TrinityCore
Loading...
Searching...
No Matches
boss_high_botanist_freywinn.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 "SpellInfo.h"
21#include "the_botanica.h"
22
31
43
50
51// 17975 - High Botanist Freywinn
53{
55
56 void Reset() override
57 {
58 _Reset();
60 }
61
71
72 // Do not despawn them
73 void JustSummoned(Creature* summon) override
74 {
75 if (me->IsEngaged())
76 DoZoneInCombat(summon);
77 }
78
79 void OnSpellCast(SpellInfo const* spellInfo) override
80 {
81 if (spellInfo->Id == SPELL_TREE_FORM)
82 {
87 }
88 }
89
90 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
91 {
92 // Completely guessed, may be actually not used
93 if (spellInfo->Id == SPELL_CANCEL_TRANQUILITY)
94 {
96
97 if (_frayersKilled >= 3)
98 {
102 }
103 }
104 }
105
106 void KilledUnit(Unit* /*victim*/) override
107 {
108 Talk(SAY_SLAY);
109 }
110
111 void JustDied(Unit* /*killer*/) override
112 {
113 _JustDied();
115 }
116
117 void UpdateAI(uint32 diff) override
118 {
119 if (!UpdateVictim())
120 return;
121
122 events.Update(diff);
123
125 return;
126
127 while (uint32 eventId = events.ExecuteEvent())
128 {
129 switch (eventId)
130 {
133 events.Repeat(6s);
134 break;
135 case EVENT_TREE_FORM:
137 events.Repeat(60s);
138 break;
141 break;
142 default:
143 break;
144 }
145
147 return;
148 }
149
151 }
152
153private:
155};
156
First const & RAND(First const &first, Second const &second, Rest const &... rest)
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
@ CURRENT_CHANNELED_SPELL
Definition Unit.h:622
@ UNIT_STATE_CASTING
Definition Unit.h:249
void AddSC_boss_high_botanist_freywinn()
void JustEngagedWith(Unit *who) override
EventMap events
void DoZoneInCombat(Creature *creature=nullptr)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
bool IsEngaged() const override
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
uint32 Id
Definition SpellInfo.h:289
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
Definition Unit.h:783
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, SpellCastResult result=SPELL_FAILED_INTERRUPTED, Optional< SpellCastResult > resultOther={})
Definition Unit.cpp:3044
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3807
bool HasUnitState(const uint32 f) const
Definition Unit.h:890
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void JustSummoned(Creature *summon) override
void OnSpellCast(SpellInfo const *spellInfo) override
@ DATA_HIGH_BOTANIST_FREYWINN
#define RegisterBotanicaCreatureAI(ai_name)