mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-04 22:07:52 +00:00
fix(Scripts/Ulduar): Freya's Ancient Conservator should cast Nature's Fury on a random player (#26199)
Co-authored-by: Lopin <Lopin@TwinStar.cz> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -292,10 +292,14 @@ SpellCastResult UnitAI::DoCastAOE(uint32 spellId, bool triggered)
|
||||
|
||||
/**
|
||||
* @brief Cast the spell on a random unit from the threat list
|
||||
*
|
||||
* @param aura Optional aura filter forwarded to SelectTarget: a positive value
|
||||
* requires the aura on the target, a negative value excludes targets
|
||||
* that already have it.
|
||||
*/
|
||||
SpellCastResult UnitAI::DoCastRandomTarget(uint32 spellId, uint32 threatTablePosition, float dist, bool playerOnly, bool triggered, bool withTank)
|
||||
SpellCastResult UnitAI::DoCastRandomTarget(uint32 spellId, uint32 threatTablePosition, float dist, bool playerOnly, bool triggered, bool withTank, int32 aura)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, threatTablePosition, dist, playerOnly, withTank))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, threatTablePosition, dist, playerOnly, withTank, aura))
|
||||
{
|
||||
return DoCast(target, spellId, triggered);
|
||||
}
|
||||
|
||||
@@ -395,7 +395,8 @@ public:
|
||||
SpellCastResult DoCastToAllHostilePlayers(uint32 spellid, bool triggered = false);
|
||||
SpellCastResult DoCastVictim(uint32 spellId, bool triggered = false);
|
||||
SpellCastResult DoCastAOE(uint32 spellId, bool triggered = false);
|
||||
SpellCastResult DoCastRandomTarget(uint32 spellId, uint32 threatTablePosition = 0, float dist = 0.0f, bool playerOnly = true, bool triggered = false, bool withTank = true);
|
||||
// aura: forwarded to SelectTarget - if 0: ignored, if > 0: the target shall have the aura, if < 0: the target shall NOT have the aura
|
||||
SpellCastResult DoCastRandomTarget(uint32 spellId, uint32 threatTablePosition = 0, float dist = 0.0f, bool playerOnly = true, bool triggered = false, bool withTank = true, int32 aura = 0);
|
||||
|
||||
/// @brief Cast spell on the top threat target, which may not be the current victim.
|
||||
SpellCastResult DoCastMaxThreat(uint32 spellId, uint32 threatTablePosition = 0, float dist = 0.0f, bool playerOnly = true, bool triggered = false);
|
||||
|
||||
@@ -1058,7 +1058,7 @@ struct boss_freya_summons : public ScriptedAI
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_ANCIENT_CONSERVATOR_NATURE_FURY:
|
||||
me->CastSpell(me->GetVictim(), SPELL_NATURE_FURY, false);
|
||||
DoCastRandomTarget(SPELL_NATURE_FURY, 0, 100.0f, true, false, true, -SPELL_NATURE_FURY);
|
||||
events.Repeat(14s);
|
||||
break;
|
||||
case EVENT_ANCIENT_CONSERVATOR_GRIP:
|
||||
|
||||
Reference in New Issue
Block a user