Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_loatheb.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 "SpellScript.h"
9#include "SpellAuraEffects.h"
10#include "naxxramas.h"
11
22
29
38
43
45{
46public:
47 boss_loatheb() : CreatureScript("boss_loatheb") {}
48
49 struct boss_loathebAI : public BossAI
50 {
52 {
53 _sporeLoserData = false;
54 _doomCounter = 0;
55 }
56
58 {
59 _Reset();
60 _doomCounter = 0;
61 _sporeLoserData = true;
62 }
63
64 void EnterCombat(Unit* /*who*/) OVERRIDE
65 {
67 events.ScheduleEvent(EVENT_NECROTIC_AURA, 17000);
68 events.ScheduleEvent(EVENT_DEATHBLOOM, 5000);
69 events.ScheduleEvent(EVENT_SPORE, IsHeroic() ? 18000 : 36000);
70 events.ScheduleEvent(EVENT_INEVITABLE_DOOM, 120000);
71 }
72
73 void SummonedCreatureDies(Creature* /*summon*/, Unit* /*killer*/) OVERRIDE
74 {
75 _sporeLoserData = false;
76 }
77
79 {
81 return 0;
82
83 return uint32(_sporeLoserData);
84 }
85
87 {
88 if (!UpdateVictim())
89 return;
90
91 events.Update(diff);
92
93 while (uint32 eventId = events.ExecuteEvent())
94 {
95 switch (eventId)
96 {
100 events.ScheduleEvent(EVENT_NECROTIC_AURA, 20000);
101 events.ScheduleEvent(EVENT_NECROTIC_AURA_FADING, 14000);
102 break;
103 case EVENT_DEATHBLOOM:
105 events.ScheduleEvent(EVENT_DEATHBLOOM, 30000);
106 break;
108 _doomCounter++;
110 events.ScheduleEvent(EVENT_INEVITABLE_DOOM, std::max(120000 - _doomCounter * 15000, 15000)); // needs to be confirmed
111 break;
112 case EVENT_SPORE:
114 events.ScheduleEvent(EVENT_SPORE, IsHeroic() ? 18000 : 36000);
115 break;
118 break;
119 default:
120 break;
121 }
122 }
123
125 }
126
127 private:
130 };
131
133 {
134 return new boss_loathebAI(creature);
135 }
136};
137
139{
140public:
141 achievement_spore_loser() : AchievementCriteriaScript("achievement_spore_loser") {}
142
143 bool OnCheck(Player* /*source*/, Unit* target) OVERRIDE
144 {
145 return target && target->GetAI()->GetData(DATA_ACHIEVEMENT_SPORE_LOSER);
146 }
147};
148
150
191
DBCStorage< SpellEntry > sSpellStore(SpellEntryfmt)
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
#define CAST_AI(a, b)
@ EFFECT_0
@ SPELL_AURA_DUMMY
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
#define AuraEffectApplyFn(F, I, N, M)
#define AuraEffectRemoveFn(F, I, N, M)
void AddSC_boss_loatheb()
Achievement
@ DATA_ACHIEVEMENT_SPORE_LOSER
boss_loatheb::boss_loathebAI LoathebAI
@ SPELL_INEVITABLE_DOOM
@ H_SPELL_DEATHBLOOM
@ SPELL_SUMMON_SPORE
@ SPELL_DEATHBLOOM
@ SPELL_NECROTIC_AURA
@ H_SPELL_INEVITABLE_DOOM
@ SPELL_WARN_NECROTIC_AURA
@ SAY_NECROTIC_AURA_REMOVED
@ SAY_NECROTIC_AURA_APPLIED
@ SAY_NECROTIC_AURA_FADING
@ EVENT_NECROTIC_AURA_FADING
@ EVENT_SPORE
@ EVENT_NECROTIC_AURA
@ EVENT_DEATHBLOOM
@ EVENT_INEVITABLE_DOOM
AchievementCriteriaScript(const char *name)
HookList< EffectApplyHandler > AfterEffectRemove
HookList< EffectApplyHandler > AfterEffectApply
Unit * GetTarget() const
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
SpellScriptLoader(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:176
Definition Unit.h:1367
bool OnCheck(Player *, Unit *target) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
AuraScript * GetAuraScript() const OVERRIDE
@ BOSS_LOATHEB
Definition naxxramas.h:18
bool IsHeroic() const
Creature * me
const T & RAID_MODE(const T &normal10, const T &normal25) const
boss_loathebAI(Creature *creature)
void EnterCombat(Unit *) OVERRIDE
void SummonedCreatureDies(Creature *, Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
uint32 GetData(uint32 id) const OVERRIDE