mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 10:30:27 +00:00
fix(Scripts/MagistersTerrace): Script Kalecgos' appearance after usin… (#17286)
This commit is contained in:
@@ -16,9 +16,18 @@
|
||||
*/
|
||||
|
||||
#include "InstanceScript.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "magisters_terrace.h"
|
||||
|
||||
ObjectData const creatureData[] =
|
||||
{
|
||||
{ NPC_KALECGOS, DATA_KALECGOS },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
Position const KalecgosSpawnPos = { 164.3747f, -397.1197f, 2.151798f, 1.66219f };
|
||||
|
||||
class instance_magisters_terrace : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
@@ -29,6 +38,7 @@ public:
|
||||
instance_magisters_terrace_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
SetHeaders(DataHeader);
|
||||
LoadObjectData(creatureData, nullptr);
|
||||
}
|
||||
|
||||
uint32 Encounter[MAX_ENCOUNTER];
|
||||
@@ -69,6 +79,24 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ProcessEvent(WorldObject* /*obj*/, uint32 eventId) override
|
||||
{
|
||||
if (eventId == EVENT_SPAWN_KALECGOS)
|
||||
{
|
||||
if (!GetCreature(DATA_KALECGOS) && !scheduler.IsGroupScheduled(DATA_KALECGOS))
|
||||
{
|
||||
scheduler.Schedule(1min, 1min, DATA_KALECGOS,[this](TaskContext)
|
||||
{
|
||||
if (Creature* kalecgos = instance->SummonCreature(NPC_KALECGOS, KalecgosSpawnPos))
|
||||
{
|
||||
kalecgos->GetMotionMaster()->MovePath(PATH_KALECGOS_FLIGHT, false);
|
||||
kalecgos->AI()->Talk(SAY_KALECGOS_SPAWN);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 identifier, uint32 data) override
|
||||
{
|
||||
switch (identifier)
|
||||
@@ -116,6 +144,8 @@ public:
|
||||
kael->AI()->JustSummoned(creature);
|
||||
break;
|
||||
}
|
||||
|
||||
InstanceScript::OnCreatureCreate(creature);
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) override
|
||||
@@ -184,7 +214,53 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_KALECGOS_TRANSFORM = 44670,
|
||||
SPELL_TRANSFORM_VISUAL = 24085,
|
||||
SPELL_CAMERA_SHAKE = 44762,
|
||||
SPELL_ORB_KILL_CREDIT = 46307
|
||||
};
|
||||
|
||||
enum MovementPoints
|
||||
{
|
||||
POINT_ID_PREPARE_LANDING = 6
|
||||
};
|
||||
|
||||
struct npc_kalecgos : public ScriptedAI
|
||||
{
|
||||
npc_kalecgos(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void MovementInform(uint32 type, uint32 pointId) override
|
||||
{
|
||||
if (type != WAYPOINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (pointId == POINT_ID_PREPARE_LANDING)
|
||||
{
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
|
||||
me->SetDisableGravity(false);
|
||||
me->SetHover(false);
|
||||
|
||||
me->m_Events.AddEventAtOffset([this]()
|
||||
{
|
||||
DoCastAOE(SPELL_CAMERA_SHAKE);
|
||||
me->SetObjectScale(0.6f);
|
||||
|
||||
me->m_Events.AddEventAtOffset([this]()
|
||||
{
|
||||
DoCastSelf(SPELL_ORB_KILL_CREDIT, true);
|
||||
DoCastSelf(SPELL_TRANSFORM_VISUAL);
|
||||
DoCastSelf(SPELL_KALECGOS_TRANSFORM);
|
||||
me->UpdateEntry(NPC_HUMAN_KALECGOS);
|
||||
}, 1s);
|
||||
}, 2s);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_magisters_terrace()
|
||||
{
|
||||
new instance_magisters_terrace();
|
||||
RegisterMagistersTerraceCreatureAI(npc_kalecgos);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,9 @@ enum MTData
|
||||
DATA_VEXALLUS_EVENT = 1,
|
||||
DATA_DELRISSA_EVENT = 2,
|
||||
DATA_KAELTHAS_EVENT = 3,
|
||||
MAX_ENCOUNTER = 4
|
||||
MAX_ENCOUNTER = 4,
|
||||
|
||||
DATA_KALECGOS = 5
|
||||
};
|
||||
|
||||
enum MTCreatures
|
||||
@@ -41,7 +43,9 @@ enum MTCreatures
|
||||
NPC_FEL_CRYSTAL = 24722,
|
||||
NPC_KAEL_THAS = 24664,
|
||||
NPC_PHOENIX = 21362,
|
||||
NPC_PHOENIX_EGG = 21364
|
||||
NPC_PHOENIX_EGG = 21364,
|
||||
NPC_KALECGOS = 24844,
|
||||
NPC_HUMAN_KALECGOS = 24848
|
||||
};
|
||||
|
||||
enum MTGameObjects
|
||||
@@ -54,10 +58,27 @@ enum MTGameObjects
|
||||
GO_ESCAPE_ORB = 188173
|
||||
};
|
||||
|
||||
enum InstanceEventIds
|
||||
{
|
||||
EVENT_SPAWN_KALECGOS = 16547
|
||||
};
|
||||
|
||||
enum InstanceText
|
||||
{
|
||||
SAY_KALECGOS_SPAWN = 0
|
||||
};
|
||||
|
||||
enum MovementData
|
||||
{
|
||||
PATH_KALECGOS_FLIGHT = 248440
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
inline AI* GetMagistersTerraceAI(T* obj)
|
||||
{
|
||||
return GetInstanceAI<AI>(obj, MTScriptName);
|
||||
}
|
||||
|
||||
#define RegisterMagistersTerraceCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetMagistersTerraceAI)
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user