aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/BrokenIsles/MawOfSouls/boss_ymiron_the_fallen_king.cpp13
-rw-r--r--src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp31
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp18
-rw-r--r--src/server/scripts/World/areatrigger_scripts.cpp3
4 files changed, 18 insertions, 47 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
diff --git a/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp b/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp
index 871c4d33bef..8ec595ede47 100644
--- a/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp
+++ b/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp
@@ -2922,24 +2922,13 @@ class spell_anduin_wrynn_wicked_star_selector_AuraScript : public AuraScript
}
};
+// 365017 - Wicked Star CreatePropertiesId: 24322
+// 365017 - Wicked Star CreatePropertiesId: 24740
// 365017 - Wicked Star CreatePropertiesId: 24741
struct at_anduin_wrynn_wicked_star : AreaTriggerAI
{
at_anduin_wrynn_wicked_star(AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger) { }
- static constexpr float GetWickedStarSpeed(Difficulty difficulty)
- {
- // in yards per second
- switch (difficulty)
- {
- case DIFFICULTY_HEROIC_RAID:
- case DIFFICULTY_MYTHIC_RAID:
- return 18.0f;
- default: // LFR + Normal
- return 15.0f;
- }
- }
-
void OnInitialize() override
{
if (Unit* caster = at->GetCaster())
@@ -2951,13 +2940,10 @@ struct at_anduin_wrynn_wicked_star : AreaTriggerAI
std::vector<G3D::Vector3> splinePoints;
splinePoints.push_back(PositionToVector3(at->GetPosition()));
- splinePoints.push_back(PositionToVector3(at->GetPosition()));
splinePoints.push_back(PositionToVector3(destPos));
splinePoints.push_back(PositionToVector3(at->GetPosition()));
- splinePoints.push_back(PositionToVector3(at->GetPosition()));
- float timeToTarget = at->GetDistance(destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ()) * 2 / GetWickedStarSpeed(at->GetMap()->GetDifficultyID()) * 1000;
- at->InitSplines(splinePoints, timeToTarget);
+ at->InitSplines(splinePoints);
}
}
@@ -2972,9 +2958,9 @@ struct at_anduin_wrynn_wicked_star : AreaTriggerAI
return;
if (caster->IsValidAttackTarget(unit))
- caster->CastSpell(unit, SPELL_WICKED_STAR_DAMAGE_SILENCE, CastSpellExtraArgs(TriggerCastFlags(TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_CAST_IN_PROGRESS)));
+ caster->CastSpell(unit, SPELL_WICKED_STAR_DAMAGE_SILENCE, TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_CAST_IN_PROGRESS);
else if (caster->IsValidAssistTarget(unit))
- caster->CastSpell(unit, SPELL_WICKED_STAR_EMPOWERMENT, CastSpellExtraArgs(TriggerCastFlags(TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_CAST_IN_PROGRESS)));
+ caster->CastSpell(unit, SPELL_WICKED_STAR_EMPOWERMENT, TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_CAST_IN_PROGRESS);
}
void OnDestinationReached() override
@@ -3002,8 +2988,6 @@ struct at_anduin_wrynn_empowered_wicked_star : public at_anduin_wrynn_wicked_sta
{
at_anduin_wrynn_empowered_wicked_star(AreaTrigger* areatrigger) : at_anduin_wrynn_wicked_star(areatrigger) { }
- static float constexpr EMPOWERED_WICKED_STAR_SPEED = 14.0f; // in yards per second
-
void HandleMovement(float angle) const
{
Unit* caster = at->GetCaster();
@@ -3016,12 +3000,9 @@ struct at_anduin_wrynn_empowered_wicked_star : public at_anduin_wrynn_wicked_sta
std::vector<G3D::Vector3> splinePoints;
splinePoints.push_back(PositionToVector3(at));
- splinePoints.push_back(PositionToVector3(at));
- splinePoints.push_back(PositionToVector3(destPos));
splinePoints.push_back(PositionToVector3(destPos));
- float timeToTarget = at->GetDistance(destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ()) / EMPOWERED_WICKED_STAR_SPEED * 1000;
- at->InitSplines(splinePoints, timeToTarget);
+ at->InitSplines(splinePoints);
}
void OnInitialize() override
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index f27e555c621..4c7415a4119 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -1035,7 +1035,7 @@ class spell_pri_divine_star_shadow : public SpellScript
// 122121 - Divine Star (Shadow)
struct areatrigger_pri_divine_star : AreaTriggerAI
{
- areatrigger_pri_divine_star(AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger), _maxTravelDistance(0.0f) { }
+ using AreaTriggerAI::AreaTriggerAI;
void OnInitialize() override
{
@@ -1053,18 +1053,15 @@ struct areatrigger_pri_divine_star : AreaTriggerAI
_casterCurrentPosition = caster->GetPosition();
// Note: max. distance at which the Divine Star can travel to is EFFECT_1's BasePoints yards.
- _maxTravelDistance = float(spellInfo->GetEffect(EFFECT_1).CalcValue(caster));
+ float maxTravelDistance = float(spellInfo->GetEffect(EFFECT_1).CalcValue(caster));
Position destPos = _casterCurrentPosition;
- at->MovePositionToFirstCollision(destPos, _maxTravelDistance, 0.0f);
+ at->MovePositionToFirstCollision(destPos, maxTravelDistance, 0.0f);
PathGenerator firstPath(at);
firstPath.CalculatePath(destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ(), false);
- G3D::Vector3 const& endPoint = firstPath.GetPath().back();
-
- // Note: it takes 1000ms to reach EFFECT_1's BasePoints yards, so it takes (1000 / EFFECT_1's BasePoints)ms to run 1 yard.
- at->InitSplines(firstPath.GetPath(), at->GetDistance(endPoint.x, endPoint.y, endPoint.z) * float(1000 / _maxTravelDistance));
+ at->InitSplines(firstPath.GetPath());
}
void OnUpdate(uint32 diff) override
@@ -1089,7 +1086,7 @@ struct areatrigger_pri_divine_star : AreaTriggerAI
if (!caster)
return;
- if (std::find(_affectedUnits.begin(), _affectedUnits.end(), unit->GetGUID()) != _affectedUnits.end())
+ if (advstd::ranges::contains(_affectedUnits, unit->GetGUID()))
return;
constexpr TriggerCastFlags TriggerFlags = TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_CAST_IN_PROGRESS;
@@ -1133,11 +1130,9 @@ struct areatrigger_pri_divine_star : AreaTriggerAI
Movement::PointsArray returnSplinePoints;
returnSplinePoints.push_back(PositionToVector3(at));
- returnSplinePoints.push_back(PositionToVector3(at));
- returnSplinePoints.push_back(PositionToVector3(caster));
returnSplinePoints.push_back(PositionToVector3(caster));
- at->InitSplines(returnSplinePoints, uint32(at->GetDistance(caster) / _maxTravelDistance * 1000));
+ at->InitSplines(returnSplinePoints);
task.Repeat(250ms);
});
@@ -1147,7 +1142,6 @@ private:
TaskScheduler _scheduler;
Position _casterCurrentPosition;
std::vector<ObjectGuid> _affectedUnits;
- float _maxTravelDistance;
};
// 391339 - Empowered Renew
diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp
index 94f6bd43ccc..45cfcd40ceb 100644
--- a/src/server/scripts/World/areatrigger_scripts.cpp
+++ b/src/server/scripts/World/areatrigger_scripts.cpp
@@ -484,8 +484,7 @@ struct at_void_orb_harbinger : AreaTriggerAI
PathGenerator path(at);
path.CalculatePath(destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ(), false);
- float timeToTarget = at->GetDistance(destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ()) * 144.5f;
- at->InitSplines(path.GetPath(), timeToTarget);
+ at->InitSplines(path.GetPath());
}
}