TrinityCore
boss_tuten_kash.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 "razorfen_downs.h"
20#include "ScriptedCreature.h"
21
23{
28};
29
31{
34};
35
37{
38public:
39 boss_tuten_kash() : CreatureScript("boss_tuten_kash") { }
40
41 struct boss_tuten_kashAI : public BossAI
42 {
44
45 void Reset() override
46 {
47 _Reset();
48 if (!me->HasAura(SPELL_THRASH))
52 }
53
54 void JustEngagedWith(Unit* who) override
55 {
59 }
60
61 void JustDied(Unit* /*killer*/) override
62 {
63 _JustDied();
64 }
65
66 void UpdateAI(uint32 diff) override
67 {
68 if (!UpdateVictim())
69 return;
70
71 events.Update(diff);
72
74 return;
75
76 while (uint32 eventId = events.ExecuteEvent())
77 {
78 switch (eventId)
79 {
80 case EVENT_WEB_SPRAY:
81 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, false))
82 {
83 if (!target->HasAura(SPELL_WEB_SPRAY))
84 DoCast(target, SPELL_WEB_SPRAY);
85 }
87 break;
91 break;
92 }
93
95 return;
96 }
97 }
98 };
99
100 CreatureAI* GetAI(Creature* creature) const override
101 {
102 return GetRazorfenDownsAI<boss_tuten_kashAI>(creature);
103 }
104};
105
107{
108 new boss_tuten_kash();
109}
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ SPELL_VIRULENT_POISON
@ SPELL_THRASH
@ SPELL_CURSE_OF_TUTENKASH
@ SPELL_WEB_SPRAY
void AddSC_boss_tuten_kash()
@ EVENT_WEB_SPRAY
@ EVENT_CURSE_OF_TUTENKASH
void JustEngagedWith(Unit *who) override
EventMap events
void _JustDied()
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
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 HasUnitState(const uint32 f) const
Definition: Unit.h:732
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4664
CreatureAI * GetAI(Creature *creature) const override
@ DATA_TUTEN_KASH
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *who) override