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
35
46
56
58{
59 public:
60 boss_salramm() : CreatureScript("boss_salramm") { }
61
62 struct boss_salrammAI : public BossAI
63 {
64 boss_salrammAI(Creature* creature) : BossAI(creature, DATA_SALRAMM) { }
65
72
84
85 void ExecuteEvent(uint32 eventId) override
86 {
87 switch (eventId)
88 {
92 break;
98 break;
100 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
101 DoCast(target, SPELL_SHADOW_BOLT);
103 break;
106 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 50.0f, true))
107 DoCast(target, SPELL_STEAL_FLESH);
108 events.Repeat(Seconds(15), Seconds(20));
109 break;
112 [[fallthrough]];
116 break;
117 default:
118 break;
119 }
120 }
121
122 void JustDied(Unit* /*killer*/) override
123 {
125 _JustDied();
127 }
128
129 void KilledUnit(Unit* victim) override
130 {
131 if (victim->GetTypeId() == TYPEID_PLAYER)
132 Talk(SAY_SLAY);
133 }
134 };
135
136 CreatureAI* GetAI(Creature* creature) const override
137 {
138 return GetCullingOfStratholmeAI<boss_salrammAI>(creature);
139 }
140};
141
142// 52708 - Steal Flesh
158
uint32_t uint32
Definition Define.h:133
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:27
@ DONE
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
Spells
Definition PlayerAI.cpp:32
Milliseconds randtime(Milliseconds min, Milliseconds max)
Definition Random.cpp:62
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
@ EFFECT_0
@ LOOT_MODE_DEFAULT
@ SPELL_AURA_PERIODIC_DUMMY
#define AuraEffectPeriodicFn(F, I, N)
Yells
HookList< EffectPeriodicHandler > OnEffectPeriodic
Unit * GetCaster() const
Unit * GetTarget() const
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
EventMap events
Creature *const me
Definition CreatureAI.h:82
void RemoveLootMode(uint16 lootMode)
Definition Creature.h:226
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
EncounterState GetBossState(uint32 id) const
TypeID GetTypeId() const
Definition Object.h:93
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
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:56
CreatureAI * GetAI(Creature *creature) const override
PrepareAuraScript(spell_salramm_steal_flesh)
@ DATA_NOTIFY_DEATH
bool IsHeroic() const
void ExecuteEvent(uint32 eventId) override