Jump to content

Playerbot (archive)


Recommended Posts

  • Replies 1.8k
  • Created
  • Last Reply

Top Posters In This Topic

Hi Guys

As promised here is the survey patch

diff --git a/src/game/PlayerbotAI.cpp b/src/game/PlayerbotAI.cpp
index 507d183..e097a16 100644
--- a/src/game/PlayerbotAI.cpp
+++ b/src/game/PlayerbotAI.cpp
@@ -2229,6 +2229,76 @@ void PlayerbotAI::extractItemIds(const std::string& text, std::list<uint32>& ite
    }
}

+void PlayerbotAI::extractGOinfo(const std::string& text, uint32 &guid, uint32 &entry, int &mapid, float &x, float &y, float &z) const
+{
+
+     //    Link format
+     //    |cFFFFFF00|Hfound:" << guid << ':'  << entry << ':' << x << ':' << y << ':' << z  << ':' << mapid << ':' <<  "|h[" << gInfo->name << "]|h|r";
+     //    |cFFFFFF00|Hfound:5093:1731:-9295:-270:81.874:0:|h[Copper Vein]|h|r
+
+    sLog.outDebug("extractGOinfo: text = %s",text.c_str());
+    uint8 pos = 0;
+    while (true)
+    {
+        // extract GO guid
+        int i = text.find("Hfound:", pos); // base H = 11
+        if (i == -1) // break if error
+            break;
+        pos = i + 7; //start of window in text 11 + 7 = 18
+        int endPos = text.find(':', pos); // end of window in text 22
+        if (endPos == -1) //break if error
+            break;
+        std::string guidC = text.substr(pos, endPos - pos); // get string within window i.e guid 22 - 18 =  4
+        uint32 guid = atol(guidC.c_str()); // convert ascii to long int
+
+    // extract GO entry
+    pos = endPos + 1;
+        endPos = text.find(':', pos); // end of window in text
+        if (endPos == -1) //break if error
+            break;
+
+    std::string entryC = text.substr(pos, endPos - pos); // get string within window i.e entry
+        entry = atol(entryC.c_str()); // convert ascii to float
+
+    // extract GO x
+    pos = endPos + 1;
+        endPos = text.find(':', pos); // end of window in text
+        if (endPos == -1) //break if error
+            break;
+
+    std::string xC = text.substr(pos, endPos - pos); // get string within window i.e x
+        x = atof(xC.c_str()); // convert ascii to float
+
+        // extract GO y
+    pos = endPos + 1;
+        endPos = text.find(':', pos); // end of window in text
+        if (endPos == -1) //break if error
+            break;
+
+    std::string yC = text.substr(pos, endPos - pos); // get string within window i.e y
+        y = atof(yC.c_str()); // convert ascii to float
+
+        // extract GO z
+    pos = endPos + 1;
+        endPos = text.find(':', pos); // end of window in text
+        if (endPos == -1) //break if error
+            break;
+
+    std::string zC = text.substr(pos, endPos - pos); // get string within window i.e z
+        z = atof(zC.c_str()); // convert ascii to float
+
+    //extract GO mapid
+    pos = endPos + 1;
+        endPos = text.find(':', pos); // end of window in text
+        if (endPos == -1) //break if error
+            break;
+
+    std::string mapidC = text.substr(pos, endPos - pos); // get string within window i.e mapid
+        mapid = atoi(mapidC.c_str()); // convert ascii to int
+        pos = endPos; // end
+    }
+}
+
// extracts currency in #g#s#c format
uint32 PlayerbotAI::extractMoney(const std::string& text) const
{
@@ -2675,6 +2745,19 @@ void PlayerbotAI::HandleCommand(const std::string& text, Player& fromPlayer)
        for (std::list<Item*>::iterator it = itemList.begin(); it != itemList.end(); ++it)
            EquipItem(**it);
    }
