TrinityCore
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
69{
86};
87
88enum Says
89{
93};
94
96{
97 { 238.6077f, -460.7103f, 112.5671f },
98 { 279.26f, -452.1f, 110.0f }
99};
100
102{
110
112{
113public:
115
116 bool Execute(uint64 /*eventTime*/, uint32 /*diff*/) override
117 {
121 return true;
122 }
123
124private:
126};
127
129{
130public:
132
133 bool Execute(uint64 /*eventTime*/, uint32 /*diff*/) override
134 {
136 return true;
137 }
138
139private:
141};
142
144{
145public:
147
148 bool Execute(uint64 /*eventTime*/, uint32 /*diff*/) override
149 {
150 _owner->SetWalk(true);
152 return true;
153 }
154
155private:
157};
158
160{
161public:
162 OrbFlyEvent(Creature* owner) : BasicEvent(), _owner(owner) { }
163
164 bool Execute(uint64 /*eventTime*/, uint32 /*diff*/) override
165 {
166 _owner->SetWalk(false);
169 return true;
170 }
171
172private:
174};
175
177{
178public:
179 CombatStartEvent(Unit* owner) : BasicEvent(), _owner(owner) { }
180
181 bool Execute(uint64 /*eventTime*/, uint32 /*diff*/) override
182 {
184 return true;
185 }
186
187private:
189};
190
191struct boss_palehoof : public BossAI
192{
194
195 void Reset() override
196 {
197 _Reset();
198 _orb.Clear();
201
203 {
204 go->SetGoState(GO_STATE_READY);
205 go->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
206 }
207 }
208
209 void JustSummoned(Creature* summon) override
210 {
211 BossAI::JustSummoned(summon);
212
213 if (summon->GetEntry() == NPC_PALEHOOF_ORB)
214 _orb = summon->GetGUID();
215 }
216
217 void JustEngagedWith(Unit* who) override
218 {
225 }
226
227 void ExecuteEvent(uint32 eventId) override
228 {
229 switch (eventId)
230 {
234 break;
235 case EVENT_IMPALE:
237 DoCast(target, SPELL_IMPALE);
238 events.Repeat(Seconds(10), Seconds(15));
239 break;
242 events.Repeat(Seconds(11));
243 break;
244 default:
245 break;
246 }
247 }
248
249 void JustDied(Unit* /*killer*/) override
250 {
251 events.Reset();
255 }
256
257 void EnterEvadeMode(EvadeReason /*why*/) override
258 {
260 events.Reset();
263 }
264
265 void KilledUnit(Unit* who) override
266 {
267 if (who->GetTypeId() == TYPEID_PLAYER)
268 Talk(SAY_SLAY);
269 }
270
271 void DoAction(int32 actionId) override
272 {
273 switch (actionId)
274 {
276 {
278 if (!orb)
279 return;
280
283 orb->CastSpell(orb, SPELL_AWAKEN_GORTOK, true);
284 else
286 break;
287 }
290 me->SetImmuneToPC(false);
293 orb->DespawnOrUnsummon(1s);
294 break;
297 {
298 orb->CastSpell(orb, SPELL_ORB_VISUAL, true);
299 orb->m_Events.AddEvent(new OrbAirPositionEvent(orb), orb->m_Events.CalculateTime(3s));
300 orb->m_Events.AddEvent(new OrbFlyEvent(orb), orb->m_Events.CalculateTime(6s));
301 }
302 break;
303 default:
304 break;
305 }
306 }
307
308 private:
312};
313
315{
316 PalehoofMinionsBossAI(Creature* creature, uint32 bossId) : BossAI(creature, bossId) { }
317
318 void Reset() override
319 {
321 events.Reset();
323 }
324
325 void JustEngagedWith(Unit* /*who*/) override
326 {
328 me->setActive(true);
330 }
331
332 void DoAction(int32 actionId) override
333 {
334 if (actionId == ACTION_START_FIGHT)
335 {
337 me->SetImmuneToPC(false);
339 }
340 }
341
342 void JustDied(Unit* /*killer*/) override
343 {
345 palehoof->AI()->DoAction(ACTION_NEXT_PHASE);
346 }
347
348 void EnterEvadeMode(EvadeReason why) override
349 {
351 palehoof->AI()->EnterEvadeMode(why);
352 }
353};
354
356{
358
359 void ScheduleTasks() override
360 {
364 }
365
366 void ExecuteEvent(uint32 eventId) override
367 {
368 switch (eventId)
369 {
370 case EVENT_CRAZED:
372 events.Repeat(Seconds(20), Seconds(25));
373 break;
376 events.Repeat(Seconds(11));
377 break;
380 events.Repeat(Seconds(18));
381 break;
382 default:
383 break;
384 }
385 }
386};
387
389{
391
392 void ScheduleTasks() override
393 {
397 }
398
399 void ExecuteEvent(uint32 eventId) override
400 {
401 switch (eventId)
402 {
406 break;
407 case EVENT_ENRAGE:
409 events.Repeat(Seconds(25));
410 break;
411 case EVENT_ENRAGE_2:
413 break;
414 default:
415 break;
416 }
417 }
418};
419
421{
423
424 void ScheduleTasks() override
425 {
429 }
430
431 void ExecuteEvent(uint32 eventId) override
432 {
433 switch (eventId)
434 {
435 case EVENT_GORE:
437 events.Repeat(Seconds(19));
438 break;
442 events.Repeat(Seconds(18));
443 break;
444 case EVENT_STOMP:
446 events.Repeat(Seconds(10), Seconds(15));
447 break;
448 default:
449 break;
450 }
451 }
452};
453
455{
457
458 void ScheduleTasks() override
459 {
463 }
464
465 void JustSummoned(Creature* summon) override
466 {
467 if (summon->GetEntry() == NPC_JORMUNGAR_WORM)
468 {
469 summon->m_Events.AddEvent(new WormAttackEvent(summon->ToTempSummon()), summon->m_Events.CalculateTime(2s));
470 summon->GetMotionMaster()->MoveRandom(5.0f);
471 }
472 }
473
474 void ExecuteEvent(uint32 eventId) override
475 {
476 switch (eventId)
477 {
478 case EVENT_ACID_SPIT:
481 break;
484 events.Repeat(Seconds(16));
485 break;
489 events.Repeat(Seconds(14));
490 break;
491 default:
492 break;
493 }
494 }
495
496 void EnterEvadeMode(EvadeReason why) override
497 {
500 }
501};
502
504{
505 go_palehoof_sphere(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
506
508
509 bool OnGossipHello(Player* /*player*/) override
510 {
512 {
513 if (palehoof->IsAlive() && instance->GetBossState(DATA_GORTOK_PALEHOOF) != DONE)
514 {
517 palehoof->AI()->DoAction(ACTION_START_ENCOUNTER);
518 }
519 }
520 return true;
521 }
522};
523
524// 48139 - Crazed
526{
527 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
528 {
530 }
531
532 void Register() override
533 {
535 }
536};
537
538// 48146 - Crazed
540{
541 bool Validate(SpellInfo const* /*spellInfo*/) override
542 {
544 }
545
547 {
549 }
550
551 void Register() override
552 {
554 }
555};
556
557// 47669 - Awaken Subboss
559{
560 bool Validate(SpellInfo const* /*spellInfo*/) override
561 {
563 }
564
565 void HandleScript(SpellEffIndex /*effIndex*/)
566 {
567 Unit* target = GetHitUnit();
569 target->SetUninteractible(false);
570 target->m_Events.AddEvent(new CombatStartEvent(target), target->m_Events.CalculateTime(8500ms));
571 }
572
573 void Register() override
574 {
576 }
577};
578
579// 47670 - Awaken Gortok
581{
582 void HandleDummy(SpellEffIndex /*effIndex*/)
583 {
584 Unit* target = GetHitUnit();
585 target->SetUninteractible(false);
586 target->m_Events.AddEvent(new CombatStartEvent(target), target->m_Events.CalculateTime(8s));
587 }
588
589 void Register() override
590 {
592 }
593};
594
596{
607}
uint8_t uint8
Definition: Define.h:144
int32_t int32
Definition: Define.h:138
uint64_t uint64
Definition: Define.h:141
uint32_t uint32
Definition: Define.h:142
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:32
std::chrono::minutes Minutes
Minutes shorthand typedef.
Definition: Duration.h:35
@ DONE
@ ENCOUNTER_FRAME_DISENGAGE
@ ENCOUNTER_FRAME_ENGAGE
@ TEMPSUMMON_CORPSE_DESPAWN
Definition: ObjectDefines.h:67
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
Spells
Definition: PlayerAI.cpp:32
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_1
Definition: SharedDefines.h:31
@ EFFECT_0
Definition: SharedDefines.h:30
@ 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
Used when doing CastSpell with triggered == true.
Definition: SpellDefines.h:266
@ SPELLVALUE_MAX_TARGETS
Definition: SpellDefines.h:230
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define AuraEffectRemoveFn(F, I, N, M)
Definition: SpellScript.h:2040
EvadeReason
Definition: UnitAICommon.h:30
@ REACT_AGGRESSIVE
Definition: UnitDefines.h:508
Says
@ 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
Definition: SpellScript.h:2035
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()
Definition: CreatureAI.h:161
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
Creature *const me
Definition: CreatureAI.h:61
void SetCombatPulseDelay(uint32 delay)
Definition: Creature.h:345
void SetImmuneToPC(bool apply) override
Definition: Creature.h:170
void SetReactState(ReactStates st)
Definition: Creature.h:160
CreatureAI * AI() const
Definition: Creature.h:214
void Repeat(Milliseconds time)
Definition: EventMap.cpp:63
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
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
Definition: GameObjectAI.h:50
void SetGoState(GOState state)
void SetFlag(GameObjectFlags flags)
Definition: GameObject.h:274
virtual bool SetBossState(uint32 id, EncounterState state)
Creature * GetCreature(uint32 type)
EncounterState GetBossState(uint32 id) const
void SendEncounterUnit(EncounterFrameType type, Unit const *unit, Optional< int32 > param1={}, Optional< int32 > param2={})
GameObject * GetGameObject(uint32 type)
void MoveRandom(float wanderDistance=0.0f, Optional< Milliseconds > duration={}, MovementSlot slot=MOTION_SLOT_DEFAULT)
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
void Clear()
Definition: ObjectGuid.h:286
TypeID GetTypeId() const
Definition: Object.h:173
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
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
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:162
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
void SetTempSummonType(TempSummonType type)
virtual void DoAction(int32)
Definition: UnitAI.h:72
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
TempSummon * ToTempSummon()
Definition: Unit.h:1756
UnitAI * GetAI() const
Definition: Unit.h:660
void SetUninteractible(bool apply)
Definition: Unit.cpp:8147
bool SetWalk(bool enable)
Definition: Unit.cpp:12707
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3831
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
void setActive(bool isActiveObject)
Definition: Object.cpp:922
EventProcessor m_Events
Definition: Object.h:777
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition: Object.cpp:2131
TempSummon * _owner
WormAttackEvent(TempSummon *owner)
bool Execute(uint64, uint32) override
void HandleDummy(SpellEffIndex)
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleScriptEffect(SpellEffIndex)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
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 Reset() override
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)
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
ObjectGuid _orb
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