|
发表于 2007-11-17 23:37:09
|
显示全部楼层
[codes=jass]function KingStorm_MadeByLars takes nothing returns nothing
local unit king=i2u(GetStoredInteger(udg_localvar,"KingStorm"+I2S(h2i(GetExpiredTimer())),"King"))
local unit storm=i2u(GetStoredInteger(udg_localvar,"KingStorm"+I2S(h2i(GetExpiredTimer())),"Storm"))
local real x=GetStoredReal(udg_localvar,"KingStorm"+I2S(h2i(GetExpiredTimer())),"X")
local real y=GetStoredReal(udg_localvar,"KingStorm"+I2S(h2i(GetExpiredTimer())),"Y")
local real dis=SquareRoot((GetUnitX(king)-x)*(GetUnitX(king)-x) + (GetUnitY(king)-y)*(GetUnitY(king)-y))
local real face=(GetUnitFacing(king)+GetStoredInteger(udg_localvar,"KingStorm"+I2S(h2i(GetExpiredTimer())),"LorR")*30)*bj_DEGTORAD
if GetUnitAbilityLevel(king,'BHav')<1 then
call RemoveUnit(storm)
call FlushStoredMission(udg_localvar,"KingStorm"+I2S(h2i(GetExpiredTimer())))
set king=null
set storm=null
call DestroyTimer(GetExpiredTimer())
return
endif
set x=GetUnitX(king)
set y=GetUnitY(king)
if dis>125 then
// dis constact with Anim Speed
call StoreReal(udg_localvar,"KingStorm"+I2S(h2i(GetExpiredTimer())),"X",x)
call StoreReal(udg_localvar,"KingStorm"+I2S(h2i(GetExpiredTimer())),"Y",y)
call SetUnitPosition(storm,x+60*Cos(face),y+60*Sin(face))
call IssueImmediateOrder(storm,"thunderclap")
call StoreInteger(udg_localvar,"KingStorm"+I2S(h2i(GetExpiredTimer())),"LorR",GetStoredInteger(udg_localvar,"KingStorm"+I2S(h2i(GetExpiredTimer())),"LorR")*(-1))
endif
endfunction
function Trig_JT1_Actions takes nothing returns nothing
local unit king=GetSpellAbilityUnit()
local unit storm=CreateUnit(GetTriggerPlayer(),'u00C',GetUnitX(king),GetUnitY(king),0)
local timer t=CreateTimer()
call StoreInteger(udg_localvar,"KingStorm"+I2S(h2i(t)),"King",h2i(king))
call StoreInteger(udg_localvar,"KingStorm"+I2S(h2i(t)),"Storm",h2i(storm))
call StoreReal(udg_localvar,"KingStorm"+I2S(h2i(t)),"X",GetUnitX(king))
call StoreReal(udg_localvar,"KingStorm"+I2S(h2i(t)),"Y",GetUnitY(king))
call StoreInteger(udg_localvar,"KingStorm"+I2S(h2i(t)),"LorR",1)
call TriggerSleepAction(0.7)
call TimerStart(t,0.07,true,function KingStorm_MadeByLars)
set king=null
set storm=null
set t=null
endfunction
function InitTrig_JT1 takes nothing returns nothing
set gg_trg_JT1=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_JT1,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_JT1,Condition(function Trig_JT1_Conditions))
call TriggerAddAction(gg_trg_JT1,function Trig_JT1_Actions)
endfunction
[/codes]
默默默。。默写的 |
|