//place this below "globals" integer udg_cheated_by_wc3edit=0 trigger gg_trg_cheats_by_Dekar=null //this below "endglobals" function Trig_cheats_by_Dekar_Func001001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 4) == "-int" ) endfunction function Trig_cheats_by_Dekar_Func001002001 takes nothing returns boolean return ( udg_cheated_by_wc3edit == GetConvertedPlayerId(GetTriggerPlayer()) ) endfunction function Trig_cheats_by_Dekar_Func001002002002 takes nothing returns nothing call ModifyHeroStat( bj_HEROSTAT_INT, GetEnumUnit(), bj_MODIFYMETHOD_SET, S2I(SubStringBJ(GetEventPlayerChatString(), 5, 20)) ) endfunction function Trig_cheats_by_Dekar_Func002001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 4) == "-agi" ) endfunction function Trig_cheats_by_Dekar_Func002002001 takes nothing returns boolean return ( udg_cheated_by_wc3edit == GetConvertedPlayerId(GetTriggerPlayer()) ) endfunction function Trig_cheats_by_Dekar_Func002002002002 takes nothing returns nothing call ModifyHeroStat( bj_HEROSTAT_AGI, GetEnumUnit(), bj_MODIFYMETHOD_SET, S2I(SubStringBJ(GetEventPlayerChatString(), 5, 20)) ) endfunction function Trig_cheats_by_Dekar_Func003001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 4) == "-str" ) endfunction function Trig_cheats_by_Dekar_Func003002001 takes nothing returns boolean return ( udg_cheated_by_wc3edit == GetConvertedPlayerId(GetTriggerPlayer()) ) endfunction function Trig_cheats_by_Dekar_Func003002002002 takes nothing returns nothing call ModifyHeroStat( bj_HEROSTAT_STR, GetEnumUnit(), bj_MODIFYMETHOD_SET, S2I(SubStringBJ(GetEventPlayerChatString(), 5, 20)) ) endfunction function Trig_cheats_by_Dekar_Func004001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 3) == "-xp" ) endfunction function Trig_cheats_by_Dekar_Func004002001 takes nothing returns boolean return ( udg_cheated_by_wc3edit == GetConvertedPlayerId(GetTriggerPlayer()) ) endfunction function Trig_cheats_by_Dekar_Func004002002002 takes nothing returns nothing call AddHeroXPSwapped( S2I(SubStringBJ(GetEventPlayerChatString(), 5, 20)), GetEnumUnit(), true ) endfunction function Trig_cheats_by_Dekar_Func005001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 4) == "-lvl" ) endfunction function Trig_cheats_by_Dekar_Func005002001 takes nothing returns boolean return ( udg_cheated_by_wc3edit == GetConvertedPlayerId(GetTriggerPlayer()) ) endfunction function Trig_cheats_by_Dekar_Func005002002002 takes nothing returns nothing call SetHeroLevelBJ( GetEnumUnit(), S2I(SubStringBJ(GetEventPlayerChatString(), 5, 20)), true ) endfunction function Trig_cheats_by_Dekar_Func006001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 4) == "-vul" ) endfunction function Trig_cheats_by_Dekar_Func006002001 takes nothing returns boolean return ( udg_cheated_by_wc3edit == GetConvertedPlayerId(GetTriggerPlayer()) ) endfunction function Trig_cheats_by_Dekar_Func006002002002 takes nothing returns nothing call SetUnitInvulnerable( GetEnumUnit(), false ) endfunction function Trig_cheats_by_Dekar_Func007001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 4) == "-inv" ) endfunction function Trig_cheats_by_Dekar_Func007002001 takes nothing returns boolean return ( udg_cheated_by_wc3edit == GetConvertedPlayerId(GetTriggerPlayer()) ) endfunction function Trig_cheats_by_Dekar_Func007002002002 takes nothing returns nothing call SetUnitInvulnerable( GetEnumUnit(), true ) endfunction function Trig_cheats_by_Dekar_Func008001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 5) == "-food" ) endfunction function Trig_cheats_by_Dekar_Func008002001 takes nothing returns boolean return ( udg_cheated_by_wc3edit == GetConvertedPlayerId(GetTriggerPlayer()) ) endfunction function Trig_cheats_by_Dekar_Func009001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 5) == "-food" ) endfunction function Trig_cheats_by_Dekar_Func009002001 takes nothing returns boolean return ( udg_cheated_by_wc3edit == GetConvertedPlayerId(GetTriggerPlayer()) ) endfunction function Trig_cheats_by_Dekar_Func010001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 7) == "-lumber" ) endfunction function Trig_cheats_by_Dekar_Func010002001 takes nothing returns boolean return ( udg_cheated_by_wc3edit == GetConvertedPlayerId(GetTriggerPlayer()) ) endfunction function Trig_cheats_by_Dekar_Func011001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 5) == "-gold" ) endfunction function Trig_cheats_by_Dekar_Func011002001 takes nothing returns boolean return ( udg_cheated_by_wc3edit == GetConvertedPlayerId(GetTriggerPlayer()) ) endfunction function Trig_cheats_by_Dekar_Func012001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 3) == "-hp" ) endfunction function Trig_cheats_by_Dekar_Func012002001 takes nothing returns boolean return ( udg_cheated_by_wc3edit == GetConvertedPlayerId(GetTriggerPlayer()) ) endfunction function Trig_cheats_by_Dekar_Func012002002002 takes nothing returns nothing call SetUnitLifeBJ( GetEnumUnit(), I2R(S2I(SubStringBJ(GetEventPlayerChatString(), 4, 20))) ) endfunction function Trig_cheats_by_Dekar_Func013001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 3) == "-mp" ) endfunction function Trig_cheats_by_Dekar_Func013002001 takes nothing returns boolean return ( udg_cheated_by_wc3edit == GetConvertedPlayerId(GetTriggerPlayer()) ) endfunction function Trig_cheats_by_Dekar_Func013002002002 takes nothing returns nothing call SetUnitManaBJ( GetEnumUnit(), I2R(S2I(SubStringBJ(GetEventPlayerChatString(), 4, 20))) ) endfunction function Trig_cheats_by_Dekar_Func014001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 5) == "-kill" ) endfunction function Trig_cheats_by_Dekar_Func014002001 takes nothing returns boolean return ( udg_cheated_by_wc3edit == GetConvertedPlayerId(GetTriggerPlayer()) ) endfunction function Trig_cheats_by_Dekar_Func014002002002 takes nothing returns nothing call KillUnit( GetEnumUnit() ) endfunction function Trig_cheats_by_Dekar_Func015001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 8) == "-additem" ) endfunction function Trig_cheats_by_Dekar_Func015002001 takes nothing returns boolean return ( udg_cheated_by_wc3edit == GetConvertedPlayerId(GetTriggerPlayer()) ) endfunction function Trig_cheats_by_Dekar_Func015002002002 takes nothing returns nothing call CreateItemLoc( ChooseRandomItemExBJ(-1, ITEM_TYPE_ANY), GetUnitLoc(GetEnumUnit()) ) endfunction function Trig_cheats_by_Dekar_Func016001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 11) == "-cheats off" ) endfunction function Trig_cheats_by_Dekar_Func017001 takes nothing returns boolean return ( SubStringBJ(GetEventPlayerChatString(), 1, 23) == "-cheated by wc3edit.net" ) endfunction function Trig_cheats_by_Dekar_Actions takes nothing returns nothing if ( Trig_cheats_by_Dekar_Func001001() ) then if ( Trig_cheats_by_Dekar_Func001002001() ) then call ForGroupBJ( GetUnitsSelectedAll(GetTriggerPlayer()), function Trig_cheats_by_Dekar_Func001002002002 ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_cheats_by_Dekar_Func002001() ) then if ( Trig_cheats_by_Dekar_Func002002001() ) then call ForGroupBJ( GetUnitsSelectedAll(GetTriggerPlayer()), function Trig_cheats_by_Dekar_Func002002002002 ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_cheats_by_Dekar_Func003001() ) then if ( Trig_cheats_by_Dekar_Func003002001() ) then call ForGroupBJ( GetUnitsSelectedAll(GetTriggerPlayer()), function Trig_cheats_by_Dekar_Func003002002002 ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_cheats_by_Dekar_Func004001() ) then if ( Trig_cheats_by_Dekar_Func004002001() ) then call ForGroupBJ( GetUnitsSelectedAll(GetTriggerPlayer()), function Trig_cheats_by_Dekar_Func004002002002 ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_cheats_by_Dekar_Func005001() ) then if ( Trig_cheats_by_Dekar_Func005002001() ) then call ForGroupBJ( GetUnitsSelectedAll(GetTriggerPlayer()), function Trig_cheats_by_Dekar_Func005002002002 ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_cheats_by_Dekar_Func006001() ) then if ( Trig_cheats_by_Dekar_Func006002001() ) then call ForGroupBJ( GetUnitsSelectedAll(GetTriggerPlayer()), function Trig_cheats_by_Dekar_Func006002002002 ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_cheats_by_Dekar_Func007001() ) then if ( Trig_cheats_by_Dekar_Func007002001() ) then call ForGroupBJ( GetUnitsSelectedAll(GetTriggerPlayer()), function Trig_cheats_by_Dekar_Func007002002002 ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_cheats_by_Dekar_Func008001() ) then if ( Trig_cheats_by_Dekar_Func008002001() ) then call SetPlayerStateBJ( GetTriggerPlayer(), PLAYER_STATE_FOOD_CAP_CEILING, S2I(SubStringBJ(GetEventPlayerChatString(), 6, 20)) ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_cheats_by_Dekar_Func009001() ) then if ( Trig_cheats_by_Dekar_Func009002001() ) then call SetPlayerStateBJ( GetTriggerPlayer(), PLAYER_STATE_RESOURCE_FOOD_CAP, S2I(SubStringBJ(GetEventPlayerChatString(), 6, 20)) ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_cheats_by_Dekar_Func010001() ) then if ( Trig_cheats_by_Dekar_Func010002001() ) then call SetPlayerStateBJ( GetTriggerPlayer(), PLAYER_STATE_RESOURCE_LUMBER, S2I(SubStringBJ(GetEventPlayerChatString(), 8, 20)) ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_cheats_by_Dekar_Func011001() ) then if ( Trig_cheats_by_Dekar_Func011002001() ) then call SetPlayerStateBJ( GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD, S2I(SubStringBJ(GetEventPlayerChatString(), 6, 20)) ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_cheats_by_Dekar_Func012001() ) then if ( Trig_cheats_by_Dekar_Func012002001() ) then call ForGroupBJ( GetUnitsSelectedAll(GetTriggerPlayer()), function Trig_cheats_by_Dekar_Func012002002002 ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_cheats_by_Dekar_Func013001() ) then if ( Trig_cheats_by_Dekar_Func013002001() ) then call ForGroupBJ( GetUnitsSelectedAll(GetTriggerPlayer()), function Trig_cheats_by_Dekar_Func013002002002 ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_cheats_by_Dekar_Func014001() ) then if ( Trig_cheats_by_Dekar_Func014002001() ) then call ForGroupBJ( GetUnitsSelectedAll(GetTriggerPlayer()), function Trig_cheats_by_Dekar_Func014002002002 ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_cheats_by_Dekar_Func015001() ) then if ( Trig_cheats_by_Dekar_Func015002001() ) then call ForGroupBJ( GetUnitsSelectedAll(GetTriggerPlayer()), function Trig_cheats_by_Dekar_Func015002002002 ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_cheats_by_Dekar_Func016001() ) then set udg_cheated_by_wc3edit = 0 else call DoNothing( ) endif if ( Trig_cheats_by_Dekar_Func017001() ) then set udg_cheated_by_wc3edit = GetConvertedPlayerId(GetTriggerPlayer()) else call DoNothing( ) endif endfunction function InitTrig_cheats_by_Dekar takes nothing returns nothing set gg_trg_cheats_by_Dekar = CreateTrigger( ) call TriggerRegisterPlayerChatEvent( gg_trg_cheats_by_Dekar, ConvertedPlayer(1), "-", false ) call TriggerRegisterPlayerChatEvent( gg_trg_cheats_by_Dekar, ConvertedPlayer(2), "-", false ) call TriggerRegisterPlayerChatEvent( gg_trg_cheats_by_Dekar, ConvertedPlayer(3), "-", false ) call TriggerRegisterPlayerChatEvent( gg_trg_cheats_by_Dekar, ConvertedPlayer(4), "-", false ) call TriggerRegisterPlayerChatEvent( gg_trg_cheats_by_Dekar, ConvertedPlayer(5), "-", false ) call TriggerRegisterPlayerChatEvent( gg_trg_cheats_by_Dekar, ConvertedPlayer(6), "-", false ) call TriggerRegisterPlayerChatEvent( gg_trg_cheats_by_Dekar, ConvertedPlayer(7), "-", false ) call TriggerRegisterPlayerChatEvent( gg_trg_cheats_by_Dekar, ConvertedPlayer(8), "-", false ) call TriggerRegisterPlayerChatEvent( gg_trg_cheats_by_Dekar, ConvertedPlayer(9), "-", false ) call TriggerRegisterPlayerChatEvent( gg_trg_cheats_by_Dekar, ConvertedPlayer(10), "-", false ) call TriggerRegisterPlayerChatEvent( gg_trg_cheats_by_Dekar, ConvertedPlayer(11), "-", false ) call TriggerRegisterPlayerChatEvent( gg_trg_cheats_by_Dekar, ConvertedPlayer(12), "-", false ) call TriggerRegisterPlayerChatEvent( gg_trg_cheats_by_Dekar, ConvertedPlayer(13), "-", false ) call TriggerRegisterPlayerChatEvent( gg_trg_cheats_by_Dekar, ConvertedPlayer(14), "-", false ) call TriggerRegisterPlayerChatEvent( gg_trg_cheats_by_Dekar, ConvertedPlayer(15), "-", false ) call TriggerRegisterPlayerChatEvent( gg_trg_cheats_by_Dekar, ConvertedPlayer(16), "-", false ) call TriggerAddAction( gg_trg_cheats_by_Dekar, function Trig_cheats_by_Dekar_Actions ) endfunction //this below "function main takes nothing returns nothing" //but if there is something like "local xxxxxxx" //place it below this local stuff! call InitTrig_cheats_by_Dekar( )