TrinityCore
boss_hogger.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
18#include "MotionMaster.h"
19#include "ScriptedCreature.h"
20#include "ScriptMgr.h"
21#include "the_stockade.h"
22
23enum Says
24{
25 SAY_PULL = 0, // Forest just setback!
26 SAY_ENRAGE = 1, // AreaTriggerMessage: Hogger Enrages!
27 SAY_DEATH = 2, // Yiipe!
28
29 SAY_WARDEN_1 = 0, // Yell - This ends here, Hogger!
30 SAY_WARDEN_2 = 1, // Say - He's...he's dead?
31 SAY_WARDEN_3 = 2 // Say - It's simply too good to be true. You couldn't have killed him so easily!
32};
33
35{
38 SPELL_ENRAGE = 86736
39};
40
42{
45
49};
50
52{
53 POINT_FINISH = 1
54};
55
56Position const wardenThelwaterMovePoint = { 152.019f, 106.198f, -35.1896f, 1.082104f };
57Position const wardenThelwaterSpawnPosition = { 138.369f, 78.2932f, -33.85627f, 1.082104f };
58
59// Hogger - 46254
60struct boss_hogger : public BossAI
61{
62 boss_hogger(Creature* creature) : BossAI(creature, DATA_HOGGER), _hasEnraged(false) { }
63
64 void Reset() override
65 {
66 _hasEnraged = false;
67 }
68
69 void JustEngagedWith(Unit* who) override
70 {
72
74
77 }
78
79 void JustDied(Unit* killer) override
80 {
81 BossAI::JustDied(killer);
82
84
86 }
87
88 void JustSummoned(Creature* summon) override
89 {
91
92 if (summon->GetEntry() == NPC_WARDEN_THELWATER)
94 }
95
96 void ExecuteEvent(uint32 eventId) override
97 {
98 switch (eventId)
99 {
102 events.Repeat(10s, 14s);
103 break;
106 events.Repeat(15s, 20s);
107 break;
108 default:
109 break;
110 }
111 }
112
113 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
114 {
115 if (me->HealthBelowPctDamaged(30, damage) && !_hasEnraged)
116 {
117 _hasEnraged = true;
118
121 }
122 }
123
124private:
126};
127
128// Warden Thelwater - 46409
130{
131 npc_warden_thelwater(Creature* creature) : ScriptedAI(creature) { }
132
133 void MovementInform(uint32 type, uint32 id) override
134 {
135 if (type != POINT_MOTION_TYPE)
136 return;
137
138 if (id == POINT_FINISH)
139 {
140 scheduler.Schedule(1s, [this](TaskContext /*context*/)
141 {
143 });
144
145 scheduler.Schedule(5s, [this](TaskContext /*context*/)
146 {
148 });
149
150 scheduler.Schedule(8s, [this](TaskContext /*context*/)
151 {
153 });
154 }
155 }
156
157 void UpdateAI(const uint32 diff) override
158 {
159 scheduler.Update(diff);
160 }
161
162private:
164};
165
167{
170}
uint32_t uint32
Definition: Define.h:142
@ POINT_MOTION_TYPE
Spells
Definition: PlayerAI.cpp:32
DamageEffectType
Definition: UnitDefines.h:131
Says
@ SAY_DEATH
Definition: boss_hogger.cpp:27
@ SAY_WARDEN_3
Definition: boss_hogger.cpp:31
@ SAY_PULL
Definition: boss_hogger.cpp:25
@ SAY_WARDEN_1
Definition: boss_hogger.cpp:29
@ SAY_WARDEN_2
Definition: boss_hogger.cpp:30
@ SAY_ENRAGE
Definition: boss_hogger.cpp:26
@ POINT_FINISH
Definition: boss_hogger.cpp:53
Position const wardenThelwaterMovePoint
Definition: boss_hogger.cpp:56
@ SPELL_ENRAGE
Definition: boss_hogger.cpp:38
@ SPELL_VICIOUS_SLICE
Definition: boss_hogger.cpp:36
@ SPELL_MADDENING_CALL
Definition: boss_hogger.cpp:37
void AddSC_boss_hogger()
Position const wardenThelwaterSpawnPosition
Definition: boss_hogger.cpp:57
@ EVENT_SAY_WARDEN_2
Definition: boss_hogger.cpp:47
@ EVENT_MADDENING_CALL
Definition: boss_hogger.cpp:44
@ EVENT_SAY_WARDEN_3
Definition: boss_hogger.cpp:48
@ EVENT_VICIOUS_SLICE
Definition: boss_hogger.cpp:43
@ EVENT_SAY_WARDEN_1
Definition: boss_hogger.cpp:46
void JustEngagedWith(Unit *who) override
void JustDied(Unit *) override
void JustSummoned(Creature *summon) override
EventMap events
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
Creature *const me
Definition: CreatureAI.h:61
void Repeat(Milliseconds time)
Definition: EventMap.cpp:63
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
uint32 GetEntry() const
Definition: Object.h:161
TaskScheduler & Schedule(std::chrono::duration< Rep, Period > time, task_handler_t task)
TaskScheduler & Update(success_t const &callback=nullptr)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:781
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition: Object.cpp:2025
void JustEngagedWith(Unit *who) override
Definition: boss_hogger.cpp:69
void ExecuteEvent(uint32 eventId) override
Definition: boss_hogger.cpp:96
void JustSummoned(Creature *summon) override
Definition: boss_hogger.cpp:88
boss_hogger(Creature *creature)
Definition: boss_hogger.cpp:62
void JustDied(Unit *killer) override
Definition: boss_hogger.cpp:79
void Reset() override
Definition: boss_hogger.cpp:64
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void UpdateAI(const uint32 diff) override
npc_warden_thelwater(Creature *creature)
TaskScheduler scheduler
void MovementInform(uint32 type, uint32 id) override
@ DATA_HOGGER
Definition: the_stockade.h:32
@ NPC_WARDEN_THELWATER
Definition: the_stockade.h:40
#define RegisterStormwindStockadesAI(AI)
Definition: the_stockade.h:50