Jump to content

Playerbot (archive)

Recommended Posts

Thank you for information.

Can you tell me more about : http://getmangos.eu/community/showpost.php?p=73737&postcount=7

(IsInCombat part)

I think IsInCombat is just if player is "agree" to fight against creatures (in front and deal domage),

getattackers return creatures which want to fight against player (for exemple if player run away to escape to these attackers).

Maybe AI based on this search is better... maybe I'm in wrong.

Link to comment
Share on other sites

  • Replies 1.8k
  • Created
  • Last Reply

Top Posters In This Topic

Thank you for information.

Can you tell me more about : http://getmangos.eu/community/showpost.php?p=73737&postcount=7

(IsInCombat part)

I think IsInCombat is just if player is "agree" to fight against creatures (in front and deal domage),

getattackers return creatures which want to fight against player (for exemple if player run away to escape to these attackers).

Maybe AI based on this search is better... maybe I'm in wrong.

Hi mates, had not much time doing anything else than working. But maybe I can explain some upcoming issuses.

@yad02: I added the UpdateAttackerInfo() and IsInCombat() functions to try to check for all ongoing combat and to manage all threatening hostil creatures. GetAttackers will only return creatures dealing damage to a Unit. Cause of this I changed the search to check for all creatures threatened by us. This includes also creatures not already attacking someone. And both functions check whole group for ongoing combat and attackers.

Before I miss it - a criticial todo:

1) Lately I changed combat behaviour of HunterAI and also the MovementGenerator stuff in GetCombatOrders. I tried to make i.e. Hunter (also applies to warlock, mage, etc.) to just follow a target in range of its spells. With just follow I meant to walk directly in direction of the target to a distance where spells can be casted. Using current MoveChase, or MoveFollow MovementGenerators won't do the work. Follow will follow in an angle relative to the world orientation of target. Chase will make bot follow a target in the defined angle (i.e. dist=10.0, angle=0.0 bot is 10yards north of victim). Tried to calculate the correct angle between victim und bot but sometimes it happens the bot tries to run to the opposite side of the target - and eventually threatens more creatures. Have to study my mathbooks angain, cauze using PI for angle calcs is notvery familiar to me... long time not used any real math :)

2) Combat Orders, Movement Orders: currently working on this issue. COs will be tank, protect, assist, heal, etc. MOs will be follow, near, stay. Whereby stay means stay. Even if combat goes on. Near shall make bots stay next to master (in range of i.e 10 yards). I think follow I have not to explain. Will kepp you up to date with this.

3) Finishing moves: Bot should check if target has aura which says it is under 20% of health (do not remember the aura name). Which should mean that fighters should cast finishing moves (rogue, warrior), other should care about movement rate at humanoids (prevent fleeing, calling for assistance). Who can do this?

4) Clean up spell casting code the way I did for hunter and rogue. And if possible improve it :D


Link to comment
Share on other sites

bot addin'

-added mangos_command_bot.sql for gm level toggle

-added bear(was only dire bear) & moonkin w/casting(main) druid forms

-added make sure at least 3 attackers before priest scream

-fixed/updated death knight(now summons ghoul, gargoyle & army of the dead)

-fixed hunter multi-shot(typo)

-fixed shaman & druid cast heals on corpses & group heals smarter

-rewrote warlock(added/reordered curses/spells, made casting smarter)

-small shaman update(water totem order & weapon buff)


if you have time to push this winslow that would be great

i just noticed you are keeping your branch up to date...i'll have to check it out :)

one thing i noticed is(no offense to thorazi) but if you want a "proper" Horde & Alliance grouping/trade patch use this one posted by patro http://getmangos.eu/community/showpost.php?p=71654&postcount=33

bug fixin'

sry, Runsttren, but this commit is not right http://github.com/playerbot/mangos/commit/3a98c64085d5a38066bb1f124d8d88d1e2b64553

three things i noticed after that commit

1.(major) server crash: add a bot with a pet, select the pet and use the .die command on it

2.(minor) odd bot movement: the behaviour on bot movement is not always normal

3.(minor) add bot=no teleport to you: the bot when added to the world stay were they where last only summon after follow command

