//NEW BULWARK PYRO //TAUNTS, THEN CAUSES FLAMES TO ERUPT FROM THE GROUND PrecacheModel("models/props_mvm/robot_spawnpoint_warning.mdl") PrecacheSound("weapons/flame_thrower_start.wav") PrecacheSound("weapons/stickybomblauncher_charge_up.wav") function UseHumanAnims(bot, args) { local class_string = PopExtUtil.Classes[bot.GetPlayerClass()] EntFireByHandle(bot, "SetCustomModelWithClassAnimations", format("models/player/%s.mdl", class_string), SINGLE_TICK, null, null) EntFireByHandle(bot, "RunScriptCode", format("PopExtUtil.PlayerRobotModel(self, `models/bots/%s/bot_%s.mdl`)", class_string, class_string), SINGLE_TICK, null, null) } function UseBotAnims(bot, args) { local class_string = PopExtUtil.Classes[bot.GetPlayerClass()] EntFireByHandle(bot, "SetCustomModelWithClassAnimations", format("models/bots/%s_boss/bot_%s_boss.mdl", class_string, class_string), SINGLE_TICK, null, null) } ::BurnThink <- function() { local origin = self.GetOrigin() for (local player; player = FindByClassnameWithin(player, "player", origin, 100);) { if (user.GetTeam() != player.GetTeam()) { player.TakeDamageEx(null, user, user.GetActiveWeapon(), Vector(0, 0, 0), Vector(0, 0, 0), 1, 8) PopExtUtil.Ignite(player, 10.0, 4) } } return -1 } function AddWarningThink(entity) { ::WarningThink <- function() { local origin = player.GetOrigin() self.SetAbsOrigin(origin) local soundlevel = (40 + (20 * log10(1300 / 36.0))).tointeger(); if (check == false) { EmitSoundEx ({ sound_name = "weapons/stickybomblauncher_charge_up.wav", origin = self.GetOrigin(), volume = 1 sound_level = soundlevel }); EntFireByHandle(self, "RunScriptCode", "EmitSoundEx({ sound_name = `weapons/stickybomblauncher_charge_up.wav`, flags = SND_STOP})", 2.5, null, null) check = true } return -1 } AddThinkToEnt(entity, "WarningThink") } ::BulwarkThink <- function() { local primary = PopExtUtil.GetItemInSlot(self, 0) local tauntatk = self.GetTauntAttackTime() local soundlevel = (40 + (20 * log10(1300 / 36.0))).tointeger(); if (self.InCond(51)) return if (useModel == false && ChangeModel == true) { UseBotAnims(self, null) ChangeModel = false } else if (useModel == true && ChangeModel == true) { UseHumanAnims(self, null) ChangeModel = false } if (!(self.IsTaunting())) { tickAttack() } //call this as a function because deleting this in the global scope wouldnt allow the block to be added again //this function preserves it function GetAllPlayers(ent) { if (enemy_table.find(ent) != null) return // prevent the same player being added more then once if (NetProps.GetPropInt(ent, "m_lifeState") != 0) return enemy_table.append(ent) //PopExtUtil.PrintTable(enemy_table) local warning = null warning = SpawnEntityFromTable("prop_dynamic", { model = "models/props_mvm/robot_spawnpoint_warning.mdl" origin = ent.GetOrigin() angles = Vector(0, 0, 0) targetname = "indicator_warn" }) warning.ValidateScriptScope() local propscope = warning.GetScriptScope() propscope.player <- ent propscope.check <- false AddWarningThink(warning) } if (self.IsTaunting() && DoNotCheckTaunt == false) { self.AddCondEx(28, 6.5, null) self.AddCondEx(45, 6.5, null) for(local player; player = FindByClassname(player, "player");) { if (player in enemy_table) continue if (player.GetTeam() != self.GetTeam()) { GetAllPlayers(player) } } DoNotCheckTaunt = true } if (self.IsTaunting()) { TauntAttackTimer++ } //hides the weapon if (TauntAttackTimer == 1) { PopExtUtil.StripWeapon(self, 0) } if (TauntAttackTimer == 2) { local primary = PopExtUtil.GetItemInSlot(self, 0) PopExtUtil.GiveWeapon(self, "tf_weapon_rocketlauncher_fireball", 1178) } if (TauntAttackTimer == 163) { for(local prop; prop = FindByName(prop, "indicator_warn");) { try delete ::WarningThink catch(e) return } } else if (TauntAttackTimer == 218) { for(local prop; prop = FindByName(prop, "indicator_warn");) { local proporigin = prop.GetOrigin() local summonFire = SpawnEntityFromTable("info_particle_system", { targetname = "burn_them", origin = proporigin, angles = Vector(-90, 0, 0), effect_name = "flamethrower", flag_as_weather = 0, }) EmitSoundEx ({ sound_name = "weapons/flame_thrower_start.wav", origin = proporigin, volume = 0.7 sound_level = soundlevel }); EntFireByHandle(summonFire, "Start", "", 0, null, null) EntFireByHandle(summonFire, "Stop", "", 2, null, null) EntFireByHandle(summonFire, "Kill", "", 2, null, null) EntFireByHandle(summonFire, "RunScriptCode", "EmitSoundEx({ sound_name = `weapons/flame_thrower_start.wav`, flags = SND_STOP})", 2, null, null) summonFire.ValidateScriptScope() local propscope = summonFire.GetScriptScope() propscope.user <- self AddThinkToEnt(summonFire, "BurnThink") prop.Kill() } } else if (TauntAttackTimer == 300) { TauntAttackTimer = 0 } //return spots; // causes script to iterate over spots again } //////////////////////////ON GAME EVENTS ::BurnwarkSetter <- function() { local playerScope = self.GetScriptScope() local primary = PopExtUtil.GetItemInSlot(self, 0) if (self != null && self.IsBotOfType(TF_BOT_TYPE)) { self.ValidateScriptScope(); if (!("PlayerThinkTable" in self.GetScriptScope())) self.GetScriptScope().PlayerThinkTable <- {} if (self.HasBotTag("bot_bulwark")) { playerScope.DoNotCheckTaunt <- false playerScope.enemy_table <- [] playerScope.TauntAttackTimer <- 0 playerScope.attackTime <- 5 playerScope.serverTime <- 0 playerScope.useModel <- false playerScope.ChangeModel <- false playerScope.tickAttack <- function() { if (attackTime == null) return local time = floor(Time()) if (time != serverTime) { // Once every second serverTime = time //printl(attackTime) local primary = PopExtUtil.GetItemInSlot(self, 0) if (attackTime == 8) { enemy_table = [] UseBotAnims(self, null) TauntAttackTimer = 0 DoNotCheckTaunt = false } if (attackTime > 0) { attackTime-- } if (attackTime == 0) { UseHumanAnims(self, null) NetProps.SetPropInt(primary, "m_AttributeManager.m_Item.m_iItemDefinitionIndex", 741); self.Taunt(0, 1) // particles mostly work correctly on bots attackTime = 8 } //printl(caberTimer) } } //self.SetForcedTauntCam(1) playerScope.PlayerThinkTable.BulwarkThink <- BulwarkThink } } } function OnGameEvent_post_inventory_application(params) { local player = GetPlayerFromUserID(params.userid); local class_string = PopExtUtil.Classes[player.GetPlayerClass()] local playerScope = player.GetScriptScope() // printl(class_string) // printl(player) if (player != null && player.IsBotOfType(TF_BOT_TYPE)) { EntFireByHandle(player, "CallScriptFunction", "BurnwarkSetter", 0, null, null); } } __CollectGameEventCallbacks(this);