Welcome to the work f o r c e !

This is where i keep some of my stuff. It will be expanded upon over time.

More, fancier prefabs should be set up eventually.

Hang around, you may find something special.

 

   LINKS:

       Steam

       Gamebanana

       Patreon

       Discord: luffaren

       Youtube

       Email

       Bodygroup Calculator

       ze_collective

================================================================

    CSGO hammer prefabs:

        AutoRatioSlay

              a .nut script which auto-slays CT's when a specific ct/t player ratio is met

              read the included .nut file for more information

 

        NutEnt

              A script+prefab package allowing you to hot-spawn ents via a global vscript function

              You can easily add/remove the entity-classes available for spawning in the prefab .vmf

              It also includes some extra general-purpose helper functions

 

        PackBSP

              A simple .bat-file .bsp packer, you simply drag+drop a .bsp into it.

              It packs everything within the 'csgo' folder that's next to the .bsp file.

 

        VtfOptimizer

              An app that handles mass-resizing .vtf files with a max-size-cap and a DXT1/DXT5 toggle.

              Can be used to reduce filesize on maps, just read the included instructions and save backups/be careful.

 

        levelsystem

              A copy+paste prefab for an easy-to-use level system, also including an example .vmf to help you understand it.

              It supports up to 16 stages as it uses a logic_case.

 

        moving_npc

              A barebones physbox+thruster npc base that picks a random CT-target every X seconds and then moves towards the target.

              This is by no means a complete system, but rather a base to start working your own NPC from.

 

        weapon_handler

              A standalone script to handle keeping the targetname of weapons + detecting when a weapon has been dropped.

              Just add the .nut to the "Entity Scripts" property of any weapon-entity and it'll work automatically.

 

================================================================

    CSGO plugins:

        luffarenmaps_v1_8

              This plugin allows for instant Vscript-based hotfixes, QoL-tweaks, special events and VIP/patron-updates for Luffaren-maps.

              The Vscripts are set up/managed by Luffaren centrally, and can be previewed below (in "CSGO Vscript configs").

              If a Vscript config exists for the current map on the server, it will load in once as the map starts.

 

================================================================

    CSGO Vscript configs:

        ze_best_korea_v1

        ze_castlevania_p1_7

        ze_collective_v1_9

        ze_crazykart_v4

        ze_diddle_v3

        ze_eternal_grove_v3

        ze_frostdrake_tower_v1

        ze_magmadrake_b5

        ze_pizzatime_v9

        ze_predator_ultimate_p7

        ze_santassination_v3

        ze_toaster_p3

     These Vscript configs gets loaded in through the LuffarenMaps plugin as the map starts. Click on them to view a preview of the code below.

================================================================

--------------------------------------------------------------------------------------------------------

//============[ NOTE: permanent script scope ]============\\

scinit<-false;CDATA<-[];function InitializeScriptValidate(){if(!scinit)//Safety wrapper to retry loading the Vscript

{printl("[LuffarenMaps] Vscript ERROR - script not initialized!");if(Entities.FindByName(null,"luffarenmapsplugin_reload")==null)

{local e=Entities.CreateByClassname("info_target");e.__KeyValueFromString("targetname","luffarenmapsplugin_reload");}}}

EntFireByHandle(self,"RunScriptCode"," InitializeScriptValidate(); ",5.00,null,null);

//Called once when the script is initialized/reloaded

function Initialize()

{

    if(scinit)return;scinit=true;printl("[LuffarenMaps] Vscript initialized!");

    local h = null;while(null!=(h=Entities.FindByName(h,"luffarenmapsplugin_reload")))

    {EntFireByHandle(h,"Kill","",0.00,null,null);}if(Entities.FindByName(null,"luffarenmapsplugin_success")==null)

    {local e = Entities.CreateByClassname("info_target");e.__KeyValueFromString("targetname","luffarenmapsplugin_success");}

    EntFireByHandle(self,"RunScriptCode"," InitializeCDATA(); ",0.01,null,null);

    EntFireByHandle(self,"RunScriptCode"," RoundStart(true); ",0.02,null,null);

    //XXXXXXXXXXXXXXX>   init code goes here...

}

