TrinityCore
boss_cyanigosa.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "ScriptMgr.h"
19#include "InstanceScript.h"
20#include "SpellScript.h"
21#include "ScriptedCreature.h"
22#include "violet_hold.h"
23
25{
32 SPELL_TRANSFORM = 58668
33};
34
36{
44};
45
46struct boss_cyanigosa : public BossAI
47{
48 boss_cyanigosa(Creature* creature) : BossAI(creature, DATA_CYANIGOSA) { }
49
50 void JustEngagedWith(Unit* who) override
51 {
54 }
55
56 void KilledUnit(Unit* victim) override
57 {
58 if (victim->GetTypeId() == TYPEID_PLAYER)
60 }
61
62 void JustDied(Unit* /*killer*/) override
63 {
65 _JustDied();
66 }
67
68 void MoveInLineOfSight(Unit* /*who*/) override { }
69
70 void UpdateAI(uint32 diff) override
71 {
72 if (!UpdateVictim())
73 return;
74
75 scheduler.Update(diff);
76 }
77
78 void ScheduleTasks() override
79 {
80 scheduler.Schedule(Seconds(10), [this](TaskContext task)
81 {
83 task.Repeat();
84 });
85
86 scheduler.Schedule(Seconds(15), [this](TaskContext task)
87 {
88 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true))
89 DoCast(target, SPELL_BLIZZARD);
90 task.Repeat();
91 });
92
93 scheduler.Schedule(Seconds(20), [this](TaskContext task)
94 {
96 task.Repeat();
97 });
98
99 scheduler.Schedule(Seconds(25), [this](TaskContext task)
100 {
102 task.Repeat();
103 });
104
105 if (IsHeroic())
106 {
107 scheduler.Schedule(Seconds(30), [this](TaskContext task)
108 {
109 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
111 task.Repeat();
112 });
113 }
114 }
115};
116
118{
119 public:
120 achievement_defenseless() : AchievementCriteriaScript("achievement_defenseless") { }
121
122 bool OnCheck(Player* /*player*/, Unit* target) override
123 {
124 if (!target)
125 return false;
126
127 InstanceScript* instance = target->GetInstanceScript();
128 if (!instance)
129 return false;
130
131 return instance->GetData(DATA_DEFENSELESS) != 0;
132 }
133};
134
135// 58694 - Arcane Vacuum
137{
138 bool Validate(SpellInfo const* /*spellInfo*/) override
139 {
141 }
142
143 void HandleScript(SpellEffIndex /*effIndex*/)
144 {
146 }
147
148 void Register() override
149 {
151 }
152};
153
155{
159}
uint32_t uint32
Definition: Define.h:142
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:32
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
Spells
Definition: PlayerAI.cpp:32
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_0
Definition: SharedDefines.h:30
@ SPELL_EFFECT_DUMMY
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
@ SAY_DEATH
@ SAY_BREATH_ATTACK
@ SAY_AGGRO
@ SAY_DISRUPTION
@ SAY_SLAY
@ SAY_SPAWN
@ SAY_SPECIAL_ATTACK
@ SPELL_SUMMON_PLAYER
@ SPELL_TRANSFORM
@ SPELL_UNCONTROLLABLE_ENERGY
@ SPELL_ARCANE_VACUUM
@ SPELL_BLIZZARD
@ SPELL_MANA_DESTRUCTION
@ SPELL_TAIL_SWEEP
void AddSC_boss_cyanigosa()
Yells
void JustEngagedWith(Unit *who) override
TaskScheduler scheduler
void _JustDied()
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
TypeID GetTypeId() const
Definition: Object.h:173
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:162
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
TaskContext & Repeat(std::chrono::duration< Rep, Period > duration)
TaskScheduler & Schedule(std::chrono::duration< Rep, Period > time, task_handler_t task)
TaskScheduler & Update(success_t const &callback=nullptr)
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:161
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1042
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:91
bool OnCheck(Player *, Unit *target) override
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
bool IsHeroic() const
void KilledUnit(Unit *victim) override
void JustEngagedWith(Unit *who) override
void UpdateAI(uint32 diff) override
void JustDied(Unit *) override
void MoveInLineOfSight(Unit *) override
boss_cyanigosa(Creature *creature)
void ScheduleTasks() override
@ DATA_CYANIGOSA
Definition: violet_hold.h:52
@ DATA_DEFENSELESS
Definition: violet_hold.h:67
#define RegisterVioletHoldCreatureAI(ai_name)
Definition: violet_hold.h:164