TrinityCore
Loading...
Searching...
No Matches
boss_argaloth.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 "baradin_hold.h"
20#include "Containers.h"
21#include "InstanceScript.h"
22#include "Map.h"
23#include "ScriptedCreature.h"
24#include "SpellAuraEffects.h"
25#include "SpellScript.h"
26
31
41
50
51struct boss_argaloth : public BossAI
52{
54
63
70
71 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
72 {
73 if (damage >= me->GetHealth() || _isInFelFirestormPhase)
74 return;
75
76 if ((me->HealthBelowPctDamaged(66, damage) && _felFirestormCount == 0) || (me->HealthBelowPctDamaged(33, damage) && _felFirestormCount == 1))
77 {
80 }
81 }
82
89
141private:
144};
145
146// 88954 - Consuming Darkness
148{
149 void HandlePeriodic(AuraEffect const* /*aurEff*/)
150 {
151 if (AuraEffect* aurEff = GetEffect(EFFECT_0))
152 {
153 SpellEffectValue damage = aurEff->GetAmount() + CalculatePct(aurEff->GetAmount(), 10);
154 aurEff->SetAmount(damage);
155 }
156 }
157
162};
163
164// 88972 - Fel Firestorm
182
183// 88987 - Fel Firestorm
185{
186 void FilterTargets(std::list<WorldObject*>& targets)
187 {
188 if (targets.empty())
189 return;
190
191 size_t targetSize = GetCaster()->GetMap()->Is25ManRaid() ? 8 : 3;
192 if (targets.size() > targetSize)
193 Trinity::Containers::RandomResize(targets, targetSize);
194 }
195
200};
201
uint8_t uint8
Definition Define.h:156
uint32_t uint32
Definition Define.h:154
@ ENCOUNTER_FRAME_DISENGAGE
@ ENCOUNTER_FRAME_ENGAGE
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
@ EFFECT_0
@ TARGET_UNIT_SRC_AREA_ENEMY
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ SPELLVALUE_MAX_TARGETS
double SpellEffectValue
This is a double instead of float to be able to store full range of int32.
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define AuraEffectApplyFn(F, I, N, M)
EvadeReason
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
DamageEffectType
@ UNIT_STATE_CASTING
Definition Unit.h:276
T CalculatePct(T base, U pct)
Definition Util.h:72
@ BOSS_ARGALOTH
@ DATA_EXTINUISH_FEL_FLAMES
#define RegisterBaradinHoldCreatureAI(ai_name)
void AddSC_boss_argaloth()
ArgalothTexts
@ SAY_ANNOUNCE_FEL_FIRESTORM
ArgalothSpells
@ SPELL_CONSUMING_DARKNESS
@ SPELL_FEL_FIRESTORM
@ SPELL_METEOR_SLASH_VISUAL
@ SPELL_FEL_FIRESTORM_TRIGGERED
@ SPELL_BERSERK
@ SPELL_METEOR_SLASH
ArgalothEvents
@ EVENT_END_FEL_FIRESTORM
@ EVENT_FEL_FIRESTORM
@ EVENT_CONSUMING_DARKNESS
@ EVENT_METEOR_SLASH
@ EVENT_BERSERK
HookList< EffectPeriodicHandler > OnEffectPeriodic
HookList< EffectApplyHandler > AfterEffectApply
AuraEffect * GetEffect(uint8 effIndex) const
Unit * GetTarget() const
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
SummonList summons
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
void SetReactState(ReactStates st)
Definition Creature.h:174
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
void CancelEvent(uint32 eventId)
Definition EventMap.cpp:135
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell, bool includePets=false, bool includeControlled=false)
void SendEncounterUnit(EncounterFrameType type, Unit const *unit, Optional< int32 > param1={}, Optional< int32 > param2={})
bool Is25ManRaid() const
Definition Map.cpp:3349
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Unit * GetCaster() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:162
Definition Unit.h:635
uint64 GetHealth() const
Definition Unit.h:788
bool HealthBelowPctDamaged(float pct, uint32 damage) const
Definition Unit.h:793
bool HasUnitState(const uint32 f) const
Definition Unit.h:743
bool AttackStop()
Definition Unit.cpp:5965
Map * GetMap() const
Definition Object.h:411
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:100
void HandlePeriodic(AuraEffect const *)
void FilterTargets(std::list< WorldObject * > &targets)
void AfterApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void RandomResize(C &container, std::size_t requestedSize)
Definition Containers.h:67
bool Is25ManRaid() const
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
boss_argaloth(Creature *creature)
void EnterEvadeMode(EvadeReason) override
void JustEngagedWith(Unit *who) override
void UpdateAI(uint32 diff) override
void JustDied(Unit *) override