TrinityCore
boss_salramm_the_fleshcrafter.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
19#include "InstanceScript.h"
20#include "ScriptedCreature.h"
21#include "ScriptMgr.h"
22#include "SpellAuraEffects.h"
23#include "SpellScript.h"
24
26{
32};
33
34#define SPELL_EXPLODE_GHOUL DUNGEON_MODE(52480,58825)
35#define SPELL_SHADOW_BOLT DUNGEON_MODE(57725,58827)
36
38{
46};
47
49{
56};
57
59{
60 public:
61 boss_salramm() : CreatureScript("boss_salramm") { }
62
63 struct boss_salrammAI : public BossAI
64 {
65 boss_salrammAI(Creature* creature) : BossAI(creature, DATA_SALRAMM) { }
66
67 void InitializeAI() override
68 {
72 }
73
74 void JustEngagedWith(Unit* who) override
75 {
78
82 if (IsHeroic())
84 }
85
86 void ExecuteEvent(uint32 eventId) override
87 {
88 switch (eventId)
89 {
93 break;
99 break;
101 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
102 DoCast(target, SPELL_SHADOW_BOLT);
104 break;
107 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 50.0f, true))
108 DoCast(target, SPELL_STEAL_FLESH);
109 events.Repeat(Seconds(15), Seconds(20));
110 break;
113 [[fallthrough]];
117 break;
118 default:
119 break;
120 }
121 }
122
123 void JustDied(Unit* /*killer*/) override
124 {
126 _JustDied();
128 }
129
130 void KilledUnit(Unit* victim) override
131 {
132 if (victim->GetTypeId() == TYPEID_PLAYER)
133 Talk(SAY_SLAY);
134 }
135 };
136
137 CreatureAI* GetAI(Creature* creature) const override
138 {
139 return GetCullingOfStratholmeAI<boss_salrammAI>(creature);
140 }
141};
142
143// 52708 - Steal Flesh
145{
146 void HandlePeriodic(AuraEffect const* /*eff*/)
147 {
150 }
151
152 void Register() override
153 {
155 }
156};
157
159{
160 new boss_salramm();
162}
uint32_t uint32
Definition: Define.h:142
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:32
@ DONE
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
Spells
Definition: PlayerAI.cpp:32
Milliseconds randtime(Milliseconds min, Milliseconds max)
Definition: Random.cpp:62
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
@ EFFECT_0
Definition: SharedDefines.h:30
@ LOOT_MODE_DEFAULT
Definition: SharedDefines.h:77
@ SPELL_AURA_PERIODIC_DUMMY
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:2046
#define SPELL_EXPLODE_GHOUL
#define SPELL_SHADOW_BOLT
void AddSC_boss_salramm()
Yells
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:2045
Unit * GetCaster() const
Unit * GetTarget() const
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
EventMap events
void _JustDied()
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
Creature *const me
Definition: CreatureAI.h:61
void RemoveLootMode(uint16 lootMode)
Definition: Creature.h:299
void Repeat(Milliseconds time)
Definition: EventMap.cpp:63
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
EncounterState GetBossState(uint32 id) const
TypeID GetTypeId() const
Definition: Object.h:173
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
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:92
CreatureAI * GetAI(Creature *creature) const override
@ DATA_NOTIFY_DEATH
@ DATA_SALRAMM
bool IsHeroic() const
void ExecuteEvent(uint32 eventId) override