+
+    // find item in world
+     else if (text.size() > 2 && text.substr(0, 2) == "f " || text.size() > 5 && text.substr(0, 5) == "find ")
+    {
+        uint32 guid;
+        float x,y,z;
+    uint32 entry;
+    int mapid;
+    extractGOinfo(text, guid, entry, mapid, x, y, z);
+        // sLog.outDebug("find: guid : %u entry : %u x : (%f) y : (%f) z : (%f) mapid : %d",guid, entry, x, y, z, mapid);
+    SetMovementOrder( MOVEMENT_STAY );
+    m_bot->GetMotionMaster()->MovePoint( mapid, x, y, z );
+    }

    else if (text == "quests")
    {
@@ -2801,9 +2884,45 @@ void PlayerbotAI::HandleCommand(const std::string& text, Player& fromPlayer)
     ChatHandler ch(&fromPlayer);
         SendWhisper("I have this much space ", fromPlayer);
         ch.SendSysMessage(out.str().c_str());
-    }
-    
-    
+    }
+    // Survey project: 09:50 09/03/10
+    else if (text == "survey")
+    {
+      float distance = 100.0f;
+      uint32 count = 0;
+      std::ostringstream detectout;
+
+      QueryResult *result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, map, "
+        "(POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ "
+        "FROM gameobject WHERE map='%u' AND (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) <= '%f' ORDER BY order_",
+         m_bot->GetPositionX(), m_bot->GetPositionY(), m_bot->GetPositionZ(),
+         m_bot->GetMapId(), m_bot->GetPositionX(), m_bot->GetPositionY(), m_bot->GetPositionZ(), distance*distance);
+
+      if (result)
+      {
+         do
+         {
+             Field *fields = result->Fetch();
+             uint32 guid = fields[0].GetUInt32();
+             uint32 entry = fields[1].GetUInt32();
+             float x = fields[2].GetFloat();
+             float y = fields[3].GetFloat();
+             float z = fields[4].GetFloat();
+             int mapid = fields[5].GetUInt16();
+
+             GameObjectInfo const * gInfo = ObjectMgr::GetGameObjectInfo(entry);
+
+             if(!gInfo)
+                 continue;
+
+             detectout << "|cFFFFFF00|Hfound:" << guid << ":" << entry << ":" << x << ":" << y << ":" << z  << ":" << mapid  << ":" <<  "|h[" << gInfo->name << "]|h|r";
+         ++count;
+         } while (result->NextRow());
+
+         delete result;
+      }
+       SendWhisper(detectout.str().c_str(), fromPlayer);
+    }
    else
    {
        // if this looks like an item link, reward item it completed quest and talking to NPC
diff --git a/src/game/PlayerbotAI.h b/src/game/PlayerbotAI.h
index 2045ac2..105066e 100644
--- a/src/game/PlayerbotAI.h
+++ b/src/game/PlayerbotAI.h
@@ -126,6 +126,9 @@ class MANGOS_DLL_SPEC PlayerbotAI
        // extracts item ids from links
        void extractItemIds(const std::string& text, std::list<uint32>& itemIds) const;

+        // extracts gameobject info from link
+    void extractGOinfo(const std::string& text, uint32 &guid,  uint32 &entry, int &mapid, float &x, float &y, float &z) const;
+
        // extracts currency from a string as #g#s#c and returns the total in copper
        uint32 extractMoney(const std::string& text) const;

The present patch finds all gameobjects within the local, regardless of level and event restrictions or existance on the map. It would be sensible to filter items that have no immediate relevance. An perfect example while testing, 'Brightly Colored Eggs' were detected in Elwynn Forest. These appear during Noblegarden, the ingame holiday which takes place for about 24 hours usually on Easter Sunday. At any other time, their detection is irrelevant.

Also it might be an idea to limit the number of objects displayed. The Darkmoon Faire is in Elwynn Forest at present, and there were too many objects to handle in one location, when I did a survey.

The find command will direct the bot(s) to travel to the objects location, and then wait for further instructions. This could be useful in securing the item, without endangering the player. If the bot(s) encounter hostiles either in transit or at the location, they will fight. The location of the bot(s) will show up on the minimap, so you can also travel to the location even thought the bot(s) might not be in Line of Sight.

I gave information on how to use the survey and find commands in post #884

Overview

The first stage is to interrogate the database for all gameobjects based upon distance from a specified player or bot. The recovered data is then loaded into 'link' strings. All instances are then passed to the client.

[botname]whispers: [Peachbloom][iron Vein][Chair][Water Barrel][Chest] etc...

The user then decides on the next action. For instance, lets find a particular object. Hold down the shift key and click on the link. This then copies the link to the dialog bar. extractGOinfo function recovers all gameobject data from the 'link' string, that is used by the find command to MovePoint the bot to the object location.

/w botname find [iron Vein]

I would be grateful if you could give me feedback good or bad, and any ideas.

Cheers

Link to comment
Share on other sites

hope will help


Revision: * * 9565 09969c4c6d0a68ca429d61effd1abc365d02451d
Date 10:3:2010. Time 21:48 
//=====================================================
*** Hardware ***
Processor: Intel(R) Core(TM) i7 CPU         920  @ 2.67GHz
Number Of Processors: 8
Physical Memory: 12573784 KB (Available: 5252760 KB)
Commit Charge Limit: 25145672 KB

*** Operation System ***
Windows Vista or Windows Server 2008 Server 4.0, Enterprise Edition (Version 6.1, Build 7600)

//=====================================================
Exception code: C0000005 ACCESS_VIOLATION
Fault address:  00000001404E09DD 01:00000000004DF9DD C:\\users_sys\\games\\WoW\\Mangos\\server\\mangosd.exe

Registers:
RAX:0000000000000000
RBX:0000000006BA8CF0
RCX:000007FFE9A25EC0
RDX:000000000000004B
RSI:000007FFE9A84BD0
RDI:0000000140306590
R8: 000007FFE9964000
R9: 8000000000000000
R10:000000000E3D7648
R11:0000000000000000
R12:0000000000000000
R13:0000000000000000
R14:0000000000000000
R15:000000000E3D92C0
CS:RIP:0033:00000001404E09DD
SS:RSP:002B:000000000E3D9880  RBP:00000000
DS:002B  ES:002B  FS:0053  GS:002B
Flags:00010202

Call stack:
Address   Frame     Function      SourceFile
00000001404E09DD  000000000E3D9900  PlayerbotAI::HasAura+1D  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 866
00000001404E6218  000000000E3D9A00  PlayerbotAI::CastSpell+208  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 2126
00000001404E5FA8  000000000E3DAA90  PlayerbotAI::CastSpell+B8  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 2080
0000000140642BB8  000000000E3F0170  PlayerbotHunterAI::DoNextCombatManeuver+5C8  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbothunterai.cpp line 173
00000001404E23B2  000000000E3F0200  PlayerbotAI::DoNextCombatManeuver+282  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 1320
00000001404E5ACD  000000000E3F23D0  PlayerbotAI::UpdateAI+77D  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 2008
000000014015A993  000000000E3FF7D0  Player::Update+11F3  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\player.cpp line 1406
000000014012609E  000000000E3FFB60  Map::Update+19E  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\map.cpp line 594
000000014036636F  000000000E3FFC50  MapManager::Update+19F  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\mapmanager.cpp line 266
00000001402E0933  000000000E3FFE00  World::Update+733  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\world.cpp line 1412
000000014006ABB5  000000000E3FFE40  WorldRunnable::run+A5  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\mangosd\\worldrunnable.cpp line 61
00000001403065B3  000000000E3FFEB0  ACE_Based::Thread::ThreadTask+23  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 190
000007FEF64B170B  000000000E3FFEF0  ?invoke@ACE_OS_Thread_Adapter@@UEAAKXZ+5B
0000000072BA2FDF  000000000E3FFF20  _endthreadex+47
0000000072BA3080  000000000E3FFF50  _endthreadex+E8
00000000771CF56D  000000000E3FFF80  BaseThreadInitThunk+D
0000000077403281  000000000E3FFFD0  RtlUserThreadStart+21

Call stack:
Address   Frame     Function      SourceFile
000000007741FEFA  000000000042F990  NtWaitForSingleObject+A
000007FEFD5B10AC  000000000042FA30  WaitForSingleObjectEx+9C
000007FEF645B64A  000000000042FA60  ?thr_join@ACE_OS@@YAHPEAXPEAK@Z+2A
000007FEF64DE8E3  000000000042FAE0  ?wait_task@ACE_Thread_Manager@@QEAAHPEAVACE_Task_Base@@@Z+243
0000000140308013  000000000042FB20  WorldSocketMgr::Wait+63  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\worldsocketmgr.cpp line 313
000000014003A158  000000000042FEE0  Master::Run+9B8  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\mangosd\\master.cpp line 325
0000000140038B9D  000000000042FF20  main+42D  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\mangosd\\main.cpp line 180
000000014006B692  000000000042FF50  __tmainCRTStartup+11A  f:\\dd\\vctools\\crt_bld\\self_64_amd64\\crt\\src\\crtexe.c line 582
00000000771CF56D  000000000042FF80  BaseThreadInitThunk+D
0000000077403281  000000000042FFD0  RtlUserThreadStart+21

Call stack:
Address   Frame     Function      SourceFile
000000007742046A  00000000032FFCB0  ZwWaitForMultipleObjects+A
00000000773E9BD7  00000000032FFF50  EtwTraceMessageVa+E07
00000000771CF56D  00000000032FFF80  BaseThreadInitThunk+D
0000000077403281  00000000032FFFD0  RtlUserThreadStart+21

Call stack:
Address   Frame     Function      SourceFile
00000000774201FA  00000000036FFC60  NtDelayExecution+A
000007FEFD5B1203  00000000036FFD00  SleepEx+B3
0000000140306819  00000000036FFD50  ACE_Based::Thread::Sleep+39  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 238
00000001405E5E1F  00000000036FFE40  SqlDelayThread::run+6F  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\database\\sqldelaythread.cpp line 45
00000001403065B3  00000000036FFEB0  ACE_Based::Thread::ThreadTask+23  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 190
000007FEF64B170B  00000000036FFEF0  ?invoke@ACE_OS_Thread_Adapter@@UEAAKXZ+5B
0000000072BA2FDF  00000000036FFF20  _endthreadex+47
0000000072BA3080  00000000036FFF50  _endthreadex+E8
00000000771CF56D  00000000036FFF80  BaseThreadInitThunk+D
0000000077403281  00000000036FFFD0  RtlUserThreadStart+21

Call stack:
Address   Frame     Function      SourceFile
00000000774201FA  0000000003AFFC60  NtDelayExecution+A
000007FEFD5B1203  0000000003AFFD00  SleepEx+B3
0000000140306819  0000000003AFFD50  ACE_Based::Thread::Sleep+39  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 238
00000001405E5E1F  0000000003AFFE40  SqlDelayThread::run+6F  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\database\\sqldelaythread.cpp line 45
00000001403065B3  0000000003AFFEB0  ACE_Based::Thread::ThreadTask+23  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 190
000007FEF64B170B  0000000003AFFEF0  ?invoke@ACE_OS_Thread_Adapter@@UEAAKXZ+5B
0000000072BA2FDF  0000000003AFFF20  _endthreadex+47
0000000072BA3080  0000000003AFFF50  _endthreadex+E8
00000000771CF56D  0000000003AFFF80  BaseThreadInitThunk+D
0000000077403281  0000000003AFFFD0  RtlUserThreadStart+21

Call stack:
Address   Frame     Function      SourceFile
00000000774201FA  0000000003EFFC60  NtDelayExecution+A
000007FEFD5B1203  0000000003EFFD00  SleepEx+B3
0000000140306819  0000000003EFFD50  ACE_Based::Thread::Sleep+39  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 238
00000001405E5E1F  0000000003EFFE40  SqlDelayThread::run+6F  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\database\\sqldelaythread.cpp line 45
00000001403065B3  0000000003EFFEB0  ACE_Based::Thread::ThreadTask+23  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 190
000007FEF64B170B  0000000003EFFEF0  ?invoke@ACE_OS_Thread_Adapter@@UEAAKXZ+5B
0000000072BA2FDF  0000000003EFFF20  _endthreadex+47
0000000072BA3080  0000000003EFFF50  _endthreadex+E8
00000000771CF56D  0000000003EFFF80  BaseThreadInitThunk+D
0000000077403281  0000000003EFFFD0  RtlUserThreadStart+21

Call stack:
Address   Frame     Function      SourceFile
0000000077420B8A  000000000E3D7190  ZwGetContextThread+A
00000000771B44FA  000000000E3D71C0  GetThreadContext+A
0000000140069459  000000000E3D7700  WheatyExceptionReport::PrintTracesForAllThreads+C9  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\wheatyexceptionreport.cpp line 370
0000000140069826  000000000E3D8770  WheatyExceptionReport::GenerateExceptionReport+396  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\wheatyexceptionreport.cpp line 468
0000000140068ABA  000000000E3D8A20  WheatyExceptionReport::WheatyUnhandledExceptionFilter+18A  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\wheatyexceptionreport.cpp line 109
0000000077249380  000000000E3D8B00  UnhandledExceptionFilter+160
000000007746573C  000000000E3D8B30  MD5Final+1DEC
00000000773E5148  000000000E3D8BA0  __C_specific_handler+9C
000000007740554D  000000000E3D8BD0  RtlCompareUnicodeString+7D
00000000773E5D1C  000000000E3D92B0  RtlTimeToSecondsSince1970+62C
000000007741FE48  000000000E3D9870  KiUserExceptionDispatcher+2E
00000001404E09DD  000000000E3D9900  PlayerbotAI::HasAura+1D  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 866
00000001404E6218  000000000E3D9A00  PlayerbotAI::CastSpell+208  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 2126
00000001404E5FA8  000000000E3DAA90  PlayerbotAI::CastSpell+B8  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 2080
0000000140642BB8  000000000E3F0170  PlayerbotHunterAI::DoNextCombatManeuver+5C8  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbothunterai.cpp line 173
00000001404E23B2  000000000E3F0200  PlayerbotAI::DoNextCombatManeuver+282  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 1320
00000001404E5ACD  000000000E3F23D0  PlayerbotAI::UpdateAI+77D  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 2008
000000014015A993  000000000E3FF7D0  Player::Update+11F3  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\player.cpp line 1406
000000014012609E  000000000E3FFB60  Map::Update+19E  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\map.cpp line 594
000000014036636F  000000000E3FFC50  MapManager::Update+19F  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\mapmanager.cpp line 266
00000001402E0933  000000000E3FFE00  World::Update+733  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\world.cpp line 1412
000000014006ABB5  000000000E3FFE40  WorldRunnable::run+A5  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\mangosd\\worldrunnable.cpp line 61
00000001403065B3  000000000E3FFEB0  ACE_Based::Thread::ThreadTask+23  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 190
000007FEF64B170B  000000000E3FFEF0  ?invoke@ACE_OS_Thread_Adapter@@UEAAKXZ+5B
0000000072BA2FDF  000000000E3FFF20  _endthreadex+47
0000000072BA3080  000000000E3FFF50  _endthreadex+E8
00000000771CF56D  000000000E3FFF80  BaseThreadInitThunk+D
0000000077403281  000000000E3FFFD0  RtlUserThreadStart+21

Call stack:
Address   Frame     Function      SourceFile
00000000774200DA  000000000E7FF7C0  ZwRequestWaitReplyPort+A
00000000771D2B08  000000000E7FF7F0  GetConsoleMode+F8
0000000077205601  000000000E7FF940  VerifyConsoleIoHandle+281
000000007721A922  000000000E7FFA20  ReadConsoleA+B2
00000000771E9934  000000000E7FFA60  GetEnvironmentStringsA+5AB8
0000000072BEDC36  000000000E7FFB00  realloc+72A
0000000072BEE29D  000000000E7FFB60  _read+10D
0000000072BAE7E3  000000000E7FFBA0  _filbuf+8F
0000000072BADC6C  000000000E7FFC10  fgets+198
0000000140013F79  000000000E7FFE40  CliRunnable::run+B9  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\mangosd\\clirunnable.cpp line 327
00000001403065B3  000000000E7FFEB0  ACE_Based::Thread::ThreadTask+23  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 190
000007FEF64B170B  000000000E7FFEF0  ?invoke@ACE_OS_Thread_Adapter@@UEAAKXZ+5B
0000000072BA2FDF  000000000E7FFF20  _endthreadex+47
0000000072BA3080  000000000E7FFF50  _endthreadex+E8
00000000771CF56D  000000000E7FFF80  BaseThreadInitThunk+D
0000000077403281  000000000E7FFFD0  RtlUserThreadStart+21

Call stack:
Address   Frame     Function      SourceFile
000000007741FEFA  000000000EBFF880  NtWaitForSingleObject+A
000007FEFCB43978  000000000EBFF900  0001:0000000000002978 C:\\Windows\\system32\\MSWSOCK.dll
000007FEFCB506B6  000000000EBFFAA0  WSPStartup+7CD6
000007FEFF2572BC  000000000EBFFAE0  select+15C
000007FEFF25723D  000000000EBFFBE0  select+DD
000007FEF6468252  000000000EBFFC60  ?wait_for_multiple_events@?$ACE_Select_Reactor_T@V?$ACE_Reactor_Token_T@VACE_Token@@@@@@MEAAHAEAVACE_Select_Reactor_Handle_Set@@PEAVACE_Time_Value@@@Z+132
000007FEF64E0DC0  000000000EBFFCD0  ?handle_events@ACE_TP_Reactor@@UEAAHPEAVACE_Time_Value@@@Z+A0
000007FEF64BE55D  000000000EBFFD00  ?run_reactor_event_loop@ACE_Reactor@@QEAAHAEAVACE_Time_Value@@P6AHPEAV1@@Z@Z+4D
0000000140307977  000000000EBFFE40  ReactorRunnable::svc+77  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\worldsocketmgr.cpp line 167
000007FEF64DA171  000000000EBFFE70  ?svc_run@ACE_Task_Base@@SAKPEAX@Z+41
000007FEF64DA72B  000000000EBFFEB0  ?invoke_i@ACE_Thread_Adapter@@EEAAKXZ+4B
000007FEF64DA851  000000000EBFFEF0  ?invoke@ACE_Thread_Adapter@@UEAAKXZ+71
0000000072BA2FDF  000000000EBFFF20  _endthreadex+47
0000000072BA3080  000000000EBFFF50  _endthreadex+E8
00000000771CF56D  000000000EBFFF80  BaseThreadInitThunk+D
0000000077403281  000000000EBFFFD0  RtlUserThreadStart+21

Call stack:
Address   Frame     Function      SourceFile
000000007741FEFA  000000000EFFF880  NtWaitForSingleObject+A
000007FEFCB43978  000000000EFFF900  0001:0000000000002978 C:\\Windows\\system32\\MSWSOCK.dll
000007FEFCB506B6  000000000EFFFAA0  WSPStartup+7CD6
000007FEFF2572BC  000000000EFFFAE0  select+15C
000007FEFF25723D  000000000EFFFBE0  select+DD
000007FEF6468252  000000000EFFFC60  ?wait_for_multiple_events@?$ACE_Select_Reactor_T@V?$ACE_Reactor_Token_T@VACE_Token@@@@@@MEAAHAEAVACE_Select_Reactor_Handle_Set@@PEAVACE_Time_Value@@@Z+132
000007FEF64E0DC0  000000000EFFFCD0  ?handle_events@ACE_TP_Reactor@@UEAAHPEAVACE_Time_Value@@@Z+A0
000007FEF64BE55D  000000000EFFFD00  ?run_reactor_event_loop@ACE_Reactor@@QEAAHAEAVACE_Time_Value@@P6AHPEAV1@@Z@Z+4D
0000000140307977  000000000EFFFE40  ReactorRunnable::svc+77  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\worldsocketmgr.cpp line 167
000007FEF64DA171  000000000EFFFE70  ?svc_run@ACE_Task_Base@@SAKPEAX@Z+41
000007FEF64DA72B  000000000EFFFEB0  ?invoke_i@ACE_Thread_Adapter@@EEAAKXZ+4B
000007FEF64DA851  000000000EFFFEF0  ?invoke@ACE_Thread_Adapter@@UEAAKXZ+71
0000000072BA2FDF  000000000EFFFF20  _endthreadex+47
0000000072BA3080  000000000EFFFF50  _endthreadex+E8
00000000771CF56D  000000000EFFFF80  BaseThreadInitThunk+D
0000000077403281  000000000EFFFFD0  RtlUserThreadStart+21
========================
Local Variables And Parameters

Call stack:
Address   Frame     Function      SourceFile
00000001404E09DD  000000000E3D9900  PlayerbotAI::HasAura+1D  c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 866


Link to comment
Share on other sites

Hi mrelfire,

I think I have a solution for you. Around MaNGOS[9415] they were making changes with SpellEffectIndex, and they changed the type definition spellEffectPair in Unit.h;

@@ -951,7 +951,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
{     public:
        typedef std::set<Unit*> AttackerSet;
-        typedef std::Pair<uint32, uint8> spellEffectPair;
+        typedef std::Pair<uint32, SpellEffectIndex> spellEffectPair;
        typedef std::multimap< spellEffectPair, Aura*> AuraMap;
        typedef std::list<Aura *> AuraList;
        typedef std::list<DiminishingReturn> Diminishing;
@@ -1168,7 +1168,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject0 

Now in PlayerbotAI.cpp for function HasAura;

//typedef std::Pair<uint32, uint8> spellEffectPair;
//typedef std::multimap<spellEffectPair, Aura*> AuraMap;

bool PlayerbotAI::HasAura(uint32 spellId, const Unit& player) const
{
   for (Unit::AuraMap::const_iterator iter = player.GetAuras().begin(); iter != player.GetAuras().end(); ++iter)
   {
       if (iter->second->GetId() == spellId)
           return true;
   }
   return false;
}

Your crash dump points to an access violation in PlayerbotAI.cpp @ line 866 in HasAura, as it tries to access AuraMap. I believe that both of the type definitions are redundant, and that of spellEffectPair contradicts the changes made above. I have succesfully compiled, with both typedefs commented out. I believe this should solve your crash.

If it works I will remove these typedefs, next time I update blueboy. Please let me know.

Hope this helps

Link to comment
Share on other sites

Suggestion number 3

Raid:

1/ tele doesn't work when you are in raid party, and the bots of your firends cry all the time

=> perhaps you should remove this limitation or check of the teleport function when you are a bot

2/ entering a raid dungeon

all the bots of your friends are stuck outside

=> it is link to point 1

Link to comment
Share on other sites

Suggestion number 3

Raid:

1/ tele doesn't work when you are in raid party, and the bots of your firends cry all the time

=> perhaps you should remove this limitation or check of the teleport function when you are a bot

2/ entering a raid dungeon

all the bots of your friends are stuck outside

=> it is link to point 1

Hi,

Thanks for the info I will certainly look into this. Interestingly in post #522 from WOLFMAN I had a similar issue to your second point. He had a situation where he could enter the gates of Moltencore, but his bot raid party would not follow (i.e teleport). It turned out that there was a quest requirement that needed to be completed before they could enter. If this is the location, do not look at #522, as I provide the solution and it might spoil your fun. Please let me know.

Cheers

Link to comment
Share on other sites

Hi,

Thanks for the info I will certainly look into this. Interestingly in post #522 from WOLFMAN I had a similar issue to your second point. He had a situation where he could enter the gates of Moltencore, but his bot raid party would not follow (i.e teleport). It turned out that there was a quest requirement that needed to be completed before they could enter. If this is the location, do not look at #522, as I provide the solution and it might spoil your fun. Please let me know.

Cheers

I have tested in all ulduar Dungeons: the bots with me were ok, and can enter, but only the raid master can teleport every all bots inside the dungeons

Link to comment
Share on other sites

suggestion number 4

Mage (cold tree)

1/ he always attack with it is lower spells

2/ and between spells, he attacks with its "hand weapon" (quite dangerous for a mage :) )

=> I do not know any official games rules for a mage, and it depends about your tree selection, but I guess, regarding your attack level, you are allowed to attack with high level spells, and only in worst case scenario you attack with your hand weapon

Link to comment
Share on other sites

suggestion number 4

Mage (cold tree)

1/ he always attack with it is lower spells

2/ and between spells, he attacks with its "hand weapon" (quite dangerous for a mage :) )