//Called once every round start (also just after 'Initialize' has been called)

function RoundStart(justinitalized=false)

{

    printl("[LuffarenMaps] Vscript RoundStart() called!");

    //XXXXXXXXXXXXXXX>   roundstart code goes here (bool:justinitalized)...

    EntFireByHandle(self,"RunScriptCode"," RevertPlayerModelScale(); ",0.50,null,null);

    EntFireByHandle(self,"RunScriptCode"," PreventDelayAct1(); ",10.00,null,null);

    EntFireByHandle(self,"RunScriptCode"," FixAct3ShortcutFuck(); ",15.00,null,null);

    EntFireByHandle(self,"RunScriptCode","MiscFixes();",0.77,null,null);

    EntFire("s3_start_z_surfprotect","AddOutput","OnStartTouch !activator:RunScriptCode:self.SetVelocity(Vector());:0.10:-1",5.00,null);

    EntFire("s3_gate_upper","AddOutput","OnOpen server:Command:sv_airaccelerate 12:0.10:1",5.00,null);

    EntFire("s3_elevator","AddOutput","OnFullyOpen server:Command:sv_airaccelerate 12:0.10:1",5.00,null);

    EntFire("s3_elevator","AddOutput","OnFullyOpen server:Command:sv_airaccelerate 12:1.10:1",5.00,null);

    EntFire("s3_elevator","AddOutput","OnFullyOpen server:Command:sv_airaccelerate 12:3.10:1",5.00,null);

    EntFire("s3_elevator","AddOutput","OnFullyOpen server:Command:sv_airaccelerate 12:5.10:1",5.00,null);

    EntFire("s3_elevator","AddOutput","OnFullyOpen server:Command:sv_airaccelerate 12:10.10:1",5.00,null);

    EntFire("s3_elevator","AddOutput","OnFullyOpen server:Command:sv_airaccelerate 12:15.10:1",5.00,null);

    EntFire("s3_elevator","AddOutput","OnFullyOpen server:Command:sv_airaccelerate 12:20.10:1",5.00,null);

    EntFire("s3_postpringle_door","AddOutput","OnFullyOpen server:Command:sv_airaccelerate 100:0.10:1",5.00,null);

    EntFire("s3_postpringle_door","AddOutput","OnFullyOpen server:Command:sv_airaccelerate 100:5.10:1",5.00,null);

    EntFire("s3_space_door","AddOutput","OnFullyOpen server:Command:sv_airaccelerate 12:0.10:1",5.00,null);

    EntFire("s3_space_door","AddOutput","OnFullyOpen server:Command:sv_airaccelerate 12:5.10:1",5.00,null);

    EntFire("s3_space_door","AddOutput","OnFullyOpen server:Command:sv_airaccelerate 12:10.10:1",5.00,null);

}

function RevertPlayerModelScale()

{

    EntFireByHandle(self,"RunScriptCode"," RevertPlayerModelScale(); ",0.50,null,null);

    EntFire("player","AddOutput","modelscale 1.0",0.00,null);

}

//Called once when the script is initialized/validated

function DateTimeReceived(datetime)

{

    printl("[LuffarenMaps] Vscript Datetime received! ("+datetime+")");

    //XXXXXXXXXXXXXXX>   DateTime code goes here (string:datetime "YYYY-MM-DD-MM-SS")...

}

//Called once when the script is initialized/validated

function ServerInfoReceived(info)

{

    printl("[LuffarenMaps] Vscript ServerInfo received! ("+info+")");

    //XXXXXXXXXXXXXXX>   ServerInfo code goes here (string:info "serverIP-serverNAME")...

}

//Called once when the script is initialized/validated

function InitializeCDATA()

