mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
feat(Core/SmartScripts): SMART_TARGET_LOOT_RECIPIENTS (#9967)
This commit is contained in:
committed by
GitHub
parent
7d25a0fb68
commit
8a5b96349b
@@ -3835,6 +3835,29 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_TARGET_LOOT_RECIPIENTS:
|
||||
{
|
||||
if (me)
|
||||
{
|
||||
if (Group* lootGroup = me->GetLootRecipientGroup())
|
||||
{
|
||||
for (GroupReference* it = lootGroup->GetFirstMember(); it != nullptr; it = it->next())
|
||||
{
|
||||
if (Player* recipient = it->GetSource())
|
||||
{
|
||||
l->push_back(recipient);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Player* recipient = me->GetLootRecipient())
|
||||
{
|
||||
l->push_back(recipient);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
case SMART_TARGET_NONE:
|
||||
case SMART_TARGET_POSITION:
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user