=> I do not know any official games rules for a mage, and it depends about your tree selection, but I guess, regarding your attack level, you are allowed to attack with high level spells, and only in worst case scenario you attack with your hand weapon

Hi,

I do not have much time for game play : ( , so bear with me. The default attacked stance for mage bots is 'ranged'. However if the bot is close to the hostile and or has low mana, it may well switch the mellee attack.

I have looked at the 'DoNextCombatManeuver' function in PlayerbotMageAI.cpp and the spells tend to be processed sequentially. Let me explain, Initially the default choice is SpellSequence = SPELL_FROST. Under, SPELL_FROST option there is a list of frost spells. The mage will cast the first spell it can. It is then instructed to choose SpellSequence = SPELL_FIRE and casts the first fire spell it can, and so forth until it cycles back to SpellSequence = SPELL_FROST.

If you are unhappy with the ordering of spells, then change it (i.e move a favourite spell further up the list) ;)

I would place the most mana costly spells at the top of the list and then place them in decreasing order. That way, there is more chance of a more powerfull spell being cast.

Hope this helps

Link to comment
Share on other sites

Hi,

I do not have much time for game play : ( , so bear with me. The default attacked stance for mage bots is 'ranged'. However if the bot is close to the hostile and or has low mana, it may well switch the mellee attack.

I have looked at the 'DoNextCombatManeuver' function in PlayerbotMageAI.cpp and the spells tend to be processed sequentially. Let me explain, Initially the default choice is SpellSequence = SPELL_FROST. Under, SPELL_FROST option there is a list of frost spells. The mage will cast the first spell it can. It is then instructed to choose SpellSequence = SPELL_FIRE and casts the first fire spell it can, and so forth until it cycles back to SpellSequence = SPELL_FROST.

If you are unhappy with the ordering of spells, then change it (i.e move a favourite spell further up the list) ;)

