TrinityCore
Loading...
Searching...
No Matches
boss_mother_shahraz.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 "ScriptedCreature.h"
20#include "black_temple.h"
21#include "SpellScript.h"
22#include "SpellAuraEffects.h"
23#include "GridNotifiers.h"
24
36
61
71
79
87
97
98// 22947 - Mother Shahraz
100{
102
103 void Reset() override
104 {
105 _Reset();
106 _enraged = false;
107 }
108
120
121 void KilledUnit(Unit* victim) override
122 {
123 if (victim->GetTypeId() == TYPEID_PLAYER)
124 Talk(SAY_SLAY);
125 }
126
127 void JustDied(Unit* /*killer*/) override
128 {
129 _JustDied();
131 }
132
133 void EnterEvadeMode(EvadeReason /*why*/) override
134 {
136 }
137
138 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
139 {
140 if (!_enraged && me->HealthBelowPctDamaged(10, damage))
141 {
142 _enraged = true;
146 }
147 }
148
149 void ExecuteEvent(uint32 eventId) override
150 {
151 switch (eventId)
152 {
155 events.Repeat(30s);
156 break;
159 events.Repeat(15s);
160 break;
164 events.Repeat(30s);
165 break;
168 events.Repeat(18s, 30s);
169 break;
170 case EVENT_TAUNT:
172 events.Repeat(30s, 40s);
173 break;
174 case EVENT_BERSERK:
177 break;
178 default:
179 break;
180 }
181 }
182
183private:
185};
186
187// 40869 - Fatal Attraction
223
224// 40870 - Fatal Attraction Dummy Visual
244
245// 40816 - Saber Lash
247{
249
250 bool Validate(SpellInfo const* spellInfo) override
251 {
252 return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_1).TriggerSpell });
253 }
254
255 void OnTrigger(AuraEffect const* aurEff)
256 {
258
259 uint32 triggerSpell = aurEff->GetSpellEffectInfo().TriggerSpell;
260 if (Unit* target = GetUnitOwner()->GetAI()->SelectTarget(SelectTargetMethod::Random, 0))
261 GetUnitOwner()->CastSpell(target, triggerSpell, true);
262 }
263
268};
269
270/* 40863 - Sinister Periodic
271 40865 - Vile Periodic
272 40866 - Wicked Periodic
273 40862 - Sinful Periodic */
275{
277
278 bool Validate(SpellInfo const* spellInfo) override
279 {
280 return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
281 }
282
283 void OnTrigger(AuraEffect const* aurEff)
284 {
286
287 uint32 triggerSpell = aurEff->GetSpellEffectInfo().TriggerSpell;
288 if (Unit* target = GetUnitOwner()->GetAI()->SelectTarget(SelectTargetMethod::Random, 0))
289 GetUnitOwner()->CastSpell(target, triggerSpell, true);
290 }
291
296};
297
298// 40867 - Random Periodic
319
uint32_t uint32
Definition Define.h:133
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:42
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_TELEPORT_UNITS
@ TARGET_DEST_CASTER_RANDOM
@ TARGET_UNIT_SRC_AREA_ENEMY
#define EFFECT_ALL
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ SPELLVALUE_MAX_TARGETS
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define SpellDestinationTargetSelectFn(F, I, N)
DamageEffectType
Definition Unit.h:352
#define RegisterBlackTempleCreatureAI(ai_name)
@ DATA_MOTHER_SHAHRAZ
void AddSC_boss_mother_shahraz()
uint32 const PrismaticAuras[6]
@ EVENT_RANDOM_BEAM
@ EVENT_SILENCING_SHRIEK
@ EVENT_BERSERK
@ EVENT_FATAL_ATTRACTION
@ EVENT_PRISMATIC_SHIELD
uint32 const RandomBeam[4]
uint32 const BeamTriggers[4]
@ SPELL_SABER_LASH_IMMUNITY
@ SPELL_RANDOM_PERIODIC
@ SPELL_SILENCING_SHRIEK
@ SPELL_SINISTER_PERIODIC
@ SPELL_BEAM_WICKED
@ SPELL_PRISMATIC_AURA_NATURE
@ SPELL_BEAM_VILE
@ SPELL_BEAM_SINISTER
@ SPELL_PRISMATIC_AURA_FIRE
@ SPELL_SINFUL_PERIODIC
@ SPELL_FATAL_ATTRACTION
@ SPELL_FATAL_ATTRACTION_TELEPORT
@ SPELL_WICKED_PERIODIC
@ SPELL_BEAM_SINFUL
@ SPELL_PRISMATIC_AURA_SHADOW
@ SPELL_PRISMATIC_AURA_FROST
@ SPELL_BERSERK
@ SPELL_PRISMATIC_AURA_HOLY
@ SPELL_PRISMATIC_AURA_ARCANE
@ SPELL_VILE_PERIODIC
@ SPELL_FATAL_ATTRACTION_DAMAGE
@ EMOTE_BERSERK
SpellEffectInfo const & GetSpellEffectInfo() const
void PreventDefaultAction()
HookList< EffectPeriodicHandler > OnEffectPeriodic
Unit * GetUnitOwner() const
void JustEngagedWith(Unit *who) override
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
EventMap events
Creature *const me
Definition CreatureAI.h:82
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
TypeID GetTypeId() const
Definition Object.h:93
uint32 TriggerSpell
Definition SpellInfo.h:228
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition SpellInfo.h:483
Unit * GetCaster() const
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Definition Unit.h:769
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:918
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
PrepareSpellScript(spell_mother_shahraz_fatal_attraction)
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *spellInfo) override
void OnTrigger(AuraEffect const *aurEff)
PrepareAuraScript(spell_mother_shahraz_generic_periodic)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_mother_shahraz_random_periodic)
bool Validate(SpellInfo const *spellInfo) override
void OnTrigger(AuraEffect const *aurEff)
PrepareAuraScript(spell_mother_shahraz_saber_lash)
void Relocate(Position const &pos)
Definition Spell.cpp:99
void JustEngagedWith(Unit *who) override
void KilledUnit(Unit *victim) override
void ExecuteEvent(uint32 eventId) override
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void EnterEvadeMode(EvadeReason) override
boss_mother_shahraz(Creature *creature)
void JustDied(Unit *) override