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
29
31{
35 SAY_DEATH = 3
36};
37
44
46{
47 public:
48 boss_meathook() : CreatureScript("boss_meathook") { }
49
50 struct boss_meathookAI : public BossAI
51 {
52 boss_meathookAI(Creature* creature) : BossAI(creature, DATA_MEATHOOK) { }
53
60
69
70 void ExecuteEvent(uint32 eventId) override
71 {
72 switch (eventId)
73 {
74 case EVENT_CHAIN:
75 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, -20.0f, true))
77 else if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true))
79 else
81 events.Repeat(Seconds(10), Seconds(15));
82 break;
83 case EVENT_DISEASE:
86 break;
87 case EVENT_FRENZY:
89 events.Repeat(Seconds(13), Seconds(17));
90 break;
91 default:
92 break;
93 }
94 }
95
96 void JustDied(Unit* /*killer*/) override
97 {
99 _JustDied();
101 }
102
103 void KilledUnit(Unit* victim) override
104 {
105 if (victim->GetTypeId() == TYPEID_PLAYER)
106 Talk(SAY_SLAY);
107 }
108 };
109
110 CreatureAI* GetAI(Creature* creature) const override
111 {
112 return GetCullingOfStratholmeAI<boss_meathookAI>(creature);
113 }
114};
115
117{
118 new boss_meathook();
119}
uint32_t uint32
Definition Define.h:133
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:27
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:24
@ DONE
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
Spells
Definition PlayerAI.cpp:32
@ LOOT_MODE_DEFAULT
void AddSC_boss_meathook()
@ SAY_DEATH
@ SAY_AGGRO
@ SAY_SLAY
@ SAY_SPAWN
@ SPELL_CONSTRICTING_CHAINS
@ SPELL_FRENZY
@ SPELL_DISEASE_EXPULSION
@ EVENT_DISEASE
@ EVENT_FRENZY
@ EVENT_CHAIN
Yells
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
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:56
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)