|
楼主 |
发表于 2010-6-2 18:04:59
|
显示全部楼层
错了错了,进过试验(至少杀了8000个怪,杀怪越多出现错误概率就越大),是那个复活函数有问题,但不知道问题出在哪里,怎么没有人啊?难道从来没有人遇到和我一样的问题吗
下面是复活的函数
function heroresurrection takes nothing returns nothing
local timer tm=GetExpiredTimer()
local unit hero=LUtm(2,tm,"hero")
call ReviveHero(hero,GetUnitX(udg_company),GetUnitY(udg_company)+200,true)
call DestroyTimerDialog(LoadTimerDialogHandle(udg_HT[2],GetHandleId(tm),StringHash("td")))
call DestroyTimer(tm)
set tm=null
set hero=null
endfunction
function animalresurrection takes nothing returns nothing
local timer tm=GetExpiredTimer()
local unit animal=LUtm(2,tm,"animal")
local integer uid=GetUnitTypeId(animal)
local real x
local real y
local unit monstor
if uid=='nsln' then
set y=GetRandomReal(-2226,245)
set x=GetRandomReal(9783,11296)
set monstor=CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE),uid,x,y,bj_UNIT_FACING )
set animal=null
set monstor=null
call DestroyTimer(tm)
set tm=null
endif
call DestroyTimer(tm)
set animal=null
set tm=null
endfunction
function Trig_resurrection_Actions takes nothing returns nothing
local timer tm
local timerdialog td
if IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO) then
set tm=CreateTimer()
call SUtm(2,tm,"hero",GetTriggerUnit())
set td= CreateTimerDialogBJ(tm,"Time to resurrecte")
call SaveTimerDialogHandle(udg_HT[2],GetHandleId(tm),StringHash("td"),td)
call TimerStart(tm,15,false,function heroresurrection)
set tm=null
set td=null
endif
if IsUnitOwnedByPlayer(GetTriggerUnit(),Player(PLAYER_NEUTRAL_AGGRESSIVE)) then
if GetUnitTypeId(GetTriggerUnit())=='nsln' then
set tm=CreateTimer()
call SUtm(2,tm,"animal",GetTriggerUnit())
call TimerStart(tm,1,false,function animalresurrection)
set tm=null
endif
endif
endfunction
//===========================================================================
function InitTrig_resurrection takes nothing returns nothing
set gg_trg_resurrection = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_resurrection, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_resurrection, function Trig_resurrection_Actions )
endfunction |
|