Core/Scripts: Proper fix Gal'Darah Puncture remove

This commit is contained in:
Keader
2019-08-21 23:03:25 -03:00
parent 1886507e7f
commit cbc01f35b6
2 changed files with 28 additions and 2 deletions

View File

@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gal_darah_clear_puncture';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(60022,'spell_gal_darah_clear_puncture');

View File

@@ -17,7 +17,6 @@
#include "ScriptMgr.h"
#include "gundrak.h"
#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
@@ -36,6 +35,7 @@ enum Spells
SPELL_HEARTH_BEAM_VISUAL = 54988,
SPELL_TRANSFORM_RHINO = 55297,
SPELL_TRANSFORM_BACK = 55299,
SPELL_CLEAR_PUNCTURE = 60022,
// Rhino Spirit
SPELL_STAMPEDE_SPIRIT = 55221,
@@ -164,7 +164,7 @@ class boss_gal_darah : public CreatureScript
{
_JustDied();
Talk(SAY_DEATH);
instance->DoRemoveAurasDueToSpellOnPlayers(IsHeroic() ? SPELL_PUNCTURE_HEROIC : SPELL_PUNCTURE);
DoCastSelf(SPELL_CLEAR_PUNCTURE, true);
}
void KilledUnit(Unit* victim) override
@@ -315,6 +315,28 @@ public:
}
};
// 60022 - Clear Puncture
class spell_gal_darah_clear_puncture : public SpellScript
{
PrepareSpellScript(spell_gal_darah_clear_puncture);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PUNCTURE, SPELL_PUNCTURE_HEROIC });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
Unit* target = GetHitUnit();
target->RemoveAurasDueToSpell(target->GetMap()->IsHeroic() ? SPELL_PUNCTURE_HEROIC : SPELL_PUNCTURE);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_gal_darah_clear_puncture::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class achievement_share_the_love : public AchievementCriteriaScript
{
public:
@@ -338,5 +360,6 @@ void AddSC_boss_gal_darah()
new boss_gal_darah();
new spell_gal_darah_impaling_charge();
new spell_gal_darah_stampede_charge();
RegisterSpellScript(spell_gal_darah_clear_puncture);
new achievement_share_the_love();
}