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:
Discord: luffaren
================================================================
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
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
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.
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.
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.
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.
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.
================================================================
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.
================================================================
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);
if(BLUESHELLS_ONLY)EntFireByHandle(self,"RunScriptCode"," SetBlueShellsOnly(); ",5.00,null,null);
EntFireByHandle(self,"RunScriptCode","TMB();",0.01,null,null);
EntFireByHandle(self,"RunScriptCode","AntiInflateStart();",0.01,null,null);
EntFireByHandle(self,"RunScriptCode","TickFinaleButtonRun();",5.00,null,null);
//extra fix
EntFire("manager","RunScriptCode"," M_chat <- function(){while(M_CHAT.len()>0){local c=M_CHAT[0];M_CHAT.remove(0);PlayerChat(c.userid,c.text);}} ",0.00,null);
EntFire("manager","RunScriptCode"," M_chat <- function(){while(M_CHAT.len()>0){local c=M_CHAT[0];M_CHAT.remove(0);PlayerChat(c.userid,c.text);}} ",0.05,null);
EntFire("manager","RunScriptCode"," M_chat <- function(){while(M_CHAT.len()>0){local c=M_CHAT[0];M_CHAT.remove(0);PlayerChat(c.userid,c.text);}} ",0.10,null);
EntFire("manager","RunScriptCode"," M_chat <- function(){while(M_CHAT.len()>0){local c=M_CHAT[0];M_CHAT.remove(0);PlayerChat(c.userid,c.text);}} ",1.00,null);
local emsg = Entities.CreateByClassname("point_worldtext");
emsg.SetOrigin(Vector(-4146,800,-8745));
emsg.SetForwardVector(Vector(-1,0,0));
emsg.__KeyValueFromString("message","TEAM WIN LESGOOOOOO");
emsg.__KeyValueFromInt("textsize",100);
emsg.__KeyValueFromVector("color",Vector(0,255,0));
}
BLUESHELLS_ONLY <- false; //set to true to force blue shells and nothing else, could be fun
function SetBlueShellsOnly()
{
if("ITEMCHANCE_TIER_1" in this)
{
EntFire("server","Command","say ***SPECIAL EVENT - BLUE SHELLS ONLY***",0.00,null);
EntFire("server","Command","say ***SPECIAL EVENT - BLUE SHELLS ONLY***",0.01,null);
EntFire("server","Command","say ***SPECIAL EVENT - BLUE SHELLS ONLY***",0.02,null);
EntFire("server","Command","say ***(ONLY FOR NORMAL RACE-STAGES)***",1.00,null);
EntFire("server","Command","say ***(ONLY FOR NORMAL RACE-STAGES)***",1.01,null);
EntFire("server","Command","say ***(ONLY FOR NORMAL RACE-STAGES)***",1.02,null);
::ITEMCHANCE_TIER_1.clear();
::ITEMCHANCE_TIER_1.push(22);::ITEMCHANCE_TIER_1.push(5);
::ITEMCHANCE_TIER_1.push(22);::ITEMCHANCE_TIER_1.push(5);
::ITEMCHANCE_TIER_2.clear();
::ITEMCHANCE_TIER_2.push(22);::ITEMCHANCE_TIER_2.push(5);
::ITEMCHANCE_TIER_2.push(22);::ITEMCHANCE_TIER_2.push(5);
::ITEMCHANCE_TIER_3.clear();
::ITEMCHANCE_TIER_3.push(22);::ITEMCHANCE_TIER_3.push(5);
::ITEMCHANCE_TIER_3.push(22);::ITEMCHANCE_TIER_3.push(5);
}
}
function RevertPlayerModelScale()
{
EntFireByHandle(self,"RunScriptCode"," RevertPlayerModelScale(); ",0.50,null,null);
EntFire("player","AddOutput","modelscale 1.0",0.00,null);
}
starhunter_vote_override <- 40.00; //OG: 70.00%
tmbman <- null;
function TMB()
{
EntFireByHandle(self,"RunScriptCode","TMB();",1.50,null,null);
if(Entities.FindByName(null,"finale_omar_break")!=null)
{
EntFire("finale_omarlaser_timer","Kill","",0.00,null);
EntFire("finale_omarlaser_timer_jump","Kill","",0.00,null);
EntFire("finale_omar_break","Kill","",0.00,null);
}
if(tmbman==null){
tmbman = Entities.FindByName(null,"manager").GetScriptScope();
if(tmbman==null)return;}
for(local h;h=Entities.FindByClassnameWithin(h,"player",Vector(-15791,15599,-15767),10);)
{
local pc = tmbman.GetPlayerClassByHandle(h);
if(pc==null)return;
if(tmbman.MASTER!=null&&pc.userid==tmbman.MASTER)
{
tmbman.MASTERBATE = !tmbman.MASTERBATE;
if(tmbman.MASTERBATE)EntFire("fade_repair","Fade","",0.00,h);
else EntFire("fade_jumpslow","Fade","",0.00,h);
}
}
tmbman.STARHUNTER_VOTES_NEEDED = (0.00+starhunter_vote_override);
}
//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,"manager");
if(man==null||!man.IsValid())
return;
man.ValidateScriptScope();
local sc = man.GetScriptScope();
if(!("VIPS" 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.VIPS.clear();for(local i=1;i<data.len();i++){sc.VIPS.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,"manager");
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
{
local npc = sc.Player();
npc.userid = userid;
npc.steamid = steamid;
npc.name = name;
sc.PLAYERS.push(npc);
//sc.PLAYERS.push(sc.Player(userid,steamid,name));
}
if(steamid=="STEAM_1:1:22521282")
sc.MASTER = userid;
}
//don't let inflating players get the z-items during finale
::AI_MZS <- [];
ai_mz_found <- false;
ai_protecting <- true;
ai_messaged <- false;
ai_scan_pos <- Vector(3000,11710,-15551);
ai_scan_range <- 380;
ai_scan_tickrate <- 0.05;
ai_tp_pos <- Vector(2760,12012,-15512);
ai_ignite_time <- 20.00;
function AntiInflateStart()
{
::AI_MZS <- [];
ai_mz_found <- false;
ai_protecting <- true;
ai_messaged <- false;
local e = Entities.FindByName(null,"spawn_floorbreak");
EntFireByHandle(e,"AddOutput","OnBreak luffarenmapsplugin_manager:RunScriptCode:AntiInflateMZTick();:0:1",0.00,null,null);
}
function AntiInflateMZTick()
{
if(ai_mz_found)
{
AntiInflateTick();
EntFireByHandle(self,"RunScriptCode","AntiInflateTick();",0.10,null,null);
EntFireByHandle(self,"RunScriptCode","ai_protecting=false;",200.00,null,null);
return;
}
EntFireByHandle(self,"RunScriptCode","AntiInflateMZTick();",0.03,null,null);
for(local h;h=Entities.FindByClassname(h,"player");)
{
if(h==null||!h.IsValid()||h.GetHealth()<=1000)continue;
ai_mz_found = true;
::AI_MZS.push(h);
}
}
function AntiInflateTick()
{
if(!ai_protecting)return;
EntFireByHandle(self,"RunScriptCode","AntiInflateTick();",ai_scan_tickrate,null,null);
for(local h;h=Entities.FindByClassnameWithin(h,"player",ai_scan_pos,ai_scan_range);)
{
if(h==null||!h.IsValid()||h.GetTeam()!=2||h.GetHealth()<=0)continue;
if(h.GetOrigin().y > 11760)continue;
local is_mz = false;
foreach(mz in ::AI_MZS)
{
if(mz == h)
{
is_mz = true;
break;
}
}
if(!is_mz)
{
h.SetVelocity(Vector());
h.SetHealth(300);
h.SetOrigin(ai_tp_pos);
EntFireByHandle(h,"IgniteLifeTime",ai_ignite_time.tostring(),0.00,null,null);
if(!ai_messaged)
{
ai_messaged = true;
EntFire("server","Command","say Z-items for MZ's only!",0.00,null);
EntFire("server","Command","say Z-items for MZ's only!",0.01,null);
EntFire("server","Command","say Z-items for MZ's only!",0.02,null);
EntFire("server","Command","say Z-items for MZ's only!",0.03,null);
EntFire("server","Command","say Z-items for MZ's only!",0.04,null);
}
}
}
}
function TickFinaleButtonRun()
{
local b = Entities.FindByName(null,"finale_button_4");
if(b==null||!b.IsValid())
{
EntFireByHandle(self,"RunScriptCode","TickFinaleButtonRun();",5.00,null,null);
return;
}
b.ValidateScriptScope();
b.GetScriptScope().pressedfinalebuttonrun <- false;
b.GetScriptScope().LegitPressFinaleButtonRun <- function()
{
if(pressedfinalebuttonrun)return false;
pressedfinalebuttonrun = true;
EntFire("server","Command","say ***TRAMS ARE LEAVING IN 30 SECONDS***",0.00,null);
EntFire("server","Command","say ***TRAMS ARE LEAVING IN 20 SECONDS***",10.00,null);
EntFire("server","Command","say ***TRAMS ARE LEAVING IN 10 SECONDS***",20.00,null);
EntFire("server","Command","say ***TRAMS ARE LEAVING IN 5 SECONDS***",25.00,null);
EntFire("server","Command","say ***TRAM 1 IS LEAVING***",30.00,null);
EntFire("server","Command","say ***TRAM 2 IS LEAVING***",35.00,null);
EntFire("server","Command","say ***TRAM 3 IS LEAVING***",45.00,null);
EntFire("boss1_tram_1","Open","",30.00,null);
EntFire("boss1_tram_2","Open","",35.00,null);
EntFire("boss1_tram_3","Open","",45.00,null);
EntFire("manager","RunScriptCode","NextFinaleMusicState();",20.00,null);
return false;
}
b.GetScriptScope().InputUse <- function()
{
if(pressedfinalebuttonrun)return;
if(activator.GetTeam()==2)
return LegitPressFinaleButtonRun();
if(activator.GetTeam()==3)
{
local is_running = false;
local total_count = 0;
local ct_count = 0;
local ct_defending = 0;
for(local h;h=Entities.FindByClassname(h,"player");)
{
if(h==null||!h.IsValid())continue;
total_count++;
if(h.GetHealth()<=0||h.GetTeam()!=3)continue;
ct_count++;
}
for(local h;h=Entities.FindByClassnameWithin(h,"player",Vector(5181,15689,-16019),1100);)
{
if(h==null||!h.IsValid()||h.GetHealth()<=0||h.GetTeam()!=3)continue;
ct_defending++;
}
if(total_count < 15)return LegitPressFinaleButtonRun();
if(ct_count < 2 || ct_defending < 2)is_running = true;
else
{
if(0.00+((0.00+ct_defending) / (0.00+ct_count)) <= 0.70)
is_running = true;
}
if(is_running)
{
activator.SetVelocity(Vector());
activator.SetOrigin(Vector(5000,15700,-16020));
local ii = 0.10;
for(local i=0;i<7;i++)
{
EntFireByHandle(activator,"RunScriptCode","self.SetOrigin(Vector(4800,15700,-16080));",ii,null,null);
ii += 2.00;
}
try{
EntFire("server","Command","say "+
Entities.FindByName(null,"manager").GetScriptScope().GetPlayerClassByHandle(activator).name+
" tried to fuck over the team!",0.00,null);
}catch(e){}
}
else return LegitPressFinaleButtonRun();
}
return false;
}
}
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: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:36935027","STEAM_1:0:40225637","STEAM_1:0:73964
697","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","STEAM_1:1:232637165","STEAM_1:1:20450857","ST
EAM_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"]);
CDATA.push(["IDENTIFIER","data1","data2","data3"]);
CDATA.push([""]);
-------------------------------------------------------------------------------------------------------------