TrinityCore
boss_eck.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 "ScriptMgr.h"
19#include "gundrak.h"
20#include "ScriptedCreature.h"
21
23{
24 EMOTE_SPAWN = 0
25};
26
28{
29 SPELL_ECK_BERSERK = 55816, // Eck goes berserk, increasing his attack speed by 150% and all damage he deals by 500%.
30 SPELL_ECK_BITE = 55813, // Eck bites down hard, inflicting 150% of his normal damage to an enemy.
31 SPELL_ECK_SPIT = 55814, // Eck spits toxic bile at enemies in a cone in front of him, inflicting 2970 Nature damage and draining 220 mana every 1 sec for 3 sec.
32 SPELL_ECK_SPRING_1 = 55815, // Eck leaps at a distant target. --> Drops aggro and charges a random player. Tank can simply taunt him back.
33 SPELL_ECK_SPRING_2 = 55837 // Eck leaps at a distant target.
34};
35
37{
42};
43
44struct boss_eck : public BossAI
45{
47 {
48 Initialize();
50 }
51
53 {
54 _berserk = false;
55 }
56
57 void Reset() override
58 {
59 _Reset();
60 Initialize();
61 }
62
63 void JustEngagedWith(Unit* who) override
64 {
69 events.ScheduleEvent(EVENT_BERSERK, 60s, 90s); // 60-90 secs according to wowwiki
70 }
71
72 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
73 {
74 if (!_berserk && me->HealthBelowPctDamaged(20, damage))
75 {
77 _berserk = true;
78 }
79 }
80
81 void ExecuteEvent(uint32 eventId) override
82 {
83 switch (eventId)
84 {
85 case EVENT_BITE:
88 break;
89 case EVENT_SPIT:
92 break;
93 case EVENT_SPRING:
94 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 35.0f, true))
97 break;
98 case EVENT_BERSERK:
100 _berserk = true;
101 break;
102 default:
103 break;
104 }
105 }
106
107private:
109};
110
112{
114}
Texts
First const & RAND(First const &first, Second const &second, Rest const &... rest)
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
DamageEffectType
Definition: UnitDefines.h:131
void AddSC_boss_eck()
Definition: boss_eck.cpp:111
@ SPELL_ECK_BITE
Definition: boss_eck.cpp:30
@ SPELL_ECK_SPRING_1
Definition: boss_eck.cpp:32
@ SPELL_ECK_SPRING_2
Definition: boss_eck.cpp:33
@ SPELL_ECK_BERSERK
Definition: boss_eck.cpp:29
@ SPELL_ECK_SPIT
Definition: boss_eck.cpp:31
@ EMOTE_SPAWN
Definition: boss_eck.cpp:24
@ EVENT_BERSERK
Definition: boss_eck.cpp:41
@ EVENT_SPRING
Definition: boss_eck.cpp:40
@ EVENT_SPIT
Definition: boss_eck.cpp:39
@ EVENT_BITE
Definition: boss_eck.cpp:38
void JustEngagedWith(Unit *who) override
EventMap events
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
Creature *const me
Definition: CreatureAI.h:61
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:52
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 DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:781
#define RegisterGundrakCreatureAI(ai_name)
Definition: gundrak.h:99
@ DATA_ECK_THE_FEROCIOUS
Definition: gundrak.h:35
void Reset() override
Definition: boss_eck.cpp:57
bool _berserk
Definition: boss_eck.cpp:108
void ExecuteEvent(uint32 eventId) override
Definition: boss_eck.cpp:81
boss_eck(Creature *creature)
Definition: boss_eck.cpp:46
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
Definition: boss_eck.cpp:72
void Initialize()
Definition: boss_eck.cpp:52
void JustEngagedWith(Unit *who) override
Definition: boss_eck.cpp:63