aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/BrokenIsles
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-01-10 21:22:28 +0100
committerShauren <shauren.trinity@gmail.com>2025-01-10 21:22:28 +0100
commit069771e22ef29e47298c62e6cb9d7dce72375348 (patch)
tree4cfd5dbb536d04831f5e3c6ad8f8ec763dc38125 /src/server/scripts/BrokenIsles
parent84b0eca4476faa68d9cf06431bc60c9a61c6152f (diff)
Core/AreaTriggers: Replace fixed movement times in database for areatriggers with speed
Diffstat (limited to 'src/server/scripts/BrokenIsles')
-rw-r--r--src/server/scripts/BrokenIsles/MawOfSouls/boss_ymiron_the_fallen_king.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/server/scripts/BrokenIsles/MawOfSouls/boss_ymiron_the_fallen_king.cpp b/src/server/scripts/BrokenIsles/MawOfSouls/boss_ymiron_the_fallen_king.cpp
index 514a386767a..6ab34f040b7 100644
--- a/src/server/scripts/BrokenIsles/MawOfSouls/boss_ymiron_the_fallen_king.cpp
+++ b/src/server/scripts/BrokenIsles/MawOfSouls/boss_ymiron_the_fallen_king.cpp
@@ -470,7 +470,7 @@ class spell_ymiron_the_fallen_king_bane_periodic_AuraScript : public AuraScript
static constexpr float BANE_MISSILE_DIST_BASE = 10.0f;
static constexpr float BANE_MISSILE_ANGLE_OFFSET = 0.75f;
- static constexpr int8 BANE_MAX_TOTAL_TICKS = 4 + 4 + 14;
+ static constexpr std::size_t BANE_MAX_TOTAL_TICKS = 4 + 4 + 14;
void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& /*isPeriodic*/, int32& amplitude)
{
@@ -494,7 +494,7 @@ class spell_ymiron_the_fallen_king_bane_periodic_AuraScript : public AuraScript
void OnAfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- for (int8 i = 0; i < BANE_MAX_TOTAL_TICKS; i++)
+ for (std::size_t i = 0; i < BANE_MAX_TOTAL_TICKS; i++)
{
float angle = Position::NormalizeOrientation(GetCaster()->GetOrientation() + (i * BANE_MISSILE_ANGLE_OFFSET));
_angles[2 * i + 0] = angle;
@@ -533,16 +533,14 @@ class spell_ymiron_the_fallen_king_bane_periodic_AuraScript : public AuraScript
}
private:
- std::array<float, BANE_MAX_TOTAL_TICKS * 2> _angles;
- std::array<float, BANE_MAX_TOTAL_TICKS * 2> _distances;
+ std::array<float, BANE_MAX_TOTAL_TICKS * 2> _angles = { };
+ std::array<float, BANE_MAX_TOTAL_TICKS * 2> _distances = { };
};
struct at_ymiron_the_fallen_king_bane : AreaTriggerAI
{
at_ymiron_the_fallen_king_bane(AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger) { }
- static constexpr float TIME_TO_TARGET_DIST_MULTIPLIER = 966.6466466434464f;
-
void OnInitialize() override
{
Unit* caster = at->GetCaster();
@@ -550,7 +548,6 @@ struct at_ymiron_the_fallen_king_bane : AreaTriggerAI
return;
float radius = at->GetExactDist(caster);
- float timeToTarget = radius * TIME_TO_TARGET_DIST_MULTIPLIER;
float angle = at->GetOrientation();
AreaTriggerOrbitInfo orbitInfo;
@@ -562,7 +559,7 @@ struct at_ymiron_the_fallen_king_bane : AreaTriggerAI
orbitInfo.BlendFromRadius = radius;
orbitInfo.InitialAngle = angle;
orbitInfo.PathTarget = caster->GetGUID();
- at->InitOrbit(orbitInfo, timeToTarget);
+ at->InitOrbit(orbitInfo);
}
void OnUnitEnter(Unit* unit) override