TrinityCore
Loading...
Searching...
No Matches
boss_the_black_stalker.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 "Containers.h"
20#include "ScriptedCreature.h"
21#include "SpellScript.h"
22#include "the_underbog.h"
23
24/*
25 * How levitation sequence works: boss casts Levitate and it triggers a chain of spells, target(any target, player or pet, any position in
26 threat list) eventually gets pulled towards by randomly selected trigger. Then target becomes protected from Pull Towards by Suspension
27 aura which is triggered every 1 sec up to 4 times. Since it has stun mechanic, diminishing returns cuts off its duration every cast in
28 half (20 > 10 > 5 > 0). Eventually player becomes immune to Suspension and vulnerable to another pull towards.
29 Whole levitate sequence is designed to pull player towards up to 3 times. Usually it works like this: player gets pulled towards,
30 gets protected by Suspension from Pull Towards next 2 times. If player is unlucky, boss can cast Levitate on same player again, in that case
31 player can be pulled towards 2 times in a row without any protection from fall damage by Suspension(case from sniffs).
32 However currently diminishing returns affects Suspension after first cast, its duration is 10 instead of 20 seconds and player will be
33 immune to 4th cast. That allows to pull player towards when levitation sequence ends. Levitation sequence has sensetive design and looks
34 like lack of delays between packets makes it work differently too.
35 Of course as was said above player can be pulled towards 2 times in a row but that looks like a rare case.
36 * Timers requires to be revisited
37 */
38
40{
41 // Combat
44 SPELL_STATIC_CHARGE = 31715, // Never seen any cast on retail, probably because of shared cooldown with Chain Lightning
46
47 // Scripts
54};
55
64
65// 17882 - The Black Stalker
67{
69
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 {
97 if (me->GetPositionX() < 100.0f || me->GetPositionY() < -30.0f)
99 events.Repeat(1s);
100 break;
101 case EVENT_LEVITATE:
103 events.Repeat(18s, 24s);
104 break;
107 events.Repeat(6s, 12s);
108 break;
110 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30, true))
112 events.Repeat(10s);
113 break;
116 events.Repeat(15s, 25s);
117 break;
118 default:
119 break;
120 }
121
123 return;
124 }
125
127 }
128};
129
130// 31704 - Levitate
150
151// 31701 - Levitation Pulse
171
172// 31702 - Someone Grab Me
199
200// 31703 - Magnetic Pull
220
221// 38756 - Summon Spore Strider
243
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ SPELL_EFFECT_SCRIPT_EFFECT
@ TARGET_UNIT_SRC_AREA_ENTRY
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
@ UNIT_STATE_CASTING
Definition Unit.h:249
@ EVENT_CHAIN_LIGHTNING
@ EVENT_STATIC_CHARGE
@ EVENT_SUMMON_SPORE_STRIDER
@ SPELL_SUSPENSION_PRIMER
@ SPELL_MAGNETIC_PULL
@ SPELL_SUMMON_SPORE_STRIDER
@ SPELL_SOMEONE_GRAB_ME
@ SPELL_SUMMON_SPORE_STRIDER_EFFECT
@ SPELL_CHAIN_LIGHTNING
@ SPELL_STATIC_CHARGE
@ SPELL_LEVITATION_PULSE
void AddSC_boss_the_black_stalker()
void JustEngagedWith(Unit *who) override
EventMap events
@ EVADE_REASON_BOUNDARY
Definition CreatureAI.h:95
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
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
Unit * GetCaster() const
HookList< EffectHandler > OnEffectHit
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
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:783
bool HasUnitState(const uint32 f) const
Definition Unit.h:890
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2833
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_the_black_stalker_levitate)
PrepareSpellScript(spell_the_black_stalker_levitation_pulse)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_the_black_stalker_magnetic_pull)
void FilterTargets(std::list< WorldObject * > &targets)
PrepareSpellScript(spell_the_black_stalker_someone_grab_me)
PrepareSpellScript(spell_the_black_stalker_summon_spore_strider)
void RandomResize(C &container, std::size_t requestedSize)
Definition Containers.h:66
float GetPositionX() const
Definition Position.h:79
float GetPositionY() const
Definition Position.h:80
bool IsHeroic() const
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *who) override
boss_the_black_stalker(Creature *creature)
#define RegisterTheUnderbogCreatureAI(ai_name)
@ DATA_THE_BLACK_STALKER