mmkay im trying to make a spell where you cast an ice bolt, then when the ice bolt hits the enemy it does the frost nova ability....
i know alot of people made this already, but im making it myself, ive done it before... but its not working now for some reason.....
The 'h001' unit is the dummy caster, when my guy casts frost bolt, the trigger will make the dummy caster, but not give the dummy caster the ability or order him to cast it or even kill him in 2.0 sec.... please help =]
i know alot of people made this already, but im making it myself, ive done it before... but its not working now for some reason.....
JASS:
function Trig_Frost_Bolt_Conditions takes nothing returns boolean
return ( GetSpellAbilityId() == 'A000' )
endfunction
function Trig_Frost_Bolt_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit enm = GetSpellTargetUnit()
local location uloc = GetUnitLoc(u)
local location enmloc = GetUnitLoc(enm)
local real time = (DistanceBetweenPoints(uloc, enmloc) / 1000.0)
local player up = GetOwningPlayer(u)
local unit spec
call Preload("frostnova")
call PolledWait(time)
call SetUnitTimeScale(CreateUnitAtLoc( up, 'h001', uloc, 0.0 ), 2.0)
set spec = GetLastCreatedUnit()
call UnitAddAbilityBJ( 'A001', spec )
set enmloc = GetUnitLoc(enm)
call IssuePointOrderLocBJ( spec, "frostnova", enmloc )
call PolledWait( 0.5 )
set u = null
set enm = null
call RemoveLocation( uloc )
set uloc = null
call RemoveLocation( enmloc )
set enmloc = null
set spec = null
set up = null
endfunction
//===========================================================================
function InitTrig_Frost_Bolt takes nothing returns nothing
set gg_trg_Frost_Bolt = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Frost_Bolt, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Frost_Bolt, Condition( function Trig_Frost_Bolt_Conditions ) )
call TriggerAddAction( gg_trg_Frost_Bolt, function Trig_Frost_Bolt_Actions )
endfunction
The 'h001' unit is the dummy caster, when my guy casts frost bolt, the trigger will make the dummy caster, but not give the dummy caster the ability or order him to cast it or even kill him in 2.0 sec.... please help =]