- Joined
- Dec 16, 2007
- Messages
- 252
f
JASS:
unction Trig_Nuke_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A009'
endfunction
function Nuke_Effect takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit dummy = H2U(GetHandleHandle(t, "dummy"))
local real ang = GetHandleReal(t, "ang")
local real i = GetHandleReal(t, "i")
local location o= GetUnitLoc(dummy)
call SetUnitPosition(dummy,GetUnitX(dummy) + 20 * Cos(ang * bj_DEGTORAD),GetUnitY(dummy) + 20 * Sin(ang * bj_DEGTORAD))
set i = i + 1
call DisplayTextToForce( GetPlayersAll(), R2S(i) )
if i == 100 then
//set dummy = CreateUnitAtLoc(GetOwningPlayer(dummy) , 'u004', o, ang )
call SetUnitPathing(GetLastCreatedUnit(), false)
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 0.00, 200.00 )
endif
if i == 200 then
call RemoveUnit(dummy)
call PauseTimer(t)
call FlushHandleLocals(t)
call PauseTimer(t)
call DestroyTimer(t)
endif
call RemoveLocation(o)
set t=null
set dummy=null
set o=null
endfunction
function Trig_Nuke_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit dummy
local unit bomb
local location l = GetSpellTargetLoc()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real xtarg = GetLocationX(l)
local real ytarg = GetLocationY(l)
local real ang = bj_RADTODEG * Atan2(ytarg - y, xtarg - x)
local timer t = CreateTimer()
local location s = PolarProjectionBJ(Location(xtarg, ytarg), 2000., ang - 180)
local real i = 0
set dummy = CreateUnitAtLoc(GetOwningPlayer(u) , 'u003', s, ang )
call SetUnitPathing(dummy, false)
set i = 1
call SetHandleHandle(t, "dummy", dummy)
call SetHandleHandle(t, "bomb", bomb)
call SetHandleReal(t, "ang", ang)
call SetHandleReal(t, "i", i)
call TimerStart(t, 0.03, true, function Nuke_Effect)
call RemoveLocation(l)
call RemoveLocation(s)
set u=null
set dummy=null
set l=null
set t=null
set s=null
endfunction
//===========================================================================
function InitTrig_Nuke takes nothing returns nothing
set gg_trg_Nuke = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Nuke, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Nuke, Condition( function Trig_Nuke_Conditions ) )
call TriggerAddAction( gg_trg_Nuke, function Trig_Nuke_Actions )
endfunction
Last edited: