Jump to content

blueboy

Members
  • Posts

    723
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by blueboy

  1. Hi klyxmaster, Does your server code include 'debug info'. I have noticed a nasty exit myself when I have included 'debug info'. If you compile the code without, it should be O.K. EDIT: Here is a snippet from my server output window I know, your going to reply that your haven't got 'debug info' in your code. In which case, it might be worth posting as a bug to the core guys as playerbot shouldn't effect the mangosd daemon code in any way. Hope this helps
  2. The playerbot they have integrated into mangosR2 differs in many respects our playerbot. They do not use 'botguy' They have moved the playerbot config options from the dedicated 'playerbot.conf' file, back to 'mangosd.conf'. Not convinced that was a good move. Who knows, they may have also disabled the 'PlayerbotAI.MaxNumBots' option in the code. They have recently experienced numerous crashes that do not occur with playerbot with MaNGOS. Fixes were posted, but I was reluctant to apply these to our code as nothing was broken. I'll take a quick look at their code to see if there is a reason why the bot limit doesn't work. EDIT: yes I don't know what they have done with this option. There is no longer a check in PlayerbotMgr.cpp to stop you from exceeding the limit from the commandline and they are doing something different in World.cpp that doesn't make sense. There are two ways to stop certain bots from assisting in an attack. 1. If the player acts as a general and just commands the bots to attack. Simply 'uninvite' that bot from the group, then /p attack The bot will remain close by the player and will not assist the other bots. 2. If the player intends on attacking with the other bots, then command the bot to 'stay'. If the target is beyond 'ranged attack' distance it will do nothing. Hope this helps
  3. Hi, Hmm, I'm not sure that is the accepted way to close the mangosd daemon. Fine to use ctrl-c to close the realmd daemon, but for mangosd/mangosd.exe I think it would be better to server shutdown <time delay> at the server console. Hope this helps
  4. Hi Kreegoth, I've just tested it. In playerbot.conf I tried three ways to exceed the limit I have a macro to summon all member bots in my group Bot added successfully You cannot summon anymore bots (Current Max: 1) You cannot summon anymore bots (Current Max: 1) You cannot summon anymore bots (Current Max: 1) I tried at the command line You cannot summon anymore bots (Current Max: 1) and I also tried to summon a bot via 'botguy' You cannot summon anymore bots (Current Max: 1) I seem to be the only person with working code EDIT: Your not using 'sharedbots' by any chance. I'm not sure what effect the limit would have, if you are trying to summon bots from more than one account. Let me know
  5. Hi, Glad you got 'SellGarbage' to work Many of the recent features added to playerbot for MaNGOS have not yet been transferred to playerbot for MaNGOS Zero. The bots should be able to accept class quests, using the improved 'quest' command that is not available for MaNGOS Zero. It should work when I get around to doing it, but time is a killer. The only problem with bot class quests is that quest indicators (! or ?) on the main and minmap are only listed for the player character. Normally, class quests are issued by the appropriate class trainer, so look out for these guys. If you use an addon such as 'EveryQuest' this will indicate all possible questgivers on the map, regardless of class. It still guess work, but it's worth visiting all potential npcs and doing a group request, /p quest list N.B Occasionally you might need to move the player's position to relocate the bots. Sometimes one or more might not be close enough to the questgiver for it to display all available quests for all bots. Then re-try the above command. Hope this helps
  6. Hi, I'm testing 'Chatter' (version 1.2.11-4) myself and it appears to work fine. With the default settings, I'm not getting any unwanted chat to playerbot, so it's not necessary to add a filter. One thing I noticed was that the chat dialog window doesn't always scroll. After selecting a trainer, I entered and I appeared to get nothing. When I manually scrolled the Chatter window, it was all there at the end. As you can see neither bot has any spells to learn. In fact neither can learn any spells from this particular trainer. Thanks for introducing me to this addon. My eye sight isn't as good as it was and the Chatter display is very pleasant. Concerning the crash, if your only running playerbot with MaNGOS, there must be something wrong with your build. One possibility, is the OS or hardware compatibility leading to a runtime crash. Your using 'Vista' or Server 2008 (according to the crash log), is this 32 or 64 bits implementation? and are you using VS 2008 or VS 2010? Hope this helps
  7. Hi Guys, @UnkleNuke Yes I agree, I think that's best approach, having the appropriate playerbot language data load at server start. @Schmoozerd Thanks, I'll look into that also. Cheers both
  8. Hi, I've had a quick look at your crash dump and it appears that the trainers window may have been open at the time of the crash. If so, your not using the 'skill' command properly. 1. As the player, just select the trainer so it is highlighted with selection ring around it's base. Do not activate the npc so it's 'gossipmenu' windows opens. 2. Enter the following to determine what skills can be learnt from this trainer If any are available, a [skill link] will be displayed in the general log. Remember you must select the [skill link] using your mouse, whilst holding down the shift key. It will then be echoed to the chat dialog window. 3. Enter Example EDIT: Concerning the chat issue can you post exactly what your entering, to get cheers Hope this helps
  9. Hi, All solved now. Sorry, in the excitment to change playerbot code I didn't sync the repositories with the core. Before this merge, the code was merged with MaNGOS [11846] that wouldn't include the TrainerSpell changes. So if you tried to compile the code on any branch as is, you would receive the error you got. All repositories are now merged with MaNGOS [11863] Hope this helps
  10. Hi, The redundant 5th parameter in the MovePoint() function. Yes thanks I'll have to update new-ai too Cheers
  11. Oh Boy, Do you ever get days when your computer does your head in. I got exactly what you got using notepad on xp. fatal: corrupt patch at line 612 It appears that you need to insert a newline at the end of the file before saving it. You also need to save the file with 'Unicode' encoding. It then applies O.K Ah! I see you appear to have got it to work. Hope this helps
  12. I use actually use EditPlus for windows (programmers editor) and nedit for linux. I'll try it out on windows and see if I get the same problem.
  13. Hi, Check the end of the patch you copied from the thread. Just in case you might have included some text from the post in the patch. I did the same when I tried it. You should just have only the 3 line pattern at the end. I know it works, I've just merged and compiled it You might also check that your text editor isn't adding something to the patch.
  14. 1) you can create a macro, .bot add one .bot add two /invite one /invite two but you will find that it will probably complain that bot 'one' or 'two' are not yet online, the first time you apply it. It will work the second time. It's difficult to introduce a delay into macros without problems. Perhaps you might wish to look into this, I've tried. 2) 'portal' or more correctly portal 'master' contain our beta test code. 'new-ai' is one of our alpha branches that contains untested code that isn't yet ready for general testing. Every so often we will merge the contents of these branches into portal 'master'. You are free to use the code on the alpha branches but any feedback you provide is for the developers information only (minimal support). Hope this helps
  15. Hi darkfr3ak, I think the best thing to do here is for me to provide you with a modified 'craft' patch that will merge with just the portal master code. Remember there are still features in new-ai that you won't have (i.e 'mail' and the modified 'use' command). diff --git a/bot_readme.txt b/bot_readme.txt index 3fff571..3d0bace 100644 --- a/bot_readme.txt +++ b/bot_readme.txt @@ -27,7 +27,23 @@ For a full list of commands, use '/t BOTNAME help' or various subcommands e.g. ' /t BOTNAME assist (you'll need to be attacking something and the bot only does melee atm) /t BOTNAME spells (replies with all spells known to bot) /t BOTNAME cast <SPELLID | (part of) SPELLNAME | [sPELLLINK]> -/t BOTNAME use [iTEM LINK] +/t BOTNAME craft < alchemy | a > (List all learnt alchemy [RECIPE]..) + < blacksmithing | b > (List all learnt blacksmith [RECIPE]..) + < cooking | c > (List all learnt cooking [RECIPE]..) + < engineering | e > (List all learnt engineering [RECIPE]..) + < firstaid | f > (List all learnt firstaid [RECIPE]..) + < inscription | i > (List all learnt inscription [RECIPE]..) + < jewelcrafting | j > (List all learnt jewelcrafting [RECIPE]..) + < leatherworking | l > (List all learnt leatherworking [RECIPE]..) + < magic | m > (List all learnt enchanting [RECIPE]..) + < smelting | s > (List all learnt mining [RECIPE]..) + < tailoring | t > (List all learnt tailoring [RECIPE]..) +/t BOTNAME craft [RECIPE] (craft any recipe that consumes reagents) +/t BOTNAME craft [RECIPE] all (craft all instances of a particular recipe, indicated by it's [charge]) +/t BOTNAME use [iTEM LINK] (use item on self) +/t BOTNAME use [iTEM LINK] TARGET (use item on selected unit) +/t BOTNAME use [iTEM LINK][EQUIPPED ITEM LINK] (use item on equipped item) +/t BOTNAME use [iTEM LINK][GAMEOBJECT LINK] (use item on gameobject ) /t BOTNAME equip [iTEM LINK] /t BOTNAME reset (will reset states, orders and loot list) /t BOTNAME report (bot reports all items, creatures or gameobjects needed to finish quests) diff --git a/src/game/playerbot/PlayerbotAI.cpp b/src/game/playerbot/PlayerbotAI.cpp index 59e1c00..92be366 100644 --- a/src/game/playerbot/PlayerbotAI.cpp +++ b/src/game/playerbot/PlayerbotAI.cpp @@ -1006,6 +1006,34 @@ void PlayerbotAI::HandleBotOutgoingPacket(const WorldPacket& packet) pSpell->cancel(); return; } + case SPELL_FAILED_REQUIRES_SPELL_FOCUS: + { + std::ostringstream out; + + SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId); + if (!spellInfo) + return; + + switch(spellInfo->RequiresSpellFocus) // SpellFocusObject.dbc id + { + case 1 : // need an anvil + out << "|cffff0000I Require an Anvil"; + break; + case 2 : // need a loom + out << "|cffff0000I Require a Loom"; + break; + case 3 : // need forge + out << "|cffff0000I Require a Forge"; + break; + case 4 : // need cooking fire + out << "|cffff0000I Require a Cooking Fire"; + break; + default: + out << "|cffff0000I Require Spell Focus on " << spellInfo->RequiresSpellFocus; + } + TellMaster(out.str().c_str()); + break; + } default: //DEBUG_LOG ("[%s] SMSG_CAST_FAIL: unknown (%u)",m_bot->GetName(),result); return; @@ -3347,6 +3375,29 @@ void PlayerbotAI::UpdateAI(const uint32 /*p_time*/) m_targetGuidCommand = ObjectGuid(); } + else if ( m_botState == BOTSTATE_CRAFT) + { + SpellEntry const* spellInfo = sSpellStore.LookupEntry(m_CurrentlyCastingSpellId); + if (!spellInfo) + return; + + Spell *spell = new Spell(m_bot, spellInfo, false); + if (!spell) + return; + + if (GetSpellCharges(m_CurrentlyCastingSpellId) == 0 || !CanStore() || spell->CheckCast(true) != SPELL_CAST_OK) + { + SetState(BOTSTATE_NORMAL); + SetIgnoreUpdateTime(0); + } + else + { + SpellCastTargets targets; + spell->prepare(&targets); + SetIgnoreUpdateTime(3); + } + } + //if master is unmounted, unmount the bot else if (!GetMaster()->IsMounted() && m_bot->IsMounted()) { @@ -3931,23 +3982,117 @@ bool PlayerbotAI::HasTool(uint32 TC) switch (TC) { - case TC_MINING_PICK: + case TC_MINING_PICK: // = 165 + + if (m_bot->HasItemTotemCategory(TC)) + return true; + else + out << "|cffff0000I do not have a MINING PICK!"; + break; + + case TC_ARCLIGHT_SPANNER: // = 14 + + if (m_bot->HasItemTotemCategory(TC)) + return true; + else + out << "|cffff0000I do not have an ARCLIGHT SPANNER!"; + break; + + case TC_BLACKSMITH_HAMMER: // = 162 + + if (m_bot->HasItemTotemCategory(TC)) + return true; + else + out << "|cffff0000I do not have a BLACKSMITH's HAMMER!"; + break; + + case TC_SKINNING_KNIFE: // = 166 + + if (m_bot->HasItemTotemCategory(TC)) + return true; + else + out << "|cffff0000I do not have a SKINNING KNIFE!"; + break; + + case TC_COPPER_ROD: // = 6, + if (m_bot->HasItemTotemCategory(TC)) + return true; + else + out << "|cffff0000I do not have a RUNED COPPER ROD!"; + break; + + case TC_SILVER_ROD: // = 7, + if (m_bot->HasItemTotemCategory(TC)) + return true; + else + out << "|cffff0000I do not have a RUNED SILVER ROD!"; + break; + + case TC_GOLDEN_ROD: // = 8, + if (m_bot->HasItemTotemCategory(TC)) + return true; + else + out << "|cffff0000I do not have a RUNED GOLDEN ROD!"; + break; + + case TC_TRUESILVER_ROD: // = 9, + if (m_bot->HasItemTotemCategory(TC)) + return true; + else + out << "|cffff0000I do not have a RUNED TRUESILVER ROD!"; + break; + + case TC_ARCANITE_ROD: // = 10, + if (m_bot->HasItemTotemCategory(TC)) + return true; + else + out << "|cffff0000I do not have a RUNED ARCANITE ROD!"; + break; + + case TC_FEL_IRON_ROD: // = 41, + if (m_bot->HasItemTotemCategory(TC)) + return true; + else + out << "|cffff0000I do not have a RUNED FEL IRON ROD!"; + break; + + case TC_ADAMANTITE_ROD: // = 62, + if (m_bot->HasItemTotemCategory(TC)) + return true; + else + out << "|cffff0000I do not have a RUNED ADAMANTITE ROD!"; + break; + + case TC_ETERNIUM_ROD: // = 63, + if (m_bot->HasItemTotemCategory(TC)) + return true; + else + out << "|cffff0000I do not have a RUNED ETERNIUM ROD!"; + break; + + case TC_RUNED_AZURITE_ROD: // = 101, + if (m_bot->HasItemTotemCategory(TC)) + return true; + else + out << "|cffff0000I do not have a RUNED AZURITE ROD!"; + break; + case TC_RUNED_COBALT_ROD: // = 189, if (m_bot->HasItemTotemCategory(TC)) return true; else - out << "|cffffffffI do not have a pick!"; + out << "|cffff0000I do not have a RUNED COBALT ROD!"; break; - case TC_SKINNING_KNIFE: + case TC_RUNED_TITANIUM_ROD: // = 190, if (m_bot->HasItemTotemCategory(TC)) return true; else - out << "|cffffffffI do not have a skinning knife!"; + out << "|cffff0000I do not have a RUNED TITANIUM ROD!"; break; default: - out << "|cffffffffI do not know what tool that needs!"; + out << "|cffffffffI do not know what tool that needs! TC (" << TC << ")"; } TellMaster(out.str().c_str()); return false; @@ -3977,6 +4122,75 @@ bool PlayerbotAI::HasSpellReagents(uint32 spellId) return true; } +uint32 PlayerbotAI::GetSpellCharges(uint32 spellId) +{ + const SpellEntry* const pSpellInfo = sSpellStore.LookupEntry(spellId); + if (!pSpellInfo) + return 0; + + if (m_bot->CanNoReagentCast(pSpellInfo)) + return 0; + + uint32 charges = 0; + std::list<uint32> chargeList; + for (uint32 i = 0; i < MAX_SPELL_REAGENTS; ++i) + { + if (pSpellInfo->Reagent[i] <= 0) + continue; + + uint32 totalcount = 0; + uint32 itemid = pSpellInfo->Reagent[i]; + uint32 count = pSpellInfo->ReagentCount[i]; + ItemCountInInv(itemid, totalcount); + chargeList.push_back((totalcount / count)); + } + + for (uint32 i = 0; i < MAX_SPELL_TOTEM_CATEGORIES; ++i) + { + if (pSpellInfo->TotemCategory[i] == 0) + continue; + + if (!m_bot->HasItemTotemCategory(pSpellInfo->TotemCategory[i])) + { + m_noToolList.push_back(pSpellInfo->TotemCategory[i]); + return 0; + } + } + + if (!chargeList.empty()) + { + charges = chargeList.front(); + chargeList.pop_front(); + for (std::list<uint32>::iterator it = chargeList.begin(); it != chargeList.end(); ++it) + if (*it < charges) + charges = *it; + } + return charges; +} + +void PlayerbotAI::ItemCountInInv(uint32 itemid, uint32 &count) +{ + for(int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) + { + Item *pItem = m_bot->GetItemByPos( INVENTORY_SLOT_BAG_0, i ); + if (pItem && pItem->GetEntry() == itemid && !pItem->IsInTrade()) + count += pItem->GetCount(); + } + + for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) + { + if (Bag* pBag = (Bag*)m_bot->GetItemByPos( INVENTORY_SLOT_BAG_0, i )) + { + for(uint32 j = 0; j < pBag->GetBagSize(); ++j) + { + Item* pItem = m_bot->GetItemByPos( i, j ); + if (pItem && pItem->GetEntry() == itemid && !pItem->IsInTrade()) + count += pItem->GetCount(); + } + } + } +} + // extracts all item ids in format below // I decided to roll my own extractor rather then use the one in ChatHandler // because this one works on a const string, and it handles multiple links @@ -6541,6 +6755,9 @@ void PlayerbotAI::HandleCommand(const std::string& text, Player& fromPlayer) else if (ExtractCommand("quest", input)) _HandleCommandQuest(input, fromPlayer); + else if (ExtractCommand("craft", input)) + _HandleCommandCraft(input, fromPlayer); + else if (ExtractCommand("pet", input)) _HandleCommandPet(input, fromPlayer); @@ -7305,14 +7522,14 @@ void PlayerbotAI::_HandleCommandTalent(std::string &text, Player &fromPlayer) if (!ApplyActiveTalentSpec()) { SendWhisper("The talent spec has been set active but could not be applied. It appears something has gone awry.", fromPlayer); - //DEBUG_LOG ("[PlayerbotAI]: Could set TalentSpec but could not apply it - 'talent spec #': Class: %i; chosenSpec: %li", (long)m_bot->getClass(), chosenSpec); + //DEBUG_LOG ("[PlayerbotAI]: Could set TalentSpec but could not apply it - 'talent spec #': Class: %li; chosenSpec: %u", (long)m_bot->getClass(), chosenSpec); } InspectUpdate(); } else { SendWhisper("An error has occured. Please let a Game Master know. This error has been logged.", fromPlayer); - DEBUG_LOG ("[PlayerbotAI]: Could not GetTalentSpec to set & apply - 'talent spec #': Class: %i; chosenSpec: %li", (long)m_bot->getClass(), chosenSpec); + DEBUG_LOG ("[PlayerbotAI]: Could not GetTalentSpec to set & apply - 'talent spec #': Class: %li; chosenSpec: %u", (long)m_bot->getClass(), chosenSpec); } } } @@ -7558,6 +7775,196 @@ void PlayerbotAI::_HandleCommandCollect(std::string &text, Player &fromPlayer) SendWhisper("I'm collecting nothing.", fromPlayer); } +void PlayerbotAI::_HandleCommandCraft(std::string &text, Player &fromPlayer) +{ + DEBUG_LOG("Craft (%s)",text.c_str()); + + std::ostringstream msg; + uint32 charges; + uint32 skill; + int32 category; + uint32 linkcount = 0; + + if (ExtractCommand("alchemy", text, true)) // true -> "craft alchemy" OR "craft a" + { + if (m_bot->HasSkill(SKILL_ALCHEMY)) + { + skill = SKILL_ALCHEMY; + category = SKILL_CATEGORY_PROFESSION; + } + else + return; + } + else if (ExtractCommand("blacksmithing", text, true)) // true -> "craft blacksmithing" OR "craft b" + { + if (m_bot->HasSkill(SKILL_BLACKSMITHING)) + { + skill = SKILL_BLACKSMITHING; + category = SKILL_CATEGORY_PROFESSION; + } + else + return; + } + else if (ExtractCommand("cooking", text, true)) // true -> "craft cooking" OR "craft c" + { + if (m_bot->HasSkill(SKILL_COOKING)) + { + skill = SKILL_COOKING; + category = SKILL_CATEGORY_SECONDARY; + } + else + return; + } + else if (ExtractCommand("engineering", text, true)) // true -> "craft engineering" OR "craft e" + { + if (m_bot->HasSkill(SKILL_ENGINEERING)) + { + skill = SKILL_ENGINEERING; + category = SKILL_CATEGORY_PROFESSION; + } + else + return; + } + else if (ExtractCommand("firstaid", text, true)) // true -> "craft firstaid" OR "craft f" + { + if (m_bot->HasSkill(SKILL_FIRST_AID)) + { + skill = SKILL_FIRST_AID; + category = SKILL_CATEGORY_SECONDARY; + } + else + return; + } + else if (ExtractCommand("inscription", text, true)) // true -> "craft inscription" OR "craft i" + { + if (m_bot->HasSkill(SKILL_INSCRIPTION)) + { + skill = SKILL_INSCRIPTION; + category = SKILL_CATEGORY_PROFESSION; + } + else + return; + } + else if (ExtractCommand("jewelcrafting", text, true)) // true -> "craft jewelcrafting" OR "craft j" + { + if (m_bot->HasSkill(SKILL_JEWELCRAFTING)) + { + skill = SKILL_JEWELCRAFTING; + category = SKILL_CATEGORY_PROFESSION; + } + else + return; + } + else if (ExtractCommand("leatherworking", text, true)) // true -> "craft leatherworking" OR "craft l" + { + if (m_bot->HasSkill(SKILL_LEATHERWORKING)) + { + skill = SKILL_LEATHERWORKING; + category = SKILL_CATEGORY_PROFESSION; + } + else + return; + } + else if (ExtractCommand("magic", text, true)) // true -> "craft magic" OR "craft m" + { + if (m_bot->HasSkill(SKILL_ENCHANTING)) + { + skill = SKILL_ENCHANTING; + category = SKILL_CATEGORY_PROFESSION; + } + else + return; + } + else if (ExtractCommand("smelting", text, true)) // true -> "craft smelting" OR "craft s" + { + if (m_bot->HasSkill(SKILL_MINING)) + { + skill = SKILL_MINING; + category = SKILL_CATEGORY_PROFESSION; + } + else + return; + } + else if (ExtractCommand("tailoring", text, true)) // true -> "craft tailoring" OR "craft t" + { + if (m_bot->HasSkill(SKILL_TAILORING)) + { + skill = SKILL_TAILORING; + category = SKILL_CATEGORY_PROFESSION; + } + else + return; + } + else + { + uint32 spellId; + extractSpellId(text, spellId); + + SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId); + if (!spellInfo) + return; + + if (text.find("all",0) != std::string::npos) + { + m_CurrentlyCastingSpellId = spellId; + SetState(BOTSTATE_CRAFT); + } + else + { + SpellCastTargets targets; + Spell *spell = new Spell(m_bot, spellInfo, false); + spell->prepare(&targets); + } + return; + } + + m_spellsToLearn.clear(); + m_bot->skill(m_spellsToLearn); + SendWhisper("I can create:\\n", fromPlayer); + ChatHandler ch(&fromPlayer); + for (std::list<uint32>::iterator it = m_spellsToLearn.begin(); it != m_spellsToLearn.end(); ++it) + { + SkillLineEntry const *SkillLine = sSkillLineStore.LookupEntry(*it); + + if (SkillLine->categoryId == category && *it == skill) + { + for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) + { + SkillLineAbilityEntry const *SkillAbility = sSkillLineAbilityStore.LookupEntry(j); + if (!SkillAbility) + continue; + + SpellEntry const* spellInfo = sSpellStore.LookupEntry(SkillAbility->spellId); + if (!spellInfo) + continue; + + if (IsPrimaryProfessionSkill(*it) && spellInfo->Effect[EFFECT_INDEX_0] != SPELL_EFFECT_CREATE_ITEM) + continue; + + if (SkillAbility->skillId == *it && m_bot->HasSpell(SkillAbility->spellId) && SkillAbility->forward_spellid == 0 && ((SkillAbility->classmask & m_bot->getClassMask()) == 0)) + { + MakeSpellLink(spellInfo, msg); + ++linkcount; + if ((charges = GetSpellCharges(SkillAbility->spellId)) > 0) + msg << "[" << charges << "]"; + if (linkcount >= 20) + { + ch.SendSysMessage(msg.str().c_str()); + linkcount = 0; + msg.str(""); + } + } + } + } + } + m_noToolList.unique(); + for (std::list<uint32>::iterator it = m_noToolList.begin(); it != m_noToolList.end(); it++) + HasTool(*it); + ch.SendSysMessage(msg.str().c_str()); + m_noToolList.clear(); + m_spellsToLearn.clear(); +} + void PlayerbotAI::_HandleCommandQuest(std::string &text, Player &fromPlayer) { std::ostringstream msg; @@ -8350,6 +8757,28 @@ void PlayerbotAI::_HandleCommandHelp(std::string &text, Player &fromPlayer) return; } } + if (bMainHelp || ExtractCommand("craft", text)) + { + ch.SendSysMessage(_HandleCommandHelpHelper("craft ", "I will create a single specified recipe", HL_RECIPE).c_str()); + ch.SendSysMessage(_HandleCommandHelpHelper("craft [RECIPE] all", "I will create all specified recipes").c_str()); + + if (!bMainHelp) + { + ch.SendSysMessage(_HandleCommandHelpHelper("craft < alchemy | a >", "List all learnt alchemy recipes").c_str()); + ch.SendSysMessage(_HandleCommandHelpHelper("craft < blacksmithing | b >", "List all learnt blacksmith recipes").c_str()); + ch.SendSysMessage(_HandleCommandHelpHelper("craft < cooking | c >", "List all learnt cooking recipes").c_str()); + ch.SendSysMessage(_HandleCommandHelpHelper("craft < engineering | e >", "List all learnt engineering recipes").c_str()); + ch.SendSysMessage(_HandleCommandHelpHelper("craft < firstaid | f >", "List all learnt firstaid recipes").c_str()); + ch.SendSysMessage(_HandleCommandHelpHelper("craft < inscription | i >", "List all learnt inscription recipes").c_str()); + ch.SendSysMessage(_HandleCommandHelpHelper("craft < jewelcrafting | j >", "List all learnt jewelcrafting recipes").c_str()); + ch.SendSysMessage(_HandleCommandHelpHelper("craft < leatherworking | l >", "List all learnt leatherworking recipes").c_str()); + ch.SendSysMessage(_HandleCommandHelpHelper("craft < magic | m >", "List all learnt enchanting recipes").c_str()); + ch.SendSysMessage(_HandleCommandHelpHelper("craft < smelting | s >", "List all learnt mining recipes").c_str()); + ch.SendSysMessage(_HandleCommandHelpHelper("craft < tailoring | t >", "List all learnt tailoring recipes").c_str()); + if (text != "") ch.SendSysMessage(sInvalidSubcommand.c_str()); + return; + } + } if (bMainHelp || ExtractCommand("cast", text)) { ch.SendSysMessage(_HandleCommandHelpHelper("cast", "I will cast the spell or ability listed.", HL_SPELL).c_str()); @@ -8781,6 +9210,12 @@ std::string PlayerbotAI::_HandleCommandHelpHelper(std::string sCommand, std::str if (bReqLinkMultiples) oss << " [AUCTION] .."; } + else if (reqLink == HL_RECIPE) + { + oss << " [RECIPE]"; + if (bReqLinkMultiples) + oss << " [RECIPE] .."; + } else { oss << " {unknown}"; diff --git a/src/game/playerbot/PlayerbotAI.h b/src/game/playerbot/PlayerbotAI.h index b5f36eb..89b91de 100644 --- a/src/game/playerbot/PlayerbotAI.h +++ b/src/game/playerbot/PlayerbotAI.h @@ -1473,7 +1473,8 @@ public: BOTSTATE_DEAD, // we are dead and wait for becoming ghost BOTSTATE_DEADRELEASED, // we released as ghost and wait to revive BOTSTATE_LOOTING, // looting mode, used just after combat - BOTSTATE_FLYING // bot is flying + BOTSTATE_FLYING, // bot is flying + BOTSTATE_CRAFT // bot is crafting }; enum CollectionFlags @@ -1561,7 +1562,8 @@ public: HL_SPELL, HL_TARGET, HL_NAME, - HL_AUCTION + HL_AUCTION, + HL_RECIPE }; public: @@ -1672,6 +1674,8 @@ public: bool HasTool(uint32 TC); bool HasSpellReagents(uint32 spellId); + void ItemCountInInv(uint32 itemid, uint32 &count); + uint32 GetSpellCharges(uint32 spellId); uint8 GetHealthPercent(const Unit& target) const; uint8 GetHealthPercent() const; @@ -1832,6 +1836,7 @@ private: void _HandleCommandGet(std::string &text, Player &fromPlayer); void _HandleCommandCollect(std::string &text, Player &fromPlayer); void _HandleCommandQuest(std::string &text, Player &fromPlayer); + void _HandleCommandCraft(std::string &text, Player &fromPlayer); void _HandleCommandPet(std::string &text, Player &fromPlayer); void _HandleCommandSpells(std::string &text, Player &fromPlayer); void _HandleCommandSurvey(std::string &text, Player &fromPlayer); @@ -1891,6 +1896,7 @@ private: ObjectGuid m_lootPrev; // previous loot BotEntryList m_collectObjects; // object entries searched for in findNearbyGO BotTaxiNode m_taxiNodes; // flight node chain; + BotEntryList m_noToolList; // list of required tools uint8 m_collectionFlags; // what the bot should look for to loot uint32 m_collectDist; // distance to collect objects copy this to an empty file and save. Then apply from your <source root>, where 'bot_readme.txt' is located Hope this helps
  16. Ah, I've only just pushed that code so it's only on new-ai alpha branch. You can still use the 'craft' code with portal. Just create a snap-shot patch for just the 'craft' commit. Then apply this to your portal build, re-build and your rolling... Here is an amended bash script to create this snap-shot patch Then copy new-ai.patch to your <source-root> You shouldn't get any conflicts, but I always use '--check' as a precaution. All feedback on the 'craft' code will be welcomed.. Hope this helps
  17. It does, but only a lean version. If you wish to use all the features of playerbot then you need to get the code from the playerbot site. When you mean 'version/branches' are you referring to how git manages the code. I was the same when I started, it's can be difficult to grasp and one of those things you must accept works. A brilliant concept by Linus Torvalds.
  18. But doesn't that take the fun out of the game as a GM you are invunerable
  19. I've heard others refer to this 'invisibility of bots' in instances, but never experienced it myself. Which instances does this occur in and I'll give it a try. Oh, are you sure it's genuine invisiblity or are the bots passing through wall and floors (e.g Deadmines in Westfall with narrow tunnels & corridors) If so, and your not using 'movement maps' that would explain it. Let me know.
  20. Hi, I'm a little puzzled I thought the issue was with the use of GetTrainerSpellState(tSpell,reqLevel); in playerbot following core changes. I fail to see how disabling the bots proves that the problem is in another place. My fix should work now that I have fixed the typos. Or, are you referring to other issue that led to a crash in Unit::IsHostileTo(), originally posted by mosst. In this case, I would agree that the problem is in another place.
  21. Hi, Yes my mistake again. I use 'movement maps' on my server and the fifth parameter enables/disables 'getpath'. The default is true (enabled) and this feature was not required. Or at least it seemed pointless for bots to calculate the best route to a vendor when they are stand close by. I will do as you have done and just remove it. EDIT: I have now updated portal with the type fixes Cheers
  22. Hi, I will check the MovePoint error. It looks like the have updated this function in the core too. The 'reqlevel' was declared in the fix I pushed to portal last night. P.S. Your error say 'reqlevel', it's spelt wrong. You obviously applied the changes manually and it's a typo. It should be 'reqLevel' EDIT: Sorry my bad. I've just glanced at the patch I used again and saw that I spelt it wrong. I will amend this shortly, once I've got back from the dentist Hope this helps
  23. If your'e still referring to MaNGOS ZERO, this might be a deficiency in the core code. The playerbot code can not effect the actions of the player hunter, only the bot hunter. Many of the opcodes for this core are still quarantined. Hope this helps
  24. The error-message is freely translated, cause i'm german. I hope you can help on this one. I really love your work with the playerbot, and i really want it in my game https://github.com/mangosR2/mangos/commit/9237a89346b09ae4a04830e47c675e423660a56a Thanks But after testing I found a problem. I took a level 2 paladin to a trainer and was able to learn all spells upto 'Blessing of Kings', that requires level 22. https://github.com/blueboy/portal/commit/ae1d5be88f6b3bd6a8bffbbee6d244d81c37c17c I have pushed a revison to portal to test out. I checked my server and the paladin can now only learn 'Devotion of Aura' as expected. Hope this helps
  25. Hi, O.K there is one conflict which is to be expected. A DB reference for playerbot has been inserted into revision_sql.h. This conflict will be flagged each time the core or playerbot modifies this file. Direct merge method CONFLICT (content): Merge conflict in src/shared/revision_sql.h Automatic merge failed; fix conflicts and then commit the result. To fix this, replace the 3 line pattern above and below the playerbot reference Before with merge conflict markers After with conflict markers removed save the changes and then build 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