Jump to content

blueboy

Members
  • Posts

    723
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything 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 (Wowhead has this listed as a level 10 item) Autoequip insists on equpping him with (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. possibly a trap for !pItem2 here, Hope this helps
  3. 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. 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 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, 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, 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 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. 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. 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 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 Taming combat order macros 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. 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 2. Create a remote branch (new_branch_name) off the 'master' 3. Track your remote branch from your local branch This will allow you to 'git push' or 'git pull' to & from your local repo, directly to your remote repo 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 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, 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) etc.. repeat for all modified files. Once done, you need to finalise the commit prior to pushing Then 'git log' should preview what the commit description will look like online. If you're happy If not, and wish to edit the commit 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). 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) That more than enough for the moment Hope this helps
  14. Hi Gitch, 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 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. 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 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, and it then worked. @hurrensohn Glad the MaNGOS One code is behaving itself Cheers
  19. As I suspected. 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 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. I have changed the patch condition from to 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. 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, 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 * 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, To train collect, 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. 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.
  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. 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