{

    local man = Entities.FindByName(null,"mapmanager");

    if(man==null||!man.IsValid())

        return;

    man.ValidateScriptScope();

    local sc = man.GetScriptScope();

    if(!("PATRONS" in sc))

        return;

    foreach(data in CDATA)

    {

        if(data.len()<=0)continue;local dds="";foreach(dd in data){dds=dds+"|"+dd;}dds=dds+"|";

        printl("[LuffarenMaps] Vscript CustomData loaded! ("+dds+")");

        if(data[0]=="VIP" && data.len()>1)

            {sc.PATRONS.clear();for(local i=1;i<data.len();i++){sc.PATRONS.push(data[i]);}}

    }

}

mapman<-null;

//Called every time a client is validated/connected with name, userid and steamid

function ClientValidated(userid,steamid,name)

{

    userid = userid.tointeger();

    local s = [];for(local i=0;i<steamid.len();i++)

    {

        local ceil = 1+i;if(ceil>steamid.len())break;

        local c = steamid.slice(i,ceil);if(c=="c")c=":";s.push(c);

    }

    steamid = "";foreach(ss in s)steamid = steamid+ss;

    printl("[LuffarenMaps] Vscript client validated! ("+userid.tostring()+"|"+steamid+"|"+name+")");

    if(mapman==null||!mapman.IsValid())

    {

        mapman = Entities.FindByName(null,"mapmanager");

        if(mapman==null||!mapman.IsValid())

            return;

    }

    mapman.ValidateScriptScope();

    local sc = mapman.GetScriptScope();

    local pc = sc.GetPlayerClassBySteamID(steamid);

    if(pc==null)pc = sc.GetPlayerClassByUserID(userid);

    if(pc!=null)

    {

        pc.steamid = steamid;

        pc.name = name;

        pc.userid = userid;

    }

    else 

        sc.PLAYERS.push(sc.Player(userid,steamid,name));

    if(steamid=="STEAM_1:1:22521282")

        sc.MASTER = userid;

}

// This changes a handful of things:

// - prevents non-mother zombies from getting to 'juicy' areas early on, for those who inflate

// - adds some delay prevention spots

// - adds an anti-boost trigger

// - makes the walla-walla puzzle not reset for the same people twice, to circumvent puzzle-trolling

::GetDistance<-function(v1,v2){return sqrt((v1.x-v2.x)*(v1.x-v2.x)+(v1.y-v2.y)*(v1.y-v2.y)+(v1.z-v2.z)*(v1.z-v2.z));}

function MiscFixes()