I would place the most mana costly spells at the top of the list and then place them in decreasing order. That way, there is more chance of a more powerfull spell being cast.

Hope this helps

Wonderfull list !!!

So my next suggestion( :) ) is :

- can we outsourced this spell list inside a sql table, which is linked to each bot

- if you have no lines for a bot, you take the default (your list for example)

- if you found lines for the specific bot, you take them

with that we can tune each bot if we want with different play

what do you think ?

Link to comment
Share on other sites

i forgot to mention that the idea with implementing spells for bots in sql is very handy.... compiling the core over and over takes a lot of time compared with inserting some new values into sql..

sorry mrelfire for being rushy with the dectection thing ... i was 2 intrested in it lol

Link to comment
Share on other sites

i forgot to mention that the idea with implementing spells for bots in sql is very handy.... compiling the core over and over takes a lot of time compared with inserting some new values into sql..

I wasn't aware of the difficulty, I am like at christmas and looking for the christmas present

sorry mrelfire for being rushy with the dectection thing ... i was 2 intrested in it lol

don't worry, it is just fun

Link to comment
Share on other sites

Hi, I just downloaded this patch. However, it seems it is terribly outdated (as in, lots of merge conflicts, using ints where enums should be, method names that have changed, etc...). As it's still actively developed, I'm quite sure I've done something wrong and/or downloaded a wrong revision. I'm using MaNGOS revision 9502. Can someone confirm this is still the correct source? git://github.com/playerbot/mangos.git

