Jump to content

blueboy

Members
  • Posts

    723
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by blueboy

  1. Hi Gitch,

    The code is working well and it is understood that the current item comparison is still only at the early stages of developement. The factors to consider in item comparison are too numerous to list and from a human point of view it can be purely personal preference that you can't measure.

    I haven't had a chance to try out your changes yet, but last night I was looking item comparison for weapons. The issue here being; which is better (for say a warrior to use), a sword or a dagger. By far the most important factor here would be DPS and or possibly skill level (i.e. User can train the bot with the preferred weapon type) or bot Class (i.e Rogue would be better off with a dagger). Item level on it's own leads to unexpected results

    Initially equipped with

    [brushwood Blade]

    One-Handed Sword

    11-21 Damage

    5.3 damage per sec

    +1 Stamina

    Speed 3.00

    (Wowhead has this listed as a level 10 item)

    Autoequip insists on equpping him with

    [Fiisherman's Knife]

    One-Handed Dagger

    4-8 Damage

    4.3 damage per sec

    Speed 1.4

    Requires Level 9

    (Wowhead has this listed as a level 14 item)

    Cheers

  2. Hi Gitch,

    Problems. After about ten minutes play the server crashes. I have checked this several times. It looks like it might be connected to 'autoequip'

    I have a snippet of the crash log that I hope will help. I does look like a NULL pointer error.

    #0 0x0853f2c0 in Object::GetUInt32Value (this=0x0, index=3)

    at /home/mangos/wow/playerbot/source/portal/src/game/Object.h:183

    __FUNCTION__ = "GetUInt32Value"

    __PRETTY_FUNCTION__ = "const uint32& Object::GetUInt32Value(uint16) const"

    #1 0x08551003 in Object::GetEntry (this=0x0)

    at /home/mangos/wow/playerbot/source/portal/src/game/Object.h:146

    No locals.

    #2 0x0862d5e3 in Item::GetProto (this=0x0)

    at /home/mangos/wow/playerbot/source/portal/src/game/Item.cpp:568

    No locals.

    #3 0x0867423d in PlayerbotAI::AutoUpgradeEquipment (this=0xa07be600)

    at /home/mangos/wow/playerbot/source/portal/src/game/playerbot/PlayerbotAI.cpp:557

    pItem2 = 0x0

    pProto = 0xac5fc078

    pProto2 = 0xac5cb3e8

    it =

    itemListForEqSlot = 0xa7717f00

    equipSlot = 15 '\\017'

    GitOldMaxValue = 5

    GitNewQuality = 1

    GitNewArmor = 10

    equip = {0x0, 0x0, 0x0, 0x0, 0x0, 0xa7717f30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,

    0xa7717f00, 0x0, 0x0, 0x0}

    GitNewMaxValue = 10

    GitOldQuality = 1

    GitOldArmor = 19

    #4 0x086775b0 in PlayerbotAI::HandleBotOutgoingPacket (this=0xa07be600, packet=...)

    at /home/mangos/wow/playerbot/source/portal/src/game/playerbot/PlayerbotAI.cpp:1475

    bot = 0xa0a3e080

    p = {<ByteBuffer> = {static DEFAULT_SIZE = <optimized out>, _rpos = 4, _wpos = 4,

    _storage = std::vector of length 4, capacity 4 = {4 '\\004', 0 '\\000', 0 '\\000',

    0 '\\000'}}, m_opcode = 288}

    status = 4

    possibly a trap for !pItem2 here,

    Item* const pItem2 = m_bot->GetItemByPos(INVENTORY_SLOT_BAG_0, equipSlot);

    if(!pItem2)

    continue; // or return;

    ItemPrototype const *pProto = pItem2->GetProto();

    Hope this helps

  3. sheesh (if it just didn't take so long to recompile heh)

    The code your recompiling doesn't contain ScriptDev2 code too, does it. When I'm doing development work, I leave that out and the code recompiles much quicker. It's a pain when you edit header files because the compiler will insist on a complete rebuild. Just a thought ;)

  4. Sorry for the buggyness

    No at all, the work is in development and you would expect issues. Sorry, I didn't understand the scope of the command (only for looting). I did try including the call code

    if (AutoEquipPlug == 1 )

    {

    Player* const bot = GetPlayerBot();

    AutoUpgradeEquipment(*bot);

    }

    in both TRADE_STATUS_TRADE_ACCEPT (item received through trade) & SMSG_ITEM_PUSH_RESULT (item created, bought or generally received)handlers in PlayerbotAI.cpp and I found something interesting on trading. The item appears to be equipped and then unequipped. The darkmoon vest is no longer 'bind when equipped' but is now soulbound.

    EDIT@ I can confirm that my hunter auto-equipped a pair of gloves after looting :)

    No hurry, everything is relaxed here, only do work when you want. Drive safely ;)

    Hope this helps

  5. Hi Gitch,

    I'm currently testing your 'autoequip'

    I first enabled it

    /w ten autoequip

    I then got my rogue bot to purchase a 'rogue deck' from the local auctioneer. I created a suitable 'darkmoon vest' (leather), but the rogue refuses to autoequip. It's certainly the best item he has and there are no restrictions (armour or level) preventing him from using it. One possiblity is that it is a 'bind when equipped' item. Does the code only work for ordinary items? , I haven't taken a closer look at the code yet so I can't comment

    Cheers

  6. Hi kennumen,

    Thank for the information. I have revised the pet tame code to force the application of 'Aspect of the Monkey' if available, as you suggested.

    https://github.com/blueboy/portalone/commit/5dc8a56a131a26ffb6913ce9f3f0d7358f6dcc4b

    I have also taken the liberty of pushing a patch to portalone that you authored back in November for portal - "Minimize impact on World.cpp". When I created the code for MaNGOS One I used the PlayerbotMgr.cpp from the MaNGOS code. This only contains only part of the code you originally pushed. It was 'nightterror' who drew this to my attention recently. I have now remedied this ;)

    Cheers

  7. Hi blueboy thanks for your work.

    When i enter with my bot in a raid instance (Molten Core for example) the bot not enter in the instance, how i can solve this ?

    Thanks again.

    Hi,

    Although this is off the topic of playerbot.

    I seem to remember sometime back, someone asked the same question. I believe there is a condition in the game itself. You need to complete the following quest,

    Attunement to the Core

    Presumably you will need to get all the bots to complete this quest too

    Hope this helps

  8. Hi Gitch,

    Druid bots: Upon accepting the quest 'Moonglade', the bot should learn the spell "Tele: MoonGlade". Didnt work for my bot, had to log her in and get it manually. (tho it appears that quest is still realllllly buggy)

    I had that problem, the druid has the quest but not the spell 'Teleport: MoonGlade'. I did visit wowhead and apparently this spell is only available to druids at level 15. Mine is only at level 12. If this is so, surely they should prevent the druid from getting the quest until it reaches level 15.

    I have taken kennumen advice and revised the tame code to apply the aura "Aspect of the Monkey". As the bot never enters BOTSTATE_COMBAT (i.e so combat AI never used) during the taming process it was necessary to apply it (if available) as the command starts. I tested it with and without the aura and it certainly helps. I was able to tame a creature at the same level as the bot, with the aura. I'll be posting the revision shortly

    EDIT@ O.K There is no mechanism in the playerbot code to receive the spell 'Teleport: MoonGlade', once your druid accepts the quest 'Heeding the Call'. It works for the player druid. As this is a druid only quest, only druids should really ever go to MoonGlade. It just so happens that playerbot allows party members to be teleported to the player's location. So it seems a pointless exercise to fix this to allow the druid bot to receive the teleport spell. If you get the bot to cast the spell, it teleports to MoonGlade and then is immediately summoned to the master's location. No way around this guys, for druids they will need to learn the shapshifting abilities as the player. You can of course continue as the druid bot once all the party has reached MoonGlade.

    Hope this helps

  9. Hi kennumen,

    Good tip about the 'Aspect of the Monkey'. That will certainly improve the bot's chances of taming. I was a little puzzled by your comment

    No hunter worth his salt ever uses the 'dismiss pet' spell anyway, on account of it lowering the pets happiness.

    Sorry, I was not referring to temporary dismissal of the pet, but permanently abandoning the pet. You won't be able to tame a new pet until you either stable the old one or get rid of it. The 'dismiss pet' spell won't do. I know my son loves to acquire a more and more exotic pet and this patch was for him. I would be interested if someone with an 'Uber' hunter bot could test whether it can tame exotic pets. I have a feeling that a more advanced taming spell will be required.

    Cheers

  10. @blueboy,

    Wont get to test this new ai til tomorrow night, but one question that popped into my mind is:

    have you looked into how the hunter bot will feed the pet? Just curious, I know this is just an initial phase!

    The pet will start out unhappy. Will definitely test this out tomorrow. :D

    Hi Gitch,

    Hunter bot feeding was one of the first things I tackled after joining playerbot three years ago. It should be automatic. If your hunter bot has the right food in it's inventory for the pets diet, it will feed the pet until it is no longer unhappy. The pet does start out unhappy and if you watch the hunter bot will feed the pet.

    One thing I have thought about was an option whereby the hunter replenishes it's larder with suitable food for it's pet. Definitely one for the 'todo' list which I also have to do :rolleyes:

    Cheers

  11. For anyone trying to compile Playerbot for Mangos One, there is a line missing in PlayerbotMgr.cpp

    that line is:

    #include "config.h"
    

    That should let you compile

    Thanks for the feedback. That's odd :/ the code compiled fine on my boxes. I'll take a closer look

    Cheers

  12. Hi Guys,

    I've been working on extending pet management commands, primarily for hunter bots.

    Background that led to this work.

    I was messing with the revised 'use' command and wondered whether I could lead my hunter bot through it's taming quests. I was pleased to find that I could. One difference I noticed was that the bot has to own the tamed pets for the stipulated time period (~15 minutes - unless of course it dies), in order to progress to the next quest (There is currently no way for bots to abandon pets directly - Yet ;)) However, once the bot had the ability to tame, I found that simply casting the 'tame beast' spell (spellid - 1515) on a chosen creature would not work.

    I have now created the 'tame' sub-command for the 'pet' command

    /t botname or /p pet tame <player selected creature>

    Initially tested with player and single hunter bot

    The bot will travel to within casting range of the creature and begin taming. At this point the creature will begin attacking the bot. The trick was to allow the bot to tame the creature without it killing the creature first. So I needed to write code that would keep casting the 'tame beast' spell (should it fail) and prevent the bot from retaliating too much. To acheive this I have created a new BOTSTATE flag (BOTSTATE_TAME) that controls the taming code, located in the playerbot UpdateAI() function. So 'tame beast' will be cast again & again (should it fail), until the pet is tamed or until the hunter/creature is dead.

    Taming is difficult for a player hunter, particularly for elite pets. I'm pleased that this command doesn't make it any easier. More often than not the bot or the creature will be killed. Tip: Use a healer for the player, this way you can at least ensure that the bot will survive.

    Getting a hunter bot to tame a creature, while the remainng party looks on

    Unfortunately, the normal AI will not allow this. Each bot has an it's own attackers list. If this list is empty the bot while not enter combat mode and thus react. To achieve this it will be necessary for you to order the bots to behave passively. I have created a new combat order (co) (ORDERS_PASSIVE). It's a little awkward, but if you use macros to toggle the combat orders then it's no biggie ;)

    Example

    Normal combat order macros

    .bot co one tank // warrior bot

    .bot co two heal // priest bot

    .bot co three assist one // hunter bot

    etc..

    Taming combat order macros

    .bot co one passive

    .bot co two passive

    Note that it's not necessary to make the hunter passive as it will be focused on taming, rather than fighting. The passive flag essentially prevents the bot attackers list from being updated.

    If you should get tired of the pet, then I have now added an 'abandon' sub-command to the 'pet' command list.

    /t botname or /p pet abandon

    This will abandon the current hunter pet. Please note that 'tame' and 'abandon' will not work for warlock pets. The code checks whether the bot has the 'tame beast' spell in it's spellbook (i.e also not available for low level hunters) and as you know, warlock pets cannot be abandoned.

    I will be pushing the code the the new-ai branch shortly. I would be grateful if you could provide feedback. I have only tested the code on low level pets so far. Not sure how it will perform with exotic pets?

    Hope this helps

  13. Hi Gitch,

    I understand, everyone is nervous about messing things up to begin with ;)

    I would recommend you use the 'master' as the base code for your branch, rather than using a sub-branch like 'new-ai'. You can if you wish, merge 'new-ai' into this (git merge origin/new-ai). If you want to push to 'new-ai' that's fine (help below)...

    It best the visualise a git repository like the trunk and branches of a tree. The trunk will be the 'master' and the branches come off this.

    What you need to do is create a branch of your own (choose a name and replace 'new_branch_name')

    1. Create a local repository for your code

    git clone [email protected]:blueboy/portal.git new_branch_name

    cd new_branch_name

    2. Create a remote branch (new_branch_name) off the 'master'

    git push origin origin:refs/heads/new_branch_name

    3. Track your remote branch from your local branch

    git checkout --track -b new_branch_name origin/new_branch_name

    This will allow you to 'git push' or 'git pull' to & from your local repo, directly to your remote repo

    :~/portal> git branch -a

    * master

    remotes/origin/HEAD -> origin/master

    remotes/origin/autobot

    remotes/origin/loot-fix-bt

    remotes/origin/master

    remotes/origin/new-ai

    remotes/origin/sharedbots

    remotes/origin/talentspec

    Shows the current layout of the portal master and it's associated remote branches.

    4. To merge one branch into another (e.g master into new_branch_name, after say a core update), inside new_branch_name

    git merge origin/master

    If there are no merge conflicts, a 'git status' or 'git log' should show that the merge was successful. If you do get conflicts then these will need to be addressed before the merge takes. I will discuss this with you later.

    -----------------------------------------------------------

    If you wish to add your code to an existing branch (e.g new-ai) follow the steps above. Omit step 2. and replace 'new_branch_name' with new-ai. You will then have a local repository 'new-ai' that can be used to update the remote 'new-ai' branch directly. The normal state for the local branch should be,

    :~/portal> git status

    # On branch master

    nothing to commit (working directory clean)

    You can now apply local patches to the code or manually edit the files. Once done, repeat 'git status' and you will be notified which files have been modified.

    To commit the changes (example)

    git add /src/game/playerbot/PlayerbotAI.cpp

    git add /src/game/playerbot/PlayerbotAI.h

    etc..

    repeat for all modified files. Once done, you need to finalise the commit prior to pushing

    git commit -a -m "This is a decription of my commit"

    Then 'git log' should preview what the commit description will look like online. If you're happy :D

    git push

    If not, and wish to edit the commit

    git commit --amend

    Will open the commit header description, with your default editor. Edit the description and save, then 'git push'

    To Remove an unpushed commit altogether from your local repo, should things go pear shaped. (Remember: Once you push, it is nigh impossible to remove your commit, so carefully consider what your pushing).

    git rebase -i HEAD~2

    Your editor will open allowing you to change things (follow the instructions)

    To set default editor ("notepad" or your preferred editor should be in the directory path)

    git config --global core.editor "notepad"

    That more than enough for the moment :o

    Hope this helps

  14. Hi Gitch,

    i get an error saying -m is not an option for grep.

    No worries, I frequently get asked this question from windows users. The 'git-bash' shell contains an old version of grep.exe that does not have the '-m' option. Easily solved. Locate the folder holding the shell binaries. Then download from GNU (version 2.5.4 or greater) the updated binary & dependancies (libiconv2.dll,libintl3.dll,pcre3.dll & regex2.dll),

    grep.exe update

    Copy these to the binary folder and your running.

    Hope this helps

  15. Hi Gitch,

    I've added you to the collaborators list for 'portal'. You will now be able to create your own work space (branch) off the 'portal master', for your development work and push/pull code when you wish. If you have any questions, don't hesitate to ask.

    Hope this helps

  16. Hi Gitch,

    Indeed, welcome aboard ;)

    git pull [email protected]:blueboy/portal.git new-ai:master

    I get permission denied (publickey)

    Not surprising. I checked Github and you haven't yet got an account, or at least one with the user name 'Gitch'. You will need to create one (it's free) and you will create a 'key pair' in the process. Github recognises

    [email protected]:blueboy

    separated by a colon as collaborator (read/write) access. It will expect a valid 'pass phrase' associated with your 'public key' to access the online repos. Create your account and I will add you to the collaborators list.

    git pull git://github.com/blueboy/portal.git new-ai:master

    Will work for guest readonly access.

    Hope this helps

  17. Hi Gitch,

    After the first patch, did you edit the code manually? I moved the code for the patch further on down below the declaration of spellId.

    so we need the reposition the patch in the function UseItem() to check for possible spellId.

    uint32 spellId = 0;

    for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)

    {

    if (item->GetProto()->Spells[ i ].SpellId > 0)

    {

    spellId = item->GetProto()->Spells[ i ].SpellId;

    break;

    }

    }

    if ((item->GetProto()->Flags & ITEM_FLAG_LOOTABLE) && spellId == 0)

    {

    // Open quest item in inventory, containing related items (e.g Gnarlpine necklace, containing Tallonkai's Jewel)

    WorldPacket* const packet = new WorldPacket(CMSG_OPEN_ITEM, 2);

    *packet << item->GetBagSlot();

    *packet << item->GetSlot();

    m_bot->GetSession()->QueuePacket(packet); // queue the packet to get around race condition

    return;

    }

    WorldPacket *packet = new WorldPacket(CMSG_USE_ITEM, 28);

    *packet << bagIndex << slot << cast_count << spellId << item_guid

    Sorry for any confusion I may have caused.

  18. Hi All,

    @kennumen Sorry for not fixing it before, but we got there eventually ;) I'll have to read the todo list again and see what else needs attention.

    @Gitch

    THE CASE OF MYSTERIOUS PARENTHESIS

    I'm amazed it works without the parenthesis. Chances are your compiler will send out warnings as the code builds. It normally likes separate conditional expressions to be contained in parenthesis to satisfy logic.

    I had similar problems with quest:Druid of the Claw. The server output was suggesting an inventory failure for me. I got the bots to drop some useless items and targeted the druids corpse. I Then,

    /p use [Voodoo Charm]

    and it then worked.

    @hurrensohn Glad the MaNGOS One code is behaving itself ;)

    Cheers

  19. As I suspected.

    You fix one thing and break another..

    My fix was flawed, but it was 4 in the morning when I wrote it {)

    The fix works fine for the quest 'Ferocitas the Dream Eater' to recover 'Tallonkai's Jewel', but it breaks the ability to fill phials for the 'Crown of the Earth' quests. Easily solved.

    Gitch pointed out that

    Bot whispers: Can't find spell entry for spell 0 on item 8049"

    Quest items like those for the quest 'Crown of the Earth' do possess spell entries, so we need the reposition the patch in the function UseItem() to check for possible spellId.

    Revised Patch

    diff --git a/src/game/playerbot/PlayerbotAI.cpp b/src/game/playerbot/PlayerbotAI.cpp
    index 3bf733c..c4b531d 100644
    --- a/src/game/playerbot/PlayerbotAI.cpp
    +++ b/src/game/playerbot/PlayerbotAI.cpp
    @@ -5744,6 +5744,16 @@ void PlayerbotAI::UseItem(Item *item, uint32 targetFlag, ObjectGuid targetGUID)
            }
        }
    
    +    if (item->GetProto()->Class == ITEM_CLASS_QUEST && spellId == 0)
    +    {
    +        // Open quest item in inventory, containing related items (e.g Gnarlpine necklace, containing Tallonkai's Jewel)
    +        WorldPacket* const packet = new WorldPacket(CMSG_OPEN_ITEM, 2);
    +        *packet << item->GetBagSlot();
    +        *packet << item->GetSlot();
    +        m_bot->GetSession()->QueuePacket(packet); // queue the packet to get around race condition
    +        return;
    +    }
    +
        WorldPacket *packet = new WorldPacket(CMSG_USE_ITEM, 28);
        *packet << bagIndex << slot << cast_count << spellId << item_guid
                << glyphIndex << unk_flags << targetFlag;
    

    EDIT@ I will be pushing this fix to the repos shortly. Hold fast, I found a different instance where this doesn't work. You maybe aware that the "Lunar Festival" quest is active at present. Each questgiver give a "Coin of Ancestry" and an email. The email includes a "Lucky Red Envelope". It's this that causes the problem. To resolve this I examined the data (item_template in World database) for each item causing issues.

    Item Item (entry) Item (Flags) Item (spellid_1) bitwise (&)

    Gnarlpine necklace 8049 2052 (0x00000804) 0 ITEM_FLAG_LOOTABLE

    Tourmaline Phial 5621 64 (0x00000040) 6610 False

    Lucky Red Envelope 21746 4 (0x00000004) 0 ITEM_FLAG_LOOTABLE

    I have changed the patch condition from

    + if (item->GetProto()->Class == ITEM_CLASS_QUEST && spellId == 0)

    to

    + if ((item->GetProto()->Flags & ITEM_FLAG_LOOTABLE) && spellId == 0)

    so, revision 2 of the patch is

    Revision 2

    diff --git a/src/game/playerbot/PlayerbotAI.cpp b/src/game/playerbot/PlayerbotAI.cpp
    index 3bf733c..c4b531d 100644
    --- a/src/game/playerbot/PlayerbotAI.cpp
    +++ b/src/game/playerbot/PlayerbotAI.cpp
    @@ -5744,6 +5744,16 @@ void PlayerbotAI::UseItem(Item *item, uint32 targetFlag, ObjectGuid targetGUID)
            }
        }
    
    +    if ((item->GetProto()->Flags & ITEM_FLAG_LOOTABLE) && spellId == 0)
    +    {
    +        // Open quest item in inventory, containing related items (e.g Gnarlpine necklace, containing Tallonkai's Jewel)
    +        WorldPacket* const packet = new WorldPacket(CMSG_OPEN_ITEM, 2);
    +        *packet << item->GetBagSlot();
    +        *packet << item->GetSlot();
    +        m_bot->GetSession()->QueuePacket(packet); // queue the packet to get around race condition
    +        return;
    +    }
    +
        WorldPacket *packet = new WorldPacket(CMSG_USE_ITEM, 28);
        *packet << bagIndex << slot << cast_count << spellId << item_guid
                << glyphIndex << unk_flags << targetFlag;
    

    Hope this helps

  20. Hi Gitch,

    Glad it works O.K. Keep an eye on the 'use' command just in case the fix causes it to misfire for other types of items. If you wish to get more involved, I can add you to our 'Collaborators List' for the repos. Then, once your settled with 'git' (if you have any particular queries, just ask. We all needed help with git initially) you can push your own code.

    @UnkleNuke Thanks, I couldn't have put it better ;) Playerbot wouldn't be what it is today without the excellent contributions from numerous dedicated individuals, who love the mod as much as I do.

    Cheers

  21. ******New problem encountered*******

    Item 8049, Gnarlpine necklace; 1 of 3 items with 'flags' set to 2052 (just to help ya if you need to locate it)

    Can't find spell entry for spell %u on item %u"

    Bot whispers: Can't find spell entry for spell 0 on item 8049"

    Thanks for the info on this. I'll check it out this evening and get back to you.

    EDIT@ I see what you mean. I have created a patch for you to test out. It works on my server.

    In game,

    /t botname or /p use [Gnarlpine Necklace]

    and 'Tallonkai's Jewel' will be placed in the bots inventory, destroying the 'Gnarlpine necklace' as it should.

    diff --git a/src/game/playerbot/PlayerbotAI.cpp b/src/game/playerbot/PlayerbotAI.cpp
    index 3bf733c..b438b94 100644
    --- a/src/game/playerbot/PlayerbotAI.cpp
    +++ b/src/game/playerbot/PlayerbotAI.cpp
    @@ -5734,6 +5734,16 @@ void PlayerbotAI::UseItem(Item *item, uint32 targetFlag, ObjectGuid targetGUID)
            return;
        }
    
    +    if (item->GetProto()->Class == ITEM_CLASS_QUEST)
    +    {
    +        // Open quest item in inventory, containing related items (e.g Gnarlpine necklace, containing Tallonkai's Jewel)
    +        WorldPacket* const packet = new WorldPacket(CMSG_OPEN_ITEM, 2);
    +        *packet << item->GetBagSlot();
    +        *packet << item->GetSlot();
    +        m_bot->GetSession()->QueuePacket(packet); // queue the packet to get around race condition
    +        return;
    +    }
    +
        uint32 spellId = 0;
        for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
        {
    

    Cheers

  22. Hi Gitch,

    On the first post for this thread I have included a link to playerbot wiki. This resource provides scripts, documentation & information all about playerbot.

    The gameobject collect feature created by BThallid works very well. Only quest items (and skinning objects, if bot has SKINNING) are collected automatically. All other items require manual training (i.e successfully collect an object once). You will also need to check that collect is configured to collect the particular object in 'playerbot.conf'. These provide the default settings that can be overridden in the game using

    collect OBJECT Sets collect status, OBJECT = [ all | none | combat | loot | objects | profession* | quest ]

    * profession refers to herb or mining collection. The 'skin' status override option is only available, if the bot has the skill

    To initially locate example gameobjects,

    /t botname or /p survey

    To train collect,

    /t botname or /p get [gameobject link]

    If the bot fulfills the collection criteria (i.e can successfully collect - has skill) the gameobject will be added to the collection list, until you log out. When you log in again, all required quest objects will be added to this list, but you will again need to train collect for other items

    Hope this helps

  23. Is there any particular technical reasoning behind your choice to use YTDB instead of UDB, blueboy?

    It may be there's just enough difference between the two databases to explain some Playerbot errors.

    No technical reason, just a personal preference :) I acknowledge that many users prefer UDB and this was why it was important to resolve the playerbot errors.

    The crash occured because the pointer 'cSpells' returned a NULL value.

    TrainerSpellData const* cSpells = creature->GetTrainerSpells();

    It just so happens that this does not occur with the YTDB data, but does for UDB. I should have built in a check on the validity of the cSpells value before using it here

    TrainerSpell const* trainer_spell = cSpells->Find(spellId);

    My bad, and not a crticism of either YTDB or UDB.

  24. Hi Gitch,

    Thanks for your time testing this issue out. Sorry you might not have noticed that I edited my last post. I found the problem.

    Call stack:

    Address Frame Function SourceFile

    004E5DCE 00000000 stdext::_Hash<std::tr1::_Umap_traits<unsigned int,TrainerSpell,stdext::_Hash_compare<unsigned int,std::tr1::hash<unsigned int>,std::equal_to<unsigned int> >,std::allocator<std::pair<unsigned int const ,TrainerSpell> >,0> >::lower_bound+1E

    004D9E49 00000000 TrainerSpellData::Find+19

    0056224D 00000000 PlayerbotAI::_HandleCommandSkill+45D

    TrainerSpellData::Find(uint32 spellId) is called using either cSpell or tSpell pointers. With UDB data one of these had a NULL value, thus the crash. I have now revised the code to test both before they are used and assign the most appropriate. When I first created the command my choice of variable names was also poor

    1. trainer_spell

    2. trainer_spells

    and this might have caused confusion. I have now renamed 'trainer_spells' to 'all_trainer_spells'. At present I'm just testing the patch with all repo code before pushing it. If you would like to try it before on your server, here's the patch (currently only tested on portal master code).

    (N.B If your using windows save the pasted patch with 'unicode' encoding and newline at EOF)

    diff --git a/src/game/playerbot/PlayerbotAI.cpp b/src/game/playerbot/PlayerbotAI.cpp
    index 9107b82..20e77e4 100644
    --- a/src/game/playerbot/PlayerbotAI.cpp
    +++ b/src/game/playerbot/PlayerbotAI.cpp
    @@ -7496,8 +7496,13 @@ void PlayerbotAI::_HandleCommandSkill(std::string &text, Player &fromPlayer)
    
            // check present spell in trainer spell list
            TrainerSpellData const* cSpells = creature->GetTrainerSpells();
    -        TrainerSpellData const* tSpells = creature->GetTrainerTemplateSpells();
    -        if (!cSpells && !tSpells)
    +        TrainerSpellData const* tSpells = creature->GetTrainerTemplateSpells();
    +
    +        TrainerSpellData const* all_trainer_spells = cSpells;
    +        if (!all_trainer_spells)
    +           all_trainer_spells = tSpells;
    +
    +    if (!all_trainer_spells)
            {
                SendWhisper("No spells can be learnt from this trainer", fromPlayer);
                return;
    @@ -7521,10 +7526,7 @@ void PlayerbotAI::_HandleCommandSkill(std::string &text, Player &fromPlayer)
                    if (!spellId)
                        break;
    
    -                TrainerSpell const* trainer_spell = cSpells->Find(spellId);
    -                if (!trainer_spell)
    -                    trainer_spell = tSpells->Find(spellId);
    -
    +                TrainerSpell const* trainer_spell = all_trainer_spells->Find(spellId);
                    if (!trainer_spell || !trainer_spell->learnedSpell)
                        continue;
    
    @@ -7583,11 +7585,7 @@ void PlayerbotAI::_HandleCommandSkill(std::string &text, Player &fromPlayer)
            {
                msg << "The spells I can learn and their cost:\\r";
    
    -            TrainerSpellData const* trainer_spells = cSpells;
    -            if (!trainer_spells)
    -                trainer_spells = tSpells;
    -
    -            for (TrainerSpellMap::const_iterator itr =  trainer_spells->spellList.begin(); itr !=  trainer_spells->spellList.end(); ++itr)
    +            for (TrainerSpellMap::const_iterator itr =  all_trainer_spells->spellList.begin(); itr !=  all_trainer_spells->spellList.end(); ++itr)
                {
                    TrainerSpell const* tSpell = &itr->second;
    
    

    EDIT@ Sorry Gitch I have been calling you 'Glitch' by mistake. I guess errors happen ;)

    Hope this helps

×
×
  • 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