Jump to content

Playerbot


Recommended Posts

Ok.. So im kindof confused here.. After testing the patch out further i find that it creates an issue and Im going to have to rework it unless you can offer some suggestions..

With patch in place the priest does indeed stay out of melee range and use her wand which increases her DPS a VERY large amount.

BUT she for some reason doesnt seem to be healing anymore....

Im confused as to the cause of this.

As expected the patches for the warlock and the mage work as intended. I wonder if it is to do with the priest needing to change between the master and the masters target but that doesnt really make sense because she was doing that when she was meleeing and not using her wand...

Any ideas?

Link to comment
Share on other sites

  • Replies 799
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

I might know what is stopping your priest from healing. I created your patch as a modification to the PlayerbotPriestAI that I modified on new-ai. Did you apply the AI from new-ai before you applied your patch.

1. use base code from portal master

2. apply patch from new-ai

3. apply patch from your revised code.

I looked at my modified PlayerbotPriestAI.cpp and it doesn't have the conditional code for setting 'SpellSequence'.

i.e

    if (ai->GetCombatOrder() == PlayerbotAI::ORDERS_HEAL ) // && ai->GetMovementOrder() == PlayerbotAI::MOVEMENT_STAY)
       SpellSequence = SPELL_HOLY;
   else if( ai->GetCombatOrder() == PlayerbotAI::ORDERS_ASSIST ) // && ai->GetMovementOrder() == PlayerbotAI::MOVEMENT_STAY)
       SpellSequence = SPELL_SHADOWMAGIC;
   else
       SpellSequence = SPELL_HOLY;

It's late here and my brian is on shutdown. I will try to make sense of this tomorrow

Hope this helps

Link to comment
Share on other sites

In addition,

That coding exists in the Cpp files im using. But i have noticed something about the issue

The priest seems to heal me fine as long as i am standing near her.

If i tank at a distance where she can use her wand she will not heal me.

Is there something preventing her from healing at a distance? The spells are able to be cast as far as im standing...

Link to comment
Share on other sites

Hi Kreegoth,

Sorry, I've got a family crisis on at present, so I can't spend too much time on the computer.

It does sound like there maybe some conditional code preventing the healing process, if the healing target is beyond a certain distance. It may even be a condition of the healing spells. Take a look at wowhead to see if the player is beyond the ranged distance for the spell.

EDIT: I've just read the last part of your post :o , and the spell range is not the cause. Take a look in PlayerbotAI.cpp, and particularly at the code for spell casting.

Hope this helps

Link to comment
Share on other sites

will you be updating playbot soon for cores 11546+ and up ?

