diff options
author | Andrew Blakely <andrew.blakely@ymail.com> | 2016-11-25 07:54:38 -0600 |
---|---|---|
committer | joschiwald <joschiwald.trinity@gmail.com> | 2018-02-11 16:00:49 +0100 |
commit | 06e1990af272763a4c043ffddb5bdae572385dc9 (patch) | |
tree | d89b16d770a7a3366b497c20a5b4a5ddc6df0df3 | |
parent | 05fb27dae4e8af859e01e5b9e52b082cba217657 (diff) |
Core/Scripts: Fixed Vaelastrasz bomb mechanic (#18260)
* Core/Scripts: Fixed Vaelastrasz bomb mechanic
Vaelstraz was suppose to bomb raid members that are mana users every 15
seconds. He was not doing that with the current implementation.
This implementation allows him to bomb the raid and to select the proper
targets. This is also done in a cleaner way.
* Added AuraScript for SPELL_BURNINGADRENALINE
Needed to define an AuraScript for custom behavior that would denatonate
the damaging aura when the debuff falls off.
SpellId - 18173
* Added SQL for Burning Adrenaline Script Ref
* Fixed Multiple Application of BA
* Add unit null check in lambda
* Remove DB name from sql query
* Added Newline in SQL update file.
* Added SQL delete query for potential existing spell
* Fix SQL newline again.
* As suggested a simpler SpellCast overload works
I don't know if there are any consequences but it seems to function fine
in in-game.
I'd like more information on the overload that involves an AuraEffect.
* Remove duplicate Unit null check in lambda
* Update boss_vaelastrasz.cpp
(cherry picked from commit 60ac53ff07333a62c3d76b6daf072d4fbcb11d1c)
# Conflicts:
# src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp
-rw-r--r-- | sql/updates/world/master/2018_02_11_04_world_2016_11_16_00_world.sql | 3 | ||||
-rw-r--r-- | src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp | 58 |
2 files changed, 47 insertions, 14 deletions
diff --git a/sql/updates/world/master/2018_02_11_04_world_2016_11_16_00_world.sql b/sql/updates/world/master/2018_02_11_04_world_2016_11_16_00_world.sql new file mode 100644 index 00000000000..9a046d72499 --- /dev/null +++ b/sql/updates/world/master/2018_02_11_04_world_2016_11_16_00_world.sql @@ -0,0 +1,3 @@ +-- Adds a reference to the spell_vael_burning_adrenaline script for Burning Adrenaline (Vael Fight) +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_vael_burning_adrenaline'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES ('18173', 'spell_vael_burning_adrenaline'); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp index bad4f2d728b..4dbabbfed19 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp @@ -22,6 +22,8 @@ #include "Player.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" +#include "SpellAuraEffects.h" +#include "SpellScript.h" enum Says { @@ -43,8 +45,9 @@ enum Spells SPELL_FLAMEBREATH = 23461, SPELL_FIRENOVA = 23462, SPELL_TAILSWIPE = 15847, - SPELL_BURNINGADRENALINE = 23620, - SPELL_CLEAVE = 20684 //Chain cleave is most likely named something different and contains a dummy effect + SPELL_BURNINGADRENALINE = 18173, //Cast this one. It's what 3.3.5 DBM expects. + SPELL_BURNINGADRENALINE_EXPLOSION = 23478, + SPELL_CLEAVE = 19983 //Chain cleave is most likely named something different and contains a dummy effect }; enum Events @@ -189,24 +192,19 @@ public: break; case EVENT_BURNINGADRENALINE_CASTER: { - Unit* target = NULL; - - uint8 i = 0; - while (i < 3) // max 3 tries to get a random target with power_mana + //selects a random target that isn't the current victim and is a mana user (selects mana users) but not pets + //it also ignores targets who have the aura. We don't want to place the debuff on the same target twice. + if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 1, [&](Unit* u) { return u && !u->IsPet() && u->getPowerType() == POWER_MANA && !u->HasAura(SPELL_BURNINGADRENALINE); })) { - ++i; - target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); // not aggro leader - if (target && target->GetPowerType() == POWER_MANA) - i = 3; + me->CastSpell(target, SPELL_BURNINGADRENALINE, true); } - if (target) // cast on self (see below) - target->CastSpell(target, SPELL_BURNINGADRENALINE, true); } + //reschedule the event events.ScheduleEvent(EVENT_BURNINGADRENALINE_CASTER, 15000); break; case EVENT_BURNINGADRENALINE_TANK: - // have the victim cast the spell on himself otherwise the third effect aura will be applied to Vael instead of the player - me->EnsureVictim()->CastSpell(me->GetVictim(), SPELL_BURNINGADRENALINE, true); + //Vael has to cast it himself; contrary to the previous commit's comment. Nothing happens otherwise. + me->CastSpell(me->GetVictim(), SPELL_BURNINGADRENALINE, true); events.ScheduleEvent(EVENT_BURNINGADRENALINE_TANK, 45000); break; } @@ -245,7 +243,39 @@ public: } }; +//Need to define an aurascript for EVENT_BURNINGADRENALINE's death effect. +// 18173 - Burning Adrenaline +class spell_vael_burning_adrenaline : public SpellScriptLoader +{ +public: + spell_vael_burning_adrenaline() : SpellScriptLoader("spell_vael_burning_adrenaline") { } + + class spell_vael_burning_adrenaline_AuraScript : public AuraScript + { + PrepareAuraScript(spell_vael_burning_adrenaline_AuraScript); + + void OnAuraRemoveHandler(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + //The tooltip says the on death the AoE occurs. According to information: http://qaliaresponse.stage.lithium.com/t5/WoW-Mayhem/Surviving-Burning-Adrenaline-For-tanks/td-p/48609 + //Burning Adrenaline can be survived therefore Blizzard's implementation was an AoE bomb that went off if you were still alive and dealt + //damage to the target. You don't have to die for it to go off. It can go off whether you live or die. + GetTarget()->CastSpell(GetTarget(), SPELL_BURNINGADRENALINE_EXPLOSION, true); + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_vael_burning_adrenaline_AuraScript::OnAuraRemoveHandler, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_vael_burning_adrenaline_AuraScript(); + } +}; + void AddSC_boss_vaelastrasz() { new boss_vaelastrasz(); + new spell_vael_burning_adrenaline(); } |