TrinityCore
Loading...
Searching...
No Matches
magisters_terrace.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/*
19 * Kalec for some reason lifts off after landing
20 * Kalec seems to be spawned after cinematic is finished, not after specific time
21 */
22
23#include "ScriptMgr.h"
24#include "magisters_terrace.h"
25#include "MotionMaster.h"
26#include "Player.h"
27#include "ScriptedCreature.h"
28
44
45Position const KalecgosHumanSpawnPos = { 197.86285f, -272.74414f, -8.651634f, 0.0f };
46
47// 24844 - Kalecgos
48struct npc_kalecgos : public ScriptedAI
49{
50 npc_kalecgos(Creature* creature) : ScriptedAI(creature) { }
51
52 void JustAppeared() override
53 {
56 }
57
58 void MovementInform(uint32 type, uint32 pointId) override
59 {
60 if (type != WAYPOINT_MOTION_TYPE)
61 return;
62
63 if (pointId == POINT_ID_PREPARE_LANDING)
64 {
66 me->SetDisableGravity(false);
68 }
69 }
70
71 void UpdateAI(uint32 diff) override
72 {
73 _events.Update(diff);
74
75 switch (_events.ExecuteEvent())
76 {
79 me->SetFacingTo(0.0698132f);
80 me->SetObjectScale(0.6f);
82 break;
85 // This doesn't appear in sniff and credit is rewarded when cinematic is finished
88 break;
91 me->DespawnOrUnsummon(1500ms);
92 break;
93 default:
94 break;
95 }
96 }
97
98private:
100};
101
uint32_t uint32
Definition Define.h:133
@ WAYPOINT_MOTION_TYPE
@ TEMPSUMMON_MANUAL_DESPAWN
@ EMOTE_ONESHOT_LAND
Creature *const me
Definition CreatureAI.h:82
void SetObjectScale(float scale) override
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
void Update(uint32 time)
Definition EventMap.h:67
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
void MovePath(uint32 pathId, bool repeatable)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition Unit.cpp:13286
void HandleEmoteCommand(Emote emoteId)
Definition Unit.cpp:1568
void SetFacingTo(float ori, bool force=true, uint32 movementId=EVENT_FACE)
Definition Unit.cpp:13250
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition Object.cpp:1992
@ POINT_ID_PREPARE_LANDING
@ EVENT_KALECGOS_TRANSFORM
@ SPELL_ORB_KILL_CREDIT
@ PATH_KALECGOS_FLIGHT
@ SPELL_CAMERA_SHAKE
@ EVENT_KALECGOS_LANDING
@ SPELL_TRANSFORM_VISUAL
@ EVENT_KALECGOS_SUMMON
@ SAY_KALECGOS_SPAWN
void AddSC_magisters_terrace()
Position const KalecgosHumanSpawnPos
@ NPC_HUMAN_KALECGOS
#define RegisterMagistersTerraceCreatureAI(ai_name)
void JustAppeared() override
void MovementInform(uint32 type, uint32 pointId) override
npc_kalecgos(Creature *creature)
void UpdateAI(uint32 diff) override