i got the server crash in some different scenarios but none i could exactly recreate, i could generate them by sometimes by entering combat and next start adding all my bots(far away) or by using the .die command on the bots themselves(its not limited to the pets)...so i finally found a constant kill the bots pet! oddly enough if pet dies in normal gameplay mangos doesnt crash. to test i compiled the latest mangos with a playerbot commit before and it works fine :)

am i the only one?...anyone else get this?


everyone that contributes to playerbot ;)

Link to comment
Share on other sites

@ mightylink merging ahb and player bot works fine for me i just compiled a new one today. this is what i do

first i get the ahb

git clone git://github.com/Naicisum/mangos.git ahbot

cd ahbot

git checkout origin/ahbot

git checkout -b ahbot

git diff master ahbot > auctionhousebot.patch

then i merge with player bot

git pull git://github.com/playerbot/mangos.git

and that's it, ahb and playerbot are merged together

Link to comment
Share on other sites

added basic support for racial traits to all classes, some hunter & warrior work including racial traits :)

EDIT: removed unused races in classes & some minor changes

i.e. there is no blood elf warrior class

@LordPsyan - not true, you are most likely using a bad dual faction patch. i use this Horde & Alliance grouping/trade patch(i just updated it) the other faction bots never fight and they heal each other too :)

playerbot Horde & Alliance grouping/trade patch for rev_8892:

diff --git a/src/game/Group.cpp b/src/game/Group.cpp
index abd8ab1..f0c3687 100644
--- a/src/game/Group.cpp
+++ b/src/game/Group.cpp
@@ -348,6 +348,8 @@ uint32 Group::RemoveMember(const uint64 &guid, const uint8 &method)
    //END Playerbot mod

+    BroadcastGroupUpdate();
    // remove member and change leader (if need) only if strong more 2 members _before_ member remove
    if(GetMembersCount() > (isBGGroup() ? 1 : 2))           // in BG group case allow 1 members group
@@ -1696,3 +1698,18 @@ void Group::_homebindIfInstance(Player *player)
            player->m_InstanceValid = false;
+void Group::BroadcastGroupUpdate(void)
+    // Group Hack: force flags update on group leave - for values update hack
+    for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
+    {
+        Player *pp = sObjectMgr.GetPlayer(citr->guid);
+        if(pp && pp->IsInWorld())
+        {
+            pp->ForceValuesUpdateAtIndex(UNIT_FIELD_BYTES_2);
+            pp->ForceValuesUpdateAtIndex(UNIT_FIELD_FACTIONTEMPLATE);
+            DEBUG_LOG("-- Forced group value update for '%s'", pp->GetName());
+        }
+    }
diff --git a/src/game/Group.h b/src/game/Group.h
index 0411036..032ee03 100644
--- a/src/game/Group.h
+++ b/src/game/Group.h
@@ -337,6 +337,9 @@ class MANGOS_DLL_SPEC Group
        InstanceGroupBind* GetBoundInstance(Map* aMap);
        BoundInstancesMap& GetBoundInstances(Difficulty difficulty) { return m_boundInstances[difficulty]; }

+        //Group hack.
+        void BroadcastGroupUpdate(void);
        bool _addMember(const uint64 &guid, const char* name, bool isAssistant=false);
        bool _addMember(const uint64 &guid, const char* name, bool isAssistant, uint8 group);
diff --git a/src/game/GroupHandler.cpp b/src/game/GroupHandler.cpp
index 0c54d41..1bda13e 100644
--- a/src/game/GroupHandler.cpp
+++ b/src/game/GroupHandler.cpp
@@ -196,6 +196,7 @@ void WorldSession::HandleGroupAcceptOpcode( WorldPacket & /*recv_data*/ )
    if(!group->AddMember(GetPlayer()->GetGUID(), GetPlayer()->GetName()))

+    group->BroadcastGroupUpdate();

void WorldSession::HandleGroupDeclineOpcode( WorldPacket & /*recv_data*/ )
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 687202c..981c240 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -711,6 +711,38 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask *
                        *data << (m_uint32Values[ index ] & ~UNIT_DYNFLAG_OTHER_TAGGER);
