Skip to content

Commit fe7daf2

Browse files
NyeriahLopinclaude
authored
fix(Scripts/Ulduar): Freya's Ancient Conservator should cast Nature's Fury on a random player (azerothcore#26199)
Co-authored-by: Lopin <Lopin@TwinStar.cz> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e1262cd commit fe7daf2

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎src/server/game/AI/CoreAI/UnitAI.cpp‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,14 @@ SpellCastResult UnitAI::DoCastAOE(uint32 spellId, bool triggered)
292292

293293
/**
294294
* @brief Cast the spell on a random unit from the threat list
295+
*
296+
* @param aura Optional aura filter forwarded to SelectTarget: a positive value
297+
* requires the aura on the target, a negative value excludes targets
298+
* that already have it.
295299
*/
296-
SpellCastResult UnitAI::DoCastRandomTarget(uint32 spellId, uint32 threatTablePosition, float dist, bool playerOnly, bool triggered, bool withTank)
300+
SpellCastResult UnitAI::DoCastRandomTarget(uint32 spellId, uint32 threatTablePosition, float dist, bool playerOnly, bool triggered, bool withTank, int32 aura)
297301
{
298-
if (Unit* target = SelectTarget(SelectTargetMethod::Random, threatTablePosition, dist, playerOnly, withTank))
302+
if (Unit* target = SelectTarget(SelectTargetMethod::Random, threatTablePosition, dist, playerOnly, withTank, aura))
299303
{
300304
return DoCast(target, spellId, triggered);
301305
}

‎src/server/game/AI/CoreAI/UnitAI.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@ class UnitAI
395395
SpellCastResult DoCastToAllHostilePlayers(uint32 spellid, bool triggered = false);
396396
SpellCastResult DoCastVictim(uint32 spellId, bool triggered = false);
397397
SpellCastResult DoCastAOE(uint32 spellId, bool triggered = false);
398-
SpellCastResult DoCastRandomTarget(uint32 spellId, uint32 threatTablePosition = 0, float dist = 0.0f, bool playerOnly = true, bool triggered = false, bool withTank = true);
398+
// aura: forwarded to SelectTarget - if 0: ignored, if > 0: the target shall have the aura, if < 0: the target shall NOT have the aura
399+
SpellCastResult DoCastRandomTarget(uint32 spellId, uint32 threatTablePosition = 0, float dist = 0.0f, bool playerOnly = true, bool triggered = false, bool withTank = true, int32 aura = 0);
399400

400401
/// @brief Cast spell on the top threat target, which may not be the current victim.
401402
SpellCastResult DoCastMaxThreat(uint32 spellId, uint32 threatTablePosition = 0, float dist = 0.0f, bool playerOnly = true, bool triggered = false);

‎src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ struct boss_freya_summons : public ScriptedAI
10581058
switch (events.ExecuteEvent())
10591059
{
10601060
case EVENT_ANCIENT_CONSERVATOR_NATURE_FURY:
1061-
me->CastSpell(me->GetVictim(), SPELL_NATURE_FURY, false);
1061+
DoCastRandomTarget(SPELL_NATURE_FURY, 0, 100.0f, true, false, true, -SPELL_NATURE_FURY);
10621062
events.Repeat(14s);
10631063
break;
10641064
case EVENT_ANCIENT_CONSERVATOR_GRIP:

0 commit comments

Comments
 (0)