TrinityCore
Loading...
Searching...
No Matches
boss_razorgore.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 "blackwing_lair.h"
20#include "InstanceScript.h"
21#include "GameObject.h"
22#include "GameObjectAI.h"
23#include "Player.h"
24#include "ScriptedCreature.h"
25#include "SpellScript.h"
26
34
36{
37 // @todo orb uses the wrong spell, this needs sniffs
41
42 SPELL_CLEAVE = 22540,
46};
47
49{
52 NPC_WARRIOR = 12416,
53 NPC_MAGE = 12420,
54 NPC_WARLOCK = 12459,
55
56 GO_EGG = 177807
57};
58
66
67struct boss_razorgore : public BossAI
68{
70 {
71 Initialize();
72 }
73
75 {
76 secondPhase = false;
77 }
78
79 void Reset() override
80 {
81 _Reset();
82
83 Initialize();
85 }
86
87 void JustDied(Unit* /*killer*/) override
88 {
89 _JustDied();
91
93 }
94
106
107 void DoAction(int32 action) override
108 {
109 if (action == ACTION_PHASE_TWO)
111 }
112
113 void DamageTaken(Unit* /*who*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
114 {
115 // @todo this is wrong - razorgore should still take damage, he should just nuke the whole room and respawn if he dies during P1
116 if (!secondPhase)
117 damage = 0;
118 }
119
120 void UpdateAI(uint32 diff) override
121 {
122 if (!UpdateVictim())
123 return;
124
125 events.Update(diff);
126
128 return;
129
130 while (uint32 eventId = events.ExecuteEvent())
131 {
132 switch (eventId)
133 {
134 case EVENT_CLEAVE:
137 break;
138 case EVENT_STOMP:
141 break;
142 case EVENT_FIREBALL:
145 break;
149 break;
150 }
151
153 return;
154 }
156 }
157
158private:
160};
161
163{
164 go_orb_of_domination(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
165
167
168 bool OnGossipHello(Player* player) override
169 {
171 {
173 {
174 razorgore->Attack(player, true);
175 player->CastSpell(razorgore, SPELL_MINDCONTROL);
176 }
177 }
178 return true;
179 }
180};
181
182// 19873 - Destroy Egg
184{
186
188 {
189 if (InstanceScript* instance = GetCaster()->GetInstanceScript())
190 instance->SetData(DATA_EGG_EVENT, SPECIAL);
191 }
192
193 void Register() override
194 {
196 }
197};
198
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
@ DONE
@ SPECIAL
@ NOT_STARTED
Spells
Definition PlayerAI.cpp:32
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
#define SpellHitFn(F)
@ UNIT_STATE_CASTING
Definition Unit.h:235
DamageEffectType
Definition Unit.h:352
@ DATA_EGG_EVENT
@ ACTION_PHASE_TWO
#define RegisterBlackwingLairCreatureAI(ai_name)
#define RegisterBlackwingLairGameObjectAI(ai_name)
@ DATA_RAZORGORE_THE_UNTAMED
@ EVENT_FIREBALL
@ EVENT_CONFLAGRATION
@ EVENT_STOMP
@ EVENT_CLEAVE
@ SPELL_CLEAVE
@ SPELL_CONFLAGRATION
@ SPELL_MINDCONTROL
@ SPELL_CHANNEL
@ SPELL_FIREBALLVOLLEY
@ SPELL_WARSTOMP
@ SPELL_EGG_DESTROY
@ SAY_DEATH
@ SAY_EGGS_BROKEN1
@ SAY_EGGS_BROKEN3
@ SAY_EGGS_BROKEN2
@ GO_EGG
@ NPC_MAGE
@ NPC_WARLOCK
@ NPC_WARRIOR
@ NPC_ELITE_WARRIOR
@ NPC_ELITE_DRACHKIN
void AddSC_boss_razorgore()
InstanceScript *const instance
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void Update(uint32 time)
Definition EventMap.h:67
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
Creature * GetCreature(uint32 type)
Unit * GetCaster() const
HookList< HitHandler > OnHit
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Definition Unit.h:769
void SetFullHealth()
Definition Unit.h:927
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
void RemoveAllAuras()
Definition Unit.cpp:4157
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:55
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:56
void Register() override
PrepareSpellScript(spell_egg_event)
void UpdateAI(uint32 diff) override
void JustDied(Unit *) override
void Reset() override
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void DoAction(int32 action) override
boss_razorgore(Creature *creature)
InstanceScript * instance
bool OnGossipHello(Player *player) override
go_orb_of_domination(GameObject *go)