|
楼主 |
发表于 2010-6-1 17:46:36
|
显示全部楼层
这个是复活野怪的触发,两个一起退出魔兽的时候有致命错误,但是游戏的时候并不会弹出来
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 )
call IssueImmediateOrder(monstor,"windwalk")
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,10,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
----------- 帖子于 17:46 更新 --------- 之前内容发布于 17:37 ------------
天呐这还是有一定概率关闭魔兽之后出现的啊……怎么这么玄,望高手jieda |
|