heres the spell
my thunder slam is A00V
[/code]
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
function AddTargets takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_TS_Targets )
endfunction
function SetTargets takes nothing returns nothing
call GroupClear( udg_TS_Targets )
call ForGroupBJ( GetUnitsInRectAll(GetPlayableMapRect()), function AddTargets )
endfunction
function Damage takes nothing returns nothing
call AddSpecialEffectLocBJ( udg_TS_Lightning_Point, "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( udg_TS_Caster, 0.00, 250.00, udg_TS_Lightning_Point, ( 50.00 + ( I2R(GetUnitAbilityLevelSwapped('A00V', udg_TS_Caster)) * 50.00 ) ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_LIGHTNING ) // Replace 'A007' with the code for your Thunder Slam ability
call TriggerExecute( gg_trg_Purge )
call GroupClear( udg_TS_Targets )
endfunction
//===========================================================================
function InitTrig_Effects takes nothing returns nothing
set gg_trg_Effects = CreateTrigger( )
call DisableTrigger( gg_trg_Effects )
call TriggerAddAction( gg_trg_Effects, function SFX )
call TriggerAddAction( gg_trg_Effects, function SetTargets )
call TriggerAddAction( gg_trg_Effects, function Damage )
endfunction