TrinityCore
Loading...
Searching...
No Matches
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
34
45
46// 31134 - Cyanigosa
47struct boss_cyanigosa : public BossAI
48{
49 boss_cyanigosa(Creature* creature) : BossAI(creature, DATA_CYANIGOSA) { }
50
51 void JustEngagedWith(Unit* who) override
52 {
55 }
56
57 void KilledUnit(Unit* victim) override
58 {
59 if (victim->GetTypeId() == TYPEID_PLAYER)
61 }
62
63 void JustDied(Unit* /*killer*/) override
64 {
66 _JustDied();
67 }
68
69 void MoveInLineOfSight(Unit* /*who*/) override { }
70
71 void UpdateAI(uint32 diff) override
72 {
73 if (!UpdateVictim())
74 return;
75
76 scheduler.Update(diff);
77 }
78
79 void ScheduleTasks() override
80 {
81 scheduler.Schedule(10s, [this](TaskContext& task)
82 {
84 task.Repeat();
85 });
86
87 scheduler.Schedule(15s, [this](TaskContext& task)
88 {
89 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true))
90 DoCast(target, SPELL_BLIZZARD);
91 task.Repeat();
92 });
93
94 scheduler.Schedule(20s, [this](TaskContext& task)
95 {
97 task.Repeat();
98 });
99
100 scheduler.Schedule(25s, [this](TaskContext& task)
101 {
103 task.Repeat();
104 });
105
106 if (IsHeroic())
107 {
108 scheduler.Schedule(30s, [this](TaskContext& task)
109 {
110 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
112 task.Repeat();
113 });
114 }
115 }
116};
117
118// 58694 - Arcane Vacuum
120{
121 bool Validate(SpellInfo const* /*spellInfo*/) override
122 {
124 }
125
126 void HandleScript(SpellEffIndex /*effIndex*/)
127 {
129 }
130
135};
136
138{
139 public:
140 achievement_defenseless() : AchievementCriteriaScript("achievement_defenseless") { }
141
142 bool OnCheck(Player* /*player*/, Unit* target) override
143 {
144 if (!target)
145 return false;
146
147 InstanceScript* instance = target->GetInstanceScript();
148 if (!instance)
149 return false;
150
151 return instance->GetData(DATA_DEFENSELESS) != 0;
152 }
153};
154
uint32_t uint32
Definition Define.h:154
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
#define SpellEffectFn(F, I, N)
void AddSC_boss_cyanigosa()
CyanigosaSpells
@ SPELL_SUMMON_PLAYER
@ SPELL_TRANSFORM
@ SPELL_UNCONTROLLABLE_ENERGY
@ SPELL_ARCANE_VACUUM
@ SPELL_BLIZZARD
@ SPELL_MANA_DESTRUCTION
@ SPELL_TAIL_SWEEP
CyanigosaTexts
@ SAY_DEATH
@ SAY_BREATH_ATTACK
@ SAY_AGGRO
@ SAY_DISRUPTION
@ SAY_SLAY
@ SAY_SPAWN
@ SAY_SPECIAL_ATTACK
TypeID GetTypeId() const
Definition BaseEntity.h:166
void JustEngagedWith(Unit *who) override
TaskScheduler scheduler
bool UpdateVictim()
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
TaskContext & Repeat(TaskScheduler::duration_t duration)
TaskScheduler & Schedule(duration_t time, task_handler_t task)
TaskScheduler & Update()
Update the scheduler to the current time.
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:172
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:71
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:162
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:81
Definition Unit.h:647
InstanceScript * GetInstanceScript() const
Definition Object.cpp:394
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2222
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:99
bool OnCheck(Player *, Unit *target) override
bool Validate(SpellInfo const *) override
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)