local colortank = "models/bots/boss_bot/boss_tank_color.mdl" local index = GetModelIndex(colortank) PrecacheModel(colortank) IncludeScript("netpropperf.nut"); IncludeScript("itemdef_constants.nut"); local loaded = false; local resource = FindByClassname(null, "tf_objective_resource"); local gamerules = FindByClassname(null, "tf_gamerules"); local mvmlogic = FindByClassname(null, "tf_logic_mann_vs_machine"); local locker = FindByName(null, "locker_model"); local playermanager = FindByClassname(null, "tf_player_manager"); local wavenum = 0; //block scout for now //nvm this breaks bot spawns too lol // SetValue("tf_tournament_classlimit_scout", 0) //function is called on wave init ::LoadScripts <- function() { //load scripts if they aren't currently loaded while (!loaded) { if (locker == null) { ClearGameEventCallbacks(); IncludeScript("oxidize_spawnents.nut", null); IncludeScript("oxidize_newspawns.nut", null); IncludeScript("oxidize_botattributes.nut", null); IncludeScript("oxidize_playerattributes.nut", null); IncludeScript("oxidize_luarewrite.nut", null); if (IsMITM()) { DoEntFire("item_teamflag", "AddOutput", "OnPickup !self:ForceDrop::0:-1", 0.0, null, null); DoEntFire("item_teamflag", "AddOutput", "OnPickup !self:RunScriptCode:SetLocalOrigin(Vector(666.747559, 2664.590576, -27.968681)):0:-1", 0.1, null, null); DoEntFire("bosspush", "Kill", "", 0.1, null, null); } loaded = true; } loaded = true; SetPropString(resource, "m_iszMvMPopfileName", "You will not survive...") } //set cvars while (GetInt("tf_bot_flag_escort_max_count") != 0) { //yeet escort shit to force mobber ai SetValue("tf_bot_escort_range", 99999); SetValue("tf_bot_flag_escort_range", 99999); SetValue("tf_bot_flag_escort_max_count", 0); SetValue("tf_mvm_bot_flag_carrier_interval_to_1st_upgrade", 99999); //full moon SetValue("tf_forced_holiday", 8); } //enable spells SetPropBool(gamerules, "m_bIsUsingSpells", true) //set custom upgrade file //moved to the map file itself // EntFireByHandle(gamerules, "SetCustomUpgradesFile", "scripts/items/mvm_upgrades_oxidize.txt", 0.0, null, null); DoEntFire("upgradefile", "Trigger", "", 0.0, null, null); EntFireByHandle(gamerules, "SetRedTeamRespawnWaveTime", "9999", 0.0, null, null); //kill spawn door triggers //this also kills a nav_prefer trigger that we don't use for (local triggers; triggers = FindByClassname(triggers, "trigger_multiple"); ) { if (triggers.GetName().len() == 0) triggers.Kill() } ::Scripts <- {} // ::Scripts.OnGameEvent_teamplay_round_start <- function(params) { printl("test"); loaded = false; } // ::Scripts.OnGameEvent_mvm_reset_stats <- function(params) { printl("test"); loaded = false; } ::Scripts.OnGameEvent_mvm_begin_wave <- function(params) { wavenum = params.wave_index + 1} ::Scripts.OnGameEvent_player_activate <- function(params) { DoEntFire("!activator", "RunScriptCode", "ClientPrint(null, 3, `\x07b500c9Type .info to learn more about the mission`)", 10.0, GetPlayerFromUserID(params.userid), GetPlayerFromUserID(params.userid)); } ::Scripts.OnGameEvent_mvm_wave_complete <- function(params) { loaded = false; if (wavenum != 5) return; SetPropString(resource, "m_iszMvMPopfileName", "mvm_oxidize_rc3_brain_adv_ii_vscript.pop") } ::Scripts.OnGameEvent_player_say <- function(params) { local player = GetPlayerFromUserID(params.userid) if (params.text != ".info" || params.text.slice(0, params.text.len()) != ".info" ) return; ClientPrint(player, 3, "\x07b500c9MISSION INFO:") ClientPrint(player, 3, "\x0702b2d1One life per wave") ClientPrint(player, 3, "\x0702b2d110 Minute round timer") ClientPrint(player, 3, "\x0702b2d1Ammo upgrades removed, ammo capacity is doubled") ClientPrint(player, 3, "\x0702b2d1Players will receive buffs as teammates die.") //class-specific info switch(player.GetPlayerClass()) { case TF_CLASS_SCOUT: ClientPrint(player, 3, "\x070cd102STAT CHANGES: Scout gets reduced money healing"); break; case TF_CLASS_SOLDIER: ClientPrint(player, 3, "\x070cd102STAT CHANGES: Soldier banners take 4x more damage to charge"); break; case TF_CLASS_ENGINEER: ClientPrint(player, 3, "\x070cd102STAT CHANGES: Engineer has increased HP, build rate, and free teleporters"); break; case TF_CLASS_MEDIC: ClientPrint(player, 3, "\x070cd102STAT CHANGES: Mediguns cannot be upgraded, mediguns cannot overheal"); break; } } __CollectGameEventCallbacks(::Scripts) } //mann in the machine check ::IsMITM <- function() { if (GetStr("sm_mitm_version") == null) { // printl("MITM not loaded") return false; } else { printl(format("MITM version: %d", GetStr("sm_mitm_version"))) return true; } } //round timer, kill revive markers, tank model, skeletons ::MiscThink <- function() { // set round time to < 10 seconds to avoid announcer lines if ( (GetPropFloat(gamerules, "m_flRestartRoundTime") <= (Time() + 12.0)) && (GetPropFloat(gamerules, "m_flRestartRoundTime") > (Time() + 3.0)) ) SetPropFloat(gamerules, "m_flRestartRoundTime", Time() + 3.0); //kill revive markers for (local revive; revive = FindByClassname(revive, "entity_revive_marker"); ) revive.Kill(); if (FindByClassname(null, "tank_boss") != null) { //set tank model local tank = FindByClassname(null, "tank_boss") if (tank.GetModelName() != colortank) { tank.SetModelSimple(colortank); SetPropString(tank, "m_modelString", colortank); SetPropInt(tank, "m_nModelIndex", index); //standard/romevision indices SetPropIntArray(tank, "m_nModelIndexOverrides", index, 0); SetPropIntArray(tank, "m_nModelIndexOverrides", index, 3); } tank.SetModelScale(0.99, 0.0) if (tank.GetModelScale() != 1.0) tank.SetModelScale(1.0, 0.0) } if (wavenum != 5) return; //kill skele spawners before they split from tf_zombie_spawner for (local skelespell; skelespell = FindByClassname(skelespell, "tf_projectile_spellspawnzombie"); ) if (GetPropEntity(skelespell, "m_hThrower") == null) skelespell.Kill(); // m_hThrower does not change when the skeletons split for spell-casted skeles, just need to kill them after spawning for (local skeles; skeles = FindByClassname(skeles, "tf_zombie"); ) { //kill blu split skeles if (skeles.GetModelScale() == 0.5 && skeles.GetTeam() == TF_TEAM_PVE_INVADERS) { // printl("Killing split skeleton " + skeles + " with model scale " + skeles.GetModelScale() + " on team " + skeles.GetTeam()) skeles.Kill(); return; } if (skeles.GetTeam() == 5) { skeles.SetTeam(TF_TEAM_PVE_INVADERS); skeles.SetSkin(1); } } } resource.ValidateScriptScope(); resource.GetScriptScope().MiscThink <- MiscThink; AddThinkToEnt(resource, "MiscThink"); LoadScripts();