找回密码
 点一下
查看: 962|回复: 2

难搞这个触发不知道怎么的在关闭魔兽之后才会出现错误

[复制链接]
发表于 2010-6-1 14:20:04 | 显示全部楼层 |阅读模式
可以一直玩,就是退出魔兽的时候弹出个对话框说是严重致命错误,就各位大大的看看什么问题?
function windwalk takes nothing returns boolean//这是判断进入矩形区域单位是否有疾风步的,就是如果有疾风步那些怪就不打他
if GetOwningPlayer(GetTriggerUnit())!=Player(PLAYER_NEUTRAL_AGGRESSIVE) and not(UnitHasBuffBJ(GetTriggerUnit(),'BOwk')) then
return true
else
return false
endif
endfunction
function sanmonstorattackbegin takes nothing returns nothing这是怪组攻击进入矩形的单位
call IssueTargetOrder(GetEnumUnit(),"attack",GetTriggerUnit())
endfunction
function sandmonstorattack takes nothing returns nothing
local group sand=CreateGroup()
set sand=GetUnitsOfPlayerAndTypeId(Player(PLAYER_NEUTRAL_AGGRESSIVE),'nsln')
call ForGroup(sand,function sanmonstorattackbegin)
set sand=null
endfunction
function Trig_sandmonstor_Actions takes nothing returns nothing这是触发
local integer i=10
local real x
local real y
local unit sb
local trigger trg=CreateTrigger()
local rect range=Rect(10080,-1760,10944,-576)
local event ev=TriggerRegisterEnterRectSimple(trg,range)
local triggeraction act=TriggerAddAction(trg,function sandmonstorattack)
local triggercondition cd=TriggerAddCondition(trg,Condition(function windwalk))
loop
exitwhen i<=0
set i=i-1
set y=GetRandomReal(-2226,245)
set x=GetRandomReal(9783,11296)
set sb=CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE),'nsln',x,y,bj_UNIT_FACING )
set sb=null
endloop
call DestroyTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_sandmonstor takes nothing returns nothing
    set gg_trg_sandmonstor = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_sandmonstor, 20.00 )
    call TriggerAddAction( gg_trg_sandmonstor, function Trig_sandmonstor_Actions )
endfunction
 楼主| 发表于 2010-6-1 17:34:54 | 显示全部楼层
额。这个触发单独运作还不会弹出来,是和另一个触发,复活野怪结合一起,杀两轮退出魔兽就弹出致命错误了,是哪里的问题?
回复

使用道具 举报

 楼主| 发表于 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
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-7-4 22:35 , Processed in 0.029972 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表