TrinityCore
Loading...
Searching...
No Matches
boss_laj.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 "the_botanica.h"
21
23{
24 EMOTE_SUMMON = 0
25};
26
44
54
55// 17980 - Laj
56struct boss_laj : public BossAI
57{
58 boss_laj(Creature* creature) : BossAI(creature, DATA_LAJ), _activeTransformAura(0) { }
59
60 void Reset() override
61 {
62 _Reset();
64 }
65
74
75 void JustSummoned(Creature* summon) override
76 {
77 // Not entirely correct, they aggro on their own in a weird way and in general behave weirdly
78 if (me->IsEngaged())
79 DoZoneInCombat(summon);
80 }
81
82 void UpdateAI(uint32 diff) override
83 {
84 if (!UpdateVictim())
85 return;
86
87 events.Update(diff);
88
90 return;
91
92 while (uint32 eventId = events.ExecuteEvent())
93 {
94 switch (eventId)
95 {
96 // Teleport sequence
97 case EVENT_TELEPORT:
100 events.Repeat(25s, 40s);
102 break;
103 case EVENT_EMOTE:
106 break;
107 case EVENT_SUMMON:
108 // He can summon 2 creatures of one type or 2 different. He always spawns them at 2 platforms(despite there are 4 in the room)
109 // Even if he uses other 4 spells, that does not make sense because the only difference between them is spells entries
110 // Best guess other spells were added on early development stage for second pair of platforms and were never used on live
114 break;
115 // Abilities
117 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 8.f))
119 events.Repeat(20s, 30s);
120 break;
121 case EVENT_TRANSFORM:
122 {
126
128 DoCastSelf(spell);
129 _activeTransformAura = spell;
130 events.Repeat(25s, 45s);
131 break;
132 }
133 case EVENT_THRASH:
135 events.Repeat(15s, 20s);
136 break;
137 default:
138 break;
139 }
140
142 return;
143 }
144
146 }
147
148private:
150};
151
First const & RAND(First const &first, Second const &second, Rest const &... rest)
uint32_t uint32
Definition Define.h:133
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
@ UNIT_STATE_CASTING
Definition Unit.h:235
LajTexts
Definition boss_laj.cpp:23
@ EMOTE_SUMMON
Definition boss_laj.cpp:24
LajEvents
Definition boss_laj.cpp:46
@ EVENT_TELEPORT
Definition boss_laj.cpp:47
@ EVENT_EMOTE
Definition boss_laj.cpp:48
@ EVENT_TRANSFORM
Definition boss_laj.cpp:51
@ EVENT_SUMMON
Definition boss_laj.cpp:49
@ EVENT_ALLERGIC_REACTION
Definition boss_laj.cpp:50
@ EVENT_THRASH
Definition boss_laj.cpp:52
LajSpells
Definition boss_laj.cpp:28
@ SPELL_SUMMON_FLAYER_1
Definition boss_laj.cpp:34
@ SPELL_TRANSFORM_SHADOW
Definition boss_laj.cpp:42
@ SPELL_TRANSFORM_FROST
Definition boss_laj.cpp:40
@ SPELL_TRANSFORM_FIRE
Definition boss_laj.cpp:39
@ SPELL_TELEPORT_SELF
Definition boss_laj.cpp:30
@ SPELL_TRANSFORM_ARCANE
Definition boss_laj.cpp:38
@ SPELL_SUMMON_FLAYER_2
Definition boss_laj.cpp:36
@ SPELL_SUMMON_LASHER_2
Definition boss_laj.cpp:35
@ SPELL_ALLERGIC_REACTION
Definition boss_laj.cpp:29
@ SPELL_THRASH
Definition boss_laj.cpp:31
@ SPELL_SUMMON_LASHER_1
Definition boss_laj.cpp:33
@ SPELL_TRANSFORM_NATURE
Definition boss_laj.cpp:41
void AddSC_boss_laj()
Definition boss_laj.cpp:152
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 SetReactState(ReactStates st)
Definition Creature.h:119
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
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
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
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3784
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
boss_laj(Creature *creature)
Definition boss_laj.cpp:58
void JustEngagedWith(Unit *who) override
Definition boss_laj.cpp:66
void UpdateAI(uint32 diff) override
Definition boss_laj.cpp:82
void Reset() override
Definition boss_laj.cpp:60
uint32 _activeTransformAura
Definition boss_laj.cpp:149
void JustSummoned(Creature *summon) override
Definition boss_laj.cpp:75
@ DATA_LAJ
#define RegisterBotanicaCreatureAI(ai_name)