Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_noxxion.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/* ScriptData
7SDName: Boss_Noxxion
8SD%Complete: 100
9SDComment:
10SDCategory: Maraudon
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15
17{
20};
21
23{
24public:
25 boss_noxxion() : CreatureScript("boss_noxxion") { }
26
28 {
29 return new boss_noxxionAI(creature);
30 }
31
32 struct boss_noxxionAI : public ScriptedAI
33 {
34 boss_noxxionAI(Creature* creature) : ScriptedAI(creature) { }
35
41
43 {
44 ToxicVolleyTimer = 7000;
45 UppercutTimer = 16000;
46 AddsTimer = 19000;
47 InvisibleTimer = 15000; //Too much too low?
48 Invisible = false;
49 }
50
51 void EnterCombat(Unit* /*who*/) OVERRIDE { }
52
53 void SummonAdds(Unit* victim)
54 {
55 if (Creature* Add = DoSpawnCreature(13456, float(std::rand() % 7 + -7), float(std::rand() % 7 + -7), 0, 0, TempSummonType::TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000))
56 Add->AI()->AttackStart(victim);
57 }
58
60 {
61 if (Invisible && InvisibleTimer <= diff)
62 {
63 //Become visible again
64 me->setFaction(14);
66 //Noxxion model
67 me->SetDisplayId(11172);
68 Invisible = false;
69 //me->m_canMove = true;
70 }
71 else if (Invisible)
72 {
73 InvisibleTimer -= diff;
74 //Do nothing while invisible
75 return;
76 }
77
78 //Return since we have no target
79 if (!UpdateVictim())
80 return;
81
82 //ToxicVolleyTimer
83 if (ToxicVolleyTimer <= diff)
84 {
86 ToxicVolleyTimer = 9000;
87 }
88 else ToxicVolleyTimer -= diff;
89
90 //UppercutTimer
91 if (UppercutTimer <= diff)
92 {
94 UppercutTimer = 12000;
95 }
96 else UppercutTimer -= diff;
97
98 //AddsTimer
99 if (!Invisible && AddsTimer <= diff)
100 {
101 //Interrupt any spell casting
102 //me->m_canMove = true;
103 me->InterruptNonMeleeSpells(false);
104 me->setFaction(35);
106 // Invisible Model
107 me->SetDisplayId(11686);
108 SummonAdds(me->GetVictim());
109 SummonAdds(me->GetVictim());
110 SummonAdds(me->GetVictim());
111 SummonAdds(me->GetVictim());
112 SummonAdds(me->GetVictim());
113 Invisible = true;
114 InvisibleTimer = 15000;
115
116 AddsTimer = 40000;
117 }
118 else AddsTimer -= diff;
119
121 }
122 };
123};
124
126{
127 new boss_noxxion();
128}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN
Definition Object.h:69
@ UNIT_FLAG_NOT_SELECTABLE
Definition Unit.h:650
@ UNIT_FIELD_FLAGS
void AddSC_boss_noxxion()
@ SPELL_TOXICVOLLEY
@ SPELL_UPPERCUT
bool UpdateVictim()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
Creature * DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, TempSummonType type, uint32 despawntime)
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void SummonAdds(Unit *victim)
boss_noxxionAI(Creature *creature)
void EnterCombat(Unit *) OVERRIDE