--please do not modify or copy this for your own needs --you may use this unmodified version if you credit me :) --made by Wacev --This lua file is now deprecated, please us robot_extras_revamped.lua instead --https://steamcommunity.com/profiles/76561198009331097/ function has_value (tab, val) --copied from stack overflow for index, value in pairs(tab) do if value == val then return true end end return false end function OnWaveSpawnBot(bot, wave, tags) if bot.m_iClass ~= TF_CLASS_SPY then local usesLeft = 3 local maxHealth = bot.m_iHealth local curHealth = bot.m_iHealth local enraged = false local ShotCount = 0 local enrageCount = 0 local maxammo = bot.m_hActiveWeapon.m_iClip1 bot:AddCallback(ON_DAMAGE_RECEIVED_POST, function(ent, damage, previousHealth) curHealth = bot.m_iHealth if IsValid(bot:GetPlayerItemBySlot(0)) then if bot:GetPlayerItemBySlot(0):GetItemName() == "The Phlogistinator" and ( not has_value(tags, "bot_boss") ) then --phlog taunt when injured function. if curHealth <= maxHealth*0.8 and ( enraged == false ) then enraged = true bot:Taunt("TAUNT_BASE_WEAPON", 0) end end end if has_value(tags, "bot_enragable") then --enrage bot function if curHealth <= maxHealth*0.65 and ( enraged == false ) then enraged = true bot:AddCond(34,6) bot:AddCond(26,6) bot:AddCond(71,1) bot:AddCond(52,1) bot:ChangeAttributes("Enraged") timer.Simple(6, function() bot:ChangeAttributes("Defualt") end) end end end) bot:AddCallback(ON_DAMAGE_RECEIVED_PRE, function(ent, damage) curHealth = bot.m_iHealth if has_value(tags, "bot_canteenuber") then --uber canteen bot function if not bot:InCond(8) then if curHealth <= maxHealth*0.25 and ( enraged == false ) then usesLeft = 0 bot:AddCond(52,5) PrintChatText('\x0799CCFF' .. tostring(bot:GetPlayerName()) .. ' \x07FBECCBhas used thier \x079ec34fÜBERCHARGE \x07FBECCBPower Up Canteen!') for _, player in pairs(ents.GetAllPlayers()) do --play the canteen sound to all players if player:IsRealPlayer() then player:PlaySoundToSelf("MVM.PlayerUsedPowerup") player:PlaySoundToSelf("MVM.PlayerUsedPowerup") end end enraged = true elseif damage.Damage >= curHealth and ( enraged == false ) then -- makes the uber canteen bot servive a lethal strike -- usesLeft = 0 bot:AddCond(52,5) bot:SetHealth(1) PrintChatText('\x0799CCFF' .. tostring(bot:GetPlayerName()) .. ' \x07FBECCBhas used thier \x079ec34fÜBERCHARGE \x07FBECCBPower Up Canteen!') for _, player in pairs(ents.GetAllPlayers()) do --play the canteen sound to all players if player:IsRealPlayer() then player:PlaySoundToSelf("MVM.PlayerUsedPowerup") player:PlaySoundToSelf("MVM.PlayerUsedPowerup") end end enraged = true end end end end) timer.Simple(0.5, function() bot.m_hActiveWeapon:AddCallback(ON_FIRE_WEAPON_PRE, function(ent) if has_value(tags, "bot_canteencrit") then --crit canteen bot function if ( not bot:InCond(34) ) and ( not bot:InCond(51) ) then --only increment shot count when not critboosted and not in spawn ShotCount = ShotCount + 1 if ShotCount >= 3 and ( enrageCount < 3 ) then ShotCount = 0 enrageCount = enrageCount + 1 bot:AddCond(34,5) PrintChatText('\x0799CCFF' .. tostring(bot:GetPlayerName()) .. ' \x07FBECCBhas used thier \x079ec34fCRITS \x07FBECCBPower Up Canteen!') --what an ungodly parameter for _, player in pairs(ents.GetAllPlayers()) do --play the canteen sound to all players if player:IsRealPlayer() then player:PlaySoundToSelf("MVM.PlayerUsedPowerup") player:PlaySoundToSelf("MVM.PlayerUsedPowerup") end end end else ShotCount = 0 --to prevent back to back to back crit canteens end end if has_value(tags, "bot_canteenammo") then --ammo canteen bot function if ent.m_iClip1 == 0 and (usesLeft ~= 0) then usesLeft = usesLeft - 1 ent.m_iClip1 = maxammo PrintChatText('\x0799CCFF' .. tostring(bot:GetPlayerName()) .. ' \x07FBECCBhas used thier \x079ec34fAMMO REFILL \x07FBECCBPower Up Canteen!') for _, player in pairs(ents.GetAllPlayers()) do --play the canteen sound to all players if player:IsRealPlayer() then player:PlaySoundToSelf("MVM.PlayerUsedPowerup") player:PlaySoundToSelf("MVM.PlayerUsedPowerup") end end end end end) end) end end function PrintChatText(text) --currently colored text is limited to lua scripts, idk why util.PrintToChatAll(text) --to create colored text, start with "\x07" then add the color in hexadecimal form end PlayerTable = {} PlayerCount = 0 function RecountPlayers() PlayerCount = 0 for i,v in pairs(PlayerTable) do PlayerTable[i] = nil end for index, player in pairs(ents.GetAllPlayers()) do if ( player:IsRealPlayer() ) and ( player.m_iTeamNum == 2 ) then PlayerTable[PlayerCount] = player PlayerCount = PlayerCount + 1 end end end function OrbitalRocket(projectile,activator,weapon) RecountPlayers() local RandomPlayer = PlayerTable[math.random(0,#PlayerTable)] OrbitalRocketMain(RandomPlayer,activator,projectile:GetNetIndex()) end function OrbitalRocketMain(target,attacker,index) if (target:IsValid()) and (attacker:IsValid()) then timer.Simple(3, function() local rand = (math.random() * math.random()) local KeyValues = { model = "models/props_mvm/indicator/indicator_circle_long.mdl", skin = 1, origin = target:GetAbsOrigin(), disableshadows = 1, targetname = 'indicator ' .. tostring(index) } local KeyValues2 = { origin = target:GetAbsOrigin() + Vector(0, 0, 1100), angles = "90 0 0", Crits = 0, SpreadAngle = 0, targetname = 'shooter ' .. tostring(index) } ents.CreateWithKeys("tf_point_weapon_mimic", KeyValues2, true, true) local mimic = ents.FindByName('shooter ' .. tostring(index)) mimic["$weaponname"] = "Orbital Strike Rocket" if ( attacker:InCond(34) ) or ( attacker:InCond(11) ) then mimic["Crits"] = 1 end ents.CreateWithKeys("prop_dynamic", KeyValues, true, true) ents.FindByName('indicator ' .. tostring(index)):AcceptInput("SetAnimation","start") timer.Create(0.015, function() ents.FindByName('indicator ' .. tostring(index)):SetAbsOrigin(target:GetAbsOrigin() + Vector(0, 0, 8)) ents.FindByName('shooter ' .. tostring(index)):SetAbsOrigin(target:GetAbsOrigin() + Vector(0, 0, 1100)) end, 2.5 / 0.015) timer.Simple(5, function() ents.FindByName('indicator ' .. tostring(index)):AcceptInput("Skin", 0) end) timer.Simple(6.2, function() ents.FindByName('shooter ' .. tostring(index)):AcceptInput("FireOnce") end) timer.Simple(7.5, function() ents.FindByName('indicator ' .. tostring(index)):AcceptInput("SetAnimation","end") end) timer.Simple(8, function() ents.FindByName('indicator ' .. tostring(index)):AcceptInput("kill") ents.FindByName('shooter ' .. tostring(index)):AcceptInput("kill") end) end) end end