TrinityCore
Loading...
Searching...
No Matches
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
33
34#define SPELL_EXPLODE_GHOUL DUNGEON_MODE(52480,58825)
35#define SPELL_SHADOW_BOLT DUNGEON_MODE(57725,58827)
36
47
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
73
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
157
uint32_t uint32
Definition Define.h:154
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:28
@ DONE
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
Spells
Definition PlayerAI.cpp:32
Milliseconds randtime(Milliseconds min, Milliseconds max)
Definition Random.cpp:62
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
@ EFFECT_0
@ LOOT_MODE_DEFAULT
@ SPELL_AURA_PERIODIC_DUMMY
#define AuraEffectPeriodicFn(F, I, N)
#define SPELL_EXPLODE_GHOUL
#define SPELL_SHADOW_BOLT
Yells
HookList< EffectPeriodicHandler > OnEffectPeriodic
Unit * GetCaster() const
Unit * GetTarget() const
TypeID GetTypeId() const
Definition BaseEntity.h:166
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
EventMap events
Creature *const me
Definition CreatureAI.h:63
void RemoveLootMode(uint16 lootMode)
Definition Creature.h:321
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
EncounterState GetBossState(uint32 id) const
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:162
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:89
Definition Unit.h:635
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:100
CreatureAI * GetAI(Creature *creature) const override
@ DATA_NOTIFY_DEATH
bool IsHeroic() const
void ExecuteEvent(uint32 eventId) override