TrinityCore
Loading...
Searching...
No Matches
boss_palehoof.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#include "ScriptMgr.h"
19#include "InstanceScript.h"
20#include "GameObject.h"
21#include "GameObjectAI.h"
22#include "MotionMaster.h"
23#include "ObjectAccessor.h"
24#include "ScriptedCreature.h"
25#include "SpellScript.h"
26#include "TemporarySummon.h"
27#include "utgarde_pinnacle.h"
28
30{
31 // Palehoof
33 SPELL_IMPALE = 48261,
37 SPELL_FREEZE = 16245,
38 // Orb - World Trigger
43 // Ravenous Furbolg
46 SPELL_CRAZED = 48139,
49 // Frenzied Worgen
54 // Ferocious Rhino
55 SPELL_GORE = 48130,
56 SPELL_GORE_2 = 59264,
59 SPELL_STOMP = 48131,
60 // Massive Jormungar
66};
67
87
88enum Says
89{
93};
94
96{
97 { 238.6077f, -460.7103f, 112.5671f },
98 { 279.26f, -452.1f, 110.0f }
99};
100
110
112{
113public:
115
116 bool Execute(uint64 /*eventTime*/, uint32 /*diff*/) override
117 {
119 return true;
120 }
121
122private:
124};
125
127{
128public:
130
131 bool Execute(uint64 /*eventTime*/, uint32 /*diff*/) override
132 {
133 _owner->SetWalk(true);
135 return true;
136 }
137
138private:
140};
141
143{
144public:
145 OrbFlyEvent(Creature* owner) : BasicEvent(), _owner(owner) { }
146
147 bool Execute(uint64 /*eventTime*/, uint32 /*diff*/) override
148 {
149 _owner->SetWalk(false);
152 return true;
153 }
154
155private:
157};
158
160{
161public:
162 CombatStartEvent(Unit* owner) : BasicEvent(), _owner(owner) { }
163
164 bool Execute(uint64 /*eventTime*/, uint32 /*diff*/) override
165 {
167 return true;
168 }
169
170private:
172};
173
174struct boss_palehoof : public BossAI
175{
177
178 void Reset() override
179 {
180 _Reset();
181 _orb.Clear();
184
186 {
187 go->SetGoState(GO_STATE_READY);
188 go->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
189 }
190 }
191
192 void JustSummoned(Creature* summon) override
193 {
194 BossAI::JustSummoned(summon);
195
196 if (summon->GetEntry() == NPC_PALEHOOF_ORB)
197 _orb = summon->GetGUID();
198 }
199
209
210 void ExecuteEvent(uint32 eventId) override
211 {
212 switch (eventId)
213 {
217 break;
218 case EVENT_IMPALE:
220 DoCast(target, SPELL_IMPALE);
221 events.Repeat(Seconds(10), Seconds(15));
222 break;
225 events.Repeat(Seconds(11));
226 break;
227 default:
228 break;
229 }
230 }
231
239
247
248 void KilledUnit(Unit* who) override
249 {
250 if (who->GetTypeId() == TYPEID_PLAYER)
251 Talk(SAY_SLAY);
252 }
253
254 void DoAction(int32 actionId) override
255 {
256 switch (actionId)
257 {
259 {
261 if (!orb)
262 return;
263
266 orb->CastSpell(orb, SPELL_AWAKEN_GORTOK, true);
267 else
269 break;
270 }
273 me->SetImmuneToPC(false);
276 orb->DespawnOrUnsummon(1s);
277 break;
280 {
281 orb->CastSpell(orb, SPELL_ORB_VISUAL, true);
282 orb->m_Events.AddEvent(new OrbAirPositionEvent(orb), orb->m_Events.CalculateTime(3s));
283 orb->m_Events.AddEvent(new OrbFlyEvent(orb), orb->m_Events.CalculateTime(6s));
284 }
285 break;
286 default:
287 break;
288 }
289 }
290
291 private:
295};
296
298{
299 PalehoofMinionsBossAI(Creature* creature, uint32 bossId) : BossAI(creature, bossId) { }
300
301 void Reset() override
302 {
304 events.Reset();
306 }
307
308 void JustEngagedWith(Unit* /*who*/) override
309 {
311 me->setActive(true);
313 }
314
315 void DoAction(int32 actionId) override
316 {
317 if (actionId == ACTION_START_FIGHT)
318 {
320 me->SetImmuneToPC(false);
322 }
323 }
324
325 void JustDied(Unit* /*killer*/) override
326 {
328 palehoof->AI()->DoAction(ACTION_NEXT_PHASE);
329 }
330
331 void EnterEvadeMode(EvadeReason why) override
332 {
334 palehoof->AI()->EnterEvadeMode(why);
335 }
336};
337
339{
341
348
349 void ExecuteEvent(uint32 eventId) override
350 {
351 switch (eventId)
352 {
353 case EVENT_CRAZED:
355 events.Repeat(Seconds(20), Seconds(25));
356 break;
359 events.Repeat(Seconds(11));
360 break;
363 events.Repeat(Seconds(18));
364 break;
365 default:
366 break;
367 }
368 }
369};
370
372{
374
381
382 void ExecuteEvent(uint32 eventId) override
383 {
384 switch (eventId)
385 {
389 break;
390 case EVENT_ENRAGE:
392 events.Repeat(Seconds(25));
393 break;
394 case EVENT_ENRAGE_2:
396 break;
397 default:
398 break;
399 }
400 }
401};
402
404{
406
413
414 void ExecuteEvent(uint32 eventId) override
415 {
416 switch (eventId)
417 {
418 case EVENT_GORE:
420 events.Repeat(Seconds(19));
421 break;
425 events.Repeat(Seconds(18));
426 break;
427 case EVENT_STOMP:
429 events.Repeat(Seconds(10), Seconds(15));
430 break;
431 default:
432 break;
433 }
434 }
435};
436
438{
440
447
448 void JustSummoned(Creature* summon) override
449 {
450 if (summon->GetEntry() == NPC_JORMUNGAR_WORM)
451 {
453 SetAggressiveStateAfter(2s, summon, true);
454 summon->GetMotionMaster()->MoveRandom(5.0f);
455 }
456 }
457
458 void ExecuteEvent(uint32 eventId) override
459 {
460 switch (eventId)
461 {
462 case EVENT_ACID_SPIT:
465 break;
468 events.Repeat(Seconds(16));
469 break;
473 events.Repeat(Seconds(14));
474 break;
475 default:
476 break;
477 }
478 }
479
485};
486
488{
489 go_palehoof_sphere(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
490
492
493 bool OnGossipHello(Player* /*player*/) override
494 {
496 {
497 if (palehoof->IsAlive() && instance->GetBossState(DATA_GORTOK_PALEHOOF) != DONE)
498 {
501 palehoof->AI()->DoAction(ACTION_START_ENCOUNTER);
502 }
503 }
504 return true;
505 }
506};
507
508// 48139 - Crazed
523
524// 48146 - Crazed
544
545// 47669 - Awaken Subboss
547{
549
550 bool Validate(SpellInfo const* /*spellInfo*/) override
551 {
553 }
554
555 void HandleScript(SpellEffIndex /*effIndex*/)
556 {
557 Unit* target = GetHitUnit();
560 target->m_Events.AddEvent(new CombatStartEvent(target), target->m_Events.CalculateTime(8500ms));
561 }
562
567};
568
569// 47670 - Awaken Gortok
586
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint64_t uint64
Definition Define.h:132
uint32_t uint32
Definition Define.h:133
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:27
std::chrono::minutes Minutes
Minutes shorthand typedef.
Definition Duration.h:30
@ DONE
@ ENCOUNTER_FRAME_DISENGAGE
@ ENCOUNTER_FRAME_ENGAGE
@ TEMPSUMMON_CORPSE_DESPAWN
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
Spells
Definition PlayerAI.cpp:32
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_APPLY_AURA
@ GO_FLAG_NOT_SELECTABLE
@ GO_STATE_READY
@ GO_STATE_ACTIVE
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ SPELLVALUE_MAX_TARGETS
#define SpellEffectFn(F, I, N)
#define AuraEffectRemoveFn(F, I, N, M)
@ UNIT_FLAG_UNINTERACTIBLE
@ SAY_AGGRO
@ SAY_SLAY
@ PALEHOOF_SOUND_DEATH
void AddSC_boss_palehoof()
@ SUMMON_MINIBOSSES_GROUP
@ POSITION_FINAL
@ ACTION_NEXT_PHASE
@ ACTION_START_ENCOUNTER
@ POSITION_FLY
@ ACTION_START_FIGHT
@ SPELL_STOMP
@ SPELL_ENRAGE_2
@ SPELL_GRIEVOUS_WOUND
@ SPELL_POISON_BREATH_H
@ SPELL_WITHERING_ROAR
@ SPELL_ORB_CHANNEL
@ SPELL_POISON_BREATH
@ SPELL_CRAZED_TAUNT
@ SPELL_ORB_VISUAL
@ SPELL_WITHERING_ROAR_H
@ SPELL_CRAZED
@ SPELL_FREEZE
@ SPELL_ACID_SPLATTER_H
@ SPELL_GRIEVOUS_WOUND_H
@ SPELL_TERRIFYING_ROAR
@ SPELL_ENRAGE_1
@ SPELL_GORE
@ SPELL_MORTAL_WOUND_H
@ SPELL_GORE_2
@ SPELL_IMPALE_H
@ SPELL_ARCING_SMASH
@ SPELL_CHAIN_LIGHTNING
@ SPELL_AWAKEN_SUBBOSS
@ SPELL_ACID_SPLATTER
@ SPELL_MORTAL_WOUND
@ SPELL_AWAKEN_GORTOK
@ SPELL_IMPALE
@ SPELL_ACID_SPIT
@ SPELL_CHAIN_LIGHTNING_H
Position const OrbPositions[2]
@ EVENT_CHAIN_LIGHTNING
@ EVENT_CRAZED
@ EVENT_ENRAGE
@ EVENT_MORTAL_WOUND
@ EVENT_ACID_SPIT
@ EVENT_MORTAL_WOUND_2
@ EVENT_GORE
@ EVENT_STOMP
@ EVENT_ENRAGE_2
@ EVENT_IMPALE
@ EVENT_POISON_BREATH
@ EVENT_GRIEVOUS_WOUND
@ EVENT_ACID_SPLATTER
@ EVENT_TERRIFYING_ROAR
@ EVENT_ARCING_SMASH
@ EVENT_WITHERING_ROAR
Unit * GetTarget() const
HookList< EffectApplyHandler > OnEffectRemove
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
void JustSummoned(Creature *summon) override
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
SummonList summons
EventMap events
virtual void ScheduleTasks()
CombatStartEvent(Unit *owner)
bool Execute(uint64, uint32) override
void DoZoneInCombat(Creature *creature=nullptr)
Creature *const me
Definition CreatureAI.h:82
void SetCombatPulseDelay(uint32 delay)
Definition Creature.h:269
void SetImmuneToPC(bool apply) override
Definition Creature.h:129
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
void Reset()
Definition EventMap.cpp:21
void AddEvent(BasicEvent *event, Milliseconds e_time, bool set_addtime=true)
Milliseconds CalculateTime(Milliseconds t_offset) const
GameObject *const me
void SetGoState(GOState state)
void SetFlag(GameObjectFlags flags)
Definition GameObject.h:171
virtual bool SetBossState(uint32 id, EncounterState state)
Creature * GetCreature(uint32 type)
EncounterState GetBossState(uint32 id) const
GameObject * GetGameObject(uint32 type)
void SendEncounterUnit(EncounterFrameType type, Unit const *unit=nullptr, uint8 param1=0, uint8 param2=0)
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={})
void MoveRandom(float wanderDistance=0.0f)
void Clear()
Definition ObjectGuid.h:150
TypeID GetTypeId() const
Definition Object.h:93
uint32 GetEntry() const
Definition Object.h:81
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
bool Execute(uint64, uint32) override
OrbAirPositionEvent(Creature *owner)
bool Execute(uint64, uint32) override
OrbFinalPositionEvent(Creature *owner)
bool Execute(uint64, uint32) override
OrbFlyEvent(Creature *owner)
Creature * _owner
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
void SetTempSummonType(TempSummonType type)
virtual void DoAction(int32)
Definition UnitAI.h:154
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
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
TempSummon * ToTempSummon()
Definition Unit.h:1794
UnitAI * GetAI() const
Definition Unit.h:800
bool SetWalk(bool enable)
Definition Unit.cpp:13268
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3784
void RemoveUnitFlag(UnitFlags flags)
Definition Unit.h:955
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
void setActive(bool isActiveObject)
Definition Object.cpp:991
EventProcessor m_Events
Definition Object.h:591
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:2082
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
PrepareSpellScript(spell_palehoof_awaken_gortok)
void HandleDummy(SpellEffIndex)
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_palehoof_awaken_subboss)
PrepareSpellScript(spell_palehoof_crazed_effect)
bool Validate(SpellInfo const *) override
void HandleScriptEffect(SpellEffIndex)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_palehoof_crazed)
void Register() override
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
void JustDied(Unit *) override
void EnterEvadeMode(EvadeReason why) override
PalehoofMinionsBossAI(Creature *creature, uint32 bossId)
void DoAction(int32 actionId) override
void JustEngagedWith(Unit *) override
T const & DUNGEON_MODE(T const &normal5, T const &heroic10) const
void DoPlaySoundToSet(WorldObject *source, uint32 soundId)
void SetAggressiveStateAfter(Milliseconds timer, Creature *who=nullptr, bool startCombat=true, Creature *summoner=nullptr, StartCombatArgs const &combatArgs={ })
boss_ferocious_rhino(Creature *creature)
void ExecuteEvent(uint32 eventId) override
void ScheduleTasks() override
void ExecuteEvent(uint32 eventId) override
void ScheduleTasks() override
boss_frenzied_worgen(Creature *creature)
void EnterEvadeMode(EvadeReason why) override
boss_massive_jormungar(Creature *creature)
void JustSummoned(Creature *summon) override
void ExecuteEvent(uint32 eventId) override
void ScheduleTasks() override
boss_palehoof(Creature *creature)
void JustSummoned(Creature *summon) override
void JustEngagedWith(Unit *who) override
void EnterEvadeMode(EvadeReason) override
void JustDied(Unit *) override
void ExecuteEvent(uint32 eventId) override
void DoAction(int32 actionId) override
void KilledUnit(Unit *who) override
void Reset() override
boss_ravenous_furbolg(Creature *creature)
void ExecuteEvent(uint32 eventId) override
void ScheduleTasks() override
bool OnGossipHello(Player *) override
InstanceScript * instance
go_palehoof_sphere(GameObject *go)
#define RegisterUtgardePinnacleCreatureAI(ai_name)
#define RegisterUtgardePinnacleGameObjectAI(ai_name)
@ DATA_GORTOK_PALEHOOF_SPHERE
@ DATA_FRENZIED_WORGEN
@ DATA_RAVENOUS_FURBOLG
@ DATA_FEROCIOUS_RHINO
@ DATA_GORTOK_PALEHOOF
@ DATA_MASSIVE_JORMUNGAR
@ NPC_JORMUNGAR_WORM
@ NPC_PALEHOOF_ORB