// w/o PopExt const WEAPONRESTRICT_PRIMARY = 2; const WEAPONRESTRICT_SECONDARY = 4; ::MaxPlayers <- MaxClients().tointeger(); IncludeScript("popextensions_main.nut",getroottable()) PopExt.AddRobotTag("fake_medic", { OnSpawn = function(bot,tag) { bot.GetScriptScope().AttackMode <- false bot.GetScriptScope().PlayerThinkTable.fakeMedThink <- function() { local iHealth = self.GetHealth() if (iHealth <= 2000 && AttackMode == false) { self.RemoveWeaponRestriction(WEAPONRESTRICT_SECONDARY) self.AddWeaponRestriction(WEAPONRESTRICT_PRIMARY) self.AcceptInput("$BotCommand","switch_action FetchFlag",self,null) self.LeaveSquad() AttackMode = true } } } OnTakeDamage = function(bot,params) { if (!bot.IsValid()) return if (params.damage_stats == TF_DMG_CUSTOM_BACKSTAB && bot.GetScriptScope().AttackMode == false) { bot.RemoveWeaponRestriction(WEAPONRESTRICT_SECONDARY) bot.AddWeaponRestriction(WEAPONRESTRICT_PRIMARY) bot.AcceptInput("$BotCommand","switch_action FetchFlag",bot,null) bot.LeaveSquad() bot.GetScriptScope().AttackMode = true } } }) PopExt.AddRobotTag("fake_medic_common", { OnSpawn = function(bot,tag) { bot.GetScriptScope().AttackMode <- false bot.GetScriptScope().flTimeAttackMode <- 0 bot.GetScriptScope().PlayerThinkTable.fakeMedThink <- function() { local iHealth = self.GetHealth() if (AttackMode == false) { if (iHealth <= 50 && flTimeAttackMode == 0) { flTimeAttackMode = Time() + 0.2 } if (flTimeAttackMode != 0) { local flTime = Time() if (flTime >= flTimeAttackMode) { flTimeAttackMode = 0 AttackMode = true self.RemoveWeaponRestriction(WEAPONRESTRICT_SECONDARY) self.AddWeaponRestriction(WEAPONRESTRICT_PRIMARY) self.AcceptInput("$BotCommand","switch_action FetchFlag",self,null) self.LeaveSquad() } } } } } }) PopExt.AddRobotTag("birb_tiddies", { OnSpawn = function(bot,tag) { bot.GetScriptScope().PlayerThinkTable.bossThink <- function() { if (!self.InCond(80)) self.RemoveCond(81) } } }) ::CountdownCallbacks <- { function OnGameEvent_recalculate_holidays(_) { if(GetRoundState() == 3) { if(ThinkEnt && ThinkEnt.IsValid()) ThinkEnt.Kill() delete ::CountdownCallbacks }} ThinkEnt = CreateByClassname("logic_relay") iCountdownLast = -1 hGameRules = FindByClassname(null, "tf_gamerules") Think = function() { local flRestartRoundTime = GetPropFloat(hGameRules, "m_flRestartRoundTime") if(flRestartRoundTime != -1) { local iCountdown = ceil(flRestartRoundTime - Time()).tointeger() if(iCountdown != iCountdownLast && iCountdown in Callbacks) Callbacks[iCountdown]() iCountdownLast = iCountdown } else iCountdownLast = -1 } Callbacks = { [8] = function() { EntFire("countdown_relay", "Trigger") } } } CountdownCallbacks.ThinkEnt.ValidateScriptScope() CountdownCallbacks.ThinkEnt.GetScriptScope().Think <- function() { CountdownCallbacks.Think() return -1 } AddThinkToEnt(CountdownCallbacks.ThinkEnt, "Think")