- SeySayux

Link to comment
Share on other sites

Just a quick update to help troubleshoot some of the crashes, per post #892 I've updated w/ this patch (commented the typedefs) to Revision 9518, sd2 1627 w/ the following log:

Revision: * * 9518 7ad3aeecc84b474dd52ed90e65414bfeecefea76
Date 10:3:2010. Time 21:34 
//=====================================================
*** Hardware ***
Processor: Intel(R) Pentium(R) 4 CPU 3.00GHz
Number Of Processors: 1
Physical Memory: 1047532 KB (Available: 105532 KB)
Commit Charge Limit: 2520240 KB

*** Operation System ***
Microsoft Windows XP Professional Service Pack 3 (Version 5.1, Build 2600)

//=====================================================
Exception code: C0000005 ACCESS_VIOLATION
Fault address:  007AA0FC 01:003A90FC C:\\mangos\\mangosd.exe

Registers:
EAX:00000000
EBX:7F524158
ECX:7F467A60
EDX:00009729
ESI:00000000
EDI:008F50B0
CS:EIP:001B:007AA0FC
SS:ESP:0023:07E3F244  EBP:07E3F274
DS:0023  ES:0023  FS:003B  GS:0000
Flags:00010206

Call stack:
Address   Frame     Function      SourceFile
007AA0FC  00000000  PlayerbotAI::HasAura+C
007AE9CB  00000000  PlayerbotAI::CastSpell+17B
007AE7F4  00000000  PlayerbotAI::CastSpell+A4
008A7BCD  00000000  PlayerbotMageAI::DoNextCombatManeuver+27D
007AB64A  00000000  PlayerbotAI::DoNextCombatManeuver+1CA
007AE3D1  00000000  PlayerbotAI::UpdateAI+641
0050784F  00000000  Player::Update+F0F
004DF3BA  00000000  Map::Update+CA
006904B8  00000000  MapManager::Update+128
00630FD0  00000000  World::Update+780
004527FE  00000000  WorldRunnable::run+8E
008F50C9  00000000  ACE_Based::Thread::ThreadTask+19
002A1B84  00000000  __WSAFDIsSet+FFFFFFFFFFFCCB4C
78543433  00000000  _endthreadex+44
785434C7  00000000  _endthreadex+D8
7C80B729  00000000  GetModuleFileNameA+1BA

