|
楼主 |
发表于 2010-5-26 12:20:33
|
显示全部楼层
我把技能也发上来吧,要的随便拿
function Conditions takes nothing returns boolean
if(not(GetSpellAbilityId()=='A00A')) then
return false
endif
return true
endfunction
function RowRun takes nothing returns nothing
local timer tm=GetExpiredTimer()
local unit me=LoadUnitHandle(udg_HT[2],GetHandleId(tm),StringHash("me"))
local unit temp=LoadUnitHandle(udg_HT[2],GetHandleId(tm),StringHash("temp"))
local trigger trg=LoadTriggerHandle(udg_HT[2],GetHandleId(tm),StringHash("trg"))
local location point=LoadLocationHandle(udg_HT[2],GetHandleId(tm),StringHash("point"))
local real x=GetUnitX(temp)
local real y=GetUnitY(temp)
local real x1=GetLocationX(point)
local real y1=GetLocationY(point)
local real x2=GetUnitX(me)
local real y2=GetUnitY(me)
local real k=Atan2(y1-y2,x1-x2)
local real dx=50*Cos(k)
local real dy=50*Sin(k)
local integer i=0
if Pow(Pow(x-x2,2)+Pow(y-y2,2),0.5)>2500 then
call RemoveLocation(point)
call RemoveUnit(temp)
call FlushChildHashtable(udg_HT[2],GetHandleId(tm))
call DestroyTimer(tm)
call FlushChildHashtable(udg_HT[2],GetHandleId(trg))
call DestroyTrigger(trg)
set i=1
endif
if i==0 then
if RAbsBJ(x)>4000 or RAbsBJ(y)>4000 then
call RemoveUnit(temp)
endif
call SetUnitX(temp,x+dx)
call SetUnitY(temp,y+dy)
else
set me=null
set temp=null
set point=null
set tm=null
endif
endfunction
function damage takes nothing returns nothing
local trigger trg=GetTriggeringTrigger()
local unit me=LoadUnitHandle(udg_HT[2],GetHandleId(trg),StringHash("me"))
local real i=LRtg(2,trg,"i")
if GetOwningPlayer(GetTriggerUnit())!=Player(0) then
call UnitDamageTarget(me, GetTriggerUnit(), i, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
set i=i*0.9
call SRtg(2,trg,"i",i)
endif
call DisplayTimedTextToPlayer(Player(0),0,0,0.1,"c")
set trg=null
set me=null
set trg=null
endfunction
function row takes nothing returns nothing
local trigger trg=GetTriggeringTrigger()
local timer tm=CreateTimer()
local trigger trg1=CreateTrigger()
local real t=LRtg(2,trg,"t")
local timer tm1=LTMtg(2,trg,"tm")
local unit me=LoadUnitHandle(udg_HT[2],GetHandleId(trg),StringHash("me"))
local unit temp=LoadUnitHandle(udg_HT[2],GetHandleId(trg),StringHash("temp"))
local location point=LoadLocationHandle(udg_HT[2],GetHandleId(trg),StringHash("point"))
local triggeraction act
local event ev
local real i=360*t
call SetUnitTimeScale(me,1)
call FlushChildHashtable(udg_HT[2],GetHandleId(tm1))
call DestroyTimer(tm1)
call SRtg(2,trg1,"i",i)
call SaveTriggerHandle(udg_HT[2],GetHandleId(tm),StringHash("trg"),trg1)
call SaveUnitHandle(udg_HT[2],GetHandleId(trg1),StringHash("me"),me)
set ev=TriggerRegisterUnitInRangeSimple(trg1,300,temp)
set act=TriggerAddAction(trg1,function damage)
call SaveUnitHandle(udg_HT[2],GetHandleId(tm),StringHash("me"),me)
call SaveUnitHandle(udg_HT[2],GetHandleId(tm),StringHash("temp"),temp)
call SaveLocationHandle(udg_HT[2],GetHandleId(tm),StringHash("point"),point)
set me=null
set temp=null
set point=null
call TimerStart(tm,0.01,true,function RowRun)
set tm=null
set tm1=null
set act=null
call FlushChildHashtable(udg_HT[2],GetHandleId(trg))
call DestroyTrigger(trg)
set trg=null
endfunction
function timing takes nothing returns nothing
local timer tm=GetExpiredTimer()
local trigger trg=LTGtm(2,tm,"trg")
local unit me=LUtm(2,tm,"me")
local real t=LRtg(2,trg,"t")
set t=t+0.01
if t==0.8 then
call SetUnitTimeScale(me,0.01)
endif
call SRtg(2,trg,"t",t)
set me=null
set tm=null
set trg=null
endfunction
function Trig_wind_Actions takes nothing returns nothing
local timer tm=CreateTimer()
local trigger trg=CreateTrigger()
local location point =GetSpellTargetLoc()
local triggeraction act
local triggercondition cd
local unit temp=CreateUnit(Player(0),'uaco',GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()),0)
local event ev
local event ev1
local real t=0
call STMtg(2,trg,"tm",tm)
call SRtg(2,trg,"t",t)
call STGtm(2,tm,"trg",trg)
call SUtm(2,tm,"me",GetTriggerUnit())
call TimerStart(tm,0.01,true,function timing)
call SaveUnitHandle(udg_HT[2],GetHandleId(trg),StringHash("temp"),temp)
call SaveLocationHandle(udg_HT[2],GetHandleId(trg),StringHash("point"),point)
call SaveUnitHandle(udg_HT[2],GetHandleId(trg),StringHash("me"),GetTriggerUnit())
set ev1=TriggerRegisterUnitEvent(trg,GetTriggerUnit(),EVENT_UNIT_SPELL_ENDCAST)
set ev=TriggerRegisterUnitEvent(trg,GetTriggerUnit(),EVENT_UNIT_SPELL_FINISH)
set cd=TriggerAddCondition(trg,Condition(function Conditions))
set act=TriggerAddAction(trg,function row)
set temp=null
set trg=null
set point=null
set act=null
set cd=null
set ev=null
set ev1=null
endfunction
//===========================================================================
function InitTrig_wind takes nothing returns nothing
set gg_trg_wind = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(gg_trg_wind,EVENT_PLAYER_UNIT_SPELL_CHANNEL)
call TriggerAddCondition(gg_trg_wind,Condition(function Conditions))
call TriggerAddAction( gg_trg_wind, function Trig_wind_Actions )
endfunction |
|