I had to chang these lines for patch to work... it appleyed ok, but when i went to complie core i got 2 errors :( so its more then i know how to fix, hope your family crisis is not to bad, and gets better for you ;D

ChatHandler.cpp

GetPlayer()->Whisper(msg, lang, player->GetObjectGuid());

GetPlayer()->Whisper(msg, lang, player->GetGUID());

ChatHandler::FillMessageData(&data, this, type, lang, NULL, 0, msg.c_str(), NULL);

ChatHandler::FillMessageData(&data, this, type, lang, msg.c_str());

QuestHandler.cpp

pPlayer->SetDividerGuid(_player->GetObjectGuid());

pPlayer->SetDivider(_player->GetGUID());

WorldSession.cpp

if (uint64 lguid = GetPlayer()->GetLootGUID())

if (ObjectGuid lootGuid = GetPlayer()->GetLootGuid())

Link to comment
Share on other sites

running win 7 visual studio 2008

10>..\\..\\src\\game\\playerbot\\PlayerbotMgr.cpp(377) : error C2039: 'GetGuildById' : is not a member of 'ObjectMgr'

10> c:\\mangos files\\mangos 11546\\test 11546\\src\\game\\playerbot\\../ObjectMgr.h(432) : see declaration of 'ObjectMgr'

10>..\\..\\src\\game\\playerbot\\PlayerbotMgr.cpp(692) : error C2039: 'GetPlayerGUIDByName' : is not a member of 'ObjectMgr'

10> c:\\mangos files\\mangos 11546\\test 11546\\src\\game\\playerbot\\../ObjectMgr.h(432) : see declaration of 'ObjectMgr'

10>..\\..\\src\\game\\playerbot\\PlayerbotMgr.cpp(798) : error C2039: 'GetPlayerGUIDByName' : is not a member of 'ObjectMgr'

10> c:\\mangos files\\mangos 11546\\test 11546\\src\\game\\playerbot\\../ObjectMgr.h(432) : see declaration of 'ObjectMgr'

10>Player.cpp

10>..\\..\\src\\game\\playerbot\\PlayerbotAI.cpp(2158) : error C2039: 'SetDivider' : is not a member of 'Player'

10> c:\\mangos files\\mangos 11546\\test 11546\\src\\game\\Player.h(1034) : see declaration of 'Player'

10>..\\..\\src\\game\\playerbot\\PlayerbotAI.cpp(2165) : error C2039: 'SetDivider' : is not a member of 'Player'

10> c:\\mangos files\\mangos 11546\\test 11546\\src\\game\\Player.h(1034) : see declaration of 'Player'

10>..\\..\\src\\game\\playerbot\\PlayerbotAI.cpp(2169) : error C2039: 'GetDivider' : is not a member of 'Player'

10> c:\\mangos files\\mangos 11546\\test 11546\\src\\game\\Player.h(1034) : see declaration of 'Player'

10>..\\..\\src\\game\\playerbot\\PlayerbotAI.cpp(2173) : error C2039: 'SetDivider' : is not a member of 'Player'

10> c:\\mangos files\\mangos 11546\\test 11546\\src\\game\\Player.h(1034) : see declaration of 'Player'

10>..\\..\\src\\game\\playerbot\\PlayerbotAI.cpp(3075) : error C2039: 'GetCasterGUID' : is not a member of 'SpellAuraHolder'

10> c:\\mangos files\\mangos 11546\\test 11546\\src\\game\\playerbot\\../SpellAuras.h(45) : see declaration of 'SpellAuraHolder'

========== Build: 9 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========

Im not sure if this will help, Hope all have a good weekend

Link to comment
Share on other sites

Hi Guys,

I've just got a moment to spend online.

I've merged the code on portal master with the latest MaNGOS [11565] and it compiles and runs without issue. I have also merged portal master with blueboy master and playerbot master. This should stop the errors you're getting, caused by several variables being renamed in the core.

Hope this helps

Link to comment
Share on other sites

  • 2 weeks later...

You can make your own patch by running a diff between Playerbot and MaNGOS core source codes. Just make sure your MaNGOS master is at the same revision as the Playerbot branch you're using or you'll also pick up changes in master instead of a clean Playerbot patch.

See git diff in the Git Manual for more instruction. Reading lets you learn many things. :cool:

Link to comment
Share on other sites

  • 4 weeks later...

hey guys,

I have an idea..good or bad u decide... it is called "Perfect GM Bot"

-- Perfect GM Bot --

This bot can stand in GM Island and summon to him any player that made a ticket about quests. He can read tickets, and if he finds the name of a quest in ticket he summons the player to him.. Once player summoned Bot will freeze him in place and say simple santaces like:

- Link me the quest pls.

Once the player link him the quests that are not working, he will check a special db ex: bot_quest table, and give the player autocomplte to that q or not. The table is filled by a gm based on reports on forum. If the quest is not in list the bot will say:

- I'm sorry the quest u requested autocomplete is working or not currently reported on forum!

The bot will unfreeze the player and teleport him back to his last location. After that he deletes the ticket, and pass to next ticket with quest/s.

If quest/s is in the list he will grant player autocomplete to that quest/s!

This way u make everyplayer happy and your gm's can do different things instead of reading tickets with quest, that from what I saw on many server, there is a problem with them, and gm have to reeaaad a lot about those q...many know the quests are not working many don't...and it really takes a lot of time to check every player with a quest ticket!

Blueboy if you believe that this idea is usefull, and only if u believe, I may ask a question.

Is it possible to introduce it in a patch like Ahbot to get into repo at the proper time?

Cause I dunno, but maybe it doesn't modify the core so much like playerbot! Dunno...once again..u are the master..

With respect,

Tyrael

Link to comment
Share on other sites

Hi tyrael,

A very interesting idea and worth pursuing. A GM bot to automate what are very mundane tasks, and I'm sure it would be particularly popular with admins of middle to high population servers. I would suggest that it is developed as a separate (optional) patch, compatible with playerbot. You maybe aware that we develop our code in the 'alpha branches' off the portal master repo.

I remember the debate over the original 'botguy' (a.k.a Pappy Looter) code that was a hassle to use and caused frequent crashes. Eventually we found a way to incorporate the features into playerbot. Maybe you could adapt the botguy code for your suggested 'gmguy', as an optional patch for those who wish to use it.

Let me know what you think and how involved you wish to be in it's development.

Thanks for your suggestion

Link to comment
Share on other sites

pff.. blueboy... I would love to start it..but I am zero with C++... I can try if u want 2... but don't wait for results from me...

BUt, i repeat.. I can try...

Neva got the chance to learn c... noone helped me 2... if u feel that u can help me somehow learn c++.. I am willing to learn... never to late to learn something..

Dunno what to say.. I really want to do it! this idea will help every server out there!

I improved a little bit the ideea... and thought to create a few commands that usual players can access .. and whisper gm bot for help...

and a counter use of it..or wrong use would be making the bot counting how many times a certain player acces his gm powers... and by that restrict the acces for a period of time or forever, depending of player abuse!

The bot can be adapt not just for quests but for players that lose an item due to a crash and he creates a ticket..and I as a gm let the bot a note that when that player enters the game ..to send him a mail with an excuse text for the crash and bla bla bla!

With respect,

Tyrael

Link to comment
Share on other sites

Hi tyrael,

You have a good idea and the enthusiasm to have a go ;) The programming side can be learnt and I will help you all I can. Two questions for you, so I know what you need...

