TrinityCore
boss_noxxion.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_Noxxion
20SD%Complete: 100
21SDComment:
22SDCategory: Maraudon
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "maraudon.h"
27#include "ScriptedCreature.h"
28
30{
32 SPELL_UPPERCUT = 22916
33};
34
36{
37public:
38 boss_noxxion() : CreatureScript("boss_noxxion") { }
39
40 CreatureAI* GetAI(Creature* creature) const override
41 {
42 return GetMaraudonAI<boss_noxxionAI>(creature);
43 }
44
45 struct boss_noxxionAI : public BossAI
46 {
48 {
49 Initialize();
50 }
51
53 {
54 ToxicVolleyTimer = 7000;
55 UppercutTimer = 16000;
56 AddsTimer = 19000;
57 InvisibleTimer = 15000; //Too much too low?
58 Invisible = false;
59 }
60
66
67 void Reset() override
68 {
70
71 Initialize();
72 }
73
74 void SummonAdds(Unit* victim)
75 {
76 if (Creature* Add = DoSpawnCreature(13456, float(irand(-7, 7)), float(irand(-7, 7)), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90s))
77 Add->AI()->AttackStart(victim);
78 }
79
80 void UpdateAI(uint32 diff) override
81 {
82 if (Invisible && InvisibleTimer <= diff)
83 {
84 //Become visible again
86 me->SetUninteractible(false);
87 //Noxxion model
88 me->SetDisplayId(11172);
89 Invisible = false;
90 //me->m_canMove = true;
91 }
92 else if (Invisible)
93 {
94 InvisibleTimer -= diff;
95 //Do nothing while invisible
96 return;
97 }
98
99 //Return since we have no target
100 if (!UpdateVictim())
101 return;
102
103 //ToxicVolleyTimer
104 if (ToxicVolleyTimer <= diff)
105 {
107 ToxicVolleyTimer = 9000;
108 }
109 else ToxicVolleyTimer -= diff;
110
111 //UppercutTimer
112 if (UppercutTimer <= diff)
113 {
115 UppercutTimer = 12000;
116 }
117 else UppercutTimer -= diff;
118
119 //AddsTimer
120 if (!Invisible && AddsTimer <= diff)
121 {
122 //Interrupt any spell casting
123 //me->m_canMove = true;
126 me->SetUninteractible(true);
127 // Invisible Model
128 me->SetDisplayId(11686);
134 Invisible = true;
135 InvisibleTimer = 15000;
136
137 AddsTimer = 40000;
138 }
139 else AddsTimer -= diff;
140 }
141 };
142};
143
145{
146 new boss_noxxion();
147}
uint32_t uint32
Definition: Define.h:142
@ TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN
Definition: ObjectDefines.h:64
Spells
Definition: PlayerAI.cpp:32
int32 irand(int32 min, int32 max)
Definition: Random.cpp:35
@ FACTION_FRIENDLY
@ FACTION_MONSTER
void AddSC_boss_noxxion()
@ SPELL_TOXICVOLLEY
@ SPELL_UPPERCUT
void Reset() override
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
void SetDisplayId(uint32 displayId, bool setNative=false) override
Definition: Creature.cpp:3402
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Definition: Unit.h:627
void SetFaction(uint32 faction) override
Definition: Unit.h:859
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:3089
void SetUninteractible(bool apply)
Definition: Unit.cpp:8147
Unit * GetVictim() const
Definition: Unit.h:715
CreatureAI * GetAI(Creature *creature) const override
@ BOSS_NOXXION
Definition: maraudon.h:27
Creature * DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, Milliseconds despawntime)
void UpdateAI(uint32 diff) override
void SummonAdds(Unit *victim)
boss_noxxionAI(Creature *creature)