diff --git a/changelog.txt b/changelog.txt index de893f252..138482aa8 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,10 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 10/07/2018 == +Uleat: Fixed a few bot issues.. + - Fix for bot item trades not attuning + - Fix for bot mana, endurance not updating properly + == 10/06/2018 == Uleat: Fixed a few bot issues.. - Fix for bot 'stop melee level' not honoring setting level over rule level diff --git a/zone/bot.cpp b/zone/bot.cpp index 52bc0c9b5..2c8b143c6 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -1854,6 +1854,13 @@ bool Bot::Process() { SendHPUpdate(); if(HasPet()) GetPet()->SendHPUpdate(); + + // hack fix until percentage changes can be implemented + auto g = GetGroup(); + if (g) { + g->SendManaPacketFrom(this); + g->SendEndurancePacketFrom(this); + } } if(GetAppearance() == eaDead && GetHP() > 0) @@ -3896,6 +3903,8 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli client->ResetTrade(); return; } + // non-failing checks above are causing this to trigger (i.e., !ItemClassCommon and !IsEquipable{race, class, min_level}) + // this process is hindered by not having bots use the inventory trade method (TODO: implement bot inventory use) if (client->CheckLoreConflict(return_instance->GetItem())) { client->Message(CC_Yellow, "You already have lore equipment matching the item '%s' - Trade Canceled!", return_instance->GetItem()->Name); client->ResetTrade(); @@ -3999,8 +4008,17 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli m_inv.PutItem(trade_iterator.toBotSlot, *trade_iterator.tradeItemInstance); this->BotAddEquipItem(trade_iterator.toBotSlot, (trade_iterator.tradeItemInstance ? trade_iterator.tradeItemInstance->GetID() : 0)); + trade_iterator.tradeItemInstance = nullptr; // actual deletion occurs in client delete below + client->DeleteItemInInventory(trade_iterator.fromClientSlot, 0, (trade_iterator.fromClientSlot == EQEmu::invslot::slotCursor)); - trade_iterator.tradeItemInstance = nullptr; + + // database currently has unattuned item saved in inventory..it will be attuned on next bot load + // this prevents unattuned item returns in the mean time (TODO: re-work process) + if (trade_iterator.toBotSlot >= invslot::EQUIPMENT_BEGIN && trade_iterator.toBotSlot <= invslot::EQUIPMENT_END) { + auto attune_item = m_inv.GetItem(trade_iterator.toBotSlot); + if (attune_item && attune_item->GetItem()->Attuneable) + attune_item->SetAttuned(true); + } } // trade messages