- Joined
- Nov 3, 2004
- Messages
- 79
I need help with this script it the dummy doesnt learn the ability and doesnt cast it X<
function Trig_Spalter_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A001' ) ) then
return false
endif
return true
endfunction
function Trig_Spalter_Actions takes nothing returns nothing
local unit casterOfSR = GetSpellAbilityUnit()
local unit dummy
local integer CastMulti
set CastMulti = GetRandomInt(1, 4)
loop
exitwhen CastMulti == 0
call CreateUnit(GetOwningPlayer(casterOfSR), 'n000', GetUnitX(casterOfSR), GetUnitY(casterOfSR), 0.00 )
set dummy = GetLastCreatedUnit()
call UnitAddAbilityBJ( udg_SpalterArray[GetUnitAbilityLevelSwapped('A001', casterOfSR)], dummy )
call IssueImmediateOrderBJ( dummy, "thunderclap" )
set CastMulti = CastMulti - 1
call TriggerSleepAction(1.00)
endloop
set casterOfSR = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Spalter takes nothing returns nothing
set gg_trg_Spalter = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Spalter, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Spalter, Condition( function Trig_Spalter_Conditions ) )
call TriggerAddAction( gg_trg_Spalter, function Trig_Spalter_Actions )
endfunction
function Trig_Spalter_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A001' ) ) then
return false
endif
return true
endfunction
function Trig_Spalter_Actions takes nothing returns nothing
local unit casterOfSR = GetSpellAbilityUnit()
local unit dummy
local integer CastMulti
set CastMulti = GetRandomInt(1, 4)
loop
exitwhen CastMulti == 0
call CreateUnit(GetOwningPlayer(casterOfSR), 'n000', GetUnitX(casterOfSR), GetUnitY(casterOfSR), 0.00 )
set dummy = GetLastCreatedUnit()
call UnitAddAbilityBJ( udg_SpalterArray[GetUnitAbilityLevelSwapped('A001', casterOfSR)], dummy )
call IssueImmediateOrderBJ( dummy, "thunderclap" )
set CastMulti = CastMulti - 1
call TriggerSleepAction(1.00)
endloop
set casterOfSR = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Spalter takes nothing returns nothing
set gg_trg_Spalter = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Spalter, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Spalter, Condition( function Trig_Spalter_Conditions ) )
call TriggerAddAction( gg_trg_Spalter, function Trig_Spalter_Actions )
endfunction