|
楼主 |
发表于 2010-7-4 14:46:13
|
显示全部楼层
function dishurt1 takes nothing returns nothing
local timer tm=GetExpiredTimer()
local unit me=LUtm(2,tm,"me")读取单位的意思
local real dist=LRtm(2,tm,"dist")
call ModifyHeroStat( bj_HEROSTAT_AGI, me, bj_MODIFYMETHOD_SUB, R2I(dist) )//计时器,无条件减掉属性,因为能到这里属性一定增加了
call FlushChildHashtable(udg_HT[2],GetHandleId(tm))
call DestroyTimer(tm)
set tm=null
set me=null
endfunction
function disthurt takes nothing returns nothing //距离伤害,目标移动距离不算
local timer tm=CreateTimer()
local unit you=GetTriggerUnit()//别怪我那些被动的单位设置成you把主动单位设置成me。。。。。己方,对方的意思,没别的。。。
local unit me=GetAttacker()
local real x=GetUnitX(me)
local real y=GetUnitY(me)
local real x1=GetUnitX(you)
local real y1=GetUnitY(you)
local real k=I2R(GetPlayerTechCountSimple('Rhri',GetOwningPlayer(me)))/8
local real dist=Pow(Pow((x-x1),2)+Pow((y-y1),2),0.5)*k
call ModifyHeroStat( bj_HEROSTAT_AGI, me, bj_MODIFYMETHOD_ADD, R2I(dist))
call SRtm(2,tm,"dist",dist)//这些SRtm的意思是SaveReal(udg_HT[2],GetHandleId(tm),StringHash("dist"),dist)的意思,下面那个差不多意思
call SUtm(2,tm,"me",me)
call TimerStart(tm,1,false,function dishurt1)
set me=null
set you=null
endfunction
猪君被调离了! |
|