{

    if(!("WALLA_OFFENDER" in this))::WALLA_OFFENDER <- [];

    local sc = Entities.FindByName(null,"mapmanager").GetScriptScope();

    sc.mf_mz_found <- false;

    sc.mf_MZLIST <- [];

    sc.mf_TickMZ <- function()

    {

        if(mf_mz_found)return;

        EntFire("mapmanager","RunScriptCode","mf_TickMZ();",0.03,null);

        for(local h;h=Entities.FindByClassname(h,"player");)

        {

            if(h==null||!h.IsValid())continue;

            if(h.GetHealth() > 1004)

            {

                mf_mz_found = true;

                mf_MZLIST.push(h);

                continue;

            }

        }

        if(mf_mz_found)

        {

            printl("----------------------------------");

            printl("MOTHER ZOMBIES FOUND: ");

            foreach(mz in mf_MZLIST){printl("     "+mz);}

            printl("----------------------------------");

        }

    }

    sc.mf_MZ_SPOTS <- [

            {    pos=Vector(350,-3956,50),        radius=350,        vel=Vector(300,-200,-50)    },

            {    pos=Vector(481,-10070,-381),    radius=300,        vel=Vector(-200,-300,-50)    },

        ];

    sc.mf_TickMZ_SPOTS <- function()

    {

        EntFire("mapmanager","RunScriptCode","mf_TickMZ_SPOTS();",0.40,null);

        foreach(spot in mf_MZ_SPOTS)

        {

            for(local h;h=Entities.FindByClassnameWithin(h,"player",spot.pos,spot.radius);)

            {

                if(h==null||!h.IsValid()||h.GetTeam()!=2||h.GetHealth()<=0)continue;

                local is_mz = false;

                foreach(mz in mf_MZLIST){if(h==mz){is_mz=true;break;}}

                if(is_mz)continue;

                h.SetVelocity(spot.vel);

            }

        }

    }

    sc.mf_WallaDelay <- function()

    {

        for(local h;h=Entities.FindByClassnameWithin(h,"player",Vector(14094,5242,0),2000);)

        {

            if(h==null||!h.IsValid()||h.GetTeam()!=3||h.GetHealth()<=0)continue;

            EntFireByHandle(h,"SetDamageFilter","",0.00,null,null);

            EntFireByHandle(h,"SetHealth","-1",0.00,null,null);

            EntFireByHandle(h,"SetDamageFilter","",0.02,null,null);

            EntFireByHandle(h,"SetHealth","-1",0.05,null,null);

        }

    }

    sc.mf_RockDelay <- function()

    {

        EntFire("mapmanager","RunScriptCode","mf_RockDelay();",2.00,null);

        for(local h;h=Entities.FindByClassnameWithin(h,"player",Vector(6056,1580,-400),430);)

        {

            if(h==null||!h.IsValid()||h.GetTeam()!=3||h.GetHealth()<=0)continue;

            h.SetVelocity(Vector(0,1000,251));

        }

    }

    sc.mf_BushDelay <- function()

    {

        for(local h;h=Entities.FindByClassnameWithin(h,"player",Vector(972,2385,542),1000);)

        {

            if(h==null||!h.IsValid()||h.GetTeam()!=3||h.GetHealth()<=0)continue;

            EntFireByHandle(h,"SetDamageFilter","",0.00,null,null);

            EntFireByHandle(h,"SetHealth","-1",0.00,null,null);

            EntFireByHandle(h,"SetDamageFilter","",0.02,null,null);

            EntFireByHandle(h,"SetHealth","-1",0.05,null,null);

        }

    }

    EntFire("mapmanager","RunScriptCode","mf_RockDelay();",0.05,null);

    EntFire("mapmanager","RunScriptCode","mf_TickMZ();",0.05,null);

    EntFire("mapmanager","RunScriptCode","mf_TickMZ_SPOTS();",0.05,null);

    EntFire("walla_manager","AddOutput","OnTrigger mapmanager:RunScriptCode:mf_WallaDelay();:10:1",12.00,null);

    EntFire("forest_bloon_prepredoor","AddOutput","OnFullyOpen mapmanager:RunScriptCode:mf_BushDelay();:10:1",12.00,null);

    sc = Entities.FindByName(null,"walla_manager").GetScriptScope();

    sc.Hit <- function(index)

    {

        if(active&&!cooldown&&activator!=null&&activator.IsValid()&&activator.GetClassname()=="player"&&activator.GetHealth()>0)

        {

            cooldown = true;

            EntFireByHandle(self,"RunScriptCode"," cooldown = false; ",0.02,null,null);

            if(index==(1+order)||index==6&&order==6)

            {

                if(index==9)

                {

                    active = false;

                    active2 = false;

                    EntFire("walla_s_win","PlaySound","",0.50,null);

                    SPEED = 30;

                    RADIUS_CAP = 10000;

                    EntFireByHandle(self,"RunScriptCode"," stop = true; ",5.00,null,null);

                    EntFireByHandle(self,"RunScriptCode"," ColorButtons(255,255,0); ",0.00,null,null);

                    EntFireByHandle(self,"RunScriptCode"," ColorButtons(255,255,0); ",0.21,null,null);

                    EntFireByHandle(self,"RunScriptCode"," ColorButtons(255,255,0); ",0.50,null,null);

                    EntFireByHandle(self,"FireUser4","",0.00,null,null);

                }

                order++;

                if(index==1)EntFire("walla_s_ooh","PlaySound","",0.00,null);

                else if(index==2)EntFire("walla_s_eeh","PlaySound","",0.00,null);

                else if(index==3)EntFire("walla_s_ohahah","PlaySound","",0.00,null);

                else if(index==4)EntFire("walla_s_ting","PlaySound","",0.00,null);

                else if(index==5)EntFire("walla_s_tang","PlaySound","",0.00,null);

                else if(index==6)EntFire("walla_s_walla","PlaySound","",0.00,null);

                else if(index==8)EntFire("walla_s_bing","PlaySound","",0.00,null);

                else if(index==9)EntFire("walla_s_bang","PlaySound","",0.00,null);

                EntFireByHandle(caller,"Color","255 255 0",0.00,null,null);

                EntFireByHandle(caller,"Color","255 255 255",0.20,null,null);

            }

            else

            {

                local is_walla_offender = false;

                foreach(w in ::WALLA_OFFENDER)

                {

                    local pc = Entities.FindByName(null,"mapmanager").GetScriptScope().GetPlayerClassByHandle(activator);

                    if(activator==w.handle || pc != null && w.pc == pc)

                    {

                        is_walla_offender=true;

                        break;

                    }

                }

                if(is_walla_offender)

                {

                    EntFireByHandle(activator,"SetHealth","0",0.00,null,null);

                    return;

                }

                local pc = Entities.FindByName(null,"mapmanager").GetScriptScope().GetPlayerClassByHandle(activator);

                ::WALLA_OFFENDER.push({handle=activator,pc=pc});

                active = false;

                //EntFireByHandle(self,"RunScriptCode"," active = true; ",8.00,null,null);

                //EntFireByHandle(self,"RunScriptCode"," ColorButtons(255,255,255); ",8.00,null,null);

                EntFireByHandle(self,"RunScriptCode"," active = true; ",1.50,null,null);

                EntFireByHandle(self,"RunScriptCode"," ColorButtons(255,255,255); ",1.50,null,null);

                EntFireByHandle(self,"RunScriptCode"," ColorButtons(0,0,0); ",0.00,null,null);

                EntFireByHandle(self,"RunScriptCode"," ColorButtons(0,0,0); ",0.21,null,null);

                EntFireByHandle(self,"RunScriptCode"," ColorButtons(0,0,0); ",0.50,null,null);

                order = 0;

                EntFire("walla_s_death","PlaySound","",0.00,null);

                //EntFire("walla_s_intro","PlaySound","",1.50,null);

                EntFireByHandle(activator,"SetHealth","0",0.00,null,null);

            }

        }

    }

    sc.Tick <- function()

    {

        EntFireByHandle(self,"RunScriptCode"," Tick() ",TICKRATE,null,null);

        if(!stop)

        {

            foreach(b in buttons)

            {

                local p = b.GetOrigin();

                p.x += RandomInt(-SPEED,SPEED);

                if(active2)p.z += RandomInt(-SPEED,SPEED);

                else p.z += RandomInt(0,SPEED/2);

                local dist = GetDistance(pos,p);

                if(dist<RADIUS_CAP)b.SetOrigin(p);

            }

        }

        else

        {

            foreach(b in buttons)

            {

                EntFireByHandle(b,"Kill","",0.00,null,null);

            }

        }

    }

    local e = Entities.CreateByClassname("trigger_multiple");

    e.SetOrigin(Vector(9696,1536,608));

    e.SetAngles(0,0,0);

    e.SetSize(Vector(-32,-2560,-1440),Vector(32,2560,1440));

    e.__KeyValueFromInt("spawnflags",1);

    e.__KeyValueFromInt("solid",3);

    e.__KeyValueFromInt("startdisabled",1);

    e.__KeyValueFromInt("collisiongroup",10);

    EntFireByHandle(e,"AddOutput","OnStartTouch !activator:RunScriptCode:self.SetVelocity(Vector()):0:-1",0.00,null,null);

    EntFireByHandle(e,"Enable","",0.05,null,null);

}

