TrinityCore
boss_majordomo_executus.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/* ScriptData
19SDName: Boss_Majordomo_Executus
20SD%Complete: 30
21SDComment: Correct spawning and Event NYI
22SDCategory: Molten Core
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "InstanceScript.h"
27#include "Map.h"
28#include "molten_core.h"
29#include "Player.h"
30#include "ScriptedCreature.h"
31#include "ScriptedGossip.h"
32
34{
40
43};
44
46{
53};
54
56{
59};
60
62{
67
71};
72
73struct boss_majordomo : public BossAI
74{
76 {
77 }
78
79 void KilledUnit(Unit* /*victim*/) override
80 {
81 if (urand(0, 99) < 25)
83 }
84
85 void JustEngagedWith(Unit* who) override
86 {
93 }
94
95 void UpdateAI(uint32 diff) override
96 {
98 {
99 if (!UpdateVictim())
100 return;
101
102 events.Update(diff);
103
105 {
109 _JustDied();
111 return;
112 }
113
115 return;
116
117 if (HealthBelowPct(50))
119
120 while (uint32 eventId = events.ExecuteEvent())
121 {
122 switch (eventId)
123 {
127 break;
131 break;
132 case EVENT_BLAST_WAVE:
135 break;
136 case EVENT_TELEPORT:
138 DoCast(target, SPELL_TELEPORT);
140 break;
141 default:
142 break;
143 }
144
146 return;
147 }
148 }
149 else
150 {
151 events.Update(diff);
152
153 while (uint32 eventId = events.ExecuteEvent())
154 {
155 switch (eventId)
156 {
157 case EVENT_OUTRO_1:
160 break;
161 case EVENT_OUTRO_2:
163 break;
164 case EVENT_OUTRO_3:
166 break;
167 default:
168 break;
169 }
170 }
171 }
172 }
173
174 void DoAction(int32 action) override
175 {
176 if (action == ACTION_START_RAGNAROS)
177 {
182 }
183 else if (action == ACTION_START_RAGNAROS_ALT)
184 {
187 }
188 }
189
190 bool OnGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
191 {
192 if (menuId == MENU_OPTION_YOU_CHALLENGED_US && gossipListId == OPTION_ID_YOU_CHALLENGED_US)
193 {
194 CloseGossipMenuFor(player);
196 }
197 return false;
198 }
199};
200
202{
204}
Texts
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
@ DONE
Spells
Definition: PlayerAI.cpp:32
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:42
void CloseGossipMenuFor(Player *player)
@ FACTION_FRIENDLY
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:297
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ SPELL_DAMAGE_REFLECTION
@ SPELL_SUMMON_RAGNAROS
@ SPELL_AEGIS_OF_RAGNAROS
@ SPELL_MAGIC_REFLECTION
void AddSC_boss_majordomo()
@ MENU_OPTION_YOU_CHALLENGED_US
@ OPTION_ID_YOU_CHALLENGED_US
@ EVENT_DAMAGE_REFLECTION
@ EVENT_MAGIC_REFLECTION
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
EventMap events
void _JustDied()
virtual void EnterEvadeMode(EvadeReason why=EvadeReason::Other)
Definition: CreatureAI.cpp:219
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
InstanceMap * instance
EncounterState GetBossState(uint32 id) const
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, Milliseconds duration=0ms, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty, SmoothPhasingInfo const *smoothPhasingInfo=nullptr)
Definition: Object.cpp:1836
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
void SetFaction(uint32 faction) override
Definition: Unit.h:859
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:983
void SetNpcFlag(NPCFlags flags)
Definition: Unit.h:982
void NearTeleportTo(Position const &pos, bool casting=false)
Definition: Unit.cpp:12327
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2148
Position const RagnarosSummonPos
Position const RagnarosTelePos
#define RegisterMoltenCoreCreatureAI(ai_name)
Definition: molten_core.h:84
@ ACTION_START_RAGNAROS
Definition: molten_core.h:45
@ ACTION_START_RAGNAROS_ALT
Definition: molten_core.h:46
@ NPC_RAGNAROS
Definition: molten_core.h:63
@ NPC_FLAMEWAKER_ELITE
Definition: molten_core.h:65
@ NPC_FLAMEWAKER_HEALER
Definition: molten_core.h:64
@ BOSS_MAJORDOMO_EXECUTUS
Definition: molten_core.h:38
constexpr float GetPositionX() const
Definition: Position.h:76
constexpr float GetPositionY() const
Definition: Position.h:77
constexpr float GetOrientation() const
Definition: Position.h:79
constexpr float GetPositionZ() const
Definition: Position.h:78
bool HealthBelowPct(uint32 pct) const
void KilledUnit(Unit *) override
bool OnGossipSelect(Player *player, uint32 menuId, uint32 gossipListId) override
void DoAction(int32 action) override
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *who) override
boss_majordomo(Creature *creature)