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 "ObjectAccessor.h"
28#include "Player.h"
29#include "scholomance.h"
30#include "ScriptedCreature.h"
31
36
48
66
77
78Position const SpawnPosition = { 315.0280f, 70.53845f, 102.1496f, 0.3859715f };
79Position const MovePosition1 = { 299.4884f, 92.76137f, 105.6335f, 0.0f };
80Position const MovePosition2 = { 314.8673f, 90.30210f, 101.6459f, 0.0f };
81
82// 10506 - Kirtonos the Herald
84{
86
87 void JustAppeared() override
88 {
90 me->SetDisableGravity(true);
91 }
92
93 void JustEngagedWith(Unit* who) override
94 {
96
97 // Abilities he uses doesn't depend on form
106 }
107
108 void MovementInform(uint32 type, uint32 pointId) override
109 {
110 if (type == WAYPOINT_MOTION_TYPE && pointId == POINT_LANDING)
112
113 if (type == POINT_MOTION_TYPE && pointId == POINT_STAIRS_UP)
115 }
116
117 void EnterEvadeMode(EvadeReason /*why*/) override
118 {
120 gate->SetGoState(GO_STATE_ACTIVE);
121
123 }
124
125 void JustDied(Unit* /*killer*/) override
126 {
128 gate->SetGoState(GO_STATE_ACTIVE);
129
130 _JustDied();
131 }
132
134 {
135 events.Update(diff);
136
137 while (uint32 eventId = events.ExecuteEvent())
138 {
139 switch (eventId)
140 {
141 case EVENT_INTRO_1:
144 break;
145 case EVENT_INTRO_2:
148 gate->SetGoState(GO_STATE_READY);
149 break;
150 case EVENT_INTRO_3:
151 me->SetDisableGravity(false);
154 break;
155 case EVENT_INTRO_4:
158 me->SetImmuneToAll(false);
160 brazier->SetGoState(GO_STATE_READY);
162 break;
163 case EVENT_INTRO_5:
164 me->SetWalk(true);
166 break;
167 default:
168 break;
169 }
170 }
171 }
172
173 void UpdateAI(uint32 diff) override
174 {
175 if (!UpdateVictim())
176 {
177 UpdateIntroEvents(diff);
178 return;
179 }
180
181 events.Update(diff);
182
184 return;
185
186 while (uint32 eventId = events.ExecuteEvent())
187 {
188 switch (eventId)
189 {
190 case EVENT_SWOOP:
192 events.Repeat(10s, 15s);
193 break;
194 case EVENT_WING_FLAP:
196 events.Repeat(15s);
197 break;
200 events.Repeat(45s, 60s);
201 break;
202 case EVENT_DISARM:
204 events.Repeat(10s, 20s);
205 break;
208 events.Repeat(3s, 7s);
209 break;
212 events.Repeat(30s, 50s);
213 break;
217 events.Repeat(30s, 50s);
218 break;
221 {
222 // This is how it works...
225 SetEquipmentSlots(true);
226 }
227 else
228 {
231 }
232 events.Repeat(20s, 30s);
233 break;
234 default:
235 break;
236 }
237
239 return;
240 }
241 }
242};
243
244// 175564 - Brazier of the Herald
257
uint32_t uint32
Definition Define.h:154
@ WAYPOINT_MOTION_TYPE
@ POINT_MOTION_TYPE
@ TEMPSUMMON_MANUAL_DESPAWN
@ EMOTE_ONESHOT_ROAR
@ GO_STATE_READY
@ GO_STATE_ACTIVE
EvadeReason
@ UNIT_STATE_CASTING
Definition Unit.h:290
@ 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:63
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
void SetImmuneToAll(bool apply) override
Definition Creature.h:187
void Update(uint32 time)
Definition EventMap.h:77
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
EventId ExecuteEvent()
Definition EventMap.cpp:77
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:40
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={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={}, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
void MovePath(uint32 pathId, bool repeatable, Optional< Milliseconds > duration={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< std::pair< Milliseconds, Milliseconds > > waitTimeRangeAtPathEnd={}, Optional< float > wanderDistanceAtPathEnds={}, Optional< bool > followPathBackwardsFromEndToStart={}, Optional< bool > exactSplinePath={}, bool generatePath=true, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:172
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:71
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:81
Definition Unit.h:647
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3846
MotionMaster * GetMotionMaster()
Definition Unit.h:1750
bool SetWalk(bool enable)
Definition Unit.cpp:13422
bool HasUnitState(const uint32 f) const
Definition Unit.h:755
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4822
void HandleEmoteCommand(Emote emoteId, Player *target=nullptr, Trinity::IteratorPair< int32 const * > spellVisualKitIds={}, int32 sequenceVariation=0)
Definition Unit.cpp:1662
bool SetDisableGravity(bool disable, bool updateAnimTier=true, bool updatePlayHoverAnim=true)
Definition Unit.cpp:13440
void PlayDirectSound(uint32 soundId, Player const *target=nullptr, uint32 broadcastTextId=0) const
Definition Object.cpp:2941
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:1403
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
@ DATA_KIRTONOS
Definition scholomance.h:35
#define RegisterScholomanceCreatureAI(ai_name)
Definition scholomance.h:72
@ GO_GATE_KIRTONOS
Definition scholomance.h:55
@ GO_BRAZIER_OF_THE_HERALD
Definition scholomance.h:63
#define RegisterScholomanceGameObjectAI(ai_name)
Definition scholomance.h:73
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