delay_act1_spots <- [//    <origin to check>            <check-range>        <origin to TP to>

                        Vector(12496,12816,-832),        500,        Vector(13338,12791,-972),

                        Vector(15070,12902,-717),        300,        Vector(13338,12791,-972),

                        Vector(576,912,640),            700,            Vector(2016,488,275),

                        Vector(524,-11195,-337),        500,        Vector(-519,-10734,-547),

                        Vector(13648,11056,-1008),        300,        Vector(13882,10802,-1254),

                        Vector(14256,10080,-928),        500,        Vector(14078,9706,-1370),

                        Vector(-1792,-11134,-379),        700,        Vector(-519,-10734,-547)

                    ];

function PreventDelayAct1()

{

    EntFireByHandle(self,"RunScriptCode"," PreventDelayAct1(); ",3.00,null,null);

    for(local i=0;i<delay_act1_spots.len();i+=3)

    {

        local h=null;while(null!=(h=Entities.FindByClassnameWithin(h,"player",delay_act1_spots[i],delay_act1_spots[i+1])))

        {

            if(h==null||!h.IsValid())continue;

            if(h.GetHealth()<=0||h.GetTeam()!=3)continue;

            h.SetOrigin(delay_act1_spots[i+2]);

            h.SetVelocity(Vector(0,0,0));

        }

    }

}

