diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 6 | ||||
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 13 | ||||
-rw-r--r-- | src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp | 16 |
3 files changed, 12 insertions, 23 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 7f69471f325..f7d8ba69917 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1604,7 +1604,7 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffectInfo const& spellEffectIn break; case TARGET_DEST_CASTER_RANDOM: if (dist > objSize) - dist = objSize + (dist - objSize) * rand_norm(); + dist = objSize + (dist - objSize); break; case TARGET_DEST_CASTER_FRONT_LEFT: case TARGET_DEST_CASTER_BACK_LEFT: @@ -1655,8 +1655,6 @@ void Spell::SelectImplicitTargetDestTargets(SpellEffectInfo const& spellEffectIn { float angle = targetType.CalcDirectionAngle(); float dist = spellEffectInfo.CalcRadius(nullptr, targetIndex); - if (targetType.GetTarget() == TARGET_DEST_TARGET_RANDOM) - dist *= rand_norm(); Position pos = dest._position; target->MovePositionToFirstCollision(pos, dist, angle); @@ -1709,8 +1707,6 @@ void Spell::SelectImplicitDestDestTargets(SpellEffectInfo const& spellEffectInfo { float angle = targetType.CalcDirectionAngle(); float dist = spellEffectInfo.CalcRadius(m_caster, targetIndex); - if (targetType.GetTarget() == TARGET_DEST_DEST_RANDOM) - dist *= rand_norm(); Position pos = dest._position; m_caster->MovePositionToFirstCollision(pos, dist, angle); diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 656bd37e3a7..545cb27bcd8 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -674,17 +674,26 @@ float SpellEffectInfo::CalcRadius(WorldObject* caster /*= nullptr*/, SpellTarget // TargetA -> TargetARadiusEntry // TargetB -> TargetBRadiusEntry // Aura effects have TargetARadiusEntry == TargetBRadiusEntry (mostly) + SpellImplicitTargetInfo target = TargetA; SpellRadiusEntry const* entry = TargetARadiusEntry; if (targetIndex == SpellTargetIndex::TargetB && HasRadius(targetIndex)) + { + target = TargetB; entry = TargetBRadiusEntry; + } if (!entry) return 0.0f; float radius = entry->RadiusMin; - // Client uses max if min is 0 - if (radius == 0.0f) + // Random targets use random value between RadiusMin and RadiusMax + // For other cases, client uses RadiusMax if RadiusMin is 0 + if (target.GetTarget() == TARGET_DEST_CASTER_RANDOM || + target.GetTarget() == TARGET_DEST_TARGET_RANDOM || + target.GetTarget() == TARGET_DEST_DEST_RANDOM) + radius += (entry->RadiusMax - radius) * rand_norm(); + else if (radius == 0.0f) radius = entry->RadiusMax; if (caster) diff --git a/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp b/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp index 02ce46f3d00..0a511949c71 100644 --- a/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp +++ b/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp @@ -3669,21 +3669,6 @@ class spell_remnant_of_a_fallen_king_army_of_the_dead : public SpellScript } }; -// 362863 - Echoes of Andorhal -class spell_remnant_of_a_fallen_king_echoes_of_andorhal : public SpellScript -{ - void SetDest(SpellDestination& dest) const - { - Position const echoesSummon = GetCaster()->GetRandomPoint(DominationGraspCenter, frand(20.5f, 30.0f)); - dest.Relocate(echoesSummon); - } - - void Register() override - { - OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_remnant_of_a_fallen_king_echoes_of_andorhal::SetDest, EFFECT_0, TARGET_DEST_DEST_RANDOM); - } -}; - // 362543 - Remorseless Winter class spell_remnant_of_a_fallen_king_remorseless_winter_periodic : public AuraScript { @@ -3868,7 +3853,6 @@ void AddSC_boss_anduin_wrynn() RegisterSpellScript(spell_remnant_of_a_fallen_king_spawn); RegisterSpellScript(spell_remnant_of_a_fallen_king_energize_runic_power); RegisterSpellScript(spell_remnant_of_a_fallen_king_army_of_the_dead); - RegisterSpellScript(spell_remnant_of_a_fallen_king_echoes_of_andorhal); RegisterSpellScript(spell_remnant_of_a_fallen_king_soul_reaper); RegisterSpellScript(spell_remnant_of_a_fallen_king_remorseless_winter_periodic); RegisterSpellScript(spell_remnant_of_a_fallen_king_remorseless_winter_damage); |