+                // FG: pretend that OTHER players in own group are friendly ("blue")
+                else if(index == UNIT_FIELD_BYTES_2 || index == UNIT_FIELD_FACTIONTEMPLATE)
+                {
+                bool ch = false;
+                if(target->GetTypeId() == TYPEID_PLAYER && GetTypeId() == TYPEID_PLAYER && target != this)
+                {
+                    if(target->IsInSameGroupWith((Player*)this) || target->IsInSameRaidWith((Player*)this))
+                    {
+                        if(index == UNIT_FIELD_BYTES_2)
+                        {
+                            DEBUG_LOG("-- VALUES_UPDATE: Sending '%s' the blue-group-fix from '%s' (flag)", target->GetName(), ((Player*)this)->GetName());
+                            *data << ( m_uint32Values[ index ] & (UNIT_BYTE2_FLAG_SANCTUARY << 8) ); // this flag is at uint8 offset 1 !!
+                            ch = true;
+                        }
+                        else if(index == UNIT_FIELD_FACTIONTEMPLATE)
+                        {
+                            FactionTemplateEntry const *ft1, *ft2;
+                            ft1 = ((Player*)this)->getFactionTemplateEntry();
+                            ft2 = ((Player*)target)->getFactionTemplateEntry();
+                            if(ft1 && ft2 && !ft1->IsFriendlyTo(*ft2))
+                                {
+                                uint32 faction = ((Player*)target)->getFaction(); // pretend that all other HOSTILE players have own faction, to allow follow, heal, rezz (trade wont work)
+                                DEBUG_LOG("-- VALUES_UPDATE: Sending '%s' the blue-group-fix from '%s' (faction %u)", target->GetName(), ((Player*)this)->GetName(), faction);
+                                *data << uint32(faction);
+                                ch = true;
+                            }
+                        }
+                    }
+                }
+                if(!ch)
+                *data << m_uint32Values[ index ];
+                }
                    // send in current format (float as float, uint32 as uint32)
@@ -1688,6 +1720,19 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa
    return pCreature;

+void Object::ForceValuesUpdateAtIndex(uint32 i)
+    m_uint32Values_mirror[i] = GetUInt32Value(i) + 1; // makes server think the field changed
+    if(m_inWorld)
+    {
+        if(!m_objectUpdated)
+        {
+            AddToClientUpdateList();
+            m_objectUpdated = true;
+        }
+    }
namespace MaNGOS
    class NearUsedPosDo
diff --git a/src/game/Object.h b/src/game/Object.h
index 4707f47..f5edd79 100644
--- a/src/game/Object.h
+++ b/src/game/Object.h
@@ -301,6 +301,8 @@ class MANGOS_DLL_SPEC Object

        virtual bool hasQuest(uint32 /* quest_id */) const { return false; }
        virtual bool hasInvolvedQuest(uint32 /* quest_id */) const { return false; }
+        void ForceValuesUpdateAtIndex(uint32);

        Object ( );
diff --git a/src/game/TradeHandler.cpp b/src/game/TradeHandler.cpp
index 6662545..d64062c 100644
--- a/src/game/TradeHandler.cpp
+++ b/src/game/TradeHandler.cpp
@@ -532,11 +532,11 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)

-    if (pOther->GetTeam() !=_player->GetTeam() )
+    /*if (pOther->GetTeam() !=_player->GetTeam() )
-    }
+    }*/

    if (!pOther->IsWithinDistInMap(_player,10.0f,false))


Link to comment
Share on other sites

blueboy, do you plan to update your own repository?

Yes, it will be updated shortly. I know the existing code is compatible with MaNGOS [9147], just a small change to PlayerbotAI.cpp. Search for the occurance (Two occurances) of MOVEMENTFLAG_FLYING2 and change it to MOVEMENTFLAG_FLYING. The code will then compile without issue. It won't be long before I push the merge.

Oh, yes there is still one other change in ChatHandler.cpp. I have explained fully in my #510 post on this thread.


Link to comment
Share on other sites

Hi Guys,

