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 {
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
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
256
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 {
320 events.Reset();
322 }
323
324 void JustEngagedWith(Unit* /*who*/) override
325 {
326 me->setActive(true);
328 }
329
330 void DoAction(int32 actionId) override
331 {
332 if (actionId == ACTION_START_FIGHT)
333 {
335 me->SetImmuneToPC(false);
337 }
338 }
339
340 void JustDied(Unit* /*killer*/) override
341 {
343 palehoof->AI()->DoAction(ACTION_NEXT_PHASE);
344 }
345
346 void EnterEvadeMode(EvadeReason why) override
347 {
349 palehoof->AI()->EnterEvadeMode(why);
350 }
351};
352
354{
356
363
364 void ExecuteEvent(uint32 eventId) override
365 {
366 switch (eventId)
367 {
368 case EVENT_CRAZED:
370 events.Repeat(Seconds(20), Seconds(25));
371 break;
374 events.Repeat(Seconds(11));
375 break;
378 events.Repeat(Seconds(18));
379 break;
380 default:
381 break;
382 }
383 }
384};
385
387{
389
396
397 void ExecuteEvent(uint32 eventId) override
398 {
399 switch (eventId)
400 {
404 break;
405 case EVENT_ENRAGE:
407 events.Repeat(Seconds(25));
408 break;
409 case EVENT_ENRAGE_2:
411 break;
412 default:
413 break;
414 }
415 }
416};
417
419{
421
428
429 void ExecuteEvent(uint32 eventId) override
430 {
431 switch (eventId)
432 {
433 case EVENT_GORE:
435 events.Repeat(Seconds(19));
436 break;
440 events.Repeat(Seconds(18));
441 break;
442 case EVENT_STOMP:
444 events.Repeat(Seconds(10), Seconds(15));
445 break;
446 default:
447 break;
448 }
449 }
450};
451
453{
455
462
463 void JustSummoned(Creature* summon) override
464 {
465 if (summon->GetEntry() == NPC_JORMUNGAR_WORM)
466 {
467 summon->m_Events.AddEvent(new WormAttackEvent(summon->ToTempSummon()), summon->m_Events.CalculateTime(2s));
468 summon->GetMotionMaster()->MoveRandom(5.0f);
469 }
470 }
471
472 void ExecuteEvent(uint32 eventId) override
473 {
474 switch (eventId)
475 {
476 case EVENT_ACID_SPIT:
479 break;
482 events.Repeat(Seconds(16));
483 break;
487 events.Repeat(Seconds(14));
488 break;
489 default:
490 break;
491 }
492 }
493
499};
500
502{
503 go_palehoof_sphere(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
504
506
507 bool OnGossipHello(Player* /*player*/) override
508 {
510 {
511 if (palehoof->IsAlive() && instance->GetBossState(DATA_GORTOK_PALEHOOF) != DONE)
512 {
515 palehoof->AI()->DoAction(ACTION_START_ENCOUNTER);
516 }
517 }
518 return true;
519 }
520};
521
522// 48139 - Crazed
535
536// 48146 - Crazed
538{
539 bool Validate(SpellInfo const* /*spellInfo*/) override
540 {
542 }
543
545 {
547 }
548
553};
554
555// 47669 - Awaken Subboss
557{
558 bool Validate(SpellInfo const* /*spellInfo*/) override
559 {
561 }
562
563 void HandleScript(SpellEffIndex /*effIndex*/)
564 {
565 Unit* target = GetHitUnit();
567 target->SetUninteractible(false);
568 target->m_Events.AddEvent(new CombatStartEvent(target), target->m_Events.CalculateTime(8500ms));
569 }
570
575};
576
577// 47670 - Awaken Gortok
579{
580 void HandleDummy(SpellEffIndex /*effIndex*/)
581 {
582 Unit* target = GetHitUnit();
583 target->SetUninteractible(false);
584 target->m_Events.AddEvent(new CombatStartEvent(target), target->m_Events.CalculateTime(8s));
585 }
586
591};
592
uint8_t uint8
Definition Define.h:156
int32_t int32
Definition Define.h:150
uint64_t uint64
Definition Define.h:153
uint32_t uint32
Definition Define.h:154
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:28
std::chrono::minutes Minutes
Minutes shorthand typedef.
Definition Duration.h:32
@ DONE
@ ENCOUNTER_FRAME_DISENGAGE
@ ENCOUNTER_FRAME_ENGAGE
@ TEMPSUMMON_CORPSE_DESPAWN
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
Spells
Definition PlayerAI.cpp:32
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
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
@ SPELLVALUE_MAX_TARGETS
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
#define SpellEffectFn(F, I, N)
#define AuraEffectRemoveFn(F, I, N, M)
EvadeReason
@ REACT_AGGRESSIVE
@ 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
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
TypeID GetTypeId() const
Definition BaseEntity.h:166
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:169
Creature *const me
Definition CreatureAI.h:63
void SetImmuneToPC(bool apply) override
Definition Creature.h:184
void SetReactState(ReactStates st)
Definition Creature.h:174
CreatureAI * AI() const
Definition Creature.h:228
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
void Reset()
Definition EventMap.cpp:25
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:277
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={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::ForceWalk, MovementSlot slot=MOTION_SLOT_DEFAULT, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
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 Clear()
Definition ObjectGuid.h:329
uint32 GetEntry() const
Definition Object.h:89
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)
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
void SetTempSummonType(TempSummonType type)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
virtual void DoAction(int32 param)
Definition UnitAI.h:73
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:635
MotionMaster * GetMotionMaster()
Definition Unit.h:1723
TempSummon * ToTempSummon()
Definition Unit.h:1828
UnitAI * GetAI() const
Definition Unit.h:668
void SetUninteractible(bool apply)
Definition Unit.cpp:8564
bool SetWalk(bool enable)
Definition Unit.cpp:13343
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3974
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
void setActive(bool isActiveObject)
Definition Object.cpp:276
EventProcessor m_Events
Definition Object.h:561
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:1507
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 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
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