feat(Core/SmartScripts): SMART_TARGET_LOOT_RECIPIENTS (#9967)
This commit is contained in:
parent
7d25a0fb68
commit
8a5b96349b
3 changed files with 25 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue