Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_maiden_of_grief.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/* Script Data Start
7SDName: Boss maiden_of_grief
8SDAuthor: LordVanMartin
9SD%Complete:
10SDComment:
11SDCategory:
12Script Data End */
13
14#include "ScriptMgr.h"
15#include "ScriptedCreature.h"
16#include "halls_of_stone.h"
17
28
30{
35};
36
41
43{
44public:
45 boss_maiden_of_grief() : CreatureScript("boss_maiden_of_grief") { }
46
48 {
50 {
51 instance = me->GetInstanceScript();
52 }
53
55
60
62 {
63 PartingSorrowTimer = std::rand() % 30000 + 25000;
64 StormOfGriefTimer = 10000;
65 ShockOfSorrowTimer = 20000+rand()%5000;
66 PillarOfWoeTimer = std::rand() % 15000 + 5000;
67
68 if (instance)
69 {
72 }
73 }
74
75 void EnterCombat(Unit* /*who*/) OVERRIDE
76 {
78
79 if (instance)
80 {
83 }
84 }
85
87 {
88 //Return since we have no target
89 if (!UpdateVictim())
90 return;
91
92 if (IsHeroic())
93 {
94 if (PartingSorrowTimer <= diff)
95 {
96 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
98
99 PartingSorrowTimer = std::rand() % 40000 + 30000;
100 } else PartingSorrowTimer -= diff;
101 }
102
103 if (StormOfGriefTimer <= diff)
104 {
106 StormOfGriefTimer = std::rand() % 20000 + 15000;
107 } else StormOfGriefTimer -= diff;
108
109 if (ShockOfSorrowTimer <= diff)
110 {
112 Talk(SAY_STUN);
114 ShockOfSorrowTimer = std::rand() % 30000 + 20000;
115 } else ShockOfSorrowTimer -= diff;
116
117 if (PillarOfWoeTimer <= diff)
118 {
120
121 if (target)
123 else
125
126 PillarOfWoeTimer = std::rand() % 25000 + 5000;
127 } else PillarOfWoeTimer -= diff;
128
130 }
131
132 void JustDied(Unit* /*killer*/) OVERRIDE
133 {
135
136 if (instance)
137 instance->SetBossState(DATA_MAIDEN_OF_GRIEF, DONE);
138 }
139
141 {
142 if (victim->GetTypeId() != TypeID::TYPEID_PLAYER)
143 return;
144
145 Talk(SAY_SLAY);
146 }
147 };
148
150 {
152 }
153};
154
@ ACHIEVEMENT_TIMED_TYPE_EVENT
Definition DBCEnums.h:158
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
@ TYPEID_PLAYER
Definition Object.h:55
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SAY_SLAY
#define SAY_DEATH
#define SAY_AGGRO
@ SPELL_STORM_OF_GRIEF_H
@ SPELL_SHOCK_OF_SORROW_N
@ SPELL_PILLAR_OF_WOE_N
@ SPELL_STORM_OF_GRIEF_N
@ SPELL_PILLAR_OF_WOE_H
@ SPELL_PARTING_SORROW
@ SPELL_SHOCK_OF_SORROW_H
void AddSC_boss_maiden_of_grief()
@ ACHIEV_GOOD_GRIEF_START_EVENT
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
AI * GetHallsOfStoneAI(Creature *creature)
@ DATA_MAIDEN_OF_GRIEF
bool IsHeroic() const
Creature * me
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================