mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-31 17:43:47 +00:00
fix(Scripts/ShatteredHalls): Don't let Flame Arrows stack in Blood Guard Porung Gauntlet Event (#24434)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: sudlud <sudlud@users.noreply.github.com>
This commit is contained in:
@@ -291,10 +291,29 @@ class spell_tsh_shoot_flame_arrow : public SpellScript
|
||||
|
||||
unitList.remove_if([&](WorldObject* target) -> bool
|
||||
{
|
||||
return !target->SelectNearestPlayer(15.0f);
|
||||
if (!target)
|
||||
return true;
|
||||
|
||||
if (!target->SelectNearestPlayer(15.0f))
|
||||
return true;
|
||||
|
||||
if (target->FindNearestGameObject(GO_BLAZE, 6.0f))
|
||||
return true;
|
||||
|
||||
// Don't stack arrows on the same target
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
if (target->GetGUID() == instance->GetGuidData(DATA_LAST_FLAME_ARROW))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
Acore::Containers::RandomResize(unitList, 1);
|
||||
|
||||
// Replace last arrow GUID
|
||||
if (!unitList.empty())
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
instance->SetGuidData(DATA_LAST_FLAME_ARROW, unitList.front()->GetGUID());
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
|
||||
@@ -117,11 +117,25 @@ public:
|
||||
return PrisonerGUID[data - DATA_PRISONER_1];
|
||||
case DATA_EXECUTIONER:
|
||||
return ExecutionerGUID;
|
||||
case DATA_LAST_FLAME_ARROW:
|
||||
return LastArrowGUID;
|
||||
}
|
||||
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
void SetGuidData(uint32 data, ObjectGuid value) override
|
||||
{
|
||||
switch (data)
|
||||
{
|
||||
case DATA_LAST_FLAME_ARROW:
|
||||
LastArrowGUID = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Update(uint32 diff) override
|
||||
{
|
||||
if (RescueTimer && RescueTimer < 100 * MINUTE * IN_MILLISECONDS)
|
||||
@@ -164,6 +178,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
ObjectGuid LastArrowGUID;
|
||||
ObjectGuid ExecutionerGUID;
|
||||
ObjectGuid PrisonerGUID[3];
|
||||
uint32 RescueTimer;
|
||||
|
||||
@@ -37,7 +37,8 @@ enum DataTypes
|
||||
DATA_EXECUTIONER = 14,
|
||||
DATA_OMROGG_LEFT_HEAD = 15,
|
||||
DATA_OMROGG_RIGHT_HEAD = 16,
|
||||
DATA_WARCHIEF_PORTAL = 17
|
||||
DATA_WARCHIEF_PORTAL = 17,
|
||||
DATA_LAST_FLAME_ARROW = 18
|
||||
};
|
||||
|
||||
enum CreatureIds
|
||||
@@ -49,6 +50,7 @@ enum CreatureIds
|
||||
NPC_SH_ZEALOT = 17462,
|
||||
NPC_SH_ARCHER = 17427,
|
||||
NPC_SH_SCOUT = 17693,
|
||||
NPC_SH_FLAME_ARROW = 17687,
|
||||
|
||||
// Warchief Kargath
|
||||
NPC_WARCHIEF_KARGATH = 16808,
|
||||
@@ -76,7 +78,8 @@ enum CreatureIds
|
||||
enum GameobjectIds
|
||||
{
|
||||
GO_GRAND_WARLOCK_CHAMBER_DOOR_1 = 182539,
|
||||
GO_GRAND_WARLOCK_CHAMBER_DOOR_2 = 182540
|
||||
GO_GRAND_WARLOCK_CHAMBER_DOOR_2 = 182540,
|
||||
GO_BLAZE = 181915
|
||||
};
|
||||
|
||||
enum SpellIds
|
||||
|
||||
Reference in New Issue
Block a user