Are any of you having issues compiling the core, after MaNGOS[9219]. I'm running linux (OpenSUSE 11.2) and the core build keeps failing, with the following error

checking for OPENSSL... ../configure: line 16209: syntax error near unexpected token `elif'
../configure: line 16209: `elif test $pkg_failed = untried; then'

My system uses openssl 0.9.8k, so I know that is correct. I have reported this issue, but would interested to know if it effects anyone else.


Is it related to this post? http://getmangos.eu/community/showthread.php?12148-[9219][patch]-Allow-configure-to-find-OpenSSL-if-pkg-config-fails

Link to comment
Share on other sites

Is it related to this post? http://getmangos.eu/community/showthread.php?12148-[9219][patch]-Allow-configure-to-find-OpenSSL-if-pkg-config-fails

Thanks, yes it is. I didn't come across that post when I was trying to sort it out. I have fixed it now, , thanks to MaNGOS support. My build script was unnecessarily complex. I was reconfiguring too much, and it was messing with the changes made in MaNGOS[9219]. Don't laugh this is what I was using up to now, it worked! You will see what I removed.

autoreconf --install --force
#automake --add-missing
#automake src/bindings/ScriptDev2/Makefile
mkdir /home/mangos/compile/mangos1/objdir
mv build.sh /home/mangos/compile/mangos1/objdir
mv debug.sh /home/mangos/compile/mangos1/objdir

Thanks for your help, how's your project going. Have you sorted out the purchase part yet? Let me know


Link to comment
Share on other sites

why are you so boring ? can't you go down of your ladder, we are not in a contest but in a community, don't make your boss, you are not, if it was, your name were VladimirMangos, Xsavior, Nofantasy ...

You have personnal problems ? about your childhood ? what was doing your father ? you lie we will talk...

Did I? I am giving you a solution but seems you don't accept it, I think it is obvious and everyone can see it in your reply. I am not saying mine is the best, I am saying if you can have a better solution we are welcome you to provide one, but just don't do a double work. You just tough and not understanding, and I was trying to explain to you there is a localization feature supported by Mangos as well as Playerbot.

i suppose with your attitude that you can't explain how mangos will do to look for FR DBC in a subfolder for the entire game, and just for bots look to EN DBC...

see...... it is not my attitude problem..... it is your attitude.

I already explained on page 14 about how playerbot support localization


so, you want the specific piece of the code in mangos where it looks for additional dbc

struct LocalData
   explicit LocalData(uint32 build) : main_build(build), availableDbcLocales(0xFFFFFFFF),checkedDbcLocaleBuilds(0) {}
   uint32 main_build;

   // bitmasks for index of fullLocaleNameList
   uint32 availableDbcLocales;
   uint32 checkedDbcLocaleBuilds;

template<class T>
inline void LoadDBC(LocalData& localeData,barGoLink& bar, StoreProblemList& errlist, DBCStorage<T>& storage, const std::string& dbc_path, const std::string& filename)
   // compatibility format and C++ structure sizes
   assert(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename));

   std::string dbc_filename = dbc_path + filename;
       for(uint8 i = 0; fullLocaleNameList[i].name; ++i)
           if (!(localeData.availableDbcLocales & (1 << i)))

           std::string dbc_dir_loc = dbc_path + fullLocaleNameList[i].name + "/";

           if (!(localeData.checkedDbcLocaleBuilds & (1 << i)))
               localeData.checkedDbcLocaleBuilds |= (1<<i);// mark as checked for speedup next checks

               uint32 build_loc = ReadDBCBuild(dbc_dir_loc,fullLocaleNameList[i].name);
               if(localeData.main_build != build_loc)
                   localeData.availableDbcLocales &= ~(1<<i);  // mark as not available for speedup next checks

                   // exist but wrong build
                   if (build_loc)
                       std::string dbc_filename_loc = dbc_path + fullLocaleNameList[i].name + "/" + filename;
                       char buf[200];
                       snprintf(buf,200," (exist, but DBC locale subdir %s have DBCs for build %u instead expected build %u, it and other DBC from subdir skipped)",fullLocaleNameList[i].name,build_loc,localeData.main_build);
                       errlist.push_back(dbc_filename_loc + buf);


           std::string dbc_filename_loc = dbc_path + fullLocaleNameList[i].name + "/" + filename;
               localeData.availableDbcLocales &= ~(1<<i);  // mark as not available for speedup next checks
       // sort problematic dbc to (1) non compatible and (2) non-existed
       FILE * f=fopen(dbc_filename.c_str(),"rb");
           char buf[100];
           snprintf(buf,100," (exist, but have %d fields instead " SIZEFMTD ") Wrong client version DBC file?",storage.GetFieldCount(),strlen(storage.GetFormat()));
           errlist.push_back(dbc_filename + buf);

