-------------------------------------------------------------- -- Includes -------------------------------------------------------------- require('o_mis') require('o_ShootingGallery') require('ai/MINIGAME/SG_GF/L_NS_SG') -- @TODO: Add Path Changing on waypoint, need to get [Closest Waypoint on New Path] -- Also need [Number of Waypoints on Path] -- @TODO: Optimize -------------------------------------------------------------- -- Locals and Constants LOCALS = {} CONSTANTS = {} STORECONSTANTS = {} -------------------------------------------------------------- -- Start Location for the Zone CONSTANTS["PLAYER_START_POSx"] = -908.542480 CONSTANTS["PLAYER_START_POSy"] = 229.773178 CONSTANTS["PLAYER_START_POSz"] = -908.542480 CONSTANTS["PLAYER_START_ROTw"] = 0.91913521289825 CONSTANTS["PLAYER_START_ROTx"] = 0 CONSTANTS["PLAYER_START_ROTy"] = 0.39394217729568 CONSTANTS["PLAYER_START_ROTz"] = 0 -- cannon constants CONSTANTS["CANNON_TEMPLATEID"] = 1864 CONSTANTS["IMPACT_SKILLID"] = 34 CONSTANTS["PROJECTILE_TEMPLATEID"] = 1822 CONSTANTS["CANNON_PLAYER_OFFSETx"] = 6.652 CONSTANTS["CANNON_PLAYER_OFFSETy"] = 0 CONSTANTS["CANNON_PLAYER_OFFSETz"] = -1.188 CONSTANTS["Reward_Model_Matrix"] = 157 CONSTANTS["CANNON_VELOCITY"] = 400 --129.0 CONSTANTS["CANNON_MIN_DISTANCE"] = 30.0 CONSTANTS["CANNON_REFIRE_RATE"] = 800.0 --800 CONSTANTS["CANNON_BARREL_OFFSETx"] = 0 CONSTANTS["CANNON_BARREL_OFFSETy"] = 4.3 CONSTANTS["CANNON_BARREL_OFFSETz"] = 9 CONSTANTS["CANNON_SUPER_CHARGE"] = 6297 CONSTANTS["CANNON_PROJECTILE"] = 1822 CONSTANTS["CANNON_SUPERCHARGE_SKILL"] = 249 CONSTANTS["CANNON_SKILL"] = 228 CONSTANTS["CANNON_TIMEOUT"] = -1 CONSTANTS["CANNON_FOV"] = 22 CONSTANTS["CANNON_USE_LEADERBOARDS"] = true CONSTANTS["STREAK_MOD"] = 2 -- for Animations STORECONSTANTS["VALID_ACTORS"] = {3109, 3110, 3111, 3112, 3125, 3126} STORECONSTANTS["STREAK_BONUS"] = {1,2,5,10} STORECONSTANTS["VALID_EFFECTS"] = {3122} -- Super Charger is charged for this amount of time CONSTANTS["ChargedTime"] = 10 -- The amount of points needed to supper charge CONSTANTS["ChargedPoints"] = 25000 -- Modle reward grp name CONSTANTS["Reward_Model_GrpName"] = "QBRewardGroup" -- Activity ID CONSTANTS["ActivityID"] = 14 -- Activity ID -- Reward Score and Loot Matrix\ -- 1 CONSTANTS["Score_Reward_1"] = 50000 CONSTANTS["Score_LootMatrix_1"] = 157 -- 2 CONSTANTS["Score_Reward_2"] = 100000 CONSTANTS["Score_LootMatrix_2"] = 187 -- 3 CONSTANTS["Score_Reward_3"] = 200000 CONSTANTS["Score_LootMatrix_3"] = 188 -- 4 CONSTANTS["Score_Reward_4"] = 400000 CONSTANTS["Score_LootMatrix_4"] = 189 -- 5 CONSTANTS["Score_Reward_5"] = 800000 CONSTANTS["Score_LootMatrix_5"] = 190 ACTORS = {} -- stores actors for the instance EFFECTS = {} -- stores effects for the instance -------------------------------------------------------------- -- Wave Data waves = {} PLAYER_SCORE = {} -------------------------------------------------------------- -- Syntax: [Time] [Text to Show Player] -------------------------------------------------------------- AddWave(waves, 30.0, "Wave;One" ) AddWave(waves, 30.0, "Wave;Two" ) AddWave(waves, 30.0, "Wave;Three" ) -- wave constants STORECONSTANTS["NUM_WAVES"] = #waves CONSTANTS["FIRST_WAVE_START_TIME"] = 4.0 CONSTANTS["IN_BETWEEN_WAVE_PAUSE"] = 7.0 -------------------------------------------------------------- -- Spawn Data spawns = {} SPAWN_DATA = {} -------------------------------------------------------------- -- Startup do not chaged!!! -------------------------------------------------------------- function onStartup(self) targetSettings(self) -- set game state LOCALS["GameStarted"] = false LOCALS["CurSpawnNum"] = 0 LOCALS["ThisWave"] = 0 LOCALS["GameScore"] = 0 LOCALS["GameTime"] = 0 LOCALS["NumShots"] = 0 LOCALS["NumKills"] = 0 LOCALS["MaxStreak"] = 0 self:SetVar("StreakBouns",0) self:SetVar("StopCharge", false ) self:SetVar("NumberOfCharges", 0 ) wave1Score = 0 wave2Score = 0 wave3Score = 0 self:SetVar("WaveStatus", true) self:SetVar("StreakBouns", 0) setCONSTANTS( self,spawns,SPAWN_DATA,CONSTANTS , waves, PLAYER_SCORE, EFFECTS , ACTORS,STORECONSTANTS ) self:SetVar("CONSTANTS", CONSTANTS) self:SetVar("timelimit", waves[1].timeLimit) totalscore = 0 end -------------------------------------------------------------- -- target Settings -------------------------------------------------------------- function targetSettings(self) -- AddPath - adds a path to a spawn. Can have one or more. -- Syntax: AddPath(paths, "[Path Name]") -- AddSpawn - configures data for the spawn and adds it. Can -- only have one. -- Syntax: AddSpawn(spawn, paths, [Template ID], -- [Initial Spawn Time Min], [Initial Spawn Time Max], [Does Respawn], -- [Respawn Time Min], [Respawn Time Max], -- [Initial Speed], [Score], [Change Speed at Waypoints], -- [Chance to Change Speed], [Min Speed], [Max Speed], -- [Is Moving Platform], [Despawn On Last Waypoint], [Time Score]) -- -- NOTE: All times are in Seconds (i.e. 3.50 = 3 and a half seconds) -------------------------------------------------------------- -- Wave 1 Spawns spawn = {} -------------------------------------------------------------- -- Ducks 1 -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_1_Ducks_1") AddPath(paths, "Row_2_Ducks_1") AddPath(paths, "Row_3_Ducks_1") AddSpawn(spawn,paths, 6920, 0.0, 2.0, true, 2.0, 5.0, 2.0, 1500, false, 0.0, 1.0, 1.0, true, true, 0.0) -- Ducks 3 -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_1_Ducks_3") AddPath(paths, "Row_2_Ducks_3") AddPath(paths, "Row_3_Ducks_3") AddSpawn(spawn,paths, 6919, 0.0, 2.0, true, 2.0, 5.0, 10.0, 1000, false, 0.0, 1.0, 1.0, true, true, 0.0) -- Friendly -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_2_BullsEye_1_wave_1") AddPath(paths, "Row_3_BullsEye_2_wave_1") AddSpawn(spawn,paths, 6940, 1.0, 8.0, false, 2.0, 5.0, 1.0, -1000, false, 0.0, 1.0, 1.0, true, true, 0.0) -- Friendly ---------------------------------------------------------- paths = {} ---------------------------------------------------------- AddPath(paths, "Row_2_BullsEye_2_wave_1") AddPath(paths, "Row_3_BullsEye_1_wave_1") AddSpawn(spawn,paths, 6940, 10.0, 20.0, false, 2.0, 5.0, 1.0, -1000, false, 0.0, 1.0, 1.0, true, true, 0.0) -- Add the spawns for the wave AddSpawnsForWave(spawns,spawn) -------------------------------------------------------------- -- Wave 2 Spawns spawn = {} -------------------------------------------------------------- -- Ducks 1 -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_1_Ducks_1") AddPath(paths, "Row_2_Ducks_1") AddPath(paths, "Row_3_Ducks_1") AddSpawn(spawn,paths, 6918, 0.0, 2.0, true, 2.0, 5.0, 2.0, 1500, false, 0.0, 1.0, 1.0, true, true, 0.0) -- Ducks 2 -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_1_Ducks_2") AddPath(paths, "Row_2_Ducks_2") AddPath(paths, "Row_3_Ducks_2") AddSpawn(spawn,paths, 6920, 0.0, 2.0, true, 2.0, 5.0, 2.0, 500, false, 0.0, 1.0, 1.0, true, true, 0.0) -- Ducks 3 -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_1_Ducks_3") AddPath(paths, "Row_2_Ducks_3") AddPath(paths, "Row_3_Ducks_3") AddSpawn(spawn,paths, 6919, 0.0, 2.0, true, 2.0, 5.0, 10.0, 1000, false, 0.0, 1.0, 1.0, true, true, 0.0) -- Friendly -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_1_BullsEye_1_wave_2") AddPath(paths, "Row_3_BullsEye_1_wave_2") AddSpawn(spawn,paths, 6940, 1.0, 8.0, false, 10.0, 15.0, 1.0, -1000, false, 0.0, 1.0, 1.0, true, true, 0.0) -- Friendly -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_2_BullsEye_2_wave_2") AddPath(paths, "Row_3_BullsEye_2_wave_2") AddSpawn(spawn,paths, 6940, 10.0, 18.0, false, 10.0, 15.0, 1.0, -1000, false, 0.0, 1.0, 1.0, true, true, 0.0) -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_2_BullsEye_1_wave_2") AddPath(paths, "Row_1_BullsEye_2_wave_2") AddSpawn(spawn,paths, 6940, 21.0, 27.0, false, 10.0, 15.0, 1.0, -1000, false, 0.0, 1.0, 1.0, true, true, 0.0) -- Add the spawns for the wave AddSpawnsForWave(spawns,spawn) -------------------------------------------------------------- -- Wave 3 Spawns spawn = {} -------------------------------------------------------------- -- Ducks 1 -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_1_Ducks_1") AddPath(paths, "Row_2_Ducks_1") AddPath(paths, "Row_3_Ducks_1") AddSpawn(spawn,paths, 6919, 0.0, 2.0, true, 2.0, 5.0, 2.0, 1500, false, 0.0, 1.0, 1.0, true, true, 0.0) -- Ducks 2 -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_1_Ducks_2") AddPath(paths, "Row_2_Ducks_2") AddPath(paths, "Row_3_Ducks_2") AddSpawn(spawn,paths, 6918, 0.0, 2.0, true, 2.0, 5.0, 2.0, 500, false, 0.0, 1.0, 1.0, true, true, 0.0) -- Ducks 3 -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_1_Ducks_3") AddPath(paths, "Row_2_Ducks_3") AddPath(paths, "Row_3_Ducks_3") AddSpawn(spawn,paths, 6920, 0.0, 2.0, true, 2.0, 5.0, 10.0, 1000, false, 0.0, 1.0, 1.0, true, true, 0.0) -- Ducks 4 -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_1_Ducks_4") AddPath(paths, "Row_2_Ducks_4") AddPath(paths, "Row_3_Ducks_4") AddSpawn(spawn,paths, 6919, 0.0, 2.0, true, 2.0, 5.0, 10.0, 1000, false, 0.0, 1.0, 1.0, true, true, 0.0) -- -- Sub 1 ------------------------------------------------------------ -- paths = {} ------------------------------------------------------------ -- AddPath(paths, "Wave_1_Sub_1") -- AddPath(paths, "Wave_1_Sub_2") -- AddSpawn(spawn,paths, -- 6920, 0.0, 2.0, true, 0, 2, 2.0, 1000, false, 0.0, 1.0, 1.0, true, true, 0.0) -- Friendly -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_1_BullsEye_1_wave_3") AddPath(paths, "Row_3_BullsEye_2_wave_3") AddSpawn(spawn,paths, 6940, 0.0, 5.0, false, 10.0, 15.0, 1.0, -1000, false, 0.0, 1.0, 1.0, true, true, 0.0) -- Friendly 2 -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_2_BullsEye_1_wave_3") AddPath(paths, "Row_3_BullsEye_1_wave_3") AddSpawn(spawn,paths, 6940, 5.0, 10.0, false, 10.0, 15.0, 1.0, -1000, false, 0.0, 1.0, 1.0, true, true, 0.0) -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_1_BullsEye_2_wave_3") AddPath(paths, "Row_2_BullsEye_2_wave_3") AddSpawn(spawn,paths, 6940, 10.0, 15.0, false, 10.0, 15.0, 1.0, -1000, false, 0.0, 1.0, 1.0, true, true, 0.0) -------------------------------------------------------------- paths = {} -------------------------------------------------------------- AddPath(paths, "Row_3_BullsEye_3_wave_3") AddSpawn(spawn,paths, 6940, 20.0, 25.0, false, 10.0, 15.0, 1.0, -1000, false, 0.0, 1.0, 1.0, true, true, 0.0) -- Add the spawns for the wave AddSpawnsForWave(spawns,spawn) end ---------------------------------------------------------------------------------------------------------------------------- -- Do not Chage -- ---------------------------------------------------------------------------------------------------------------------------- function onPlayerLoaded(self, msg) if (msg) then mainPlayerLoaded(self, msg) end end function onObjectLoaded(self, msg) if (msg) then mainObjectLoaded(self, msg) end end function onNotifyObject(self, msg) if( msg) then mainNotifyObject(self, msg) end end function onPlayerExit( self, msg) if (msg) then mainPlayerExit( self, msg) end end function onShootingGalleryFire(self, msg) if (msg) then mainShootingGalleryFire( self, msg) end end