aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Blakely <andrew.blakely@ymail.com>2016-11-25 07:54:38 -0600
committerSarah Alexander <sarah-alexander@outlook.com>2016-11-25 11:54:38 -0200
commit60ac53ff07333a62c3d76b6daf072d4fbcb11d1c (patch)
treefa19165e952972c28d9ec33870ecc7b61b0cfe56 /src
parent28050f338dfc66e0c40b6a3915bf96e38e0613e5 (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
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp58
1 files changed, 44 insertions, 14 deletions
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp
index ad1c494e576..da0d7a73e12 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp
@@ -17,6 +17,8 @@
*/
#include "ScriptMgr.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "ScriptedCreature.h"
#include "blackwing_lair.h"
#include "ScriptedGossip.h"
@@ -42,8 +44,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
@@ -188,24 +191,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;
}
@@ -244,7 +242,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();
}