TrinityCore
Loading...
Searching...
No Matches
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#include "SpellScript.h"
22#include "gundrak.h"
23
25{
26 EMOTE_SPAWN = 0
27};
28
30{
31 SPELL_ECK_BERSERK = 55816, // Eck goes berserk, increasing his attack speed by 150% and all damage he deals by 500%.
32 SPELL_ECK_BITE = 55813, // Eck bites down hard, inflicting 150% of his normal damage to an enemy.
33 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.
34 SPELL_ECK_SPRING_1 = 55815, // Eck leaps at a distant target. --> Drops aggro and charges a random player. Tank can simply taunt him back.
35 SPELL_ECK_SPRING_2 = 55837, // Eck leaps at a distant target.
36
37 SPELL_ECK_RESIDUE = 55817
38};
39
47
48struct boss_eck : public BossAI
49{
51 {
52 Initialize();
54 }
55
57 {
58 _berserk = false;
59 }
60
61 void Reset() override
62 {
63 _Reset();
64 Initialize();
65 }
66
67 void JustEngagedWith(Unit* who) override
68 {
73 events.ScheduleEvent(EVENT_BERSERK, 60s, 90s); // 60-90 secs according to wowwiki
74 }
75
76 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
77 {
78 if (!_berserk && me->HealthBelowPctDamaged(20, damage))
79 {
81 _berserk = true;
82 }
83 }
84
85 void ExecuteEvent(uint32 eventId) override
86 {
87 switch (eventId)
88 {
89 case EVENT_BITE:
92 break;
93 case EVENT_SPIT:
96 break;
97 case EVENT_SPRING:
98 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 35.0f, true))
101 break;
102 case EVENT_BERSERK:
104 _berserk = true;
105 break;
106 default:
107 break;
108 }
109 }
110
111private:
113};
114
115// 55814 - Eck Spit
117{
118 bool Validate(SpellInfo const* /*spellInfo*/) override
119 {
121 }
122
123 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
124 {
126 }
127
132};
133
First const & RAND(First const &first, Second const &second, Rest const &... rest)
uint32_t uint32
Definition Define.h:154
Spells
Definition PlayerAI.cpp:32
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
@ EFFECT_0
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_PERIODIC_DAMAGE
#define AuraEffectRemoveFn(F, I, N, M)
DamageEffectType
void AddSC_boss_eck()
Definition boss_eck.cpp:134
@ SPELL_ECK_BITE
Definition boss_eck.cpp:32
@ SPELL_ECK_SPRING_1
Definition boss_eck.cpp:34
@ SPELL_ECK_SPRING_2
Definition boss_eck.cpp:35
@ SPELL_ECK_BERSERK
Definition boss_eck.cpp:31
@ SPELL_ECK_RESIDUE
Definition boss_eck.cpp:37
@ SPELL_ECK_SPIT
Definition boss_eck.cpp:33
@ EMOTE_SPAWN
Definition boss_eck.cpp:26
@ EVENT_BERSERK
Definition boss_eck.cpp:45
@ EVENT_SPRING
Definition boss_eck.cpp:44
@ EVENT_SPIT
Definition boss_eck.cpp:43
@ EVENT_BITE
Definition boss_eck.cpp:42
HookList< EffectApplyHandler > AfterEffectRemove
Unit * GetTarget() const
void JustEngagedWith(Unit *who) override
EventMap events
Creature *const me
Definition CreatureAI.h:63
void RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:56
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:40
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:172
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:71
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:81
Definition Unit.h:647
bool HealthBelowPctDamaged(float pct, uint32 damage) const
Definition Unit.h:805
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2222
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
Definition boss_eck.cpp:123
void Register() override
Definition boss_eck.cpp:128
bool Validate(SpellInfo const *) override
Definition boss_eck.cpp:118
#define RegisterGundrakCreatureAI(ai_name)
Definition gundrak.h:101
@ DATA_ECK_THE_FEROCIOUS
Definition gundrak.h:35
void Reset() override
Definition boss_eck.cpp:61
bool _berserk
Definition boss_eck.cpp:112
void ExecuteEvent(uint32 eventId) override
Definition boss_eck.cpp:85
boss_eck(Creature *creature)
Definition boss_eck.cpp:50
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
Definition boss_eck.cpp:76
void Initialize()
Definition boss_eck.cpp:56
void JustEngagedWith(Unit *who) override
Definition boss_eck.cpp:67