1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Ride into the sunset with the 32nd Modeling Contest. The contest is optionally paired. Best of luck, people!
    Dismiss Notice
  4. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  5. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  6. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[JASS] AntiCheat Pack Thread =)

Discussion in 'Triggers & Scripts' started by Nestharus, Dec 7, 2010.

  1. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    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:
    Color Key
    Description
    Red
    Unfinished
    Yellow
    Half Finished
    Green
    Finished
    [c]Description

    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
    • Bug Update 1

      Fixed up gold/lumber tracking

    Code (vJASS):

    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[p] != bounty[p]) 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[p].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
     


    Code (vJASS):

    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: Dec 11, 2010
  2. Garfield1337

    Garfield1337

    Joined:
    Jul 6, 2009
    Messages:
    1,806
    Resources:
    4
    Maps:
    1
    Spells:
    3
    Resources:
    4
    This seems very useful.
    Maybe you can add blocker for vision cheats such as iseedeadpeople.

    Umm...when i activated a cheat,it didn't say my name as a cheater,it said:
    " has attempted to cheat" o_O
    Also,it didn't end game as it should for cheater,or i didn't set some global boolean to true? D:
     
  3. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    The update has the fix for that.

    With single player wc3 cheats, the name never gets registered, so I had to make a tweak.

    Name now shows up.

    lol
    Code (vJASS):

    if (cheated == null) then
        set cheated = Player(pid)
    endif
     


    I made the update 5 mins before your post : P

    I am planning to block every possible cheat from changing ownership of units to creating units to creating items to everything : ). I'm just starting with player states.

    The challenge with lumber/gold cheat detection was capturing trade events ; P.


    I need testers to try it with trading, selling, and etc to make sure this is stable ^^.
     
  4. DamneDD

    DamneDD

    Joined:
    Jan 3, 2010
    Messages:
    53
    Resources:
    0
    Resources:
    0
    If you complete this, it will be Legen— wait for it... Legen— wait for it... LEGENDARY!!!
     
  5. Lambdadelta

    Lambdadelta

    Joined:
    Jul 6, 2009
    Messages:
    721
    Resources:
    1
    Maps:
    1
    Resources:
    1
    AllYourBaseAreBelongToUs
    AllYourBaseAreBelongToUs
    AllYourBaseAreBelongToUs
    AllYourBaseAreBelongToUs
    AllYourBaseAreBelongToUs

    **Points at MSN conversation**
     
  6. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Actually, the overhead on a generic anti cheat pack would be rather insane. I'd prefer to think of using this for implementing anti cheat packs engineered for a specific map. When they are made for a specific map, the overhead drastically drops : ).

    For example, in an RPG, if you only ever control one unit, you can check for changes in unit ownership as well as created units. If a unit enters a map and is not the player's unit but belongs to the player, then the player cheated. Much simpler unit handle validation than would be required of a generic anti cheat pack : ).
     
  7. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    The whosyourdaddy shouldn't be hard enough to prevent. Use the old trick placing 2 dummy units, one owner is the single player and the other is neutral hostile with high hp reg. These are not visible but still the player's unit attacks the other one with a low damage. When cheat is turned on, the neutral hostile dies. Cheat detected. Simple Enough.

    You have darn many projects, where do you find time? :p
     
  8. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    That code is already in the system if you didn't notice : p

    Code (vJASS):

            static if ANTI_GOD then
                private static method antigodc takes nothing returns boolean
                    local unit antiunit
                   
                    call Cheat("whosyourdaddy") //disable
                   
                    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
     


    Code (vJASS):

                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
     


    : D

    The only thing is, it can't be placed out of camera bounds or it won't attack unless fog is disabled ;o, even if it has sight radius. As you see, I'm current placing at it at the map's edge, which resulted in it not working (didn't know why it didn't work until just now, I just realized this as I wrote this post).

    The thing was marked as red and disabled because I was totally lost as to why it was bugged, haha.


    And btw, Trade Event took me like 15 mins to code as the work was already done in this anti cheat pack.
     
  9. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    Ah I only saw it red :D

    Tested 1 unit from the map edge then? Else you can just create like a small blackspot in a corner or something. Doesn't need to be big at all as you can in matter of fact place the units on top of each other.
     
  10. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    The units are placed on top of each other ; P.

    Although, I don't understand why, when iseedeadpeople is entered, the top left units will hit each other, but the bot left, with visibility, still will not >.>.


    Changed to yellow
     
  11. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    hehe weird, have no idea why. You seem always like to bug the JASS language :D
     
  12. Lambdadelta

    Lambdadelta

    Joined:
    Jul 6, 2009
    Messages:
    721
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I think you should name the configurable globals (the NO_GOD, etc) according to their cheat name. So, NO_WHOSYOURDADDY = true, or WHOSYOURDADDY = true. True for allowed, false for disabled.
     
  13. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Er... this blocks the cheat + anything similar, so labeling it as the cheat isn't quite accurate.

    The ANTI_GOD var actually made perfect sense to me. Same with ANTI_FOG or w/e.
     
  14. Nightblade

    Nightblade

    Joined:
    Dec 15, 2009
    Messages:
    511
    Resources:
    0
    Resources:
    0
    Youre not doing TheDudeAbides?
     
  15. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Adding these cheats (just found them)
    • ihavethepower
    • thedudeabides
    • itvexesme
    • abrakadabra
     
  16. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,162
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    1, 2, and 4 I have never heard of. What do they do?
     
  17. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Look at the list in the first post.. they are at the top.
     
  18. Ceday

    Ceday

    Joined:
    Feb 22, 2010
    Messages:
    1,114
    Resources:
    0
    Resources:
    0
    There is no such a cheat ihavethepower or abrakadabra.
     
  19. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,930
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    This is rather pointless. Everyone knows the best cheats is to just modify the map script and there is no code that can prevent you doing so...
     
  20. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Er, this prevents the cheats as well as any manipulations similar to them... this means that the person would have to disable the anti-cheat pack to get their stuff to work.

    You can do various levels of protection to make it extremely difficult. Each level of protection may only take 10 seconds to implement, but require hours to disable.

    Protections would work off of layered values. Starting new protections would be easy and adding layers would also be easy. Every single layer would have to be undone from the top to the bottom.

    I only find this to be useful on maps with save/load features.