AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2]RandomWitch/LMC_RandomWitch +12 Models(Updated 01/03/2017) (https://forums.alliedmods.net/showthread.php?t=278167)

Lux 01-26-2016 06:22

[L4D2]RandomWitch/LMC_RandomWitch +12 Models(Updated 01/03/2017)
 
2 Attachment(s)
Hey Not really sure why no one has done this before but well i'm doing it :D

I did infact get the Real Witch_Bride to spawn but when ever you startle her she forces a panic event


but well model is good enough it comes with the music too.:twisted:

PHP Code:

"RandomWitch"PLUGIN_VERSION"Version of RandomWitch"

"RW_Enable"
"1""Should We Enable Random Witch" 

Anybug?

///////////////////////////////////////////////////////////////////////////////////////////////////////


PHP Code:

// This file was auto-generated by SourceMod (v1.9.0.6056)
// ConVars for plugin "LMC_RandomWitch.smx"


// Should We Enable Random Witch
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
lmc_randomwitch "1"

// Chance out of 100 to have a overlay model, (0, 100)
// -
// Default: "25"
// Minimum: "0.000000"
// Maximum: "100.000000"
lmc_randomwitchchance "25" 

LMC_RandomWitch release
Note you can use both of these plugins together.

Requirement:
Lux's Model Changer
Module required:LMCCore
Optional For ragdoll deaths:
LMCEDeathHandler
//////////////////////////////////////////////////////////////////////////////////////////////////////

Sev 01-28-2016 09:13

Re: [L4D2]RandomWitch
 
Neat idea.

I'd be interested in the idea being expanded upon with the witch randomly walking or sitting at will. Perhaps even the witch getting up and follow survivors if they get too close.

kochiurun119 01-29-2016 05:49

Re: [L4D2]RandomWitch
 
Can you make plugin for tank(Model tank l4d and model tank l4d2) for l4d2? L4d2 have 2 model tank too!

Lux 01-29-2016 08:22

Re: [L4D2]RandomWitch
 
Quote:

Originally Posted by Sev (Post 2387569)
Neat idea.

I'd be interested in the idea being expanded upon with the witch randomly walking or sitting at will. Perhaps even the witch getting up and follow survivors if they get too close.

I'm Kinda not sure what you mean, like the witch does that anyway you can change the time of day to force her to sit or walk on anymap

tank_spawn

also does anyone know if the tank_spawn event is fired more than once if the tank gets passed?

Lux 03-01-2017 01:00

Re: [L4D2]RandomWitch
 
LMC_RandomWitch release
Note you can use both of these plugins together.

You don't nee the include to compile, but it's there if you want to make something :D

Besure to checkout L4D2ModelChanger

hoanganh81097 08-12-2018 21:24

Re: [L4D2]RandomWitch/LMC_RandomWitch +12 Models(Updated 01/03/2017)
 
if i add more custom model witch, do i have a IsModelPrecached ?

Spirit_12 08-12-2018 23:38

Re: [L4D2]RandomWitch/LMC_RandomWitch +12 Models(Updated 01/03/2017)
 
1 Attachment(s)
What sort of panic event does it start? Can it not be blocked? If it is SpawnITMob function, which is used for Boomer horde and Car alarms then I can block it. Run the following plugin and check the messages, alter the cvars to see, if they block the event.

PHP Code:


#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>
#include <dhooks>

#define GAMEDATA            "left4downtown.l4d2"
#define PLUGIN_VERSION         "1.0"

ConVar cvar_mob_count;
ConVar cvar_mobit_count;

public 
Plugin myinfo =
{
    
name "Spawn mob and Spawn IT mob",
    
author "$atanic $pirit",
    
description "Adds a hook for mob spawns",
    
version PLUGIN_VERSION,
    
url ""
}

public 
void OnPluginStart()
{
    
CreateConVar("mob_spawn_version"PLUGIN_VERSION""FCVAR_NOTIFY|FCVAR_DONTRECORD);
    
cvar_mob_count        =    CreateConVar"count_mob""0",        "Mob count to spawn!");
    
cvar_mobit_count    =    CreateConVar"count_mobit""0",    "MobIT count to spawn!");

    
Handle hGamedata LoadGameConfigFile(GAMEDATA);
    if( 
hGamedata == null 
        
SetFailState("Failed to load \"%s.txt\" gamedata."GAMEDATA);
        
    
// ====================================================================================================
    // Detour    -    ZombieManager::SpawnMob
    // ====================================================================================================
    
    
Handle hDetour_SpawnMob DHookCreateDetour(Address_NullCallConv_THISCALLReturnType_VoidThisPointer_Ignore);
    if( !
hDetour_SpawnMob )
        
SetFailState("Failed to setup detour for hDetour_SpawnMob");
    
    
// Load the address of the function from gamedata file.
    
if (!DHookSetFromConf(hDetour_SpawnMobhGamedataSDKConf_Signature"Zombiemanager_SpawnMob"))
        
SetFailState("Failed to find \"ZombieManager::SpawnMob\" signature.");

    
// Add all parameters.
    
DHookAddParam(hDetour_SpawnMobHookParamType_Int);


    
// Add a pre hook on the function.
    
if (!DHookEnableDetour(hDetour_SpawnMobfalseDetour_OnSpawnMob))
        
SetFailState("Failed to detour OnSpawnMob.");
        
    
// And a post hook.
    
if (!DHookEnableDetour(hDetour_SpawnMobtrueDetour_OnSpawnMob_Post))
        
SetFailState("Failed to detour OnSpawnMob post.");
        
    
// ====================================================================================================
    // Detour    -    ZombieManager::SpawnITMob
    // ====================================================================================================
    
    
Handle hDetour_SpawnITMob DHookCreateDetour(Address_NullCallConv_THISCALLReturnType_VoidThisPointer_Ignore);
    if( !
hDetour_SpawnITMob )
        
SetFailState("Failed to setup detour for hDetour_SpawnITMob");
    
    
// Load the address of the function from gamedata file.
    
if (!DHookSetFromConf(hDetour_SpawnITMobhGamedataSDKConf_Signature"Zombiemanager_SpawnITMob"))
        
SetFailState("Failed to find \"ZombieManager::SpawnITMob\" signature.");

    
// Add all parameters.
    
DHookAddParam(hDetour_SpawnITMobHookParamType_Int);


    
// Add a pre hook on the function.
    
if (!DHookEnableDetour(hDetour_SpawnITMobfalseDetour_OnSpawnITMob))
        
SetFailState("Failed to detour OnSpawnITMob.");
        
    
// And a post hook.
    
if (!DHookEnableDetour(hDetour_SpawnITMobtrueDetour_OnSpawnITMob_Post))
        
SetFailState("Failed to detour OnSpawnITMob post.");
}


