fix(Scripts/AhnKahet): Fix Taldaram Spheres duration, spawn position … (#22296)

This commit is contained in:
Andrew
2025-06-13 18:52:21 -03:00
committed by GitHub
parent 1ce62f4718
commit a8cc3b7ba7
@@ -90,7 +90,6 @@ enum Points
POINT_ORB, POINT_ORB,
}; };
constexpr float DATA_GROUND_POSITION_Z = 11.308135f;
constexpr float DATA_SPHERE_DISTANCE = 25.0f; constexpr float DATA_SPHERE_DISTANCE = 25.0f;
#define DATA_SPHERE_ANGLE_OFFSET float(M_PI) / 2.0f #define DATA_SPHERE_ANGLE_OFFSET float(M_PI) / 2.0f
@@ -98,7 +97,6 @@ struct npc_taldaram_flamesphere : public NullCreatureAI
{ {
npc_taldaram_flamesphere(Creature *pCreature) : NullCreatureAI(pCreature), npc_taldaram_flamesphere(Creature *pCreature) : NullCreatureAI(pCreature),
instance(pCreature->GetInstanceScript()), instance(pCreature->GetInstanceScript()),
uiDespawnTimer(13000),
moveTimer(0) moveTimer(0)
{ {
pCreature->SetReactState(REACT_PASSIVE); pCreature->SetReactState(REACT_PASSIVE);
@@ -112,14 +110,6 @@ struct npc_taldaram_flamesphere : public NullCreatureAI
} }
} }
void MovementInform(uint32 type, uint32 id) override
{
if (type == POINT_MOTION_TYPE && id == POINT_ORB)
{
me->DisappearAndDie();
}
}
void IsSummonedBy(WorldObject* /*summoner*/) override void IsSummonedBy(WorldObject* /*summoner*/) override
{ {
// Replace sphere instantly if sphere is summoned after prince death // Replace sphere instantly if sphere is summoned after prince death
@@ -131,9 +121,6 @@ struct npc_taldaram_flamesphere : public NullCreatureAI
DoCastSelf(SPELL_FLAME_SPHERE_SPAWN_EFFECT); DoCastSelf(SPELL_FLAME_SPHERE_SPAWN_EFFECT);
DoCastSelf(SPELL_FLAME_SPHERE_VISUAL); DoCastSelf(SPELL_FLAME_SPHERE_VISUAL);
/// @todo: replace with DespawnOrUnsummon
uiDespawnTimer = 13000;
} }
void JustDied(Unit* /*who*/) override void JustDied(Unit* /*who*/) override
@@ -176,17 +163,6 @@ struct npc_taldaram_flamesphere : public NullCreatureAI
moveTimer -= diff; moveTimer -= diff;
} }
} }
if (uiDespawnTimer)
{
if (uiDespawnTimer <= diff)
{
me->DisappearAndDie();
uiDespawnTimer = 0;
}
else
uiDespawnTimer -= diff;
}
} }
void SetVictimPos(Position const& pos) void SetVictimPos(Position const& pos)
@@ -197,7 +173,6 @@ struct npc_taldaram_flamesphere : public NullCreatureAI
private: private:
Position victimPos; Position victimPos;
InstanceScript* instance; InstanceScript* instance;
uint32 uiDespawnTimer;
uint32 moveTimer; uint32 moveTimer;
}; };
@@ -245,7 +220,7 @@ struct boss_taldaram : public BossAI
{ {
if (action == ACTION_REMOVE_PRISON || action == ACTION_REMOVE_PRISON_AT_RESET) if (action == ACTION_REMOVE_PRISON || action == ACTION_REMOVE_PRISON_AT_RESET)
{ {
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), DATA_GROUND_POSITION_Z, me->GetOrientation()); me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetMapWaterOrGroundLevel(me->GetPosition()), me->GetOrientation());
instance->HandleGameObject(instance->GetGuidData(DATA_PRINCE_TALDARAM_PLATFORM), true); instance->HandleGameObject(instance->GetGuidData(DATA_PRINCE_TALDARAM_PLATFORM), true);
if (action == ACTION_REMOVE_PRISON) if (action == ACTION_REMOVE_PRISON)
@@ -383,7 +358,7 @@ struct boss_taldaram : public BossAI
{ {
case EVENT_PRINCE_BLOODTHIRST: case EVENT_PRINCE_BLOODTHIRST:
{ {
DoCastSelf(SPELL_BLOODTHIRST); DoCastVictim(SPELL_BLOODTHIRST);
events.Repeat(10s); events.Repeat(10s);
break; break;
} }
@@ -392,7 +367,7 @@ struct boss_taldaram : public BossAI
if (Unit* victim = me->GetVictim()) if (Unit* victim = me->GetVictim())
{ {
DoCast(victim, SPELL_CONJURE_FLAME_SPHERE); DoCast(victim, SPELL_CONJURE_FLAME_SPHERE);
victimSperePos = *victim; victimSperePos = victim->GetPosition();
} }
if (!events.GetNextEventTime(EVENT_PRINCE_VANISH)) if (!events.GetNextEventTime(EVENT_PRINCE_VANISH))
@@ -531,7 +506,7 @@ class spell_prince_taldaram_flame_sphere_summon : public SpellScript
void SetDest(SpellDestination& dest) void SetDest(SpellDestination& dest)
{ {
dest._position.m_positionZ = DATA_GROUND_POSITION_Z + 5.5f; dest._position.m_positionZ = GetCaster()->GetPositionZ() + 5.5f;
} }
void Register() override void Register() override