TrinityCore
Loading...
Searching...
No Matches
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
40
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
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 const& /*context*/)
141 {
143 });
144
145 scheduler.Schedule(5s, [this](TaskContext const& /*context*/)
146 {
148 });
149
150 scheduler.Schedule(8s, [this](TaskContext const& /*context*/)
151 {
153 });
154 }
155 }
156
157 void UpdateAI(const uint32 diff) override
158 {
159 scheduler.Update(diff);
160 }
161
162private:
164};
165
uint32_t uint32
Definition Define.h:154
@ POINT_MOTION_TYPE
Spells
Definition PlayerAI.cpp:32
DamageEffectType
@ SAY_DEATH
@ SAY_WARDEN_3
@ SAY_PULL
@ SAY_WARDEN_1
@ SAY_WARDEN_2
@ SAY_ENRAGE
@ POINT_FINISH
Position const wardenThelwaterMovePoint
@ SPELL_ENRAGE
@ SPELL_VICIOUS_SLICE
@ SPELL_MADDENING_CALL
void AddSC_boss_hogger()
Position const wardenThelwaterSpawnPosition
@ EVENT_SAY_WARDEN_2
@ EVENT_MADDENING_CALL
@ EVENT_SAY_WARDEN_3
@ EVENT_VICIOUS_SLICE
@ EVENT_SAY_WARDEN_1
void JustEngagedWith(Unit *who) override
void JustDied(Unit *) override
void JustSummoned(Creature *summon) override
EventMap events
Creature *const me
Definition CreatureAI.h:63
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={}, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
uint32 GetEntry() const
Definition Object.h:89
TaskScheduler & Schedule(duration_t time, task_handler_t task)
TaskScheduler & Update()
Update the scheduler to the current time.
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:180
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:89
Definition Unit.h:635
MotionMaster * GetMotionMaster()
Definition Unit.h:1723
bool HealthBelowPctDamaged(float pct, uint32 damage) const
Definition Unit.h:793
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:1398
void JustEngagedWith(Unit *who) override
void ExecuteEvent(uint32 eventId) override
void JustSummoned(Creature *summon) override
boss_hogger(Creature *creature)
void JustDied(Unit *killer) override
void Reset() override
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
@ NPC_WARDEN_THELWATER
#define RegisterStormwindStockadesAI(AI)