TrinityCore
Loading...
Searching...
No Matches
boss_meathook.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
24{
25 SPELL_FRENZY = 58841
26};
27
28#define SPELL_CONSTRICTING_CHAINS DUNGEON_MODE(52696,58823)
29#define SPELL_DISEASE_EXPULSION DUNGEON_MODE(52666,58824)
30
32{
36 SAY_DEATH = 3
37};
38
45
47{
48 public:
49 boss_meathook() : CreatureScript("boss_meathook") { }
50
51 struct boss_meathookAI : public BossAI
52 {
53 boss_meathookAI(Creature* creature) : BossAI(creature, DATA_MEATHOOK) { }
54
61
70
71 void ExecuteEvent(uint32 eventId) override
72 {
73 switch (eventId)
74 {
75 case EVENT_CHAIN:
76 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, -20.0f, true))
78 else if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true))
80 else
82 events.Repeat(Seconds(10), Seconds(15));
83 break;
84 case EVENT_DISEASE:
87 break;
88 case EVENT_FRENZY:
90 events.Repeat(Seconds(13), Seconds(17));
91 break;
92 default:
93 break;
94 }
95 }
96
97 void JustDied(Unit* /*killer*/) override
98 {
100 _JustDied();
102 }
103
104 void KilledUnit(Unit* victim) override
105 {
106 if (victim->GetTypeId() == TYPEID_PLAYER)
107 Talk(SAY_SLAY);
108 }
109 };
110
111 CreatureAI* GetAI(Creature* creature) const override
112 {
113 return GetCullingOfStratholmeAI<boss_meathookAI>(creature);
114 }
115};
116
118{
119 new boss_meathook();
120}
uint32_t uint32
Definition Define.h:154
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:24
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:28
@ DONE
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
Spells
Definition PlayerAI.cpp:32
@ LOOT_MODE_DEFAULT
void AddSC_boss_meathook()
@ SAY_DEATH
@ SAY_AGGRO
@ SAY_SLAY
@ SAY_SPAWN
@ SPELL_FRENZY
#define SPELL_DISEASE_EXPULSION
#define SPELL_CONSTRICTING_CHAINS
@ EVENT_DISEASE
@ EVENT_FRENZY
@ EVENT_CHAIN
Yells
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
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:100
CreatureAI * GetAI(Creature *creature) const override
@ DATA_NOTIFY_DEATH
void ExecuteEvent(uint32 eventId) override
void JustDied(Unit *) override
void KilledUnit(Unit *victim) override
void JustEngagedWith(Unit *who) override
boss_meathookAI(Creature *creature)