Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_huhuran.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_Huhuran
8SD%Complete: 100
9SDComment:
10SDCategory: Temple of Ahn'Qiraj
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15
28
30{
31public:
32 boss_huhuran() : CreatureScript("boss_huhuran") { }
33
35 {
36 return new boss_huhuranAI(creature);
37 }
38
39 struct boss_huhuranAI : public ScriptedAI
40 {
41 boss_huhuranAI(Creature* creature) : ScriptedAI(creature) { }
42
49
50 bool Frenzy;
51 bool Berserk;
52
54 {
55 Frenzy_Timer = std::rand() % 35000 + 25000;
56 Wyvern_Timer = std::rand() % 28000 + 18000;
57 Spit_Timer = 8000;
58 PoisonBolt_Timer = 4000;
59 NoxiousPoison_Timer = std::rand() % 20000 + 10000;
60 FrenzyBack_Timer = 15000;
61
62 Frenzy = false;
63 Berserk = false;
64 }
65
66 void EnterCombat(Unit* /*who*/) OVERRIDE
67 {
68 }
69
71 {
72 //Return since we have no target
73 if (!UpdateVictim())
74 return;
75
76 //Frenzy_Timer
77 if (!Frenzy && Frenzy_Timer <= diff)
78 {
81 Frenzy = true;
82 PoisonBolt_Timer = 3000;
83 Frenzy_Timer = std::rand() % 35000 + 25000;
84 } else Frenzy_Timer -= diff;
85
86 // Wyvern Timer
87 if (Wyvern_Timer <= diff)
88 {
89 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
91 Wyvern_Timer = std::rand() % 32000 + 15000;
92 } else Wyvern_Timer -= diff;
93
94 //Spit Timer
95 if (Spit_Timer <= diff)
96 {
98 Spit_Timer = std::rand() % 10000 + 5000;
99 } else Spit_Timer -= diff;
100
101 //NoxiousPoison_Timer
102 if (NoxiousPoison_Timer <= diff)
103 {
105 NoxiousPoison_Timer = std::rand() % 24000 + 12000;
106 } else NoxiousPoison_Timer -= diff;
107
108 //PoisonBolt only if frenzy or berserk
109 if (Frenzy || Berserk)
110 {
111 if (PoisonBolt_Timer <= diff)
112 {
114 PoisonBolt_Timer = 3000;
115 } else PoisonBolt_Timer -= diff;
116 }
117
118 //FrenzyBack_Timer
119 if (Frenzy && FrenzyBack_Timer <= diff)
120 {
121 me->InterruptNonMeleeSpells(false);
122 Frenzy = false;
123 FrenzyBack_Timer = 15000;
124 } else FrenzyBack_Timer -= diff;
125
126 if (!Berserk && HealthBelowPct(31))
127 {
128 me->InterruptNonMeleeSpells(false);
131 Berserk = true;
132 }
133
135 }
136 };
137};
138
140{
141 new boss_huhuran();
142}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SPELL_FRENZY
#define SPELL_BERSERK
@ EMOTE_FRENZY_KILL
void AddSC_boss_huhuran()
Huhuran
@ SPELL_ACIDSPIT
@ SPELL_WYVERNSTING
@ SPELL_NOXIOUSPOISON
@ SPELL_FRENZY
@ EMOTE_BERSERK
@ SPELL_BERSERK
@ SPELL_POISONBOLT
@ EMOTE_FRENZY_KILL
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
bool HealthBelowPct(uint32 pct) const
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void EnterCombat(Unit *) OVERRIDE
boss_huhuranAI(Creature *creature)