Scripts/Spells: Update Gordunni Trap spell script (#27437)

Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
This commit is contained in:
offl
2021-12-23 02:08:46 +02:00
committed by GitHub
parent fa505a2209
commit 9d6c4e3d93
2 changed files with 8 additions and 5 deletions

View File

@@ -0,0 +1,3 @@
--
UPDATE `spell_dbc` SET `RangeIndex`=12, `EffectImplicitTargetA1`=47, `EffectImplicitTargetA2`=47, `EffectRadiusIndex1`=15, `EffectRadiusIndex2`=15 WHERE `Id`=11756;
UPDATE `spell_dbc` SET `RangeIndex`=12, `EffectImplicitTargetA1`=47, `EffectRadiusIndex1`=15 WHERE `Id`=19394;

View File

@@ -16,8 +16,8 @@
*/
#include "ScriptMgr.h"
#include "GameObject.h"
#include "SpellScript.h"
#include "Unit.h"
enum GordunniTrapSpells
{
@@ -35,15 +35,15 @@ class spell_gordunni_trap : public SpellScript
return ValidateSpellInfo({ SPELL_GORDUNNI_DIRT_MOUND_CHEST, SPELL_GORDUNNI_DIRT_MOUND_JUNK });
}
void HandleDummy()
void HandleDummy(SpellEffIndex /*effIndex*/)
{
GameObject* caster = GetGObjCaster();
caster->CastSpell(caster, urand(0, 1) ? SPELL_GORDUNNI_DIRT_MOUND_CHEST : SPELL_GORDUNNI_DIRT_MOUND_JUNK);
Unit* target = GetHitUnit();
target->CastSpell(target, urand(0, 1) ? SPELL_GORDUNNI_DIRT_MOUND_CHEST : SPELL_GORDUNNI_DIRT_MOUND_JUNK);
}
void Register() override
{
OnCast += SpellCastFn(spell_gordunni_trap::HandleDummy);
OnEffectHitTarget += SpellEffectFn(spell_gordunni_trap::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};