- Joined
- Dec 16, 2007
- Messages
- 252
I have been using HandleVars but I heard that.. it's not good.
Can someone teach me how to use the TT by Cohadar?
Here's a spell that uses the HandleVars, how can I make it use the TT instead?
I think I saw a spell that uses TT, I looked through a code but I can't figure where you configure the interval time nor how to use it.
Yes the spell is converted from GUI.
Can someone teach me how to use the TT by Cohadar?
Here's a spell that uses the HandleVars, how can I make it use the TT instead?
I think I saw a spell that uses TT, I looked through a code but I can't figure where you configure the interval time nor how to use it.
Yes the spell is converted from GUI.
JASS:
function Trig_Nuke_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00E'
endfunction
function Nuke_Effect takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit dummy = H2U(GetHandleHandle(t, "dummy"))
local unit bomb
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 SetHandleReal (t, "i", i)
if i == 100 then
set bomb = CreateUnitAtLoc(GetOwningPlayer(dummy) , 'u004', o, ang )
call SetUnitUserData( bomb, GetUnitUserData(dummy) )
call UnitAddAbilityBJ( 'Arav', bomb )
call SetUnitPathing(bomb, false)
call SetUnitFlyHeightBJ( bomb, 1.00, 400.00 )
set bomb = null
endif
if i == 200 then
call RemoveUnit(dummy)
call PauseTimer(t)
call FlushHandleLocals(t)
call PauseTimer(t)
call DestroyTimer(t)
else
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 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)
set dummy = CreateUnitAtLoc(GetOwningPlayer(u) , 'u003', s, ang )
call SetUnitUserData( dummy, GetUnitAbilityLevelSwapped('A00E', u ))
call SetUnitPathing(dummy, false)
call SetHandleHandle(t, "dummy", dummy)
call SetHandleHandle(t, "u", u)
call SetHandleReal(t, "ang", ang)
call TimerStart(t, 0.03, true, function Nuke_Effect)
call RemoveLocation(l)
call RemoveLocation(s)
set s=null
set l=null
set t=null
endfunction
//===========================================================================
function InitTrig_Nuke takes nothing returns nothing
set gg_trg_Nuke = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Nuke, EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_Nuke, Condition( function Trig_Nuke_Conditions ) )
call TriggerAddAction( gg_trg_Nuke, function Trig_Nuke_Actions )
endfunction