TrinityCore
boss_romogg_bonecrusher.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 "blackrock_caverns.h"
20#include "InstanceScript.h"
21#include "ScriptedCreature.h"
22
24{
31 SPELL_CALL_FOR_HELP = 82137, // Needs Scripting
33 SPELL_QUAKE = 75272,
37 EVENT_QUAKE = 2, // Not yet sure of timing
42};
43
44Position const SummonPos = { 249.2639f, 949.1614f, 191.7866f, 3.141593f };
45
47{
48 public:
49 boss_romogg_bonecrusher() : CreatureScript("boss_romogg_bonecrusher") { }
50
52 {
54 {
56 }
57
58 void Reset() override
59 {
60 _Reset();
61 }
62
63 void JustDied(Unit* /*killer*/) override
64 {
65 _JustDied();
67
69 raz->AI()->SetData(TYPE_RAZ, DATA_ROMOGG_DEAD);
70 }
71
72 void KilledUnit(Unit* who) override
73 {
74 if (who->GetTypeId() == TYPEID_PLAYER)
76 }
77
78 void JustEngagedWith(Unit* who) override
79 {
87 }
88
89 void UpdateAI(uint32 diff) override
90 {
91 if (!UpdateVictim())
92 return;
93
94 events.Update(diff);
95
97 return;
98
99 while (uint32 eventId = events.ExecuteEvent())
100 {
101 switch (eventId)
102 {
108 break;
112 break;
113 case EVENT_QUAKE:
116 break;
120 break;
121 default:
122 break;
123 }
124 }
125 }
126 };
127
128 CreatureAI* GetAI(Creature* creature) const override
129 {
130 return GetBlackrockCavernsAI<boss_romogg_bonecrusherAI>(creature);
131 }
132};
133
135{
137}
uint32_t uint32
Definition: Define.h:142
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: ObjectDefines.h:70
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ NPC_RAZ_THE_CRAZED
@ DATA_RAZ_THE_CRAZED
@ DATA_ROMOGG_BONECRUSHER
@ SPELL_SKULLCRACKER
@ EMOTE_SKULLCRACKER
@ EMOTE_CALL_FOR_HELP
@ SPELL_WOUNDING_STRIKE
@ EVENT_SKULLCRACKER
@ SPELL_CALL_FOR_HELP
@ EVENT_CHAINS_OF_WOE
@ EVENT_WOUNDING_STRIKE
@ SPELL_CHAINS_OF_WOE
void AddSC_boss_romogg_bonecrusher()
Position const SummonPos
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
EventMap events
void _JustDied()
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
Creature * GetCreature(uint32 type)
TypeID GetTypeId() const
Definition: Object.h:173
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
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:2025
CreatureAI * GetAI(Creature *creature) const override