TrinityCore
Loading...
Searching...
No Matches
forge_of_souls.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 "forge_of_souls.h"
20#include "Player.h"
21#include "ScriptedCreature.h"
22#include "ScriptedGossip.h"
23#include "SpellAuras.h"
24#include "SpellScript.h"
25
40
59
67
73
75{
76 SPELL_LETHARGY = 69133
77};
78
80{
87
89 {
91 }
92
94
97
98 void Reset() override
99 {
100 events.Reset();
101 Initialize();
102 }
103
104 bool OnGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
105 {
106 if (menuId == MENU_ID_SYLVANAS && gossipListId == GOSSIP_OPTION_ID)
107 {
108 CloseGossipMenuFor(player);
111 events.Reset();
113 }
114 return false;
115 }
116
117 void UpdateAI(uint32 diff) override
118 {
119 if (phase == PHASE_INTRO)
120 {
121 events.Update(diff);
122 switch (events.ExecuteEvent())
123 {
124 case EVENT_INTRO_1:
127 break;
128
129 case EVENT_INTRO_2:
132 break;
133
134 case EVENT_INTRO_3:
137 break;
138
139 case EVENT_INTRO_4:
142 break;
143
144 case EVENT_INTRO_5:
147 break;
148
149 case EVENT_INTRO_6:
151 // End of Intro
153 break;
154 }
155 }
156
157 //Return since we have no target
158 if (!UpdateVictim())
159 return;
160
161 events.Update(diff);
163 }
164};
165
167{
168 npc_jaina_fos(Creature* creature) : ScriptedAI(creature)
169 {
170 Initialize();
173 }
174
176 {
178 }
179
181
184
185 void Reset() override
186 {
187 events.Reset();
188 Initialize();
189 }
190
191 bool OnGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
192 {
193 if (menuId == MENU_ID_JAINA && gossipListId == GOSSIP_OPTION_ID)
194 {
195 CloseGossipMenuFor(player);
198 events.Reset();
200 }
201 return false;
202 }
203
204 void UpdateAI(uint32 diff) override
205 {
206 if (phase == PHASE_INTRO)
207 {
208 events.Update(diff);
209 switch (events.ExecuteEvent())
210 {
211 case EVENT_INTRO_1:
214 break;
215
216 case EVENT_INTRO_2:
219 break;
220
221 case EVENT_INTRO_3:
224 break;
225
226 case EVENT_INTRO_4:
229 break;
230
231 case EVENT_INTRO_5:
234 break;
235
236 case EVENT_INTRO_6:
239 break;
240
241 case EVENT_INTRO_7:
244 break;
245
246 case EVENT_INTRO_8:
248 // End of Intro
250 break;
251 }
252 }
253
254 //Return since we have no target
255 if (!UpdateVictim())
256 return;
257
258 events.Update(diff);
259
261 }
262};
263
264// 69131 - Soul Sickness
266{
268
269 bool Validate(SpellInfo const* /*spellInfo*/) override
270 {
272 }
273
274 void HandleStun(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
275 {
276 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
277 {
278 Unit* target = GetTarget();
279 target->CastSpell(target, SPELL_LETHARGY, aurEff);
280 }
281 }
282
287};
288
uint32_t uint32
Definition Define.h:133
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
void CloseGossipMenuFor(Player *player)
@ EFFECT_0
@ AURA_REMOVE_BY_EXPIRE
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_DUMMY
#define AuraEffectRemoveFn(F, I, N, M)
@ UNIT_NPC_FLAG_GOSSIP
Yells
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
Unit * GetTarget() const
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
void Reset()
Definition EventMap.cpp:21
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
Definition Unit.h:769
void RemoveNpcFlag(NPCFlags flags)
Definition Unit.h:1098
void SetNpcFlag(NPCFlags flags)
Definition Unit.h:1097
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1087
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
PrepareAuraScript(spell_forge_of_souls_soul_sickness)
void HandleStun(AuraEffect const *aurEff, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
@ GOSSIP_OPTION_ID
@ MENU_ID_JAINA
@ MENU_ID_SYLVANAS
@ ACTION_INTRO
@ SAY_JAINA_INTRO_4
@ SAY_SYLVANAS_INTRO_3
@ SAY_JAINA_INTRO_5
@ SAY_SYLVANAS_INTRO_4
@ SAY_JAINA_INTRO_6
@ SAY_JAINA_INTRO_2
@ SAY_JAINA_INTRO_1
@ SAY_JAINA_INTRO_8
@ SAY_SYLVANAS_INTRO_5
@ SAY_SYLVANAS_INTRO_2
@ SAY_SYLVANAS_INTRO_6
@ SAY_JAINA_INTRO_7
@ SAY_JAINA_INTRO_3
@ SAY_SYLVANAS_INTRO_1
ForgeSpells
@ SPELL_LETHARGY
void AddSC_forge_of_souls()
@ PHASE_INTRO
@ PHASE_NORMAL
@ EVENT_INTRO_4
@ EVENT_INTRO_1
@ EVENT_INTRO_2
@ EVENT_INTRO_5
@ EVENT_INTRO_8
@ EVENT_INTRO_6
@ EVENT_INTRO_7
@ EVENT_NONE
@ EVENT_INTRO_3
#define RegisterForgeOfSoulsCreatureAI(ai_name)
bool OnGossipSelect(Player *player, uint32 menuId, uint32 gossipListId) override
npc_jaina_fos(Creature *creature)
void UpdateAI(uint32 diff) override
InstanceScript * instance
void Reset() override
InstanceScript * instance
npc_sylvanas_fos(Creature *creature)
void UpdateAI(uint32 diff) override
void Reset() override
bool OnGossipSelect(Player *player, uint32 menuId, uint32 gossipListId) override