Raised This Month: $ Target: $400
 0% 

[L4D & L4D2]Witch fixes[Left 4 Fix]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Plugin ID:
6510
Plugin Version:
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    936 
    Plugin Description:
    Witch fixes!
    Old 04-10-2019 , 16:38   [L4D & L4D2]Witch fixes[Left 4 Fix]
    Reply With Quote #1

    Witch fixes stuff apart of Left 4 Fix.
    https://github.com/LuxLuma/Left-4-fi...04%20fix/witch

    Huge thanks to silvers in helping me learn alot of stuff about disassembly, IDA, memory patching and finding windows signatures.
    Thanks Dragokas for testing L4D1 Linux.
    Thanks fbef0102 for making L4D1 version of witch_allow_in_safezone.



    Code:
    [L4D2]Witch_Double_Startle_Fix
     - Fixes witch when wandering playing startle twice by forcing the NextThink to end the startle.
    
    ------------------------------------------------------------------------------------------------------
    witch_allow_in_safezone
     - Allows witches to chase victims into safezones.
    
     - Extra Requirements
     - - [DHooks (Experimental Dynamic Detour support)](https://forums.alliedmods.net/showth...86#post2588686)
    
    ------------------------------------------------------------------------------------------------------
    witch_prevent_target_loss
    -Prevents the witch from randomly loosing target.
    
    Note:
    When used with witch_target_partch the witch will still target you over team changes, whenever Dhooks is updated with object returns I can test my fix idea.
    
    ------------------------------------------------------------------------------------------------------
    witch_target_patch
     - Fixes witch going after wrong clone survivor


    Installation:
    1.Download the .zip files.
    2.Choose What fixes to install files are named accordingly inside .zip file.
    3.Open chosen files and move contents to "/addons/sourcemod" folder.
    4.Restart the server.
    Attached Files
    File Type: zip witch_fixes.zip (54.6 KB, 438 views)
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D

    Last edited by Lux; 05-29-2024 at 23:04. Reason: updated gamedata for l4d1 update
    Lux is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 07-26-2019 , 09:47   Re: [L4D2]Witch fixes[Left 4 Fix]
    Reply With Quote #2

    Very Useful, and I went to your Left-4-fix/left 4 fix/witch/ github
    I saw you made many fix about witch.
    And one fix I'm very interesting.
    Sorry to bother you, do you have plan to do witch_allow_in_safezone.smx for left 4 dead 1?
    __________________
    HarryPotter is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 07-27-2019 , 01:37   Re: [L4D2]Witch fixes[Left 4 Fix]
    Reply With Quote #3

    Not really in l4d2 there is a function that got added to

    Code:
    WitchLocomotion::IsAreaTraversable()
        CDirector::AllowWitchesInCheckpoints()
    l4d1 there is no AllowWitchesInCheckpoints this was added for l4d2 i don't play l4d1 if it were easy enough for me to add support for l4d1 i would.

    If you want to do it for your self my guess would be to
    Detour WitchLocomotion::IsAreaTraversable() and check if the survivor is in the safezone nav area and just Set the return to true.


    Ill have a look into no promises
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D

    Last edited by Lux; 07-27-2019 at 01:46.
    Lux is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 07-27-2019 , 06:08   Re: [L4D2]Witch fixes[Left 4 Fix]
    Reply With Quote #4

    Quote:
    Originally Posted by Lux View Post
    Code:
    WitchLocomotion::IsAreaTraversable()
        CDirector::AllowWitchesInCheckpoints()
    l4d1 there is no AllowWitchesInCheckpoints this was added for l4d2 i don't play l4d1 if it were easy enough for me to add support for l4d1 i would.

    If you want to do it for your self my guess would be to
    Detour WitchLocomotion::IsAreaTraversable() and check if the survivor is in the safezone nav area and just Set the return to true.
    I will do it by myself and see if it works ,thanks
    __________________
    HarryPotter is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 07-27-2019 , 08:14   Re: [L4D2]Witch fixes[Left 4 Fix]
    Reply With Quote #5

    Code:
    WitchLocomotion::IsAreaTraversable()
    In left4dead1 it really works in linux. It autually allows witches to chase survivor into saferoom!!
    wow! what the wonderful fix!!!!!
    However, there's a problem, I'm sorry, did not know where to find the windows signature
    PHP Code:
    "Games"
    {
        
    "left4dead"
        
    {
            
    "Functions"
            
    {
                
    "WitchLocomotion::IsAreaTraversable"
                
    {
                    
    "signature"  "WitchLocomotion::IsAreaTraversable"
                    "callconv"  "thiscall"
                    "return"  "bool"
                    "this"  "ignore"
                
    }
            }
            
    "Signatures"
            
    {
                
    "WitchLocomotion::IsAreaTraversable"
                
    {
                    
    "library"        "server"
                    "linux"        "@_ZNK15WitchLocomotion17IsAreaTraversableEPK8CNavArea"
                    "windows"        "??????????????"
                
    }
            }
        }

    __________________

    Last edited by HarryPotter; 07-27-2019 at 08:14.
    HarryPotter is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 07-27-2019 , 16:49   Re: [L4D2]Witch fixes[Left 4 Fix]
    Reply With Quote #6

    Quote:
    Originally Posted by fbef0102 View Post
    Code:
    WitchLocomotion::IsAreaTraversable()
    In left4dead1 it really works in linux. It autually allows witches to chase survivor into saferoom!!
    wow! what the wonderful fix!!!!!
    However, there's a problem, I'm sorry, did not know where to find the windows signature
    PHP Code:
    "Games"
    {
        
    "left4dead"
        
    {
            
    "Functions"
            
    {
                
    "WitchLocomotion::IsAreaTraversable"
                
    {
                    
    "signature"  "WitchLocomotion::IsAreaTraversable"
                    "callconv"  "thiscall"
                    "return"  "bool"
                    "this"  "ignore"
                
    }
            }
            
    "Signatures"
            
    {
                
    "WitchLocomotion::IsAreaTraversable"
                
    {
                    
    "library"        "server"
                    "linux"        "@_ZNK15WitchLocomotion17IsAreaTraversableEPK8CNavArea"
                    "windows"        "??????????????"
                
    }
            }
        }

    Hey nice job on getting it working, ill try and get windows signiture for you later and post it.
    Nice work on trying and getting it to work.
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 07-27-2019 , 18:20   Re: [L4D2]Witch fixes[Left 4 Fix]
    Reply With Quote #7

    Hello fbef0102 i think i found it

    PHP Code:
    "Games"
    {
        
    "left4dead"
        
    {
            
    "Functions"
            
    {
                
    "WitchLocomotion::IsAreaTraversable"
                
    {
                    
    "signature"  "WitchLocomotion::IsAreaTraversable"
                    "callconv"  "thiscall"
                    "return"  "bool"
                    "this"  "ignore"
                
    }
            }
            
    "Signatures"
            
    {
                
    "WitchLocomotion::IsAreaTraversable"
                
    {
                    
    "library"        "server"
                    "linux"        "@_ZNK15WitchLocomotion17IsAreaTraversableEPK8CNavArea"
                    "windows"        "\x2A\x2A\x2A\x2A\x2A\x2A\x6A\x00\x8B\xF1\x6A\x03\x8B\x2A\x2A\x2A\x2A\x2A\x2A\x84"
                
    }    /*    ? ? ? ? ? ? 6A 00 8B F1 6A 03 8B ? ? ? ? ? ? 84 */
            
    }
        }

    Enjoy let me know if it does not work.
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 07-28-2019 , 10:28   Re: [L4D2]Witch fixes[Left 4 Fix]
    Reply With Quote #8

    Quote:
    PHP Code:
    "windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x6A\x00\x8B\xF1\x6A\x03\x8B\x2A\x2A\x2A\x2A\x2A\x2A\x84" 
    Enjoy let me know if it does not work.
    well when witch spawns , error occurs and servrer crashes
    Code:
    [DHOOKS] FATAL: Failed to find return address of original function. Check the arguments and return type of your detour setup.
    PHP Code:
    public void OnPluginStart()
    {
        
    Handle hGamedata LoadGameConfigFile(GAMEDATA);
        if(
    hGamedata == null
            
    SetFailState("Failed to load \"%s.txt\" gamedata."GAMEDATA);
        
        
    Handle hDetour;
        
    hDetour DHookCreateFromConf(hGamedata"WitchLocomotion::IsAreaTraversable");
        if(!
    hDetour)
            
    SetFailState("Failed to find \"WitchLocomotion::IsAreaTraversable\" signature.");
            
        if(!
    DHookEnableDetour(hDetourtrueAllowWitchesInCheckpoints))
            
    SetFailState("Failed to detour \"WitchLocomotion::IsAreaTraversable\".");
        
        
    delete hGamedata;
    }

    public 
    MRESReturn AllowWitchesInCheckpoints(Handle hReturn)
    {
        
    DHookSetReturn(hReturntrue);
        return 
    MRES_Override;

    __________________

    Last edited by HarryPotter; 07-28-2019 at 10:30.
    HarryPotter is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 07-28-2019 , 15:04   Re: [L4D2]Witch fixes[Left 4 Fix]
    Reply With Quote #9

    You want to fill in all the infomation for detours best you can, i think the nav area's are just ints as for the return looks like a bool to me.

    PHP Code:
            "Functions"
            
    {
                
    "WitchLocomotion::IsAreaTraversable"
                
    {
                    
    "signature"  "WitchLocomotion::IsAreaTraversable"
                    "callconv"  "thiscall"
                    "return"  "bool"
                    "this"  "ignore"
                    "arguments"
                    
    {
                        
    "NavArea"
                        
    {
                            
    "type"    "int"
                        
    }
                    }
                }
            } 
    Windows can be a real pain sometimes
    PHP Code:
    56 57 8B 7C 24 0C 6A 00 8B F1 
    \x56\x57\x8B\x7C\x24\x0C\x6A\x00\x8B\xF1 
    That is the function not wildcarded need to wildcarde the first 6bytes so other hooks can be hooked onto it.
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 07-29-2019 , 06:26   Re: [L4D2]Witch fixes[Left 4 Fix]
    Reply With Quote #10

    Quote:
    Originally Posted by Lux View Post
    Windows can be a real pain sometimes
    PHP Code:
    56 57 8B 7C 24 0C 6A 00 8B F1 
    \x56\x57\x8B\x7C\x24\x0C\x6A\x00\x8B\xF1 
    That is the function not wildcarded need to wildcarde the first 6bytes so other hooks can be hooked onto it.
    Great job, Lux
    I test in l4d1 linux and windows and it works without any errors
    Thanks!
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d1_witch_allow_in_safezone.sp - 589 views - 2.2 KB)
    File Type: txt witch_allow_in_safezone.txt (931 Bytes, 652 views)
    __________________

    Last edited by HarryPotter; 07-29-2019 at 06:26.
    HarryPotter is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 05:04.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode