|
随便建个触发器 自定义代码如下
开始会显示文字xxx"
单位使用物品时会显示文字x1x1x1
[jass]
function ITC1 takes nothing returns boolean
call DisplayTextToPlayer( Player(0), 0, 0, "x1x1x1" )
return false
endfunction
function IT takes nothing returns nothing
local trigger t= CreateTrigger()
call TriggerRegisterUnitEvent(t,gg_unit_Hpal_0001,EVENT_UNIT_USE_ITEM)
call TriggerAddCondition(t,Condition(function ITC1))
call DisplayTextToPlayer( Player(0), 0, 0, "xxx" )
endfunction
function InitTrig____________________001 takes nothing returns nothing
call IT()
endfunction
[/jass]
但是把function ITC1 和IT放入自定义脚本后
开始会显示文字xxx"
单位使用物品时却不显示文字x1x1x1
脚本代码
[jass]
function ITC1 takes nothing returns boolean
call DisplayTextToPlayer( Player(0), 0, 0, "x1x1x1" )
return false
endfunction
function IT takes nothing returns nothing
local trigger t= CreateTrigger()
call TriggerRegisterUnitEvent(t,gg_unit_Hpal_0001,EVENT_UNIT_USE_ITEM)
call TriggerAddCondition(t,Condition(function ITC1))
call DisplayTextToPlayer( Player(0), 0, 0, "xxx" )
endfunction
[/jass]
触发器代码
[jass]
function InitTrig____________________001 takes nothing returns nothing
call IT()
endfunction
[/jass] |
|