TrinityCore
Loading...
Searching...
No Matches
boss_kirtonos_the_herald.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 * Timers requires to be revisited
20 */
21
22#include "ScriptMgr.h"
23#include "GameObject.h"
24#include "GameObjectAI.h"
25#include "InstanceScript.h"
26#include "MotionMaster.h"
27#include "MoveSplineInit.h"
28#include "ObjectAccessor.h"
29#include "Player.h"
30#include "scholomance.h"
31#include "ScriptedCreature.h"
32
37
49
67
78
79Position const SpawnPosition = { 315.0280f, 70.53845f, 102.1496f, 0.3859715f };
80Position const MovePosition1 = { 299.4884f, 92.76137f, 105.6335f, 0.0f };
81Position const MovePosition2 = { 314.8673f, 90.30210f, 101.6459f, 0.0f };
82
83// 10506 - Kirtonos the Herald
85{
87
88 void JustAppeared() override
89 {
91 me->SetDisableGravity(true);
92 }
93
94 void JustEngagedWith(Unit* who) override
95 {
97
98 // Abilities he uses doesn't depend on form
107 }
108
109 void MovementInform(uint32 type, uint32 pointId) override
110 {
111 if (type == WAYPOINT_MOTION_TYPE && pointId == POINT_LANDING)
113
114 if (type == POINT_MOTION_TYPE && pointId == POINT_STAIRS_UP)
116 }
117
118 void EnterEvadeMode(EvadeReason /*why*/) override
119 {
121 gate->SetGoState(GO_STATE_ACTIVE);
122
124 }
125
126 void JustDied(Unit* /*killer*/) override
127 {
129 gate->SetGoState(GO_STATE_ACTIVE);
130
131 _JustDied();
132 }
133
135 {
136 events.Update(diff);
137
138 while (uint32 eventId = events.ExecuteEvent())
139 {
140 switch (eventId)
141 {
142 case EVENT_INTRO_1:
145 break;
146 case EVENT_INTRO_2:
149 gate->SetGoState(GO_STATE_READY);
150 break;
151 case EVENT_INTRO_3:
152 me->SetDisableGravity(false);
155 break;
156 case EVENT_INTRO_4:
159 me->SetImmuneToAll(false);
161 brazier->SetGoState(GO_STATE_READY);
163 break;
164 case EVENT_INTRO_5:
165 me->SetWalk(true);
167 break;
168 default:
169 break;
170 }
171 }
172 }
173
174 void UpdateAI(uint32 diff) override
175 {
176 if (!UpdateVictim())
177 {
178 UpdateIntroEvents(diff);
179 return;
180 }
181
182 events.Update(diff);
183
185 return;
186
187 while (uint32 eventId = events.ExecuteEvent())
188 {
189 switch (eventId)
190 {
191 case EVENT_SWOOP:
193 events.Repeat(10s, 15s);
194 break;
195 case EVENT_WING_FLAP:
197 events.Repeat(15s);
198 break;
201 events.Repeat(45s, 60s);
202 break;
203 case EVENT_DISARM:
205 events.Repeat(10s, 20s);
206 break;
209 events.Repeat(3s, 7s);
210 break;
213 events.Repeat(30s, 50s);
214 break;
218 events.Repeat(30s, 50s);
219 break;
222 {
223 // This is how it works...
226 SetEquipmentSlots(true);
227 }
228 else
229 {
232 }
233 events.Repeat(20s, 30s);
234 break;
235 default:
236 break;
237 }
238
240 return;
241 }
242
244 }
245};
246
247// 175564 - Brazier of the Herald
260
uint32_t uint32
Definition Define.h:133
@ WAYPOINT_MOTION_TYPE
@ POINT_MOTION_TYPE
@ TEMPSUMMON_MANUAL_DESPAWN
@ EMOTE_ONESHOT_ROAR
@ GO_STATE_READY
@ GO_STATE_ACTIVE
@ UNIT_STATE_CASTING
Definition Unit.h:235
@ SPELL_SHADOW_BOLT_VOLLEY
@ SPELL_KIRTONOS_TRANSFORM
Position const MovePosition1
@ EVENT_SHADOW_BOLT_VOLLEY
@ EVENT_KIRTONOS_TRANSFORM
Position const SpawnPosition
Position const MovePosition2
void AddSC_boss_kirtonos_the_herald()
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
void SetImmuneToAll(bool apply) override
Definition Creature.h:126
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
GameObject *const me
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=nullptr)
virtual ObjectGuid GetGuidData(uint32 type) const override
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={})
void MovePath(uint32 pathId, bool repeatable)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3638
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4535
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition Unit.cpp:13286
bool SetWalk(bool enable)
Definition Unit.cpp:13268
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
void HandleEmoteCommand(Emote emoteId)
Definition Unit.cpp:1568
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
void PlayDirectSound(uint32 soundId, Player *target=nullptr)
Definition Object.cpp:3433
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
@ DATA_KIRTONOS
Definition scholomance.h:37
#define RegisterScholomanceCreatureAI(ai_name)
Definition scholomance.h:65
@ GO_GATE_KIRTONOS
Definition scholomance.h:48
@ GO_BRAZIER_OF_THE_HERALD
Definition scholomance.h:56
#define RegisterScholomanceGameObjectAI(ai_name)
Definition scholomance.h:66
void SetEquipmentSlots(bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
void UpdateAI(uint32 diff) override
void EnterEvadeMode(EvadeReason) override
boss_kirtonos_the_herald(Creature *creature)
void MovementInform(uint32 type, uint32 pointId) override
void JustEngagedWith(Unit *who) override
bool OnGossipHello(Player *player) override