mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
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.
This commit is contained in:
2
sql/updates/world/3.3.5/2016_08_19_00_world.sql
Normal file
2
sql/updates/world/3.3.5/2016_08_19_00_world.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
-- fix Rider of the Unholy / Blood / Frost (issue #17817)
|
||||
UPDATE `smart_scripts` SET `target_type`=27 WHERE `source_type`=0 AND `entryorguid` IN (30954,30956,30953) AND `action_type`=33;
|
||||
@@ -2761,6 +2761,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:
|
||||
|
||||
@@ -374,6 +374,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
|
||||
case SMART_TARGET_CLOSEST_ENEMY:
|
||||
case SMART_TARGET_CLOSEST_FRIENDLY:
|
||||
case SMART_TARGET_STORED:
|
||||
case SMART_TARGET_LOOT_RECIPIENTS:
|
||||
break;
|
||||
default:
|
||||
TC_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());
|
||||
|
||||
@@ -1104,8 +1104,9 @@ enum SMARTAI_TARGETS
|
||||
SMART_TARGET_THREAT_LIST = 24, // All units on creature's threat list
|
||||
SMART_TARGET_CLOSEST_ENEMY = 25, // maxDist, playerOnly
|
||||
SMART_TARGET_CLOSEST_FRIENDLY = 26, // maxDist, playerOnly
|
||||
SMART_TARGET_LOOT_RECIPIENTS = 27, // all players that have tagged this creature (for kill credit)
|
||||
|
||||
SMART_TARGET_END = 27
|
||||
SMART_TARGET_END = 28
|
||||
};
|
||||
|
||||
struct SmartTarget
|
||||
|
||||
Reference in New Issue
Block a user