- Joined
- Jul 10, 2007
- Messages
- 6,306
The First Warcraft 3 Complete Anti Cheat Pack!
Features that block cheats block all things similar to that cheat as well. For example, blocking greedisgood blocks all gold/lumber cheats that can result from cheat packs and hacks.Features:
| |||||||||
Blocked Cheats | |||||||||
thedudeabides | remove spell cooldown | ||||||||
itvexesme | disable victory conditions | ||||||||
Motherland | skip campaign levels | ||||||||
SomebodySetUpUsTheBomb | instant defeat | ||||||||
AllYourBaseAreBelongToUs | instant win | ||||||||
SharpAndShiny | research upgrades | ||||||||
WarpTen | fast build speed | ||||||||
IocainePowder | fast death/decay | ||||||||
WhosYourDaddy | god mode | ||||||||
PointBreak | no food limit | ||||||||
ThereIsNoSpoon | infinite mana | ||||||||
StrengthAndHonor | can't lose | ||||||||
Synergy | disable tech tree reqs | ||||||||
IseeDeadPeople | makes map visible | ||||||||
WhoIsJohnGalt | enable research | ||||||||
KeyserSoze | extra gold | ||||||||
LeafitToMe | extra lumber | ||||||||
GreedIsGood | extra gold and lumber | ||||||||
RiseAndShine | set time of day to dawn | ||||||||
LightsOut | time of day to dusk | ||||||||
DayLightSavings | set time of day or halt/resume time of day | ||||||||
Protections | |||||||||
Handle Validation | protection against unauthorized handle creation | ||||||||
Player State Validation | protection against unauthorized player state manipulation | ||||||||
Fog State Validation | protection against fogstate handle manipulation | ||||||||
Unit Handle Validation | protection against movement/manipulation of units | ||||||||
Item Handle Validation | protection against movement/manipulation of items |
Updates
-
Fixed up gold/lumber tracking
JASS:
library AntiCheat uses PlayerManager, WorldBounds
//hiveworkshop.com/forums/jass-functions-413/system-pt-player-tracking-142554/
//www.hiveworkshop.com/forums/jass-functions-413/snippet-worldbounds-180494/
//v1.0.0.12
//trading still bugged
globals
//prevents manipulation of all player states
constant boolean ANTI_PLAYER_STATE = true
//prevents manipulation of fog
constant boolean ANTI_FOG = true
//prevents players from becoming immortal
constant boolean ANTI_GOD = false
//prevents players from warp building
constant boolean ANTI_WARP = true
//prevents players from creating handles
constant boolean ANTI_HANDLE_CREATION = true
//prevents infinite mana cheat
constant boolean ANTI_MANA = true
endglobals
globals
private constant integer ANTI_GOD = 'aPSN'
private constant integer ANTI_MH = 'aLSN'
private constant integer ANTI_MANA_ABI = 'aNSN'
endglobals
//! external ObjectMerger w3u hgtw aPSN unam "AntiCheatGod" unsf "(AntiCheat)" uabi "aNSN" ua1b "1" ua1d "1" ua1s "1" ua1r "64" uwu1 "0" def "0" ucol "0" upap "" usnd "" ubsl "" uibo "1" ucbo "1" uhpm "50000" uhpr "400" uhrt "always" ulum "0" usid "128" usin "128" ureq "" upgr "" utip " " utub " " umpi "12" ua1c ".01" ua1m "" ua1w "instant" umpm "20" umpr "7" uubs "" ushr "0" upat "" uacq "64" usca ".01"
//! external ObjectMerger w3u hgtw aLSN unam "AntiCheatMH" unsf "(AntiCheat)" uabi "aNSN" ua1b "1" ua1d "1" ua1s "1" ua1r "64" uwu1 "0" def "0" ucol "0" upap "" usnd "" ubsl "" uibo "1" ucbo "1" uhpm "50000" uhpr "400" uhrt "always" ulum "0" usid "0" usin "0" ureq "" upgr "" utip " " utub " " umpi "12" ua1c ".01" ua1m "" ua1w "instant" umpm "20" umpr "7" uubs "" ushr "0" upat "" uacq "64" usca ".01"
//! external ObjectMerger w3a AEim aNSN anam "AntiCheatMana" ansf "(AntiCheat)" aher "0" alev "1" aare 1 "0" amcs 1 "0" atar 1 "" achd "0" atp1 1 " " aub1 1 " " aut1 1 " " auu1 1 " " arhk 1 ""
globals
private hashtable table = InitHashtable()
endglobals
private function PlayerState takes player p, playerstate ps, integer val returns nothing
call SaveInteger(table, GetPlayerId(p), GetHandleId(ps), val)
endfunction
hook SetPlayerState PlayerState
private struct AntiCheater extends array
private static integer gid
private static integer lid
private static integer tval = 0
private static integer tps = 0
private static player tp = null
private static integer tpd = 0
private static hashtable tradetable = InitHashtable()
private static integer array bounty
private static integer array unknowns
public static player cheated = null
public static trigger cheats = CreateTrigger()
public static boolean endgame = false
private static real antisyncm = 0
private static real bountysyncm = 0
private static real antisyncs = 0
private static real bountysyncs = 0
private static timer ptime = CreateTimer()
private static timer timestamp = CreateTimer()
private static real minutes = 0
private static method operator seconds takes nothing returns real
return TimerGetElapsed(timestamp)
endmethod
private static method sync takes boolean b returns nothing
if (b) then
set bountysyncm = minutes
set bountysyncs = seconds
else
set antisyncm = minutes
set antisyncs = seconds
endif
endmethod
private static method vsyncc takes boolean b returns boolean
if (b) then
return bountysyncm == minutes and bountysyncs == seconds
endif
return antisyncm == minutes and antisyncs == seconds
endmethod
private static method operator vsync takes nothing returns boolean
return bountysyncm == antisyncm and bountysyncs == antisyncs
endmethod
private static method ptc takes nothing returns nothing
local Players p = 0
local boolean gc = false
loop
if (unknowns != bounty) then
call SetPlayerState(p.get, PLAYER_STATE_RESOURCE_GOLD, LoadInteger(table, p, gid))
call SetPlayerState(p.get, PLAYER_STATE_RESOURCE_LUMBER, LoadInteger(table, p, lid))
set gc = true
if (cheated == null) then
set cheated = Players.get
endif
else
call SaveInteger(table, p, gid, GetPlayerState(p.get, PLAYER_STATE_RESOURCE_GOLD))
call SaveInteger(table, p, lid, GetPlayerState(p.get, PLAYER_STATE_RESOURCE_LUMBER))
endif
set p = p.next
exitwhen p.end
endloop
if (gc) then
call TriggerEvaluate(cheats)
endif
set cheated = null
endmethod
private static method anti takes nothing returns boolean
local player p = GetTriggerPlayer()
local integer pid = GetPlayerId(p)
local playerstate e = GetEventPlayerState()
local integer pstate = GetPlayerState(p, e)
local integer hid = GetHandleId(e)
local integer ptable = LoadInteger(table, pid, hid)
local Players ps = 0
local integer eid
local integer eid2 = 0
//Sync and Reset
///////////////////////////////////////////////
if (not vsyncc(false)) then
call sync(false)
set ps = 0
loop
set unknowns[ps] = 0
set ps = ps.next
exitwhen ps.end
endloop
set tval = 0
set tps = 0
set tp = null
set tpd = 0
call FlushChildHashtable(tradetable, 0)
endif
if (not vsync) then
set ps = 0
loop
set bounty[ps] = 0
set ps = ps.next
exitwhen ps.end
endloop
call sync(true)
endif
///////////////////////////////////////////////
if (e == PLAYER_STATE_RESOURCE_GOLD or e == PLAYER_STATE_RESOURCE_LUMBER) then
if (pstate != ptable) then
if (e == PLAYER_STATE_RESOURCE_GOLD) then
set eid = gid
else
set eid = lid
set eid2 = 1
endif
if (tp != null and tps == eid and tval == -(pstate-ptable) and tp != p and not LoadBoolean(tradetable, 0, (tpd*17+pid)*10+eid2)) then
call SaveBoolean(tradetable, 0, (tpd*17+pid)*10+eid2, true)
call SaveBoolean(tradetable, 0, (pid*17+tpd)*10+eid2, true)
call SaveInteger(table, pid, hid, -tval+pstate)
call SaveInteger(table, tpd, hid, tval+pstate)
set tp = null
set unknowns[tpd] = unknowns[tpd] - 1
else
set unknowns[pid] = unknowns[pid] + 1
set tval = (pstate-ptable)
set tps = pid
set tp = p
if (cheated == null) then
set cheated = tp
endif
endif
call TimerStart(ptime, 0, false, function thistype.ptc)
endif
elseif (pstate != ptable) then
if (cheated == null) then
set cheated = Player(pid)
endif
call TriggerEvaluate(cheats)
set cheated = null
call SetPlayerState(p, e, ptable)
endif
return false
endmethod
private static method update takes nothing returns boolean
local eventid e = GetTriggerEventId()
local Players pid
if (not vsyncc(true)) then
set pid = 0
loop
set bounty[pid] = 0
set pid = pid.next
exitwhen pid.end
endloop
call sync(true)
endif
if (e == EVENT_PLAYER_UNIT_SELL) then
set pid = GetPlayerId(GetTriggerPlayer())
set bounty[pid] = bounty[pid] + 1
set pid = GetPlayerId(GetOwningPlayer(GetBuyingUnit()))
set bounty[pid] = bounty[pid] + 1
elseif (e == EVENT_PLAYER_UNIT_DEATH) then
if (GetKillingUnit() != null) then
set pid = GetPlayerId(GetOwningPlayer(GetKillingUnit()))
set bounty[pid] = bounty[pid] + 1
endif
else
set pid = GetPlayerId(GetTriggerPlayer())
set bounty[pid] = bounty[pid] + 1
endif
return false
endmethod
private static method cheater takes nothing returns boolean
set cheated = GetTriggerPlayer()
return false
endmethod
static if ANTI_FOG then
private static method antifogc takes nothing returns boolean
call Cheat("iseedeadpeople")
if (cheated == null) then
set cheated = GetOwningPlayer(GetAttacker())
endif
call TriggerEvaluate(cheats)
set cheated = null
return false
endmethod
endif
static if ANTI_GOD then
private static method antigodc takes nothing returns boolean
local unit antiunit
call Cheat("whosyourdaddy")
set antiunit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), ANTI_GOD, WorldBounds.minX, WorldBounds.minY, 0)
call TriggerRegisterUnitEvent(t6, antiunit, EVENT_UNIT_DEATH)
call SetUnitX(antiunit, WorldBounds.minX)
call SetUnitY(antiunit, WorldBounds.minY)
if (cheated == null) then
set cheated = GetOwningPlayer(GetKillingUnit())
endif
//set endgame = true
call TriggerEvaluate(cheats)
set cheated = null
return false
endmethod
endif
static if ANTI_MANA then
private static method antimanac takes nothing returns boolean
if (cheated == null) then
set cheated = GetOwningPlayer(GetTriggerUnit())
endif
set endgame = true
call TriggerEvaluate(cheats)
set cheated = null
return false
endmethod
endif
private static method timestamps takes nothing returns nothing
set minutes = minutes + 1
endmethod
private static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
local trigger t2 = CreateTrigger()
local Human p = Human.first
local Players p2 = 0
local trigger t3 = CreateTrigger()
static if ANTI_MANA then
local trigger t4 = CreateTrigger()
endif
static if ANTI_FOG then
local trigger t5 = CreateTrigger()
endif
static if ANTI_GOD then
local trigger t6 = CreateTrigger()
endif
local unit antiunit
set gid = GetHandleId(PLAYER_STATE_RESOURCE_GOLD)
set lid = GetHandleId(PLAYER_STATE_RESOURCE_LUMBER)
loop
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_ALLIED_VICTORY, GREATER_THAN_OR_EQUAL, 0.)
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_FOOD_CAP_CEILING, GREATER_THAN_OR_EQUAL, 0.)
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_GAME_RESULT, GREATER_THAN_OR_EQUAL, 0.)
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_GIVES_BOUNTY, GREATER_THAN_OR_EQUAL, 0.)
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_ALLIED_VICTORY, GREATER_THAN_OR_EQUAL, 0.)
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_GOLD_GATHERED, GREATER_THAN_OR_EQUAL, 0.)
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_GOLD_UPKEEP_RATE, GREATER_THAN_OR_EQUAL, 0.)
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_LUMBER_GATHERED, GREATER_THAN_OR_EQUAL, 0.)
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_LUMBER_UPKEEP_RATE, GREATER_THAN_OR_EQUAL, 0.)
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_NO_CREEP_SLEEP, GREATER_THAN_OR_EQUAL, 0.)
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_OBSERVER, GREATER_THAN_OR_EQUAL, 0.)
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_OBSERVER_ON_DEATH, GREATER_THAN_OR_EQUAL, 0.)
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_PLACED, GREATER_THAN_OR_EQUAL, 0.)
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_RESOURCE_FOOD_CAP, GREATER_THAN_OR_EQUAL, 0.)
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_RESOURCE_FOOD_USED, GREATER_THAN_OR_EQUAL, 0.)
call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN, 0.)
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_RESOURCE_HERO_TOKENS, GREATER_THAN_OR_EQUAL, 0.)
call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_RESOURCE_LUMBER, GREATER_THAN, 0.)
//call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_UNFOLLOWABLE, GREATER_THAN_OR_EQUAL, 0.)
call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_DEATH, null)
call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_SELL, null)
call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_PAWN_ITEM, null)
call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_TRAIN_START, null)
call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_TRAIN_CANCEL, null)
call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_CONSTRUCT_START, null)
call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_CONSTRUCT_CANCEL, null)
call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_RESEARCH_START, null)
call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_RESEARCH_CANCEL, null)
call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_UPGRADE_START, null)
call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_UPGRADE_CANCEL, null)
call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_HERO_REVIVE_START, null)
call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_HERO_REVIVE_CANCEL, null)
if (Human[p2].get != null) then
call TriggerRegisterPlayerChatEvent(t3, p2.get, "", false)
endif
set p2 = p2.next
exitwhen p2.end
endloop
call TriggerAddCondition(t, Condition(function thistype.anti))
call TriggerAddCondition(t2, Condition(function thistype.update))
call TriggerAddCondition(t3, Condition(function thistype.cheater))
static if ANTI_MANA then
set antiunit = CreateUnit(Human.first.get, ANTI_MH, WorldBounds.maxX, WorldBounds.maxY, 0)
call IssueImmediateOrder(antiunit, "immolation")
call TriggerRegisterUnitStateEvent(t4, antiunit, UNIT_STATE_MANA, GREATER_THAN, 12.)
call TriggerAddCondition(t4, Condition(function thistype.antimanac))
call UnitAddAbility(antiunit, 'Aloc')
call UnitAddAbility(antiunit, 'Aivs')
call UnitAddAbility(antiunit, 'Avul')
endif
static if ANTI_FOG then
set p = Human.first
loop
set antiunit = CreateUnit(p.get, ANTI_MH, WorldBounds.minX, WorldBounds.maxY, 0)
call TriggerRegisterUnitEvent(t5, antiunit, EVENT_UNIT_ATTACKED)
call SetUnitX(antiunit, WorldBounds.minX)
call SetUnitY(antiunit, WorldBounds.maxY)
set p = p.next
exitwhen p.end
endloop
set antiunit = CreateUnit(Players(12).get, ANTI_MH, WorldBounds.minX, WorldBounds.maxY, 0)
call TriggerRegisterUnitEvent(t5, antiunit, EVENT_UNIT_ATTACKED)
call SetUnitX(antiunit, WorldBounds.minX)
call SetUnitY(antiunit, WorldBounds.maxY)
call TriggerAddCondition(t5, Condition(function thistype.antifogc))
call PauseUnit(antiunit, true)
endif
static if ANTI_GOD then
set p = Human.first
loop
set antiunit = CreateUnit(p.get, ANTI_GOD, WorldBounds.minX, WorldBounds.minY, 0)
call TriggerRegisterUnitEvent(t6, antiunit, EVENT_UNIT_DEATH)
call SetUnitX(antiunit, WorldBounds.minX)
call SetUnitY(antiunit, WorldBounds.minY)
set p = p.next
exitwhen p.end
endloop
set antiunit = CreateUnit(Players(12).get, ANTI_GOD, WorldBounds.minX, WorldBounds.minY, 0)
call TriggerRegisterUnitEvent(t6, antiunit, EVENT_UNIT_DEATH)
call SetUnitX(antiunit, WorldBounds.minX)
call SetUnitY(antiunit, WorldBounds.minY)
call TriggerAddCondition(t6, Condition(function thistype.antigodc))
endif
call TimerStart(timestamp, 60, true, function thistype.timestamps)
endmethod
endstruct
struct Cheater extends array
public static method operator get takes nothing returns player
return AntiCheater.cheated
endmethod
public static method onCheat takes boolexpr bc returns nothing
call TriggerAddCondition(AntiCheater.cheats, bc)
endmethod
public static method operator endgame takes nothing returns boolean
return AntiCheater.endgame
endmethod
endstruct
endlibrary
JASS:
struct Tester extends array
private static method catch takes nothing returns boolean
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 100000, GetPlayerName(Cheater.get) + " has attempted to cheat!")
if (Cheater.endgame) then
//call EndGame(false) //game is ruined
elseif (GetLocalPlayer() == Cheater.get) then
//call EndGame(false)
endif
return false
endmethod
private static method onInit takes nothing returns nothing
call Cheater.onCheat(Condition(function thistype.catch))
endmethod
endstruct
Last edited: