::REMOVE_ON_DEATH <- Constants.FTFBotAttributeType.REMOVE_ON_DEATH local particle_brush1 = Entities.FindByName(null, "particle_brush1") local particle_brush2 = Entities.FindByName(null, "particle_brush2") local notebook = Entities.FindByName(null, "notebook") local checkpoint_relay = Entities.FindByName(null, "checkpoint_relay") local powerupindex = 0 const STRONGMANN_TIME = 3; const POWERUP_TIME = 30; ::ModelTable <- [ "models/lazy_zombies_v2/scout.mdl", "models/lazy_zombies_v2/soldier.mdl", "models/lazy_zombies_v2/pyro.mdl", "models/lazy_zombies_v2/demo.mdl", "models/lazy_zombies_v2/heavy.mdl", "models/lazy_zombies_v2/engineer.mdl", "models/lazy_zombies_v2/medic.mdl", "models/lazy_zombies_v2/sniper.mdl", "models/lazy_zombies_v2/spy.mdl", ] ::PowerupTable <- [ "powerup_instakill_spawner", "powerup_bonuspoints_spawner", "powerup_nuke_spawner", "powerup_doublepoints_spawner", "powerup_maxammo_spawner", "powerup_minigun_spawner", ] ::RoundEnd <- function(activator) { PopExtUtil.AddThinkToEnt(activator, "RoundEnd_Think") } ::RoundEnd_Glow <- function() // highlight bots when spawn limit is reached { foreach (bot in PopExtUtil.BotArray) NetProps.SetPropBool(bot,"m_bGlowEnabled",true) } ::RoundEnd_Think <- function() { if (PopExtUtil.CountAliveBots() == 1) { // printl("Wow!") // EntFire(checkpoint_relay, "trigger") EntFireByHandle(checkpoint_relay, "trigger", "", 0, null, null); } } ::RefillAmmo <- function(player) { } ::ApplyTeleportEffects <- function(self) { ScreenFade(self,255,255,255,255,1.5,0,2) ScreenShake(self.GetCenter(),8,128,3,48,0,true) EmitSoundEx ({ sound_name = "Halloween.TeleportVortex.BookSpawn", origin = self.GetCenter(), filter_type = Constants.EScriptRecipientFilter.RECIPIENT_FILTER_DEFAULT }); } ::EnterStrongmann <- function(self) { self.ValidateScriptScope() local scope = self.GetScriptScope(); self.AddCondEx(6,3,null) scope.teleporttime = Time() + STRONGMANN_TIME; // I dunno keep it as like a minute?? scope.isinstrongmannroom = true; // trip look up for playerlogic ScreenFade(self,255,255,255,255,1,0,1) ScreenShake(self.GetCenter(),16,144,2,48,0,true) local strongmannwarp = Entities.FindByName(null, "warp_destination") self.Teleport(true,strongmannwarp.GetCenter(),true,strongmannwarp.GetAbsAngles(),false,self.GetAbsVelocity()); EmitSoundEx ({ sound_name = "Halloween.TeleportVortex.BookExit", origin = self.GetCenter(), filter_type = Constants.EScriptRecipientFilter.RECIPIENT_FILTER_DEFAULT }); } ::ExitStrongmann <- function(self) { self.ValidateScriptScope() local scope = self.GetScriptScope(); local startwarp = Entities.FindByName(null, "red_spawn") self.AddCondEx(6,3,null) ScreenFade(self,255,255,255,255,1,0,1) ScreenShake(self.GetCenter(),16,144,2,48,0,true) self.Teleport(true,startwarp.GetCenter(),true,startwarp.GetAbsAngles(),false,self.GetAbsVelocity()); EmitSoundEx ({ sound_name = "Halloween.TeleportVortex.BookExit", origin = self.GetCenter(), filter_type = Constants.EScriptRecipientFilter.RECIPIENT_FILTER_DEFAULT }); } ::SpawnPowerup <- function(player) // zombie_spawn_parent, lightning particle name { EmitSoundEx ({ sound_name = "misc/halloween/merasmus_spell.wav", origin = player.GetCenter(), filter_type = Constants.EScriptRecipientFilter.RECIPIENT_FILTER_DEFAULT }); local powerup = Entities.FindByName(null, PowerupTable[powerupindex]) // DispatchParticleEffect("zombie_spawn_parent",player.GetCenter(),player.GetAbsAngles()) powerup.SetAbsOrigin(player.GetCenter()); EntFireByHandle(powerup, "forcespawn", "", 0, player, player); powerupindex += 1 if (powerupindex >= 4) // limit so minigun can't get rolled, for now { powerupindex = 0 } } ::ActivateInstakill <- function(self) { EmitSoundEx ({ sound_name = "items/powerup_pickup_crits.wav", origin = self.GetCenter(), filter_type = Constants.EScriptRecipientFilter.RECIPIENT_FILTER_DEFAULT }); EmitSoundEx ({ sound_name = "deadlands/powerup_instagib.mp3", origin = self.GetCenter(), // delay = -1.5, filter_type = Constants.EScriptRecipientFilter.RECIPIENT_FILTER_DEFAULT }); self.AddCondEx(56,30,null) ClientPrint(self, HUD_PRINTCENTER, "Instakill!"); } ::ActivateMaxammo <- function(self) { EmitSoundEx ({ sound_name = "deadlands/pickup_maxammo.mp3", origin = self.GetCenter(), filter_type = Constants.EScriptRecipientFilter.RECIPIENT_FILTER_DEFAULT }); EmitSoundEx ({ sound_name = "deadlands/powerup_maxammo.mp3", origin = self.GetCenter(), // delay = -1.5, filter_type = Constants.EScriptRecipientFilter.RECIPIENT_FILTER_DEFAULT }); ClientPrint(self, HUD_PRINTCENTER, "Max Ammo!"); } ::ActivateBonuspoints <- function(self) { self.AddCurrency(2000) ClientPrint(self, HUD_PRINTCENTER, "Bonus Points!"); EmitSoundEx ({ sound_name = "deadlands/pickup_bonuspoints.mp3", origin = self.GetCenter(), filter_type = Constants.EScriptRecipientFilter.RECIPIENT_FILTER_DEFAULT }); EmitSoundEx ({ sound_name = "deadlands/powerup_bonuspoints.mp3", // delay = -1.5, origin = self.GetCenter(), filter_type = Constants.EScriptRecipientFilter.RECIPIENT_FILTER_DEFAULT }); } ::ActivateDoublePoints <- function(self) { local scope = self.GetScriptScope(); scope.doublepointstime = Time() + POWERUP_TIME; ClientPrint(self, HUD_PRINTCENTER, "Double Points!"); EmitSoundEx ({ sound_name = "items/powerup_pickup_haste.wav", origin = self.GetCenter(), filter_type = Constants.EScriptRecipientFilter.RECIPIENT_FILTER_DEFAULT }); EmitSoundEx ({ sound_name = "deadlands/powerup_doublepoints.mp3", // delay = -1.5, origin = self.GetCenter(), filter_type = Constants.EScriptRecipientFilter.RECIPIENT_FILTER_DEFAULT }); } ::ActivateNuke <- function(self) { PopExtUtil.PlaySoundOnAllClients("misc/doomsday_missile_explosion.wav") ScreenFade(self,255,255,255,255,1.5,0,1) ScreenShake(self.GetCenter(),16,144,3,48,0,true) foreach (bot in PopExtUtil.BotArray) { if (PopExtUtil.IsAlive(bot) && !bot.HasBotTag("Cooldude")) { bot.TakeDamage(bot.GetHealth(),DMG_ALWAYSGIB,self) } } EmitSoundEx ({ sound_name = "deadlands/powerup_nuke.mp3", // delay = -1.5, origin = self.GetCenter(), filter_type = Constants.EScriptRecipientFilter.RECIPIENT_FILTER_DEFAULT }); } ::ActivateMinigun <- function(self) { self.ValidateScriptScope() local scope = self.GetScriptScope(); EmitSoundEx ({ sound_name = "deadlands/pickup_minigun.mp3", origin = self.GetCenter(), filter_type = Constants.EScriptRecipientFilter.RECIPIENT_FILTER_DEFAULT }); EmitSoundEx ({ sound_name = "deadlands/powerup_minigun.wav", delay = -1.5, origin = self.GetCenter(), filter_type = Constants.EScriptRecipientFilter.RECIPIENT_FILTER_DEFAULT }); ClientPrint(self, HUD_PRINTCENTER, "Death Machine!"); CustomWeapons.GiveItem("Death Machine", self); self.SetIsMiniBoss(true) scope.miniguntime = Time() + POWERUP_TIME; if (scope.miniguntime < Time()) { PopExtUtil.StripWeapon(self,0); GetPlayerLoadout(self) } } ::PlayPerkAnimation <- function(self) // disabled mostly until I can figure out how to call a secondary weapon from scope { // local main_viewmodel = GetPropEntity(self, "m_hViewModel") // CustomWeapons.EquipItem("Perk Bottle", self); // main_viewmodel.SetSequence(main_viewmodel.LookupSequence("bb_fire_red")) // main_viewmodel.ResetSequence(main_viewmodel.LookupSequence("bb_fire_red")) // main_viewmodel.SetPlaybackRate(0.7) PopExtUtil.PlaySoundOnClient(self,"Scout.DodgeCanDrink",1.0,80) } ::RollZombieModel <- function(self) { local diceroll = RandomInt(0,8) local model = ModelTable[diceroll] // local currentweapon = self.GetActiveWeapon() // 572 unarmed combat // self.SetCustomModelWithClassAnimations(model) EntFireByHandle(particle_brush1, "starttouch", "", 0, self, self); EntFireByHandle(particle_brush2, "starttouch", "", 0, self, self); } ::ExitStageLeft <- function() // remove bot from wave counter { local botcount = NetProps.GetPropInt(PopExtUtil.ObjectiveResource, "m_nMannVsMachineWaveClassCounts") local enemycount = NetProps.GetPropInt(PopExtUtil.ObjectiveResource, "m_nMannVsMachineWaveEnemyCount") local diceroll = RandomInt(1,100) botcount-= 1 // enemycount-= 1 NetProps.SetPropInt(PopExtUtil.ObjectiveResource, "m_nMannVsMachineWaveClassCounts", botcount) // NetProps.SetPropInt(PopExtUtil.ObjectiveResource, "m_nMannVsMachineWaveEnemyCount", enemycount) }