Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_maiden_of_virtue.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_Maiden_of_Virtue
8SD%Complete: 100
9SDComment:
10SDCategory: Karazhan
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15
29
31{
32public:
33 boss_maiden_of_virtue() : CreatureScript("boss_maiden_of_virtue") { }
34
36 {
37 return new boss_maiden_of_virtueAI(creature);
38 }
39
41 {
42 boss_maiden_of_virtueAI(Creature* creature) : ScriptedAI(creature) { }
43
49
50 bool Enraged;
51
53 {
54 Repentance_Timer = 25000+(rand()%15000);
55 Holyfire_Timer = 8000+(rand()%17000);
56 Holywrath_Timer = 15000+(rand()%10000);
57 Holyground_Timer = 3000;
58 Enrage_Timer = 600000;
59
60 Enraged = false;
61 }
62
63 void KilledUnit(Unit* /*Victim*/) OVERRIDE
64 {
65 if ((std::rand() % 1) == 0)
67 }
68
69 void JustDied(Unit* /*killer*/) OVERRIDE
70 {
72 }
73
74 void EnterCombat(Unit* /*who*/) OVERRIDE
75 {
77 }
78
80 {
81 if (!UpdateVictim())
82 return;
83
84 if (Enrage_Timer < diff && !Enraged)
85 {
86 DoCast(me, SPELL_BERSERK, true);
87 Enraged = true;
88 } else Enrage_Timer -= diff;
89
90 if (Holyground_Timer <= diff)
91 {
92 DoCast(me, SPELL_HOLYGROUND, true); //Triggered so it doesn't interrupt her at all
93 Holyground_Timer = 3000;
94 } else Holyground_Timer -= diff;
95
96 if (Repentance_Timer <= diff)
97 {
100
101 Repentance_Timer = std::rand() % 35000 + 25000; //A little randomness on that spell
102 } else Repentance_Timer -= diff;
103
104 if (Holyfire_Timer <= diff)
105 {
106 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
107 DoCast(target, SPELL_HOLYFIRE);
108
109 Holyfire_Timer = std::rand() % 23000 + 8000; //Anywhere from 8 to 23 seconds, good luck having several of those in a row!
110 } else Holyfire_Timer -= diff;
111
112 if (Holywrath_Timer <= diff)
113 {
114 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
115 DoCast(target, SPELL_HOLYWRATH);
116
117 Holywrath_Timer = std::rand() % 25000 + 20000; //20-30 secs sounds nice
118 } else Holywrath_Timer -= diff;
119
121 }
122 };
123};
124
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SAY_SLAY
#define SAY_DEATH
#define SAY_AGGRO
#define SPELL_BERSERK
void AddSC_boss_maiden_of_virtue()
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
Creature * me
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================