local _root = getroottable() function IncludeScriptInFile(path) { try IncludeScript(format("scrapyard_expert/%s", path), _root) catch(e) printl(e) } function IncludeWave1() { IncludeScriptInFile("nanoboost_bot.nut") IncludeScriptInFile("pyro_bulwark.nut") } function IncludeWave2() { //due to conflicting player_spawns, scripts must combine to form one super script that controls every wave 2 gimmick IncludeScriptInFile("shield_guardian.nut") IncludeScriptInFile("baseball_fireball_rain.nut") IncludeScriptInFile("tele_charge_bot_scrapyard.nut") IncludeScriptInFile("bulwark_exp_wave2.nut") } function IncludeWave3() { IncludeScriptInFile("spawn_deployer.nut") Convars.SetValue("tf_halloween_bot_quit_range", 10000) Convars.SetValue("tf_halloween_bot_chase_duration", 9999) Convars.SetValue("tf_halloween_bot_chase_range", 9999) Convars.SetValue("tf_halloween_bot_health_per_player", 0) PopExt.AddCustomIcon("horsemann_lite", 1, false, true, false, false) PopExt.AddRobotTag("bot_horseman", { OnDeath = function(bot, tag) { PopExt.DecrementWaveIconSpawnCount("horsemann_lite",MVM_CLASS_FLAG_MINIBOSS,0) } }) } // function IncludeWave4() // { // IncludeScriptInFile("marauder_logic.nut") // } //HHH Logic //This is the only way we can detect when HHH takes damage and also interact with the bot that controls the healthbar function OnScriptHook_OnTakeDamage(params) { local victim = params.const_entity local attacker = params.attacker local damage = params.damage local dmgtype = params.damage_type local dmgbonus = params.damage_bonus //check if HHH was hurt; if so, damage the bot with the tag for (local boss; boss = FindByClassname(boss, "headless_hatman");) { if (!boss.IsValid()) continue if (victim == boss) { for(local bot; bot = FindByClassname(bot, "player");) { if (!bot.IsBotOfType(TF_BOT_TYPE)) continue if (bot.IsBotOfType(TF_BOT_TYPE)) { if (bot.HasBotTag("bot_horseman")) { //this really sucks but we have to do it if (attacker.InCond(11) || attacker.InCond(34) || attacker.InCond(44)) { // ^ Kritzkrieg, Canteen, MMMph (do flames even hit HHH???), bot.RemoveCondEx(5, true) bot.TakeDamage(damage * 3, 16, boss) bot.AddCondEx(5, 99999, null) } else if (attacker.InCond(16) || attacker.InCond(19)) { // ^ Buff Banner, Cola/Steak bot.RemoveCondEx(5, true) bot.TakeDamage(damage * 1.35, 16, boss) bot.AddCondEx(5, 99999, null) } else { bot.RemoveCondEx(5, true) bot.TakeDamage(damage, 16, boss) bot.AddCondEx(5, 99999, null) } } } } } } } function SpawnHHH() { local hatman = SpawnEntityFromTable("headless_hatman", { targetname = "marvin" }) hatman.SetHealth(10000) hatman.SetCollisionGroup(COLLISION_GROUP_PUSHAWAY) hatman.SetOrigin(Vector(223, 285, -577)) hatman.SetAngles(180, 0, 0) hatman.SetModelSimple("models/bots/headless_hatman_burnt.mdl") for (local boss; boss = FindByClassname(boss, "headless_hatman");) { if (!boss.IsValid()) continue for(local bot; bot = FindByClassname(bot, "player");) { if (!bot.IsBotOfType(TF_BOT_TYPE)) continue if (bot.IsBotOfType(TF_BOT_TYPE)) { if (bot.HasBotTag("bot_horseman")) { bot.Teleport(true, Vector(4364, 2404, -175.0), false, QAngle(), false, Vector(0, 0, 0)) bot.AddCondEx(64, 99999, null) //stop HHH from targeting bot.AddCondEx(5, 99999, null) // no dmg from players // bot.AddCustomAttribute("dmg taken increased", 0, -1) } } } } }