If there is another set of DBC then when mangos calls LoadDBCStores() it will shift by availableDbcLocales on proper index.

index are: 0 = English; 1 = Korean; 2 = French; 3 = German; 4 = Chinese; 5 = Taiwanese; 6 = Spanish; 7 = Spanish Mexico; 8 = Russian

so your Fr DBC will settle on index 2.

Anyway, I am done, now I really quit from this project, although I already stopped updating for like few months.

Link to comment
Share on other sites

Or make 8 configs...

#    BotCostLevel1-10 (and the others)
#        Modify the costs of bots bought from vendors per level of the player, the costs are in G (Gold)
BotCostLevel1-10 = 5
BotCostLevel11-20 = 10
BotCostLevel21-30 = 20
BotCostLevel31-40 = 30
BotCostLevel41-50 = 40
BotCostLevel51-60 = 50
BotCostLevel61-70 = 60
BotCostLevel71-80 = 75

And at this thread, we've been thinking about a new option in Playerbot... BG Mode (name is quite self-explanatory), it will probably be hard to make (needs SD2 support) but you're not on your own Blueboy ;)

Link to comment
Share on other sites


I was unable to recreate the crash on my debug core (link to post containing the stuff im talking about)

But you said you had the crash earlier...can you give me more details on when it occured?

i tried, like the user that reported the crash, to go into a random instance with 9 bots.. it went fine...


Thanks for trying. I'm not really surprised you were unable to reproduce the crash, as I said in my last post they seem to be triggered randomly. I believe the crashes are caused by null values being passed as parameters to the HasAura functions (VC seems less tolerant of this than Gnu C++).

Typical case

Typical test found,

bool PlayerbotRogueAI:: DoFirstCombatManeuver(Unit *pTarget)


PlayerbotAI* ai = GetAI();

Player * m_bot = GetPlayerBot();

if( STEALTH>0 && !m_bot->HasAura( STEALTH ) && ai->CastSpell(STEALTH, *m_bot) )


if( ai->GetManager()->m_confDebugWhisper )

ai->TellMaster( "First > Stealth (%d)", STEALTH );

return false;


return false;


There is two ways to tackle this. Either rewrite the Class AIs (long term solution), to avoid null values being being passed and or include checks in the HasAura functions to trap the null values.

If the above highlighted code was rewitten to use nested if statements, you would prevent null values from being passed, but the code would be more verbose.

  if(!m_bot->HasAura( STEALTH ) && ai->CastSpell(STEALTH, *m_bot))   

Alternatively, you included traps in the HasAura functions. I have already had some limited success with spellId;

bool PlayerbotAI::HasAura(uint32 spellId, const Unit& player) const


if(spellId <= 0)

return false;

for (Unit::AuraMap::const_iterator iter = player.GetAuras().begin(); iter != player.GetAuras().end(); ++iter)


if (iter->second->GetId() == spellId)

return true;


return false;


bool PlayerbotAI::HasAura(const char* spellName) const


return HasAura(spellName, *m_bot);


bool PlayerbotAI::HasAura(const char* spellName, const Unit& player) const


uint32 spellId = getSpellId(spellName);

return (spellId) ? HasAura(spellId, player) : false;


If your interested in helping, we could try some additional checks that may help.