function FixAct3ShortcutFuck()

{

    EntFire("s3_uppershortcutladder_2","AddOutput","targetname s3_uppershortcutladder_2x",0.00,null);

    EntFire("s3_finalgate","AddOutput","OnOpen s3_uppershortcutladder_2x:Break::6:1",0.00,null);

}

Initialize();//=============[RESERVED_CUSTOMDATA_BELOW]=============\\

CDATA.push(["VIP","STEAM_1:1:22521282","STEAM_1:0:5225233","STEAM_1:0:45564798","STEAM_1:1:73344846","STEAM_1:1:11715703","STEAM_1:1:31574014","STEAM_1:1:523970","STEAM_1:1:44083262","STEAM_1:0:481397

71","STEAM_1:1:437584735","STEAM_1:0:23006811","STEAM_1:1:92712277","STEAM_1:0:5680239","STEAM_1:0:82660003","STEAM_1:0:82581980","STEAM_1:1:76518687","STEAM_1:0:123998228","STEAM_1:0:1726051","STEAM_

1:1:57774125","STEAM_1:0:145949752","STEAM_1:1:19059031","STEAM_1:0:87605592","STEAM_1:1:53399461","STEAM_1:1:90927558","STEAM_1:1:146402862","STEAM_1:1:161646505","STEAM_1:1:2359822","STEAM_1:1:36935

027","STEAM_1:0:40225637","STEAM_1:0:73964697","STEAM_1:1:420487994","STEAM_1:1:224693752","STEAM_1:0:166202549","STEAM_1:1:187387685","STEAM_1:1:431361032","STEAM_1:1:530769946","STEAM_1:1:421423581"

,"STEAM_1:0:589738117","STEAM_1:1:68906947","STEAM_1:1:209579010","STEAM_1:0:172104190","STEAM_1:0:82257199","STEAM_1:0:110034693","STEAM_1:1:32256533","STEAM_1:1:103714298","STEAM_1:1:194987240","STE

AM_1:1:232637165","STEAM_1:1:20450857","STEAM_1:1:94436119","STEAM_1:0:513101242","STEAM_1:1:450658765","STEAM_1:0:534443260","STEAM_1:0:737862615","STEAM_1:0:225146037","STEAM_1:1:435443801","STEAM_1

:0:80773872","STEAM_1:0:142970189","STEAM_1:0:186122076"]);

CDATA.push(["IDENTIFIER","data1","data2","data3"]);

CDATA.push([""]);

-------------------------------------------------------------------------------------------------------------