Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_hungarfen.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_Hungarfen
8SD%Complete: 95
9SDComment: Need confirmation if spell data are same in both modes. Summons should have faster rate in heroic
10SDCategory: Coilfang Resevoir, Underbog
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15
25
27{
28public:
29 boss_hungarfen() : CreatureScript("boss_hungarfen") { }
30
32 {
33 boss_hungarfenAI(Creature* creature) : ScriptedAI(creature)
34 {
35 Root = false;
38 }
39
41 {
42 Root = false;
43 Mushroom_Timer = 5000; // 1 mushroom after 5s, then one per 10s. This should be different in heroic mode
44 AcidGeyser_Timer = 10000;
45 }
46
47 void EnterCombat(Unit* /*who*/) OVERRIDE { }
48
50 {
51 if (!UpdateVictim())
52 return;
53
54 if (!HealthAbovePct(20))
55 {
56 if (!Root)
57 {
59 Root = true;
60 }
61 }
62
63 if (Mushroom_Timer <= diff)
64 {
65 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
66 me->SummonCreature(17990, target->GetPositionX()+(rand()%8), target->GetPositionY()+(rand()%8), target->GetPositionZ(), float(rand()%5), TempSummonType::TEMPSUMMON_TIMED_DESPAWN, 22000);
67 else
68 me->SummonCreature(17990, me->GetPositionX()+(rand()%8), me->GetPositionY()+(rand()%8), me->GetPositionZ(), float(rand()%5), TempSummonType::TEMPSUMMON_TIMED_DESPAWN, 22000);
69
70 Mushroom_Timer = 10000;
71 } else Mushroom_Timer -= diff;
72
73 if (AcidGeyser_Timer <= diff)
74 {
75 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
77 AcidGeyser_Timer = 10000+rand()%7500;
78 } else AcidGeyser_Timer -= diff;
79
81 }
82 private:
83 bool Root;
86 };
87
89 {
90 return new boss_hungarfenAI(creature);
91 }
92};
93
95{
96public:
97 npc_underbog_mushroom() : CreatureScript("npc_underbog_mushroom") { }
98
100 {
102 {
103 Stop = false;
104 Grow_Timer = 0;
105 Shrink_Timer = 0;
106 }
107
109 {
110 Stop = false;
111 Grow_Timer = 0;
112 Shrink_Timer = 20000;
113
116 }
117
118 void MoveInLineOfSight(Unit* /*who*/) OVERRIDE { }
119
120
121 void AttackStart(Unit* /*who*/) OVERRIDE { }
122
123 void EnterCombat(Unit* /*who*/) OVERRIDE { }
124
126 {
127 if (Stop)
128 return;
129
130 if (Grow_Timer <= diff)
131 {
133 Grow_Timer = 3000;
134 } else Grow_Timer -= diff;
135
136 if (Shrink_Timer <= diff)
137 {
138 me->RemoveAurasDueToSpell(SPELL_GROW);
139 Stop = true;
140 } else Shrink_Timer -= diff;
141 }
142 private:
143 bool Stop;
146 };
147
149 {
150 return new npc_underbog_mushroomAI(creature);
151 }
152};
153
155{
156 new boss_hungarfen();
158}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:70
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SPELL_PUTRID_MUSHROOM
@ SPELL_ACID_GEYSER
void AddSC_boss_hungarfen()
@ SPELL_FOUL_SPORES
@ SPELL_SPORE_CLOUD
@ SPELL_ACID_GEYSER
@ SPELL_GROW
@ SPELL_PUTRID_MUSHROOM
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
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
bool HealthAbovePct(uint32 pct) const
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void EnterCombat(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
@ SPELL_GROW