|
发表于 2010-6-25 16:06:09
|
显示全部楼层
[jass]
globals
integer TestInteger = 100 //英雄三围增加值(可调整)
boolean Testing = false //测试开关
endglobals
function TestF takes nothing returns nothing
if Testing then
// 停止测试
set Testing = false
call DisplayTextToPlayer( GetTriggerPlayer(), 0, 0, "停止测试" )
//减少英雄属性
call ModifyHeroStat( 0, udg_Hero, 1, TestInteger )
call ModifyHeroStat( 1, udg_Hero, 1, TestInteger )
call ModifyHeroStat( 2, udg_Hero, 1, TestInteger )
else
// 开启测试
set Testing = true
call DisplayTextToPlayer( GetTriggerPlayer(), 0, 0, "开始测试" )
//增加英雄属性
call ModifyHeroStat( 0, udg_Hero, 0, TestInteger )
call ModifyHeroStat( 1, udg_Hero, 0, TestInteger )
call ModifyHeroStat( 2, udg_Hero, 0, TestInteger )
endif
endfunction
function Test takes nothing returns nothing//自定义函数:测试
local trigger TestT = CreateTrigger()
call TriggerRegisterPlayerChatEvent( TestT, Player(0), "test", true )//进行测试的玩家序号(可调整)
call TriggerAddAction( TestT, function TestF )
endfunction
[/jass] |
|