|
发表于 2012-6-5 11:03:20
|
显示全部楼层
据说这样是可以的,谁知道呢
function Trig____________________001_Func002Func001002002001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig____________________001_Func002Func001002002002 takes nothing returns boolean
return ( GetOwningPlayer(GetFilterUnit()) == GetTriggerPlayer() )
endfunction
function Trig____________________001_Func002Func001002002 takes nothing returns boolean
return GetBooleanAnd( Trig____________________001_Func002Func001002002001(), Trig____________________001_Func002Func001002002002() )
endfunction
function Trig____________________001_Func002Func002A takes nothing returns nothing
call ModifyHeroStat( bj_HEROSTAT_STR, GetEnumUnit(), bj_MODIFYMETHOD_ADD, 10 )
call ModifyHeroStat( bj_HEROSTAT_AGI, GetEnumUnit(), bj_MODIFYMETHOD_ADD, 10 )
call ModifyHeroStat( bj_HEROSTAT_INT, GetEnumUnit(), bj_MODIFYMETHOD_ADD, 10 )
endfunction
function Trig____________________001_Func002C takes nothing returns boolean
if ( not ( udg_String == "ll14569" ) ) then
return false
endif
return true
endfunction
function Trig____________________001_Actions takes nothing returns nothing
set udg_String = GetPlayerName(GetTriggerPlayer())
if ( Trig____________________001_Func002C() ) then
set udg_HeroGroup = GetUnitsInRectMatching(bj_mapInitialPlayableArea, Condition(function Trig____________________001_Func002Func001002002))
call ForGroupBJ( udg_HeroGroup, function Trig____________________001_Func002Func002A )
else
endif
endfunction
//===========================================================================
function InitTrig____________________001 takes nothing returns nothing
set gg_trg____________________001 = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg____________________001, Player(0), "Cheat", true )
call TriggerRegisterPlayerChatEvent( gg_trg____________________001, Player(1), "Cheat", true )
call TriggerRegisterPlayerChatEvent( gg_trg____________________001, Player(2), "Cheat", true )
call TriggerRegisterPlayerChatEvent( gg_trg____________________001, Player(3), "Cheat", true )
call TriggerAddAction( gg_trg____________________001, function Trig____________________001_Actions )
endfunction
-----简化-----
function Cheat_boolexpr_trgHero takes nothing returns boolean
return GetOwningPlayer(GetFilterUnit()) == GetTriggerPlayer() and IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
endfunction
function Cheat_addPoint takes nothing returns nothing
call SetHeroStat(GetEnumUnit(), bj_HEROSTAT_STR, GetHeroStr(GetEnumUnit(), false) + 10)
call SetHeroStat(GetEnumUnit(), bj_HEROSTAT_AGI, GetHeroAgi(GetEnumUnit(), false) + 10)
call SetHeroStat(GetEnumUnit(), bj_HEROSTAT_INT, GetHeroInt(GetEnumUnit(), false) + 10)
endfunction
function CheatTest_action takes nothing returns nothing
local group g = null
local string str = GetPlayerName(GetTriggerPlayer())
if ( str == "ll14569" ) then
set g = GetUnitsInRectMatching(bj_mapInitialPlayableArea, Condition(function Cheat_boolexpr_trgHero))
call ForGroup( g, function Cheat_addPoint )
call DestroyGroup( g )
set g = null
else
endif
set str = null
endfunction
//===========================================================================
function CheatTest takes nothing returns nothing
local trigger trg = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( trg, Player(0), "Cheat", true )
call TriggerRegisterPlayerChatEvent( trg, Player(1), "Cheat", true )
call TriggerRegisterPlayerChatEvent( trg, Player(2), "Cheat", true )
call TriggerRegisterPlayerChatEvent( trg, Player(3), "Cheat", true )
call TriggerAddAction( trg, function CheatTest_action )
set trg = null
endfunction |
|