// ====================================================================================================
// Function    -    ZombieManager::SpawnMob
// ====================================================================================================

public MRESReturn Detour_OnSpawnMob(Handle hParam)
{
    
int param1 DHookGetParam(hParam1);
    
//int client = SDKCall(hGetPlayerSlot, pThis) + 1; 
    
PrintToChatAll("Detour_OnSpawnMob_pre called on %d"param1);
    
    if(
cvar_mob_count.IntValue)
    {
        
DHookSetParam(hParam1cvar_mob_count.IntValue);
        return 
MRES_ChangedOverride;
    }
    return 
MRES_Ignored;
}

public 
MRESReturn Detour_OnSpawnMob_Post(Handle hParam)
{
    
int param1 DHookGetParam(hParam1);
    
PrintToChatAll("Detour_OnSpawnMob_Post called on %d"param1);
    return 
MRES_Ignored;
}

// ====================================================================================================
// Function    -    ZombieManager::SpawnITMob
// ====================================================================================================
    
public MRESReturn Detour_OnSpawnITMob(Handle hParam)
{
    
int param1 DHookGetParam(hParam1);
    
PrintToChatAll("Detour_OnSpawnITMob_pre called on %d"param1);
    
    if(
cvar_mobit_count.IntValue)
    {
        
DHookSetParam(hParam1cvar_mobit_count.IntValue);
        return 
MRES_ChangedOverride;
    }
    return 
MRES_Ignored;
}

public 
MRESReturn Detour_OnSpawnITMob_Post(Handle hParam)
{
    
int param1 DHookGetParam(hParam1);
    
PrintToChatAll("Detour_OnSpawnITMob_Post called on %d"param1);
    return 
MRES_Ignored;



Lux 08-13-2018 08:03

Re: [L4D2]RandomWitch/LMC_RandomWitch +12 Models(Updated 01/03/2017)
 
I'm not sure why you posted that here xD
Was this ment to be on a different thread?

Spirit_12 08-13-2018 13:51

Re: [L4D2]RandomWitch/LMC_RandomWitch +12 Models(Updated 01/03/2017)
 
Quote:

Originally Posted by Lux (Post 2386660)
I did infact get the Real Witch_Bride to spawn but when ever you startle her she forces a panic event

You stated it starts a panic event every time you startle her. Was pointing out a way to avoid that scenario.

I had just finished hooking those 2 functions. Just wanted to see if they can be used.

hoanganh81097 08-13-2018 15:10

Re: [L4D2]RandomWitch/LMC_RandomWitch +12 Models(Updated 01/03/2017)
 
Can make this plugin for Common Infected ? :D


All times are GMT -4. The time now is 15:49.

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