Call stack:
Address   Frame     Function      SourceFile
7C90E514  00000000  KiFastSystemCallRet+0
7C802542  00000000  WaitForSingleObject+12
00259C04  00000000  __WSAFDIsSet+FFFFFFFFFFF84BCC
002C64AA  00000000  __WSAFDIsSet+FFFFFFFFFFFF1472
002C266F  00000000  __WSAFDIsSet+FFFFFFFFFFFED637
0064913A  00000000  WorldSocketMgr::Wait+4A
77B8D804  00000000  0000:00000000 
77B8D804  00000000  0000:00000000 
6C696146  00000000

Link to comment
Share on other sites

Hi, I just downloaded this patch. However, it seems it is terribly outdated (as in, lots of merge conflicts, using ints where enums should be, method names that have changed, etc...). As it's still actively developed, I'm quite sure I've done something wrong and/or downloaded a wrong revision. I'm using MaNGOS revision 9502. Can someone confirm this is still the correct source? git://github.com/playerbot/mangos.git

- SeySayux

it is not outdated , some lines changed probably to rev 9571 and that is why you have a lot of conflicts ... suggest updating to the newest rev.

It works fine

Link to comment
Share on other sites

Hi, I just downloaded this patch. However, it seems it is terribly outdated (as in, lots of merge conflicts, using ints where enums should be, method names that have changed, etc...). As it's still actively developed, I'm quite sure I've done something wrong and/or downloaded a wrong revision. I'm using MaNGOS revision 9502. Can someone confirm this is still the correct source? git://github.com/playerbot/mangos.git

- SeySayux

Hi,

Your using the wrong repository. We have been using git://github.com/blueboy/mangos.git since December last yesr. I have just updated it the be compatible with the latest MaNGOS[9573]

Hope this helps

Link to comment
Share on other sites

Hi Bramm,

So you commented out the two typedefs in PlayerbotAI.cpp, and your still getting the access violation :confused: Hmmm I'll have another look at the code, once I've had some sleep. I've been up all night removing trailing whitespaces form the code.

Thanks for the feedback

Link to comment
Share on other sites

Hi,

Your using the wrong repository. We have been using git://github.com/blueboy/mangos.git since December last yesr. I have just updated it the be compatible with the latest MaNGOS[9573]

Hope this helps

I was thinking something like that (i.e. I was using the wrong repo). Anyways, thanks, I'll try this and see if it helps

Link to comment
Share on other sites

Guest
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