diff --git a/src/game/PlayerbotAI.cpp b/src/game/PlayerbotAI.cpp
index 99852ea..0c0b602 100644
--- a/src/game/PlayerbotAI.cpp
+++ b/src/game/PlayerbotAI.cpp
@@ -876,7 +876,7 @@ bool PlayerbotAI::HasAura(uint32 spellId, const Unit& player) const

bool PlayerbotAI::HasAura(const char* spellName) const
-    return HasAura(spellName, *m_bot);
+    return (spellName) ? HasAura(spellName, *m_bot) : false;

bool PlayerbotAI::HasAura(const char* spellName, const Unit& player) const

Hope this helps

Link to comment
Share on other sites

I havn't any error with ahbot...

meniacle patch here: 1_playerbot_10452

Hi KiriX,

I tried to download the patch from filebeam but my antivirus blocked it, saying 'MALICIOUS URL BLOCKED' !


I use the following bash script to create my playerbot patch,

#!/bin/bash -x

git clone git://github.com/mangos/mangos.git blueboy

cd blueboy

git fetch git://github.com/blueboy/mangos.git master:blueboy

git checkout blueboy

HASH=`git log --pretty=oneline | grep -m 1 '\\[1[0-9]\\{4\\}]' | cut -d " " -f 1`

git diff $HASH > playerbot.patch

If you want to create a patch from the portal repo, then replace all instances of blueboy with portal. You do not need to know much about git to run this script from the command line.

Please let us know

Link to comment
Share on other sites

kyle1, thx, I'll think about this... But at moment it was better that I could find for fix this problem.

UnkleNuke, afraid I don't understand you correct, but that about mmaps - I use playerbot with mmaps - it's great =) I added some (little-little) change into playerbot code for using mmaps fully =)


Sorry it's my fault. When you asked me about 'path-finding' and 'mmap' I thought you meant 'minimaps' on the client :blink: Yes I know, I should try to follow other relevant projects, but I don't have enough time. Since you and UnkleNuke mentioned mmap, I found faramir118's github and I can now see what all the buzz is about, particularly with the various utube video demos.

The improvements in the way NPCs navigate will be a definite advantage. It's visually annoying to see NPCs walking through walls and floor boards of buildings. I'm sure when they have perfected it, playerbot will also benefit.

I tried to extract a set of 'mmaps', but the extractor hangs and complains that my map files are the wrong version. Does 'mmap' work with the latest maps/vmaps ?

Building map 619:

We have 49 tiles.

maps/6192730.map is the wrong version, please extract new .map files

maps/6192830.map is the wrong version, please extract new .map files

maps/6192930.map is the wrong version, please extract new .map files

maps/6193030.map is the wrong version, please extract new .map files

maps/6193130.map is the wrong version, please extract new .map files

maps/6193230.map is the wrong version, please extract new .map files

maps/6193330.map is the wrong version, please extract new .map files

maps/6192731.map is the wrong version, please extract new .map files

maps/6192831.map is the wrong version, please extract new .map files

maps/6192931.map is the wrong version, please extract new .map files

maps/6193031.map is the wrong version, please extract new .map files

maps/6193131.map is the wrong version, please extract new .map files

maps/6193231.map is the wrong version, please extract new .map files

maps/6193331.map is the wrong version, please extract new .map files

maps/6192732.map is the wrong version, please extract new .map files

maps/6192832.map is the wrong version, please extract new .map files

maps/6192932.map is the wrong version, please extract new .map files

maps/6193032.map is the wrong version, please extract new .map files

[32,30]: Building polymesh...

I am sure everyone will be interested to see the changes you have made B)


Link to comment
Share on other sites

kyle1, I'm already wrote patch wich include talent's range bonus ;)

blueboy, you should compile new maps and vmaps extractors after you apply mmaps patch, then reextract maps and vmaps, then extract mmaps. I can give you all new extractors or use this (extracted maps, vmaps and mmaps):

mmaps: http://narod.ru/disk/24068319000/mmaps.7z.html

maps: http://narod.ru/disk/24068689000/maps.7z.html

vmaps: http://narod.ru/disk/24068436000/vmaps.7z.html

Patch for talent's range bonus:

