mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Scripts/MagistersTerrace): Script Kalecgos' appearance after usin… (#17286)
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
--
|
||||||
|
-- Pathing for Kalecgos Entry: 24844 'TDB FORMAT'
|
||||||
|
SET @NPC := 24844;
|
||||||
|
SET @PATH := @NPC * 10;
|
||||||
|
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||||
|
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||||
|
(@PATH,1,163.9735,-398.0906,2.083333,0,0,0,0,100,0), -- 16:16:43
|
||||||
|
(@PATH,2,164.3802,-397.1771,2.083333,0,0,0,0,100,0), -- 16:16:43
|
||||||
|
(@PATH,3,162.7923,-386.1964,15.67094,0,0,0,0,100,0), -- 16:16:43
|
||||||
|
(@PATH,4,151.5555,-345.349,5.92646,0,0,0,0,100,0), -- 16:16:43
|
||||||
|
(@PATH,5,162.2416,-299.8032,-5.436685,0,0,0,0,100,0), -- 16:16:43
|
||||||
|
(@PATH,6,199.7482,-272.3315,-7.186677,0,0,0,0,100,0), -- 16:16:43
|
||||||
|
(@PATH,7,199.7482,-272.3315,-7.186677,0,0,0,0,100,0), -- 16:16:43
|
||||||
|
(@PATH,8,199.7482,-272.3315,-7.186677,0.06981317,0,0,0,100,0); -- 16:16:54
|
||||||
|
-- 0x1C2F2C4920184300001F1D000038BF6E .go 163.9735 -398.0906 2.083333
|
||||||
|
|
||||||
|
DELETE FROM `event_scripts` WHERE `id` = 16547;
|
||||||
|
DELETE FROM `smart_scripts` WHERE `entryorguid` = 24844;
|
||||||
|
|
||||||
|
UPDATE `creature_template` SET `AIName` = '', `ScriptName` = 'npc_kalecgos' WHERE `entry` = 24844;
|
||||||
|
UPDATE `creature_template` SET `AIName` = '' WHERE `entry` = 24848;
|
||||||
@@ -16,9 +16,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "InstanceScript.h"
|
#include "InstanceScript.h"
|
||||||
|
#include "ScriptedCreature.h"
|
||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
#include "magisters_terrace.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
|
class instance_magisters_terrace : public InstanceMapScript
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -29,6 +38,7 @@ public:
|
|||||||
instance_magisters_terrace_InstanceMapScript(Map* map) : InstanceScript(map)
|
instance_magisters_terrace_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||||
{
|
{
|
||||||
SetHeaders(DataHeader);
|
SetHeaders(DataHeader);
|
||||||
|
LoadObjectData(creatureData, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Encounter[MAX_ENCOUNTER];
|
uint32 Encounter[MAX_ENCOUNTER];
|
||||||
@@ -69,6 +79,24 @@ public:
|
|||||||
return 0;
|
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
|
void SetData(uint32 identifier, uint32 data) override
|
||||||
{
|
{
|
||||||
switch (identifier)
|
switch (identifier)
|
||||||
@@ -116,6 +144,8 @@ public:
|
|||||||
kael->AI()->JustSummoned(creature);
|
kael->AI()->JustSummoned(creature);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InstanceScript::OnCreatureCreate(creature);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnGameObjectCreate(GameObject* go) override
|
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()
|
void AddSC_instance_magisters_terrace()
|
||||||
{
|
{
|
||||||
new instance_magisters_terrace();
|
new instance_magisters_terrace();
|
||||||
|
RegisterMagistersTerraceCreatureAI(npc_kalecgos);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ enum MTData
|
|||||||
DATA_VEXALLUS_EVENT = 1,
|
DATA_VEXALLUS_EVENT = 1,
|
||||||
DATA_DELRISSA_EVENT = 2,
|
DATA_DELRISSA_EVENT = 2,
|
||||||
DATA_KAELTHAS_EVENT = 3,
|
DATA_KAELTHAS_EVENT = 3,
|
||||||
MAX_ENCOUNTER = 4
|
MAX_ENCOUNTER = 4,
|
||||||
|
|
||||||
|
DATA_KALECGOS = 5
|
||||||
};
|
};
|
||||||
|
|
||||||
enum MTCreatures
|
enum MTCreatures
|
||||||
@@ -41,7 +43,9 @@ enum MTCreatures
|
|||||||
NPC_FEL_CRYSTAL = 24722,
|
NPC_FEL_CRYSTAL = 24722,
|
||||||
NPC_KAEL_THAS = 24664,
|
NPC_KAEL_THAS = 24664,
|
||||||
NPC_PHOENIX = 21362,
|
NPC_PHOENIX = 21362,
|
||||||
NPC_PHOENIX_EGG = 21364
|
NPC_PHOENIX_EGG = 21364,
|
||||||
|
NPC_KALECGOS = 24844,
|
||||||
|
NPC_HUMAN_KALECGOS = 24848
|
||||||
};
|
};
|
||||||
|
|
||||||
enum MTGameObjects
|
enum MTGameObjects
|
||||||
@@ -54,10 +58,27 @@ enum MTGameObjects
|
|||||||
GO_ESCAPE_ORB = 188173
|
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>
|
template <class AI, class T>
|
||||||
inline AI* GetMagistersTerraceAI(T* obj)
|
inline AI* GetMagistersTerraceAI(T* obj)
|
||||||
{
|
{
|
||||||
return GetInstanceAI<AI>(obj, MTScriptName);
|
return GetInstanceAI<AI>(obj, MTScriptName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define RegisterMagistersTerraceCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetMagistersTerraceAI)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user