mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-17 10:45:43 +00:00
ItemUsageValue: Handle items that create required items (#1091)
* Updated IsItemUsefulForQuest to handle items that create required quest items * Debug output * Removed unneeded botAI-> * Debug output in Calculate * -> not . * Comprehensive debug output for quest usage * Corrected logic for lootable items when sync quest is enabled * #include "LootObjectStack.h" * Corrected call to IsItem * Removed debug statements * Reimplement ItemCount >= RequiredItemCount * Modified CanLoot to loot all items when loot source is an item in their bags * Set loot target when sending Open packet
This commit is contained in:
@@ -4,6 +4,9 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "LootObjectStack.h"
|
||||
#include "AiObjectContext.h"
|
||||
|
||||
bool OpenItemAction::Execute(Event event)
|
||||
{
|
||||
bool foundOpenable = false;
|
||||
@@ -27,6 +30,11 @@ void OpenItemAction::OpenItem(Item* item, uint8 bag, uint8 slot)
|
||||
packet << bag << slot;
|
||||
bot->GetSession()->HandleOpenItemOpcode(packet);
|
||||
|
||||
// Store the item GUID as the loot target
|
||||
LootObject lootObject;
|
||||
lootObject.guid = item->GetGUID();
|
||||
botAI->GetAiObjectContext()->GetValue<LootObject>("loot target")->Set(lootObject);
|
||||
|
||||
std::ostringstream out;
|
||||
out << "Opened item: " << item->GetTemplate()->Name1;
|
||||
botAI->TellMaster(out.str());
|
||||
|
||||
Reference in New Issue
Block a user