Jump to content

Playerbot (archive)


Recommended Posts

Can you be more specific? Which versions of NPCHandler.cpp are you comparing (i.e MaNGOS version & blueboy version). Give examples of lines that are missing, line numbers if possible

I have recently removed all playerbot mods from NPCHandler.cpp in blueboy. This was by request to resolve server crash issues, believed to be caused by 'mangos botguy'. Nothing else has been removed.

Please get back to me

You ppls having a crash with playerbot?

I did just once and i forgot to tell you all here that i manage to fixed it

(look for the date i fixed it here http://www.getmangos.eu/community/showpost.php?p=96530&postcount=159)

The culprit is here in Player.cpp:

Yours:

     GossipMenuItemsMapBounds pMenuItemBounds = sObjectMgr.GetGossipMenuItemsMapBounds(menuId);
...


   // Playerbot mod


   Creature *pCreature = (Creature*)pSource;


   if(pCreature->isBotGiver())
       pCreature->LoadBotMenu(this);


    // if default menuId and no menu options exist for this, use options from default options

Mine:

   for(GossipMenuItemsMap::const_iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr)
   {
       bool bCanTalk = true;

       if (itr->second.cond_1 && !sObjectMgr.IsPlayerMeetToCondition(this, itr->second.cond_1))
           continue;

       if (itr->second.cond_2 && !sObjectMgr.IsPlayerMeetToCondition(this, itr->second.cond_2))
           continue;

       if (itr->second.cond_3 && !sObjectMgr.IsPlayerMeetToCondition(this, itr->second.cond_3))
           continue;

       if (pSource->GetTypeId() == TYPEID_UNIT)
       {
           Creature *pCreature = (Creature*)pSource;

           uint32 npcflags = pCreature->GetUInt32Value(UNIT_NPC_FLAGS);

           if(pCreature->isBotGiver())
               pCreature->LoadBotMenu(this);

           if (!(itr->second.npc_option_npcflag & npcflags))

I hope you can understand me there...

Link to comment
Share on other sites

  • Replies 1.8k
  • Created
  • Last Reply

Top Posters In This Topic

Hi Stillhard,

I see what you did. I added a declaration of 'pCreature' pointer, to retain position of the playerbot mod in the function 'PrepareGossipMenu()'. You moved the playerbot mod. Interesting, can you tell me,

* Do you use the 'mangos botguy' ? // everyone who replied at the time told me that the code was redundant.

* Did your move stop the server crashes ? // crash occured when spawned 'botguy' was selected.

Sorry for missing your post to 'Windows Crash Dumps', I am not notified of posts from that thread.

Regards blueboy

Link to comment
Share on other sites

Hi Stillhard,

I see what you did. I added a declaration of 'pCreature' pointer, to retain position of the playerbot mod in the function 'PrepareGossipMenu()'. You moved the playerbot mod. Interesting, can you tell me,

* Do you use the 'mangos botguy' ? // everyone who replied at the time told me that the code was redundant.

* Did your move stop the server crashes ? // crash occured when spawned 'botguy' was selected.

Sorry for missing your post to 'Windows Crash Dumps', I am not notified of posts from that thread.

Regards blueboy

Yes i use the bot guy (i'm going to make a petition to save the bot guy :P).

I can tell you that everything working... i've tested 100% no crashed for the bot guy or playerbot.

Link to comment
Share on other sites

Yes i use the bot guy (i'm going to make a petition to save the bot guy :P).

I can tell you that everything working... i've tested 100% no crashed for the bot guy or playerbot.

I tried to use botguy with your positioning of code in Player.cpp, i.e

for(GossipMenuItemsMap::const_iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr)
   {
       bool bCanTalk = true;

       if (itr->second.cond_1 && !sObjectMgr.IsPlayerMeetToCondition(this, itr->second.cond_1))
           continue;

       if (itr->second.cond_2 && !sObjectMgr.IsPlayerMeetToCondition(this, itr->second.cond_2))
           continue;

       if (itr->second.cond_3 && !sObjectMgr.IsPlayerMeetToCondition(this, itr->second.cond_3))
           continue;

       if (pSource->GetTypeId() == TYPEID_UNIT)
       {
           Creature *pCreature = (Creature*)pSource;

           uint32 npcflags = pCreature->GetUInt32Value(UNIT_NPC_FLAGS);

           if(pCreature->isBotGiver())
               pCreature->LoadBotMenu(this);

           if (!(itr->second.npc_option_npcflag & npcflags))

and I got an assertion error in GossipDef.cpp @ line 40: Error: Assertion in AddMenuItem failed: m_gItems.size() <= 64. I looked at the link you provided to prove you had solved the problem and all it said was,

Edited:

REMOVED!

Fixed - false alarm -

Sorry guys

I do not see how you got it to work, as is.

I however have got it to work 100% with some adjustment, and if anyone is interested I will post the code to blueboy.

Regards blueboy

Link to comment
Share on other sites

I do not see how you got it to work, as is.

I however have got it to work 100% with some adjustment, and if anyone is interested I will post the code to blueboy.

Well alot of things changed with the gossip system, i dunno...

But back there, one thing for sure that my server crashed once a player click a GO to finish his quest, (i can't remember what GO was) etc, that was related to new gossip/dialog system.

It is great that you've managed to solved it.

I'll try to be more responsive to this thread next time.

Thank you blueboy

Link to comment
Share on other sites

The new playerbot code has now been uploaded to blueboy. This is compatible with MaNGOS [9043], and compiles without error. The new code incorporates my 'botguy' code fix, and so far seems to work well without server crashes.

If you would like to use 'botguy' with playerbot,

1. Apply both sql files to the mangos database,

mangos_botguy.sql

mangos_command_bot.sql

2. You will need to logon with a 'gamesmaster' account to use .npc command

3. To summon 'Pappy Looter', whisper

.npc add 99002

4. Select 'Pappy Looter' to add and remove bots at will.

5. To dismiss 'Pappy Looter', select him with mouse and then whisper,

.npc delete

Merry Christmas to you all, blueboy

Link to comment
Share on other sites

This fix Druid Tank bug

Without it, druid never use SWIPE,

else if (ENRAGE > 0 && m_bot->HasAura(DIRE_BEAR_FORM, 0) || m_bot->HasAura(BEAR_FORM, 0) && DruidSpellCombat < 2 && !m_bot->HasAura(ENRAGE, 0))

is always true if you are un DIRE_BEAR_FORM

you must add ( || )

@@ -156,7 +156,7 @@ void PlayerbotDruidAI::DoNextCombatManeuver(Unit *pTarget)
            {
                ai->CastSpell (BEAR_FORM);
            }
-            else if (DEMORALIZING_ROAR > 0 && m_bot->HasAura(DIRE_BEAR_FORM, 0) || m_bot->HasAura(BEAR_FORM, 0) && !m_bot->HasAura(MOONKIN_FORM, 0) && !pTarget->HasAura(DEMORALIZING_ROAR, 0) && ai->GetRageAmount() >= 10)
+            else if (DEMORALIZING_ROAR > 0 && (m_bot->HasAura(DIRE_BEAR_FORM, 0) || m_bot->HasAura(BEAR_FORM, 0)) && !m_bot->HasAura(MOONKIN_FORM, 0) && !pTarget->HasAura(DEMORALIZING_ROAR, 0) && ai->GetRageAmount() >= 10)
            {
                ai->CastSpell(DEMORALIZING_ROAR, *pTarget);
            }
@@ -235,37 +235,37 @@ void PlayerbotDruidAI::DoNextCombatManeuver(Unit *pTarget)
                DruidSpellCombat++;
                break;
            }
-            else if (ENRAGE > 0 && m_bot->HasAura(DIRE_BEAR_FORM, 0) || m_bot->HasAura(BEAR_FORM, 0) && DruidSpellCombat < 2 && !m_bot->HasAura(ENRAGE, 0))
+            else if (ENRAGE > 0 && (m_bot->HasAura(DIRE_BEAR_FORM, 0) || m_bot->HasAura(BEAR_FORM, 0)) && DruidSpellCombat < 2 && !m_bot->HasAura(ENRAGE, 0))
            {
                ai->CastSpell(ENRAGE, *m_bot);
                DruidSpellCombat = DruidSpellCombat +2;
                break;
            }
-            else if (SWIPE > 0 && m_bot->HasAura(DIRE_BEAR_FORM, 0) || m_bot->HasAura(BEAR_FORM, 0) && DruidSpellCombat < 4 && ai->GetRageAmount()>=20)
+            else if (SWIPE > 0 && (m_bot->HasAura(DIRE_BEAR_FORM, 0) || m_bot->HasAura(BEAR_FORM, 0)) && DruidSpellCombat < 4 && ai->GetRageAmount()>=20)
            {
                ai->CastSpell(SWIPE, *pTarget);
                DruidSpellCombat = DruidSpellCombat +2;
                break;
            }
-            else if (MAUL > 0 && m_bot->HasAura(DIRE_BEAR_FORM, 0) || m_bot->HasAura(BEAR_FORM, 0) && DruidSpellCombat < 6 && ai->GetRageAmount()>=15)
+            else if (MAUL > 0 && (m_bot->HasAura(DIRE_BEAR_FORM, 0) || m_bot->HasAura(BEAR_FORM, 0)) && DruidSpellCombat < 6 && ai->GetRageAmount()>=15)
            {
                ai->CastSpell(MAUL, *pTarget);
                DruidSpellCombat = DruidSpellCombat +2;
                break;
            }
-            else if (BASH > 0 && m_bot->HasAura(DIRE_BEAR_FORM, 0) || m_bot->HasAura(BEAR_FORM, 0) && !pTarget->HasAura(BASH, 0) && DruidSpellCombat < 8 && ai->GetRageAmount()>=10)
+            else if (BASH > 0 && (m_bot->HasAura(DIRE_BEAR_FORM, 0) || m_bot->HasAura(BEAR_FORM, 0)) && !pTarget->HasAura(BASH, 0) && DruidSpellCombat < 8 && ai->GetRageAmount()>=10)
            {
                ai->CastSpell(BASH, *pTarget);
                DruidSpellCombat = DruidSpellCombat +2;
                break;
            }
-            else if (CHALLENGING_ROAR > 0 && m_bot->HasAura(DIRE_BEAR_FORM, 0) || m_bot->HasAura(BEAR_FORM, 0) && pVictim != m_bot && DruidSpellCombat < 10 && !pTarget->HasAura(CHALLENGING_ROAR, 0) && !pTarget->HasAura(GROWL, 0) && ai->GetRageAmount()>=15)
+            else if (CHALLENGING_ROAR > 0 && (m_bot->HasAura(DIRE_BEAR_FORM, 0) || m_bot->HasAura(BEAR_FORM, 0)) && pVictim != m_bot && DruidSpellCombat < 10 && !pTarget->HasAura(CHALLENGING_ROAR, 0) && !pTarget->HasAura(GROWL, 0) && ai->GetRageAmount()>=15)
            {
                ai->CastSpell(CHALLENGING_ROAR, *pTarget);
                DruidSpellCombat = DruidSpellCombat +2;
                break;
            }
-            else if (GROWL > 0 && m_bot->HasAura(DIRE_BEAR_FORM, 0) || m_bot->HasAura(BEAR_FORM, 0) && pVictim != m_bot && DruidSpellCombat < 12 && !pTarget->HasAura(CHALLENGING_ROAR, 0) && !pTarget->HasAura(GROWL, 0))
+            else if (GROWL > 0 && (m_bot->HasAura(DIRE_BEAR_FORM, 0) || m_bot->HasAura(BEAR_FORM, 0)) && pVictim != m_bot && DruidSpellCombat < 12 && !pTarget->HasAura(CHALLENGING_ROAR, 0) && !pTarget->HasAura(GROWL, 0))
            {
                ai->CastSpell(GROWL, *pTarget);
                DruidSpellCombat = DruidSpellCombat +2;

Link to comment
Share on other sites

rev. 9044 with http://github.com/blueboy/mangos/commit/ce4c26a5545e2d47aa53a59e510f2921b114de74

Crash again :(

I had to roll back these changes :(

1. Can you give me any more details? :rolleyes:

i.e Describe your system, which version of ScriptDev2 are you using, any other mods used.

2. Did it crash during compilation or runtime?

3. What were you doing when it crashed? i.e were you trying to use 'Pappy Looter' for instance

4. How did you apply playerbot to MaNGOS [9044], the code was adjusted for MaNGOS [9043].

i.e Did you try merging or did you create a 'patch' and apply this to a fresh MaNGOS [9044]?

Please get back to me, blueboy

Link to comment
Share on other sites

rev. 9044 with http://github.com/blueboy/mangos/commit/ce4c26a5545e2d47aa53a59e510f2921b114de74

Crash again :(

I had to roll back these changes :(

Please try this:

@@ -12400,16 +12400,10 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)

    pMenu->GetGossipMenu().SetMenuId(menuId);

    GossipMenuItemsMapBounds pMenuItemBounds = sObjectMgr.GetGossipMenuItemsMapBounds(menuId);

-    // Playerbot mod
-    Creature *pCreature = (Creature*)pSource;
-
-    if (pCreature->isBotGiver())
-        pCreature->LoadBotMenu(this);
-
    // if default menuId and no menu options exist for this, use options from default options
    if (pMenuItemBounds.first == pMenuItemBounds.second && menuId == GetDefaultGossipMenuForSource(pSource))
        pMenuItemBounds = sObjectMgr.GetGossipMenuItemsMapBounds(0);

    for(GossipMenuItemsMap::const_iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr)
@@ -12429,10 +12423,14 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
        {
            Creature *pCreature = (Creature*)pSource;

            uint32 npcflags = pCreature->GetUInt32Value(UNIT_NPC_FLAGS);

+            // Playerbot mod
+            if (pCreature->isBotGiver())
+                pCreature->LoadBotMenu(this);
+
            if (!(itr->second.npc_option_npcflag & npcflags))
                continue;

            switch(itr->second.option_id)
            {

17 hours with no crash here :)

Link to comment
Share on other sites

1. Can you give me any more details? :rolleyes:

i.e Describe your system, which version of ScriptDev2 are you using, any other mods used.

2. Did it crash during compilation or runtime?

3. What were you doing when it crashed? i.e were you trying to use 'Pappy Looter' for instance

4. How did you apply playerbot to MaNGOS [9044], the code was adjusted for MaNGOS [9043].

i.e Did you try merging or did you create a 'patch' and apply this to a fresh MaNGOS [9044]?

Please get back to me, blueboy

1. Win server 2003; SD2 rev.1523; many patch, but crash (as say CrashLog) in playerbot (sorry, crashlog was deleted, but I remember line with isBotGiver())

2. During runtime

3. When player try to speak with any NPC

4. git pull git://github.com/blueboy/mangos.git without any conflict

I try in game now after http://github.com/blueboy/mangos/commit/86e640ebfcb6dc982883e34bb12f289370571ad6

added

Crash:

Call stack:
Address   Frame     Function      SourceFile
0065E747  00000000  ?GetScriptId@Creature@@QBEIXZ+37
0065E6D8  00000000  ?GetScriptName@Creature@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ+18
00731DB7  00000000  ?[b]isBotGiver[/b]@Creature@@QAE_NXZ+37
004F975E  00000000  ?PrepareGossipMenu@Player@@QAEXPAVWorldObject@@I@Z+DE
00668725  00000000  ?Use@GameObject@@QAEXPAVUnit@@@Z+115
008AAE4A  00000000  ?HandleGameObjectUseOpcode@WorldSession@@QAEXAAVWorldPacket@@@Z+16A
005E9DB0  00000000  ?Update@WorldSession@@QAE_NI@Z+120
005FBB83  00000000  ??0CreatureEventAI@@QAE@ABV0@@Z+8243
005FA301  00000000  ??0CreatureEventAI@@QAE@ABV0@@Z+69C1
00430BCE  00000000  ?getSource@?$Reference@V?$GridRefManager@VCorpse@@@@VCorpse@@@@QBEPAVCorpse@@XZ+1931E
008C9859  00000000  ?GetFloatDefault@Config@@QAEMPBDM@Z+DC9
00AF14D4  00000000  ?invoke@ACE_OS_Thread_Adapter@@UAEKXZ+74
78543433  00000000  _endthreadex+44
785434C7  00000000  _endthreadex+D8
7C82482F  00000000  GetModuleHandleA+DF

Go to try Stillhard fix...

added

Stillhard, thx! I have no crash with your fix :)

Link to comment
Share on other sites

Hi KiriX,

Glad you got your crash sorted out although I can't see how Stillhard's fix can possibly work. The only real difference between your system and mine is that I run a linux server, while you run a Windows 2003 server. I run the code as is on blueboy, and it has never crashed.

Regards blueboy

Link to comment
Share on other sites

added

Crash:

Call stack:
Address   Frame     Function      SourceFile
0065E747  00000000  ?GetScriptId@Creature@@QBEIXZ+37
0065E6D8  00000000  ?GetScriptName@Creature@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ+18
00731DB7  00000000  ?[b]isBotGiver[/b]@Creature@@QAE_NXZ+37
004F975E  00000000  ?PrepareGossipMenu@Player@@QAEXPAVWorldObject@@I@Z+DE
00668725  00000000  ?Use@GameObject@@QAEXPAVUnit@@@Z+115
008AAE4A  00000000  ?HandleGameObjectUseOpcode@WorldSession@@QAEXAAVWorldPacket@@@Z+16A
005E9DB0  00000000  ?Update@WorldSession@@QAE_NI@Z+120
005FBB83  00000000  ??0CreatureEventAI@@QAE@ABV0@@Z+8243
005FA301  00000000  ??0CreatureEventAI@@QAE@ABV0@@Z+69C1
00430BCE  00000000  ?getSource@?$Reference@V?$GridRefManager@VCorpse@@@@VCorpse@@@@QBEPAVCorpse@@XZ+1931E
008C9859  00000000  ?GetFloatDefault@Config@@QAEMPBDM@Z+DC9
00AF14D4  00000000  ?invoke@ACE_OS_Thread_Adapter@@UAEKXZ+74
78543433  00000000  _endthreadex+44
785434C7  00000000  _endthreadex+D8
7C82482F  00000000  GetModuleHandleA+DF

Go to try Stillhard fix...

added

Stillhard, thx! I have no crash with your fix :)

I think that Stillhard found a more proper place in the code for a given piece of code.

I draw this conclusion based on the old version playerbot...

Your welcome KiriX :)

Link to comment
Share on other sites

Hi All,

I can see that this is turning into a 'Mine is better than yours' arguement. I am glad that Stillhard fix works for those who have recently wished to contribute.

However I disagree with the comments,

I think that Stillhard found a more proper place in the code for a given piece of code.

I draw this conclusion based on the old version playerbot...

If you actually look at the code on http://github.com/playerbot/mangos you will see this is not so

In the original function prepareGossipMenu() located in Creature.cpp, you will see that

void Creature::PrepareGossipMenu( Player *pPlayer,uint32 gossipid )
{
   PlayerMenu* pm=pPlayer->PlayerTalkClass;
   pm->ClearMenus();

   // lazy loading single time at use
   LoadGossipOptions();

   // Playerbot mod
   if(isBotGiver())
       LoadBotMenu(pPlayer);

   for( GossipOptionList::iterator i = m_goptions.begin( ); i != m_goptions.end( ); ++i )
   {
       GossipOption* gso=&*i;
       if(gso->GossipId == gossipid)
       {
           bool cantalking=true;
           if(gso->Id==1)
           {
               uint32 textid=GetNpcTextId();
               GossipText const* gossiptext=sObjectMgr.GetGossipText(textid);
               if(!gossiptext)
                   cantalking=false;
           }
           else
           {
               switch (gso->Action)
               {
                   case GOSSIP_OPTION_QUESTGIVER:
                       pPlayer->PrepareQuestMenu(GetGUID());
                       //if (pm->GetQuestMenu()->MenuItemCount() == 0)
                       cantalking=false;
                       //pm->GetQuestMenu()->ClearMenu();
                       break;
                   case GOSSIP_OPTION_ARMORER:
                       cantalking=false;                   // added in special mode
                       break;
                   case GOSSIP_OPTION_SPIRITHEALER:
                       if( !pPlayer->isDead() )
                           cantalking=false;
                       break;
                   case GOSSIP_OPTION_VENDOR:
                   {
                       VendorItemData const* vItems = GetVendorItems();
                       if(!vItems || vItems->Empty())
                       {
                           sLog.outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_VENDOR but have empty trading item list.",
                               GetGUIDLow(),GetEntry());
                           cantalking=false;
                       }
                       break;
                   }
                   case GOSSIP_OPTION_TRAINER:
                       if(!isCanTrainingOf(pPlayer,false))
                           cantalking=false;
                       break;
                   case GOSSIP_OPTION_UNLEARNTALENTS:
                       if(!isCanTrainingAndResetTalentsOf(pPlayer))
                           cantalking=false;
                       break;
                   case GOSSIP_OPTION_UNLEARNPETSKILLS:
                       if(!pPlayer->GetPet() || pPlayer->GetPet()->getPetType() != HUNTER_PET || pPlayer->GetPet()->m_spells.size() <= 1 || GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS || GetCreatureInfo()->trainer_class != CLASS_HUNTER)
                           cantalking=false;
                       break;
                   case GOSSIP_OPTION_TAXIVENDOR:
                       if ( pPlayer->GetSession()->SendLearnNewTaxiNode(this) )
                           return;
                       break;
                   case GOSSIP_OPTION_BATTLEFIELD:
                       if(!isCanInteractWithBattleMaster(pPlayer,false))
                           cantalking=false;
                       break;
                   case GOSSIP_OPTION_SPIRITGUIDE:
                   case GOSSIP_OPTION_INNKEEPER:
                   case GOSSIP_OPTION_BANKER:
                   case GOSSIP_OPTION_PETITIONER:
                   case GOSSIP_OPTION_STABLEPET:
                   case GOSSIP_OPTION_TABARDDESIGNER:
                   case GOSSIP_OPTION_AUCTIONEER:
                       break;                              // no checks
                   default:
                       sLog.outErrorDb("Creature %u (entry: %u) have unknown gossip option %u",GetDBTableGUIDLow(),GetEntry(),gso->Action);
                       break;
               }
           }

           //note for future dev: should have database fields for BoxMessage & BoxMoney
           if(!gso->OptionText.empty() && cantalking)
           {
               std::string OptionText = gso->OptionText;
               std::string BoxText = gso->BoxText;
               int loc_idx = pPlayer->GetSession()->GetSessionDbLocaleIndex();
               if (loc_idx >= 0)
               {
                   NpcOptionLocale const *no = sObjectMgr.GetNpcOptionLocale(gso->Id);
                   if (no)
                   {
                       if (no->OptionText.size() > (size_t)loc_idx && !no->OptionText[loc_idx].empty())
                           OptionText=no->OptionText[loc_idx];
                       if (no->BoxText.size() > (size_t)loc_idx && !no->BoxText[loc_idx].empty())
                           BoxText=no->BoxText[loc_idx];
                   }
               }
               pm->GetGossipMenu().AddMenuItem((uint8)gso->Icon,OptionText, gossipid,gso->Action,BoxText,gso->BoxMoney,gso->Coded);
           }
       }
   }

   ///some gossips aren't handled in normal way ... so we need to do it this way .. TODO: handle it in normal way ;-)
   if(pm->Empty())
   {
       if(HasFlag(UNIT_NPC_FLAGS,UNIT_NPC_FLAG_TRAINER))
       {
           isCanTrainingOf(pPlayer,true);                  // output error message if need
       }
       if(HasFlag(UNIT_NPC_FLAGS,UNIT_NPC_FLAG_BATTLEMASTER))
       {
           isCanInteractWithBattleMaster(pPlayer,true);     // output error message if need
       }
   }
}

prepareGossipMenu() is only called once each time a NPC is selected, and LoadBotMenu once if the NPC is 'Pappy Looter'. Stillhard has moved the playerbot mod inside an iterative loop in the new function PrepareGossipMenu() located in Player.cpp. Now, LoadBotMenu is called 16 times, each time 'Pappy Looter' is selected.

LoadBotMenu contains all the code necessary to display menu options for all available bots. It only needs to be called ONCE!

'Pound to a penny' that this is a Windows 2003 vs Linux compatiblity issue. I know that KiriX uses Windows, and I suspect that Stillhard does too. It might be necessary to write conditional code, depending on which system is used.

I hope this is clear to you all

Link to comment
Share on other sites

I use it and I have no crashs :

@@ -13149,12 +13149,9 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)

    GossipMenuItemsMapBounds pMenuItemBounds = sObjectMgr.GetGossipMenuItemsMapBounds(menuId);

   if(pSource->GetTypeId() == TYPEID_UNIT && ((Creature*)pSource)->isBotGiver())
    {
       ((Creature*)pSource)->LoadBotMenu(this);
        return;
    }


Link to comment
Share on other sites

Sorry again

I'm not good in C++ but I know programming

I prefer to leave out botguy ... since everybody change it without any safe logic

Please blue boy make a patch in your directory if somebody need this and leave it out of code

And a small hint

in GossipDef.h

you write

GOSSIP_OPTION_UNLEARNPETSKILLS = 17, //UNIT_NPC_FLAG_TRAINER (16) (bonus option for GOSSIP_OPTION_TRAINER)

+ // Playerbot mod

+ GOSSIP_OPTION_BOT = 99, //UNUSED (just for bot system)

GOSSIP_OPTION_MAX

};

It is better to remove the "=99"

because max will be 100 and suppose that somewhere there is a for loop ... or something else which test somthing ...

Blue boy thanks for the answer sorry for late letter

In reality my question is about intelligent of the PriestAI.cpp

As an example

lets say that we are in combat not dwell

As i understand first bot will check fade then PWS then bot health then master health and last group

I wish first check health master then group then test alive

I suppose that i have to change the if-else sentences

am i right?

thanks again

Link to comment
Share on other sites

blueboy, if you mind my two cents, i think this argument is kinda infantile personally. who has the greener grass isnt the issue here... I think its a moot point whether or not Pappy Looter works, the main emphasis here should be focused on evolving the AI of the playerbots themselves.. maybe if its so important to make a vendor-ish object work we can have a linked subthread to PappyLooter-101 or something.

I have never used the original playerbot thread.. or at least it has never compiled into the game correctly when i did try to do playerbot months ago. Since i started my server back up I have been using blueboy's code and it is stable it has never crashed our live server and aside with some difficulties with certain classes not liking to ressurect themselves after death (orc warriors and hunters especially) I think this is an extremely convenient mod for small community servers.

I might offer a suggestion though

I am in the process of creating a modification for our live server which will take selected vendors throughout the realms and provide them with contact to the Elite Adventurer's Guild. This in turn will (upon purchase of the item) cause the vendor to mail them instructions on how to summon a companion and how to use it. This way the player gets full info on how to summon and dismiss the bot as well as command it... and thanks to the in-game email system allowing you to save your letters as an item they have the commands at thier convenience.

Blueboy, are you developing the AIs as well? I was wondering if it were at all possible that when the summoned bot is dismissed, OR when the player logs off the server, could it be setup so that the bot is sent back to it's .start location and restored to life if dead? its just a thought... it would make muling a little easier as you could have the bot sent to an innkeeper upon dismissal and then when you login to the bots account you can sell all the worthless junk you have collected along the way. This is especially important to me because I am having a very difficult time with making the Auctionbot work on our main server and without us admin dropoping tons of collected garbage in there, there would be hardly anything for players that come into the world since we are a very small community.

sorry for the story.. kinda stoned *lol*

3razar3

Link to comment
Share on other sites

Hi All,

I can see that this is turning into a 'Mine is better than yours' arguement. I am glad that Stillhard fix works for those who have recently wished to contribute.

prepareGossipMenu() is only called once each time a NPC is selected, and LoadBotMenu once if the NPC is 'Pappy Looter'. Stillhard has moved the playerbot mod inside an iterative loop in the new function PrepareGossipMenu() located in Player.cpp. Now, LoadBotMenu is called 16 times, each time 'Pappy Looter' is selected.

LoadBotMenu contains all the code necessary to display menu options for all available bots. It only needs to be called ONCE!

'Pound to a penny' that this is a Windows 2003 vs Linux compatiblity issue. I know that KiriX uses Windows, and I suspect that Stillhard does too. It might be necessary to write conditional code, depending on which system is used.

I hope this is clear to you all

Dear blueboy, thx man...

I trust you. And i think we'll find a better solution for all of us.

I use it and I have no crashs :

@@ -13149,12 +13149,9 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)

    GossipMenuItemsMapBounds pMenuItemBounds = sObjectMgr.GetGossipMenuItemsMapBounds(menuId);

   if(pSource->GetTypeId() == TYPEID_UNIT && ((Creature*)pSource)->isBotGiver())
    {
       ((Creature*)pSource)->LoadBotMenu(this);
        return;
    }


I think this should be the proper way.

Let's work together... ^_^

Link to comment
Share on other sites

It's sad that you do not want to recognize the existence of the problem :(

MaNGOS not developed only under Linux, why playerbot functioning normally only nix systems, and you do not want to recognize the existence of a problem when you even offered a solution (twice)... :(

Note that the decision of Stillhard and yad02 essentially identical - they are checking

if (pSource-> GetTypeId () == TYPEID_UNIT &&

and

if (pSource-> GetTypeId () == TYPEID_UNIT)

Rather, in the old version in the file creature.cpp this check is simply not needed (I did not understand deeper).

I do not think that if you take at least version yad02, this can break patch.

It is very difficult to express all their thoughts on a non-native language so as to understand you correctly...

If you do not trust my words, I can test the patch on a clean MaNGOS to Win system and give you CrashLog...

Link to comment
Share on other sites

Kirix I understand your point entirely, I was personally just stating that the mod is playerbot... while the happylooter is the traditional method of deployment it wouldnt hurt to modfy how you introduce the playerbots to the world for uniqueness.

I just personally think that the playerbot AI is what should be focused on above all else as it is the playerbots we are getting the mod for ultimately, not a custom vendor.

for the record, our live server is hosted on a bladeserver running Win 2k3 DataCenter and as i said many times before I have no running problems with this modification insofar as server crashes, I am only interested in the improvements to the AI and improvements to the command system.

Link to comment
Share on other sites

Oh Boy,

I have provoked a great deal of discussion between you guys, and thats good. Believe it or not I have carefully read all of your posts and agree with virtually all that has been said. Sorry to erazare; if you think your reply was a story, here's the trilogy.

It would help if members briefly described their systems, when posting new issues.

@yad02 Thanks for your Druid tank fix. I have installed it on my server, but have not had chance to test it. My Druid has not yet got 'Dire Bear Form', but your code looks good.

Your botguy fix is different again, and I will certainly try it out. I believe that all systems are unique in their own way, and all fixes are valid, and non should be discounted.

@policent I understand your concerns and agree that in the long term it might be better to separate 'playerbot' from 'botguy'.

Change the value of GOSSIP_OPTION_BOT to a smaller value would reduce the iterations in a 'for loop', but thats another story.

If I understand you right, your working on a new AI for priests. It worth looking at the AI's already written to glean ideas. Use flags in the code, to test your logic.

@erazare I agree that 'botguy' is diverting our attention away from the AI. I prefer not to use 'botguy' myself. Macros allow ordinary players to summon and dismiss bots at will, without the need of a 'GM' and without the overhead of additional code. I support the suggestion that we should separate 'botguy' from 'playerbot'. If there is a desire to use 'botguy' in the future, then a fork off 'playerbot' (sub-thread) would be a good idea. Then we can concentrate on supporting 'playerbot' AI.

In the meantime I suggest we join forces and create installable git patches for those who wish to use it. I will create one that works on my system, and perhaps we can get patches for the other approaches. Then it is upto the individual to choose which patch they prefer.

When I started on this forum, about a month ago I wanted to devote my attention to developing the AI of playerbot. However it seem that I have been left holding the baby. I like to help people and as issues have arisen, I have tried to address these. It has been difficult.

I was so pleased by ckegg's recent submission to resolve the 'player already has a corpse'problem. There are still issues with handling bots at player logoff. Your suggestion touches on an issue I believe exists in 'playerbot', and must be resolved

Bots become permanently dead.

I have noticed that if a bot dies and the player logs out before it has time to resurrect. When the player logs in again, the summoned bot will not resurrect. The only way to revive it is by logging in as the bot, resurrecting it, and then logging out again. It can then be summoned as a useful bot again. The short term solution would be to ensure that all bots are alive before the player logsout.

Online help in the use of playerbot, sounds nice. Perhaps you can share the mod, when it is ready.

Auctionhousebot should stock the auctionhouse automatically. I use code from http://github.com/Naicisum/mangos, and it works well. This is what i did;

1. created an account solely for the auctionhousebot.

2. created a character in this account using the wow client.

3. configure 'mangosd.conf' with account id, bot character id, and items you wish to appear in the auctionhouse.

4. Log in at least once with the auctionhousebot character.

Make sure that 'auctionhousebot' table in the Character database is configure correctly. The default value of 'maxitems' field is zero. Don't be suprised if nothing appears in the auctionhouse. Change this to something real like '500' and you can then leave auctionhousebot to run itself.

@Stillhard Thanks for your comments, and I fully agree.

@KiriX It is difficult for one guy to support all systems. As I stated in my last post, I think this present issue is one of system compatibility. What works on my system would not necessarily work on yours. No one is suggesting that we should ignore Windows in preference for linux. If you run Windows, we would welcome your input. I agree with erazare in separating 'botguy' and 'playerbot', we can focus on their individual development.

Cheers to you all, blueboy

Link to comment
Share on other sites

:(

As I noticed i do not know C++ so I cann't help in programing

I know programing other languages and I insist that it is safer to remove "=99" but is your decision to do or not

About dead

there are two situations one when logout and when login

When logout you can write something like this

... If "is not alive" then "revive" "teleport to master"

"logout"

again the same when login

BUT

this is not enough because of network disconnect. Master disconnect will leave bots inside since they are in server. So a safe question in bot Ai ( which repeated every msec) is necessary

If "not master" then "logout bot"

I can't write all this because I do not know C++ also i do not know the procedures of mangos

I thing that this code will solve the problem

Merry Christmas

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