TrinityCore
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
28{
31 SPELL_THRASH = 3391, // No aura here
32
37
43};
44
46{
53};
54
55struct boss_laj : public BossAI
56{
57 boss_laj(Creature* creature) : BossAI(creature, DATA_LAJ), _activeTransformAura(0) { }
58
59 void Reset() override
60 {
61 _Reset();
63 }
64
65 void JustEngagedWith(Unit* who) override
66 {
72 }
73
74 void JustSummoned(Creature* summon) override
75 {
76 // Not entirely correct, they aggro on their own in a weird way and in general behave weirdly
77 if (me->IsEngaged())
78 DoZoneInCombat(summon);
79 }
80
81 void UpdateAI(uint32 diff) override
82 {
83 if (!UpdateVictim())
84 return;
85
86 events.Update(diff);
87
89 return;
90
91 while (uint32 eventId = events.ExecuteEvent())
92 {
93 switch (eventId)
94 {
95 // Teleport sequence
96 case EVENT_TELEPORT:
99 events.Repeat(25s, 40s);
101 break;
102 case EVENT_EMOTE:
105 break;
106 case EVENT_SUMMON:
107 // 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)
108 // Even if he uses other 4 spells, that does not make sense because the only difference between them is spells entries
109 // Best guess other spells were added on early development stage for second pair of platforms and were never used on live
113 break;
114 // Abilities
116 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 8.f))
118 events.Repeat(20s, 30s);
119 break;
120 case EVENT_TRANSFORM:
121 {
125
127 DoCastSelf(spell);
128 _activeTransformAura = spell;
129 events.Repeat(25s, 45s);
130 break;
131 }
132 case EVENT_THRASH:
134 events.Repeat(15s, 20s);
135 break;
136 default:
137 break;
138 }
139
141 return;
142 }
143 }
144
145private:
147};
148
150{
152}
Texts
First const & RAND(First const &first, Second const &second, Rest const &... rest)
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
@ REACT_PASSIVE
Definition: UnitDefines.h:506
@ REACT_AGGRESSIVE
Definition: UnitDefines.h:508
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ 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:149
@ EMOTE_SUMMON
Definition: boss_laj.cpp:24
@ 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
void JustEngagedWith(Unit *who) override
EventMap events
void DoZoneInCombat()
Definition: CreatureAI.h:161
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
bool IsEngaged() const override
Definition: Creature.cpp:3601
void SetReactState(ReactStates st)
Definition: Creature.h:160
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void Repeat(Milliseconds time)
Definition: EventMap.cpp:63
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
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
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3831
boss_laj(Creature *creature)
Definition: boss_laj.cpp:57
void JustEngagedWith(Unit *who) override
Definition: boss_laj.cpp:65
void UpdateAI(uint32 diff) override
Definition: boss_laj.cpp:81
void Reset() override
Definition: boss_laj.cpp:59
uint32 _activeTransformAura
Definition: boss_laj.cpp:146
void JustSummoned(Creature *summon) override
Definition: boss_laj.cpp:74
@ DATA_LAJ
Definition: the_botanica.h:33
#define RegisterBotanicaCreatureAI(ai_name)
Definition: the_botanica.h:52