PrecacheModel("models/props_mvm/robot_spawnpoint_warning.mdl") PrecacheSound("weapons/dragons_fury_impact_bonus_damage_hit.wav") PrecacheSound("player/pl_impact_airblast1.wav") local areas = {} GetAllAreas(areas) // function LookAtTheClosestPlayer() // { // local closest = 1e9; // local aimat = Vector(); // local eye_pos = self.EyePosition() // for(local player; player = Entities.FindByClassname(player, "player");) // { // if(player.GetTeam() == self.GetTeam() || NetProps.GetPropInt(player, "m_lifeState") != 0) // continue; // local direction = player.GetCenter() - eye_pos; // local distance = direction.Length(); // if(distance < closest) { // closest = distance; // aimat = direction; // } // } // if(aimat) { // aimat.Norm() // self.SetForwardVector(aimat) // } // return -1; // } // AddThinkToEnt(GetListenServerHost(),"LookAtTheClosestPlayer") // Then you can add traceline check // function LookAtTheClosestPlayer(who) { // local closest = 1e9; // local aimat = null; // local eye_pos = who.EyePosition(); // local line = { // mask = 16395, //MASK_SOLID_BRUSHONLY // ignore = who, // start = eye_pos, // end = null // } // for(local player; player = Entities.FindByClassname(player, "player");) { // if(player.GetTeam() == who.GetTeam() || NetProps.GetPropInt(player, "m_lifeState") != 0) // continue; // local center = player.GetCenter(); // local direction = center - eye_pos; // local distance = direction.Length(); // if(distance < closest) { // line.end = center; // TraceLineEx(line); // if(!line.hit) { // closest = distance; // aimat = direction; // } // } // } // if(aimat) { // aimat.Norm() // who.SetForwardVector(aimat) // } // } // LookAtTheClosestPlayer(GetListenServerHost()) //ATTACKS //-Draco Meteor: Summon meteors (rockets or fireballs) from the sky. they land in different areas of the map //-Flamethrower: Use primary weapon //-Flame Lash: Fires several flares in a line //-Fire Bomb: Charge explosives, then launch them ::BombThink <- function() { //printl("piper") velocityNum++ // printl(velocityNum) // printl(velocityPipeInit) // if (velocityNum >= 40) // { // self.SetPhysVelocity(Vector(velocityPipeInit.x, velocityPipeInit.y, velocityNum * velocityNum)) // } // if (velocityNum >= 50) // { // self.SetPhysVelocity(Vector(velocityPipeInit.x, velocityPipeInit.y, velocityNum / velocityNum)) // } // if (velocityNum <= 40) // { // self.SetPhysVelocity(Vector(0, 0, velocityNum * 2)) // } if (NetProps.GetPropBool(self, "m_bTouched") == true) { local origin = self.GetOrigin() local blast = NetProps.GetPropFloat(self, "m_DmgRadius") local damage = NetProps.GetPropFloat(self, "m_flDamage") + 40 local launcher = NetProps.GetPropInt(self, "m_hOriginalLauncher") local soundlevel = (40 + (20 * log10(1300 / 36.0))).tointeger(); for(local enemy; enemy = FindByClassnameWithin(enemy, "player", origin, blast);) { if (enemy.GetTeam() != shooter && enemy.GetTeam() != TEAM_SPECTATOR) { if (enemy.InCond(30) || enemy.InCond(24)) { enemy.TakeDamageEx(null, shooter, launcher, Vector(0, 0, 0), enemy.GetOrigin(), damage * 1.35, 64) // blast } else { enemy.TakeDamageEx(null, shooter, launcher, Vector(0, 0, 0), enemy.GetOrigin(), damage, 64) // blast } } } DispatchParticleEffect("projectile_fireball", origin, Vector(0, 0, 0)) DispatchParticleEffect("heavy_ring_of_fire_child01", origin, Vector(0, 0, 0)) EmitSoundEx({ sound_name = "weapons/dragons_fury_impact_bonus_damage_hit.wav", origin = origin, sound_level = soundlevel }); EmitSoundEx({ sound_name = "player/pl_impact_airblast1.wav", origin = origin, sound_level = soundlevel }); self.Kill() } } ::GiantModeThink <- function() { local buttons_giantmode = NetProps.GetPropInt(self, "m_nButtons"); local buttons_changed_giantmode = buttons_last_giantmode ^ buttons_giantmode; local buttons_pressed_giantmode = buttons_changed_giantmode & buttons_giantmode; local buttons_released_giantmode = buttons_changed_giantmode & (~buttons_giantmode); local activeWep = self.GetActiveWeapon() local wepID = NetProps.GetPropInt(activeWep, "m_AttributeManager.m_Item.m_iItemDefinitionIndex") local primary = PopExtUtil.GetItemInSlot(self, 0) local second = PopExtUtil.GetItemInSlot(self, 1) local melee = PopExtUtil.GetItemInSlot(self, 2) local curOrigin = self.GetOrigin() local maxhp = self.GetMaxHealth() local curHp = self.GetHealth() local playerScope = self.GetScriptScope() local fire_time = NetProps.GetPropFloat(second, "m_flLastFireTime"); ////printl(fire_time) //////////////////////ATTACK 3 ///////////////////////////////// if (self.InCond(51)) return tickAttack() function SpawnFlare(player, offset) { local eye_angle = player.EyeAngles(); NetProps.SetPropVector(player, "pl.v_angle", eye_angle + offset + Vector()) NetProps.SetPropEntity(flaregun, "m_hOwner", player); NetProps.SetPropFloat(flaregun, "m_flNextPrimaryAttack", 0); flaregun.PrimaryAttack(); NetProps.SetPropVector(player, "pl.v_angle", eye_angle + Vector()) } function SpawnBombs(player, offset) { local eye_angle = player.EyeAngles(); local forwardvelo = player.EyePosition()+player.EyeAngles().Forward()*50 local propos = player.EyePosition() NetProps.SetPropVector(player, "pl.v_angle", eye_angle + offset + Vector()) NetProps.SetPropEntity(bomb, "m_hOwner", player); NetProps.SetPropFloat(bomb, "m_flNextPrimaryAttack", 0); bomb.PrimaryAttack(); NetProps.SetPropVector(player, "pl.v_angle", eye_angle + Vector()) } //for some reason spawnbombs takes limited calls, create a second one function SpawnBombs2(player, offset) { local eye_angle = player.EyeAngles(); NetProps.SetPropVector(player, "pl.v_angle", eye_angle + offset + Vector()) NetProps.SetPropEntity(bomb2, "m_hOwner", player); NetProps.SetPropFloat(bomb2, "m_flNextPrimaryAttack", 0); bomb2.PrimaryAttack(); NetProps.SetPropVector(player, "pl.v_angle", eye_angle + Vector()) } if (activateFlare == true) { for(local pipe; pipe = FindByClassname(pipe, "tf_projectile_pipe");) { if (pipe == null) continue if (pipe.GetOwner() == bomb.GetOwner() || pipe.GetOwner() == bomb2.GetOwner()) { //printl(pipe) local pipeScope = pipe.GetScriptScope() pipe.SetModelSimple("models/passtime/ball/passtime_ball_halloween.mdl") EntFireByHandle(pipe, "Ignite", "", 0, null, null) local pipeVel = GetPhysVelocity(pipe) pipe.GetScriptScope().ProjectileThinkTable <- {} pipe.ValidateScriptScope(); if (!("BombThink" in pipeScope.ProjectileThinkTable)) { pipeScope.shooter <- self pipeScope.velocityNum <- 0 pipeScope.velocityPipeInit <- pipeVel pipeScope.ProjectileThinkTable.BombThink <- BombThink } } if (pipe == null) { activateFlare = false break } } } //printl(flareTimer) if (pipeBombCheck == true) { flareTimer++ self.AddCondEx(87, 0.1, null) self.AddCustomAttribute("move speed penalty", 0.01, 0.1) self.AddCustomAttribute("no_jump", 1, 2) } if (flareTimer <= 87) { for(local propkin; propkin = FindByName(propkin, "pumpkin");) { if (propkin != null && propkin.IsValid()) { EntFireByHandle(propkin, "Ignite", "", 0, null, null) propkin.SetAbsAngles(QAngle(flareTimer, flareTimer, flareTimer)) } } } if (flareTimer == 87) { for(local propkin; propkin = FindByName(propkin, "pumpkin");) { if (propkin != null && propkin.IsValid()) { propkin.Kill() } } SpawnBombs(self, QAngle(0, 90)) SpawnBombs(self, QAngle(0, 180)) SpawnBombs(self, QAngle(0, -180)) SpawnBombs(self, QAngle(0, -90)) SpawnBombs2(self, QAngle(0, 45)) SpawnBombs2(self, QAngle(0, -45)) SpawnBombs2(self, QAngle(0, 0)) SpawnBombs2(self, QAngle(45, 0)) SpawnBombs2(self, QAngle(-45, 0)) pipeBombCheck = false flareTimer = 0 } if (buttons_pressed_giantmode & Constants.FButtons.IN_ATTACK2) { //printl("create projectile") if(!("bomb" in getroottable()) || !bomb.IsValid()) { bomb <- Entities.CreateByClassname("TF_WEAPON_GRENADELAUNCHER"); NetProps.SetPropInt(bomb, "m_AttributeManager.m_Item.m_iItemDefinitionIndex", 206); NetProps.SetPropInt(bomb, "m_AttributeManager.m_Item.m_bInitialized", 1); bomb.DispatchSpawn(); bomb.AddAttribute("fuse bonus", 99, -1) } if(!("bomb2" in getroottable()) || !bomb2.IsValid()) { bomb2 <- Entities.CreateByClassname("TF_WEAPON_GRENADELAUNCHER"); NetProps.SetPropInt(bomb2, "m_AttributeManager.m_Item.m_iItemDefinitionIndex", 206); NetProps.SetPropInt(bomb2, "m_AttributeManager.m_Item.m_bInitialized", 1); bomb2.DispatchSpawn(); bomb2.AddAttribute("fuse bonus", 99, -1) } pipeBombCheck = true flareTimer = 0 local summonFire = SpawnEntityFromTable("info_particle_system", { targetname = "summoning_fire", origin = self.GetOrigin(), angles = Vector(0, 0, 0), effect_name = "utaunt_headless_fire", flag_as_weather = 0, }) EntFireByHandle(summonFire, "start", "", -1, null, null) EntFireByHandle(summonFire, "Kill", "", 3, null, null) local bombProp1 = SpawnEntityFromTable("prop_dynamic", { targetname = "pumpkin" origin = self.GetOrigin() + Vector(50, 0, 70), model = "models/passtime/ball/passtime_ball_halloween.mdl", solid = 0 }) local bombProp1 = SpawnEntityFromTable("prop_dynamic", { targetname = "pumpkin" origin = self.GetOrigin() + Vector(0, 50, 70), model = "models/passtime/ball/passtime_ball_halloween.mdl", solid = 0 }) local bombProp1 = SpawnEntityFromTable("prop_dynamic", { targetname = "pumpkin" origin = self.GetOrigin() + Vector(0, -50, 70), model = "models/passtime/ball/passtime_ball_halloween.mdl", solid = 0 }) local bombProp1 = SpawnEntityFromTable("prop_dynamic", { targetname = "pumpkin" origin = self.GetOrigin() + Vector(-50, 0, 70), model = "models/passtime/ball/passtime_ball_halloween.mdl", solid = 0 }) local bombProp1 = SpawnEntityFromTable("prop_dynamic", { targetname = "pumpkin" origin = self.GetOrigin() + Vector(-25, 25, 70), model = "models/passtime/ball/passtime_ball_halloween.mdl", solid = 0 }) local bombProp1 = SpawnEntityFromTable("prop_dynamic", { targetname = "pumpkin" origin = self.GetOrigin() + Vector(25, -25, 70), model = "models/passtime/ball/passtime_ball_halloween.mdl", solid = 0 }) local bombProp1 = SpawnEntityFromTable("prop_dynamic", { targetname = "pumpkin" origin = self.GetOrigin() + Vector(-25, -25, 70), model = "models/passtime/ball/passtime_ball_halloween.mdl", solid = 0 }) local bombProp1 = SpawnEntityFromTable("prop_dynamic", { targetname = "pumpkin" origin = self.GetOrigin() + Vector(25, 25, 70), model = "models/passtime/ball/passtime_ball_halloween.mdl", solid = 0 }) } buttons_last_giantmode = buttons_giantmode; } ::GiantModeEnable <- function() { ////printl(self) local playerScope = self.GetScriptScope() local wep = PopExtUtil.GetItemInSlot(self, 1) self.ValidateScriptScope(); if (!("PlayerThinkTable" in self.GetScriptScope())) player.GetScriptScope().PlayerThinkTable <- {} if (self.HasBotTag("boss_bomber")) { playerScope.buttons_last_giantmode <- 0 playerScope.pipeBombCheck <- false self.PressAltFireButton(0.1) playerScope.flareTimer <- 0 playerScope.activateFlare <- true playerScope.last_fire_time <- 0 playerScope.attackTime <- 5 playerScope.serverTime <- 0 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 > 0) { attackTime-- } if (attackTime == 0) { self.PressAltFireButton(0.1) attackTime = 8 } //printl(caberTimer) } } playerScope.PlayerThinkTable.GiantModeThink <- GiantModeThink } } // function OnGameEvent_player_spawn(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)) // { // if (!player.HasBotTag("boss_bomber")) return // EntFireByHandle(player, "CallScriptFunction", "GiantModeEnable", 0.1, null, null); // } // } __CollectGameEventCallbacks(this); //EntFireByHandle(player, "CallScriptFunction", "GiantModeEnable", 0, null, null);