|
function EquipSystem_SimError takes player forPlayer, string msg returns nothing
local sound error
set error = CreateSoundFromLabel("InterfaceError",false,false,false,10,10)
set msg="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+msg+"|r"
if (GetLocalPlayer() == forPlayer) then
call ClearTextMessages()
call DisplayTimedTextToPlayer( forPlayer, 0.52, 0.96, 2.00, msg )
call StartSound( error )
endif
set error = null
endfunction
这个是自定义脚本代码
function Trig_HeroSpeedActions takes nothing returns nothing
local integer i
local player p
set p = GetTriggerPlayer()
set i = GetPlayerId(p) + 1
if ((udg_PHero == null)) then
call EquipSystem_SimError(p,"|cffffcc00"+"你还没有选择英雄."+"|r")
else
call DisplayTimedTextToPlayer( p, 0, -0, 10.00, ( udg_PlayerC + ( GetUnitName(udg_PHero) + ( "|r" + ( "的移动速度为:" + I2S(R2I(GetUnitMoveSpeed(udg_PHero))) ) ) ) ) )
endif
endfunction
//===========================================================================
function InitTrig_HeroSpeed takes nothing returns nothing
local trigger trg
set trg = CreateTrigger()
#ifdef DEBUG
call YDWESaveTriggerName(trg, "HeroSpeed")
#endif
#include <YDTrigger/TriggerRegisterAnyPlayerEvent.h>
call TriggerRegisterPlayerChatEvent( trg, YDWEGetAllPlayer(), "-hs", true )
#include <YDTrigger/TriggerRegisterAnyPlayerEvent.h>
call TriggerAddAction(trg, function Trig_HeroSpeedActions)
endfunction |
|