TrinityCore
Loading...
Searching...
No Matches
boss_venoxis.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 "zulgurub.h"
19#include "ObjectMgr.h"
20#include "ScriptedCreature.h"
21#include "ScriptMgr.h"
22#include "Spell.h"
23
24/*
25 * @todo
26 * - Fix timers (research some more)
27 */
28
29enum Says
30{
31 SAY_VENOXIS_TRANSFORM = 1, // Let the coils of hate unfurl!
32 SAY_VENOXIS_DEATH = 2 // Ssserenity.. at lassst!
33};
34
36{
37 // troll form
40 SPELL_RENEW = 23895,
44
45 // snake form
51
52 // used when swapping event-stages
53 SPELL_VENOXIS_TRANSFORM = 23849, // 50% health - shapechange to cobra
54 SPELL_FRENZY = 8269 // 20% health - frenzy
55};
56
58{
59 // troll form
66
67 // phase-changing
69
70 // snake form events
75};
76
78{
79 PHASE_ONE = 1, // troll form
80 PHASE_TWO = 2 // snake form
81};
82
83enum NPCs
84{
86};
87
88struct boss_venoxis : public BossAI
89{
90 boss_venoxis(Creature* creature) : BossAI(creature, DATA_VENOXIS)
91 {
92 Initialize();
93 }
94
96 {
97 _inMeleeRange = 0;
98 _transformed = false;
99 _frenzied = false;
100 }
101
102 void Reset() override
103 {
104 _Reset();
105 // remove all spells and auras from previous attempts
108 // set some internally used variables to their defaults
109 Initialize();
111 }
112
113 void JustDied(Unit* /*killer*/) override
114 {
115 _JustDied();
118 }
119
120 void JustEngagedWith(Unit* who) override
121 {
124 // Always running events
126 // Phase one events (regular form)
132
134
135 // Set zone in combat
137 }
138
139 void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
140 {
141 // check if venoxis is ready to transform
142 if (!_transformed && !HealthAbovePct(50))
143 {
144 _transformed = true;
145 // schedule the event that changes our phase
147 }
148 // we're losing health, bad, go frenzy
149 else if (!_frenzied && !HealthAbovePct(20))
150 {
151 _frenzied = true;
153 }
154 }
155
156 void UpdateAI(uint32 diff) override
157 {
158 if (!UpdateVictim())
159 return;
160
161 events.Update(diff);
162
163 // return back to main code if we're still casting
165 return;
166
167 while (uint32 eventId = events.ExecuteEvent())
168 {
169 switch (eventId)
170 {
171 // thrash is available in all phases
172 case EVENT_THRASH:
173 DoCast(me, SPELL_THRASH, true);
175 break;
176 // troll form spells and Actions (first part)
180 break;
181 case EVENT_RENEW:
184 break;
185 case EVENT_HOLY_NOVA:
186 _inMeleeRange = 0;
187
188 for (uint8 i = 0; i < 10; ++i)
189 {
191 // check if target is within melee-distance
192 if (me->IsWithinMeleeRange(target))
194 }
195
196 // trigger spellcast only if we have 3 or more targets to affect
197 if (_inMeleeRange >= 3)
199
201 break;
202 case EVENT_HOLY_FIRE:
204 DoCast(target, SPELL_HOLY_FIRE);
206 break;
207 case EVENT_HOLY_WRATH:
209 DoCast(target, SPELL_HOLY_WRATH);
211 break;
212
213 //
214 // snake form spells and Actions
215 //
216
217 case EVENT_VENOM_SPIT:
219 DoCast(target, SPELL_VENOM_SPIT);
221 break;
224 DoCast(target, SPELL_POISON_CLOUD);
226 break;
231 break;
232 case EVENT_FRENZY:
233 // frenzy at 20% health
234 DoCast(me, SPELL_FRENZY, true);
235 break;
236
237 //
238 // shape and phase-changing
239 //
240
241 case EVENT_TRANSFORM:
242 // shapeshift at 50% health
246
247 // phase two events (snakeform)
251
252 // transformed, start phase two
254
255 break;
256 default:
257 break;
258 }
259
261 return;
262 }
263
265 }
266
267private:
271};
272
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
Spells
Definition PlayerAI.cpp:32
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
@ UNIT_STATE_CASTING
Definition Unit.h:235
DamageEffectType
Definition Unit.h:352
@ SAY_VENOXIS_TRANSFORM
@ SAY_VENOXIS_DEATH
@ SPELL_HOLY_WRATH
@ SPELL_VENOXIS_TRANSFORM
@ SPELL_PARASITIC_SERPENT
@ SPELL_DISPEL_MAGIC
@ SPELL_HOLY_NOVA
@ SPELL_SUMMON_PARASITIC_SERPENT
@ SPELL_THRASH
@ SPELL_RENEW
@ SPELL_FRENZY
@ SPELL_HOLY_FIRE
@ SPELL_POISON_CLOUD
@ SPELL_PARASITIC_SERPENT_TRIGGER
@ SPELL_VENOM_SPIT
@ PHASE_ONE
@ PHASE_TWO
@ NPC_PARASITIC_SERPENT
void AddSC_boss_venoxis()
@ EVENT_POISON_CLOUD
@ EVENT_RENEW
@ EVENT_HOLY_WRATH
@ EVENT_DISPEL_MAGIC
@ EVENT_TRANSFORM
@ EVENT_FRENZY
@ EVENT_PARASITIC_SERPENT
@ EVENT_HOLY_NOVA
@ EVENT_THRASH
@ EVENT_VENOM_SPIT
@ EVENT_HOLY_FIRE
void JustEngagedWith(Unit *who) override
EventMap events
void DoZoneInCombat(Creature *creature=nullptr)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void SetReactState(ReactStates st)
Definition Creature.h:119
void Update(uint32 time)
Definition EventMap.h:67
EventId ExecuteEvent()
Definition EventMap.cpp:73
void SetPhase(PhaseIndex phase)
Definition EventMap.cpp:28
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
bool IsWithinMeleeRange(Unit const *obj) const
Definition Unit.h:844
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
void RemoveAllAuras()
Definition Unit.cpp:4157
bool HealthAbovePct(uint32 pct) const
void ResetThreatList(Unit *who=nullptr)
void JustEngagedWith(Unit *who) override
boss_venoxis(Creature *creature)
void Reset() override
void UpdateAI(uint32 diff) override
void JustDied(Unit *) override
void DamageTaken(Unit *, uint32 &, DamageEffectType, SpellInfo const *) override
#define RegisterZulGurubCreatureAI(ai_name)
Definition zulgurub.h:91
@ DATA_VENOXIS
Definition zulgurub.h:31