Active loot roll (#1338)

This commit is contained in:
Yunfan Li
2025-05-25 21:24:25 +08:00
committed by GitHub
parent 45f98e52b4
commit b726f3dfcb
4 changed files with 9 additions and 56 deletions

View File

@@ -15,8 +15,6 @@
bool LootRollAction::Execute(Event event)
{
Player* bot = QueryItemUsageAction::botAI->GetBot();
Group* group = bot->GetGroup();
if (!group)
return false;
@@ -108,61 +106,11 @@ bool LootRollAction::Execute(Event event)
group->CountRollVote(bot->GetGUID(), guid, vote);
break;
}
// One item at a time
return true;
}
// WorldPacket p(event.getPacket()); //WorldPacket packet for CMSG_LOOT_ROLL, (8+4+1)
// p.rpos(0); //reset packet pointer
// p >> guid; //guid of the item rolled
// p >> slot; //number of players invited to roll
// p >> rollType; //need,greed or pass on roll
// std::vector<Roll*> rolls = group->GetRolls();
// bot->Say("guid:" + std::to_string(guid.GetCounter()) +
// "item entry:" + std::to_string(guid.GetEntry()), LANG_UNIVERSAL);
// for (std::vector<Roll*>::iterator i = rolls.begin(); i != rolls.end(); ++i)
// {
// if ((*i)->isValid() && (*i)->itemGUID == guid && (*i)->itemSlot == slot)
// {
// uint32 itemId = (*i)->itemid;
// bot->Say("item entry2:" + std::to_string(itemId), LANG_UNIVERSAL);
// ItemTemplate const *proto = sObjectMgr->GetItemTemplate(itemId);
// if (!proto)
// continue;
// switch (proto->Class)
// {
// case ITEM_CLASS_WEAPON:
// case ITEM_CLASS_ARMOR:
// if (!QueryItemUsage(proto).empty())
// vote = NEED;
// else if (bot->HasSkill(SKILL_ENCHANTING))
// vote = DISENCHANT;
// break;
// default:
// if (StoreLootAction::IsLootAllowed(itemId, botAI))
// vote = NEED;
// break;
// }
// break;
// }
// }
// if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(guid.GetEntry()))
// {
// switch (proto->Class)
// {
// case ITEM_CLASS_WEAPON:
// case ITEM_CLASS_ARMOR:
// if (!QueryItemUsage(proto).empty())
// vote = NEED;
// break;
// default:
// if (StoreLootAction::IsLootAllowed(guid.GetEntry(), botAI))
// vote = NEED;
// break;
// }
// }
return true;
return false;
}