mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00: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:
|
||||
|
||||
@@ -361,6 +361,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
|
||||
case SMART_TARGET_PLAYER_WITH_AURA:
|
||||
case SMART_TARGET_RANDOM_POINT:
|
||||
case SMART_TARGET_ROLE_SELECTION:
|
||||
case SMART_TARGET_LOOT_RECIPIENTS:
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Not handled target_type(%u), Entry %d SourceType %u Event %u Action %u, skipped.", e.GetTargetType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
|
||||
@@ -1334,7 +1334,7 @@ enum SMARTAI_TARGETS
|
||||
SMART_TARGET_THREAT_LIST = 24, // All units on creature's threat list, maxdist, playerOnly
|
||||
SMART_TARGET_CLOSEST_ENEMY = 25, // maxDist, playerOnly
|
||||
SMART_TARGET_CLOSEST_FRIENDLY = 26, // maxDist, playerOnly
|
||||
SMART_TARGET_LOOT_RECIPIENTS = 27, // TODO: NOT SUPPORTED YET
|
||||
SMART_TARGET_LOOT_RECIPIENTS = 27, // all players that have tagged this creature (for kill credit)
|
||||
SMART_TARGET_FARTHEST = 28, // maxDist, playerOnly, isInLos
|
||||
SMART_TARGET_VEHICLE_PASSENGER = 29, // seat number (vehicle can target it's own accessory)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user