local processedProjectiles = {} local grenadePartics = {} local processedSounds = {} local processedPlayers = {} //grenade effects PrecacheEntityFromTable({ classname = "info_particle_system", effect_name = "smoke_marker" }); local CUSTOM_MODEL = ("models/workshop/weapons/c_models/c_quadball/w_quadball_grenade.mdl"); //PrecacheModel("models/props_trainyard/cart_bomb_separate.mdl"); //local CUSTOM_MODEL = ("models/props_trainyard/cart_bomb_separate.mdl"); PrecacheScriptSound ("^mvm/giant_demoman/giant_demoman_grenade_shoot.wav") PrecacheScriptSound ("mvm/giant_demoman/giant_demoman_grenade_shoot.wav") //intro effects PrecacheEntityFromTable({ classname = "info_particle_system" effect_name = "mvm_wood_boards_destroy_2BR" }) PrecacheEntityFromTable({ classname = "info_particle_system" effect_name = "asplode_hoodoo_debris" }) //run intro DispatchParticleEffect("asplode_hoodoo_debris", Vector(755, -1996, 900), Vector(0, 90, 0)) DispatchParticleEffect("mvm_wood_boards_destroy_2BR", Vector(755, -1996, 900), Vector(0, 45, 0)) DispatchParticleEffect("mvm_wood_boards_destroy_2BR", Vector(755, -1996, 900), Vector(0, 135, 0)) EmitSoundEx({ sound_name = "doomsday.launch_exp" entity = "spawnbot_left_0" volume = 1.0 pitch = 100 }) EmitSoundEx({ sound_name = "MVM.TankSmash" entity = "spawnbot_left_0" volume = 5.0 pitch = 100 }) /* PrecacheEntityFromTable({ classname = "info_particle_system", effect_name = "cauldron_smoke_lit" }); local particle = SpawnEntityFromTable("info_particle_system", { origin = Vector(853, -1985, 913), // Replace with target coordinates angles = QAngle(0, 0, 0), effect_name = "cauldron_smoke_lit", start_active = 1 }); */ local scope = self.GetScriptScope() //replace grenade model, play firing sound, add smoke trail scope.ThinkA <- function() { local proj = null while ((proj = Entities.FindByClassname(proj, "tf_projectile_pipe")) != null) { if (!(proj in processedProjectiles)) { processedProjectiles[proj] <- true local owner = proj.GetOwner() if (owner == null) { owner = NetProps.GetPropEntity(proj, "m_hThrower") } if (owner != null && owner.IsPlayer()) { if (owner.HasBotTag("fatty")) { proj.SetModel(CUSTOM_MODEL) proj.SetModelScale(2.5, 0.0) proj.SetSkin(1); local grenadeParticle = SpawnEntityFromTable("info_particle_system", { origin = Vector(proj.GetOrigin().x,proj.GetOrigin().y,proj.GetOrigin().z), angles = QAngle(0, 0, 0), effect_name = "smoke_marker", start_active = 1 }); EntFireByHandle(grenadeParticle, "SetParent", "!activator", 0.0, proj, null); grenadePartics[grenadeParticle] <- true EmitSoundEx({ sound_name = "MVM.GiantDemoman_Grenadeshoot" entity = proj sound_level = 0 volume = 10.0 pitch = 100 }) } } } } //clear from projectile list once dead foreach (ent, _ in processedProjectiles) { if (ent == null || !ent.IsValid()) { delete processedProjectiles[ent] } } //delete erent particles that spawn at origin foreach (ent, _ in grenadePartics) { if (ent == null || !ent.IsValid()) { delete grenadePartics[ent] } else if ( ent != null ) { if (ent.GetOrigin().x == 0 && ent.GetOrigin().y == 0 && ent.GetOrigin().z == 0) { ent.Destroy() delete grenadePartics[ent] } } } } //teleport boss on gate capture scope.ThinkB <- function() { local conPoint = Entities.FindByName(null, "cap_a"); if (conPoint != null) { local ownerTeam = conPoint.GetTeam(); if (ownerTeam == Constants.ETFTeam.TF_TEAM_BLUE) { local ent = null while ((ent = Entities.FindByClassname(ent, "player")) != null) { if (!ent.IsAlive()) continue local isBot = false try { isBot = ent.IsBotOfType(TF_BOT_TYPE) } catch (e) { isBot = NetProps.GetPropBool(ent, "m_bIsABot") } if (isBot && ent.HasBotTag("fatty") && !(ent in processedPlayers)) { processedPlayers[ent] <- true ent.SetAbsAngles(QAngle (4.2, -145, 0)); ent.SetAbsOrigin(Vector(778, 3998, 184)); EmitSoundEx({ sound_name = "MVM.Robot_Teleporter_Deliver" entity = "soundtarget_trains" volume = 5.0 pitch = 80 }) } } } } } scope.MasterThink <- function() { ThinkA() ThinkB() return 0.01 } AddThinkToEnt(self, "MasterThink")