diff --git a/src/game/playerbot/PlayerbotAI.cpp b/src/game/playerbot/PlayerbotAI.cpp
index 8b89150..86e9816 100644
--- a/src/game/playerbot/PlayerbotAI.cpp
+++ b/src/game/playerbot/PlayerbotAI.cpp
@@ -2238,12 +2238,16 @@ bool PlayerbotAI::CastSpell(uint32 spellId)
    uint64 targetGUID = m_bot->GetSelection();
    Unit* pTarget = ObjectAccessor::GetUnit(*m_bot, m_bot->GetSelection());

+    Spell* const pSpell = m_bot->FindCurrentSpellBySpellId(spellId);
    SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(pSpellInfo->rangeIndex);
-    float max_range = GetSpellMaxRange(srange, false);
+    float max_range = GetSpellMaxRange(srange, m_bot->IsFriendlyTo(pTarget));
    float dist = m_bot->GetCombatDistance(pTarget);
+    if(m_bot->GetSpellModOwner())
+        m_bot->ApplySpellMod(pSpellInfo->Id, SPELLMOD_RANGE, max_range, pSpell);
    if(dist > max_range)
-        return false;
+        return false;

    if (!m_bot->IsWithinLOSInMap(pTarget))
        return false;
@@ -2275,7 +2279,6 @@ bool PlayerbotAI::CastSpell(uint32 spellId)
    // actually cast spell
    m_bot->CastSpell(pTarget, pSpellInfo, false);

-    Spell* const pSpell = m_bot->FindCurrentSpellBySpellId(spellId);
    if (!pSpell)
        return false;

Link to comment
Share on other sites

Hi Syenet,

In order for me to troubleshoot this issue, I need some information from you?

Can you describe your system more (i.e MaNGOS version, which repo are you getting playerbot from and any other mods installed).

Can you describe your raid group (i.e 1 player and 9 bots or any other combination).

I have briefly looked at your crash dump.

004FD8E6 00000000 std::_Tree<std::_Tset_traits<Player *,std::less<Player *>,std::allocator<Player *>,0> >::_Eqrange+6

This is what currently runs on my box;

MaNGOS[11106], playerbot from https://github.com/blueboy/portal, ahbot[Naiscisum] from https://github.com/blueboy/ahbot,

Move Maps [faramir118 & Team], vellums [Lynx3d] patch.

I have searched my code for the keyword _Tset_traits and found nothing. I suspect something else is causing the crash.

EDIT: Some further thoughts on the above issue.

As a player why do you want to leave the group, whilst inside an instance? bots can not enter an instance unless they are members of the player group. If you leave this group, whilst inside the instance then the bot(s) and player(s) no longer belong in the same instance. I did a great deal of work on a similiar issue, where bot(s) and player were in the same group, separated on either side of an instance.


The 'Unknown' name issue is an annoyance that very occasionally occurs and is not caused by playerbot. I thought this issue had been resolved in the core as I have not seen it for a long time. A dirty fix for this is to logout, delete your client cache, and then login again. If it occurs regularly on your server, try building the server without playerbot to check this out (In the past, summoned creatures for Warlocks and Hunters have had 'Unknown' names).


Please get back to me

Link to comment
Share on other sites

I do not believe you can safely change the format of a raid group, while inside the instance.

Yes, but I have no choice but to leave the instance and reform the group. I said I can entirely close the client to resolve the 'Unknown' issue, but I want to find another more convenient way to fix it, and try to find out the reason to fix it in the code. So I tried reforming the group, but always fatality. Since you questioned, I also think it might be a cache issue, so I'm not sure if it's fixable in your code.


I agree that this issue needs to be addressed, but I do not think it is caused by playerbot. Did you get chance to look at the link I gave in my previous post. I believe the pet name issue is linked to the issue your having


ilkham wrote:

Pet names are correctly shown in the DB table, but when loggin into game "most" pets display as "Unknown" as well as the pet action bar not being there until you mount and dismount again. I type /reload to get the pet's name to display again. Zoning however, removes it and changes back to "Unknown" once again.

You might try /reload (or /console reloadui) next time this issue occurs on your system. It may work and avoid the need for you to leave the raid group and exit the instance.

Hope this helps

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use