Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_grobbulus.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#include "SpellInfo.h"
10
21
29
31{
33};
34
36{
37public:
38 boss_grobbulus() : CreatureScript("boss_grobbulus") { }
39
41 {
42 return new boss_grobbulusAI(creature);
43 }
44
45 struct boss_grobbulusAI : public BossAI
46 {
48 {
49 me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_POISON_CLOUD_ADD, true);
50 }
51
52 void EnterCombat(Unit* /*who*/) OVERRIDE
53 {
55 events.ScheduleEvent(EVENT_CLOUD, 15000);
56 events.ScheduleEvent(EVENT_INJECT, 20000);
57 events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000); //not sure
58 events.ScheduleEvent(EVENT_BERSERK, 12*60000);
59 }
60
61 void SpellHitTarget(Unit* target, const SpellInfo* spell) OVERRIDE
62 {
63 if (spell->Id == uint32(SPELL_SLIME_SPRAY))
64 {
65 if (TempSummon* slime = me->SummonCreature(NPC_FALLOUT_SLIME, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0))
66 DoZoneInCombat(slime);
67 }
68 }
69
71 {
72 if (!UpdateVictim())
73 return;
74
75 events.Update(diff);
76
77 while (uint32 eventId = events.ExecuteEvent())
78 {
79 switch (eventId)
80 {
81 case EVENT_CLOUD:
83 events.ScheduleEvent(EVENT_CLOUD, 15000);
84 return;
85 case EVENT_BERSERK:
87 return;
88 case EVENT_SPRAY:
90 events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000);
91 return;
92 case EVENT_INJECT:
93 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
94 if (!target->HasAura(SPELL_MUTATING_INJECTION))
96 events.ScheduleEvent(EVENT_INJECT, 8000 + uint32(120 * me->GetHealthPct()));
97 return;
98 }
99 }
101 }
102 };
103};
104
106{
107public:
108 npc_grobbulus_poison_cloud() : CreatureScript("npc_grobbulus_poison_cloud") { }
109
111 {
112 return new npc_grobbulus_poison_cloudAI(creature);
113 }
114
116 {
118 {
119 SetCombatMovement(false);
120 }
121
123
125 {
126 Cloud_Timer = 1000;
128 }
129
131 {
132 if (Cloud_Timer <= diff)
133 {
135 Cloud_Timer = 10000;
136 } else Cloud_Timer -= diff;
137 }
138 };
139};
140
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition Object.h:71
@ IMMUNITY_ID
@ UNIT_FLAG_NON_ATTACKABLE
Definition Unit.h:626
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ UNIT_FIELD_FLAGS
@ SPELL_POISON_CLOUD
#define SPELL_BERSERK
@ H_SPELL_SLIME_SPRAY
@ SPELL_BOMBARD_SLIME
@ SPELL_POISON_CLOUD_ADD
@ SPELL_MUTATING_INJECTION
@ SPELL_SLIME_SPRAY
@ SPELL_BERSERK
@ SPELL_POISON_CLOUD
@ NPC_FALLOUT_SLIME
void AddSC_boss_grobbulus()
@ EVENT_CLOUD
@ EVENT_BERSERK
@ EVENT_INJECT
@ EVENT_SPRAY
@ EVENT_BERSERK
@ SPELL_SLIME_SPRAY
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
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 DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:176
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ BOSS_GROBBULUS
Definition naxxramas.h:20
void SetCombatMovement(bool allowMovement)
Creature * me
ScriptedAI(Creature *creature)
void SpellHitTarget(Unit *target, const SpellInfo *spell) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void EnterCombat(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================