[/jass] function Conditions takes nothing returns boolean if ( not ( GetSpellAbilityId() == 'A00V' ) ) then // Replace 'A007' with the code for your Thunder Slam ability return false endif return true endfunction
function Main takes nothing returns nothing local unit caster = GetSpellAbilityUnit() set udg_TS_Caster = GetSpellAbilityUnit() call SetUnitInvulnerable( caster, true ) call PauseUnitBJ( true, caster ) set bj_forLoopAIndex = 1 set bj_forLoopAIndexEnd = GetRandomInt(4, ( 3 + GetUnitAbilityLevelSwapped('A00V', caster) )) // Replace 'A007' with the code for your Thunder Slam ability loop exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd call TriggerExecute( gg_trg_Effects ) set bj_forLoopAIndex = bj_forLoopAIndex + 1 endloop call TriggerSleepAction( I2R(GetForLoopIndexA()) ) call ResetUnitAnimation( caster ) call SetUnitInvulnerable( caster, false ) call PauseUnitBJ( false, caster ) endfunction
//=========================================================================== function InitTrig_Main takes nothing returns nothing set gg_trg_Main = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Main, EVENT_PLAYER_UNIT_SPELL_EFFECT ) call TriggerAddCondition( gg_trg_Main, Condition( function Conditions ) ) call TriggerAddAction( gg_trg_Main, function Main ) endfunction
function SFX takes nothing returns nothing local unit caster = udg_TS_Caster local location point = PolarProjectionBJ(GetUnitLoc(udg_TS_Caster), GetRandomReal(250.00, 800.00), GetRandomReal(0.00, 360.00)) call TriggerSleepAction( I2R(GetForLoopIndexA()) ) call SetUnitAnimation( caster, "slam" ) call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl" ) call DestroyEffectBJ( GetLastCreatedEffectBJ() ) call TriggerSleepAction( 0.25 ) set udg_TS_Caster = caster set udg_TS_Lightning_Point = point endfunction