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 std::bind(&BossAI::DoMeleeAttackIfReady, this));
78 }
79
80 void ScheduleTasks() override
81 {
82 scheduler.Schedule(10s, [this](TaskContext task)
83 {
85 task.Repeat();
86 });
87
88 scheduler.Schedule(15s, [this](TaskContext task)
89 {
90 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true))
91 DoCast(target, SPELL_BLIZZARD);
92 task.Repeat();
93 });
94
95 scheduler.Schedule(20s, [this](TaskContext task)
96 {
98 task.Repeat();
99 });
100
101 scheduler.Schedule(25s, [this](TaskContext task)
102 {
104 task.Repeat();
105 });
106
107 if (IsHeroic())
108 {
109 scheduler.Schedule(30s, [this](TaskContext task)
110 {
111 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
113 task.Repeat();
114 });
115 }
116 }
117};
118
119// 58694 - Arcane Vacuum
139
141{
142 public:
143 achievement_defenseless() : AchievementCriteriaScript("achievement_defenseless") { }
144
145 bool OnCheck(Player* /*player*/, Unit* target) override
146 {
147 if (!target)
148 return false;
149
150 InstanceScript* instance = target->GetInstanceScript();
151 if (!instance)
152 return false;
153
154 return instance->GetData(DATA_DEFENSELESS) != 0;
155 }
156};
157
uint32_t uint32
Definition Define.h:133
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
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
void JustEngagedWith(Unit *who) override
TaskScheduler scheduler
bool UpdateVictim()
TypeID GetTypeId() const
Definition Object.h:93
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
TaskScheduler & Update(success_t const &callback=EmptyCallback)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:243
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1087
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:55
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
bool OnCheck(Player *, Unit *target) override
PrepareSpellScript(spell_cyanigosa_arcane_vacuum)
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:51
@ DATA_DEFENSELESS
Definition violet_hold.h:66
#define RegisterVioletHoldCreatureAI(ai_name)