Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_gluth.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#include "ScriptMgr.h"
7#include "ScriptedCreature.h"
8#include "naxxramas.h"
9
18
20{
21 NPC_ZOMBIE = 16360
22};
23
25{
26 {3267.9f, -3172.1f, 297.42f, 0.94f},
27 {3253.2f, -3132.3f, 297.42f, 0},
28 {3308.3f, -3185.8f, 297.42f, 1.58f},
29};
30
39
40#define EMOTE_NEARBY " spots a nearby zombie to devour!"
41
43{
44public:
45 boss_gluth() : CreatureScript("boss_gluth") { }
46
48 {
49 return new boss_gluthAI(creature);
50 }
51
52 struct boss_gluthAI : public BossAI
53 {
54 boss_gluthAI(Creature* creature) : BossAI(creature, BOSS_GLUTH)
55 {
56 // Do not let Gluth be affected by zombies' debuff
57 me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_INFECTED_WOUND, true);
58 }
59
61
62 {
63 if (who->GetEntry() == NPC_ZOMBIE && me->IsWithinDistInMap(who, 7))
64 {
65 SetGazeOn(who);
67 me->MonsterTextEmote(EMOTE_NEARBY, 0, true);
68 }
69 else
71 }
72
73 void EnterCombat(Unit* /*who*/) OVERRIDE
74 {
76 events.ScheduleEvent(EVENT_WOUND, 10000);
77 events.ScheduleEvent(EVENT_ENRAGE, 15000);
78 events.ScheduleEvent(EVENT_DECIMATE, 105000);
79 events.ScheduleEvent(EVENT_BERSERK, 8*60000);
80 events.ScheduleEvent(EVENT_SUMMON, 15000);
81 }
82
84 {
85 if (summon->GetEntry() == NPC_ZOMBIE)
86 summon->AI()->AttackStart(me);
87 summons.Summon(summon);
88 }
89
91 {
93 return;
94
95 events.Update(diff);
96
97 while (uint32 eventId = events.ExecuteEvent())
98 {
99 switch (eventId)
100 {
101 case EVENT_WOUND:
103 events.ScheduleEvent(EVENT_WOUND, 10000);
104 break;
105 case EVENT_ENRAGE:
108 events.ScheduleEvent(EVENT_ENRAGE, 15000);
109 break;
110 case EVENT_DECIMATE:
113 events.ScheduleEvent(EVENT_DECIMATE, 105000);
114 break;
115 case EVENT_BERSERK:
117 events.ScheduleEvent(EVENT_BERSERK, 5*60000);
118 break;
119 case EVENT_SUMMON:
120 for (int32 i = 0; i < RAID_MODE(1, 2); ++i)
121 DoSummon(NPC_ZOMBIE, PosSummon[rand() % RAID_MODE(1, 3)]);
122 events.ScheduleEvent(EVENT_SUMMON, 10000);
123 break;
124 }
125 }
126
127 if (me->GetVictim() && me->GetVictim()->GetEntry() == NPC_ZOMBIE)
128 {
129 if (me->IsWithinMeleeRange(me->GetVictim()))
130 {
131 me->Kill(me->GetVictim());
132 me->ModifyHealth(int32(me->CountPctFromMaxHealth(5)));
133 }
134 }
135 else
137 }
138 };
139};
140
142{
143 new boss_gluth();
144}
std::int32_t int32
Definition Define.h:73
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ IMMUNITY_ID
Creatures
@ SPELL_ENRAGE
@ EVENT_ENRAGE
@ SPELL_DECIMATE
@ EVENT_DECIMATE
#define SPELL_BERSERK
Position const PosSummon[3]
@ NPC_ZOMBIE
#define EMOTE_NEARBY
@ SPELL_ENRAGE
@ SPELL_DECIMATE
@ SPELL_BERSERK
@ SPELL_MORTAL_WOUND
@ SPELL_INFECTED_WOUND
void AddSC_boss_gluth()
@ EVENT_ENRAGE
@ EVENT_WOUND
@ EVENT_BERSERK
@ EVENT_SUMMON
@ EVENT_DECIMATE
@ EVENT_BERSERK
@ SPELL_MORTAL_WOUND
@ SPELL_INFECTED_WOUND
bool CheckInRoom()
SummonList summons
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
virtual void MoveInLineOfSight(Unit *)
Creature * DoSummon(uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN)
bool UpdateVictimWithGaze()
void SetGazeOn(Unit *target)
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:176
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ BOSS_GLUTH
Definition naxxramas.h:21
Creature * me
const T & RAID_MODE(const T &normal10, const T &normal25) const
boss_gluthAI(Creature *creature)
void MoveInLineOfSight(Unit *who) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void EnterCombat(Unit *) OVERRIDE
void JustSummoned(Creature *summon) OVERRIDE