You say that you have zero C++ experience. Have you had any experience with other computer languages?

How much experience have you got with git?

EDIT: I been thinking about your idea and have a suggestion. I don't think it is necessary to have a 'gmguy' on GM Island to service the users issues.

Why not do everything using the ChatHandler system! Create a chat command e.g .gmguy accessible by all players. This command could be enabled/disabled by the server admin at will in the playerbot.conf file.

This would avoid the need to teleport the player from their current location and the added complication of processing tickets.

# PlayerbotAI.GMguy

# Enable gmguy

# Default: 0 - off

# 1 - on

The command could then have a series of sub-commands e.g quest. So if a player finds that they have a quest that seems to be broken, they can enter something like

.gmguy quest [Milly's Harvest]

The [Milly's Harvest] link will hold all relevant info pertaining to the quest. If there is a known issue with this quest it can then be autocompleted by sending a database update using the quest id. The server admin can control those quests that can be autocompleted, again through playerbot.conf,

# PlayerbotAI.GMguy.AutoCompleteQuests

# List of Quest ids that can be autocompleted by a player, should they experience a problem

# List must be enclosed in double quotes ("") and multiple Quest Ids separated by a delimiter(,)

# Example: "805,383,2160,54,8350,9313,1656,2159"

# Default: "" no quests

Further sub-commands could be then added as the project develops.

Speak with you soon

Link to comment
Share on other sites

hey blueboy,

well the single experience I had was in past with qbasic... looong time ago... and after that a little bit of fox pro...bot once again..loong time ago.. maybe 10 - 15 years ago.

Well I love your improvement... but to make it more cosmetic.. I believe by making a bot whisper in a gm way after a player acces a command would be so wonderfull (to me)... and yes... depending of the command typed by player..the bot to ask for different things..different speaches...

Familiar with git, a little bit... only used several commands to push and add patches...but no more... but hey... I can learn that fast... the c++ is the problem.. I don't know anything...

Respect,

Tyrael

Link to comment
Share on other sites

actually such a command can be done independendly from playerbot - and might be reasonable to provide as mod..

.gmguy report quest <link> "Broken description"

and some similar things

I fully agree, but tyrael admits his programming experience is limited and I just want to help him get started. Once he is more comfortable with the code, he can start an independent core modification.

Cheers ;)

Link to comment
Share on other sites

Hi Guys,

This is an announcement of changes to the blueboy GitHub repositories. Now that AuctionHouseBot is included in the core there does not seem any point in maintaining the 'ahbot' respository any longer. I propose to remove this shortly and replace it with code for a new project suggested by tyrael.

I have created a working patch for the project 'gmguy', and the code will be available shortly. This project is independent of playerbot and I hope that tyrael will take the opportunity to start a new topic in the core modification forum. All further discussion related to gmguy will then take place there.

Overview of 'gmguy'

gmguy is a new chat command enabling players to resolve routine maintenance tasks which would otherwise done by the server admin. (Please note that the use of this command is fully controlled by the server admin and does not pose a security risk).

The command can be enabled/disabled only by the server admin in the mangosd.conf file.

# GMGuy.Active

# player access to .gmguy command

# Default: 0 - Disabled

# 1 - Enabled

The first sub-command included with the patch is 'quest'

.gmguy quest [Milly's Harvest]

To select the [Quest Link] <Shift Click> on the quest from the client objectives menu.

This will enable players to autocomplete selective quests, known to give problems in normal completion. The server admin will control which quests can be autocompleted by listing them again in mangosd.conf

# GMGuy.AutoCompleteQuests

# List of available quests that the player can auto-complete

# List must be enclosed in double quotes ("") and multiple Quest Ids separated by a delimiter(,)

# Example: "7,15,21,33,18,6,3904,1598"

# Default: "" - None

The example list above will allow players with a human faction character to autocomplete all trial quests in 'Northshire'. The quest sub-command utilizes the core command 'HandleQuestCompleteCommand' to provide the character with what it requires to normally complete the quest. The character will still need to visit the appropriate 'questgiver' and collect the reward to continue the quest chain.

EDIT: As promised I have now created a new repo 'gmguy'

Hope this helps

Link to comment
Share on other sites

  • 2 weeks later...

Hi Guys,

For sometime now I have noticed an issue with the collection of quest items by bots, using the findNearbyGO() mechanism. Frequently the bots will repeatedly fail to retrieve the quest items, whispering

I do not have the required skill

Collection was unpredicatable and it was a real concern as an objective of a quest.

This comment originates from the DoLoot() function, but I could not find any obvious reason why it should happen. On further investigation it was clear the bots were repeatedly failing to ;

CastSpell(6478) // LOCKTYPE_OPEN_KNEELING

The debug logs show that each time the spell succeeds, the following chain of opcodes are triggered

SMSG_SPELL_START

SMSG_SPELL_GO

SMSG_SPELLLOGEXECUTE

and if it fails

SMSG_SPELL_START

SMSG_SPELL_FAILURE

SMSG_SPELL_FAILED_OTHER

I then examined the playerbot handlers for these opcodes in HandleBotOutgoingPacket(), PlayerbotAI.cpp. Comparing how the core builds the SMSG_SPELL_GO packet data in Spell.cpp, with the way playerbot reads that data... (using the FIFO (First In First Out) concept, with distinct data size boundaries), I found a discrepancy.

Spell.cpp

WorldPacket data(SMSG_SPELL_GO, 50); // guess size

data << m_CastItem->GetPackGUID(); // 8

data << m_caster->GetPackGUID(); // 8

data << uint8(m_cast_count); // 1 pending spell cast?

data << uint32(m_spellInfo->Id); // 4 spellId

data << uint32(castFlags); // 4 cast flags

data << uint32(WorldTimer::getMSTime()); // 4 timestamp

PlayerbotAI.cpp

WorldPacket p(packet);

ObjectGuid castItemGuid;

p >> castItemGuid.ReadAsPacked(); // 8

ObjectGuid casterGuid;

p >> casterGuid.ReadAsPacked(); // 8

if (casterGuid != m_bot->GetObjectGuid())

return;

uint32 spellId;

p >> spellId; // 4

uint16 castFlags;

p >> castFlags; // 2

uint32 msTime;

p >> msTime; // 4

uint8 numHit;

p >> numHit; // 1

You will see that there are clear differences that will cause erroneous results. This will lead to bogus values for spellId (only data value actually used here). I have now corrected the data sizes and order in which relevant data is read.

ObjectGuid castItemGuid;

p >> castItemGuid.ReadAsPacked(); // 8

ObjectGuid casterGuid;

p >> casterGuid.ReadAsPacked(); // 8

if (casterGuid != m_bot->GetObjectGuid())

return;

uint8 castCount;

p >> castCount; // 1

uint32 spellId;

p >> spellId; // 4

uint32 castFlags;

p >> castFlags; // 4

uint32 msTime;

p >> msTime; // 4

Also, in the same block of code for the condition below, I found another problem.

if (m_CurrentlyCastingSpellId == spellId)

{

Spell* const pSpell = m_bot->FindCurrentSpellBySpellId(spellId);

if (!pSpell)

return;

if (pSpell->IsChannelActive() || pSpell->IsAutoRepeat())

m_ignoreAIUpdatesUntilTime = time(0) + (GetSpellDuration(pSpell->m_spellInfo) / 1000) + 1;

else if (pSpell->IsAutoRepeat())

m_ignoreAIUpdatesUntilTime = time(0) + 6;

else

{

m_ignoreAIUpdatesUntilTime = time(0) + 1;

m_CurrentlyCastingSpellId = 0;

}

}

m_CurrentlyCastingSpellId was found to always be zero. So the conditional code would never be executed, even if the spell was cast successfully. I found that m_CurrentlyCastingSpellId is only set in function CastSpell(), PlayerbotAI.cpp.

Spell* const pSpell = m_bot->FindCurrentSpellBySpellId(spellId);

if (!pSpell)

return false;

m_CurrentlyCastingSpellId = spellId;

m_ignoreAIUpdatesUntilTime = time(0) + (int32) ((float) pSpell->GetCastTime() / 1000.0f) + 1;

Looking at the code as a whole, it is easy to see that m_CurrentlyCastingSpellId is never set, due to it's location. So, I relocated it to a position just prior to spell actually being cast. I have also changed how update delay (m_ignoreAIUpdatesUntilTime) is calculated

uint32 CastingTime = !IsChanneledSpell(pSpellInfo) ? GetSpellCastTime(pSpellInfo) : GetSpellDuration(pSpellInfo);

m_CurrentlyCastingSpellId = spellId;

m_ignoreAIUpdatesUntilTime = time(0) + ( CastingTime / 1000) + 1;

where CastingTime is based on whether the spell is channeled or not.

Patch:

diff --git a/src/game/playerbot/PlayerbotAI.cpp b/src/game/playerbot/PlayerbotAI.cpp
index 774937e..428198f 100644
--- a/src/game/playerbot/PlayerbotAI.cpp
+++ b/src/game/playerbot/PlayerbotAI.cpp
@@ -1114,14 +1114,14 @@ void PlayerbotAI::HandleBotOutgoingPacket(const WorldPacket& packet)
            if (casterGuid != m_bot->GetObjectGuid())
                return;

+            uint8 castCount;
+            p >> castCount;
            uint32 spellId;
            p >> spellId;
-            uint16 castFlags;
+            uint32 castFlags;
            p >> castFlags;
            uint32 msTime;
            p >> msTime;
-            uint8 numHit;
-            p >> numHit;

            if (m_CurrentlyCastingSpellId == spellId)
            {
@@ -1129,8 +1129,9 @@ void PlayerbotAI::HandleBotOutgoingPacket(const WorldPacket& packet)
                if (!pSpell)
                    return;

+                uint32 CastingTime = !IsChanneledSpell(pSpell->m_spellInfo) ? GetSpellCastTime(pSpell->m_spellInfo) : GetSpellDuration(pSpell->m_spellInfo);
                if (pSpell->IsChannelActive() || pSpell->IsAutoRepeat())
-                    m_ignoreAIUpdatesUntilTime = time(0) + (GetSpellDuration(pSpell->m_spellInfo) / 1000) + 1;
+                    m_ignoreAIUpdatesUntilTime = time(0) + (CastingTime / 1000) + 1;
                else if (pSpell->IsAutoRepeat())
                    m_ignoreAIUpdatesUntilTime = time(0) + 6;
                else
@@ -3052,6 +3053,11 @@ bool PlayerbotAI::CastSpell(uint32 spellId)
    if (pSpellInfo->Effect[0] == SPELL_EFFECT_OPEN_LOCK)
        target_type = TARGET_FLAG_OBJECT;

+    uint32 CastingTime = !IsChanneledSpell(pSpellInfo) ? GetSpellCastTime(pSpellInfo) : GetSpellDuration(pSpellInfo);
+
+    m_CurrentlyCastingSpellId = spellId;
+    m_ignoreAIUpdatesUntilTime = time(0) + ( CastingTime / 1000) + 1;
+
    if (pSpellInfo->Effect[0] == SPELL_EFFECT_OPEN_LOCK ||
        pSpellInfo->Effect[0] == SPELL_EFFECT_SKINNING)
    {
@@ -3078,13 +3084,6 @@ bool PlayerbotAI::CastSpell(uint32 spellId)
    else
        m_bot->CastSpell(pTarget, pSpellInfo, false);       // actually cast spell

-    Spell* const pSpell = m_bot->FindCurrentSpellBySpellId(spellId);
-    if (!pSpell)
-        return false;
-
-    m_CurrentlyCastingSpellId = spellId;
-    m_ignoreAIUpdatesUntilTime = time(0) + (int32) ((float) pSpell->GetCastTime() / 1000.0f) + 1;
-
    // if this caused the caster to move (blink) update the position
    // I think this is normally done on the client
    // this should be done on spell success

I have already carried out some testing and it appears to solve the collection issue, but we would be interested in getting your feedback.

Hope this helps

Link to comment
Share on other sites

Hello, I am using Mangoszero 0380, is there any playerbot for this version?

The simple answer is no, but that's purely because I have never tried MaNGOS zero. I know this version of the core does not yet include AuctionHouseBot, so a patch created from our portal branch would not work, without extensive modification. However, we have not yet updated the blueboy or main playerbot repos.

As a test, I have just modified (using blueboy code) a patch that did apply to MaNGOS zero without issue. However, it failed to compile and from what I could see it wasn't solely the fault of playerbot.

I'm a little puzzled by the version you give. The current version of MaNGOS zero is [z1765], is Mangoszero 0380 a repack? If it is, then the answer is definitely no, as it would suicide to try and support every flavour and variation out there. If you are using the offical MaNGOS zero core, then I will give you what help I can, but I can't promise it will work ;)

Hope this 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