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