Core/SmartScripts: Add SMART_TARGET_LOOT_RECIPIENTS. Does what it says on the tin.

Use this new target type to fix The Rider of Blood, The Rider of Frost, The Rider of the Unholy. Closes #17817.

(cherry picked from commit e2c915fb43)
This commit is contained in:
treeston
2016-08-19 14:25:23 +02:00
committed by joschiwald
parent 8ea1a37761
commit d0f4588652
4 changed files with 22 additions and 1 deletions

View File

@@ -2783,6 +2783,23 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
l->push_back(target);
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_POSITION:
case SMART_TARGET_NONE:
default: