From bd51490b14080659b01be5fdf6c9af09620f5f6e Mon Sep 17 00:00:00 2001 From: Robert Fritzen Date: Wed, 26 Feb 2014 13:54:04 -0600 Subject: [PATCH] Initial Commit --- .gitattributes | 22 + .gitignore | 215 + ConstructionPreferences.cs | 7 + Credits.txt | 56 + Launch TWM2 Dedicated Server.bat | 14 + Launch TWM2 Online.bat | 14 + MergeToolTemp.txt | 22 + README.md | 497 ++ TWM2.tsdev | Bin 0 -> 53823 bytes missions/CenturyMaze.mis | 452 ++ missions/ChristmasMall09.mis | 470 ++ missions/DerGott.mis | 474 ++ missions/EngelamHimmel.mis | 920 ++++ missions/FlatlandBigH.mis | 144 + missions/FrozenNight.mis | 469 ++ missions/GeometricOrder.mis | 393 ++ missions/HarbingerTower.mis | 676 +++ missions/HelljumpIsland.mis | 178 + missions/MyrkWood2.mis | 1828 +++++++ missions/Oasis2.mis | 847 +++ missions/SideSwipe.mis | 568 ++ missions/Skyline.mis | 562 ++ missions/Strikers2.mis | 354 ++ missions/WarTowerClassic.mis | 369 ++ missions/slapmydashH.mis | 211 + scripts/ConstructionGame.cs | 194 + scripts/Customize/CustomScripts.cs | 25 + scripts/DominationGame.cs | 512 ++ scripts/HelljumpGame.cs | 2884 ++++++++++ scripts/HordeGame.cs | 1552 ++++++ scripts/HuntersGame.cs | 1615 ++++++ scripts/InfectionGame.cs | 649 +++ scripts/JTLmeteorStorm.cs | 322 ++ scripts/OptionsDlg.cs | 2763 ++++++++++ scripts/RankStuff.cs | 406 ++ scripts/SabotageGame.cs | 638 +++ scripts/SinglePlayerGame.cs | 1303 +++++ scripts/TR2Game.cs | 31 + scripts/TR2heavy_male.cs | 41 + scripts/TR2medium_male.cs | 43 + scripts/TWM2/AI/DroneAI.cs | 549 ++ scripts/TWM2/ArmorFunctions.cs | 687 +++ scripts/TWM2/Bosses/BossDatablocks.cs | 2369 ++++++++ scripts/TWM2/Bosses/ColonelWindshear.cs | 263 + scripts/TWM2/Bosses/GeneralVegenor.cs | 208 + scripts/TWM2/Bosses/GhostOfFire.cs | 426 ++ scripts/TWM2/Bosses/GhostOfLightning.cs | 192 + scripts/TWM2/Bosses/LordRog.cs | 325 ++ scripts/TWM2/Bosses/LordVardison.cs | 954 ++++ scripts/TWM2/Bosses/LordYvex.cs | 372 ++ scripts/TWM2/Bosses/LordraniusTrebor.cs | 418 ++ scripts/TWM2/Bosses/MajorInsignia.cs | 341 ++ scripts/TWM2/Bosses/ShadeLord.cs | 548 ++ scripts/TWM2/Bosses/Stormrider.cs | 379 ++ scripts/TWM2/ChatCommands/Admin.cs | 1007 ++++ scripts/TWM2/ChatCommands/DevAndHost.cs | 360 ++ scripts/TWM2/ChatCommands/Public.cs | 1161 ++++ scripts/TWM2/ChatCommands/SuperAdmin.cs | 769 +++ scripts/TWM2/CustomArmors.cs | 1149 ++++ scripts/TWM2/CustomCamera.cs | 296 + .../ExteriorFunctioning/ArmorDamageEffects.cs | 114 + .../TWM2/ExteriorFunctioning/BloodEffects.cs | 617 +++ .../TWM2/ExteriorFunctioning/KillTrigger.cs | 172 + .../TWM2/ExteriorFunctioning/PconFunctions.cs | 457 ++ scripts/TWM2/ExteriorFunctioning/ProtPatch.cs | 62 + .../TWM2/ExteriorFunctioning/pulsestuff.cs | 742 +++ scripts/TWM2/LoadMod.cs | 155 + scripts/TWM2/Missions/EnemyAc130Above.cs | 217 + scripts/TWM2/Missions/Invasion.cs | 99 + scripts/TWM2/Missions/MissionCore.cs | 512 ++ scripts/TWM2/Missions/RainDown.cs | 82 + scripts/TWM2/Missions/Surrounded.cs | 64 + scripts/TWM2/Missions/Surrounded2.cs | 64 + scripts/TWM2/Missions/TheShallowedCity.cs | 14 + scripts/TWM2/Objects/MedalSeal.cs | 224 + scripts/TWM2/Objects/MissileSatellite.cs | 203 + scripts/TWM2/PGDConnect/ConnectionQueue.cs | 265 + scripts/TWM2/PGDConnect/ServerInteraction.cs | 96 + scripts/TWM2/PGDConnect/UniversalLoading.cs | 51 + scripts/TWM2/PGDConnect/UniversalRanks.cs | 251 + .../TWM2/PGDConnect/UniversalSaving_Client.cs | 151 + scripts/TWM2/PGDConnect/UniversalSupport.cs | 120 + scripts/TWM2/PGDConnect/Warning.txt | 3 + scripts/TWM2/Soldier/LoadSoldierScripts.cs | 3 + scripts/TWM2/Soldier/SoldierCreation.cs | 81 + scripts/TWM2/Systems/AdvancedRankSystem.cs | 456 ++ scripts/TWM2/Systems/ArmorEnergyShields.cs | 77 + scripts/TWM2/Systems/BossSystem.cs | 448 ++ scripts/TWM2/Systems/ChatBot.cs | 392 ++ scripts/TWM2/Systems/ChatLog.cs | 46 + scripts/TWM2/Systems/ClientSettings.cs | 81 + scripts/TWM2/Systems/DChalg.cs | 826 +++ scripts/TWM2/Systems/Directorate.cs | 60 + scripts/TWM2/Systems/HarbingersWrath.cs | 299 + scripts/TWM2/Systems/Keystrokes.cs | 32 + scripts/TWM2/Systems/Killstreak.cs | 1023 ++++ scripts/TWM2/Systems/MainControl.cs | 696 +++ scripts/TWM2/Systems/Medals.cs | 246 + scripts/TWM2/Systems/Messenger.cs | 17 + scripts/TWM2/Systems/NWChallengeIndex.cs | 543 ++ scripts/TWM2/Systems/NewsPanel.cs | 60 + scripts/TWM2/Systems/Perks.cs | 480 ++ scripts/TWM2/Systems/PieceData.cs | 284 + scripts/TWM2/Systems/ScoreHudInventory.cs | 939 ++++ scripts/TWM2/Systems/Store.cs | 572 ++ scripts/TWM2/Systems/SuccessiveKills.cs | 79 + scripts/TWM2/Systems/WeaponChallenges.cs | 365 ++ scripts/TWM2/Systems/Weather.cs | 1028 ++++ scripts/TWM2/Systems/scoremenucmds.cs | 1277 +++++ scripts/TWM2/VehicleReticles.cs | 35 + scripts/TWM2/WARNING - READ.txt | 11 + scripts/TWM2/WeaponFunctions.cs | 314 ++ scripts/TWM2/Zombie/LoadZombieScripts.cs | 13 + scripts/TWM2/Zombie/MiscZombieFunctions.cs | 233 + scripts/TWM2/Zombie/PlayerZombieAttacks.cs | 464 ++ scripts/TWM2/Zombie/PlayerZombieFunctions.cs | 307 ++ scripts/TWM2/Zombie/ZombieCreation.cs | 419 ++ scripts/TWM2/Zombie/ZombieTypes/Demon.cs | 99 + scripts/TWM2/Zombie/ZombieTypes/DemonLord.cs | 612 +++ scripts/TWM2/Zombie/ZombieTypes/DemonUltra.cs | 79 + scripts/TWM2/Zombie/ZombieTypes/EliteDemon.cs | 93 + scripts/TWM2/Zombie/ZombieTypes/GeneralRog.cs | 540 ++ scripts/TWM2/Zombie/ZombieTypes/Lord.cs | 258 + scripts/TWM2/Zombie/ZombieTypes/Normal.cs | 85 + scripts/TWM2/Zombie/ZombieTypes/Rapier.cs | 188 + .../TWM2/Zombie/ZombieTypes/RapierElite.cs | 58 + scripts/TWM2/Zombie/ZombieTypes/Ravenger.cs | 74 + scripts/TWM2/Zombie/ZombieTypes/Shifter.cs | 92 + scripts/TWM2/Zombie/ZombieTypes/Slingshot.cs | 156 + scripts/TWM2/Zombie/ZombieTypes/Sniper.cs | 97 + scripts/TWM2/Zombie/ZombieTypes/Summoner.cs | 104 + .../Zombie/ZombieTypes/VolatileRavenger.cs | 98 + scripts/TWM2/Zombie/ZombieTypes/Wraith.cs | 321 ++ scripts/TWM2/cmddisplaylist.txt | 11 + scripts/TWM2/loadMenu.cs | 134 + scripts/WartowerGame.cs | 283 + scripts/admin.cs | 591 ++ scripts/camera.cs | 720 +++ scripts/chatCommands.cs | 326 ++ scripts/client.cs | 2132 ++++++++ scripts/controlDefaults.cs | 1606 ++++++ scripts/dEffects.cs | 284 + scripts/damageTypes.cs | 804 +++ scripts/deathMessages.cs | 586 ++ scripts/defaultGame.cs | 4824 +++++++++++++++++ scripts/deployables.cs | 2088 +++++++ scripts/do_not_delete/Dfunctions.cs | 1432 +++++ scripts/do_not_delete/Nuclear_blast.cs | 1099 ++++ scripts/editor.cs | 113 + scripts/expertLibraries.cs | 151 + scripts/forceField.cs | 290 + scripts/functions.cs | 1044 ++++ scripts/gameBase.cs | 147 + scripts/hazard.cs | 134 + scripts/hud.cs | 1934 +++++++ scripts/inventory.cs | 919 ++++ scripts/inventoryHud.cs | 2009 +++++++ scripts/ion.cs | 1021 ++++ scripts/item.cs | 1176 ++++ scripts/libraries.cs | 323 ++ scripts/message.cs | 464 ++ scripts/pack.cs | 129 + scripts/packs/CardPack.cs | 259 + scripts/packs/Effectpacks.cs | 1203 ++++ scripts/packs/Medpack.cs | 396 ++ scripts/packs/ZSpawnpack.cs | 401 ++ scripts/packs/ammopack.cs | 311 ++ scripts/packs/blastfloor.cs | 242 + scripts/packs/blastwall.cs | 271 + scripts/packs/blastwwall.cs | 225 + scripts/packs/cratepack.cs | 250 + scripts/packs/deconExamples.cs | 51 + scripts/packs/decorationpack.cs | 382 ++ scripts/packs/door.cs | 509 ++ scripts/packs/escapepodpack.cs | 395 ++ scripts/packs/forcefieldpack.cs | 518 ++ scripts/packs/generator.cs | 145 + scripts/packs/gravityfieldpack.cs | 344 ++ scripts/packs/jumpad.cs | 176 + scripts/packs/largeInventory.cs | 123 + scripts/packs/largeSensor.cs | 129 + scripts/packs/lightpack.cs | 273 + scripts/packs/logoprojectorpack.cs | 240 + scripts/packs/mediumSensor.cs | 129 + scripts/packs/mspine.cs | 282 + scripts/packs/parachutepack.cs | 87 + scripts/packs/repairpack.cs | 658 +++ scripts/packs/satchelCharge.cs | 830 +++ scripts/packs/solarpanel.cs | 143 + scripts/packs/spawnpointpack.cs | 154 + scripts/packs/spine.cs | 316 ++ scripts/packs/switch.cs | 339 ++ scripts/packs/telepadpack.cs | 564 ++ scripts/packs/treepack.cs | 260 + scripts/packs/tripwire.cs | 393 ++ scripts/packs/turretpack.cs | 141 + scripts/packs/vehiclepad.cs | 748 +++ scripts/player.cs | 4633 ++++++++++++++++ scripts/power.cs | 381 ++ scripts/prison.cs | 310 ++ scripts/projectiles.cs | 796 +++ scripts/saveBuilding.cs | 1027 ++++ scripts/scoreList.cs | 129 + scripts/server.cs | 2926 ++++++++++ scripts/serverCommanderMap.cs | 444 ++ scripts/skywrite.cs | 606 +++ scripts/solitudeBlock.cs | 117 + scripts/staticShape.cs | 1598 ++++++ scripts/station.cs | 1265 +++++ scripts/truPhysics.cs | 238 + scripts/turret.cs | 399 ++ scripts/turrets/ELFBarrelLarge.cs | 138 + scripts/turrets/aaBarrelLarge.cs | 265 + scripts/turrets/indoorDeployableBarrel.cs | 312 ++ scripts/turrets/missileBarrelLarge.cs | 171 + scripts/turrets/mortarBarrelLarge.cs | 145 + scripts/turrets/outdoorDeployableBarrel.cs | 236 + scripts/turrets/plasmaBarrelLarge.cs | 308 ++ scripts/turrets/sentryTurret.cs | 213 + scripts/vehicles/VehicleEffects.cs | 672 +++ scripts/vehicles/serverVehicleHud.cs | 555 ++ scripts/vehicles/vehicle.cs | 1766 ++++++ scripts/vehicles/vehicle_DropPod.cs | 458 ++ scripts/vehicles/vehicle_Stormseige.cs | 420 ++ scripts/vehicles/vehicle_TacticalMissile.cs | 454 ++ scripts/vehicles/vehicle_WindshearPlatform.cs | 559 ++ scripts/vehicles/vehicle_ac130.cs | 656 +++ scripts/vehicles/vehicle_bomber.cs | 925 ++++ scripts/vehicles/vehicle_centaurArtillery.cs | 594 ++ scripts/vehicles/vehicle_escapepod.cs | 138 + scripts/vehicles/vehicle_harbingerGunship.cs | 628 +++ scripts/vehicles/vehicle_harrier.cs | 294 + scripts/vehicles/vehicle_havoc.cs | 1071 ++++ scripts/vehicles/vehicle_helicopter.cs | 1585 ++++++ scripts/vehicles/vehicle_mpb.cs | 288 + scripts/vehicles/vehicle_shrike.cs | 727 +++ scripts/vehicles/vehicle_spec_fx.cs | 1156 ++++ scripts/vehicles/vehicle_strikeFighter.cs | 853 +++ scripts/vehicles/vehicle_tank.cs | 1135 ++++ scripts/vehicles/vehicle_wildcat.cs | 206 + scripts/weapTurretCode.cs | 979 ++++ scripts/weapons.cs | 586 ++ scripts/weapons/Construction/EditGun.cs | 637 +++ .../weapons/Construction/constructionTool.cs | 1104 ++++ scripts/weapons/Construction/modifiertool.cs | 953 ++++ scripts/weapons/Construction/superChaingun.cs | 241 + scripts/weapons/Equipment/C4.cs | 66 + scripts/weapons/Equipment/Javelin.cs | 243 + scripts/weapons/Equipment/RPG7.cs | 236 + scripts/weapons/Equipment/SWBeaconer.cs | 2987 ++++++++++ scripts/weapons/Equipment/Stinger.cs | 230 + scripts/weapons/Grenades/cameraGrenade.cs | 169 + scripts/weapons/Grenades/concussionGrenade.cs | 174 + scripts/weapons/Grenades/flareGrenade.cs | 145 + scripts/weapons/Grenades/flashGrenade.cs | 61 + scripts/weapons/Grenades/grenade.cs | 407 ++ scripts/weapons/Grenades/staticGrenade.cs | 54 + scripts/weapons/MGs/MG42.cs | 229 + scripts/weapons/MGs/MRXX.cs | 204 + scripts/weapons/MGs/RP432.cs | 212 + scripts/weapons/Melee/BOV.cs | 294 + scripts/weapons/Melee/Plasmasabre.cs | 245 + scripts/weapons/Melee/melee.cs | 191 + scripts/weapons/Mines/mine.cs | 333 ++ scripts/weapons/Other/AcidCannon.cs | 365 ++ scripts/weapons/Other/ConcussionGun.cs | 202 + scripts/weapons/Other/Flamethrower.cs | 247 + scripts/weapons/Other/IonLauncher.cs | 146 + scripts/weapons/Other/IonRifle.cs | 96 + scripts/weapons/Other/MiniCollider.cs | 111 + scripts/weapons/Other/NapalmLauncher.cs | 117 + scripts/weapons/Other/PlasmaTorpedo.cs | 126 + scripts/weapons/Other/ShadowRifle.cs | 210 + scripts/weapons/Pistols/Colt.cs | 226 + scripts/weapons/Pistols/CrimsonHawk.cs | 204 + scripts/weapons/Pistols/DesertEagle.cs | 192 + scripts/weapons/Pistols/GrappleHook.cs | 280 + scripts/weapons/Pistols/LD06Savager.cs | 163 + scripts/weapons/Pistols/M93.cs | 197 + scripts/weapons/Pistols/PulsePhaser.cs | 247 + scripts/weapons/Pistols/shocklance.cs | 286 + scripts/weapons/Rifles/ALSWPSniper.cs | 210 + scripts/weapons/Rifles/G17Sniper.cs | 225 + scripts/weapons/Rifles/G41.cs | 183 + scripts/weapons/Rifles/M1Sniper.cs | 227 + scripts/weapons/Rifles/M4A1.cs | 267 + scripts/weapons/Rifles/PulseRifle.cs | 176 + scripts/weapons/Rifles/R700Sniper.cs | 268 + scripts/weapons/Rifles/RSALaserRifle.cs | 248 + scripts/weapons/Rifles/S3.cs | 225 + scripts/weapons/Rifles/S3S.cs | 176 + scripts/weapons/SMGs/MP26.cs | 230 + scripts/weapons/SMGs/MP26CMDO.cs | 214 + scripts/weapons/SMGs/P90.cs | 233 + scripts/weapons/SMGs/Pg700.cs | 250 + scripts/weapons/SMGs/PulseSMG.cs | 225 + scripts/weapons/SMGs/chaingun.cs | 600 ++ scripts/weapons/Shotguns/M1700.cs | 224 + scripts/weapons/Shotguns/Model1887.cs | 218 + scripts/weapons/Shotguns/SA2400.cs | 326 ++ scripts/weapons/Shotguns/SCD343.cs | 219 + scripts/weapons/Shotguns/Wp400.cs | 213 + scripts/weapons/T2Guns/ELFGun.cs | 180 + scripts/weapons/T2Guns/blaster.cs | 318 ++ scripts/weapons/T2Guns/disc.cs | 431 ++ scripts/weapons/T2Guns/grenadeLauncher.cs | 742 +++ scripts/weapons/T2Guns/missileLauncher.cs | 763 +++ scripts/weapons/T2Guns/mortar.cs | 745 +++ scripts/weapons/T2Guns/plasma.cs | 443 ++ scripts/weapons/T2Guns/shockLance.cs | 203 + scripts/weapons/T2Guns/sniperRifle.cs | 285 + scripts/weapons/T2Guns/targetingLaser.cs | 143 + serverControl_R.cs | 362 ++ terrains/ISLANDbeach.nav | Bin 0 -> 565786 bytes terrains/ISLANDbeach.spn | Bin 0 -> 661 bytes terrains/ISLANDbeach.ter | Bin 0 -> 590414 bytes 316 files changed, 150033 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 ConstructionPreferences.cs create mode 100644 Credits.txt create mode 100644 Launch TWM2 Dedicated Server.bat create mode 100644 Launch TWM2 Online.bat create mode 100644 MergeToolTemp.txt create mode 100644 README.md create mode 100644 TWM2.tsdev create mode 100644 missions/CenturyMaze.mis create mode 100644 missions/ChristmasMall09.mis create mode 100644 missions/DerGott.mis create mode 100644 missions/EngelamHimmel.mis create mode 100644 missions/FlatlandBigH.mis create mode 100644 missions/FrozenNight.mis create mode 100644 missions/GeometricOrder.mis create mode 100644 missions/HarbingerTower.mis create mode 100644 missions/HelljumpIsland.mis create mode 100644 missions/MyrkWood2.mis create mode 100644 missions/Oasis2.mis create mode 100644 missions/SideSwipe.mis create mode 100644 missions/Skyline.mis create mode 100644 missions/Strikers2.mis create mode 100644 missions/WarTowerClassic.mis create mode 100644 missions/slapmydashH.mis create mode 100644 scripts/ConstructionGame.cs create mode 100644 scripts/Customize/CustomScripts.cs create mode 100644 scripts/DominationGame.cs create mode 100644 scripts/HelljumpGame.cs create mode 100644 scripts/HordeGame.cs create mode 100644 scripts/HuntersGame.cs create mode 100644 scripts/InfectionGame.cs create mode 100644 scripts/JTLmeteorStorm.cs create mode 100644 scripts/OptionsDlg.cs create mode 100644 scripts/RankStuff.cs create mode 100644 scripts/SabotageGame.cs create mode 100644 scripts/SinglePlayerGame.cs create mode 100644 scripts/TR2Game.cs create mode 100644 scripts/TR2heavy_male.cs create mode 100644 scripts/TR2medium_male.cs create mode 100644 scripts/TWM2/AI/DroneAI.cs create mode 100644 scripts/TWM2/ArmorFunctions.cs create mode 100644 scripts/TWM2/Bosses/BossDatablocks.cs create mode 100644 scripts/TWM2/Bosses/ColonelWindshear.cs create mode 100644 scripts/TWM2/Bosses/GeneralVegenor.cs create mode 100644 scripts/TWM2/Bosses/GhostOfFire.cs create mode 100644 scripts/TWM2/Bosses/GhostOfLightning.cs create mode 100644 scripts/TWM2/Bosses/LordRog.cs create mode 100644 scripts/TWM2/Bosses/LordVardison.cs create mode 100644 scripts/TWM2/Bosses/LordYvex.cs create mode 100644 scripts/TWM2/Bosses/LordraniusTrebor.cs create mode 100644 scripts/TWM2/Bosses/MajorInsignia.cs create mode 100644 scripts/TWM2/Bosses/ShadeLord.cs create mode 100644 scripts/TWM2/Bosses/Stormrider.cs create mode 100644 scripts/TWM2/ChatCommands/Admin.cs create mode 100644 scripts/TWM2/ChatCommands/DevAndHost.cs create mode 100644 scripts/TWM2/ChatCommands/Public.cs create mode 100644 scripts/TWM2/ChatCommands/SuperAdmin.cs create mode 100644 scripts/TWM2/CustomArmors.cs create mode 100644 scripts/TWM2/CustomCamera.cs create mode 100644 scripts/TWM2/ExteriorFunctioning/ArmorDamageEffects.cs create mode 100644 scripts/TWM2/ExteriorFunctioning/BloodEffects.cs create mode 100644 scripts/TWM2/ExteriorFunctioning/KillTrigger.cs create mode 100644 scripts/TWM2/ExteriorFunctioning/PconFunctions.cs create mode 100644 scripts/TWM2/ExteriorFunctioning/ProtPatch.cs create mode 100644 scripts/TWM2/ExteriorFunctioning/pulsestuff.cs create mode 100644 scripts/TWM2/LoadMod.cs create mode 100644 scripts/TWM2/Missions/EnemyAc130Above.cs create mode 100644 scripts/TWM2/Missions/Invasion.cs create mode 100644 scripts/TWM2/Missions/MissionCore.cs create mode 100644 scripts/TWM2/Missions/RainDown.cs create mode 100644 scripts/TWM2/Missions/Surrounded.cs create mode 100644 scripts/TWM2/Missions/Surrounded2.cs create mode 100644 scripts/TWM2/Missions/TheShallowedCity.cs create mode 100644 scripts/TWM2/Objects/MedalSeal.cs create mode 100644 scripts/TWM2/Objects/MissileSatellite.cs create mode 100644 scripts/TWM2/PGDConnect/ConnectionQueue.cs create mode 100644 scripts/TWM2/PGDConnect/ServerInteraction.cs create mode 100644 scripts/TWM2/PGDConnect/UniversalLoading.cs create mode 100644 scripts/TWM2/PGDConnect/UniversalRanks.cs create mode 100644 scripts/TWM2/PGDConnect/UniversalSaving_Client.cs create mode 100644 scripts/TWM2/PGDConnect/UniversalSupport.cs create mode 100644 scripts/TWM2/PGDConnect/Warning.txt create mode 100644 scripts/TWM2/Soldier/LoadSoldierScripts.cs create mode 100644 scripts/TWM2/Soldier/SoldierCreation.cs create mode 100644 scripts/TWM2/Systems/AdvancedRankSystem.cs create mode 100644 scripts/TWM2/Systems/ArmorEnergyShields.cs create mode 100644 scripts/TWM2/Systems/BossSystem.cs create mode 100644 scripts/TWM2/Systems/ChatBot.cs create mode 100644 scripts/TWM2/Systems/ChatLog.cs create mode 100644 scripts/TWM2/Systems/ClientSettings.cs create mode 100644 scripts/TWM2/Systems/DChalg.cs create mode 100644 scripts/TWM2/Systems/Directorate.cs create mode 100644 scripts/TWM2/Systems/HarbingersWrath.cs create mode 100644 scripts/TWM2/Systems/Keystrokes.cs create mode 100644 scripts/TWM2/Systems/Killstreak.cs create mode 100644 scripts/TWM2/Systems/MainControl.cs create mode 100644 scripts/TWM2/Systems/Medals.cs create mode 100644 scripts/TWM2/Systems/Messenger.cs create mode 100644 scripts/TWM2/Systems/NWChallengeIndex.cs create mode 100644 scripts/TWM2/Systems/NewsPanel.cs create mode 100644 scripts/TWM2/Systems/Perks.cs create mode 100644 scripts/TWM2/Systems/PieceData.cs create mode 100644 scripts/TWM2/Systems/ScoreHudInventory.cs create mode 100644 scripts/TWM2/Systems/Store.cs create mode 100644 scripts/TWM2/Systems/SuccessiveKills.cs create mode 100644 scripts/TWM2/Systems/WeaponChallenges.cs create mode 100644 scripts/TWM2/Systems/Weather.cs create mode 100644 scripts/TWM2/Systems/scoremenucmds.cs create mode 100644 scripts/TWM2/VehicleReticles.cs create mode 100644 scripts/TWM2/WARNING - READ.txt create mode 100644 scripts/TWM2/WeaponFunctions.cs create mode 100644 scripts/TWM2/Zombie/LoadZombieScripts.cs create mode 100644 scripts/TWM2/Zombie/MiscZombieFunctions.cs create mode 100644 scripts/TWM2/Zombie/PlayerZombieAttacks.cs create mode 100644 scripts/TWM2/Zombie/PlayerZombieFunctions.cs create mode 100644 scripts/TWM2/Zombie/ZombieCreation.cs create mode 100644 scripts/TWM2/Zombie/ZombieTypes/Demon.cs create mode 100644 scripts/TWM2/Zombie/ZombieTypes/DemonLord.cs create mode 100644 scripts/TWM2/Zombie/ZombieTypes/DemonUltra.cs create mode 100644 scripts/TWM2/Zombie/ZombieTypes/EliteDemon.cs create mode 100644 scripts/TWM2/Zombie/ZombieTypes/GeneralRog.cs create mode 100644 scripts/TWM2/Zombie/ZombieTypes/Lord.cs create mode 100644 scripts/TWM2/Zombie/ZombieTypes/Normal.cs create mode 100644 scripts/TWM2/Zombie/ZombieTypes/Rapier.cs create mode 100644 scripts/TWM2/Zombie/ZombieTypes/RapierElite.cs create mode 100644 scripts/TWM2/Zombie/ZombieTypes/Ravenger.cs create mode 100644 scripts/TWM2/Zombie/ZombieTypes/Shifter.cs create mode 100644 scripts/TWM2/Zombie/ZombieTypes/Slingshot.cs create mode 100644 scripts/TWM2/Zombie/ZombieTypes/Sniper.cs create mode 100644 scripts/TWM2/Zombie/ZombieTypes/Summoner.cs create mode 100644 scripts/TWM2/Zombie/ZombieTypes/VolatileRavenger.cs create mode 100644 scripts/TWM2/Zombie/ZombieTypes/Wraith.cs create mode 100644 scripts/TWM2/cmddisplaylist.txt create mode 100644 scripts/TWM2/loadMenu.cs create mode 100644 scripts/WartowerGame.cs create mode 100644 scripts/admin.cs create mode 100644 scripts/camera.cs create mode 100644 scripts/chatCommands.cs create mode 100644 scripts/client.cs create mode 100644 scripts/controlDefaults.cs create mode 100644 scripts/dEffects.cs create mode 100644 scripts/damageTypes.cs create mode 100644 scripts/deathMessages.cs create mode 100644 scripts/defaultGame.cs create mode 100644 scripts/deployables.cs create mode 100644 scripts/do_not_delete/Dfunctions.cs create mode 100644 scripts/do_not_delete/Nuclear_blast.cs create mode 100644 scripts/editor.cs create mode 100644 scripts/expertLibraries.cs create mode 100644 scripts/forceField.cs create mode 100644 scripts/functions.cs create mode 100644 scripts/gameBase.cs create mode 100644 scripts/hazard.cs create mode 100644 scripts/hud.cs create mode 100644 scripts/inventory.cs create mode 100644 scripts/inventoryHud.cs create mode 100644 scripts/ion.cs create mode 100644 scripts/item.cs create mode 100644 scripts/libraries.cs create mode 100644 scripts/message.cs create mode 100644 scripts/pack.cs create mode 100644 scripts/packs/CardPack.cs create mode 100644 scripts/packs/Effectpacks.cs create mode 100644 scripts/packs/Medpack.cs create mode 100644 scripts/packs/ZSpawnpack.cs create mode 100644 scripts/packs/ammopack.cs create mode 100644 scripts/packs/blastfloor.cs create mode 100644 scripts/packs/blastwall.cs create mode 100644 scripts/packs/blastwwall.cs create mode 100644 scripts/packs/cratepack.cs create mode 100644 scripts/packs/deconExamples.cs create mode 100644 scripts/packs/decorationpack.cs create mode 100644 scripts/packs/door.cs create mode 100644 scripts/packs/escapepodpack.cs create mode 100644 scripts/packs/forcefieldpack.cs create mode 100644 scripts/packs/generator.cs create mode 100644 scripts/packs/gravityfieldpack.cs create mode 100644 scripts/packs/jumpad.cs create mode 100644 scripts/packs/largeInventory.cs create mode 100644 scripts/packs/largeSensor.cs create mode 100644 scripts/packs/lightpack.cs create mode 100644 scripts/packs/logoprojectorpack.cs create mode 100644 scripts/packs/mediumSensor.cs create mode 100644 scripts/packs/mspine.cs create mode 100644 scripts/packs/parachutepack.cs create mode 100644 scripts/packs/repairpack.cs create mode 100644 scripts/packs/satchelCharge.cs create mode 100644 scripts/packs/solarpanel.cs create mode 100644 scripts/packs/spawnpointpack.cs create mode 100644 scripts/packs/spine.cs create mode 100644 scripts/packs/switch.cs create mode 100644 scripts/packs/telepadpack.cs create mode 100644 scripts/packs/treepack.cs create mode 100644 scripts/packs/tripwire.cs create mode 100644 scripts/packs/turretpack.cs create mode 100644 scripts/packs/vehiclepad.cs create mode 100644 scripts/player.cs create mode 100644 scripts/power.cs create mode 100644 scripts/prison.cs create mode 100644 scripts/projectiles.cs create mode 100644 scripts/saveBuilding.cs create mode 100644 scripts/scoreList.cs create mode 100644 scripts/server.cs create mode 100644 scripts/serverCommanderMap.cs create mode 100644 scripts/skywrite.cs create mode 100644 scripts/solitudeBlock.cs create mode 100644 scripts/staticShape.cs create mode 100644 scripts/station.cs create mode 100644 scripts/truPhysics.cs create mode 100644 scripts/turret.cs create mode 100644 scripts/turrets/ELFBarrelLarge.cs create mode 100644 scripts/turrets/aaBarrelLarge.cs create mode 100644 scripts/turrets/indoorDeployableBarrel.cs create mode 100644 scripts/turrets/missileBarrelLarge.cs create mode 100644 scripts/turrets/mortarBarrelLarge.cs create mode 100644 scripts/turrets/outdoorDeployableBarrel.cs create mode 100644 scripts/turrets/plasmaBarrelLarge.cs create mode 100644 scripts/turrets/sentryTurret.cs create mode 100644 scripts/vehicles/VehicleEffects.cs create mode 100644 scripts/vehicles/serverVehicleHud.cs create mode 100644 scripts/vehicles/vehicle.cs create mode 100644 scripts/vehicles/vehicle_DropPod.cs create mode 100644 scripts/vehicles/vehicle_Stormseige.cs create mode 100644 scripts/vehicles/vehicle_TacticalMissile.cs create mode 100644 scripts/vehicles/vehicle_WindshearPlatform.cs create mode 100644 scripts/vehicles/vehicle_ac130.cs create mode 100644 scripts/vehicles/vehicle_bomber.cs create mode 100644 scripts/vehicles/vehicle_centaurArtillery.cs create mode 100644 scripts/vehicles/vehicle_escapepod.cs create mode 100644 scripts/vehicles/vehicle_harbingerGunship.cs create mode 100644 scripts/vehicles/vehicle_harrier.cs create mode 100644 scripts/vehicles/vehicle_havoc.cs create mode 100644 scripts/vehicles/vehicle_helicopter.cs create mode 100644 scripts/vehicles/vehicle_mpb.cs create mode 100644 scripts/vehicles/vehicle_shrike.cs create mode 100644 scripts/vehicles/vehicle_spec_fx.cs create mode 100644 scripts/vehicles/vehicle_strikeFighter.cs create mode 100644 scripts/vehicles/vehicle_tank.cs create mode 100644 scripts/vehicles/vehicle_wildcat.cs create mode 100644 scripts/weapTurretCode.cs create mode 100644 scripts/weapons.cs create mode 100644 scripts/weapons/Construction/EditGun.cs create mode 100644 scripts/weapons/Construction/constructionTool.cs create mode 100644 scripts/weapons/Construction/modifiertool.cs create mode 100644 scripts/weapons/Construction/superChaingun.cs create mode 100644 scripts/weapons/Equipment/C4.cs create mode 100644 scripts/weapons/Equipment/Javelin.cs create mode 100644 scripts/weapons/Equipment/RPG7.cs create mode 100644 scripts/weapons/Equipment/SWBeaconer.cs create mode 100644 scripts/weapons/Equipment/Stinger.cs create mode 100644 scripts/weapons/Grenades/cameraGrenade.cs create mode 100644 scripts/weapons/Grenades/concussionGrenade.cs create mode 100644 scripts/weapons/Grenades/flareGrenade.cs create mode 100644 scripts/weapons/Grenades/flashGrenade.cs create mode 100644 scripts/weapons/Grenades/grenade.cs create mode 100644 scripts/weapons/Grenades/staticGrenade.cs create mode 100644 scripts/weapons/MGs/MG42.cs create mode 100644 scripts/weapons/MGs/MRXX.cs create mode 100644 scripts/weapons/MGs/RP432.cs create mode 100644 scripts/weapons/Melee/BOV.cs create mode 100644 scripts/weapons/Melee/Plasmasabre.cs create mode 100644 scripts/weapons/Melee/melee.cs create mode 100644 scripts/weapons/Mines/mine.cs create mode 100644 scripts/weapons/Other/AcidCannon.cs create mode 100644 scripts/weapons/Other/ConcussionGun.cs create mode 100644 scripts/weapons/Other/Flamethrower.cs create mode 100644 scripts/weapons/Other/IonLauncher.cs create mode 100644 scripts/weapons/Other/IonRifle.cs create mode 100644 scripts/weapons/Other/MiniCollider.cs create mode 100644 scripts/weapons/Other/NapalmLauncher.cs create mode 100644 scripts/weapons/Other/PlasmaTorpedo.cs create mode 100644 scripts/weapons/Other/ShadowRifle.cs create mode 100644 scripts/weapons/Pistols/Colt.cs create mode 100644 scripts/weapons/Pistols/CrimsonHawk.cs create mode 100644 scripts/weapons/Pistols/DesertEagle.cs create mode 100644 scripts/weapons/Pistols/GrappleHook.cs create mode 100644 scripts/weapons/Pistols/LD06Savager.cs create mode 100644 scripts/weapons/Pistols/M93.cs create mode 100644 scripts/weapons/Pistols/PulsePhaser.cs create mode 100644 scripts/weapons/Pistols/shocklance.cs create mode 100644 scripts/weapons/Rifles/ALSWPSniper.cs create mode 100644 scripts/weapons/Rifles/G17Sniper.cs create mode 100644 scripts/weapons/Rifles/G41.cs create mode 100644 scripts/weapons/Rifles/M1Sniper.cs create mode 100644 scripts/weapons/Rifles/M4A1.cs create mode 100644 scripts/weapons/Rifles/PulseRifle.cs create mode 100644 scripts/weapons/Rifles/R700Sniper.cs create mode 100644 scripts/weapons/Rifles/RSALaserRifle.cs create mode 100644 scripts/weapons/Rifles/S3.cs create mode 100644 scripts/weapons/Rifles/S3S.cs create mode 100644 scripts/weapons/SMGs/MP26.cs create mode 100644 scripts/weapons/SMGs/MP26CMDO.cs create mode 100644 scripts/weapons/SMGs/P90.cs create mode 100644 scripts/weapons/SMGs/Pg700.cs create mode 100644 scripts/weapons/SMGs/PulseSMG.cs create mode 100644 scripts/weapons/SMGs/chaingun.cs create mode 100644 scripts/weapons/Shotguns/M1700.cs create mode 100644 scripts/weapons/Shotguns/Model1887.cs create mode 100644 scripts/weapons/Shotguns/SA2400.cs create mode 100644 scripts/weapons/Shotguns/SCD343.cs create mode 100644 scripts/weapons/Shotguns/Wp400.cs create mode 100644 scripts/weapons/T2Guns/ELFGun.cs create mode 100644 scripts/weapons/T2Guns/blaster.cs create mode 100644 scripts/weapons/T2Guns/disc.cs create mode 100644 scripts/weapons/T2Guns/grenadeLauncher.cs create mode 100644 scripts/weapons/T2Guns/missileLauncher.cs create mode 100644 scripts/weapons/T2Guns/mortar.cs create mode 100644 scripts/weapons/T2Guns/plasma.cs create mode 100644 scripts/weapons/T2Guns/shockLance.cs create mode 100644 scripts/weapons/T2Guns/sniperRifle.cs create mode 100644 scripts/weapons/T2Guns/targetingLaser.cs create mode 100644 serverControl_R.cs create mode 100644 terrains/ISLANDbeach.nav create mode 100644 terrains/ISLANDbeach.spn create mode 100644 terrains/ISLANDbeach.ter diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..412eeda --- /dev/null +++ b/.gitattributes @@ -0,0 +1,22 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b9d6bd9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,215 @@ +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +#packages/ + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + +############# +## Windows detritus +############# + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac crap +.DS_Store + + +############# +## Python +############# + +*.py[co] + +# Packages +*.egg +*.egg-info +dist/ +build/ +eggs/ +parts/ +var/ +sdist/ +develop-eggs/ +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg diff --git a/ConstructionPreferences.cs b/ConstructionPreferences.cs new file mode 100644 index 0000000..e97167d --- /dev/null +++ b/ConstructionPreferences.cs @@ -0,0 +1,7 @@ +//Construction 0.70 Server Configuration File + +//Logging: +$Construction::Logging::EchoChat = 1; +$Construction::Logging::LogConnects = 1; //disconnects too +$Construction::Logging::LogChat = 1; + diff --git a/Credits.txt b/Credits.txt new file mode 100644 index 0000000..181e5d0 --- /dev/null +++ b/Credits.txt @@ -0,0 +1,56 @@ +Don't forget to add yourself to this list.. :D + +**JackTL** +For: +Maintaining mod from v50a. + +**Construct** +For: +providing main idea. +still providing great ideas to keep the mod going. +Testing and tweacking. +lot's of additions and coding help. +The neat installer. + +**Tutorial makers** +For: +Making tutorials.. duh.. + +**Lucid** +For: +Helping me with the code. +providing me with a great decontruct gun. +the neat looking loadscreen. +For being willing to help me with lots of stuff + +**Badshot** +For: +Taking the time to help me with some nasty bugs. +Knowing alot for tribes2 stuff.. and being willing to share it. +Helping all those other modders. + +**DynaBlade** +For: +His Awesome function librarys + +**T2CC** +For: +Their great forum and putting all that coding power at your very fingertips. + +**Child_Killer** +For: +Providing code that was posted before my time and being a great help so far. + +**All those who I fogot to mention sofar** +For: +Whatever they did to help this mod. + +**All those who wanted to help but couldn't** +Remember, it's the thought that counts ;) + + +**By** +Mostlikely, + +I don't need any credit for this mod, it was created for the people who want to play it (which includes me) +Feel free to use any stuff from this mod or ask me about it if you can't extract it somehow. diff --git a/Launch TWM2 Dedicated Server.bat b/Launch TWM2 Dedicated Server.bat new file mode 100644 index 0000000..8305ca7 --- /dev/null +++ b/Launch TWM2 Dedicated Server.bat @@ -0,0 +1,14 @@ +@echo off + +echo Removing DSO files... +echo; + +cd .. +del /s /q *.dso +cls + +cd /d %~dp0 +cd ../ +start Tribes2.exe -online -dedicated -mod TWM2 +cls +exit \ No newline at end of file diff --git a/Launch TWM2 Online.bat b/Launch TWM2 Online.bat new file mode 100644 index 0000000..5f09407 --- /dev/null +++ b/Launch TWM2 Online.bat @@ -0,0 +1,14 @@ +@echo off + +echo Removing DSO files... +echo; + +cd .. +del /s /q *.dso +cls + +cd /d %~dp0 +cd ../ +start Tribes2.exe -online -nopure -mod TWM2 +cls +exit \ No newline at end of file diff --git a/MergeToolTemp.txt b/MergeToolTemp.txt new file mode 100644 index 0000000..3eaf983 --- /dev/null +++ b/MergeToolTemp.txt @@ -0,0 +1,22 @@ +//--- OBJECT WRITE BEGIN --- +new StaticShape() { + position = "-255.386 25.9074 130.262"; + rotation = "0.578703 -0.576669 0.576676 119.883"; + scale = "1.05982 0.166667 157.998"; + dataBlock = "DeployedSpine"; + lockCount = "0"; + homingCount = "0"; + + depTime = "5512069"; + grounded = "0"; + lastState = "0"; + needsFit = "1"; + Ownerguid = "2744981"; + powerFreq = "8"; + team = "1"; + Target = "-1"; + owner = "3818"; + powerCount = "0"; + dObj = "6820"; +}; +//--- OBJECT WRITE END --- diff --git a/README.md b/README.md new file mode 100644 index 0000000..8e250ce --- /dev/null +++ b/README.md @@ -0,0 +1,497 @@ +Total Warfare Mod 2 +==== + +Total Warfare Mod 2 for Tribes 2, Conversion mod built on a base mix of Construction .69a and CCM. Tribes 2 is a pre 1.0 game of the Torque Game Engine. + +Web Sites/Pages: +* https://github.com/Phantom139/TWM2/ : Official Git Repostitory +* http://www.phantomdev.net - http://www.tacticaluprising.phantomdev.net - OFFICIAL SITES +* http://www.moddb.com/mods/total-warfare-mod-2-advanced-warfare +* http://www.moddb.com/groups/twm-development-team + +Current Version: 3.9 (alpha) + +Credits: +* Phantom139 (Lead Coder / Mod Developer, Official Host) +* DarknessOfLight (Lead Map Maker / Mod Tester (CoDev)) +* Dark Dragon DX (Asset Functions / CoDev) +* Signal360 (Many functions and improvements/ CoDev) +* Dondelium_X (Various CCM Functions) +* Castiger (Official Secondary Host, Bug Finding, Mod Tester) +* Mostlikely, Construct, JackTL (Construction .70a Developers) + +Thanks: +* Thyth (Tribes Next, Merge Tool) +* Linker (Doors, Spawnpoints) +* My Loyal Hosts (For standing behind me and the mod for the entirety of it's length) +* Various Others (Who have contributed to Cons Mod, TWM, and TWM 2, You have my thanks) +* You (For Downloading, and Contributing.) + +Install: +* Unzip the TWM2 Folder to C:/Dynamix/Tribes2/Gamedata/ (change the links if in a different location) +* Create a link with the target mod -mod TWM2 +* Rename serverControl_R.cs to serverControl.cs +* Run. +* ??? +* Profit. + +Uninstall: Delete the TWM2 Folder + +Server Setup: + +Provided in this folder is a file named ServerControl.cs. Inside you will find many configurable +objects to modify server settings. For starters, set the host GUID to your GUID. To Do so, +start up the dedicated server. Join it, once in game, type ListGUIDS(); in the server console +to obtain your GUID. Then modify the line: $TWM2::HostGUID = "SetMeUp";, to match your GUID. + +MOD DEVELOPMENT LOG: +3.8 -> 3.9: +* Community Led Version (Add Changes From GitHub here: https://github.com/Phantom139/TWM2/) + +3.7 -> 3.8: +* Addressed a problem in the TCPQueryList that would cause some transfers to deadlock and never complete +* Did some prep work for some special zombie related missions. +* Did some serious balancing work on Mr. Trolololol Shade Lord +* Fixed some UE Problems related to Lord Vardison, General Vegenor, and Lord Insignia +* Gave Vardison (and his DA counterpart) a brand new evil hyper laser attack +* Gave The Final Vardison Form a missile spam attack +* Balanced out pretty much all of the weapons to a point that now seems reasonable +* Added extremely challenging Bronze, Silver, Gold, and Titan commendation challenges to every weapon that + grant loads of EXP. These will be for your players who are loyal to certain guns. :) +* Upgraded the Horde Spawning System to cause some less UE problems and added error checks to pretty much + prevent Horde from causing UEs anymore. +* Added a few new Hellclasses to Helljump +* Removed the old Hellclasses that used the gravity weapons removed in V2.5 +* Pretty much wrapped everything else up, official mod support at this point is dropped... + +3.6 -> 3.7: +* Added a Phase One Vardison Boss - Dark Archmage Vardison +* We've hit the function limit, so I revitalized the chat command system and recovered ~500 functions +* Updated a lot of old code from the mod +* Addressed the bug in the PGD Connect system that would only allow one player to use the system at a + time +* At the request of players, I have added a damage to boss system that will give your boss xp award based + on the amount of damage done to a boss +- SCG Kills count as 0 exp to the admin using it +* Upgraded the Zombie AI a little bit to use less functions and overall be more balanced +* Zombie Lords now drop the Acid Cannon +* Added three new missions to the mission system, these are much harder than their previous counterparts +* Added mission completion medals to the game +* Updated the online rank transmit system - IE: Top 15 list. +* Lots of undocumented changes + +3.5 -> 3.6: +* Completed the remaining perks in the mod +* Added the Napalm Airstrike killstreak +* Fixed a few bugs in some of the old killstreaks +* Fixed a part of the camera-lock problem in the turret streaks, unfortunately the way tribes 2 is coded + I don't think the entire bug will ever be fixable. +* Added weekly and monthy challenges to the challenge system +* Added some new Hellclass options to Helljump +* Added some new zombie options to TWM2 Infection +* Added a new endgame boss, The Shade Lord +- This is a really challenging two phase boss with 80000 HP and one hit kill attacks, it will take + A lot of players to bring him down + +3.4 -> 3.5: +* Upgraded the rank storage container to be in a single container rather than 3. +- The system will auto-convert old files to the new format +* Addressed a bug in the Daily Challenge System that would cause challenges to continue beyond expiration +* Balanced some weapons +* Addressed an exploitable method for implementing unfriendly code by means of the saving system +- Thanks to Thyth for pointing this out. + +3.3 -> 3.4: +* Daily Challenge System Implemented +* Reworked the entire rank system +- Handled by a quicker and more efficient file system +- PGD Connect updated to support new version +* Implemented Phantom Games Interaction System +- Daily EXP Caps +- Rank / Officer Level Caps +- Other Services (News Panel, ect) + +3.2 -> 3.3 (or 3.2 Revised): +* Updated all PGD Services to point to the new domain. + +3.1 -> 3.2: +* Undoccumented + +3.0 -> 3.1: +* Added the Sandstorm MRLS Tank +* A Few fixes addressed + +2.9 -> 3.0: +* Modified the PGD Connect Algorith to be a little less required, less conflicts should occur. +* Re added the TWM1 Nalcidic Armor +- Enjoy! +* Horde 2 is now Horde 3 +- Added Scoring +- Added The Wave Highlight System +- Made it less challenging to get to wave 50. +* Added The Martyrdom Perk +* Fixed a bug that allowed admins to get killstreaks with /giveGun +* Drastically increased the Centaur Artillery Strike Damage + +2.8 -> 2.9: +* Fixed a console spam issue with "Commander Stormrider" +* Removed 2 un-used medals +* Fixed sniper rifles showing in the inventory list when they are disabled +* Added 1 reload weapons +- Added the Model 1887 Shotgun (Requires Instructive Colonel) +- See the new shotgun (Model 1887) or the SA2400 for examples +* Ion Progression removed in Sabotage, Domination, and Wartower game modes +* Redid the weapon reload bar +- It is now math based :P +- Weapons with longer than 1 second delays are no longer cut off +- The reload bar halts if you use an invo while reloading. +-- Weapon Balance Changes (A Large Amount) +- Reduced the damage of the Plasma Torpedo Cannon to 1.5 from 2.2 +- Reduced the Range of the Flamethrower +- Reduced the Reload Time of the M1700 Shotgun to 2 seconds from 3 seconds +- Reduced the Reload Time of the SCD343 Shotgun to 4 seconds from 5 seconds +- Increased the Reload Time of the WP400 Shotgun to 4 seconds from 3 seconds +- Reduced the range of the Grapple hook to 50% of what it was +- Removed the Centaur Dual Pistols Weapon +-- Made it an upgrade of the Colt Pistol (Excessive Duality) +- Increased the damage of the R700 Sniper To 0.62 From 0.49 +- Increased the Damage of the MP26 SMG to 0.17 from 0.1 +- Increased the Damage of the Pg700 SMG to 0.09 from 0.07 +- Increased the Damage of the P90 SMG to 0.08 from 0.07 +- Increased the Damage of the Mini-Chaingun to 0.06 from 0.035, and the Fusion Mini-Chaingun to 0.07 from 0.05 +- Reduced the Reload Time of the MRXX ZC4 MG to 9 seconds from 12 seconds +- Increased the Damage of the M1A4 to 0.09 from 0.07 +- Increased the Damage of the ALSWP Sniper to 0.5 from 0.3 +* PGD Updates +- Modified the hash of the PGD Authenticator. +- Modified some of the PGD Errors. +* Horde 2 - You now gain XP for completing a wave, the amount is handled by a special formula + +2.7 -> 2.8: +* Player Phrases, use /myPhrase to set it +- Working on a parse script to allow them to be set in satellite servers +- For now, they will only 'Stay' if set in a core server +* Patched a few issues with the universal ranks +* Added a few new commands +* Modified a few zombie spawn functions to support missions +* Missions: +- Modified the ordering of missions to provide a short bio of the mission first +- Added the "Surrounded" Mission +* Modified the server assistant (chat bot) +- Allows hosts to change it's name :P +- Added a plothera of things to do with it +-- Curse Filter +-- "Get Weather by Zip Code", "Define Word (In development)", "Get Time" +-- Performs Administrative Functions +-- And much more! + +2.6 -> 2.7: +* Ported in a plothera of TWM1 Commands +* Fixed the new chat command system that allowed hosts to disable certain commands +- Logic errors caused the system to ignore the PGD Commands. +* Added additional missions +* Brought back the TWM Infection Game Mode +* Added Armor Flags (Unlocked at Prestige Level 5) +- These are just like the phantom armor flags of TWM1 +- Only they apply to all armors. +* PGD Updates (The brunt of 2.7) +- Fixed additional HTML Errors +- Provided By Signal360, the new and enhanced PGD Rank System +-- Sha1 security for rank uploads +-- Better processing of the rank data +-- Core/Satellite determined by a new Username/Password system provided by the servers. +-- Lifted all PGD Bans [For now] +* Started the framework of a new mission start menu (for Ordering Missions) +* Rank Tags (For Roleplay), hosts can use the /RankTags command to toggle rank tags +* Renamed the Rank "General Of The Army"[57] to "Commanding General". +* Patched an issue with new players Rank Files that would cause them to error out +- Players with this issue in their file can join a 2.7 server, and rank up once to fix it. + +2.5 -> 2.6: +* Added the MRXX ZC4 Machine Gun +* Prep-Work on additional Scenarios +* Added an instant notification system for attempted hacks +* Modified the anti-tamper system to be a little more sensative (this will not affect your gameplay) +* Re-Patched the rapid team crash +* Patched Players being able to change to team 0 +* Modified the system to double check possible EXP super gain hack +* Added Banning from PGD Ranks +* Fixed a Glitch in the rank downloader with HTML Tags. +* Modified functioning with voting. +* Added the Mass EMP Killstreak (20 Kills) +* Added In-complete Upgrades on certain weapons +- Please Note, that some do still remain +* Completed the "Team Gain" Perk +* Reformatted the Inventory list to go by Weapon Type/Rank +* Added a Center Print MOTD Function, check serverControl.cs +* Fixed the 'Endless' Bottom print bug for camera killstreaks +* Airstrikes are now directional based on the direction of the camera +* Air rapier zombies can now be targeted by missile weapons +* Added restrictions to the /VoteBoss Command +- 1 Boss Vote per hour (even if it fails) +- Hosts may disable the usage of the command +* BOSS: Lordranius Trebor's Official EXP Reward Cut in Half to 25000. +* Devs/Hosts can now disable chat commands +* Fixed some of the Spelling errors in the death messages. +* Top Ranks are now only downloaded from PGD +* Hosts can disable boss vote / change map votes + +2.4 -> 2.5: +* Scenarios. +* Gravity Weapons Removed +* Patched a few UE Causing aspects with Lord Vardison +* Added The Shadow Armor +* Added The M93 Pistol +* Added The ALSWP Sniper Rifle +* Added The Crimson Hawk Pistol +* Added The Stinger Missile Launcher +* Added The Proton(Plasma) Torpedo Cannon +* Added The P90 SMG +* Added The Satellite Strike Killstreak (8 Kills) +* Fixed the Harbinger HQ Map (It's Playable Now) +* Added More Non-Weapon Challenges +- Prestige Challenge Category Completed +- Sabotage Challenge Category Completed +- Domination Challenge Category Completed +- Horde 2 Challenge Category Completed +- From The Top Challenge Category Completed +* AC130 and Harbingers Wrath Streaks can now detect incoming missiles, they will fire off flares when missiles are detected. +* Added 4 More Prestige Levels, bringing the total to 9. +- Removed the Second Prestige Image, replaced 9 with the PGD Logo, all others downgraded 1 +* New Perks: +- Bomb Shadower (Tier 3): In Sabotage, the WP that shows you holding the bomb will not show when this perk is active (Requires the 3 For 3 Sabotage Challenge) +- Double Down (Tier 1): Gain double EXP for every non boss kill (Requires Prestige Level 1) +- Radar Phantom (Tier 2): Active Ability, Jams Sensors (Requires Commander Rank) +- Second Chance (Tier 3): In Horde, you can spend one team revive to respawn (Requires the Army Of 50 Stopped Challenge) +* Modified The Following Vehicles: +- Modified the AC130 and Harbinger Gunships to both have gunner seats, the pilot switches the turret weapons when there is no gunner. +- Combat Helicopter: Added a gunner seat, the gunner controls the turret, otherwise the turret is auto fire. +- Gunship Helicopter: See above, pilot can fire a missile pod with the mine key +- Apache Helicopter: See above, pilot can fire a flare pod with the mine key +* Modified The Following Weapons: +- Desert Eagle Pistol: Added a Spread +- RP-342 Machine Gun: Damage increased to 0.035 from 0.02 + +2.35 -> 2.4: +* Added additional security measures to the universal system +* The All important reason you downloaded this version: +* FIXED THE RANK FILE GLITCH, HORRAH! +* Added the Fission Bomb Killstreak (only a few will find this.... :P) +* Additional system patches +* Patched the universal rank system to output all error codes, should the rank upload fail. +* Reduced the power on the RSA Laser Rifle: From 1.4 -> 0.6 +* Banned Gravity Weapons and Ion Weapons From The War Tower Game Mode + +2.3 -> 2.35: +* Patched serious security loopholes: +- Univeral Saved Files will now be scanned on load for corruption +- Key Download and scanning is now handled by PGD and not the Server +- Prestige will check for your rank upon attempting to do so. +- Universal Ranks are now forced to provide the key when uploading +-- Added /SaveRank and /LoadRank in case the server fails to do so, or you want to +* Weapons can now have a required prestige level +* Added 2 new weapons +- Both require a prestige level to test the new system updates. +* Started the harbinger soldier AI. + +2.2 -> 2.3: +* modified the auto-patcher +* Added Officer Ranks +- Reach Master Commander, then hit the reset button +* Added the AC-130 +- AC-130 Gunner Streak +* Signal360 Added the following: +- /passVote +- /VoteBoss +- System Ammendments +* Brought back 2 Classic TWM Bosses +- Stormrider +- The Ghost Of Fire +-- Enjoy, Complements of Phantom139 +* Fixed a glitch with weapon challenges. +* Delayed camera based superweapons to prevent the "Lock" Glitch (this can still occur though) +* And some various other unnoted changes + +2.1 - 2.2: +* Super Release! +* Added the auto-patcher + +2.0 -> 2.1: +* New Guns! +- Javelin +- M4A1 +- SCD343 +* Universal Rank System Implementation +* More Non-Weapon Challenge Categories +- Boss Challenges +- Blacklist Challenges +* Additional Fixes + +1.9 -> 2.0: +* Christmas Mall 2009 Map +- Decent Sized Map, Good for close and long range battles +- Sabotage, Domination +* Domination Enhancement: +- Mappers can now name areas: +- $Domination::Flag[Num(1, 2, or 3), "Map File Name without .mis"] = "Name"; (Thanks To DoL For This) +* 3 More Killstreaks: +- Plasma Harrier Airstrike: 7 Kills: Airstrike with a remaining plasma harrier +- Gunship Helicopter: 9 Kills: Call in a heavily armed helicopter +- Z-Bomb: 100 Zombie Kills: Wipe out all zombies in a flashing blast +* Killstreak Upgrades: +- Added Host Streak Settings: +-- 1: Current Method: 3 Streaks/Player +-- 2: Old Method: All Streaks Earneds if Unlocked +-- 3: New Method: X Streaks/Player, X Set by host. +-- 4: No Streaks: Simple enough... +- Chopper Gunner: Renamed to Apache Gunner +-- Apache Helicopter has a more powerful chaingun than the Combat Helicopter, slower RoF, but larger splash damage +- Apache Gunner and Harbingers wrath now count to your kills. +* Opened the Non-Weapon Challenges Up +- Special Event Challenges: Challenges to do on "Special" Days. +- Killstreak Challenges: Challenges completed for using killstreak rewards +* RPG-7 Enhanced +- Now Randomly Moves While Fired +- Requires Rank 50. +* Slingshot Zombie Added (Finally), Pilots Beware +* Explosive Weapons Now Can Count To Weapon Kills +* Helljump Updates +- The Transport is now invincible (bug fix) +- Players who jump too early out will be placed back in the transport + +1.8 -> 1.9: +* Removed the old Killstreak methods. +* Implemented a brand new killstreak system +- 3 Streaks Per Player +- Unlocked via rank/medal +- 4 New Killstreaks +-- Stealth Bomber: 8 Kills: Carpet bomb an area without notice.... until it's too late +-- Apache Gunner: 10 Kills: Control a combat Helicoper's turret for 1 minute +-- Centaur Bombardment: 15 Kills: Call in a massive proton collider bombardment. +-- Arrov IV Nuke Strike: 25 Kills: Boom... you should know what this is. +* Modified some weapons that were implemented in 1.8 +* /setRot Added +* Full Scale and Nudge added to the MIST +* /SetNudge added +* Added the Hardline Perk +- Killstreaks require one less kill + +1.7 -> 1.8: +* Added the plasmasaber melee weapon. +* Added the UAMS Guided Missile Strike Kill Streak (6 Kills) +* Added the Harbinger's Wrath Kill Streak (10 Kills) +- Hosts, to create a gunship that endlessly circles the map (Gunship support), type StartHarbingersWrath(your CID, 1, 1); +* Helljump: Players can no longer kill the transports. +* Fixed the helicopters on crack glitch. +- If you don't know what this is... lol, start up helljump and call in a heli. +- Hosts, if you have good eyes with script files, you can find the function to make you a chopper gunner (like harbinger's wrath, but with a helicopter) +* DarknessOfLight provided me with the SA2400 Shotgun (Rank 33). +* Added the Wartower game mode (FFA Tower Wars) +- Tower 2009 Limited Edition Map +- Century Maze Map +* Fixed the sabotage bomb explosion (it properly explodes now) +* Fixed the S3S Rifle Glitch (You could shoot yourself :p) +* Shotgun weapons (Excluding the LD06 Savager) now properly make their fire sound +* Added the Silencer Attachment to all guns that have them. +* Ported in TWM's Centaur Dual Pistols. +* Ported in TWM's Desert Eagle Pistol. +* Shotguns now display in the weapons challenge list, but do not have upgrades. +* Fixed a glitch with the RP-432 Machine gun, the sound is now correct, fixed a similar issue on the MG42. +* Signal360 has provided me with a new way of loading/saving universally, I will check it and possibly use it in 1.9. +* Kill triggers can now kill invincible players. +* Added a new trigger, Invincibility Disabler (used in the wartower game mode), to disable your invincibility when you leave the spawn area. +* Kill streaks can now be tracked via the player info page. +* some other things. + +1.6 -> 1.7: +* PGD Connect Implemented +- Universal Saving/Loading Added +* Fixes, Fixes, Fixes +* Start of Universal Ranks +* MP-26 CMDO Weapon Added For Helljump +* S3-S Rifle For Helljump + +1.5 -> 1.6: +* 9 New Medals (Some are not obtainable yet) +* Hell-Class Selection (With Medal) +* Centaur Artillery Vehicle +* Gravity Axe Weapon +* PRTCLR-995 Weapon +* Weapon Challenge System Upgrade +* KillTrac System Updates +* BOSS: Lordranius Trebor Added +* Fix: Fixed Major Insignia Name, it would display General Vegenor instead of Major Insignia. +* Lobby Options such as kick.ban can now be perfomed on players that are loading +* Admin options now display the name of the admin instead of "The Admin" (Like in TWM 1) +* Some new chat commands + +1.4 -> 1.5: +* Hell-Jump Game +* Additional Zombie Namers +* Fixed the Host Setup Glitch +* Fixes, Fixes Fixes +* Online Services now point to PGD.com (www.phantomgamesdevelopment.com) + +1.3 rev -> 1.4: +* A various amount of fixes +* Volatile Ravenger Zombies +* Door Fixes +* Grapple Hook Added +* more? + +1.3 -> 1.3 Revised: +* Fixed News Panel +* Modified the Score Menu Loadup +* Doors should now save and load properly, no matter the texture (needs testing) +* Fixed an Issue with object moving where inv. stations would not work +* Modified a few other things + +1.2 -> 1.3: +* Weapons Challenge System Fixed +* Added a Plothera Of Upgrades +* added a gun or two +* harbinger HQ Tower Map Added +* a few bugs fixed +* bosses Renamed + +1.1 -> 1.2 (F.P.R): +- FPR: First Public Release +* More Guns +* 4 new zombie types +* Horde 2 Game +* Improved Many Functioning + +1.0 -> 1.1: +* Final 3 Bosses Added +* Added The Domination Game +* Added 3 New Maps (2 By DoL) +* Even more guns added +* Weapon Challenges System +* CSS Improved to 3.1 +* Cleaned a few files of un-used functions +* added server logging + +Alpha .02 -> 1.0: +* Cleaned over 120 Un-Used Datablocks from the mod +* Moar Guns :) +* More Bosses Added (4 now) +* Added the Perks System +* Added The Sabotage Game +* Fixed many glitches / bugs + +Alpha .01 -> Alpha .02: +* Added many chat commands +* Added 10+ Weapons +* Improved the inventory Menu +* Modified the armors +* Added C4 Mines +* Added 2 Bosses +* Various Other Improvements + +Cons .70a -> Alpha .01: +* Added CCM's Zombies +* Added CCM's F39 Fighter +* Implemented P-Con 1.7 Functions +* Implemented Clip System +* Implemented Rank System +* Improved / Added New Systems diff --git a/TWM2.tsdev b/TWM2.tsdev new file mode 100644 index 0000000000000000000000000000000000000000..8f3f6e5a305a8504a3e579a7b076a766333093d0 GIT binary patch literal 53823 zcmbuI2Y3@l*ZncYSnkF^=y8CAZfYnABp745!Po{8aAJfl+X7i~BpKuM-h1!8_uhN& zz4zXG@A;oIt2GB``7>%_Cr+ACI%WEl>0?XE+e7j8Xkb=2&>oNaLt{&-+Si4G4T}Sv zwUG^h@T_oqDAa?7`NpTTyeb-5A83g8LD91rdD){!^M56^k?0=n0dzFJd{s%JNy*5R zzDla*tt^>1s-&c(B_40vVf^@xj*il};Ti)QOB*7s<55>rI;XT`W^A3mA?BYQ4#Zmn z(S}$l#7@b+T7t0>{J*~>7KjG@q2Qi@#*%fxus_;a5?RNED=jH03&jIbe;l8yS~1@c3JiE6%}(UR@SeqsIFPKZ0S}g ztg2qNsG_{Ke%`_*6;j?erE$%|`Af@cS5#Nz%tJ3rg0Xo0%1POCgVBV{8 zovF=wW@HVj>5Rn#t)hEOtTdd6ZzZYYR{1z+uAu_umbjj?Fke9MO^GA`{ z10lC&PJR8-irUJG>hc<2CQ5ugS(k-STpNk|LnW*H(I$U1P*NFbESbaxG);zuLy={( zC`Zb>`0^mLefcaXKs0(Ng9~m-`$CMs|3=||h0+8=jfMFoR zAcnyVLm0MZC}G%!0UJaY-!O*Z4BIkn$H2aQBN?~^zR?V07{)S;V<=@9&oF^uB7@oJ zCR0se*q&i3!!(BJ3^N#ZVAzpiCc`X-ofvjzn9WeeFo&U>VJ<@j!#sxh3=0?*GAv?P z%&>%^l3^*sGKMOK3D;QQXtYX-OVONIL3~Lzb78D5a4f@d497E^z;GhNNem}5 zoWgJ_!)XksGn~P2Cc{|_XEU6`a4y4n4Cgakz;GeMMGO}+T*7cE!(|MYGhD%NCBsz= zS2JA0a4o}i4A(Qa4*As4EHlU!0;f$ zLktfyJi_oO!($AOGd#iYB*Rk-PcuBj@GQe~49_#X!0;l&OAIeFyu$D*!)pw$GrYm@ zCc|3{Z!^5Z@Gir94DU01!0;i%M+_e`e8TW4!)FYiGkn4DCBs(?Uo(8e@GZl44Bs>S z!0;o(PYgdZ{KD`n!*2|~GyK8uC&OP1e>42U@GrxE3|%r1a18I_>&k#5c^4m#>pq_0 z`7#-LGGsCM7_u317;+i%81fkk7z!DR7-}VgL zvHPYmOlO$Eumi)63^N&KG3>;!GsA3#GKM(}8J03EW2jn+8zGgy7f!z*`8W*2Nm4!M1p;4%bc50RByHXI33td>gsCIuJ7YBjpOq z+=MKztRdJ~?hl6}VY+srXxpS~N5J0}3CHS|#ajZ=x|F8o>!tBtG~S!W1H^bAWLag6 ztwH0tFS6lD&)QX$lj_P_{PFTgYpWmE40Y1dY<#rbpOy#Ea-diqNK3z19)zq{(o)LJ zMn!`|XmBVE28qF8$oiBuZuEy60*%%F@P@=$K0fr}s2ZDeGYja{a@iEZY@_VwNcM9S z`xz|#9E~i$Y)Q?ks+w@HEfD2eJqBeXk{!retqwNf>ZdNXvH5k-`#5?ZPwye(eFCx^ ze`{-`&EK$r#wVg+VA7by*aVUd%+HTzC)4Z{nr$s+ry}c97Hy40=lWay&4G%hCR`B3 zXnPu}rYCL93aQwHYuI2UI6$bi);G00L3L~pUczA>}O!)y9lj) z7b9d072ivcWv}yxc_G6Ubt!Uehi%b7Q>-poZgz9DxSSSO&|;WaTxl#qeq3UjZR0BB z!;;G++eYoA`R(}Ot+NfyE|H$s(DPb)4j0eskmZ@CO`%A{*j|sK!AVR@i5jVTlrg3(AeSrNu$bLpjKMx_xn-ht}k~@osQIx(n zlbuCMOS^qOO5exmJ4$>XN0vEf*-Eb2C!mKU7h5)f%0MU(sB_ww11(tJQ?z=TR-?u0 z8Du@mr_kwH$Zfn%6??P?+gfp?t252a;hbjA)9eMBjS;gKS=4|7WzELK9Ta%>g02R3OL~uH@6)VQ%sxO?P>z+;9__63?-?j<4aPD*MB#waI!KOE z#_H1Q&4~_7d>_;A6Z(x8zfY0nG_+vEtGV4A{XRp1>o_f+yryzKK6SF4ISb+k{(_!g z(sP1%euXTXN6a}9v)B0=x$ApQIbJ23+3oLJI(|pTiQ@P@vI6vOkHP%5e?VdX*H}-s&!WXtvG5_wFE=f#c<|uDWTULF986N{ z>;Z+N=)OE!O%tnpWJON%nm{~`4bQk0pm=2R+f3a^OvkR)_NyqOe=qt^7yn{p9LS4= z1EEzM<82A}%^{{YDn_OCz&#*NX_V&X@&cZ|zU*Qvb}>V`=!dK)81tRBTvTPH%0`qqn8~cC?=<_9Kw>0uXkFv6r_8+Rff{B+Apz zm8#~?O|-?G;p1sL zfwnt|?L=e)+zhw#0FDT_EkO54sK*J#=38WQc_-6&3XOLb1zjM`7nrMe^KM#XjaRPC`{2k^JV-d=fjoJPjQ(D_!cTpaI1=9t@nH2vB}&P#18yPxOCg0G2w3&pP)Sz%)U10$7z zSPU10X7O53ic=vOW=OBM3%H(!8)&#l3`33~w&;pYevZHx!&a2Kmebil8w07W>_!@) zZ5wSDi|roBiU>G&RAs}DqS$rVNcyHUv&L~6x6^ou7;i+D-{|}_WgpmqGWWNWQfoha zC(ZVxS*4img)GN?b+R`KaH?TfWb(qr+U!f4{b;jPZ1zWnTd}Rq=*$7gMkhVYuVry(|DN}AA&5`G+YviHgXF;6eXqqqj`d{9URUMj$j8> z(!r6)@=OOSLb#dF9*#nh>*%}1#TUqSaSXdSmR&5DE{;QnFRU#T>EvLU*}RTNS;`mY zuC;6WM4FvMvuZIr85!P+fOohn z{LLYA$T$;aTiA!Dwzm7wvuS<~&1=Q{Tx3|O8_U9t3nI=C#Ca%6KMUhUfE`^+X>Nzu zE};2^G+!a+7a8-W#Q2U`n-`aTQ5>tdEnJc6oN{`a+SKl|uA=kRbY3OS*C6ZJ7>qU0@>(RWJ&PRw6C){!R(2TW zdb-^}w_U{TMr1{EBN({fLPEpMgeu3~u`vYw5JF`3(uY?b_l zC3aCxrQI>zNt3&1vRX{;MwUG{iWBg%h5VrRAa@<(&AKaFSeI;J2K7Pv?xWfLG+QHP z574ZlF&M}A63re&?%IB2t(Ch@ujReivnbfkl6?Sz! z!S+wmVmGmP3R%9hXEbYv3-~n3T&D=mT1#zXSKhORAFVXsCTGxy9D=Y$$Sd*_JRj%|C+n;S`x4_qlzd^^f;`k=AyowN>HjsUI z=36NGA9k84klks%1K9U2LWWH8cZqd`2s zKvo!tHTc^CZIMQ91l%^hM5*g1?`#|Ct?btEHEqA4ZKK$Ji>y~*6UOP|OM>g7{%FuS zjC_Z3*H6sb!fwSs(DX-|2E_CyWCio^;RErOXr#j#=lvOl$~^$*qA;zoy(avX=D*Rr zNz8wzc~c0tu3Xo(f1uFy<;joOUe~6zx0kek(f@DyH;ey23IAA&%m3g1+uz;Z`giFD z{|tnT7V+Tq!Il<-yX4~k7QtV^xwvpbzZW=x4$j6{Eg5uZ{Szc2l+7Ot> zy9wMbvQXsO)239~Z!ViwIkZ|YR=LQEOzS3E$!3;^V$Zpyrcx{U;rx`ydK14>t?NH!4mv&Xzk2;bzqiEA6HlvZ{%@5$llRs4L3{;Lm z(f_b>O@ZvrbsW1WWfyx$7vqr?C0efxGzY@Yp>P6`0lHh*jdB|8rqeDab~BLmnjeT@KNSr&EQ>Z`PlaD#<_;*w zz>obgdYjlyb0%G9(KRlvJ0Z)T--6TAWli(&kR`vcol)kxdQMpZDJ|`%FQf4s8n=sa zIkMt}@e=-s!WiqM`&?AGPGJ;xcXQjtJa#dkU2K#t79h)?AN9B4YIQ**VvaEjQMQGX z_te(*Dno-tC00dG+pAyl>r_D;2Pfr<;v}x#Ho%Ku;)Ch*~c38 zv8VJ=$37PLqj+e#84p&j!nWPQK6XQS`nM_r8s6siDxsb|tYr^-Ne}*%9%{`IncMj~ zl)JZc>uQ_W?Yxn$0lMxju1zdz@$ZQnQC!?+q^{FlTVeM|LAGB{i+#jm1G0hzflz3D zduy9qZiG!tOWH4t@c?Un&wHRe<#Q%_Og6EfGe*}qUH22$ zc4WB=Fh~%PCESP-*P+H;XBTf1jXG(xzZmU_EVHHEtgXGE3zLTgr_{px5Z;&Y0Rr!b zEPp{eMq;BeS&sct=DOBTt+i$c((E9b9Vli8BkPY_8MySCYljb<3j}_ZhoIWEb<4HE zW&wMRa2UHfoLwCxT^)g}5O zjYfxx(dozvY~uyamwg5bU0ZZowY58oc4yP>FtIxaS!UvMo(t{TWSmk9pHKJ#!iNid zA+r31k+6HmbrH(8OKx{^D&m}lr?#~x;g`_*Qd%D&)|Vm6L349b#MN~<3S3`;$5$F! z(<^Cu6-|#6)2os7_xaq5po{8x)HhZQIk&t zB-`3Y0&b@5EwnvaY;Q$Yw5WCoP7(rhzr z=I_w_WHEmiS#HRES^pkNTzfTlo!wwRpwWjkIz@~=a*S}wDOZFaqr`LG9pXu8qJ{m? zpVIC#+MOzPpCilR^QD!6a67kwFHqn*9GGpuRd4TBeMPUY>2;cTeS<7}3B4lb$Mh|7 z*N@3qC9AE|_jLM!PN$30kI4G4X-y>57z{*RH@|*DRr>wrM5{WLFpu-X*!K(j`IY^g zA^rS@tT!p=mW8XE-%;Zl#W2gBxV@pZH%|bwlRw$XU+m;e>Ev&A5{fiO+MG88BT@P0 z{y~jv2jT2(w3hZ8{Ezlsy2Jh~vClx(Q*NAeMUsA^s@#=Hzh}}Nn6C$I&lX$0*j3DS zQGYnt9;=N8);Yhjo=O*q3rMB8y~6Rai)?mrj&zZO4BJbzF>wW)i`+GWX4bjO*=c1B z^J!Q>!*j*35Lp2Y@xmU)*qw8dA{4r=KGI!XO|5k?t$Wk@JhASBEQi*+ZVYVV@1!pZ zT)VJz+e9;K*^id}X?ea_4nUSwIdR&A3G^F?OgU=Tv_#@~dMj2Z4b5}vu<#8A;2VOF zae+8)jVz~fVsiYX1O=`QOil$7<0r0`cF1EWU5C;2LUA3AtY_tvGBbX%EfUvvl_V73nh;I@?#wFrB8ChYae|;p1H$;QY;h?!|I0dDy^BDJ+p5E4e^HXU)jpmn% z`E(Xl1{(b#bDl5*scW4YSG&a0$}a4VglE$4GVz;*EZ6we1pMatlbulF+M0~zGV=;B zwj^368k)BwVB?!j*D|_ZF0ONs6|~}BNqcMZ7+a1)*Z7&U%Svlx_f{1&ok!Cv#B@Hg zY%GE70v8~69c~=IWWBXoM61QLx>Br`Aj`sle!vXtR3dY&MAl?W$;Z zmDnvumfh++ZouuR8hP*J$xyP!9-V7xvVta8i^)o4_$Kh+83zz(vkE2Y-$e4uO*XXO z@2+%RP1kG0bq%tfmGh@eqG25p*P~GOgW?&^L=*EG3|Qapw5q4owPLlFR=BHZ)|nrP z>&vuOsE%RC%``Hv)6lGeW{otvPRs(x3Mzx)AfA^C1vzAg|+!AxJmlx zL{?nse2g00*~T~G+}_?373rrkc3nR!;JW=xS__iigtq zFgo8V&W9r_XpJ-mG0+)}Cmzr{0)?(8OvF6pR&yF-?>8UCK8|J|w@Dwzum~@P#GS`c zk43uq+po5r{W^~)egYkD7snHk^>$jOZImaW#BQF1yh0LL{5p={Zg8PVZt`T|%q7#p+TPwZ_^KyS>Yhx~@wS$1th3 zhny=&T}h*R#ONwyd6k{f4Xg0F$0ReLc{PeK@Ym{W=-A@jwRSA?T6$eauY1ModSpdQ z{cZkGt9zGl1BzW|@bXPKyH8JZy92$69o)@h&M1fBGKra%0GgN^c|!e zqLub`?L5Xl9%mm9Ngq!j%U*`@(3rDzJc%542kq98tg@TN({y=;E)R>#v&iz6wQ;(T z*j(q4%I8qzx{I7rX-`OAKqKFa2pNxv)l0|*MB3w<8()4I^{ykS>`XRK*j>u2?Cdpm z_Na9BIBFYy2@$Y(Mq;#6KYZ zxZocmD{R9&F%2#4$>)(jLaFN%(fQq{x3WL~PiXroZJ!X^&uCkP$3s(2Mm|UB z`3Y#FX6c|EH~W%3eZ`)hl%BpumQ@vqZZH=J-yn0Hr=?sVNF%#den+?O>GqVk{b1ah z6IYr)rn<=<#`$IvjqG>xGu?in+tcFqE3(|GAST+G>yMkuqTf)mx&4Z}p`$y0+ZWT~MX~6O ztS|b6g|ojei^uuOFPF0q>RdY&_d!7??CJSd?5H0*dPzF!kF1{?OZo8)K&|UMZgX9^ z8Qa+)b~c!uy)2y#L6+4f&q-~K%=K!wl-t#^4Go6U;1w|##-cX7E9MM74M*x;vr=I# zwqyGdw0Ko4Mk32kj1_W9Dz4E{D0AIjOs%zMV`w&(X0M6aIApn)Vk?eW1{%!0>{67Z zKWC!uu3V7aRZUuhp9AuLrkY3%dct= z#R63=c+kdNSWZWovh~YoQEF>DYP18*ccl57Vm=dDo@p+(!ZK%}Ncq_&2Fg;}+QF@z z={%dxZ;5jmvK-SIdsD8BIVezeW6r*oAJ1uLceiutSwYXY#d99Ayf(It#oL>j=sF)o z6aI%IP6}ne!-ec)5&L*Y`dG|9s&RZs4jnE*(dO4kN?W@|meP3{o!=GbDr7m;cm;KC zq{G}IUXFtFV}-q3bTzcsiZwK?rRjTOx&m3QnKwb!$V!yBZl<{F?5|@N8tqD>_r+*6 zi>m!?xG>~;U4!(0IGMG8J(=B&KD*QU1F^10mhZGQ&%@GxEy~irH|1nGm9m|zVR%?E=~s`%dDAPL#uaTfCWN0mLz7KIT59v)A{sPc56JDwx`hcYq32QSwRfHo;mG7 z+-7th;5!Y4uBA+?wo7>i?arj#H)3}di)zZ}PM%`E;i|~ubREjjb1!>BA__oTvhkqN1+iCKX znB0+Sawk&Pd0*0^F#`nXyV?F8TKp^)_af`#v@Ca~BML+-{cT*P`%vZjjjN69_woR( zAEfm!V*L=ZLZQrSzjS>Vr98bg9~~o~d>t6&*<8LyX!0mceif6)*gU0ieKl%hl zxNS_0F?xbVPtxc&F?xzXjcLA+57GI}BtEoy8a3%>^RAc4HO9V9{wzCsjvf6j9X*dM z-+}DR1}~rtTedSzPHLTfW%?yry-ce=#Of7f#WAzYD+4V-j8P>XD0>wZuJfdgPGu~y zI#Sx23BzFMd!7Do(Em^Ie-l}5O$(+d;Z0_)i?>kXI(0O^n#A33cRPEZ@g17JOVhu^ z^gU$xY#iyZhqL!l=2~7kTsYT|scr2Q{wbvHlK4${I-wH5g}UYlj9Cuz z+hqYeC}amcq=OrdjP$AiuXWdd9etdglm&K0fSKF+K!yl_>?C0#Ayf(x29p17?vRGm3Zi?98V>3 zpqjg^ZBXtyRdx>a&J$d9-sbkftYPe7ID7C(58EOu#PS5=?TrCUlI6T&w;f7d4-2H% z+ih(m4M)*1TMS1dD~h%GJHl;|U|61v%N&DZ*V#j2J)}3Y>tY;@OKF@V#^aG?$-Se@ z3CP^zG-eV!skJtfXfv5MxneT~Sz!!Qjt3hO??rHhZjVye7AAYWL<<~b(g6GZ#5DFW zojv494>OSEI{tJojRqQd`csG z(z%#!OXyZ4Zk5RL%%jFpdBR~Sid@&4DMw~LlPnGGp}C5-%W2z7Y^xpHXmA5wB5>{% z)u1TlXn{AOY^~kzt)SORdKHV;DrCKC+8Z#NO$_si^6A_dzujF>?)f>I`Q&4D-sW~C ztY!~u*h6pWp$=J2O*f-VFu+!#INru{*zd+OMU3AF=l%%d2U}o3AqcX68B+ zr7wHRFk(t`JCxW+^8n5Jig^>V!WhlLV_S1xHE%|#YZO#|StXH zYppTC7~ZC#b$_vLN0wK!YEHn9TUyTdx)DXL)h?^W^%HbAx4*(oH1DMO05RW_MX`=x zV$^vrq^`^A#Ew>~?VfQTQv1?qpcw6ktO(ClGzYk+Fk>^^0{2I;>!z(NY2x7MX>X5@ z2eOBQ*ux;{;b3I>cwhztUG}-OLr~@#pmCNrwT)fq!)SRpEeDI`5y*;bTLReAhC;ZV z&{&Qa?YP)SqQbRDPyOl?z#gCbG(3%lC1Q9wvLXP^LxI-u3>3Rw((p8} zmS@rOY+7z3mggYL!RrrpW~p;i%@W^EvVr|-&ZpT0G#e^r7dmFawvNOLp%>|9wt+Rf zgl3o0Y?zo`hAa=0l~uKL#)1uIuX{O)TzBeID(#27l2%vIYPeWk%_3*`f*Z;;NL?cc zw!&Im$M)CLVq3Ae0a>2YlBLF{$<9qi^#b~8e{xeHm5WjJ_m*5utNPXDcFod{sNxR+hr$1X-n z7xyFUZ@a)79{3>j&P;{;JP)9Ha@x4L)>S%ayL^aUKFlshNtcfxORhW|uiEg07CU}Ird^CYtD#IOV1pF-~X#_fPavWXpsc!qAz(rt{mJ%_9?(X`&r zSvlzWJW5?>Jn5dcp>=+d&M(nKVWueOi1P}HUBjdvYunO#zeexZ={-)o z-#|7{y!i)!{O!@QXdEX(0p}IMH_^a#A?WEvVQhbIv%h!PU#ax>F0x+IALhDgt8(6W zc@O2TL%ye*WK-+@0o^~O`*?Bx2w87&w=;;xO_ct=L1xz%SWInVP9wiX`IgpK zvZ;0dp6)-;eUiBUh|F%YE&h!WGX>L6DBaRFD-EslFLeHu&XdLYH)MU}o50P7U_+!W zG2rz(s$6%YJzqsiYum@4?Bg%?F-7|L8(F^e(b~3--}65xb6u8t%$;V|^*_3H=?T~E z#We$&{k6p~G3^F(T*Eq$BG zrq-Q*5XzTL_i5sugUqgTbKw;W1f9P#kc+AE`pG)Siq zz4c>n{n^_N(%S%J1=3p_$5C!f15xN2NcMD*XlH!~({~7ccNE{Pk=bv&12@a?7bs|5 zg7PhW09uB$cAN6;YK;|TURl0D9n z9!DW7TImecCnrD59F1b_*Wqbty~omf9KClE?^0xWi6uhc{;M;Twof}9Qbslv)L!QA$nIvcyE5r+7Q4e=d^1y8l;gQMoHCnn@|{qDi!D10t+cV@ zAG7IOM&CK&I|o?-m^h!?l8d2o6uK@r)2i)RbOr6^(XL$V<|8X!W&YX-Mhu*1h0O|I zfC|?or&-~0%T;M_2UHfZkHzd`uJo}4SucliKbn?ViSqRC)Z5H{r_1PEMdu1}UXCog z!}(h&{E1d0cU=@FYwRkhrO67K%oCH9$coss*4$?;$D0=PT7_cQHJqn`wcM4Kt7$o3 zEY~2*Ud1V0ot>e@SfMVAP zowo~DWBc4IIKi7n5TcyFiXy9|E zO~wSuiLR@qc7N37rMz&EXi+0A4kT|!#}e+fQhP9JiPI^(o9ZD&Y}KCOdgip0M;w^*QV=aX&a=x=!lOGp79G23YzADLo&hna*=k34l*$ zm@V=`nkCjOkbsn5gz_xerzD^zsk{W0-T7!|qM}(UE~8uG23TUTTcqv^)cI=Uk3OKU zpwwJxC}+GrL9Lg%t5KKfjCCeD+aOifqACk#ve=D<`Ef&1ah+4K38Oy&R8EQ6Ud9mPDHc1NN;6MyJA3lG*!{#FAhy4X9iU?m5qp@}Au4vLjy+23F=9um z*ikz61hFTH9j9W)>)6x8o*{O!ik+fk&k=i`*cmEzrjETx>?LC7s@Qot_6o6AiCv^( z7wg#T#NHrwxr$w(V{Z|Ao7gofcCC)ROYA*jH>%i8I`#pv4~gBTVz=wq$HYD%cDIV% zqhp^D`<&PVD)yj`eM#&qVvnlWV>)7AK{vr0UihZJE{}Jnw1?&qI`%=fcg79@C_N|J2 zr(->c@vnww{G?((>sS^sAF<=BwA(l(*9~Jvo$MT645bKIlUC-evqZ>+JMJCpLlDbQPPS zW0QzYCN@jOcG9u!iA^OoN5#r@Y&x+S#OABm0v+3t*i2$eRIF0Rb|SVjvE?dOtz%`x z<`7${Vykp)F0l$?YgDXG$L14TKy0mw`E_g&vBks!D%PZ9mBf}3Td!gpbgYWla$*q` zYtykBVztELD#kx(qwMfj5?e*AQ^okFYZPo(VylVmt7809H40WoY&T*Dso23fR!?j# zvBOo2e_lrEZ5^=&V#lZ$|747U@lQkhnuwjKVkhZX3$Y-v(^Twq9os-GMC@!8J4eUD z#3IBlP_YYjY!6~lVwbAeWjYoo)=rFnX~laqy;{dQh;1UqKdIuyZqTtkiS0#TO7 z-Kt~z5Zjj+|4@n-yGzIRCw2fa{z()scE64tMC@Q<{Cg)}>=7M1l-Oa!_%}|x82{*r zvP~XA>_}q#J0@O?f7nF9jwW^tv6obgf3!rwjw5zFG5#SEZ*Tm|BnoySv6G1LkBfLQ z{QJDu1W#6D9o{*e#`JB!%a#P~NqybH-c0-|8&5<8C=|Eh-< z@s4P6YGM(VK0_}QU$w`*j2=O zs92_sT|?|zV%aK|qhr?-yMb7NiWTbEO~h^{)?3B;=-92qZX?!T#Rllu9mMV=Hblj? z*0H;Z-9v1ciVfGX`-t67Y@~{f(y<4LJw$Arik0fvBg7shHc7=M>)7MOo**_&#ir}n zQ^cMoHdDoB>DaTxo+DPKVsmut1!6A}o2O#)b?jwguMk_TVoP-FHDa$5t5UJ$I`$^9 zw}`D!v6VXZ4zYKMtyZx$I`%%X4~W&P*jgR?h}g%(8dWTyW1kZHj95^`*6Y|8#J(gJ zR)3b1z9+Ux#X5EDM`Aw_+egLr)v;fQ{Ys2~Z@{}(K1j!YC-w)i z!&K~W9s7&e-^BPA0=&H)qhtRP`;Qp^27nhkQO7cTz`7!2aK?WxcAAcLC)R@)XZH7E zXX{u`Vp+t_SFsCpESp#kG0xZT?d?(>%OjRgj5G3kv8!~fkXR8h&cyG)Up1=1`y-i`CjZk9UDY!FtLYJ>|q_-npg=j&V29fjZ@(( z=Osgl4I{>>?7bN0wpXxiiET%W6V-b$&RnlxBZ-Y7#>wct7-y$furb8O65}-UUX1h3 zD_AM9@x(Z(ycgpv^9nYR*d$_~su*XJSFkC>wkO7U;=R3b;&=s{Mr=AUP73eEI7_^O z?LcftVw~gMi*eF-1)D`|Ct{qn-HUM=cLkeGtc)0EWA|cRFbkQ2l@pswtUDTbu^u`$ zkJx--J{8N>v4zAI5zAMx0v%gItddxg8=_+?h^-_x zRK;z&b5<67I4%4xdiJd}>lR`G#sTG@+Tr(;(WyM`DiO!i_o>)3U~t|!JB zk-gX*I(8$mn}~6?V=s2Ej@?4+R$`pR*o$#mW90c2#uzQK!M~t%$dofN!tY8lidyp9C5B6f5P*}kpCiVz1P8RINID4>yJx1(tV(+UM zXAM@cCy6~pjFSL+d*iIY3ib@KXNhq}UoXZfeiiI_VlNQm)V*GebNMRROT=C##yNVu z7$@yjuvdw_MvRm2dNIz*t6*;sdy^Pv+Vx_bdRM{TCiV`oZkTGui*-k-g1txVePUTE z=F_nciG4&YPsQ?e>=R<266>X6#X9ymu`h^irDFYb>?>kl6C0#rgLUj%V&4(lM#YBe z*bl^hB(|N3jnJ{5iTy%sjEarbvEPXOPHcjTP1LbJiTy=vdlj3iWB(BQm)H&}wxf=5 zGxTL3WbCYBvvsT+vF^m?s#t}NWfJR2Y@v!R(lH;gY+_4QY?+Sb63Zi2qhhr>RzR$f z*e)uztB&;|R!nR+7293M`Vi|&Y@LcV=vY5u{fRZJSc{GgBsPdxNX1%pYzVQfiS40c zQ61Zc*id2{RjfnDh7;SC*j_5Ow~mb!>D#lqumEG%TVq=IMqGFsNRKdm(D9 ziOnK*k&0ccV>=U@P3&?NyF$n25GyCf*)j1i9vwuG|1z%Cu?k}Ih;jByFLslTEg-g# z80Wk6Vz=wqVq!~(agIwbc8`uNCAN$h=dbi)oX}GF0+ti2CdL^ny%?vkRIplND~LUz zVw|v2!B!F5h1jzy#_1;&Y&Eep#9mS{PBp1uyAj)+*y}3B86*{KEipf_cT|jXL@HPV zu|{H??h*f{ZCsrHQNfysH521Rj$Vv2J1SU^*m`1|q|u9U)*_}oq z5gVpr!*%Q!V#g92sbZsa?08})5F4jrr8;&Jv6G2SQnAT8b}F&ch)q+m={j}>u``Ly zRIyn)b~dqdh?S|>934B4*!jffsn~oSyO7vL#1^aA5*@pQ*rmj(RBXA9T~6!@Vk=Z^ zrH)-i>}q1GRcwupT}$jbV)ZJvR>y82b|bMy6$|Lt&BSgY7F4nII(8ee+lhr$ETUs~ z61$67OvU0lb`P<8iEUD`P93|S*aO7&QL%k>>>*+g6XO(c_&05@e2|VkO6)OWoaW7o z9j;?f5POmsCvNj%$LQG8#GWC>soK2Qi8}TivFC|#LN+gUnvT6l>?LBHbj^#Mtz)kc zdzIMvDt3X6y-w^6Vw^|~|E7Hbm+IJC#NH;xNz=U8RXX-AvG<5^qBJjdy^eiA>_cLl z4$X_*qGKNu`-B*$H}hh5>ey$*J}1U0%e>fqI`$>8uZVHlF)zk>$dnU|Z-{+MjMIpD zG0rQdVBZt_ff(lt^J1JpOu>F4_A@a~2Ij>$JD7s~O6)gcoaf7napErp`-9k@#5i4- z7vub03ida#e~57&E-%K3xfJX_VqNeOZw4pV@?xBAOToH=@O2}`IkLPMC(Tl@9>g+< zaq=rK#@VnGEQ^?r7-zQfVw~zq!E%V@660i5UW~I>DOf(S0%Dwv%8PZuD}xGFM64IF z?r7k}dgxehVtt7DR4iM^wj$P#SiXuC=-2>a1Bn%@SZ^I0Ol%0Tek#^q$4ZE8Lu{~$ z4bib-#D)_as$#=*Y&&8jh>cLOkvcYt*l1#7RcxG&jU_gY7$-XNe%+IFY&@|E#HOkk zr!`VGu1Ulu6XR?|-ri>F*!IMx5}U1JoP9{?Z91_T#41#bvkWQNj>KjXTcl!~I7q>E zBDOQJWhz#sV`aqV5UW)&&I6?MHkVihv0YV+bNwjTd}0fT?XF^+&_}@*5nD`*lk|AM zw?-YSB({_oC*bj7oRLTAt%}%kVw_mVi-mQphFC4JsEWmOY$dT(2!)*ff&Ue93J4=O zvx5+F%4HZZLxLF&M!)8I0gm3r29d1tU0%f)Sia!3a)}U<4;gFoJU*7{U1u zjNr5eMsR8aBRFG$5uCNa2u?;|1Scdgg7XX*!MO&E;1mKza2f$4I6Ht5oFTvnzW8qh zU;a0O@AMnN_xg?C>-t9Um3<@lCcY7T8{Y`NWN!ptv^Rq9&l|ya=#Aj3@ka3Vcq91M zyAgcz-3Y$WZbTP6k!(a)5#2=e5RoY&ON38Ej)+_l`63EL6p831qPK`XBDNCIPs9Kb z14RrLF+@a(h;2j+6ER%Gb|OZI7$st~h_NEZi5M?pf`~~XCX3i!#8eT}Ma&SfqllRz zb`r6(h%ym#M9dXYA!5FW1tJ!SSS+Ga#8MGeB9@D&5m75*rHEA`b``N&M4gD;MAVB| zD`K691`z=fO(I%E1VwBR5fTv=5fQP6h^UCTh;|VjA~uQGQ^Z~(_7SnKi2X$zAmShq z2a7mV#9<jmI9J4ZA}$bdp@@q` zTq5E!5toa&Qp8mvt`Tvqi0eh%AmSzwH;cGc#BCz(5OJr7yG7h1;yw}gi+E7PLn0m# z@u-N$MLZ$mDG^VLcvi%7B3=;jqKKD8ydvT?5wDAQQ^Z>$-VyPxi1$T&AmSqtAB*@@ z#AhPD5b>pmuSI+#;yV%Fi}+E*Pa=L1@vDg6Mf@S+FA;x>_*cY#A~NtqfpZ8D(OpCj z5j{m@iO3d_BO*^kzKB8*MIwqt^cK-q#8x8uix?nckchz|wiZz$VyK8=BDNK=orsYl zMu`|BVyuW#5#vQn6fsG}6cO8tm?mPnh#f@iC}Ng~okYwQQ6{2X#9R^cM9delP{bk; zOGH$PSSF%MM74+-5i3Nj6tRnlT}7-BQ72+|5%nVcBG!p$6cG^7ETTokdJ!8$w2BCe zXcMuAh?t1Dh>apTM0ASSQ^ejP_7Sn4i2X$zDB>Uyhln^-#Ni^25OI`ahizJMVu+(ED`63I9J5^A}$bdk%)^$Tq@!+5m$(~QpD9Ft`Tvai0eh% zDB>m&w}`k^#O)&P5OJ4?yG7h9;yw`%hd#pNRNW#OETu5b>3WuSI+-;yV#Pi1<;& z&mw*i@tcU>Mf@q^FA@KU_*aCv_`|NhFoRct6x~F07m+EVrwE^jY!SI4@OSVyTE_B9@D&7Evo=g@{!m zb`h~!#2OL1iP&AlS`mH`4I&yvG>K>y5frgrL`X!dh=_2vi0ee$AmT<5H;cGM#BCyO7jdVEyF}b0 z;$9K=i+Di9Ln0m)@u-N$L_8tlNfA$rct*r?BAyrVqKKD7ydvUN5wDAQL&RGm-WKt$ zi1$Q%AmT$2AB*@z#AhNt7xATtuS9$!;#(2li}*prPa=L6@vDg6MEoJ*PZ58M_(#Nl zB6w5B?D=`G#t7c8F@m>YjNq*pBY20!2;OBef;Uf$;0+WbcwfW_-WxH3w>*sCZ4V=O zH^T_t(J+EHDvaRG3L|(A!U*1nFoL%ijNmN>BY5Y)2;My~f;R<>;Ee$zINomr$NY`p zP`(iy&NqUi^hR)`-UtrB8^J+%BRIBh1jpBn;IO$796C3GBjQGIRNM#-b{oL~ZzDL4 zZ3M@%jo=Wq5gevAf}_tya0J>24lEnN!DS;jW^4qwww.angelfire.com/games4/deranged +//--- Mission String End --- +new SimGroup(MissionGroup) { + + powerCount = "0"; + cdTrack = "6"; + musicTrack = "desert"; + + new MissionArea(MissionArea) { + area = "-1024 -1024 2048 2048"; + flightCeiling = "4000"; + flightCeilingRange = "20"; + + locked = "true"; + }; + new SimGroup(Teams) { + + powerCount = "0"; + + new SimGroup(Team1) { + + powerCount = "1"; + providesPower = "1"; + + new SimGroup(spawnspheres) { + + powerCount = "1"; + + new SpawnSphere() { + position = "-9.76935 149.965 100.102"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + dataBlock = "SpawnSphereMarker"; + lockCount = "0"; + homingCount = "0"; + radius = "15"; + sphereWeight = "50"; + indoorWeight = "100"; + outdoorWeight = "100"; + + locked = "true"; + }; + new StaticShape() { + position = "15.4846 118.008 100.117"; + rotation = "0 0 1 220.198"; + scale = "1 1 1"; + dataBlock = "StationInventory"; + lockCount = "0"; + homingCount = "0"; + + Target = "33"; + locked = "true"; + Trigger = "4333"; + }; + new StaticShape() { + position = "26.3344 129.271 100.125"; + rotation = "0 0 1 44.1178"; + scale = "1 1 1"; + dataBlock = "StationInventory"; + lockCount = "0"; + homingCount = "0"; + + Target = "34"; + locked = "true"; + Trigger = "4335"; + }; + new StaticShape() { + position = "20.4146 135 100.098"; + rotation = "0 0 1 41.253"; + scale = "1 1 1"; + dataBlock = "StationInventory"; + lockCount = "0"; + homingCount = "0"; + + Target = "35"; + locked = "true"; + Trigger = "4337"; + }; + new StaticShape() { + position = "9.81867 123.962 100.077"; + rotation = "0 0 1 223.636"; + scale = "1 1 1"; + dataBlock = "StationInventory"; + lockCount = "0"; + homingCount = "0"; + + Target = "36"; + locked = "true"; + Trigger = "4339"; + }; + }; + }; + new SimGroup(team0) { + + powerCount = "1"; + providesPower = "1"; + }; + new SimGroup(team2) { + + powerCount = "1"; + providesPower = "1"; + + new SpawnSphere() { + position = "152.448 -0.84833 100.058"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + dataBlock = "SpawnSphereMarker"; + lockCount = "0"; + homingCount = "0"; + radius = "15"; + sphereWeight = "100"; + indoorWeight = "100"; + outdoorWeight = "100"; + + locked = "true"; + }; + new StaticShape() { + position = "119.074 20.9951 100.102"; + rotation = "0 0 1 223.063"; + scale = "1 1 1"; + dataBlock = "StationInventory"; + lockCount = "0"; + homingCount = "0"; + + Target = "37"; + locked = "true"; + Trigger = "4344"; + }; + new StaticShape() { + position = "125.119 15.385 100.079"; + rotation = "0 0 1 225.355"; + scale = "1 1 1"; + dataBlock = "StationInventory"; + lockCount = "0"; + homingCount = "0"; + + Target = "38"; + locked = "true"; + Trigger = "4346"; + }; + new StaticShape() { + position = "135.75 26.6431 100.122"; + rotation = "0 0 1 45.2637"; + scale = "1 1 1"; + dataBlock = "StationInventory"; + lockCount = "0"; + homingCount = "0"; + + Target = "39"; + locked = "true"; + Trigger = "4348"; + }; + new StaticShape() { + position = "129.584 32.3413 100.091"; + rotation = "0 0 1 43.5448"; + scale = "1 1 1"; + dataBlock = "StationInventory"; + lockCount = "0"; + homingCount = "0"; + + Target = "40"; + locked = "true"; + Trigger = "4350"; + }; + }; + }; + new Sun(Sun) { + position = "0 0 0"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + direction = "0.57735 0.57735 -0.57735"; + color = "1.000000 1.000000 1.000000 1.000000"; + ambient = "0.500000 0.500000 0.500000 1.000000"; + texture[0] = "special/sunFlare"; + texture[1] = "special/sunFlare02"; + texture[2] = "special/LensFlare/flare01"; + texture[3] = "special/LensFlare/flare02"; + texture[4] = "special/LensFlare/flare03"; + lensFlareScale = "0.7"; + lensFlareIntensity = "1"; + frontFlareSize = "300"; + backFlareSize = "450"; + flareColor = "1.000000 1.000000 1.000000 1.000000"; + + locked = "true"; + }; + new TerrainBlock(Terrain) { + rotation = "1 0 0 0"; + scale = "1 1 1"; + detailTexture = "details/desertdet1"; + terrainFile = "Flatland.ter"; + squareSize = "8"; + emptySquares = "98444 164229 229772 164484 295564 99203 426891 492682 99714 558474 99969 624265 427911 165776 428166 100497 231817 100753 166538 166787 101264 363648 167054 429440 167310 560769 102030 626561 167821 823426 692611 430725"; + + locked = "true"; + position = "-1024 -1024 0"; + }; + new NavigationGraph(NavGraph) { + conjoinAngleDev = "50"; + cullDensity = "0.3"; + customArea = "0 0 0 0"; + + GraphFile = "Flatland.nav"; + conjoinBowlDev = "20"; + locked = "true"; + scale = "1 1 1"; + coverage = "0"; + position = "0 0 0 1"; + rotation = "0 0 0 0"; + }; + new SimGroup(ObserverDropPoints) { + + powerCount = "0"; + + new Camera() { + position = "0 0 200"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + dataBlock = "Observer"; + lockCount = "0"; + homingCount = "0"; + + locked = "true"; + team = "0"; + }; + }; + new Sky(Sky) { + position = "0 0 0"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + cloudHeightPer[0] = "0.349971"; + cloudHeightPer[1] = "0.25"; + cloudHeightPer[2] = "0.199973"; + cloudSpeed1 = "0.0001"; + cloudSpeed2 = "0.0002"; + cloudSpeed3 = "0.0003"; + visibleDistance = "800"; + useSkyTextures = "0"; + renderBottomTexture = "0"; + SkySolidColor = "0.250000 0.750000 1.000000 1.000000"; + fogDistance = "750"; + fogColor = "0.600000 0.600000 0.600000 1.000000"; + fogVolume1 = "200 99 101"; + fogVolume2 = "0 0 0"; + fogVolume3 = "0 0 0"; + materialList = "sky_desert_blue.dml"; + windVelocity = "1 0 0"; + windEffectPrecipitation = "0"; + fogVolumeColor1 = "128.000000 128.000000 128.000000 0.000000"; + fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000000"; + fogVolumeColor3 = "128.000000 128.000000 128.000000 0.000000"; + high_visibleDistance = "-1"; + high_fogDistance = "-1"; + high_fogVolume1 = "-1 2.33105e-09 6.40969e-10"; + high_fogVolume2 = "-1 1.07461e-38 0"; + high_fogVolume3 = "-1 7.9874e-44 5.9061e-32"; + + locked = "true"; + cloudSpeed0 = "0.000503 0.000020"; + }; + new InteriorInstance() { + position = "83.3816 86.4043 16.1"; + rotation = "0 0 1 223.636"; + scale = "1 1 1"; + interiorFile = "dbase2.dif"; + showTerrainInside = "0"; + + locked = "true"; + }; + new TSStatic() { + position = "35.1941 122.022 104.484"; + rotation = "0.377423 -0.847435 -0.37337 98.831"; + scale = "2.27288 3.06824 1"; + shapeName = "dmiscf.dts"; + + locked = "true"; + }; + new TSStatic() { + position = "109.783 27.8607 104.598"; + rotation = "0.377423 -0.847435 -0.37337 98.831"; + scale = "2.27288 3.06824 1"; + shapeName = "dmiscf.dts"; + + locked = "true"; + }; + new TSStatic() { + position = "5.87104 158.993 106.88"; + rotation = "0.777046 -0.445261 0.444907 104.258"; + scale = "11.8008 5.5788 1"; + shapeName = "dmiscf.dts"; + + locked = "true"; + }; + new TSStatic() { + position = "-19.741 134.37 106.734"; + rotation = "0.974913 -0.157456 0.157331 91.41"; + scale = "13.6149 5.67061 1"; + shapeName = "dmiscf.dts"; + + locked = "true"; + }; + new TSStatic() { + position = "-26.0007 161.626 106.834"; + rotation = "-0.264977 0.682102 -0.68156 209.704"; + scale = "13.3927 5.60577 1"; + shapeName = "dmiscf.dts"; + + locked = "true"; + }; + new TSStatic() { + position = "168.934 -13.9842 108.218"; + rotation = "0.901932 0.305235 -0.305533 95.9472"; + scale = "13.3927 5.60577 1"; + shapeName = "dmiscf.dts"; + + locked = "true"; + }; + new TSStatic() { + position = "165.105 13.718 108.118"; + rotation = "-0.144922 -0.69936 0.699924 196.485"; + scale = "13.6149 5.67061 1"; + shapeName = "dmiscf.dts"; + + locked = "true"; + }; + new TSStatic() { + position = "137.419 -8.54752 108.264"; + rotation = "-0.408561 -0.645128 0.645669 224.419"; + scale = "11.8008 5.5788 1"; + shapeName = "dmiscf.dts"; + + locked = "true"; + }; + new SimGroup() { + + powerCount = "0"; + }; +}; +//--- OBJECT WRITE END --- diff --git a/missions/WarTowerClassic.mis b/missions/WarTowerClassic.mis new file mode 100644 index 0000000..ae04509 --- /dev/null +++ b/missions/WarTowerClassic.mis @@ -0,0 +1,369 @@ +$Killstreak::GunshipSpawnLocation["WarTowerClassic"] = "0 -1000 -4000"; +$WarTower::SpawnZone["WarTowerClassic"] = "197.699 -2.4623 -4890"; + +// DisplayName = Tower 2009 Limited Edition +// MissionTypes = Wartower + +//--- Mission Quote Begin --- +// Return of the Classic TWM Game, War Tower comes +// with a brand new tower to battle on +//--- Mission Quote End --- + +//--- Mission String Begin --- +//FFA Concepts apply, kill anyone in your way +//Invincibility in the spawn room, as well +//as inventories +//--- Mission String End --- + +//--- OBJECT WRITE BEGIN --- +new SimGroup(MissionGroup) { + musicTrack = "lush"; + cdTrack = "2"; + powerCount = "0"; + + new MissionArea(MissionArea) { + area = "-825 -900 1200 1500"; + flightCeiling = "5000"; + flightCeilingRange = "20"; + + locked = "true"; + }; + new Sun(Sun) { + position = "-1024 -1024 0"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + direction = "0.622506 0.622506 -0.474313"; + color = "0.800000 0.800000 0.800000 1.000000"; + ambient = "0.400000 0.400000 0.400000 1.000000"; + texture[0] = "special/sunFlare"; + texture[1] = "special/sunFlare02"; + texture[2] = "special/LensFlare/flare01"; + texture[3] = "special/LensFlare/flare02"; + texture[4] = "special/LensFlare/flare03"; + lensFlareScale = "0.7"; + lensFlareIntensity = "1"; + frontFlareSize = "300"; + backFlareSize = "450"; + flareColor = "1.000000 1.000000 1.000000 1.000000"; + + locked = "true"; + }; + new NavigationGraph(NavGraph) { + conjoinAngleDev = "70"; + cullDensity = "0.3"; + customArea = "0 0 0 0"; + conjoinBowlDev = "20"; + locked = "true"; + coverage = "0"; + scale = "1 1 1"; + GraphFile = "slapmydash.nav"; + squareSize = "75"; + XDimOverSize = "0"; + position = "-1024 -1024 0 1"; + YDimOverSize = "0"; + rotation = "0 0 0 0"; + }; + new TerrainBlock(Terrain) { + rotation = "1 0 0 0"; + scale = "1 1 1"; + detailTexture = "details/desertdet1"; + terrainFile = "Slapdash.ter"; + squareSize = "75"; + + locked = "true"; + hazeDistance = "250"; + position = "-1024 -1024 0"; + visibleDistance = "1200"; + }; + + new Sky(Sky) { + position = "-1024 -1024 0"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + cloudHeightPer[0] = "0.349971"; + cloudHeightPer[1] = "0.25"; + cloudHeightPer[2] = "0.199973"; + cloudSpeed1 = "0.0001"; + cloudSpeed2 = "0.0012"; + cloudSpeed3 = "0.0003"; + visibleDistance = "800"; + useSkyTextures = "1"; + renderBottomTexture = "0"; + SkySolidColor = "0.390000 0.390000 0.390000 0.000000"; + fogDistance = "750"; + fogColor = "0.500000 0.500000 0.500000 1.000000"; + fogVolume1 = "0 0 0"; + fogVolume2 = "100 100 120"; + fogVolume3 = "0 0 0"; + materialList = "Lush_l4.dml"; + windVelocity = "1 0 0"; + windEffectPrecipitation = "0"; + fogVolumeColor1 = "128.000000 128.000000 128.000000 -0.040112"; + fogVolumeColor2 = "128.000000 128.000000 128.000000 0.742938"; + fogVolumeColor3 = "128.000000 128.000000 128.000000 0.000000"; + high_visibleDistance = "-1"; + high_fogDistance = "-1"; + high_fogVolume1 = "-1 2.33105e-09 6.40969e-10"; + high_fogVolume2 = "-1 1.07461e-38 0"; + high_fogVolume3 = "-1 7.9874e-44 5.9061e-32"; + + locked = "true"; + cloudSpeed0 = "0.000503 0.000020"; + }; + + new SimGroup(Teams) { + new SimGroup(Team1) { + + }; + new SimGroup(team0) { + + }; + }; + new SimGroup(ObserverDropPoints) { + new Camera() { + position = "0 0 -4500"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + dataBlock = "Observer"; + team = "0"; + locked = "true"; + }; + }; + new Trigger(TriggerOfDie) { + position = "-1000 -1000 -5010"; + rotation = "1 0 0 0"; + scale = "5000 5000 5"; + dataBlock = "deathTrigger"; + lockCount = "0"; + homingCount = "0"; + polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 -0.0000000 -1.0000000 -0.0000000 -0.0000000 -0.0000000 1.0000000"; + }; + new Trigger(TriggerOfNoInvinc) { + position = "208.315 -0.52968 -4898"; + rotation = "1 0 0 0"; + scale = "20 20 20"; + dataBlock = "invincDisableTrigger"; + lockCount = "0"; + homingCount = "0"; + polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 -0.0000000 -1.0000000 -0.0000000 -0.0000000 -0.0000000 1.0000000"; + }; + +}; + +//"197.699 -2.4623 -4899.5" <- Spawn Zone + +//building +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "210.561 -0.77939 -4899.75";rotation = "-0.997501 0.0499524 0.04996 90.1428";scale = "1.12488 0.166666 16.0001";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "207.253 -8.49225 -4895.75";rotation = "0.59567 0.538849 0.595667 123.364";scale = "0.125 0.166666 16.0376";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (ForceFieldBare) () {datablock = "DeployedForceField15";position = "208.315 -0.52968 -4899.51";rotation = "-0.538848 0.595666 0.595672 123.364";scale = "8.0388 3.52977 0.48";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";noSlow = "1";};setTargetSensorGroup(%building.getTarget(),1);checkPowerObject(%building);%building.pzone.delete();%building.pzone = ""; +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "208.526 -0.826263 -4896";rotation = "0.0500204 0.998748 1.266e-06 180";scale = "0.125 0.166666 7";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "208.1 -0.2669 -4899.5";rotation = "0 0 1 95.7344";scale = "0.125 0.166666 8";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "207.776 -8.28877 -4896";rotation = "0.0500204 0.998748 1.266e-06 180";scale = "0.125 0.166666 7";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "207.228 -8.741 -4899.5";rotation = "0 0 1 95.7344";scale = "0.125 0.166666 8";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "210.501 -1.27588 -4897.75";rotation = "0.0353928 0.706662 0.706665 184.054";scale = "0.879902 1.16667 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "209.751 -8.73839 -4897.75";rotation = "0.0353928 0.706662 0.706665 184.054";scale = "0.879902 1.16667 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "212.277 -1.20296 -4895.75";rotation = "0.0499583 0.997501 0.0499584 90.1434";scale = "0.125 0.166666 8.04024";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "211.527 -8.66547 -4895.75";rotation = "0.0499583 0.997501 0.0499584 90.1434";scale = "0.125 0.166666 8.04024";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "206.825 -10.457 -4897.75";rotation = "-0.615849 -0.557104 -0.557103 116.745";scale = "0.748842 1.16667 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "212.526 -1.22794 -4899.5";rotation = "0 0 1 95.7344";scale = "0.125 0.166666 8";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "211.776 -8.69045 -4899.5";rotation = "0 0 1 95.7344";scale = "0.125 0.166666 8";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "206.924 -11.9722 -4895.75";rotation = "0.59567 0.538849 0.595667 123.364";scale = "0.125 0.166666 5.99074";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "206.899 -12.2209 -4899.5";rotation = "0 0 1 95.7344";scale = "0.125 0.166666 8";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "208.321 -0.55447 -4891.75";rotation = "-0.706661 0.035391 0.706667 184.054";scale = "1.875 7.66673 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "199.571 12.3846 -4899.75";rotation = "-0.0353909 -0.706658 0.70667 184.054";scale = "5.00002 0.166666 48.0006";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "208.425 5.47239 -4897.75";rotation = "-0.615849 -0.557104 -0.557103 116.745";scale = "2.74653 1.16667 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "209.222 10.913 -4895.75";rotation = "-0.557106 0.61585 -0.557102 116.747";scale = "0.125 0.166666 21.9722";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "206.899 -12.2209 -4895.5";rotation = "0 0 1 95.7344";scale = "0.125 0.166666 16";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "197.173 -11.4955 -4897.75";rotation = "0.0353928 0.706662 0.706665 184.054";scale = "4.74977 1.16667 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "209.222 10.913 -4887.75";rotation = "-0.557106 0.61585 -0.557102 116.747";scale = "0.125 0.166666 46.0004";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "206.65 -12.1959 -4895.75";rotation = "0.0499583 0.997501 0.0499584 90.1434";scale = "0.125 0.166666 37.9982";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "StationInventory";position = "204.842 8.90453 -4899.5";rotation = "0 0 1 6.29941";scale = "1 1 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";deployed = "1";powerFreq = "1";};setTargetSensorGroup(%building.getTarget(),1);checkPowerObject(%building);%building.deploy();adjustTrigger(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "197.223 -10.9981 -4891.75";rotation = "-0.595668 -0.538849 0.59567 123.364";scale = "1.875 6.33303 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "198.372 0.4446 -4887.5";rotation = "0.741592 0.670851 -1.96627e-06 180";scale = "5.75005 6.33303 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "StationInventory";position = "198.925 9.29874 -4899.5";rotation = "0 0 1 5.72819";scale = "1 1 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";deployed = "1";powerFreq = "1";};setTargetSensorGroup(%building.getTarget(),1);checkPowerObject(%building);%building.deploy();adjustTrigger(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "209.247 11.1617 -4899.5";rotation = "0 0 1 95.7344";scale = "0.125 0.166666 8";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "187.746 -10.2976 -4887.75";rotation = "0.706665 -0.0353928 0.706662 184.054";scale = "0.125 0.166666 37.9982";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "209.247 11.1617 -4895.5";rotation = "0 0 1 95.7344";scale = "0.125 0.166666 16";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "199.571 12.3846 -4897.75";rotation = "-0.997501 0.0499597 0.049965 90.143";scale = "4.74977 1.16667 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "208.998 11.1867 -4895.75";rotation = "0.0499583 0.997501 0.0499584 90.1434";scale = "0.125 0.166666 37.9982";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "188.92 1.3937 -4897.75";rotation = "-0.538848 0.595666 0.595672 123.364";scale = "5.75005 1.16667 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "189.82 12.8613 -4895.75";rotation = "-0.557106 0.61585 -0.557102 116.747";scale = "0.125 0.166666 46.0004";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "StationInventory";position = "193.426 9.85031 -4899.5";rotation = "0 0 1 5.72819";scale = "1 1 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";deployed = "1";powerFreq = "1";};setTargetSensorGroup(%building.getTarget(),1);checkPowerObject(%building);%building.deploy();adjustTrigger(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "199.521 11.8871 -4891.75";rotation = "0.557103 -0.615846 -0.557108 116.746";scale = "1.875 6.33299 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "187.497 -10.2726 -4899.5";rotation = "0 0 1 95.7344";scale = "0.125 0.166666 8";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "188.423 1.44363 -4891.75";rotation = "-0.0499593 -0.997501 0.0499575 90.1429";scale = "1.875 7.66673 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "208.998 11.1867 -4887.75";rotation = "0.0499583 0.997501 0.0499584 90.1434";scale = "0.125 0.166666 37.9982";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "187.497 -10.2726 -4895.5";rotation = "0 0 1 95.7344";scale = "0.125 0.166666 16";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "187.522 -10.0239 -4887.75";rotation = "0.59567 0.538849 0.595667 123.364";scale = "0.125 0.166666 46.0004";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "189.845 13.11 -4899.5";rotation = "0 0 1 95.7344";scale = "0.125 0.166666 8";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "229.879 -6.77214 -4889.93";rotation = "0.0491699 0.981792 0.183486 30.5307";scale = "10.0004 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "DeployedSpine";position = "189.845 13.11 -4895.5";rotation = "0 0 1 95.7344";scale = "0.125 0.166666 16";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "249.355 -8.72729 -4880";rotation = "-4.95942e-07 2.07948e-07 1 185.733";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "249.055 -11.7123 -4877";rotation = "0.997502 -0.0499514 0.0499502 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "252.339 -9.02694 -4877";rotation = "0.0499514 0.997502 0.0499489 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "251.359 11.2429 -4869.93";rotation = "-0.0129595 -0.258799 0.965844 185.537";scale = "1.25 13.3333 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "233.347 32.7219 -4849.93";rotation = "0.258797 -0.0129571 0.965845 185.538";scale = "10.0009 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "253.319 30.7169 -4860";rotation = "-3.98451e-05 1.36077e-06 1 5.73297";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "213.87 34.6773 -4840";rotation = "-1.28655e-07 3.70846e-06 1 185.733";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "211.862 14.7072 -4829.93";rotation = "0.981793 -0.0491647 0.183479 30.5306";scale = "1.25 13.3335 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "253.618 33.702 -4857";rotation = "0.0353804 0.706665 -0.706663 175.947";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "256.304 30.4171 -4857";rotation = "0.706665 -0.0353804 -0.706663 175.946";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "210.885 34.977 -4837";rotation = "-0.0499514 -0.997501 0.0499566 90.1434";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "214.169 37.6624 -4837";rotation = "-0.997502 0.0499514 0.0499486 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "209.905 -4.76687 -4820";rotation = "3.9681e-05 -3.14574e-06 1 5.73297";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "206.92 -4.46713 -4817";rotation = "0.706665 -0.0353804 0.706663 184.054";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "209.606 -7.75191 -4817";rotation = "0.0353804 0.706665 0.706663 184.054";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "229.877 -6.77179 -4809.93";rotation = "-0.258797 0.0129571 0.965845 185.538";scale = "10.0012 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "249.354 -8.72725 -4800";rotation = "1.28655e-07 -3.70846e-06 1 185.733";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "249.055 -11.7123 -4797";rotation = "0.997502 -0.0499514 0.0499486 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "252.339 -9.02693 -4797";rotation = "0.0499514 0.997501 0.0499566 90.1434";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "251.359 11.2429 -4789.93";rotation = "-0.0129586 -0.258799 0.965844 185.537";scale = "1.25 13.3333 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "253.319 30.7169 -4780";rotation = "-3.9681e-05 3.14574e-06 1 5.73297";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "253.618 33.702 -4777";rotation = "0.0353804 0.706665 -0.706663 175.947";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "256.304 30.4171 -4777";rotation = "0.706665 -0.0353804 -0.706663 175.946";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "233.347 32.7219 -4769.93";rotation = "0.258797 -0.0129571 0.965845 185.538";scale = "10.0012 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "213.871 34.6774 -4760";rotation = "4.95394e-05 1.10778e-05 1 5.73352";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "210.887 34.9771 -4757";rotation = "0.706665 -0.0353843 0.706663 184.054";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "214.171 37.6624 -4757";rotation = "0.0353843 0.706665 -0.706663 175.946";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "211.864 14.7076 -4749.93";rotation = "0.981789 -0.0491584 0.183504 30.5307";scale = "1.25 13.3334 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "209.906 -4.76641 -4740";rotation = "-3.65621e-06 -4.12642e-07 1 185.734";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "206.922 -4.46674 -4737";rotation = "-0.049956 -0.997501 0.0499535 90.1434";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "209.606 -7.75135 -4737";rotation = "0.997501 -0.049956 0.0499619 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "229.875 -6.77159 -4729.93";rotation = "-0.258798 0.0129604 0.965845 185.538";scale = "10.0003 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "249.354 -8.72683 -4720";rotation = "1.26069e-05 -3.5375e-06 1 5.73352";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "249.054 -11.7118 -4717";rotation = "0.0353843 0.706665 0.706663 184.054";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "252.339 -9.02648 -4717";rotation = "0.706665 -0.0353843 -0.706663 175.946";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "251.362 11.2429 -4709.93";rotation = "-0.0129586 -0.258797 0.965845 185.539";scale = "1.25 13.3334 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "253.318 30.7169 -4700";rotation = "1.2696e-05 -4.73697e-05 1 5.73407";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "253.618 33.7019 -4697";rotation = "0.0353869 0.706665 -0.706662 175.946";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "256.302 30.4172 -4697";rotation = "0.706665 -0.0353869 -0.706663 175.946";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "233.349 32.7225 -4689.93";rotation = "-0.0491615 -0.981785 0.183524 30.5308";scale = "10.0003 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "213.874 34.6783 -4680";rotation = "-4.30226e-07 3.71888e-06 1 185.735";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "210.889 34.978 -4677";rotation = "-0.0499599 -0.9975 0.0499679 90.1434";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "214.174 37.6633 -4677";rotation = "-0.997501 0.0499599 0.0499593 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "211.866 14.7085 -4669.93";rotation = "0.981785 -0.0491684 0.183524 30.5307";scale = "1.25 13.3334 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "209.909 -4.76541 -4660";rotation = "-2.75268e-05 3.93341e-05 1 5.73475";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "206.924 -4.46571 -4657";rotation = "0.706665 -0.0353919 0.706662 184.054";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "209.609 -7.75036 -4657";rotation = "0.0353919 0.706665 0.706662 184.055";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "229.881 -6.77099 -4649.93";rotation = "-0.258797 0.0129614 0.965845 185.54";scale = "10.0007 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "249.356 -8.72703 -4640";rotation = "-4.60261e-05 -9.29761e-06 1 5.73529";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "249.056 -11.712 -4637";rotation = "0.0353956 0.706665 0.706662 184.055";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "252.34 -9.0268 -4637";rotation = "0.706665 -0.0353956 -0.706662 175.944";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "250.93 6.93452 -4632.43";rotation = "-0.981778 0.0491743 0.183559 30.531";scale = "1.25 9.99997 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "252.455 22.0998 -4625";rotation = "2.843e-06 4.37506e-07 1 185.736";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "252.755 25.0848 -4622";rotation = "-0.9975 0.0499704 0.0499754 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "255.439 21.8 -4622";rotation = "0.0499704 0.9975 0.0499687 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "236.793 23.673 -4617.43";rotation = "-0.0491828 -0.981779 0.183553 30.5311";scale = "7.50072 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "221.625 25.1964 -4610";rotation = "2.92715e-05 -3.19396e-05 1 5.73598";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "218.641 25.4962 -4607";rotation = "0.706665 -0.0354006 0.706662 184.056";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "221.925 28.1814 -4607";rotation = "0.0354006 0.706665 -0.706662 175.944";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "220.049 9.53503 -4602.43";rotation = "0.981778 -0.0491818 0.183559 30.5309";scale = "1.25 10 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "218.526 -5.63047 -4595";rotation = "-1.04084e-06 -4.5076e-07 1 185.736";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "215.542 -5.33071 -4592";rotation = "-0.0499704 -0.9975 0.0499688 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "218.226 -8.61541 -4592";rotation = "0.9975 -0.0499704 0.0499719 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "234.188 -7.20354 -4587.43";rotation = "0.0491828 0.981779 0.183553 30.5311";scale = "7.50072 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "249.356 -8.72691 -4580";rotation = "-2.92715e-05 3.19396e-05 1 5.73598";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "249.056 -11.7119 -4577";rotation = "0.0354006 0.706665 0.706662 184.056";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "252.34 -9.02671 -4577";rotation = "0.706665 -0.0354006 -0.706662 175.944";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "250.93 6.93462 -4572.43";rotation = "-0.981778 0.049181 0.183559 30.531";scale = "1.25 10 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "242.005 18.1244 -4565";rotation = "0 0 1 5.7357";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "247.48 22.5996 -4565";rotation = "1.04084e-06 4.5076e-07 1 185.736";scale = "3.74977 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "239.521 23.3992 -4562";rotation = "-0.0499704 -0.9975 0.0499708 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "242.805 26.0843 -4562";rotation = "-0.9975 0.0499704 0.0499719 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "252.754 25.085 -4562";rotation = "-0.9975 0.0499704 0.0499719 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "255.439 21.8 -4562";rotation = "0.0499704 0.9975 0.0499688 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "240.432 2.46278 -4557.43";rotation = "0.981778 -0.049181 0.183559 30.5309";scale = "1.25 10 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "238.906 -12.7026 -4550";rotation = "-1.04084e-06 -4.5076e-07 1 185.736";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "238.606 -15.6876 -4547";rotation = "0.9975 -0.0499704 0.0499719 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "241.891 -13.0024 -4547";rotation = "0.0499704 0.9975 0.0499708 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "223.245 -11.1295 -4542.43";rotation = "0.258798 -0.0129652 0.965844 185.54";scale = "7.50028 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "208.076 -9.60646 -4535";rotation = "-2.01028e-05 -2.75371e-05 1 5.73543";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "205.092 -9.30672 -4532";rotation = "0.706665 -0.0353969 0.706662 184.055";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "207.776 -12.5914 -4532";rotation = "0.0353969 0.706665 0.706662 184.055";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "209.649 6.05507 -4527.43";rotation = "-0.981778 0.0491759 0.183558 30.5312";scale = "1.25 10 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "211.176 21.2203 -4520";rotation = "0 0 1 185.736";scale = "6.24955 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "198.243 22.5194 -4517";rotation = "-0.0499704 -0.9975 0.0499698 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "201.528 25.2039 -4517";rotation = "-0.557097 0.615861 -0.557097 116.746";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "224.109 19.9212 -4517";rotation = "0.0499704 0.9975 0.0499698 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "221.423 23.2056 -4517";rotation = "0.595674 0.53884 -0.595671 236.635";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "199.867 8.71243 -4513.68";rotation = "0.981779 -0.0491828 0.183552 30.531";scale = "1.25 8.33327 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "219.768 6.71358 -4513.68";rotation = "0.981781 -0.0491843 0.183541 30.531";scale = "1.25 8.3333 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "208.517 -5.21217 -4506.18";rotation = "0.981781 -0.0491835 0.183541 30.531";scale = "6.25005 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "195.734 -2.42218 -4503.58";rotation = "0.708183 0.152239 0.68942 205.06";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "208.085 -9.52061 -4503.68";rotation = "0.981781 -0.0491825 0.18354 30.5312";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "221.599 -5.01953 -4503.58";rotation = "-0.68056 0.219391 0.699075 162.907";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "207.643 -13.915 -4502.5";rotation = "5.65836e-07 2.68445e-06 1 185.735";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "198.459 -5.30717 -4502.08";rotation = "-0.625562 0.69154 0.36117 223.53";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "218.354 -7.30553 -4502.08";rotation = "0.681737 0.616696 0.3936 140.804";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "210.628 -14.2147 -4499.5";rotation = "0.0499656 0.997501 0.0499594 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "207.343 -16.9 -4499.5";rotation = "0.9975 -0.0499656 0.0499639 90.1434";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "191.982 -12.342 -4494.93";rotation = "-0.0491783 -0.981782 0.183538 30.5309";scale = "7.50028 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "176.813 -10.819 -4487.5";rotation = "2.19887e-05 9.69757e-07 1 5.73529";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "176.513 -13.804 -4484.5";rotation = "0.0353956 0.706665 0.706662 184.055";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "173.829 -10.5192 -4484.5";rotation = "0.706665 -0.0353956 0.706662 184.055";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "178.389 4.84238 -4479.93";rotation = "-0.0129627 -0.258797 0.965845 185.54";scale = "1.25 9.99997 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "179.912 20.0078 -4472.5";rotation = "2.843e-06 4.37506e-07 1 185.736";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "180.212 22.9928 -4469.5";rotation = "-0.9975 0.0499704 0.0499754 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "176.928 20.3076 -4469.5";rotation = "-0.0499704 -0.9975 0.049971 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "195.574 18.4349 -4464.93";rotation = "0.0491828 0.981779 0.18355 30.531";scale = "7.50072 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "210.742 16.9117 -4457.5";rotation = "1.83009e-05 2.75777e-05 1 5.73543";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "213.726 16.6119 -4454.5";rotation = "0.706665 -0.0353969 -0.706662 175.945";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "211.042 19.8967 -4454.5";rotation = "0.0353969 0.706665 -0.706662 175.946";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "209.167 1.25013 -4449.93";rotation = "0.0129632 0.258798 0.965845 185.54";scale = "1.25 9.99997 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "207.643 -13.9152 -4442.5";rotation = "-2.29305e-06 8.05055e-07 1 185.736";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "210.627 -14.215 -4439.5";rotation = "0.0499704 0.9975 0.0499685 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "207.343 -16.9002 -4439.5";rotation = "0.9975 -0.0499704 0.0499745 90.1435";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "191.981 -12.342 -4434.93";rotation = "-0.0491828 -0.981779 0.183553 30.5311";scale = "7.50093 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "195.603 -77.659 -4432.57";rotation = "0 0 1 5.7357";scale = "3.74977 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "176.813 -10.8186 -4427.5";rotation = "2.92715e-05 -3.19396e-05 1 5.73598";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "200.078 -83.1335 -4432.57";rotation = "0 0 1 185.736";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "190.128 -82.1341 -4432.57";rotation = "2.17468e-07 1.63718e-06 1 185.736";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "194.603 -87.6085 -4432.57";rotation = "0 0 1 5.7357";scale = "3.74977 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "176.513 -13.8036 -4424.5";rotation = "0.0354005 0.706665 0.706662 184.055";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "173.829 -10.5188 -4424.5";rotation = "0.706665 -0.0354006 0.706662 184.056";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "198.246 -82.9497 -4427.14";rotation = "0.049674 0.991541 0.119913 45.3451";scale = "3.74833 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "178.387 4.84278 -4419.93";rotation = "-0.981774 0.0491817 0.183579 30.5312";scale = "1.25 10 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "201.685 -73.2002 -4421.32";rotation = "-0.93359 0.046697 0.355288 16.0518";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "201.18 -78.2195 -4421.98";rotation = "0 0 1 5.7357";scale = "3.75003 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "205.656 -83.6939 -4421.98";rotation = "0 0 1 185.736";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "190.73 -82.195 -4421.98";rotation = "0 0 1 185.736";scale = "3.75003 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "202.155 -68.5239 -4419.37";rotation = "-0.012954 -0.258783 0.965849 185.54";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "200.18 -88.1695 -4421.98";rotation = "0 0 1 5.7357";scale = "3.75003 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "202.559 -64.508 -4416.28";rotation = "-0.99154 0.049646 0.119932 45.3436";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "179.912 20.0082 -4412.5";rotation = "2.34971e-06 5.02829e-07 1 185.736";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "202.869 -61.4276 -4412.24";rotation = "-0.02503 -0.499832 0.865761 184.967";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "180.212 22.9932 -4409.5";rotation = "-0.997499 0.049976 0.0499787 90.144";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "176.928 20.308 -4409.5";rotation = "-0.049976 -0.997499 0.0499753 90.1434";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "203.015 -59.9692 -4407.41";rotation = "0.039719 0.792735 0.608271 183.49";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "195.573 18.4349 -4404.93";rotation = "-0.258799 0.0129662 0.965844 185.54";scale = "7.5003 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "203.344 -56.6939 -4406.38";rotation = "0.0129769 0.25881 0.965841 185.54";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "203.65 -53.6417 -4404.79";rotation = "0.0397184 0.792731 0.608276 183.49";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "203.979 -50.3664 -4403.76";rotation = "0.0129722 0.258798 0.965844 185.54";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "204.333 -46.8431 -4402.29";rotation = "-0.996631 0.0499176 0.0650699 75.1869";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "204.556 -44.6289 -4401.25";rotation = "0.0108476 0.216425 0.976239 185.599";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "204.918 -41.0345 -4399.57";rotation = "-0.996631 0.0499242 0.065071 75.187";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "205.152 -38.6994 -4398.35";rotation = "0.00870214 0.173639 0.984771 185.649";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "210.742 16.9115 -4397.5";rotation = "2.07534e-05 3.40332e-05 1 5.73598";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "205.517 -35.0716 -4396.44";rotation = "-0.996631 0.0499221 0.0650663 75.1869";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "213.727 16.6117 -4394.5";rotation = "0.706665 -0.0354006 -0.706662 175.945";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "205.763 -32.6286 -4395.03";rotation = "0.00654109 0.130523 0.991424 185.686";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "211.042 19.8965 -4394.5";rotation = "0.0354005 0.706665 -0.706662 175.945";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "206.13 -28.977 -4392.9";rotation = "-0.996631 0.0499268 0.0650675 75.187";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "206.383 -26.4522 -4391.29";rotation = "0.00436656 0.0871534 0.996185 185.714";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "150.363 -78.1402 -4398.93";rotation = "0.300671 -0.0150644 0.953609 185.47";scale = "20.0137 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "209.167 1.25003 -4389.93";rotation = "0.981774 -0.0491813 0.183579 30.5312";scale = "1.25 10 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "206.751 -22.796 -4388.94";rotation = "-0.996631 0.049931 0.0650678 75.187";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "207.01 -20.2076 -4387.11";rotation = "0.00218405 0.043616 0.999046 185.731";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "207.376 -16.566 -4384.54";rotation = "-0.996631 0.0499325 0.0650663 75.187";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "207.643 -13.9153 -4382.5";rotation = "-2.34971e-06 -5.02829e-07 1 185.736";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "115.975 -71.1329 -4378.94";rotation = "-0.130523 0.00653833 0.991424 185.686";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "111.46 -65.6098 -4378.94";rotation = "-0.00653833 -0.130523 0.991424 185.686";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "110.956 -70.6288 -4379.6";rotation = "7.04371e-06 -1.35004e-05 1 5.73557";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "111.93 -60.9343 -4376.99";rotation = "-0.98178 0.049181 0.183547 30.531";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "105.937 -70.1247 -4378.94";rotation = "0.130523 -0.00653833 0.991424 185.686";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "110.494 -75.2261 -4377.69";rotation = "0.0191671 0.382612 0.92371 185.299";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "115.578 -74.6455 -4376.07";rotation = "0 0 1 185.736";scale = "1.25 5.0001 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "111.103 -69.1707 -4376.07";rotation = "0 0 1 5.7357";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "101.261 -69.6552 -4376.99";rotation = "-0.049181 -0.98178 0.183547 30.531";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "110.103 -79.1207 -4376.07";rotation = "0 0 1 5.7357";scale = "1.25 1.66666 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); +%building = new (StaticShape) () {datablock = "Deployedwwall";position = "105.628 -73.646 -4376.07";rotation = "0 0 1 185.736";scale = "1.25 5.00007 1";team = "0";powerCount="1";invincible="1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};checkPowerObject(%building); diff --git a/missions/slapmydashH.mis b/missions/slapmydashH.mis new file mode 100644 index 0000000..145d18e --- /dev/null +++ b/missions/slapmydashH.mis @@ -0,0 +1,211 @@ +// DisplayName = Flatdash Horde +// MissionTypes = Horde Helljump Construction + +//--- Mission Quote Begin --- +// Flat. Dash. ZOMBIES! +// Serverside Horde Mission +//--- Mission Quote End --- + +//--- Mission String Begin --- +//[Horde] Hold out from 50 Waves of Zombies +//[Horde] The Waves get tougher as you kill them +//[Horde] 1 Life Per Wave, Lives do not Stack +//--- Mission String End --- + +//--- OBJECT WRITE BEGIN --- +new SimGroup(MissionGroup) { + + musicTrack = "lush"; + cdTrack = "2"; + powerCount = "0"; + + new MissionArea(MissionArea) { + area = "-825 -900 1200 1500"; + flightCeiling = "5000"; + flightCeilingRange = "20"; + + locked = "true"; + }; + new Sun(Sun) { + position = "-1024 -1024 0"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + direction = "0.622506 0.622506 -0.474313"; + color = "0.800000 0.800000 0.800000 1.000000"; + ambient = "0.400000 0.400000 0.400000 1.000000"; + texture[0] = "special/sunFlare"; + texture[1] = "special/sunFlare02"; + texture[2] = "special/LensFlare/flare01"; + texture[3] = "special/LensFlare/flare02"; + texture[4] = "special/LensFlare/flare03"; + lensFlareScale = "0.7"; + lensFlareIntensity = "1"; + frontFlareSize = "300"; + backFlareSize = "450"; + flareColor = "1.000000 1.000000 1.000000 1.000000"; + + locked = "true"; + }; + new NavigationGraph(NavGraph) { + conjoinAngleDev = "70"; + cullDensity = "0.3"; + customArea = "0 0 0 0"; + conjoinBowlDev = "20"; + locked = "true"; + coverage = "0"; + scale = "1 1 1"; + GraphFile = "slapmydash.nav"; + squareSize = "75"; + XDimOverSize = "0"; + position = "-1024 -1024 0 1"; + YDimOverSize = "0"; + rotation = "0 0 0 0"; + }; + new TerrainBlock(Terrain) { + rotation = "1 0 0 0"; + scale = "1 1 1"; + detailTexture = "details/desertdet1"; + terrainFile = "Slapdash.ter"; + squareSize = "75"; + emptySquares = "94579 99875"; + + locked = "true"; + hazeDistance = "250"; + position = "-1024 -1024 0"; + visibleDistance = "1200"; + }; + + new Sky(Sky) { + position = "-1024 -1024 0"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + cloudHeightPer[0] = "0.349971"; + cloudHeightPer[1] = "0.25"; + cloudHeightPer[2] = "0.199973"; + cloudSpeed1 = "0.0001"; + cloudSpeed2 = "0.0012"; + cloudSpeed3 = "0.0003"; + visibleDistance = "800"; + useSkyTextures = "1"; + renderBottomTexture = "0"; + SkySolidColor = "0.390000 0.390000 0.390000 0.000000"; + fogDistance = "750"; + fogColor = "0.500000 0.500000 0.500000 1.000000"; + fogVolume1 = "0 0 0"; + fogVolume2 = "100 100 120"; + fogVolume3 = "0 0 0"; + materialList = "Lush_l4.dml"; + windVelocity = "1 0 0"; + windEffectPrecipitation = "0"; + fogVolumeColor1 = "128.000000 128.000000 128.000000 -0.040112"; + fogVolumeColor2 = "128.000000 128.000000 128.000000 0.742938"; + fogVolumeColor3 = "128.000000 128.000000 128.000000 0.000000"; + high_visibleDistance = "-1"; + high_fogDistance = "-1"; + high_fogVolume1 = "-1 2.33105e-09 6.40969e-10"; + high_fogVolume2 = "-1 1.07461e-38 0"; + high_fogVolume3 = "-1 7.9874e-44 5.9061e-32"; + + locked = "true"; + cloudSpeed0 = "0.000503 0.000020"; + }; + + + new SimGroup(Teams) { + + powerCount = "0"; + + new SimGroup(Team1) { + + powerCount = "0"; + + new SimGroup(SpawnSpheres) { + + providesPower = "1"; + powerCount = "1"; + + new SpawnSphere() { + position = "-60.1702 -231.369 129.675"; + rotation = "0 0 1 177.409"; + scale = "1 1 1"; + dataBlock = "SpawnSphereMarker"; + lockCount = "1"; + homingCount = "0"; + radius = "30"; + sphereWeight = "100"; + indoorWeight = "25"; + outdoorWeight = "75"; + team = "1"; + }; + }; + }; + + new SimGroup(team0) { + + powerCount = "0"; + + new SimGroup(base0) { + + providesPower = "1"; + powerCount = "1"; + + new TSStatic() { + position = "-16.5982 -360.09 128.145"; + rotation = "-0 0 -1 16.0428"; + scale = "1 1 1"; + shapeName = "borg17.dts"; + + locked = "true"; + team = "0"; + }; + new StaticShape(VehicleStation) { + position = "-62.3581 -259.598 126.2"; + rotation = "0 0 1 0.573347"; + scale = "1 1 1"; + dataBlock = "StationVehiclePad"; + lockCount = "0"; + homingCount = "0"; + + locked = "true"; + lastState = "1"; + Ready = "1"; + Target = "33"; + team = "0"; + station = "9838"; + }; + new StaticShape(InventoryStation) { + position = "-61.7752 -222.35 129.128"; + rotation = "-0.826342 0.00281586 -0.563161 0.69323"; + scale = "1 1 1"; + nameTag = "\x01792"; + dataBlock = "StationInventory"; + lockCount = "0"; + homingCount = "0"; + + locked = "true"; + lastState = "1"; + Target = "34"; + Trigger = "9825"; + team = "0"; + }; + }; + }; + }; + new SimGroup(ObserverDropPoints) { + + powerCount = "0"; + + new Camera(TreeCam) { + position = "-11.8305 -349.906 139.298"; + rotation = "0 0 1 -16.6157"; + scale = "1 0.739761 1"; + dataBlock = "Observer"; + lockCount = "0"; + homingCount = "0"; + + team = "0"; + }; + }; + +}; +//--- OBJECT WRITE END --- diff --git a/scripts/ConstructionGame.cs b/scripts/ConstructionGame.cs new file mode 100644 index 0000000..a46c784 --- /dev/null +++ b/scripts/ConstructionGame.cs @@ -0,0 +1,194 @@ +// DisplayName = Construction + +//--- GAME RULES BEGIN --- +// Build +//--- GAME RULES END --- + +// spam fix +function ConstructionGame::AIInit(%game) { + //call the default AIInit() function + AIInit(); +} + +function ConstructionGame::allowsProtectedStatics(%game) { + return true; +} + +function ConstructionGame::clientMissionDropReady(%game, %client) { + messageClient(%client, 'MsgClientReady',"", "SinglePlayerGame"); + messageClient(%client, 'MsgSPCurrentObjective1' ,"", "Welcome to TWM2!"); + messageClient(%client, 'MsgSPCurrentObjective2' ,"", "Phantom139, DoL, Signal360"); + messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); + DefaultGame::clientMissionDropReady(%game, %client); +} + +function ConstructionGame::onAIRespawn(%game, %client) +{ + //add the default task + if (! %client.defaultTasksAdded) + { + %client.defaultTasksAdded = true; + %client.addTask(AIPickupItemTask); + %client.addTask(AIUseInventoryTask); + %client.addTask(AITauntCorpseTask); + %client.addTask(AIEngageTurretTask); + %client.addTask(AIDetectMineTask); + %client.addTask(AIBountyPatrolTask); + %client.bountyTask = %client.addTask(AIBountyEngageTask); + } + + //set the inv flag + %client.spawnUseInv = true; +} + +function ConstructionGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) { + if (%game.testKill(%clVictim, %clKiller)) { //verify victim was an enemy + %game.awardScoreKill(%clKiller); + %game.awardScoreDeath(%clVictim); + } + else if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide + %game.awardScoreSuicide(%clVictim); +} + +function ConstructionGame::timeLimitReached(%game) { + logEcho("game over (timelimit)"); + %game.gameOver(); + cycleMissions(); +} + +function ConstructionGame::scoreLimitReached(%game) { + logEcho("game over (scorelimit)"); + %game.gameOver(); + cycleMissions(); +} + +function ConstructionGame::gameOver(%game) { + //call the default + DefaultGame::gameOver(%game); + + //send the winner message + %winner = ""; + if ($teamScore[1] > $teamScore[2]) + %winner = %game.getTeamName(1); + else if ($teamScore[2] > $teamScore[1]) + %winner = %game.getTeamName(2); + + if (%winner $= 'Storm') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.stowins.wav" ); + else if (%winner $= 'Inferno') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.infwins.wav" ); + else if (%winner $= 'Starwolf') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.swwin.wav" ); + else if (%winner $= 'Blood Eagle') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.bewin.wav" ); + else if (%winner $= 'Diamond Sword') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.dswin.wav" ); + else if (%winner $= 'Phoenix') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.pxwin.wav" ); + else + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" ); + + messageAll('MsgClearObjHud', ""); + for(%i = 0; %i < ClientGroup.getCount(); %i ++) { + %client = ClientGroup.getObject(%i); + %game.resetScore(%client); + } + for(%j = 1; %j <= %game.numTeams; %j++) + $TeamScore[%j] = 0; +} + +function ConstructionGame::vehicleDestroyed(%game, %vehicle, %destroyer) { +} + + +function ConstructionGame::ToggleModifiers(%game, %modifier, %toggleTo) { + switch$(%modifier) { + case "Titan": + %ModifierDesc = "Death is quite costly... it ends the bonus strike"; + $HellJump::Modifier["Titan"] = %toggleTo; + case "Super-Lunge": + %ModifierDesc = "Normal Zombies lunge at 3X normal distance"; + $HellJump::Modifier["SuperLunge"] = %toggleTo; + case "Kamakaziiiii": + %ModifierDesc = "Volatile Ravenger's move at 5X Speed... be cautious..."; + $HellJump::Modifier["Kamakazi"] = %toggleTo; + case "Where's My Head": + %ModifierDesc = "Zombies cannot be killed by a headshot"; + $HellJump::Modifier["WheresMyHead"] = %toggleTo; + case "You can't see me": + %ModifierDesc = "Normal zombies are now cloaked... mwuhahaha!!!"; + $HellJump::Modifier["YouCantSeeMe"] = %toggleTo; + case "Oh Lordy": + %ModifierDesc = "Zombie lords shoot 4 pulses instead of 2"; + $HellJump::Modifier["OhLordy"] = %toggleTo; + case "It BURNS!": + %ModifierDesc = "Demon Zombie Fireballs now cause Burns"; + $HellJump::Modifier["ItBurns"] = %toggleTo; + case "The Destiny": + %ModifierDesc = "Volatile Ravengers explosive power is doubled"; + $HellJump::Modifier["TheDestiny"] = %toggleTo; + case "Scrambler": + %ModifierDesc = "Zombie lords jam helicopter signals blocking you from calling them in"; + $HellJump::Modifier["Scrambler"] = %toggleTo; + case "Demonic": + %ModifierDesc = "All zombies take 50% of normal damage, thus doubling their HP"; + $HellJump::Modifier["Demonic"] = %toggleTo; + case "All On": + %ModifierDesc = "All Modifiers on"; + $HellJump::Modifier["SuperLunge"] = 1; + $HellJump::Modifier["Kamakazi"] = 1; + $HellJump::Modifier["WheresMyHead"] = 1; + $HellJump::Modifier["YouCantSeeMe"] = 1; + $HellJump::Modifier["OhLordy"] = 1; + $HellJump::Modifier["ItBurns"] = 1; + $HellJump::Modifier["TheDestiny"] = 1; + $HellJump::Modifier["Scrambler"] = 1; + $HellJump::Modifier["Demonic"] = 1; + %game.schedule(2100, "ToggleModifiers", "Titan", 1); + case "All Off": + %ModifierDesc = "All Modifiers Off"; + $HellJump::Modifier["SuperLunge"] = 0; + $HellJump::Modifier["Kamakazi"] = 0; + $HellJump::Modifier["WheresMyHead"] = 0; + $HellJump::Modifier["YouCantSeeMe"] = 0; + $HellJump::Modifier["OhLordy"] = 0; + $HellJump::Modifier["ItBurns"] = 0; + $HellJump::Modifier["TheDestiny"] = 0; + $HellJump::Modifier["Scrambler"] = 0; + $HellJump::Modifier["Demonic"] = 0; + $HellJump::Modifier["Titan"] = 0; + } + if(%modifier !$= "All On" && %modifier !$= "All Off") { + if(%toggleTo == 1) { + %toDisp = "On"; + } + else { + %toDisp = "Off"; + } + //and now lets display our message + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + bottomPrint(%cl, ""@%modifier@" - "@%toDisp@" \n "@%ModifierDesc@"", 2, 2); + messageClient(%cl, 'MsgClient', "\c5HELLJUMP: "@%modifier@" - "@%toDisp@" : "@%ModifierDesc@""); + } + } + else { + //and now lets display our message + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + bottomPrint(%cl, ""@%modifier@" \n "@%ModifierDesc@"", 2, 2); + messageClient(%cl, 'MsgClient', "\c5HELLJUMP: "@%modifier@" : "@%ModifierDesc@""); + } + } +} + +function ConstructionGame::CheckModifier(%game, %mod) { + return $HellJump::Modifier[""@%mod@""]; +} + +function ConstructionGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation) { + DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation); + DoTWM2MissionChecks(%clVictim); +} + + diff --git a/scripts/Customize/CustomScripts.cs b/scripts/Customize/CustomScripts.cs new file mode 100644 index 0000000..2d3d3a3 --- /dev/null +++ b/scripts/Customize/CustomScripts.cs @@ -0,0 +1,25 @@ +//Mod Customization +//Place your scripts in here: + +//THIS FILE IS EXECUTED LAST + +//it will not interfere with the patches, and thus prevents errors + +//If you want to manipulate damage modifiers or datablock stuff, this is how you do it: +//Datablockname.Modifier = new; +//EX: S3Bullet.directDamage = 1.1; //.4 higher + +//Add custom chat commands here! +//I've included a little sample command (in comments) +function parseCustomCommands(%sender, %command, %args) { + switch$(strLwr(%command)) { //CAUTION! Note the strlwr here! that means your command must show in lowercase in each case "": statement + //case "samplecommand": + // %arg1 = getWord(%args, 0); + // %arg2 = getWord(%args, 1) + // //Do stuff here! + // return 1; //return 1; - Command executed correctly + } +} +//make sure you add all of your commands to the list by doing this: +//addCMD("Custom", "sampleCommand", "Usage: /sampleCommand [arg1] [arg2]: Sample command ftw! people see this when they type /cmdHelp sampleCommand."); + diff --git a/scripts/DominationGame.cs b/scripts/DominationGame.cs new file mode 100644 index 0000000..cc14938 --- /dev/null +++ b/scripts/DominationGame.cs @@ -0,0 +1,512 @@ +// DisplayName = Domination + +//--- GAME RULES BEGIN --- +// Three Points are on the map +// Secure a point to gain score +// The more points secured, the faster the point gain +//--- GAME RULES END --- + +$InvBanList[Domination, "RPG"] = 1; + +$DominGame::Rounds = 5; +$DominGame::MaxScore = 350; + +datablock StaticShapeData(DominationObjective) { + className = "StaticShape"; + shapeFile = "flag.dts"; + + maxDamage = 0.5; + destroyedLevel = 0.5; + disabledLevel = 0.3; + + explosion = HandGrenadeExplosion; + expDmgRadius = 1.0; + expDamage = 0.05; + expImpulse = 200; + + dynamicType = $TypeMasks::StaticShapeObjectType; + deployedObject = true; + cmdCategory = "DSupport"; + cmdIcon = CMDSensorIcon; + cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor"; + targetNameTag = 'Control Point'; + deployAmbientThread = true; + debrisShapeName = "debris_generic_small.dts"; + debris = DeployableDebris; + heatSignature = 0; + needsPower = true; + + collidable = false; +}; + +function DominationGame::AIInit(%game) { + //call the default AIInit() function + AIInit(); +} + +function DominationGame::allowsProtectedStatics(%game) { + return true; +} + +function DominationGame::clientMissionDropReady(%game, %client) { + messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); + messageClient(%client, 'MsgClientReady',"", "SinglePlayerGame"); + DefaultGame::clientMissionDropReady(%game, %client); +} + +function DominationGame::onAIRespawn(%game, %client) { + //add the default task + if (!%client.defaultTasksAdded) { + %client.defaultTasksAdded = true; + %client.addTask(AIPickupItemTask); + %client.addTask(AIUseInventoryTask); + %client.addTask(AITauntCorpseTask); + %client.addTask(AIEngageTurretTask); + %client.addTask(AIDetectMineTask); + %client.addTask(AIBountyPatrolTask); + %client.bountyTask = %client.addTask(AIBountyEngageTask); + } + + //set the inv flag + %client.spawnUseInv = true; +} + +function DominationGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) { + if (%game.testKill(%clVictim, %clKiller)) { //verify victim was an enemy + %game.awardScoreKill(%clKiller); + %game.awardScoreDeath(%clVictim); + } + else if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide + %game.awardScoreSuicide(%clVictim); +} + +function DominationGame::timeLimitReached(%game) { + logEcho("game over (timelimit)"); + %game.Intermit(); +} + +function DominationGame::scoreLimitReached(%game) { + logEcho("game over (scorelimit)"); + %game.gameOver(); + cycleMissions(); +} + +function DominationGame::gameOver(%game) { + //call the default + DefaultGame::gameOver(%game); + $TWM2::PlayingDomin = 0; + $FissionEndsGame = 0; + + $Ion::StopIon = 0; + + $TeamWins[1] = 0; + $TeamWins[2] = 0; + + //send the winner message + %winner = ""; + if ($teamScore[1] > $teamScore[2]) + %winner = %game.getTeamName(1); + else if ($teamScore[2] > $teamScore[1]) + %winner = %game.getTeamName(2); + + if (%winner $= 'Storm') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.stowins.wav" ); + else if (%winner $= 'Inferno') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.infwins.wav" ); + else if (%winner $= 'Starwolf') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.swwin.wav" ); + else if (%winner $= 'Blood Eagle') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.bewin.wav" ); + else if (%winner $= 'Diamond Sword') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.dswin.wav" ); + else if (%winner $= 'Phoenix') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.pxwin.wav" ); + else + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" ); + + messageAll('MsgClearObjHud', ""); + for(%i = 0; %i < ClientGroup.getCount(); %i ++) { + %client = ClientGroup.getObject(%i); + %game.resetScore(%client); + } + for(%j = 1; %j <= %game.numTeams; %j++) + $TeamScore[%j] = 0; +} + +function DominationGame::vehicleDestroyed(%game, %vehicle, %destroyer) { + +} + +function DominationGame::startMatch(%game) { + DefaultGame::StartMatch(%game); + $Domination::TeamScore[1] = 0; + $Domination::TeamScore[2] = 0; + + $TeamWins[1] = 0; + $TeamWins[2] = 0; + + $Ion::StopIon = 1; + + $TWM2::PlayingDomin = 1; + $DominGame::RoundNumber = 1; + $FissionEndsGame = 1; + Game.NumTeams = 2; + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + CenterPrint(%cl, "DOMINATION", 5, 2); + if(isObject(%cl.player)) { + %cl.player.setMoveState(true); + %cl.player.schedule(5000, "setMoveState", false); + } + } + %game.InitialSetup($CurrentMission); + %game.AddTeamScore(); + + setSensorGroupCount(7); +} + +function DominationGame::Intermit(%game) { + $DominGame::RoundNumber++; + $Domination::TeamScore[1] = 0; + $Domination::TeamScore[2] = 0; + + %game.flag1.Controller = 0; + %game.flag2.Controller = 0; + %game.flag3.Controller = 0; + + %game.flag1.CapCount = 0; + %game.flag2.CapCount = 0; + %game.flag3.CapCount = 0; + + if($DominGame::RoundNumber > $DominGame::Rounds) { + %game.schedule(10000, "GameOver"); + CycleMissions(); + } + else { + MessageAll('msgInter', "\c5Domination: INTERMISSION, ROUND "@$DominGame::RoundNumber@" BEGINNING"); + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + CenterPrint(%cl, "DOMINATION \n Round "@$DominGame::RoundNumber@"", 5, 2); + if(isObject(%cl.player) && %cl.player.getState() !$= "dead") { + %cl.player.setMoveState(true); + %cl.player.schedule(5000, "setMoveState", false); + %goto = %game.pickTeamSpawn(%cl.team); + %cl.player.setPosition(%goto); + } + } + } +} + +function DominationGame::InitialSetup(%game, %map) { + %game.flag1 = new StaticShape() { + dataBlock = DominationObjective; + position = $DominationGame::ObjectiveLocation1[%map]; + }; + %game.flag2 = new StaticShape() { + dataBlock = DominationObjective; + position = $DominationGame::ObjectiveLocation2[%map]; + }; + %game.flag3 = new StaticShape() { + dataBlock = DominationObjective; + position = $DominationGame::ObjectiveLocation3[%map]; + }; + MissionCleanup.add(%game.flag1); + MissionCleanup.add(%game.flag2); + MissionCleanup.add(%game.flag3); + + %name[1] = $dFlag[1]; + %name[2] = $dFlag[2]; + %name[3] = $dFlag[3]; + for(%i = 1; %i < 4; %i++) { + if($Domination::Flag[%i, $CurrentMission] !$= "") { + %name[%i] = $Domination::Flag[%i, $CurrentMission]; + } + } + + %game.flag1.Name = %name[1]; + %game.flag2.Name = %name[2]; + %game.flag3.Name = %name[3]; + + %game.flag1.Controller = 0; + %game.flag2.Controller = 0; + %game.flag3.Controller = 0; + + %game.flag1.CapCount = 0; + %game.flag2.CapCount = 0; + %game.flag3.CapCount = 0; + + %game.ScanFlagArea(%game.flag1); + %game.ScanFlagArea(%game.flag2); + %game.ScanFlagArea(%game.flag3); + + %game.WPLoop(%game.flag1); + %game.WPLoop(%game.flag2); + %game.WPLoop(%game.flag3); +} + +function DominationGame::ScanFlagArea(%game, %area) { + InitContainerRadiusSearch(%area.getPosition(), 25, $TypeMasks::PlayerObjectType); + while ((%potentialTarget = ContainerSearchNext()) != 0) { + if(%potentialTarget.team != %area.Controller) { + %enemyPlayers++; + } + else { + %friendlyPlayers++; + } + // + %cl = %potentialTarget.client; + if(%friendlyPlayers >= 1 && %enemyPlayers >= 1) { + bottomPrint(%potentialTarget.client, "AREA CONTESTED", 1, 2); + } + else if(%friendlyPlayers == 0 && %enemyPlayers >= 1) { + bottomPrint(%potentialTarget.client, "CAPTURING AREA ("@%area.CapCount@" / 30)", 1, 2); + %game.CaptureArea(%area, %potentialTarget, %potentialTarget.team); + } + } + %game.schedule(500, "ScanFlagArea", %area); +} + +function DominationGame::CaptureArea(%game, %area, %player, %team) { + %area.CapCount++; + if(%area.CapCount > 30) { + %area.Controller = %team; + MessageAll("\c5DOMINATON: Point "@%area.name@" captured by team "@%team@"."); + bottomPrint(%player.client, "Area "@%area.name@" captured, +20 XP", 3, 2); + GainExperience(%player.client, 20, "Domination Territory Captured "); + CompleteNWChallenge(%player.client, "ZoneCapture"); + recordAction(%player.client, "AREACAP"); + %area.CapCount = 0; + return; + } +} + +function DominationGame::BuildFlagControlString(%game, %team) { + %string = ""; + if(%game.flag1.Controller == %team) { + %string = ""@%string@"[Alpha]"; + } + if(%game.flag2.Controller == %team) { + %string = ""@%string@" [Bravo]"; + } + if(%game.flag3.Controller == %team) { + %string = ""@%string@" [Charlie]"; + } + // + //they have all 3! + if(%string $= "[Alpha] [Bravo] [Charlie]") { + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + if(%cl.team == %team) { + messageClient(%cl, 'msgDominated', "\c5TEAM: All Positions Locked Down, Hold Those Positions!!!"); + CompleteNWChallenge(%cl, "ABC"); + } + else { + messageClient(%cl, 'msgDominated', "\c5TEAM: We Are Being DOMINATED, Take Those Positions!!!"); + } + } + } + return %string; +} + +function DominationGame::AddTeamScore(%game) { + if(%game.flag1.Controller != 0) + $Domination::TeamScore[%game.flag1.Controller]++; + if(%game.flag2.Controller != 0) + $Domination::TeamScore[%game.flag2.Controller]++; + if(%game.flag3.Controller != 0) + $Domination::TeamScore[%game.flag3.Controller]++; + + MessageAll('MsgSPCurrentObjective1', "", "TEAM 1 ["@$TeamWins[1]@"/5]: ("@%game.BuildFlagControlString(1)@"), "@$Domination::TeamScore[1]@" / "@$DominGame::MaxScore@""); + MessageAll('MsgSPCurrentObjective2', "", "TEAM 2 ["@$TeamWins[2]@"/5]: ("@%game.BuildFlagControlString(2)@"), "@$Domination::TeamScore[2]@" / "@$DominGame::MaxScore@""); + + %game.schedule(3000, "AddTeamScore"); + %game.CheckIntermit(); +} + +function DominationGame::CheckIntermit(%game) { + if($Domination::TeamScore[1] >= $DominGame::MaxScore) { + MessageTeam(1, 'MsgWin', "DOMINATION: Excellent Work, We Have Dominated!!!"); + MessageTeam(2, 'MsgWin', "DOMINATION: We have been Dominated, Try Harder Next Time"); + $teamScore[1] += 10000; + $TeamWins[1]++; + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + if(%cl.team == 1) { + recordAction(%cl, "DOMWIN"); + switch($TeamWins[1]) { + case 1: + CompleteNWChallenge(%cl, "MatchSet"); + case 3: + CompleteNWChallenge(%cl, "3For5"); + case 5: + CompleteNWChallenge(%cl, "Undefeatable"); + } + } + } + %game.Intermit(); + } + else if($Domination::TeamScore[2] >= $DominGame::MaxScore) { + MessageTeam(1, 'MsgWin', "DOMINATION: We have been Dominated, Try Harder Next Time"); + MessageTeam(2, 'MsgWin', "DOMINATION: Excellent Work, We Have Dominated!!!"); + $teamScore[2] += 10000; + $TeamWins[2]++; + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + if(%cl.team == 2) { + recordAction(%cl, "DOMWIN"); + switch($TeamWins[2]) { + case 1: + CompleteNWChallenge(%cl, "MatchSet"); + case 3: + CompleteNWChallenge(%cl, "3For5"); + case 5: + CompleteNWChallenge(%cl, "Undefeatable"); + } + } + } + %game.Intermit(); + } + else if($Domination::TeamScore[1] == $DominGame::MaxScore && $Domination::TeamScore[2] == $DominGame::MaxScore) { + MessageTeam(1, 'MsgWin', "DOMINATION: It's a DRAW!!!"); + MessageTeam(2, 'MsgWin', "DOMINATION: It's a DRAW!!!"); + %game.Intermit(); + } +} + +function DominationGame::pickTeamSpawn(%game, %team) { + if(%team == 1) { + %pos = vectorAdd($DominationGame::SpawnLocation1[$CurrentMission],GetRandomPosition(5,1)); + %pos = vectorAdd(%pos,"0 0 5"); + return %pos; + } + else if(%team == 2) { + %pos = vectorAdd($DominationGame::SpawnLocation2[$CurrentMission],GetRandomPosition(5,1)); + %pos = vectorAdd(%pos,"0 0 5"); + return %pos; + } +} + +function DominationGame::WPLoop(%game, %area) { + if(!isObject(%area)) { + return; //no console spamz 4 you + } + if(isObject(%area.wp)) { + %area.wp.delete(); + } + %area.wp = new WayPoint() { + position = %area.getPosition(); + dataBlock = "WayPointMarker"; + team = %area.Controller; + name = ""@%area.name@""; + }; + MissionCleanup.add(%area.wp); + %game.schedule(500, "WPLoop", %area); +} + +//MissionLists +$DominationGame::SpawnLocation1["EngelamHimmel"] = "126.7 14.7 181"; +$DominationGame::SpawnLocation2["EngelamHimmel"] = "-282 16 181"; +$DominationGame::ObjectiveLocation1["EngelamHimmel"] = "-176.82 32.36 180.016"; +$DominationGame::ObjectiveLocation2["EngelamHimmel"] = "-100 0 251"; +$DominationGame::ObjectiveLocation3["EngelamHimmel"] = "-22.25 32 180.016"; + +$DominationGame::SpawnLocation1["SideSwipe"] = "-83 -270 354"; +$DominationGame::SpawnLocation2["SideSwipe"] = "-82.3 -114 354"; +$DominationGame::ObjectiveLocation1["SideSwipe"] = "-72 -216.75 354"; +$DominationGame::ObjectiveLocation2["SideSwipe"] = "-83.6 -196.2 397"; +$DominationGame::ObjectiveLocation3["SideSwipe"] = "-92.2 -163.13 354"; + +$DominationGame::SpawnLocation1["HarbingerTower"] = "810.5 -401.1 102"; +$DominationGame::SpawnLocation2["HarbingerTower"] = "814.2 -428.7 198"; +$DominationGame::ObjectiveLocation1["HarbingerTower"] = "799.4 -402.1 113"; +$DominationGame::ObjectiveLocation2["HarbingerTower"] = "820.7 -413.5 155"; +$DominationGame::ObjectiveLocation3["HarbingerTower"] = "815 -401.7 180"; + +$DominationGame::SpawnLocation1["Skyline"] = "-59.0467 -419.333 791.448"; +$DominationGame::SpawnLocation2["Skyline"] = "-60.0561 -256.818 814.83"; +$DominationGame::ObjectiveLocation1["Skyline"] = "-59.73 -280.06 773.08"; +$DominationGame::ObjectiveLocation2["Skyline"] = "-61.15 -366.13 740.925"; +$DominationGame::ObjectiveLocation3["Skyline"] = "-59.26 -394.66 773.08"; + +$DominationGame::SpawnLocation1["GeometricOrder"] = "-172.325 -396.557 159.9"; +$DominationGame::SpawnLocation2["GeometricOrder"] = "-10.7 -573.29 159.9"; +$DominationGame::ObjectiveLocation1["GeometricOrder"] = "4.23 -600.6 159.9"; +$DominationGame::ObjectiveLocation2["GeometricOrder"] = "-79.9 -487.06 159.9"; +$DominationGame::ObjectiveLocation3["GeometricOrder"] = "-185.68 -559.78 160.45"; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +function GenerateDominationChallengeMenu(%client, %tag, %index) { + if(%client.CheckNWChallengeCompletion("ZoneCapture")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Zone Conquerer - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Zone Conquerer - Capture an Area."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("ABC")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Alpha Bravo Charlie - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Alpha Bravo Charlie - Secure All Three Areas at one Time."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("MatchSet")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Match Set - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Match Set - Win a Round Of Domination."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("3For5")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Three For Five - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Three For Five - Win 3 Rounds Of Domination."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Undefeatable")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Undefeatable - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Undefeatable - Go Undefeated in a full game of Domination."); + %index++; + } + // + return %index; +} diff --git a/scripts/HelljumpGame.cs b/scripts/HelljumpGame.cs new file mode 100644 index 0000000..bbf2e27 --- /dev/null +++ b/scripts/HelljumpGame.cs @@ -0,0 +1,2884 @@ +// DisplayName = Helljump + +//--- GAME RULES BEGIN --- +// Players are dropped into combat zones where they must survive +// Endless waves of zombies. Reinforcements after 5 strikes, 5 strikes +// make 1 group. 5 Groups make 1 wave. Bonus strike after a wave is +// complete. Ammo is scarse, so be careful. +//--- GAME RULES END --- + +//HELLJUMP GAME +//COPYRIGHT 2009-2010, PHANTOM GAMES DEVELOPMENT +//ALL RIGHTS RESERVED + +//The Code.. to end all :p + +//Zombie Spawn Area (ignore Z-Coord) +$HellJump::ZSpawnZoneCt["FlatlandBigH"] = 1; +$HellJump::ZSpawnZone["FlatlandBigH", 1] = "3000 0 100"; + +$HellJump::ZSpawnZoneCt["slapmydashH"] = 1; +$HellJump::ZSpawnZone["slapmydashH", 1] = "3000 -700 100"; + +$HellJump::ZSpawnZoneCt["FrozenNight"] = 4; +$HellJump::ZSpawnZone["FrozenNight", 1] = "-2125 2314 130"; +$HellJump::ZSpawnZone["FrozenNight", 2] = "-2329 2121 150"; +$HellJump::ZSpawnZone["FrozenNight", 3] = "-2246 2431 80"; +$HellJump::ZSpawnZone["FrozenNight", 4] = "-2369 2490 145"; + +$HellJump::ZSpawnZoneCt["HelljumpIsland"] = 1; +$HellJump::ZSpawnZone["HelljumpIsland", 1] = "1290 -1225 275"; + +//Define Initial Spawn Zone +$HellJump::SpawnGraph["FlatlandBigH"] = "52 0 101"; +$HellJump::SpawnGraph["slapmydashH"] = "-64.7988 -267.13 131.439"; +$HellJump::SpawnGraph["FrozenNight"] = "30 26 80"; +$HellJump::SpawnGraph["HelljumpIsland"] = "-791.454 499.031 540.0"; +// +//Define drop points (dont worry about Z, the code always uses the transport's current height) +$HellJump::DropPos["FlatlandBigH"] = "3000 0 1000"; +$HellJump::DropPos["HelljumpIsland"] = "1080 -1210 1000"; +$HellJump::DropPos["slapmydashH"] = "3000 -700 1000"; +$HellJump::DropPos["FrozenNight"] = "-2274 2288 1000"; +// + + +function HelljumpGame::pickPlayerSpawn(%game, %client, %respawn) { + if (isobject(%client.spawnpoint)) { + if (%client.spawnpoint.team == %client.team) { + if ( (%client.spawnpoint.ispersonal != 1) || (%client==%client.spawnpoint.owner) ) { + if (%client.spawnpoint.getdatablock().isspawnpoint==1) { + return vectoradd(%client.spawnpoint.getposition(),"0 0 1.5") SPC "0 0 0 1"; + } + } + else { + messageclient(%client,'',"\c3The spawn point you selected is a personal spawn point, spawning you at default spawn location."); + } + } + else { + messageclient(%client,'',"\c3The spawn point you selected is not on your team, spawning you at default spawn location."); + } + } + if ( (!isobject(%client.spawnpoint)) && (%client.spawnpoint != 0) && (%client.spawnpoint !$= "") ) { + messageclient(%client,'',"\c3The spawn point you selected does not exist, spawning you at default spawn location."); + } + + // place this client on his own team, '%respawn' does not ever seem to be used + //we no longer care whether it is a respawn since all spawns use same points. + %loc = $HellJump::SpawnGraph[$CurrentMission]; + %position = vectorAdd(%loc,VectorAdd(getRandomPosition(20,1), "0 0 10")); + return %position;//return %game.pickTeamSpawn(%client.team); +} + +function HelljumpGame::AIInit(%game) { + //call the default AIInit() function + AIInit(); +} + +function HelljumpGame::allowsProtectedStatics(%game) { + return true; +} + +function HelljumpGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation) { + Parent::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation); + if(%clVictim !$= "") { //actual player died + if(%game.CheckModifier("Titan") == 1) { + //end the bonus round! + %game.KillAllZombies(); + //don't continue on, if the player is going solo, we let him continue + BottomPrintAll("Bonus Strike Over..."); + return; + } + %clVictim.CantRespawn = 1; //gotta wait until next round / Wave + CenterPrint(%clVictim, "You are out until the next Group.",2,3); +// forceObserver( %game, %clVictim, "AdminForce" ); //not needed + Echo("Helljump: "@%clVictim.namebase@" has been killed."); + %game.CheckForLivingPlayers(); + } +} + +function HelljumpGame::CheckForLivingPlayers(%game) { + if($Helljump::Preparing) { + return; + } + $HellJump::LivingCount = 0; + %count = ClientGroup.getCount(); + if(%count == 0) { //no players, this fixed the constant game over stuff + return; + } + for (%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject( %i ); + if(!isObject(%cl.player) || %cl.player.getstate() $= "dead") { + //Do nothing + } + else { + $HellJump::LivingCount++; + } + } + //Display: + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + messageClient(%cl, 'MsgSPCurrentObjective2', "", "[Players: "@$HellJump::LivingCount@"][SCORE: Team: "@$HellJump::Score["Team"]@" You: "@$HellJump::Score[%cl]@"]"); + } + if($HellJump::LivingCount <= 0) { + //Everyone is Dead, or nobody is in the server, game over + %game.gameOver(); + reloadCurrentMission(); + //cycleMissions(); + } +} + +function reloadCurrentMission() { + loadMission( $CurrentMission, $CurrentMissionType ); +} + +function HelljumpGame::KillAllZombies(%game) { + Echo("Helljump: Cleaning Zombies"); + %count = MissionCleanup.getCount(); + for(%i = 0; %i < %count; %i++) { + %obj = MissionCleanup.getObject(%i); + if(isObject(%obj)) { + if(%obj.iszombie) { + %obj.scriptkill($DamageType::admin); //They all went on crack and died XD + } + } + } +} + +function HelljumpGame::AllowAllRespawn(%game) { + Echo("Helljump: Players Can now respawn."); + %count = ClientGroup.getCount(); + for (%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject( %i ); + %cl.CantRespawn = 0; + CenterPrint(%cl, "You can now respawn, but hurry, you have 15 seconds.",2,3); + } + %game.schedule(15000, "ExpireRespawn"); + messageAll('MsgSPCurrentObjective2' ,"", "You Can Now Spawn"); +} + +function HelljumpGame::ExpireRespawn(%game) { + Echo("Helljump: Players Can no longer respawn."); + %count = ClientGroup.getCount(); + for (%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject( %i ); + %cl.CantRespawn = 0; + CenterPrint(%cl, "The Respawn Period Has Expired.",2,3); + } + %game.CheckForLivingPlayers(); +} + +function HelljumpGame::spawnPlayer( %game, %client, %respawn ) { + if(%client.CantRespawn) { + CenterPrint(%client, "You are out until the next Group.",2,3); +// forceObserver( %game, %client, "AdminForce" ); //Eh, for now + return; + } + Parent::spawnPlayer( %game, %client, %respawn ); + %game.CheckForLivingPlayers(); + //board an availiable transport + %game.checkTrans(%client); +} + +function HelljumpGame::clientJoinTeam( %game, %client, %team, %respawn ) +{ + // for multi-team games played with a single team + if (Game.numTeams == 1) { + %game.assignClientTeam( %client ); + // Spawn the player: + %game.spawnPlayer( %client, %respawn ); + return; + } + +//error("DefaultGame::clientJoinTeam"); + if ( %team < 1 || %team > %game.numTeams ) + return; + + if( %respawn $= "" ) + %respawn = 1; + + %client.team = %team; + %client.lastTeam = %team; + setTargetSkin( %client.target, %game.getTeamSkin(%team) ); + setTargetSensorGroup( %client.target, %team ); + %client.setSensorGroup( %team ); + + // Spawn the player: + %game.spawnPlayer( %client, %respawn ); + +// messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 joined %2.', %client.name, %game.getTeamName(%team), %client, %team ); +// messageClient( %client, 'MsgClientJoinTeam', '\c1You joined the %2 team.', $client.name, %game.getTeamName(%client.team), %client, %client.team ); + + updateCanListenState( %client ); + + logEcho(%client.nameBase@" (cl "@%client@") joined team "@%client.team); + if ($Host::Prison::Enabled == true) { + if (%client.isJailed) + // If player should manage to get out of jail, re-spawn and re-start sentence time + jailPlayer(%client,false,mAbs(%cl.jailTime)); + } +} + +function HelljumpGame::assignClientTeam(%game, %client, %respawn ) { + + %client.team = 1; + %client.lastTeam = 1; + + // Assign the team skin: + if ( %client.isAIControlled() ) { + if ( %leastTeam & 1 ) { + %client.skin = addTaggedString( "basebot" ); + setTargetSkin( %client.target, 'basebot' ); + } + } + else + setTargetSkin( %client.target, %game.getTeamSkin(%client.team) ); + //setTargetSkin( %client.target, %client.skin ); + + // might as well standardize the messages + //messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 joined %2.', %client.name, $teamName[%leastTeam], %client, %leastTeam ); + //messageClient( %client, 'MsgClientJoinTeam', '\c1You joined the %2 team.', $client.name, $teamName[%client.team], %client, %client.team ); +// messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 joined %2.', %client.name, %game.getTeamName(%client.team), %client, %client.team ); +// messageClient( %client, 'MsgClientJoinTeam', '\c1You joined the %2 team.', %client.name, %game.getTeamName(%client.team), %client, %client.team ); + + updateCanListenState( %client ); + + logEcho(%client.nameBase@" (cl "@%client@") joined team "@%client.team); +} + +function HelljumpGame::clientChangeTeam(%game, %client, %team, %fromObs) { + if(%client.CantRespawn) { + if(!%fromObs) { //:D they tried to change teams + CenterPrint(%client, "You are out until the next Group. \n Although that was a good try :D",2,3); + return; + } + else { + CenterPrint(%client, "You are out until the next Group.",2,3); + return; + } + } + %game.removeFromTeamRankArray(%client); + + %pl = %client.player; + if(isObject(%pl)) + { + if(%pl.isMounted()) + %pl.getDataBlock().doDismount(%pl); + %pl.scriptKill(0); + } + + // reset the client's targets and tasks only + clientResetTargets(%client, true); + + // give this client a new handle to disassociate ownership of deployed objects + if( %team $= "" && (%team > 0 && %team <= %game.numTeams)) + { + if( %client.team == 1 ) + %client.team = 2; + else + %client.team = 1; + } + else + %client.team = %team; + + // Set the client's skin: + if (!%client.isAIControlled()) + setTargetSkin( %client.target, %game.getTeamSkin(%client.team) ); + setTargetSensorGroup( %client.target, %client.team ); + %client.setSensorGroup( %client.team ); + + // Spawn the player: + %client.lastSpawnPoint = %game.pickPlayerSpawn( %client ); + + %game.createPlayer( %client, %client.lastSpawnPoint, $MatchStarted ); + + if($MatchStarted) + %client.setControlObject(%client.player); + else + { + %client.camera.getDataBlock().setMode(%client.camera, "pre-game", %client.player); + %client.setControlObject(%client.camera); + } + %game.onClientEnterObserverMode(%client); + updateCanListenState( %client ); + + // MES - switch objective hud lines when client switches teams + messageClient(%client, 'MsgCheckTeamLines', "", %client.team); + logEcho(%client.nameBase@" (cl "@%client@") switched to team "@%client.team); + +} + +function HelljumpGame::clientMissionDropReady(%game, %client) { + %count = ClientGroup.getCount(); + if($MatchStarted && $CountdownStarted && %count == 1) { //Game started, first player is in + messageClient(%client, 'MsgClient', "\c5Welcome To Helljump, You are the first player, Restarting game!"); + %client.CantRespawn = 0; //they will get the first life + %game.GameOver(); + reloadCurrentMission(); + //CycleMissions(); + } + else if($MatchStarted && $CountdownStarted && %count > 1) { // Game in progress, multiple players + %game.CheckForLivingPlayers(); + messageClient(%client, 'MsgClient', "\c5Welcome To Helljump, Please wait for the next Group to begin."); + %client.CantRespawn = 1; + } + $HellJump::Score[%client] = 0; + messageClient(%client, 'MsgClientReady',"", "SinglePlayerGame"); + defaultGame::clientMissionDropReady(%game, %client); + // + if($HellJump::HellClass[%client] $= "") { + $HellJump::HellClass[%client] = "HellJumper"; + } + // +} + +function HelljumpGame::onAIRespawn(%game, %client) { + //add the default task + if (! %client.defaultTasksAdded) + { + %client.defaultTasksAdded = true; + %client.addTask(AIPickupItemTask); + %client.addTask(AIUseInventoryTask); + %client.addTask(AITauntCorpseTask); + %client.addTask(AIEngageTurretTask); + %client.addTask(AIDetectMineTask); + %client.addTask(AIBountyPatrolTask); + %client.bountyTask = %client.addTask(AIBountyEngageTask); + } + + //set the inv flag + %client.spawnUseInv = true; +} + +function HelljumpGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) { + if (%game.testKill(%clVictim, %clKiller)) { //verify victim was an enemy + %game.awardScoreKill(%clKiller); + %game.awardScoreDeath(%clVictim); + } + else if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide + %game.awardScoreSuicide(%clVictim); +} + +function HelljumpGame::timeLimitReached(%game) { + logEcho("game over (timelimit)"); + %game.gameOver(); + cycleMissions(); +} + +function HelljumpGame::startMatch(%game) { + $Host::nozombs = 0; //Allow Zombs + $HellJump::CanSpawnZombies = 1; + // IN ORDER OF APPEARANCE + $HellJump::CurrentStrike = 1; + $HellJump::CurrentGroup = 1; + $HellJump::CurrentWave = 1; + // + $HellJump::Zombiecount = 0; //Start at 0 ` + $HellJump::LivingCount = 0; //Start at 0 + $Host::RankSystem = 0; + + $HellJump::Score["Team"] = 0; + $HellJump::BonusStrike = 0; //used for spawning + + $TWM::PlayingHellJump = 1; + $HellJump::Game = %game; //This allows us to expand into other functions + DefaultGame::startMatch(%game); + messageAll('MsgSPCurrentObjective1' ,"", "Initial Startup - Prepare To Drop"); + + %group = NameToID("HellJumpGroup"); + if(%group == -1) { + %game.HellGroup = new SimGroup(HellJumpGroup); //used for hell jump + } + setSensorGroupCount(31); + %game.AllowAllRespawn(); + %game.StartWave(1); +} + +function HelljumpGame::SaveScores(%game) { + if (!IsFile("Server/Helljump/Scores/"@formattimestring("hh:nn a mm-dd-yy")@".txt")){ + new fileobject(HellScore); + HellScore.openforwrite("Server/Helljump/Scores/"@formattimestring("hh-nn-a-mm-dd-yy")@".txt"); + HellScore.writeline("Scores for this round."); + HellScore.writeline("Wave "@$HellJump::CurrentWave@", Group "@$HellJump::CurrentGroup@", Strike "@$HellJump::CurrentStrike@"."); + HellScore.writeline("Team Score: "@$HellJump::Score["Team"]@"."); + for(%i = 0; %i < ClientGroup.getCount(); %i ++) { + %client = ClientGroup.getObject(%i); + HellScore.writeline(""@%client.namebase@"'s Score: "@$HellJump::Score[%client]@"."); + } + HellScore.close(); + HellScore.delete(); + } + else { + new fileobject(HellScore); + HellScore.openforappend("Server/Helljump/Scores/"@formattimestring("hh-nn-a-mm-dd-yy")@".txt"); + HellScore.writeline("Scores for this round."); + HellScore.writeline("Wave "@$HellJump::CurrentWave@", Group "@$HellJump::CurrentGroup@", Strike "@$HellJump::CurrentStrike@"."); + HellScore.writeline("Team Score: "@$HellJump::Score["Team"]@"."); + for(%i = 0; %i < ClientGroup.getCount(); %i ++) { + %client = ClientGroup.getObject(%i); + HellScore.writeline(""@%client.namebase@"'s Score: "@$HellJump::Score[%client]@"."); + } + HellScore.close(); + HellScore.delete(); + } +} + +function HelljumpGame::gameOver(%game) { + %game.AllowAllRespawn(); + %game.SaveScores(); + DefaultGame::gameOver(%game); + + messageAll('MsgGameOver', "Game Over: Wave "@$HellJump::CurrentWave@", Group "@$HellJump::CurrentGroup@", Strike "@$HellJump::CurrentStrike@". Final Score: "@$HellJump::Score["Team"]@".~wvoice/announcer/ann.gameover.wav" ); + messageAll('MsgClearObjHud', ""); + + //Reset the Vars + $TWM::PlayingHellJump = 0; + + $HellJump::CurrentStrike = 1; + $HellJump::CurrentGroup = 1; + $HellJump::CurrentWave = 1; + + $HellJump::Score["Team"] = 0; + + $HellJump::Zombiecount = 0; + $HellJump::LivingCount = 0; + + $Host::RankSystem = 1; + + %group = NameToID("HellJumpGroup"); + if(%group != -1) { + %group.delete(); + } + + for(%i = 0; %i < ClientGroup.getCount(); %i ++) { + %client = ClientGroup.getObject(%i); + $HellJump::Score[%client] = 0; + } + + %game.toggleModifiers("All Off", 1); +} + +function HelljumpGame::UpdateClientScoreBar(%game, %client) { + %alv = $HellJump::LivingCount; + for(%i = 0; %i < ClientGroup.getcount(); %i++) { + %cl = ClientGroup.getObject(%i); + messageClient(%cl, 'MsgSPCurrentObjective2', "", "[Players: "@$HellJump::LivingCount@"][SCORE: Team: "@$HellJump::Score["Team"]@" You: "@$HellJump::Score[%cl]@"]"); + } +} + + + + + + + + + + + + + +//TRANSPORT CODE + + +//This function may be kinda old-style logic wise, but the game should calculate fast enough, that it won't +//really matter if two people spawn at about the same time, and even if we end up with two transports... hey! +//we just saved having to spawn another! +function HelljumpGame::checkTrans(%game, %client) { + %group = NameToID("HellJumpGroup"); + if(%group == -1) { + %game.HellGroup = new SimGroup(HellJumpGroup); //used for hell jump + %group = %game.HellGroup; + } + if(!isObject(%group.getObject(0))) { //no transports yet, so lets spawn #1! + %trans = %game.SpawnTransport(""@getWords(%client.player.getPosition(), 0, 1)@" "@getRandom(1500,2500)@""); //set the height + //add the guy to it. + %client.player.getDataBlock().onCollision(%client.player, %trans, 2); + %client.player.setMoveState(true); //ha! no running now + //Added 2.0 - PEople who jump early will be re-added to the slot + %client.player.saveSlot = 2; + SafeSpotLoop(%client, %obj, 2); + %client.jumpDownYet = 0; + // + %game.GiveGuns(%client.player); + return; + } + for(%i = 0; %i < %group.getCount(); %i++) { + %obj = %group.getObject(%i); + //check the current seats + for(%i = 2; %i < 6; %i++){ + if(!isObject(%obj.getMountNodeObject(%i))){ + //open seat... MINE! + %client.player.getDataBlock().onCollision(%client.player, %obj, %i); + //Added 2.0 - PEople who jump early will be re-added to the slot + %client.player.saveSlot = %i; + SafeSpotLoop(%client, %obj, %i); + %client.jumpDownYet = 0; + // + %client.player.setMoveState(true); //ha! no running now + %game.GiveGuns(%client.player); + return; + } + else { + if(%i == 5) { + %obj.allSeatsTaken = 1; + } + } + } + //drats! all seats are gone on that one! + if(%obj.allSeatsTaken) { + %i++; + //we will now check for another transport + if(!isObject(%group.getObject(%i))) { + //this one does not exist, so we will need a new one! + %trans = %game.SpawnTransport(""@getWords(%client.player.getPosition(), 0, 1)@" "@getRandom(1500,2500)@""); //set the height + //now, we add the player to the first slot on this one + %client.player.getDataBlock().onCollision(%client.player, %trans, 2); + %client.player.setMoveState(true); //ha! no running now + //Added 2.0 - PEople who jump early will be re-added to the slot + %client.player.saveSlot = 2; + SafeSpotLoop(%client, %obj, 2); + %client.jumpDownYet = 0; + // + %game.GiveGuns(%client.player); + } + else { + %i--; //the ++ will hit. + //lets hold for the next loop + } + } + } +} + +function HelljumpGame::SpawnTransport(%game, %pos) { + %phantom = new FlyingVehicle() { + datablock = "HAPCFlyer"; + team = 1; + position = %pos; + Invincible = true; + }; + %phantom.DroppedYet = 0; + HellJumpGroup.add(%phantom); + //15 seconds ends the re-spawn period. + %goto = $HellJump::DropPos[$CurrentMission]; + %xy = getWords(%goto, 0, 1); + %z = getWord(%pos, 2); + %fina = ""@%xy@" "@%z@""; + %game.schedule(15000, "MoveTransport", %phantom, %fina, 0); + return %phantom; +} + +function HelljumpGame::SpawnAmmoTransport(%game, %pos, %targ) { + %phantom = new FlyingVehicle() { + datablock = "HAPCFlyer"; + team = 1; + position = %pos; + }; + %phantom.DroppedYet = 0; + %phantom.Invincible = true; + MissionCleanup.add(%phantom); + //ammo transports go right away + if(%targ $= "") { + %goto = $HellJump::DropPos[$CurrentMission]; + %xy = getWords(%goto, 0, 1); + %z = getWord(%pos, 2); + %targ = ""@%xy@" "@%z@""; + } + else { + %xy = getWords(%targ, 0, 1); + %z = getWord(%pos, 2); + %targ = ""@%xy@" "@%z@""; + } + %game.schedule(50, "MoveTransport", %phantom, %targ, 1); + return %phantom; +} + +function HellJumpGame::getTransFacingDirection(%game, %trans, %targPos) { + if(!isObject(%trans)) { + return; + } + %pos = %trans.getworldboxcenter(); + %vector = vectorNormalize(vectorSub(%targPos, %pos)); + %v1 = getword(%vector, 0); + %v2 = getword(%vector, 1); + %v3 = getword(%vector, 2); + %nv1 = %v2; + %nv2 = (%v1 * -1); + %vector2 = %nv1@" "@%nv2@" "@%v3; + %trans.setRotation(fullrot("0 0 0",%vector2)); + + return %vector; +} + +function HelljumpGame::MoveTransport(%game, %transport, %goto, %ammo) { + if(!isObject(%transport)) { + return; + } + %game.schedule(200, "MoveTransport", %transport, %goto, %ammo); + //not there yet + if(!%ammo) { + if(vectorDist(%transport.getPosition(), %goto) > 700) { + if(vectorLen(%transport.getVelocity()) < 500) { + %transport.applyImpulse(%transport.getPosition(),vectorScale(%transport.getForwardVector(), 1000 * 1.3)); + %game.getTransFacingDirection(%transport, %goto); + } + } + else { + %transport.applyImpulse(%transport.getPosition(),vectorScale(%transport.getForwardVector(), 700)); + if(!%transport.DroppedYet) { + %transport.DroppedYet = 1; + %transport.schedule(12500, "SetCloaked", true); + %transport.schedule(15000, "Delete"); + + %frd = %transport.getForwardVector(); + %right = vectorNormalize(vectorSub(%transport.getEdge("1 0 0"),%transport.getEdge("-1 0 0"))); + for(%i = 2; %i < 6; %i++){ + if(%transport.getMountNodeObject(%i)){ + %plyr = %transport.getMountNodeObject(%i); + %plyr.setMoveState(true); //ha! no running now + %pod = schedule((2000 * %i), 0, "MakeDropPod", %frd, %right, %plyr, %transport, %i); + BottomPrint(%plyr.client, "Helljumpers!!! Prepare for drop!", 3, 1); + } + } + } + } + } + else { + if(vectorDist(%transport.getPosition(), %goto) > 400) { + if(vectorLen(%transport.getVelocity()) < 500) { + %transport.applyImpulse(%transport.getPosition(),vectorScale(%transport.getForwardVector(), 1000 * 1.3)); + %game.getTransFacingDirection(%transport, %goto); + } + } + else { + %transport.applyImpulse(%transport.getPosition(),vectorScale(%transport.getForwardVector(), 700)); + if(!%transport.DroppedYet) { + %transport.DroppedYet = 1; + %transport.schedule(12500, "SetCloaked", true); + %transport.schedule(15000, "Delete"); + + %frd = %transport.getForwardVector(); + %right = vectorNormalize(vectorSub(%transport.getEdge("1 0 0"),%transport.getEdge("-1 0 0"))); + for(%i = 2; %i < 6; %i++){ + %pod = schedule((2000 * %i), 0, "MakeAmmoPod", %frd, %right, %transport, %i); + } + } + } + } +} + +function SafeSpotLoop(%client, %obj, %slot) { + if(!isObject(%obj)) { + return; + } + if(!isObject(%client.player) || %client.player.getState() $= "Dead") { + return; + } + if(%client.jumpDownYet) { + return; //we have been dropped! + } + //the goodies + if(%obj.getMountNodeObject(%slot) != %client.player) { + %client.player.getDataBlock().onCollision(%client.player, %obj, %slot); + messageClient(%client, 'msgAlert', "\c3Helljump: Do not jump out of the transport! you will be dropped automatically! ~wfx/misc/warning_beep.wav"); + } + schedule(150, 0, "SafeSpotLoop", %client, %obj, %slot); +} + + + + + + + + + + + + + + + + + +//Scoring System +//Defines: + +//Bonus Strike Multiplier: 3X +//Demonic Multiplier: 1.5X +//Where's My Head Multiplier: 2X + +//Normal Zombie: 1Pt +//Ravenger Zombie: 3Pt +//Zombie Lord: 10Pt +//Demon Zombie: 5Pt +//Air Rapier Zombie: 7Pt +//Demon Lord Zombie: 40Pt +//Shifter Zombie: 7Pt +//Sniper Zombie: 15Pt +//Volatile Ravenger: 10Pt +//Ultra Demon Zombie: 20Pt + +function HelljumpGame::CheckScoreModifiers(%game) { + %mod = 1; + if(%game.CheckModifier("Titan") == 1) { + %mod *= 3; + } + if(%game.CheckModifier("Demonic") == 1) { + %mod *= 1.5; + } + if(%game.CheckModifier("WheresMyHead") == 1) { + %mod *= 2; + } + return %mod; +} + +//Simple award system, works well! +function HelljumpGame::AwardGamePoints(%game, %client, %points) { + //first Thing first, get the modifiers + %mod = %game.CheckScoreModifiers(); + //Lets set two score sets + $HellJump::Score[%client] += (%points * %mod); + $HellJump::Score["Team"] += (%points * %mod); + if($HellJump::Score[%client] >= 1000) { + awardClient(%client, 17); + CompleteNWChallenge(%client, "OneK"); + } + if($HellJump::Score[%client] >= 5000) { + CompleteNWChallenge(%client, "FiveK"); + } + if($HellJump::Score[%client] >= 10000) { + CompleteNWChallenge(%client, "TenK"); + } + // + if($HellJump::Score["Team"] >= 7500) { + CompleteNW_allPlayers("PointsSurge"); + } + if($HellJump::Score["Team"] >= 25000) { + CompleteNW_allPlayers("PointsJackpot"); + } +} + +function HelljumpGame::OnZombieDeath(%game, %killer, %victim) { + %ZT = %victim.type; + switch(%ZT) { + case 1: + %game.AwardGamePoints(%killer, 1); + case 2: + %game.AwardGamePoints(%killer, 5); + case 3: + %game.AwardGamePoints(%killer, 10); + case 4: + %game.AwardGamePoints(%killer, 5); + case 12: + %game.AwardGamePoints(%killer, 10); + case 13: + %game.AwardGamePoints(%killer, 10); + case 14: + %game.AwardGamePoints(%killer, 20); + case 15: + %game.AwardGamePoints(%killer, 75); + CompleteNWChallenge(%killer, "DownBoy"); + } + // + %game.UpdateClientScoreBar(%killer); + //%game.CheckNextStrike(); +} + +//NEW BEACONS +//AMMO DROP +datablock ItemData(AmmoDropCaller) +{ + className = Weapon; + catagory = "Spawn Items"; + shapeFile = "weapon_targeting.dts"; + image = AmmoDropCallerImage; + mass = 1; + elasticity = 0.2; + friction = 0.6; + pickupRadius = 2; + pickUpName = "a targeting laser rifle"; + + computeCRC = true; + +}; + +datablock ShapeBaseImageData(AmmoDropCallerImage) +{ + className = WeaponImage; + + shapeFile = "stackable3s.dts"; + item = AmmoDropCaller; + offset = "0 0 0"; + + projectile = BasicTargeter; + projectileType = TargetProjectile; + deleteLastProjectile = true; + + usesEnergy = true; + minEnergy = 3; + + stateName[0] = "Activate"; + stateSequence[0] = "Activate"; + stateSound[0] = TargetingLaserSwitchSound; + stateTimeoutValue[0] = 0.5; + stateTransitionOnTimeout[0] = "ActivateReady"; + + stateName[1] = "ActivateReady"; + stateTransitionOnAmmo[1] = "Ready"; + stateTransitionOnNoAmmo[1] = "NoAmmo"; + + stateName[2] = "Ready"; + stateTransitionOnNoAmmo[2] = "NoAmmo"; + stateTransitionOnTriggerDown[2] = "Fire"; + + stateName[3] = "Fire"; + stateEnergyDrain[3] = 3; + stateFire[3] = true; + stateAllowImageChange[3] = false; + stateScript[3] = "onFire"; + stateTransitionOnTriggerUp[3] = "Deconstruction"; + stateTransitionOnNoAmmo[3] = "Deconstruction"; + stateSound[3] = TargetingLaserPaintSound; + + stateName[4] = "NoAmmo"; + stateTransitionOnAmmo[4] = "Ready"; + + stateName[5] = "Deconstruction"; + stateScript[5] = "deconstruct"; + stateTransitionOnTimeout[5] = "Ready"; +}; + +function AmmoDropCallerImage::OnFire(%data, %obj, %slot) { + %obj.client.HasAmmoDrop = 0; + GainExperience(%obj.client, 500, "Ammo Drop Called In "); + + %obj.throwWeapon(1); + %obj.throwWeapon(0); + %obj.setInventory(AmmoDropCaller, 0, true); + Game.SpawnAmmoTransport(VectorAdd("0 0 1500",$HellJump::SpawnGraph[$CurrentMission]), %obj.getPosition()); +} + +function AmmoDropCallerImage::onMount(%this,%obj,%slot) { + Parent::onMount(%this, %obj, %slot); + bottomPrint(%obj.client, ">>>Killstreak Beacon<<<\nAmmo Drop.",2,2); +} + +//Full Team Respawn +datablock ItemData(FullTeamRespawnCaller) +{ + className = Weapon; + catagory = "Spawn Items"; + shapeFile = "weapon_targeting.dts"; + image = FullTeamRespawnCallerImage; + mass = 1; + elasticity = 0.2; + friction = 0.6; + pickupRadius = 2; + pickUpName = "a targeting laser rifle"; + + computeCRC = true; + +}; + +datablock ShapeBaseImageData(FullTeamRespawnCallerImage) +{ + className = WeaponImage; + + shapeFile = "stackable3s.dts"; + item = FullTeamRespawnCaller; + offset = "0 0 0"; + + projectile = BasicTargeter; + projectileType = TargetProjectile; + deleteLastProjectile = true; + + usesEnergy = true; + minEnergy = 3; + + stateName[0] = "Activate"; + stateSequence[0] = "Activate"; + stateSound[0] = TargetingLaserSwitchSound; + stateTimeoutValue[0] = 0.5; + stateTransitionOnTimeout[0] = "ActivateReady"; + + stateName[1] = "ActivateReady"; + stateTransitionOnAmmo[1] = "Ready"; + stateTransitionOnNoAmmo[1] = "NoAmmo"; + + stateName[2] = "Ready"; + stateTransitionOnNoAmmo[2] = "NoAmmo"; + stateTransitionOnTriggerDown[2] = "Fire"; + + stateName[3] = "Fire"; + stateEnergyDrain[3] = 3; + stateFire[3] = true; + stateAllowImageChange[3] = false; + stateScript[3] = "onFire"; + stateTransitionOnTriggerUp[3] = "Deconstruction"; + stateTransitionOnNoAmmo[3] = "Deconstruction"; + stateSound[3] = TargetingLaserPaintSound; + + stateName[4] = "NoAmmo"; + stateTransitionOnAmmo[4] = "Ready"; + + stateName[5] = "Deconstruction"; + stateScript[5] = "deconstruct"; + stateTransitionOnTimeout[5] = "Ready"; +}; + +function FullTeamRespawnCallerImage::OnFire(%data, %obj, %slot) { + %obj.client.HasFullTeamRespawn = 0; + GainExperience(%obj.client, 1500, "Full Team Respawn Activated "); + + MessageAll('MsgRespawn', "\c5"@%obj.client.namebase@" has activated a full team respawn beacon, you may now respawn."); + + %obj.throwWeapon(1); + %obj.throwWeapon(0); + %obj.setInventory(FullTeamRespawnCaller, 0, true); + Game.AllowAllRespawn(); //yeah, we can just use this :) + + CompleteNWChallenge(%obj.client, "LifeGiver"); +} + +function FullTeamRespawnCallerImage::onMount(%this,%obj,%slot) { + Parent::onMount(%this, %obj, %slot); + bottomPrint(%obj.client, ">>>Killstreak Beacon<<<\nFull Team Respawn.",2,2); +} + + + + + + + + + + + + + + + + + + +//SPAWN SYSTEM +//Waves are the largest, and thus are called at short intervals. +function HelljumpGame::SpawnZombies(%game, %pos, %type) { + if(!isObject(%game) || !$TWM::PlayingHellJump) { + error("UE BLOCKED"); + return; + } + %c = CreateEmitter(%pos, NightmareGlobeEmitter, "0 0 1"); + %c.schedule(1000, "delete"); + schedule(500, 0, "StartAZombie", %pos, %type); +} + +function HelljumpGame::StartWave(%game, %wave) { + //lets start the group. + //Group start at 1! + $HellJump::CurrentWave = %wave; + %game.schedule(15000, "StartGroup", 1); + messageAll('MsgSPCurrentObjective1' ,"", "[W"@$HellJump::CurrentWave@"|G"@$HellJump::CurrentGroup@"|S"@$HellJump::CurrentStrike@"] | Zombies Left: "@$HellJump::Zombiecount@""); + if(%wave >= 2) { + CompleteNW_allPlayers("WaveDefeater"); + } +} + +function HelljumpGame::StartGroup(%game, %group) { + //activate the modifiers for these: + //Allow Respawn: + // + if($HellJump::CurrentWave == 1) { + if(%group >= 2) { + CompleteNW_allPlayers("GroupBuster"); + } + } + else { + CompleteNW_allPlayers("GroupBuster"); + } + %game.schedule(20000, "SpawnAmmoTransport", VectorAdd("0 0 1500",$HellJump::SpawnGraph[$CurrentMission])); + %game.AllowAllRespawn(); + $HellJump::CurrentGroup = %group; + switch($HellJump::CurrentWave) { + case 1: + if(%group == 3) { + %game.ToggleModifiers("Super-Lunge", 1); + } + case 2: + if(%group == 1) { + %game.ToggleModifiers("Super-Lunge", 1); + } + if(%group == 2) { + %game.ToggleModifiers("It BURNS!", 1); + } + if(%group == 4) { + %game.ToggleModifiers("Oh Lordy", 1); + } + if(%group == 5) { + %game.ToggleModifiers("The Destiny", 1); + } + case 3: + if(%group == 1) { + %game.ToggleModifiers("Super-Lunge", 1); + %game.ToggleModifiers("It BURNS!", 1); + %game.ToggleModifiers("Oh Lordy", 1); + %game.ToggleModifiers("The Destiny", 1); + } + if(%group == 4) { + %game.ToggleModifiers("Kamakaziiiii", 1); + } + case 4: + if(%group == 1) { + %game.ToggleModifiers("Super-Lunge", 1); + %game.ToggleModifiers("It BURNS!", 1); + %game.ToggleModifiers("Oh Lordy", 1); + %game.ToggleModifiers("The Destiny", 1); + %game.ToggleModifiers("Kamakaziiiii", 1); + } + if(%group == 2) { + %game.ToggleModifiers("Demonic", 1); + } + if(%group == 3) { + %game.ToggleModifiers("Where's My Head", 1); + } + case 5: + if(%group == 1) { + %game.ToggleModifiers("Super-Lunge", 1); + %game.ToggleModifiers("It BURNS!", 1); + %game.ToggleModifiers("Oh Lordy", 1); + %game.ToggleModifiers("The Destiny", 1); + %game.ToggleModifiers("Kamakaziiiii", 1); + %game.ToggleModifiers("Demonic", 1); + %game.ToggleModifiers("Where's My Head", 1); + %game.ToggleModifiers("Scrambler", 1); + } + if(%group == 5) { + %game.ToggleModifiers("You can't see me", 1); + } + default: + %game.ToggleModifiers("Super-Lunge", 1); + %game.ToggleModifiers("It BURNS!", 1); + %game.ToggleModifiers("Oh Lordy", 1); + %game.ToggleModifiers("The Destiny", 1); + %game.ToggleModifiers("Kamakaziiiii", 1); + %game.ToggleModifiers("Demonic", 1); + %game.ToggleModifiers("Where's My Head", 1); + %game.ToggleModifiers("Scrambler", 1); + %game.ToggleModifiers("You can't see me", 1); + } + //bonus strike + if(%group == 6) { //6th group, AKA, bonus strike + %game.schedule(15000, "StartBonusStrike"); + BottomPrintAll("Wave Complete \n Keep Up The Good Work!", 2, 2); + } //bonus complete + else if(%group == 7) { + %game.schedule(30000, "StartWave", $HellJump::CurrentWave + 1); + } + //in 15 seconds, start the strike + else { + %game.schedule(15000, "StartStrike", 1); + } + messageAll('MsgSPCurrentObjective1' ,"", "[W"@$HellJump::CurrentWave@"|G"@$HellJump::CurrentGroup@"|S"@$HellJump::CurrentStrike@"] | Zombies Left: "@$HellJump::Zombiecount@""); +} + +function HelljumpGame::GoNextStrike(%game) { + $HellJump::CurrentStrike++; + CenterPrintAll("Enemy Reinforcements", 2, 2); + %game.schedule(15000, "StartStrike", $HellJump::CurrentStrike); + if(!$HellJump::BonusStrike) { + if($HellJump::CurrentStrike == 6) { //bonus strike is considered a special group + $HellJump::CurrentStrike = 1; + %game.StartGroup($HellJump::CurrentGroup + 1); + BottomPrintAll("Group Complete \n Keep Up The Good Work!", 2, 2); + } + } + else { + $HellJump::CurrentStrike = 1; + $HellJump::BonusStrike = 0; + %game.ToggleModifiers("All Off", 1); + %game.StartGroup($HellJump::CurrentGroup + 1); + BottomPrintAll("Bonus Strike Over \n Dead Silence, Prepare for the next Wave!", 2, 2); + } +} + +function HelljumpGame::DefineProperSpawnPos(%game, %loc) { + %zCheck = GetTerrainHeight(%loc); + %zProper = %zCheck + 10; + %p1 = getRandomPosition(40, 1); + %p2 = vectorAdd(%loc, %p1); + %zCheck2 = GetTerrainHeight(%p2); + %zProperf = %zCheck2 + 10; + %p3 = ""@getWords(%p2,0,1)@" "@%zProperf@""; + echo(%p3); + return %p3; +} + +function HelljumpGame::StartBonusStrike(%game) { + $HellJump::BonusStrike = 1; + BottomPrintAll("Bonus Strike \n Good Luck...", 2, 2); + %game.schedule(2500, "ToggleModifiers", "All On", 1); + //lets spawn us som zombahs + $HellJump::Zombiecount = 40; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = getRandom(13,13); + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + messageAll('MsgSPCurrentObjective1' ,"", "BONUS WAVE"); +} + +function HelljumpGame::StartStrike(%game, %strike) { + //set the current strike + $HellJump::CurrentStrike = %strike; + //holy :P + %wv = $HellJump::CurrentWave; + %gr = $HellJump::CurrentGroup; + switch(%wv) { + case 1: + switch(%gr) { + case 1: + switch(%strike) { + case 1: + $HellJump::Zombiecount = 20; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = getRandom(1,1); + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 2: + $HellJump::Zombiecount = 25; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = getRandom(1,1); + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 3: + $HellJump::Zombiecount = 30; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = getRandom(1,1); + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 4: + $HellJump::Zombiecount = 35; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = getRandom(1,2); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 5: + $HellJump::Zombiecount = 40; + for(%i = 0; %i < $HellJump::Zombiecount - 1; %i++) { //spawn 39 zombs, 1 dlors + %time = 1000 * getRandom(1, 60); + %type = getRandom(1,2); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + %game.schedule(1000, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), 15); + } + case 2: + switch(%strike) { + case 1: + $HellJump::Zombiecount = 20; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = getRandom(1,2); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 2: + $HellJump::Zombiecount = 25; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = getRandom(1,3); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 3: + $HellJump::Zombiecount = 30; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = getRandom(1,3); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 4: + $HellJump::Zombiecount = 35; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = getRandom(1,3); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 5: + $HellJump::Zombiecount = 40; + for(%i = 0; %i < $HellJump::Zombiecount - 1; %i++) { //spawn 39 zombs, 1 dlors + %time = 1000 * getRandom(1, 60); + %type = getRandom(1,3); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + %game.schedule(1000, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), 15); + } + case 3: + switch(%strike) { + case 1: + $HellJump::Zombiecount = 20; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = getRandom(1,3); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 2: + $HellJump::Zombiecount = 25; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = getRandom(1,4); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 3: + $HellJump::Zombiecount = 30; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = getRandom(1,4); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 4: + $HellJump::Zombiecount = 35; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 4); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 5: + $HellJump::Zombiecount = 40; + for(%i = 0; %i < $HellJump::Zombiecount - 1; %i++) { //spawn 39 zombs, 1 dlors + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 4); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + %game.schedule(1000, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), 15); + } + case 4: + switch(%strike) { + case 1: + $HellJump::Zombiecount = 20; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 4); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 2: + $HellJump::Zombiecount = 25; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 4); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 3: + $HellJump::Zombiecount = 30; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 4); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 4: + $HellJump::Zombiecount = 35; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 4); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 5: + $HellJump::Zombiecount = 40; + for(%i = 0; %i < $HellJump::Zombiecount - 1; %i++) { //spawn 39 zombs, 1 dlors + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 4); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(1000, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), 15); + } + case 5: + switch(%strike) { + case 1: + $HellJump::Zombiecount = 20; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 4); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 2: + $HellJump::Zombiecount = 25; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 4); + if(%type == 2) + %type = 13; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 3: + $HellJump::Zombiecount = 30; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 5); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 4: + $HellJump::Zombiecount = 35; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 5); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 5: + $HellJump::Zombiecount = 40; + for(%i = 0; %i < $HellJump::Zombiecount - 1; %i++) { //spawn 39 zombs, 1 dlors + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 5); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(1000, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), 15); + } + } + //once we hit 2, it's the same + case 2: + switch(%gr) { + case 1: + switch(%strike) { + case 1: + $HellJump::Zombiecount = 20; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 5); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 2: + $HellJump::Zombiecount = 25; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 5); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 3: + $HellJump::Zombiecount = 30; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 5); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 4: + $HellJump::Zombiecount = 35; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 6); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 5: + $HellJump::Zombiecount = 40; + for(%i = 0; %i < $HellJump::Zombiecount - 1; %i++) { //spawn 39 zombs, 1 dlors + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 6); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(1000, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), 15); + } + case 2: + switch(%strike) { + case 1: + $HellJump::Zombiecount = 20; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 6); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 2: + $HellJump::Zombiecount = 25; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 6); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 3: + $HellJump::Zombiecount = 30; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 6); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 4: + $HellJump::Zombiecount = 35; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 6); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 5: + $HellJump::Zombiecount = 40; + for(%i = 0; %i < $HellJump::Zombiecount - 1; %i++) { //spawn 39 zombs, 1 dlors + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 6); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(1000, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), 15); + } + case 3: + switch(%strike) { + case 1: + $HellJump::Zombiecount = 20; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 6); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 2: + $HellJump::Zombiecount = 25; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 6); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 3: + $HellJump::Zombiecount = 30; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 6); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 4: + $HellJump::Zombiecount = 35; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 6); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 5: + $HellJump::Zombiecount = 40; + for(%i = 0; %i < $HellJump::Zombiecount - 1; %i++) { //spawn 39 zombs, 1 dlors + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(1000, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), 15); + } + case 4: + switch(%strike) { + case 1: + $HellJump::Zombiecount = 20; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 2: + $HellJump::Zombiecount = 25; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 3: + $HellJump::Zombiecount = 30; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 4: + $HellJump::Zombiecount = 35; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 5: + $HellJump::Zombiecount = 40; + for(%i = 0; %i < $HellJump::Zombiecount - 1; %i++) { //spawn 39 zombs, 1 dlors + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(1000, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), 15); + } + case 5: + switch(%strike) { + case 1: + $HellJump::Zombiecount = 20; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 2: + $HellJump::Zombiecount = 25; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 3: + $HellJump::Zombiecount = 30; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 4: + $HellJump::Zombiecount = 35; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 5: + $HellJump::Zombiecount = 40; + for(%i = 0; %i < $HellJump::Zombiecount - 1; %i++) { //spawn 39 zombs, 1 dlors + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(1000, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), 15); + } + } + default: + switch(%gr) { + case 1: + switch(%strike) { + case 1: + $HellJump::Zombiecount = 20; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 2: + $HellJump::Zombiecount = 25; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 3: + $HellJump::Zombiecount = 30; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 4: + $HellJump::Zombiecount = 35; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 5: + $HellJump::Zombiecount = 40; + for(%i = 0; %i < $HellJump::Zombiecount - 1; %i++) { //spawn 39 zombs, 1 dlors + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(1000, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), 15); + } + case 2: + switch(%strike) { + case 1: + $HellJump::Zombiecount = 20; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 2: + $HellJump::Zombiecount = 25; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 3: + $HellJump::Zombiecount = 30; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 4: + $HellJump::Zombiecount = 35; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 5: + $HellJump::Zombiecount = 40; + for(%i = 0; %i < $HellJump::Zombiecount - 1; %i++) { //spawn 39 zombs, 1 dlors + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(1000, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), 15); + } + case 3: + switch(%strike) { + case 1: + $HellJump::Zombiecount = 20; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 2: + $HellJump::Zombiecount = 25; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 3: + $HellJump::Zombiecount = 30; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 4: + $HellJump::Zombiecount = 35; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 5: + $HellJump::Zombiecount = 40; + for(%i = 0; %i < $HellJump::Zombiecount - 1; %i++) { //spawn 39 zombs, 1 dlors + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(1000, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), 15); + } + case 4: + switch(%strike) { + case 1: + $HellJump::Zombiecount = 20; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 2: + $HellJump::Zombiecount = 25; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 3: + $HellJump::Zombiecount = 30; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 4: + $HellJump::Zombiecount = 35; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 5: + $HellJump::Zombiecount = 40; + for(%i = 0; %i < $HellJump::Zombiecount - 1; %i++) { //spawn 39 zombs, 1 dlors + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(1000, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), 15); + } + case 5: + switch(%strike) { + case 1: + $HellJump::Zombiecount = 20; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 2: + $HellJump::Zombiecount = 25; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 3: + $HellJump::Zombiecount = 30; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 4: + $HellJump::Zombiecount = 35; + for(%i = 0; %i < $HellJump::Zombiecount; %i++) { + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + case 5: + $HellJump::Zombiecount = 40; + for(%i = 0; %i < $HellJump::Zombiecount - 1; %i++) { //spawn 39 zombs, 1 dlors + %time = 1000 * getRandom(1, 60); + %type = GetRandom(1, 7); + if(%type == 2) + %type = 13; + if(%type == 5) + %type = 2; + if(%type == 6) + %type = 12; + if(%type == 7) + %type = 14; + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(%time, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), %type); + } + %zone = getRandom(1, $HellJump::ZSpawnZoneCt[$CurrentMission]); + %game.schedule(1000, SpawnZombies, %game.DefineProperSpawnPos($HellJump::ZSpawnZone[$CurrentMission, %zone]), 15); + } + } + } + messageAll('MsgSPCurrentObjective1' ,"", "[W"@$HellJump::CurrentWave@"|G"@$HellJump::CurrentGroup@"|S"@$HellJump::CurrentStrike@"] | Zombies Left: "@$HellJump::Zombiecount@""); +} + +//Score menu +function HelljumpGame::updateScoreHud(%game, %client, %tag){ + if (%client.SCMPage $= "") + %client.SCMPage = 1; + if (%client.SCMPage $= "SM") + return; + $TagToUseForScoreMenu = %tag; + messageClient( %client, 'ClearHud', "", %tag, 0 ); + messageClient( %client, 'SetScoreHudHeader', "", "" ); + messageClient( %client, 'SetScoreHudHeader', "", "E.V.A.Close" ); + messageClient( %client, 'SetScoreHudSubheader', "", "Hell-Jump Command Hud" ); + //scoreCmdMainMenu(%game,%client,%tag,%client.SCMPage); + if(%client.hasMedal(17)) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Hell-Class Selection"); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, "Settings/Perks"); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Weapon Challenges/Upgrades'); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, "Exit"); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "-*-*-Module Locked-*-*-"); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, "Settings/Perks"); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Weapon Challenges/Upgrades'); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, "Exit"); + %index++; + } +} + +function HelljumpGame::processGameLink(%game, %client, %arg1, %arg2, %arg3, %arg4, %arg5){ + %tag = $TagToUseForScoreMenu; + messageClient( %client, 'ClearHud', "", %tag, 1 ); + //Stuff + if(%arg1 $= "") + %arg1 = "Null"; + if(%arg2 $= "") + %arg2 = "Null"; + if(%arg3 $= "") + %arg3 = "Null"; + if(%arg4 $= "") + %arg4 = "Null"; + if(%arg5 $= "") + %arg5 = "Null"; + //end + echo("[F2] "@%client.namebase@": "@%arg1@", "@%arg2@", "@%arg3@", "@%arg4@", "@%arg5@"."); + switch$ (%arg1) { + + case "GTP": + %game.updateScoreHud(%client, %tag); + return; + + case "PersControl": + %client.SCMPage = "SM"; + messageClient( %client, 'SetScoreHudSubheader', "", "Personal Settings" ); + messageClient( %client, 'SetLineHud', "", %tag, %index, "Select An Option"); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Killstreak Superweapons - Special Streaks For Helljump'); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Perks'); + %index++; + //messageClient( %client, 'SetLineHud', "", %tag, %index, 'Weapon Challenges'); + //%index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Save Settings'); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Back to main menu'); + %index++; + messageClient( %client, 'ClearHud', "", %tag, %index ); + return; + + case "UpdateSettings": + UpdateSettings(%client); + MessageClient(%client, 'msgSaved', "\c5Settings Saved"); + %game.processGameLink(%client, "NAC"); + return; + + case "ChooseClass": + %client.SCMPage = "SM"; + messageClient( %client, 'SetScoreHudHeader', "", "Close EVA" ); + messageClient( %client, 'SetScoreHudSubheader', "", "Hell-Class Selection" ); + $HellJump::HellClass[%client] = %arg2; + CompleteNWChallenge(%client, "ClassExtravaganza"); + messageClient( %client, 'SetLineHud', "", "New Class: "@$HellJump::HellClass[%client]@"" ); + %index++; + messageClient( %client, 'SetLineHud', "", "New Class Weapons: "@$HellClass::Info[$HellJump::HellClass[%client]]@"" ); + %index++; + messageClient( %client, 'SetLineHud', "", "" ); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Exit'); + %index++; + // + if(!%client.jumpDownYet) { + %game.GiveGuns(%client.player); + } + return; + + case "HellClass": + %client.SCMPage = "SM"; + messageClient( %client, 'SetScoreHudHeader', "", "Close EVA" ); + messageClient( %client, 'SetScoreHudSubheader', "", "Hell-Class Selection" ); + messageClient( %client, 'SetLineHud', "", %tag, %index, "Current Class: "@$HellJump::HellClass[%client]@" - "@$HellClass::Info[$HellJump::HellClass[%client]]@""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, "NOTE: All changes will apply on your next re-spawn"); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, "Please Choose a Hell-Class:"); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, "HellJumper - "@$HellClass::Info["HellJumper"]@""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, "Light Sniper - "@$HellClass::Info["Light Sniper"]@""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, "Explosives - "@$HellClass::Info["Explosives"]@""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, "RSA Commando - "@$HellClass::Info["RSA"]@""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + if(%client.hasMedal(9)) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Stormlord - "@$HellClass::Info["Stormlord"]@""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "*Locked* Requires The Thunda-Struck Medal"); + %index++; + } + if(%client.hasMedal(1)) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Close Combat - "@$HellClass::Info["Close Combat"]@""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "*Locked* Requires The He Fell Again Medal"); + %index++; + } + if(%client.hasMedal(13)) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Shadow Guard - "@$HellClass::Info["Shadow Guard"]@""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "*Locked* Requires The Source Of All Evil Medal"); + %index++; + } + if(%client.hasMedal(20)) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Collider Fanatic - "@$HellClass::Info["Collider Fanatic"]@""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "*Locked* Requires The Hazing Medal"); + %index++; + } + if(%client.hasMedal(21)) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Flamer - "@$HellClass::Info["Flamer"]@""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "*Locked* Requires The Glorious Fire Medal"); + %index++; + } + if(%client.CheckNWChallengeCompletion("NewYearsEve")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Javelin - "@$HellClass::Info["Javelin"]@""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "*Locked* Requires The New Years Eve Fireworks Challenge"); + %index++; + } + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Exit'); + %index++; + return; + + //other + case "ActivateUpgrade": + %image = %arg2; + %upgrade = %arg3; + %client.DisableAllUpgrades(%image); //disable all first + %client.ActivateUpgrade(%image, %upgrade); + %game.processGameLink(%client, "CompletedSub"); + return; + + case "DeActivateUpgrades": + %image = %arg2; + %client.DisableAllUpgrades(%image); //disable all + %game.processGameLink(%client, "CompletedSub"); + return; + + case "CompletedSub": + %image = %arg2; + %client.SCMPage = "SM"; + messageClient( %client, 'SetScoreHudSubheader', "", "Completed Challenges" ); + messageClient( %client, 'SetLineHud', "", %tag, %index, "Select A Upgrade To Use"); + %index++; + %index = GenerateCompletedSubMenu(%client, %tag, %index, %image); + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Back to weapon challegnes'); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Back to main menu'); + %index++; + return; + + case "CompletedChallenge": + %client.SCMPage = "SM"; + messageClient( %client, 'SetScoreHudSubheader', "", "Completed Challenges" ); + messageClient( %client, 'SetLineHud', "", %tag, %index, "Select A Weapon"); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + %index = GenerateCompletedChallegnesMenu(%client, %tag, %index); + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Back to weapon challegnes'); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Back to main menu'); + %index++; + return; + + case "WeaponTasksSub": + %image = %arg2; + %client.SCMPage = "SM"; + messageClient( %client, 'SetScoreHudSubheader', "", "In-Complete Challenges" ); + messageClient( %client, 'SetLineHud', "", %tag, %index, "Challenges:"); + %index++; + %index = GenerateWChallengeSubMenu(%client, %tag, %index, %image); + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Back to weapon challegnes'); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Back to main menu'); + %index++; + return; + + case "WeaponsTasks": + %client.SCMPage = "SM"; + messageClient( %client, 'SetScoreHudSubheader', "", "In-Complete Challenges" ); + messageClient( %client, 'SetLineHud', "", %tag, %index, "Select A Weapon"); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + %index = GenerateWeaponChallegnesMenu(%client, %tag, %index); + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Back to weapon challegnes'); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Back to main menu'); + %index++; + return; + + case "OtherTasks": + %client.SCMPage = "SM"; + messageClient( %client, 'SetScoreHudSubheader', "", "In-Complete Challenges" ); + messageClient( %client, 'SetLineHud', "", %tag, %index, "Select A Challenge"); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + //%index = GenerateChallegnesMenu(%client, %tag, %index); + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Back to weapon challegnes'); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Back to main menu'); + %index++; + return; + + case "WeaponChallenge": + %client.SCMPage = "SM"; + messageClient( %client, 'SetScoreHudSubheader', "", "Weapon Challenges" ); + messageClient( %client, 'SetLineHud', "", %tag, %index, "Select An Option"); + %index++; + // + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + // + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Completed Challenges & Upgrades'); + %index++; + // + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Specific Weapon Challenges'); + %index++; + // + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Additional Challenges'); + %index++; + // + //%index = CreatePerkMenu(%client, %tag, %index); + // + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Back to main menu'); + %index++; + messageClient( %client, 'ClearHud', "", %tag, %index ); + return; + + case "Perks": + %client.SCMPage = "SM"; + messageClient( %client, 'SetScoreHudSubheader', "", "PERKS" ); + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, "--- ACTIVE PERKS ---"); + %index++; + GetActivePerks(%client); //Reload This First + messageClient( %client, 'SetLineHud', "", %tag, %index, "PRIMARY: "@%client.Perk[1]@""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, "SECONDARY: "@%client.Perk[2]@""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, "TERTIARY: "@%client.Perk[3]@""); + %index++; + // + // + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, "--- AVAILIABLE PERKS ---"); + %index++; + // + %index = CreatePerkMenu(%client, %tag, %index); + // + messageClient( %client, 'SetLineHud', "", %tag, %index, ""); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, 'Back to main menu'); + %index++; + messageClient( %client, 'ClearHud', "", %tag, %index ); + return; + + case "PerkStatus": + DisableAllPerkGroup(%client, $Perk::PerkToGroup[%arg2]); + SetPerkStatus(%client, %arg2, 1); + %game.processGameLink(%client, "Perks"); + return; + // + default: + %client.notFirstUse = 1; + } + closeScoreHudFSERV(%client); +} + +function HelljumpGame::GiveGuns(%game, %player) { + // + %class = $HellJump::HellClass[%player.client]; + // + switch$ (%class) { + case "HellJumper": + %player.setArmor("Medium"); //commando! + %player.clearInventory(); + %player.setInventory(S3SRifle, 1, true); + %player.setInventory(S3SRifleAmmo, 30, true); + %player.ClipCount[S3SRifleImage.ClipName] = S3SRifleImage.InitialClips; + %player.setInventory(Mp26CMDO, 1, true); + %player.setInventory(Mp26CMDOAmmo, 50, true); + %player.ClipCount[Mp26CMDOImage.ClipName] = Mp26CMDOImage.InitialClips; + %player.setInventory(Pistol, 1, true); + %player.setInventory(PistolAmmo, 50, true); //I'm nice for your first clip :) + %player.ClipCount[PistolImage.ClipName] = PistolImage.HellClipCount; + %player.setInventory(RepairKit,3); + %player.setInventory(Grenade,5); + %player.use(Mp26CMDO); + case "Light Sniper": + %player.setArmor("Light"); + %player.clearInventory(); + %player.setInventory(R700SniperRifle, 1, true); + %player.setInventory(R700SniperRifleAmmo, 10, true); + %player.ClipCount[R700SniperRifleImage.ClipName] = R700SniperRifleImage.InitialClips; + %player.setInventory(Shocklance, 1, true); + %player.setInventory(RepairKit,3); + %player.setInventory(Grenade,5); + %player.use(R700SniperRifle); + case "Explosives": + %player.setArmor("Heavy"); + %player.clearInventory(); + %player.setInventory(RPG, 1, true); + %player.setInventory(RPGAmmo, 1, true); + %player.ClipCount[RPGImage.ClipName] = 25; //have fun with your RPGs + %player.setInventory(Pistol, 1, true); + %player.setInventory(PistolAmmo, 50, true); //I'm nice for your first clip :) + %player.ClipCount[PistolImage.ClipName] = PistolImage.HellClipCount; + %player.setInventory(MG42, 1, true); + %player.setInventory(MG42Ammo, 200, true); + %player.ClipCount[MG42Image.ClipName] = MG42Image.InitialClips; + %player.setInventory(Javelin, 1, true); + %player.setInventory(JavelinAmmo, 1, true); + %player.ClipCount[JavelinImage.ClipName] = 10; + %player.setInventory(RepairKit,3); + %player.setInventory(Grenade,5); + %player.use(RPG); + case "Stormlord": + %player.setArmor("Microburst"); + %player.clearInventory(); + %player.setInventory(S3Rifle, 1, true); + %player.setInventory(S3RifleAmmo, 10, true); + %player.ClipCount[S3RifleImage.ClipName] = S3RifleImage.InitialClips; + %player.setInventory(IonRifle, 1, true); + %player.setInventory(Shocklance, 1, true); + %player.setInventory(RepairKit,3); + %player.setInventory(StaticGrenade,5); + %player.use(IonRifle); + case "Close Combat": + %player.setArmor("Medium"); //commando! + %player.clearInventory(); + %player.setInventory(Wp400, 1, true); + %player.setInventory(Wp400Ammo, 5, true); + %player.ClipCount[Wp400Image.ClipName] = Wp400Image.InitialClips; + %player.setInventory(Pg700, 1, true); + %player.setInventory(Pg700Ammo, 45, true); + %player.ClipCount[Pg700Image.ClipName] = Pg700Image.InitialClips; + %player.setInventory(LD06Savager, 1, true); + %player.setInventory(LD06SavagerAmmo, 10, true); //I'm nice for your first clip :) + %player.ClipCount[LD06SavagerImage.ClipName] = LD06SavagerImage.InitialClips; + %player.setInventory(RepairKit,3); + %player.setInventory(Grenade,5); + %player.use(Wp400); + case "Shadow Guard": + %player.setArmor("ShadowCommando"); //commando! + %player.clearInventory(); + %player.setInventory(ShadowRifle, 1, true); + %player.setInventory(S3Rifle, 1, true); + %player.setInventory(S3RifleAmmo, 10, true); + %player.ClipCount[S3RifleImage.ClipName] = S3RifleImage.InitialClips; + %player.setInventory(LD06Savager, 1, true); + %player.setInventory(LD06SavagerAmmo, 10, true); //I'm nice for your first clip :) + %player.ClipCount[LD06SavagerImage.ClipName] = LD06SavagerImage.InitialClips; + %player.setInventory(RepairKit,3); + %player.setInventory(Grenade,5); + %player.use(ShadowRifle); + case "RSA": + %player.setArmor("Medium"); //commando! + %player.clearInventory(); + %player.setInventory(lasergun, 1, true); + %player.setInventory(lasergunAmmo, 10, true); + %player.ClipCount[lasergunImage.ClipName] = 7; + %player.setInventory(S3SRifle, 1, true); + %player.setInventory(S3SRifleAmmo, 30, true); + %player.ClipCount[S3SRifleImage.ClipName] = S3SRifleImage.InitialClips; + %player.setInventory(PulsePhaser, 1, true); + %player.setInventory(RepairKit,3); + %player.setInventory(Grenade,5); + %player.use(lasergun); + case "Flamer": + %player.setArmor("Medium"); //commando! + %player.clearInventory(); + %player.setInventory(flamer, 1, true); + %player.setInventory(flamerAmmo, 100, true); + %player.ClipCount[flamerImage.ClipName] = 999; + %player.setInventory(Pistol, 1, true); + %player.setInventory(PistolAmmo, 50, true); //I'm nice for your first clip :) + %player.ClipCount[PistolImage.ClipName] = PistolImage.HellClipCount; + %player.setInventory(RepairKit,3); + %player.setInventory(Grenade,5); + %player.use(flamer); + case "Javelin": + %player.setArmor("Medium"); //commando! + %player.clearInventory(); + %player.setInventory(Javelin, 1, true); + %player.setInventory(JavelinAmmo, 1, true); + %player.ClipCount[JavelinImage.ClipName] = 999; + %player.setInventory(Deagle, 1, true); + %player.setInventory(DeagleAmmo, 7, true); //I'm nice for your first clip :) + %player.ClipCount[DeagleImage.ClipName] = DeagleImage.InitialClips; + %player.setInventory(TargetingLaser, 1, true); + %player.setInventory(RepairKit,3); + %player.setInventory(Grenade,5); + %player.use(Javelin); + default: + %player.setArmor("Medium"); //commando! + %player.clearInventory(); + %player.setInventory(S3SRifle, 1, true); + %player.setInventory(S3SRifleAmmo, 30, true); + %player.ClipCount[S3SRifleImage.ClipName] = S3SRifleImage.InitialClips; + %player.setInventory(Mp26CMDO, 1, true); + %player.setInventory(Mp26CMDOAmmo, 50, true); + %player.ClipCount[Mp26CMDOImage.ClipName] = Mp26CMDOImage.InitialClips; + %player.setInventory(Pistol, 1, true); + %player.setInventory(PistolAmmo, 50, true); //I'm nice for your first clip :) + %player.ClipCount[PistolImage.ClipName] = PistolImage.HellClipCount; + %player.setInventory(RepairKit,3); + %player.setInventory(Grenade,5); + %player.use(Mp26CMDO); + } +} + +//HellClass info(1.6) +$HellClass::Info["HellJumper"] = "Commando Armor - S3-S Rifle, MP26 CMDO, Colt Pistol"; +$HellClass::Info["Light Sniper"] = "Scout Armor - R700 Sniper, X-81 Shocklance"; +$HellClass::Info["Explosives"] = "Support Armor - RPG-7, MG42 Machine Gun, Javelin, Colt Pistol"; +$HellClass::Info["RSA"] = "Commando Armor - RSA Laser Rifle, S3-S Rifle, ES-77 Pulse Phaser"; +$HellClass::Info["Stormlord"] = "Microburst Armor - S3 Rifle, LUST Ion Rifle, X-81 Shocklance"; +$HellClass::Info["Close Combat"] = "Commando Armor - Wp400 Shotgun, Pg700 SMG, LD06 Savager"; +$HellClass::Info["Shadow Guard"] = "S.Commando Armor - Sh4d3 Shadow Rifle, S3 Rifle, LD06 Savager"; +//Special Classes (most of these have 1 weapon that cannot be obtained in a drop pod and a pistol. +$HellClass::Info["Collider Fanatic"] = "Commando Armor - PRTCL-995 MCC, Colt Pistol"; +$HellClass::Info["Flamer"] = "Commando Armor - A|V|X Flamethrower (Unlimited), Colt Pistol"; +$HellClass::Info["Javelin"] = "Commando Armor - Javelin (Unlimited), Desert Eagle Pistol"; + + + + + + + + + + + + + + + + + + + + + + + + + +//Phantom139 +//TWM2 3.7 Changes +function GenerateHelljumpChallengeMenu(%client, %tag, %index) { + if(%client.CheckNWChallengeCompletion("GroupBuster")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Group Buster - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Group Buster - Complete A Group."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("WaveDefeater")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Wave Defeater - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Wave Defeater - Complete A Wave."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("OneK")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "1K Soldier - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "1K Soldier - Earn 1,000 Points (Solo Score)."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("FiveK")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "5K Soldier - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "5K Soldier - Earn 5,000 Points (Solo Score)."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("TenK")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "10K Soldier - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "10K Soldier - Earn 10,000 Points (Solo Score)."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("PointsSurge")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Points Surge - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Points Surge - Earn 7,500 Points (Team Score)."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("PointsJackpot")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Points Jackpot - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Points Jackpot - Earn 25,000 Points (Team Score)."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("ThatsAHind")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "That's a Hind - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "That's a Hind - Use a Hind Pilot Killstreak in Helljump."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("DownBoy")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Down Boy... Down - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Down Boy... Down - Kill the wraith zombie on Strike 5."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("ClassExtravaganza")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Class Extravaganza - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Class Extravaganza - Use a hellclass."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("LifeGiver")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Giver of Life - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Giver of Life - Use a Full Team Respawn beacon."); + %index++; + } + // + return %index; +} + diff --git a/scripts/HordeGame.cs b/scripts/HordeGame.cs new file mode 100644 index 0000000..7c03694 --- /dev/null +++ b/scripts/HordeGame.cs @@ -0,0 +1,1552 @@ +// DisplayName = Horde 3 + +//--- GAME RULES BEGIN --- +// Horde Returns To TWM With a Few New Rules +// 5:00 Initial Time To Build up and Fortify +// Zombies dont all spawn at once, but come +// at random intervals. +// +// Now With Changes (Horde 3) +//--- GAME RULES END --- + +//HORDE 3 GAME +//COPYRIGHT 2009-2010, PHANTOM GAMES DEVELOPMENT +//ALL RIGHTS RESERVED + +//Pos - FLBig - 52 0 101 +//Pos - Flatdash - 64 265 179 +$HordeGame::SpawnGraph["FlatlandBigH"] = "52 0 101"; +$HordeGame::SpawnGraph["slapmydashH"] = "-64.7988 -267.13 131.439"; +$HordeGame::SpawnGraph["FrozenNight"] = "30 26 80"; +function HordeGame::pickPlayerSpawn(%game, %client, %respawn) { + if (isobject(%client.spawnpoint)) { + if (%client.spawnpoint.team == %client.team) { + if ( (%client.spawnpoint.ispersonal != 1) || (%client==%client.spawnpoint.owner) ) { + if (%client.spawnpoint.getdatablock().isspawnpoint==1) { + return vectoradd(%client.spawnpoint.getposition(),"0 0 1.5") SPC "0 0 0 1"; + } + } + else { + messageclient(%client,'',"\c3The spawn point you selected is a personal spawn point, spawning you at default spawn location."); + } + } + else { + messageclient(%client,'',"\c3The spawn point you selected is not on your team, spawning you at default spawn location."); + } + } + if ( (!isobject(%client.spawnpoint)) && (%client.spawnpoint != 0) && (%client.spawnpoint !$= "") ) { + messageclient(%client,'',"\c3The spawn point you selected does not exist, spawning you at default spawn location."); + } + + // place this client on his own team, '%respawn' does not ever seem to be used + //we no longer care whether it is a respawn since all spawns use same points. + %loc = $HordeGame::SpawnGraph[$CurrentMission]; + %position = vectorAdd(%loc,VectorAdd(getRandomPosition(20,1), "0 0 10")); + return %position;//return %game.pickTeamSpawn(%client.team); +} + +function MakeReviveString() { + %string = ""; + %revives = $HordeGame::RevivesLeft; + for(%i = 1; %i <= 5; %i++) { + if(%i <= $HordeGame::RevivesLeft) { + %string = ""@%string@"[R]"; + } + else { + %string = ""@%string@"[X]"; + } + } + return %string; +} + +function HordeGame::AIInit(%game) { + //call the default AIInit() function + AIInit(); +} + +function HordeGame::allowsProtectedStatics(%game) { + return true; +} + +//Score Menu Fix +function HordeGame::updateScoreHud(%game, %client, %tag) { + ConstructionGame::updateScoreHud(%game, %client, %tag); +} + +function HordeGame::processGameLink(%game, %client, %arg1, %arg2, %arg3, %arg4, %arg5){ + ConstructionGame::processGameLink(%game, %client, %arg1, %arg2, %arg3, %arg4, %arg5); +} +// + +function HordeServerStatuser() { + %count = ClientGroup.getCount(); + if(!%count || %count == 0 ||%count $= "") { //no players.. + HordeServerSetStatus("Standby"); + } + else { + HordeServerSetStatus("Active"); + } + schedule(10000,0,"HordeServerStatuser"); +} + +function HordeServerSetStatus(%status) { + if(%status $= "Standby" && $HordeGame::GameStatus $= "Active") { + $HordeGame::GameStatus = "Standby"; + Echo("Horde: Server switching to STANDBY mode"); + } + else if(%status $= "Active" && $HordeGame::GameStatus $= "Standby") { + $HordeGame::GameStatus = "Active"; + Echo("Horde: Server switching to ACTIVE mode"); + } +} + +function HordeGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation) { + Parent::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation); + if(%clVictim !$= "" && !$Horde::Preparing) { //actual player died + %clVictim.CantRespawn = 1; //gotta wait until next round / Wave + CenterPrint(%clVictim, "You are out until the next Wave.",2,3); + Echo("Horde: "@%clVictim.namebase@" has been killed."); + HordeCheckForLivingPlayers(%game); + } +} + +function HordeCheckForLivingPlayers(%game) { + if($Horde::Preparing) { + return; + } + $HordeGame::LivingCount = 0; + %count = ClientGroup.getCount(); + if(%count == 0) { //no players, this fixed the constant game over stuff + return; + } + for (%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject( %i ); + if(!isObject(%cl.player) || %cl.player.getstate() $= "dead") { + //Do nothing + } + else { + $HordeGame::LivingCount++; + } + } + %game.UpdateClientScoreBar(); + if($HordeGame::LivingCount <= 0) { + //Everyone is Dead, or nobody is in the server, game over + %game.gameOver(); + cycleMissions(); + } +} + +function HordeGame::UpdateClientScoreBar(%game) { + %alv = $HordeGame::LivingCount; + %s = MakeReviveString(); + for(%i = 0; %i < ClientGroup.getcount(); %i++) { + %cl = ClientGroup.getObject(%i); + messageClient(%cl, 'MsgSPCurrentObjective1', "", "Wave "@$HordeGame::CurrentWave@" | Zombies Left: "@$HordeGame::Zombiecount@" | TEAM: "@$HordeGame::Score["Team"]@""); + messageClient(%cl, 'MsgSPCurrentObjective2', "", "Players Alive: "@$HordeGame::LivingCount@" | "@%s@" | SCORE: "@$HordeGame::Score[%cl]@""); + } +} + +function HordeKillAllZombies() { + Echo("Horde: Cleaning Zombies"); + %count = MissionCleanup.getCount(); + for(%i = 0; %i < %count; %i++) { + %obj = MissionCleanup.getObject(%i); + if(isObject(%obj)) { + if(%obj.iszombie) { + %obj.scriptkill($DamageType::admin); //They all went on crack and died XD + } + else { + continue; + } + } + } +} + +function HordeAllowAllRespawn() { + Echo("Horde: Players Can now respawn."); + %count = ClientGroup.getCount(); + for (%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject( %i ); + %cl.CantRespawn = 0; + CenterPrint(%cl, "You can now respawn, but hurry, you have 15 seconds.",2,3); + } + messageAll('MsgSPCurrentObjective2' ,"", "You Can Now Spawn"); +} + +function LockOutCLsFromRespawn(%game) { + Echo("Horde: Players Can no longer respawn."); + %count = ClientGroup.getCount(); + for (%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject( %i ); + %cl.CantRespawn = 1; + bottomPrint(%cl, "The respawn timer has exipred.",2,3); + } + HordeCheckForLivingPlayers(%game); // Do this to see if anyone exists. +} + +function HordeShowWaveBegin() { + %count = ClientGroup.getCount(); + for (%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject( %i ); + messageClient(%cl, 'MsgClient', "~wfx/misc/lightning_impact.wav"); + BottomPrint(%cl, "Horde \n Wave "@$HordeGame::CurrentWave@" \n Begins",5,3); + } +} + +function HordeGame::spawnPlayer( %game, %client, %respawn ) { + if(%client.CantRespawn && !%client.IsActivePerk("Second Chance")) { + CenterPrint(%client, "You are out until the next Wave.",2,3); + return; + } + if(%client.IsActivePerk("Second Chance") && %client.CantRespawn) { + if($HordeGame::RevivesLeft == 0) { + CenterPrint(%client, "Second Chance: No Team Revives Left.",2,3); + return; + } + else { + $HordeGame::RevivesLeft--; + %game.UpdateClientScoreBar(); + } + messageAll('msgBack', "\c5HORDE: "@%client.namebase@" exerts second chance and respawns."); + } + Parent::spawnPlayer( %game, %client, %respawn ); + HordeCheckForLivingPlayers(%game); +} + +function HordeGame::clientJoinTeam( %game, %client, %team, %respawn ) +{ + // for multi-team games played with a single team + if (Game.numTeams == 1) { + %game.assignClientTeam( %client ); + // Spawn the player: + %game.spawnPlayer( %client, %respawn ); + return; + } + +//error("DefaultGame::clientJoinTeam"); + if ( %team < 1 || %team > %game.numTeams ) + return; + + if( %respawn $= "" ) + %respawn = 1; + + %client.team = %team; + %client.lastTeam = %team; + setTargetSkin( %client.target, %game.getTeamSkin(%team) ); + setTargetSensorGroup( %client.target, %team ); + %client.setSensorGroup( %team ); + + // Spawn the player: + %game.spawnPlayer( %client, %respawn ); + +// messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 joined %2.', %client.name, %game.getTeamName(%team), %client, %team ); +// messageClient( %client, 'MsgClientJoinTeam', '\c1You joined the %2 team.', $client.name, %game.getTeamName(%client.team), %client, %client.team ); + + updateCanListenState( %client ); + + logEcho(%client.nameBase@" (cl "@%client@") joined team "@%client.team); + if ($Host::Prison::Enabled == true) { + if (%client.isJailed) + // If player should manage to get out of jail, re-spawn and re-start sentence time + jailPlayer(%client,false,mAbs(%cl.jailTime)); + } +} + +function HordeGame::assignClientTeam(%game, %client, %respawn ) { + %numPlayers = ClientGroup.getCount(); + for(%i = 0; %i <= %game.numTeams; %i++) + %numTeamPlayers[%i] = 0; + + for(%i = 0; %i < %numPlayers; %i = %i + 1) + { + %cl = ClientGroup.getObject(%i); + if(%cl != %client) + %numTeamPlayers[%cl.team]++; + } + %leastPlayers = %numTeamPlayers[1]; + %leastTeam = 1; + for(%i = 2; %i <= %game.numTeams; %i++) + { + if( (%numTeamPlayers[%i] < %leastPlayers) || + ( (%numTeamPlayers[%i] == %leastPlayers) && + ($teamScore[%i] < $teamScore[%leastTeam] ) )) + { + %leastTeam = %i; + %leastPlayers = %numTeamPlayers[%i]; + } + } + + %client.team = %leastTeam; + %client.lastTeam = %team; + + // Assign the team skin: + if ( %client.isAIControlled() ) + { + if ( %leastTeam & 1 ) + { + %client.skin = addTaggedString( "basebot" ); + setTargetSkin( %client.target, 'basebot' ); + } + else + { + %client.skin = addTaggedString( "basebbot" ); + setTargetSkin( %client.target, 'basebbot' ); + } + } + else + setTargetSkin( %client.target, %game.getTeamSkin(%client.team) ); + + updateCanListenState( %client ); + + logEcho(%client.nameBase@" (cl "@%client@") joined team "@%client.team); +} + +function HordeGame::clientChangeTeam(%game, %client, %team, %fromObs) { + if(%client.CantRespawn) { + if(!%fromObs) { //:D they tried to change teams + CenterPrint(%client, "You are out until the next Wave. \n Although that was a good try :D",2,3); + return; + } + else { + CenterPrint(%client, "You are out until the next Wave.",2,3); + return; + } + } + %game.removeFromTeamRankArray(%client); + + %pl = %client.player; + if(isObject(%pl)) { + if(%pl.isMounted()) + %pl.getDataBlock().doDismount(%pl); + %pl.scriptKill(0); + } + + // reset the client's targets and tasks only + clientResetTargets(%client, true); + + // give this client a new handle to disassociate ownership of deployed objects + if( %team $= "" && (%team > 0 && %team <= %game.numTeams)) + { + if( %client.team == 1 ) + %client.team = 2; + else + %client.team = 1; + } + else + %client.team = %team; + + // Set the client's skin: + if (!%client.isAIControlled()) + setTargetSkin( %client.target, %game.getTeamSkin(%client.team) ); + setTargetSensorGroup( %client.target, %client.team ); + %client.setSensorGroup( %client.team ); + + // Spawn the player: + %client.lastSpawnPoint = %game.pickPlayerSpawn( %client ); + + %game.createPlayer( %client, %client.lastSpawnPoint, $MatchStarted ); + + if($MatchStarted) + %client.setControlObject(%client.player); + else + { + %client.camera.getDataBlock().setMode(%client.camera, "pre-game", %client.player); + %client.setControlObject(%client.camera); + } + %game.onClientEnterObserverMode(%client); + updateCanListenState( %client ); + + // MES - switch objective hud lines when client switches teams + messageClient(%client, 'MsgCheckTeamLines', "", %client.team); + logEcho(%client.nameBase@" (cl "@%client@") switched to team "@%client.team); + +} + +function HordeRepairAndRearm(%cl) { + if(isObject(%cl.player)) { + buyfavorites(%cl); + %cl.player.ApplyRepair(20.0); + } +} + +function HordeGame::clientMissionDropReady(%game, %client) { + $HordeGame::Score[%client] = 0; + %count = ClientGroup.getCount(); + if(!$Horde::Preparing) { + if($MatchStarted && $CountdownStarted && %count == 1) { //Game started, first player is in + messageClient(%client, 'MsgClient', "\c5Welcome To Horde, You are the first player, BEGIN!"); + %client.CantRespawn = 0; //they will get the first life + $HordeGame::GameStatus = "Active"; //Force the server into Active Mode + } + else if($MatchStarted && $CountdownStarted && %count > 1) { // Game in progress, multiple players + HordeCheckForLivingPlayers(%game); //we may have to restart the game + messageClient(%client, 'MsgClient', "\c5Welcome To Horde, Please wait for the next wave to begin."); + %client.CantRespawn = 1; + } + } + messageClient(%client, 'MsgClientReady',"", "SinglePlayerGame"); + defaultGame::clientMissionDropReady(%game, %client); +} + +function HordeGame::onAIRespawn(%game, %client) { + //add the default task + if (! %client.defaultTasksAdded) + { + %client.defaultTasksAdded = true; + %client.addTask(AIPickupItemTask); + %client.addTask(AIUseInventoryTask); + %client.addTask(AITauntCorpseTask); + %client.addTask(AIEngageTurretTask); + %client.addTask(AIDetectMineTask); + %client.addTask(AIBountyPatrolTask); + %client.bountyTask = %client.addTask(AIBountyEngageTask); + } + + //set the inv flag + %client.spawnUseInv = true; +} + +function HordeGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) { + if (%game.testKill(%clVictim, %clKiller)) { //verify victim was an enemy + %game.awardScoreKill(%clKiller); + %game.awardScoreDeath(%clVictim); + } + else if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide + %game.awardScoreSuicide(%clVictim); +} + +function HordeGame::timeLimitReached(%game) { + $TWM::HordeCalled = 1; //The Host Will Cycle + logEcho("game over (timelimit)"); + %game.gameOver(); + cycleMissions(); +} + +function HordeNextWave(%game, %wave) { + if($HordeGame::RevivesLeft < 5) { + $HordeGame::RevivesLeft++; + } + $HordeGame::CurrentWave = %wave; + HordeKillAllZombies(); //Cleans up the server + if($HordeGame::CurrentWave == 51) { //Victory + for (%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + CompleteNWChallenge(%cl, "ArmyOf50Stopped"); + } + %game.gameOver(); + cycleMissions(); + return; + } + else if($HordeGame::CurrentWave == 26) { + for (%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + CompleteNWChallenge(%cl, "Milestone25"); + } + } + else if($HordeGame::CurrentWave == 16) { + for (%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + CompleteNWChallenge(%cl, "15For15"); + } + } + // + // + %count = ClientGroup.getCount(); + for (%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject( %i ); + // + HordeRepairAndRearm(%cl); + // + if($HordeGame::CurrentWave < 10) { + %XPPerc = 0.25; + } + else if($HordeGame::CurrentWave >= 10 && $HordeGame::CurrentWave < 20) { + %XPPerc = 0.5; + } + else if($HordeGame::CurrentWave >= 20 && $HordeGame::CurrentWave < 35) { + %XPPerc = 0.75; + } + else { + %XPPerc = 1; + } + if($HordeGame::CurrentWave <= 1 || $HordeGame::CurrentWave $= "") { + + } + else { + %XPGain = MFloor((((($HordeGame::CurrentWave - 1) * 500) * %XPPerc) / $HostGamePlayerCount) / 8); + GainExperience(%cl, %XPGain, "Wave "@$HordeGame::CurrentWave - 1@" Complete "); + } + // + } + Echo("Horde: Players Moving into Wave "@%wave@"."); + HordeShowWaveBegin(); + HordeAllowAllRespawn(); // Go! + schedule(15000,0,"LockOutCLsFromRespawn", %game); + schedule(30000,0,"StartHordeZombies", $CurrentMission, %wave); + $HordeGame::Zombiecount = 0; + $HordeGame::NextWave = %wave + 1; + $HordeGame::CanSpawnZombies = 1; + $HordeGame::TeamKillsWave = 0; + $HordeGame::TeamScoreWave = 0; + DoWaveHighlights(); + for (%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject( %i ); + %cl.waveKills = 0; + %cl.waveScore = 0; + } + $Horde::Preparing = 0; + %game.UpdateClientScoreBar(); +} + +function HordeGame::startMatch(%game) { + $Host::nozombs = 0; //Allow Zombs + $HordeGame::GameStatus = "Standby"; //Always Start In Standby + $HordeGame::CanSpawnZombies = 1; + $HordeGame::CurrentWave = 1; + $HordeGame::NextWave = 2; + $HordeGame::Zombiecount = 0; //Start at 0 ` + $HordeGame::LivingCount = 0; //Start at 0 + $HordeGame::RevivesLeft = 5; //Start With 5 + $Horde::Preparing = 1; + + $HordeGame::Score["Team"] = 0; + $HordeGame::TeamKillsWave = 0; + $HordeGame::TeamKills = 0; + $HordeGame::TeamScoreWave = 0; + + for(%i = 0; %i < ClientGroup.getCount(); %i ++) { + %client = ClientGroup.getObject(%i); + $HordeGame::Score[%client] = 0; + } + + $HordeGame::InitialGoTime = 300; + Game.CountDownToGame(); + + $TWM::PlayingHorde = 1; + $TWM::HordeCalled = 1; //The Host Will Cycle + $HordeGame::Game = %game; //This allows us to expand into other functions + DefaultGame::startMatch(%game); + HordeServerStatuser(); + messageAll('MsgSPCurrentObjective1' ,"", "Initial Startup"); + + setSensorGroupCount(31); +} + +function HordeGame::CountDownToGame(%game) { + $HordeGame::InitialGoTime--; + %time = $HordeGame::InitialGoTime; + %min = mFloor(%time / 60); + %sec = %time % 60; + if(%sec < 10) { + %sec = "0"@%sec; + } + messageAll('MsgSPCurrentObjective2' ,"", "Time Left: "@%min@":"@%sec@""); + if(%time <= 0) { + HordeNextWave(%game, 1); + return; + } + %game.schedule(1000, "CountDownToGame"); +} + +function HordeGame::scoreLimitReached(%game) { + $TWM::HordeCalled = 1; //The Host Will Cycle + logEcho("game over (scorelimit)"); + %game.gameOver(); + cycleMissions(); +} + +function HordeGame::gameOver(%game) { + //Dont end in standby, nobody is alive + if($HordeGame::GameStatus $= "Standby") { + return; + } + //call the default + HordeAllowAllRespawn(); + DefaultGame::gameOver(%game); + +// cycleMissions(); + + //send the winner message + %winner = ""; + if($HordeGame::Zombiecount >= 1) { + %winner = "Zombies"; + } + else { + %winner = "Humans"; + } + + if (%winner $= "Zombies") + messageAll('MsgGameOver', "The Zombies have overrun the humans.~wvoice/announcer/ann.stowins.wav" ); + else + messageAll('MsgGameOver', "The Humans have Survived the horde.~wvoice/announcer/ann.gameover.wav" ); + + Echo("Horde: Game over, Winners : "@%winner@" on Wave "@$HordeGame::CurrentWave@"."); + + messageAll('MsgClearObjHud', ""); + + //Reset the Vars + $TWM::PlayingHorde = 0; + $TWM::HordeCalled = 1; //The Host Will Cycle + $HordeGame::CurrentWave = 1; + $HordeGame::NextWave = 2; + $HordeGame::Zombiecount = 0; + $HordeGame::LivingCount = 0; + $HordeGame::CanSpawnZombies = 1; + + for(%i = 0; %i < ClientGroup.getCount(); %i ++) { + %client = ClientGroup.getObject(%i); + %game.resetScore(%client); + } + for(%j = 1; %j <= %game.numTeams; %j++) + $TeamScore[%j] = 0; +} + + +// Working on this +function HordeGame::sendDebriefing( %game, %client ) { + messageClient( %client, 'MsgDebriefResult', "", "Game Over at wave "@$HordeGame::CurrentWave@"." ); + if($HordeGame::LivingCount > 0) { + messageClient( %client, 'MsgDebriefResult', "", 'The humans have defeated the horde.' ); + } + else { + messageClient( %client, 'MsgDebriefResult', "", 'The zombie horde has overrun the humans.' ); + } +} + +function HordeGame::vehicleDestroyed(%game, %vehicle, %destroyer) { +} + +//Useful +function CheckLegitHordeMission(%mission) { + if(%mission $= "FlatlandBigH") { + return 1; + } + else if(%mission $= "slapmydashH") { //flatdash + return 1; + } + else if(%mission $= "FrozenNight") { //flatdash + return 1; + } + else { + return 0; + } +} + + +//ZOMBIE SPAWNING +//VARS (By mission) + +//UPDATE! +//This system is now universal for any map +//Just pop in the mission name into these vars: +//$HordeGame::ZombiePtCnts["name"] = Spawn Positions; <- ammount of spawns +//$HordeGame::ZombieStartPt["name", Spawn position] = "X Y Z"; <- Coordinates of a spawn area +//After you make those entires, add an else if statement to the check +//function above to allow horde to be played on that map +// -Phantom139 + +//FL Big +$HordeGame::ZombiePtCnts["FlatlandBigH"] = 4; +$HordeGame::ZombieStartPt["FlatlandBigH", 1] = "0 150 110"; +$HordeGame::ZombieStartPt["FlatlandBigH", 2] = "0 -150 110"; +$HordeGame::ZombieStartPt["FlatlandBigH", 3] = "150 0 110"; +$HordeGame::ZombieStartPt["FlatlandBigH", 4] = "-150 0 110"; +//Flatdash +$HordeGame::ZombiePtCnts["slapmydashH"] = 4; +$HordeGame::ZombieStartPt["slapmydashH", 1] = "-39 101 208"; +$HordeGame::ZombieStartPt["slapmydashH", 2] = "213 -325 140"; +$HordeGame::ZombieStartPt["slapmydashH", 3] = "-72 -528 138"; +$HordeGame::ZombieStartPt["slapmydashH", 4] = "-342 -272 138"; +//Frozen Night +$HordeGame::ZombiePtCnts["FrozenNight"] = 4; +$HordeGame::ZombieStartPt["FrozenNight", 1] = "165 -29.3 80"; +$HordeGame::ZombieStartPt["FrozenNight", 2] = "-14 -94 81"; +$HordeGame::ZombieStartPt["FrozenNight", 3] = "-82 88.5 81"; +$HordeGame::ZombieStartPt["FrozenNight", 4] = "94 209 186"; +// + +function HordeSpawnZombies(%pos, %type) { + if(!isObject(Game) || !$TWM::PlayingHorde) { + error("UE BLOCKED"); + return; + } + %c = CreateEmitter(%pos, NightmareGlobeEmitter, "0 0 1"); + %c.schedule(1000, "delete"); + schedule(500, 0, "StartAZombie", %pos, %type); +} + +function StartHordeZombies(%mission, %wave) { + //Prevent zombies from spawning in Standby Mode + //Note: Whats the point, noone is in here. + if(!$TWM::PlayingHorde) { + return; + } + if($HordeGame::GameStatus $= "Standby") { + Echo("Horde: Not Spawning Zombies, Server in StandBy Mode, Trying again in 60 Seconds"); + schedule(60000,0,"StartHordeZombies", %mission, %wave); + return; + } + //Block multiple waves from spawning. + if(!$HordeGame::CanSpawnZombies) { + return; + } + if(CheckLegitHordeMission(%mission) == 1) { + switch(%wave) { + case 1: + for(%i = 0; %i < 20; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, 1); + } + case 2: + for(%i = 0; %i < 25; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, 1); + } + case 3: + for(%i = 0; %i < 30; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, 1); + } + case 4: + for(%i = 0; %i < 35; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, 1); + } + case 5: + for(%i = 0; %i < 40; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, 1); + } + case 6: + for(%i = 0; %i < 20; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,2); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 7: + for(%i = 0; %i < 25; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,2); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 8: + for(%i = 0; %i < 30; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,2); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 9: + for(%i = 0; %i < 35; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,2); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 10: + for(%i = 0; %i < 40; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,2); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 11: + for(%i = 0; %i < 20; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,3); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 12: + for(%i = 0; %i < 25; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,3); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 13: + for(%i = 0; %i < 30; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,3); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 14: + for(%i = 0; %i < 35; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,3); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 15: + for(%i = 0; %i < 40; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,3); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 16: + for(%i = 0; %i < 20; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,4); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 17: + for(%i = 0; %i < 25; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,4); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 18: + for(%i = 0; %i < 30; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,4); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 19: + for(%i = 0; %i < 35; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,4); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 20: + for(%i = 0; %i < 40; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,4); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 21: + for(%i = 0; %i < 20; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,5); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 22: + for(%i = 0; %i < 25; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,5); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 23: + for(%i = 0; %i < 30; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,5); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 24: + for(%i = 0; %i < 35; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = getRandom(1,5); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + //The Rapier wave :D + case 25: + for(%i = 0; %i < 25; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, 5); + } + case 26: + for(%i = 0; %i < 30; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 6); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 27: + for(%i = 0; %i < 35; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 6); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 28: + for(%i = 0; %i < 40; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 6); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 29: + for(%i = 0; %i < 45; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 7); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 30: + for(%i = 0; %i < 50; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 7); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 31: + for(%i = 0; %i < 20; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 7); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 32: + for(%i = 0; %i < 25; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 7); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 33: + for(%i = 0; %i < 30; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 7); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 34: + for(%i = 0; %i < 35; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 8); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 35: + for(%i = 0; %i < 40; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 8); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 36: + for(%i = 0; %i < 25; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 8); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 37: + for(%i = 0; %i < 30; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 8); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 38: + for(%i = 0; %i < 35; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 8); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 39: + for(%i = 0; %i < 40; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 8); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 40: + for(%i = 0; %i < 40; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 8); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + //The Lord wave :D + case 41: + for(%i = 0; %i < 25; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, 3); + } + //The Lord wave, 2.0 :D + case 42: + for(%i = 0; %i < 40; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, 3); + } + //Slasher Wave + case 43: + for(%i = 0; %i < 40; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, 11); + } + case 44: + for(%i = 0; %i < 40; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 8); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 45: + for(%i = 0; %i < 40; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 8); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 46: + for(%i = 0; %i < 45; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 8); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + case 47: + for(%i = 0; %i < 50; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %type = GetRandom(1, 8); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, %type); + } + //The sniper wave :p + case 48: + for(%i = 0; %i < 30; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, 9); + } + //The ravie wave, V2.0 :p + case 49: + for(%i = 0; %i < 45; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, 2); + } + //ZOMG!!!! Demon LORDS!!! RUN + case 50: + for(%i = 0; %i < 15; %i++) { + %pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]); + %final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1)); + $HordeGame::Zombiecount++; + %time = 1000 * getRandom(1, 60); + schedule(%time, 0, "HordeSpawnZombies", %final, 6); + } + default: + error("Horde: Wave Error, Wave "@%wave@" is unknown on "@%mission@""); + } + } + else { + error("Horde: Map Error, Wave "@%wave@" is unknown on "@%mission@""); + error("Horde: Check function CheckLegitHordeMission, map "@%mission@" is not specified"); + } + $HordeGame::CanSpawnZombies = 0; + Game.UpdateClientScoreBar(); + echo("Horde: Spawn Zombies Called, "@$HordeGame::Zombiecount@" Spawned"); +} + +// +function HordeGame::ToggleModifiers(%game, %modifier, %toggleTo) { + switch$(%modifier) { + case "Titan": + %ModifierDesc = "Death is quite costly... it ends the bonus strike"; + $HellJump::Modifier["Titan"] = %toggleTo; + case "Super-Lunge": + %ModifierDesc = "Normal Zombies lunge at 3X normal distance"; + $HellJump::Modifier["SuperLunge"] = %toggleTo; + case "Kamakaziiiii": + %ModifierDesc = "Volatile Ravenger's move at 5X Speed... be cautious..."; + $HellJump::Modifier["Kamakazi"] = %toggleTo; + case "Where's My Head": + %ModifierDesc = "Zombies cannot be killed by a headshot"; + $HellJump::Modifier["WheresMyHead"] = %toggleTo; + case "You can't see me": + %ModifierDesc = "Normal zombies are now cloaked... mwuhahaha!!!"; + $HellJump::Modifier["YouCantSeeMe"] = %toggleTo; + case "Oh Lordy": + %ModifierDesc = "Zombie lords shoot 4 pulses instead of 2"; + $HellJump::Modifier["OhLordy"] = %toggleTo; + case "It BURNS!": + %ModifierDesc = "Demon Zombie Fireballs now cause Burns"; + $HellJump::Modifier["ItBurns"] = %toggleTo; + case "The Destiny": + %ModifierDesc = "Volatile Ravengers explosive power is doubled"; + $HellJump::Modifier["TheDestiny"] = %toggleTo; + case "Scrambler": + %ModifierDesc = "Zombie lords jam helicopter signals blocking you from calling them in"; + $HellJump::Modifier["Scrambler"] = %toggleTo; + case "Demonic": + %ModifierDesc = "All zombies take 50% of normal damage, thus doubling their HP"; + $HellJump::Modifier["Demonic"] = %toggleTo; + case "All On": + %ModifierDesc = "All Modifiers on"; + $HellJump::Modifier["SuperLunge"] = 1; + $HellJump::Modifier["Kamakazi"] = 1; + $HellJump::Modifier["WheresMyHead"] = 1; + $HellJump::Modifier["YouCantSeeMe"] = 1; + $HellJump::Modifier["OhLordy"] = 1; + $HellJump::Modifier["ItBurns"] = 1; + $HellJump::Modifier["TheDestiny"] = 1; + $HellJump::Modifier["Scrambler"] = 1; + $HellJump::Modifier["Demonic"] = 1; + %game.schedule(2100, "ToggleModifiers", "Titan", 1); + case "All Off": + %ModifierDesc = "All Modifiers Off"; + $HellJump::Modifier["SuperLunge"] = 0; + $HellJump::Modifier["Kamakazi"] = 0; + $HellJump::Modifier["WheresMyHead"] = 0; + $HellJump::Modifier["YouCantSeeMe"] = 0; + $HellJump::Modifier["OhLordy"] = 0; + $HellJump::Modifier["ItBurns"] = 0; + $HellJump::Modifier["TheDestiny"] = 0; + $HellJump::Modifier["Scrambler"] = 0; + $HellJump::Modifier["Demonic"] = 0; + $HellJump::Modifier["Titan"] = 0; + } + if(%modifier !$= "All On" && %modifier !$= "All Off") { + if(%toggleTo == 1) { + %toDisp = "On"; + } + else { + %toDisp = "Off"; + } + //and now lets display our message + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + bottomPrint(%cl, ""@%modifier@" - "@%toDisp@" \n "@%ModifierDesc@"", 2, 2); + messageClient(%cl, 'MsgClient', "\c5HELLJUMP: "@%modifier@" - "@%toDisp@" : "@%ModifierDesc@""); + } + } + else { + //and now lets display our message + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + bottomPrint(%cl, ""@%modifier@" \n "@%ModifierDesc@"", 2, 2); + messageClient(%cl, 'MsgClient', "\c5HELLJUMP: "@%modifier@" : "@%ModifierDesc@""); + } + } +} + +function HordeGame::CheckModifier(%game, %mod) { + return $HellJump::Modifier[""@%mod@""]; +} + +function HordeGame::AwardGamePoints(%game, %client, %points) { + $HordeGame::Score[%client] += %points; + $HordeGame::Score["Team"] += %points; + $HordeGame::TeamScoreWave += %points; + // + %client.waveScore += %points; +} + +function HordeGame::OnZombieDeath(%game, %killer, %victim) { + %ZT = %victim.type; + switch(%ZT) { + case 1: + %game.AwardGamePoints(%killer, 1); + case 2: + %game.AwardGamePoints(%killer, 3); + case 3: + %game.AwardGamePoints(%killer, 10); + case 4: + %game.AwardGamePoints(%killer, 5); + case 5: + %game.AwardGamePoints(%killer, 7); + case 6: + %game.AwardGamePoints(%killer, 40); + case 9: + %game.AwardGamePoints(%killer, 7); + case 10: + %game.AwardGamePoints(%killer, 15); + case 12: + %game.AwardGamePoints(%killer, 10); + case 13: + %game.AwardGamePoints(%killer, 20); + } + %game.UpdateClientScoreBar(); + // For the Wave Highlights. + %killer.waveKills++; + $HordeGame::TeamKillsWave++; + $HordeGame::TeamKills++; + if($HordeGame::TeamKillsWave == 1) { + if($HordeGame::Zombiecount <= 1) { + $HordeGame::TeamKillsWave = 0; + } + else { + CenterPrintAll("Wave Highlight \n"@%killer.namebase@" Scores the First Kill!" , 3, 3); + } + } +} + +function DoWaveHighlights() { + %wave = $HordeGame::CurrentWave - 1; + if(%wave != 0) { + MessageAll('MsgHighlights', "\c5Wave "@%wave@" Highlights"); + // + %highestScore = 0; + %highestKills = 0; + %highestScoreCL = -1; + %highestKills = -1; + // + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + MessageAll('MsgDumpScore', "\c3"@%cl.namebase@": "@%cl.waveScore@" Points with "@%cl.waveKills@" Kills."); + // + if(%cl.waveScore > %highestScore) { + %highestScore = %cl.waveScore; + %highestScoreCL = %cl; + } + // + if(%cl.waveKills > %highestKills) { + %highestKills = %cl.waveKills; + %highestKillsCL = %cl; + } + } + // + CenterPrintAll("Best Stats For Wave "@%wave@""@ + "\nHighest Scorer: "@%highestScoreCL.namebase@" with "@%highestScore@" Points"@ + "\nMost Kills: "@%highestKillsCL.namebase@" with "@%highestKills@" Kills", 5 ,3); + } +} + + + + + + + + + + + + + + + + + + + + + + + + + +// +function GenerateHordeChallengeMenu(%client, %tag, %index) { + if(%client.CheckNWChallengeCompletion("15For15")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "15 For 15 - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "15 For 15 - Complete Wave 15."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Milestone25")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Milestone 25 - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Milestone 25 - Complete Wave 25."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("ArmyOf50Stopped")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Army Of 50 Stopped - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Army Of 50 Stopped - Complete Horde (All 50 Waves)."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Angel")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Angel - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Angel - Revive a fallen teammate in Horde."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("ZBomber")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Z-Bomber - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Z-Bomber - Call in a Z-Bomb While Playing Horde."); + %index++; + } + // + return %index; +} + + + + + + + + + + + + + + + + + + + + + +function HordeGame::leaveMissionArea(%game, %playerData, %player) { + if(%player.getState() $= "Dead") + return; + if(%player.client.inKillstreak) //killstreaks give special perms for not being in mission area + return; + + %player.client.outOfBounds = true; + + + messageClient(%player.client, 'LeaveMissionArea', '\c1You left the mission area. Return or die...~wfx/misc/warning_beep.wav'); + %player.killSched = %player.schedule(5000, "ScriptKill", $DamageType::Admin); + %player.killMsg = schedule(5000, 0, 'MessageAll', 'msgAdminForce', "\c3COMMAND: "@%player.client.namebase@" has been killed for desertion!!!"); + +} + +function HordeGame::enterMissionArea(%game, %playerData, %player) { + if(%player.getState() $= "Dead") + return; + + cancel(%player.killSched); + cancel(%player.killMsg); + + %player.client.outOfBounds = false; + messageClient(%player.client, 'EnterMissionArea', '\c1You are back in the mission area.'); +} + + + diff --git a/scripts/HuntersGame.cs b/scripts/HuntersGame.cs new file mode 100644 index 0000000..62fc992 --- /dev/null +++ b/scripts/HuntersGame.cs @@ -0,0 +1,1615 @@ +//--------------------------------------// +// HuntersGame.cs // +//--------------------------------------// + +//--- GAME RULES BEGIN --- +//Kill other players to make them drop flags +//Return flags to the Nexus for points +//The more flags brought to Nexus at one time, the more each flag scores +//GREED mode: you must return 8 or more flags at once to score +//HOARD mode: no returns between 5 and 2 min. left in game +//Flag Colors: Red = 1pt, Blue = 2pts, Yellow = 4pts, Green = 8pts +//--- GAME RULES END --- + +package HuntersGame { + +function Nexus::objectiveInit(%data, %object) +{ + Game.Nexus = %object; + Game.Nexus.playThread(0, "ambient"); + Game.Nexus.setThreadDir(0, true); + //The flash animation plays forwards, then back automatically, so we have to alternate the thread direcction... + Game.Nexus.flashThreadDir = true; + +} + +function NexusBase::objectiveInit(%data, %object) +{ + Game.NexusBase = %object; + Game.NexusBase.playthread(0, "ambient"); + Game.NexusBase.setThreadDir(0, true); +} + +function NexusCap::objectiveInit(%data, %object) +{ + Game.NexusCap = %object; + Game.NexusCap.playthread(0, "ambient"); + Game.NexusCap.setThreadDir(0, true); +} + +}; + +$InvBanList[Hunters, "TurretOutdoorDeployable"] = 1; +$InvBanList[Hunters, "TurretIndoorDeployable"] = 1; +$InvBanList[Hunters, "ElfBarrelPack"] = 1; +$InvBanList[Hunters, "MortarBarrelPack"] = 1; +$InvBanList[Hunters, "PlasmaBarrelPack"] = 1; +$InvBanList[Hunters, "AABarrelPack"] = 1; +$InvBanList[Hunters, "MissileBarrelPack"] = 1; +$InvBanList[Hunters, "Mine"] = 1; + +datablock AudioProfile(HuntersFlagPickupSound) +{ + filename = "fx/misc/hunters_flag_snatch.wav"; + description = AudioClose3d; + preload = true; +}; + + +//exec the AI script +exec("scripts/aiHunters.cs"); + +//exec the records script +if (isFile("prefs/HuntersRecords.cs")) + exec("prefs/HuntersRecords.cs"); + +//----------------------------------------------------------------------------- +//Game initialization functions + +function HuntersGame::setUpTeams(%game) +{ + // Force the numTeams variable to one: + DefaultGame::setUpTeams(%game); + %game.numTeams = 1; + + // allow teams 1->31 to listen to each other (team 0 can only listen to self) + for(%i = 1; %i < 32; %i++) + setSensorGroupListenMask(%i, 0xfffffffe); +} + +function HuntersGame::initGameVars(%game) +{ + %game.SCORE_PER_SUICIDE = -1; + %game.SCORE_PER_DEATH = 0; + %game.SCORE_PER_KILL = 1; + + %game.teamMode = false; + + if (!isDemo()) + %game.greedMode = $Host::HuntersGreedMode; + else + %game.greedMode = false; + %game.greedMinFlags = 8; //min number of flags you must have before you can cap + + if (!isDemo()) + %game.hoardMode = $Host::HuntersHoardMode; + else + %game.hoardMode = false; + %game.HoardStartTime = 5; //time left in the game at which hoard mode will start + %game.HoardDuration = 3; //duration of the hoard period + %game.HoardEndTime = %game.HoardStartTime - %game.HoardDuration; + + %game.yardSaleMin = 10; + + //make sure there is enough time in the match to actually have a hoard mode... + if ($host::timeLimit < %game.hoardStartTime + 1) + %game.hoardMode = false; + + %game.maxSensorGroup = 0; + + %game.highestFlagReturnCount = 10; //initialize to 10 - don't bother recording less than that... + %game.highestFlagReturnName = ""; + %game.greedFlagCount = 10; //initialize to 10 - don't bother recording greed less than that... + %game.greedFlagName = ""; + + //this is how many humans have to be playing in order to set a record + %game.numHumansForRecord = 4; + + //this is how many milliseconds before a warning is issued for camping near the Nexus + %game.nexusCampingTime = 10000; + + %game.flagHoarder = ""; + %game.flagHoarderMin = 15; + + //vars for how long before the flag is deleted, and the fade transition time... + %game.flagLifeTimeMS = 120000; + %game.fadeTimeMS = 2000; + + %game.flagMsgDelayMS = 3000; + %game.oobThrowFlagsDelayMS = 3000; + + // targets for each of the flag types (except for base which is properly skinned already) + HuntersFlag1.target = -1; // red + HuntersFlag2.target = allocTarget("", 'Blue', "", "", 0, "", ""); + HuntersFlag4.target = allocTarget("", 'Yellow', "", "", 0, "", ""); + HuntersFlag8.target = allocTarget("", 'Green', "", "", 0, "", ""); +} + +function HuntersGame::allowsProtectedStatics(%game) +{ + return true; +} + +function HuntersGame::missionLoadDone(%game) +{ + //default version sets up teams - must be called first... + DefaultGame::missionLoadDone(%game); + + //initialize the score and flag count for all the players + %count = ClientGroup.getCount(); + for(%i = 0; %i < %count; %i++) + { + %client = ClientGroup.getObject(%i); + %game.resetScore(%client); + %client.flagCount = 1; + %client.trackWaypoint = ""; + %client.playerTrackLine = -1; + } + $TopClient = -1; + $TopClientScore = 0; + + //create the Flag group + $FlagGroup = nameToID("MissionCleanup/FlagGroup"); + if ($FlagGroup <= 0) + { + $FlagGroup = new SimGroup("FlagGroup"); + MissionCleanup.add($FlagGroup); + } + + //create the "yard sale waypoint set" + if(nameToId("HuntersYardSaleSet") <= 0) + { + $HuntersYardSaleSet = new SimSet("HuntersYardSaleSet"); + MissionCleanup.add($HuntersYardSaleSet); + } +} + + +function HuntersGame::startMatch(%game) +{ + //call the default + DefaultGame::startMatch(%game); + + //schedule the hoard countdowns + %game.setupHoardCountdown(); +} + +function HuntersGame::setupHoardCountdown(%game) +{ + //delete all previous scheduled calls... + cancel(%game.hoardStart30); + cancel(%game.hoardStart10); + cancel(%game.hoardStart5); + cancel(%game.hoardStart4); + cancel(%game.hoardStart3); + cancel(%game.hoardStart2); + cancel(%game.hoardStart1); + cancel(%game.hoardStart0); + + cancel(%game.hoardEnd30); + cancel(%game.hoardEnd10); + cancel(%game.hoardEnd5); + cancel(%game.hoardEnd4); + cancel(%game.hoardEnd3); + cancel(%game.hoardEnd2); + cancel(%game.hoardEnd1); + cancel(%game.hoardEnd0); + + //schedule hoard mode start notify calls + %curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime(); + %hoardStartTimeMS = %game.HoardStartTime * 60 * 1000; + + if (%curTimeLeftMS >= %hoardStartTimeMS + 30000) + %game.hoardStart30 = %game.schedule(%curTimeLeftMS - (%hoardStartTimeMS + 30000), "notifyHoardStart", 30); + + if (%curTimeLeftMS >= %hoardStartTimeMS + 10000) + %game.hoardStart10 = %game.schedule(%curTimeLeftMS - (%hoardStartTimeMS + 10000), "notifyHoardStart", 10); + + if (%curTimeLeftMS >= %hoardStartTimeMS + 5000) + %game.hoardStart5 = %game.schedule(%curTimeLeftMS - (%hoardStartTimeMS + 5000), "notifyHoardStart", 5); + + if (%curTimeLeftMS >= %hoardStartTimeMS + 4000) + %game.hoardStart4 = %game.schedule(%curTimeLeftMS - (%hoardStartTimeMS + 4000), "notifyHoardStart", 4); + + if (%curTimeLeftMS >= %hoardStartTimeMS + 3000) + %game.hoardStart3 = %game.schedule(%curTimeLeftMS - (%hoardStartTimeMS + 3000), "notifyHoardStart", 3); + + if (%curTimeLeftMS >= %hoardStartTimeMS + 2000) + %game.hoardStart2 = %game.schedule(%curTimeLeftMS - (%hoardStartTimeMS + 2000), "notifyHoardStart", 2); + + if (%curTimeLeftMS >= %hoardStartTimeMS + 1000) + %game.hoardStart1 = %game.schedule(%curTimeLeftMS - (%hoardStartTimeMS + 1000), "notifyHoardStart", 1); + + if (%curTimeLeftMS >= %hoardStartTimeMS) + %game.hoardStart0 = %game.schedule(%curTimeLeftMS - %hoardStartTimeMS, "notifyHoardStart", 0); + + + //schedule hoard mode end notify calls + %hoardEndTimeMS = %game.HoardEndTime * 60 * 1000; + + if (%curTimeLeftMS >= %hoardEndTimeMS + 30000) + %game.hoardEnd30 = %game.schedule(%curTimeLeftMS - (%hoardEndTimeMS + 30000), "notifyHoardEnd", 30); + + if (%curTimeLeftMS >= %hoardEndTimeMS + 10000) + %game.hoardEnd10 = %game.schedule(%curTimeLeftMS - (%hoardEndTimeMS + 10000), "notifyHoardEnd", 10); + + if (%curTimeLeftMS >= %hoardEndTimeMS + 5000) + %game.hoardEnd5 = %game.schedule(%curTimeLeftMS - (%hoardEndTimeMS + 5000), "notifyHoardEnd", 5); + + if (%curTimeLeftMS >= %hoardEndTimeMS + 4000) + %game.hoardEnd4 = %game.schedule(%curTimeLeftMS - (%hoardEndTimeMS + 4000), "notifyHoardEnd", 4); + + if (%curTimeLeftMS >= %hoardEndTimeMS + 3000) + %game.hoardEnd3 = %game.schedule(%curTimeLeftMS - (%hoardEndTimeMS + 3000), "notifyHoardEnd", 3); + + if (%curTimeLeftMS >= %hoardEndTimeMS + 2000) + %game.hoardEnd2 = %game.schedule(%curTimeLeftMS - (%hoardEndTimeMS + 2000), "notifyHoardEnd", 2); + + if (%curTimeLeftMS >= %hoardEndTimeMS + 1000) + %game.hoardEnd1 = %game.schedule(%curTimeLeftMS - (%hoardEndTimeMS + 1000), "notifyHoardEnd", 1); + + if (%curTimeLeftMS >= %hoardEndTimeMS) + %game.hoardEnd0 = %game.schedule(%curTimeLeftMS - %hoardEndTimeMS, "notifyHoardEnd", 0); +} + +function HuntersGame::notifyHoardStart(%game, %seconds) +{ + if (%game.HoardMode) + { + if (%seconds > 1) + messageAll('MsgHuntersHoardNotifyStart', '\c2%1 seconds left until the HOARD period begins.~wfx/misc/hunters_%1.wav', %seconds); + else if (%seconds == 1) + messageAll('MsgHuntersHoardNotifyStart', '\c21 second left until the HOARD period begins.~wfx/misc/hunters_1.wav'); + else + { + messageAll('MsgHuntHoardNotifyStarted', '\c2The HOARD period has begun.~wfx/misc/hunters_horde.wav'); + logEcho("hoard mode start"); + %game.setNexusDisabled(); + cancel(%game.greedNexusFlash); + } + } +} + +function HuntersGame::notifyHoardEnd(%game, %seconds) +{ + if (%game.HoardMode) + { + if (%seconds > 1) + messageAll('MsgHuntersHoardNotifyEnd', '\c2%1 seconds left until the HOARD period ends.~wfx/misc/hunters_%1.wav', %seconds); + else if (%seconds == 1) + messageAll('MsgHuntersHoardNotifyEnd', '\c21 second left until the HOARD period ends.~wfx/misc/hunters_1.wav'); + else + { + messageAll('MsgHuntersHoardNotifyEnded', '\c2The HOARD period has ended!~wfx/misc/hunters_greed.wav'); + logEcho("hoard mode end"); + %game.setNexusEnabled(); + cancel(%game.greedNexusFlash); + } + } +} + +function HuntersGame::clientJoinTeam( %game, %client, %team, %respawn ) +{ + %game.assignClientTeam( %client ); + + // Spawn the player: + %game.spawnPlayer( %client, %respawn ); +} + +//----------------------------------------------------------------------------- +//Player spawn/death functions + +function HuntersGame::assignClientTeam(%game, %client) +{ + %client.team = 0; + + //initialize the team array + for (%i = 1; %i < 32; %i++) + $HuntersTeamArray[%i] = false; + + %game.maxSensorGroup = 0; + %count = ClientGroup.getCount(); + for (%i = 0; %i < %count; %i++) + { + %cl = ClientGroup.getObject(%i); + if (%cl.team != 0) + $HuntersTeamArray[%cl.team] = true; + + //need to set the number of sensor groups to the max... + if (%cl.team > %game.maxSensorGroup) + %game.maxSensorGroup = %cl.team; + } + + //now loop through the team array, looking for an empty team + for (%i = 1; %i < 32; %i++) + { + if (! $HuntersTeamArray[%i]) + { + %client.team = %i; + + if (%client.team > %game.maxSensorGroup) + %game.maxSensorGroup = %client.team; + + break; + } + } + + // set player's skin pref here + setTargetSkin(%client.target, %client.skin); + + // Let everybody know you are no longer an observer: + messageAll( 'MsgClientJoinTeam', '\c1%1 has joined the hunt.', %client.name, "", %client, 1 ); + updateCanListenState( %client ); + + //now set the max number of sensor groups... + setSensorGroupCount(%game.maxSensorGroup + 1); +} + +function HuntersGame::createPlayer(%game, %client, %spawnLoc, %respawn) +{ + //first call the default + DefaultGame::createPlayer(%game, %client, %spawnLoc, %respawn); + + //now set the sensor group + %client.setSensorGroup(%client.team); +} + +function HuntersGame::pickPlayerSpawn(%game, %client, %respawn) +{ + return %game.pickTeamSpawn(1); +} + +function HuntersGame::playerSpawned(%game, %player, %armor) +{ + //intialize + %client = %player.client; + %client.flagCount = 1; + %client.isDead = false; + + //make sure they're not still taking camping damage... + cancel(%client.campingThread); + + + //continue with the default + DefaultGame::playerSpawned(%game, %player, %armor); +} + +function HuntersGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc) +{ + //set the flag + %clVictim.isDead = true; + + //set the greed variable if required + if (!%game.teamMode && $missionRunning) + { + if (%clVictim.flagCount - 1 > %game.greedFlagCount) + { + %game.greedFlagCount = %clVictim.flagCount - 1; + %game.greedFlagName = getTaggedString(%clVictim.name); + } + } + + //first, drop all the flags + HuntersGame::dropFlag(%game, %clVictim.player); + + //now call the default game stuff + DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc); + + messageClient(%clVictim, 'MsgHuntYouHaveFlags', "", 0); +} + +function HuntersGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) +{ + if (%game.testKill(%clVictim, %clKiller)) //verify victim was an enemy + { + %game.awardScoreKill(%clKiller); + %game.awardScoreDeath(%clVictim); + } + else if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide + %game.awardScoreSuicide(%clVictim); +} + +function Huntersgame::awardScoreKill(%game, %client) +{ + //call the default + DefaultGame::awardScoreKill(%game, %client); + + //check if we have a new leader + if (!%game.teamMode && (%client.score > $TopClientScore)) + { + $TopClientScore = %client.score; + //this message is annoying! + //if (%client != $TopClient) + // messageAll('MsgHuntNewTopScore', '\c0%1 has taken the lead with a score of %2!~wfx/misc/flag_capture.wav', %client.name, %client.score); + $TopClient = %client; + } +} + +function Huntersgame::awardScoreSuicide(%game, %client) +{ + //call the default + DefaultGame::awardScoreSuicide(%game, %client); + + //check if we have a new leader + if (!%game.teamMode && %client == $TopClient && (%client.score < $TopClientScore)) + { + //first lower the topClientScore var + $TopClientScore = %client.score; + + //see if there's a new leader... + %highestScore = %client.score; + %highestScoreClient = -1; + for (%i = 0; %i < ClientGroup.getCount(); %i++) + { + %cl = ClientGroup.getObject(%i); + if (%cl.score > %highestScore) + { + %highestScore = %cl.score; + %highestScoreClient = %cl; + } + } + + //did we find someone? + if (%highestScoreClient > 0) + { + $TopClientScore = %highestScoreClient.score; + $TopClient = %highestScoreClient; + //this message is annoying... + //messageAll('MsgHuntNewTopScore', '\c0%1 is now in the lead with a score of %2!~wfx/misc/flag_capture.wav', %highestScoreClient.name, %highestScoreClient.score); + } + } +} + +function HuntersGame::equip(%game, %player) +{ + for(%i =0; %i<$InventoryHudCount; %i++) + %player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1); + %player.client.clearBackpackIcon(); + + //%player.setArmor("Light"); + buyFavorites(%player.client); + %player.setInventory( Blaster, 1, true); + %player.use("Blaster"); +} + +//----------------------------------------------------------------------------- +//flag functions +function HuntersGame::playerDroppedFlag(%game, %player) +{ + // this stuff has all been moved to HuntersGame::dropFlag + // we really don't want something to happen for *every* flag a player drops anyway +} + +function HuntersStartFlagTimeOut(%flag) +{ + // start the fade out... + %flag.startFade(Game.fadeTimeMS, 0, true); + schedule(Game.fadeTimeMS, %flag, "HuntersEndFlagTimeOut", %flag); +} + +function HuntersEndFlagTimeOut(%flag) +{ + %flag.delete(); +} + +function HuntersYardSaleTimeOut(%waypoint) +{ + %waypoint.delete(); +} + +function HuntersGame::updateFlagHoarder(%game, %eventClient) +{ + %hoarder = -1; + %maxFlags = -1; + %count = ClientGroup.getCount(); + for (%i = 0; %i < %count; %i++) + { + %client = ClientGroup.getObject(%i); + if (%client.flagCount > %game.flagHoarderMin && %client.flagCount > %maxFlags) + { + %maxflags = %client.flagCount; + %hoarder = %client; + } + } + + //if we found our hoarder, set the waypoint, otherwise, delete it + if (%hoarder > 0) + { + //only update if the event (capping, picking up flag, etc...) was the actual hoarder + if (!isObject(%game.flagHoarder) || %game.flagHoarder == %eventClient) + { + if (!isObject(%game.hoarderWaypoint)) + { + //create a waypoint at player's location... + %game.hoarderWaypoint = new WayPoint() + { + position = %hoarder.player.position; + rotation = "1 0 0 0"; + scale = "1 1 1"; + name = "Flag Hoarder Was Here"; + dataBlock = "WayPointMarker"; + lockCount = "0"; + homingCount = "0"; + team = 0; + }; + + //add the waypoint to the cleanup group + MissionCleanup.add(%game.hoarderWaypoint); + } + + //set the position + %game.flagHoarder = %hoarder; + %game.hoarderWaypoint.setTransform(%hoarder.player.getWorldBoxCenter() SPC "0 0 1 0"); + } + } + else if (isObject(%game.hoarderWaypoint)) + { + %game.flaghoarder = ""; + %game.hoarderWaypoint.delete(); + } +} + +function HuntersGame::sendFlagCountMessage(%game, %client) +{ + //send the messages + if (%client.flagCount - 1 == 1) + { + messageAllExcept(%client, -1, 'MsgHuntPlayerHasFlags', '\c2%1 now has 1 flag.', %client.name, 1); + messageClient(%client, 'MsgHuntYouHaveFlags', '\c2You now have 1 flag.', %client.flagCount - 1); + } + else if (%client.flagCount - 1 > 1) + { + messageAllExcept(%client, -1, 'MsgHuntPlayerHasFlags', '\c2%1 now has %2 flags.', %client.name, %client.flagCount - 1); + messageClient(%client, 'MsgHuntYouHaveFlags', '\c2You now have %1 flags.', %client.flagCount - 1); + } +} + +function HuntersGame::playerTouchFlag(%game, %player, %flag) +{ + //make sure the player is still alive + %client = %player.client; + if (%player.getState() !$= "Dead") + { + //increase the count bye the flag value + %flagValue = %flag.value; + %client.flagCount += %flagValue; + + //delete the flag + %flag.delete(); + + //if the client has 5 or more flags, mount an image + if (%client.flagCount >= 5) + %player.mountImage(HuntersFlagImage, $FlagSlot); + + //schedule an update message + cancel(%client.flagMsgPending); + %client.flagMsgPending = %game.schedule(%game.flagMsgDelayMS, "sendFlagCountMessage", %client); + messageClient(%client, 'MsgHuntYouHaveFlags', "", %client.flagCount - 1); + + //update the log... + logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") has "@%client.flagCount-1@" flags"); + + //play the sound pickup in 3D + %player.playAudio(0, HuntersFlagPickupSound); + + //see if the client could set the record + if (!%game.teamMode && !%client.couldSetRecord) + { + %numFlags = %client.flagCount - 1; + if (%numFlags > 10 && %numFlags > $Host::HuntersRecords::Count[$currentMission]) + { + //see if we have at least 4 non-AI players + %humanCount = 0; + %count = ClientGroup.getCount(); + for (%i = 0; %i < %count; %i++) + { + %cl = ClientGroup.getObject(%i); + if (!%cl.isAIControlled()) + %humanCount++; + if (%humanCount >= %game.numHumansForRecord) + break; + } + + if (%humanCount >= %game.numHumansForRecord) + { + %client.couldSetRecord = true; + + //send a message right away... + if (isEventPending(%client.flagMsgPending)) + { + cancel(%client.flagMsgPending); + %game.sendFlagCountMessage(%client); + } + + //send a message to everyone + messageAllExcept(%client, -1, 'MsgHuntPlayerCouldSetRecord', '\c2%1 has enough flags to set the record for this mission!~wfx/misc/flag_return.wav'); + messageClient(%client, 'MsgHuntYouCouldSetRecord', '\c2You have enough flags to set the record for this mission!~wfx/misc/flag_return.wav'); + } + } + } + + //new tracking - *everyone* automatically tracks the "flag hoarder" if they have at least 15 flags + %game.updateFlagHoarder(%client); + } +} + +function HuntersGame::checkTimeLimit(%game) +{ + DefaultGame::checkTimeLimit(%game); + + //make sure the hoard counter is also up to date + %curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime(); + messageAll('MsgHuntHoardStatus', "", %game.HoardMode, $Host::TimeLimit, %curTimeLeftMS, %game.HoardStartTime, %game.HoardDuration); +} + +function HuntersGame::timeLimitReached(%game) +{ + logEcho("game over (timelimit)"); + %game.gameOver(); + cycleMissions(); +} + +function HuntersGame::scoreLimitReached(%game) +{ + //no such thing as a score limit in Hunters... +} + +function HuntersGame::gameOver(%game) +{ + //call the default + DefaultGame::gameOver(%game); + + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" ); + + messageAll('MsgClearObjHud', ""); + for(%i = 0; %i < ClientGroup.getCount(); %i ++) + { + %client = ClientGroup.getObject(%i); + Game.resetScore(%client); + cancel(%client.oobSched); + } +} + +function HuntersGame::checkScoreLimit(%game, %client) +{ + //no such thing as a score limit in Hunters... +} + +//----------------------------------------------------------------------------- +//Nexus functions + +function HuntersGame::setNexusDisabled(%game) +{ + //set the animations + Game.Nexus.playThread(1, "transition"); + Game.NexusCap.playthread(1, "transition"); + Game.NexusBase.playthread(1, "transition"); + Game.Nexus.setThreadDir(1, true); + Game.NexusCap.setThreadDir(1, true); + Game.NexusBase.setThreadDir(1, true); +} + +function HuntersGame::setNexusEnabled(%game) +{ + //set the animations + Game.Nexus.playThread(1, "transition"); + Game.NexusCap.playthread(1, "transition"); + Game.NexusBase.playthread(1, "transition"); + Game.Nexus.setThreadDir(1, false); + Game.NexusCap.setThreadDir(1, false); + Game.NexusBase.setThreadDir(1, false); +} + +function HuntersGame::flashNexus(%game) +{ + //set the animations + Game.Nexus.playThread(1, "flash"); + Game.NexusCap.playthread(1, "flash"); + Game.NexusBase.playthread(1, "flash"); + Game.Nexus.setThreadDir(1, Game.Nexus.flashThreadDir); + Game.NexusCap.setThreadDir(1, Game.Nexus.flashThreadDir); + Game.NexusBase.setThreadDir(1, Game.Nexus.flashThreadDir); + Game.Nexus.flashThreadDir = !Game.Nexus.flashThreadDir; +} + +function HuntersGame::NexusSparkEmitter(%game, %client, %cap, %numToScore) +{ + if (isObject(%client.nexusEmitter)) + %client.nexusEmitter.delete(); + + %client.nexusEmitter = new ParticleEmissionDummy() + { + //position = getWord(%client.player.position, 0) SPC getWord(%client.player.position, 1) SPC getWord(%client.player.position, 2) + 3; + position = (%cap ? Game.nexus.getWorldBoxCenter() : %client.player.getWorldBoxCenter()); + rotation = "1 0 0 0"; + scale = "1 1 1"; + dataBlock = defaultEmissionDummy; + emitter = (%cap ? NexusParticleCapEmitter : NexusParticleDeniedEmitter); + velocity = "1"; + }; + MissionCleanup.add(%client.nexusEmitter); + + //the effect should only last a few seconds + if (%cap) + { + %timeMS = (%numToScore < 10 ? 200 : %numToScore * 20); + %client.nexusEmitter.schedule(%timeMS, "delete"); + } + else + %client.nexusEmitter.schedule(200, "delete"); +} + +function HuntersGame::hoardModeActive(%game, %wouldBeActive) +{ + if (%wouldBeActive $= "") + %wouldBeActive = false; + + //see if hoard mode is on and active + if (%game.HoardMode || %wouldBeActive) + { + %missionEndTime = ($Host::TimeLimit * 60 * 1000) + $missionStartTime; + %timeLeftMS = %missionEndTime - getSimTime(); + + %hoardStartTime = %game.HoardStartTime * 60 * 1000; + %hoardEndTime = %hoardStartTime - (%game.HoardDuration * 60 * 1000); + if (%timeLeftMS <= %hoardStartTime && %timeLeftMS > %hoardEndTime) + return true; + } + return false; +} + +function Nexus::onCollision(%data, %obj, %colObj) +{ + //make sure it was a player that entered the trigger + if((%colObj.getDataBlock().className $= Armor) && (%colObj.getState() !$= "Dead")) + { + %player = %colObj; + %client = %player.client; + + // if player has been to the nexus within last 5 seconds, don't keep spamming messages + if((getSimTime() - %player.lastNexusTime) < 5000) + return; + + %player.lastNexusTime = getSimTime(); + + if(Game.hoardModeActive()) + { + messageClient(%client, 'MsgHuntHoardNoCap', '\c2Hoard mode is in effect! You cannot return any flags right now.~wfx/powered/nexus_deny.wav'); + + //apply a "bounce" impulse to the player + %velocity = %player.getVelocity(); + if (VectorDist("0 0 0", %velocity) < 2) + %velocityNorm = "0 20 0"; + else + %velocityNorm = VectorScale(VectorNormalize(%velocity), 20); + %vector = VectorScale(%velocityNorm, -200); + %player.applyImpulse(%player.position, %vector); + + Game.NexusSparkEmitter(%client, false); + return; + } + + // you can't cap your own flag + %numToScore = %client.flagCount - 1; + if (Game.greedMode && (%numToScore < Game.GreedMinFlags) && (%numToScore >= 1)) + { + messageClient(%client, 'MsgHuntNeedGreed', '\c2Greed mode is ON! You must have %1 flags before you can return them.~wfx/powered/nexus_deny.wav', Game.GreedMinFlags); + + //transition the Nexus to the "off" animation and back again + Game.flashNexus(); + + //apply a "bounce" impuse to the player + %velocity = %player.getVelocity(); + if (VectorDist("0 0 0", %velocity) < 2) + %velocityNorm = "0 20 0"; + else + %velocityNorm = VectorScale(VectorNormalize(%velocity), 20); + %vector = VectorScale(%velocityNorm, -200); + %player.applyImpulse(%player.position, %vector); + + Game.NexusSparkEmitter(%client, false); + return; + } + + //send the flags message right away... + if (isEventPending(%client.flagMsgPending)) + { + cancel(%client.flagMsgPending); + %game.sendFlagCountMessage(%client); + } + + //unless the nexus is very near the mission boundary, there should be no oobSched to cancel, but... + cancel(%client.oobSched); + + //score the flags + %totalScore = (%numToScore * (%numToScore + 1)) / 2; + if (Game.teamMode) + { + $teamScore[%client.team] += %totalScore; + logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") score "@%numToScore@" flags worth "@%totalScore@" pts for team "@%client.team); + messageAll('MsgTeamScoreIs', "", %client.team, $teamScore[%client.team]); + Game.recalcTeamRanks(%client.team); + } + else + { + %client.flagPoints += %totalScore; + logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") score "@%numToScore@" flags worth "@%totalScore@" pts"); + Game.recalcScore(%client); + + //see if we should set the highest for the mission here + if (%numToScore > Game.highestFlagReturnCount) + { + Game.highestFlagReturnCount = %numToScore; + Game.highestFlagReturnName = getTaggedString(%client.name); + } + } + + //reset the flags + %client.flagCount = 1; + %client.couldSetRecord = false; + %player.unMountImage($FlagSlot); + messageClient(%client, 'MsgHuntYouHaveFlags', "", 0); + + //see if it's the top score + if (!Game.teamMode && (%client.score > $TopClientScore)) + %topScore = true; + else + %topScore = false; + + //send the messages + if (%numToScore <= 0) + { + messageClient(%client, 'MsgHuntYouNeedHelp', '\c2Pick up flags and bring them here to score points.~wfx/misc/nexus_idle.wav'); + } + else if (%numToScore == 1) + { + if(Game.teamMode) + messageAllExcept(%client, -1, 'MsgHuntPlayerScored', '\c2%1 returned 1 flag (1 point) for %2.~wfx/misc/nexus_cap.wav', %client.name, $TeamName[%client.team], 1); + else + { + messageAllExcept(%client, -1, 'MsgHuntPlayerScored', '\c2%1 returned 1 flag for 1 point.~wfx/misc/nexus_cap.wav', %client.name, 1); + + //new tracking - *everyone* automatically tracks the "flag hoarder" if they have at least 15 flags + Game.updateFlagHoarder(%client); + } + + //add the nexus effect + Game.NexusSparkEmitter(%client, true, %numToScore); + + messageClient(%client, 'MsgHuntYouScored', '\c2You returned 1 flag for 1 point.~wfx/misc/nexus_cap.wav', 1); + } + else if (%numToScore < 5) + { + if(Game.teamMode) + messageAllExcept(%client, -1, 'MsgHuntPlayerScored', '\c2%1 returned %2 flags (%3 points) for %4.~wfx/misc/nexus_cap.wav', %client.name, %numToScore, %totalScore, $TeamName[%client.team]); + else + { + messageAllExcept(%client, -1, 'MsgHuntPlayerScored', '\c2%1 returned %2 flags for %3 points.~wfx/misc/nexus_cap.wav', %client.name, %numToScore, %totalScore); + + //new tracking - *everyone* automatically tracks the "flag hoarder" if they have at least 15 flags + Game.updateFlagHoarder(%client); + } + + //add the nexus effect + Game.NexusSparkEmitter(%client, true, %numToScore); + + messageClient(%client, 'MsgHuntYouScored', '\c2You returned %1 flags for %2 points.~wfx/misc/nexus_cap.wav', %numToScore, %totalScore); + } + else + { + if(Game.teamMode) + messageAllExcept(%client, -1, 'MsgHuntPlayerScored', '\c2%1 returned %2 flags (%3 points) for %4.~wfx/misc/nexus_cap.wav', %client.name, %numToScore, %totalScore, $TeamName[%client.team]); + else + { + messageAllExcept(%client, -1, 'MsgHuntPlayerScored', '\c2%1 returned %2 flags for %3 points.~wfx/misc/nexus_cap.wav', %client.name, %numToScore, %totalScore); + + //new tracking - *everyone* automatically tracks the "flag hoarder" if they have at least 15 flags + Game.updateFlagHoarder(%client); + } + + //add the nexus effect + Game.NexusSparkEmitter(%client, true, %numToScore); + + messageClient(%client, 'MsgHuntYouScored', '\c2You returned %1 flags for %2 points.~wfx/misc/nexus_cap.wav', %numToScore, %totalScore); + } + + //see if it's the top score + if (%topScore) + { + $TopClientScore = %client.score; + if (%client == $TopClient) + { + if (%numToScore >= 5) + messageAll('MsgHuntTopScore', '\c0%1 is leading with a score of %2!~wfx/misc/flag_capture.wav', %client.name, %client.score); + else + messageAll('MsgHuntTopScore', '\c0%1 is leading with a score of %2!', %client.name, %client.score); + } + else + messageAll('MsgHuntNewTopScore', '\c0%1 has taken the lead with a score of %2!~wfx/misc/flag_capture.wav', %client.name, %client.score); + $TopClient = %client; + } + + //see if it's a record + if (%numToScore > 10 && %numToScore > $Host::HuntersRecords::Count[$currentMission]) + { + //see if we have at least 4 non-AI players + %humanCount = 0; + %count = ClientGroup.getCount(); + for (%i = 0; %i < %count; %i++) + { + %cl = ClientGroup.getObject(%i); + if (!%cl.isAIControlled()) + %humanCount++; + if (%humanCount >= Game.numHumansForRecord) + break; + } + + if (%humanCount >= Game.numHumansForRecord) + { + $Host::HuntersRecords::Count[$currentMission] = %numToScore; + $Host::HuntersRecords::Name[$currentMission] = getTaggedString(%client.name); + + //send a message to everyone + messageAllExcept(%client, -1, 'MsgHuntPlayerSetRecord', '\c2%1 set the record for this mission with a return of %2 flags!~wfx/misc/flag_return.wav', %client.name, %numToScore); + messageClient(%client, 'MsgHuntYouSetRecord', '\c2You set the record for this mission with a return of %1 flags!~wfx/misc/flag_return.wav', %numToScore); + + //update the records file... + export( "$Host::HuntersRecords::*", "prefs/HuntersRecords.cs", false ); + + //once the record has been set, reset everyone's tag + for (%i = 0; %i < %count; %i++) + { + %cl = ClientGroup.getObject(%count); + %cl.couldSetRecord = false; + } + } + } + + if(Game.teamMode) + Game.checkScoreLimit(%team); + else + Game.checkScoreLimit(%client); + } +} + +function HuntersGame::clientMissionDropReady(%game, %client) +{ + //%client.rank = ClientGroup.getCount(); + messageClient(%client, 'MsgClientReady',"", %game.class); + //messageClient(%client, 'MsgHuntGreedStatus', "", %game.greedMode, %game.GreedMinFlags); + //%curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime(); + //messageClient(%client, 'MsgHuntHoardStatus', "", %game.HoardMode, $Host::TimeLimit, %curTimeLeftMS, %game.HoardStartTime, %game.HoardDuration); + messageClient(%client, 'MsgHuntYouHaveFlags', "", 0); + messageClient(%client, 'MsgYourScoreIs', "", 0); + // MES function below does not exist + //%game.populateRankArray(%client); + //messageClient(%client, 'MsgYourRankIs', "", -1); + + messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); + + DefaultGame::clientMissionDropReady(%game, %client); +} + +function HuntersGame::AIHasJoined(%game, %client) +{ + //let everyone know the player has joined the game + //messageAllExcept(%client, -1, 'MsgClientJoin', '%1 joined the game.', %client.name, "", %client, 1); +} + +function HuntersGame::resetScore(%game, %client) +{ + %client.score = 0; + %client.suicides = 0; + %client.kills = 0; + %client.teamKills = 0; + %client.deaths = 0; + %client.flagPoints = 0; +} + +function HuntersGame::recalcScore(%game, %cl) +{ + if (%cl <= 0) + return; + + %killValue = %cl.kills * %game.SCORE_PER_KILL; + %deathValue = %cl.deaths * %game.SCORE_PER_DEATH; + + if (%killValue - %deathValue == 0) + %killPoints = 0; + else + %killPoints = (%killValue * %killValue) / (%killValue - %deathValue); + + %cl.score = %killPoints; + %cl.score += %cl.flagPoints; + %cl.score += %cl.suicides * %game.SCORE_PER_SUICIDE; + //%cl.score = mFloatLength(%cl.score, 1); + %cl.score = mFloor(%cl.score); + + //must send the message to update the HUD + messageClient(%cl, 'MsgYourScoreIs', "", %cl.score); + + %game.recalcTeamRanks(%cl); +} + +function HuntersGame::sendGameVoteMenu( %game, %client, %key ) +{ + // Don't send any options if a vote is already running: + if ( %game.scheduleVote $= "" ) + { + // First send the common options: + DefaultGame::sendGameVoteMenu( %game, %client, %key ); + + if (!isDemo()) + { + if(!%client.isAdmin) + { + // Now send the Hunters-specific options: + if ( %game.greedMode ) + messageClient( %client, 'MsgVoteItem', "", %key, 'VoteGreedMode', 'disable greed mode', 'Vote Disable GREED Mode' ); + else + messageClient( %client, 'MsgVoteItem', "", %key, 'VoteGreedMode', 'enable greed mode', 'Vote Enable GREED Mode' ); + + if ( %game.HoardMode ) + messageClient( %client, 'MsgVoteItem', "", %key, 'VoteHoardMode', 'disable hoard mode', 'Vote Disable HOARD Mode' ); + else + messageClient( %client, 'MsgVoteItem', "", %key, 'VoteHoardMode', 'enable hoard mode', 'Vote Enable HOARD Mode' ); + } + else + { + if ( %game.greedMode ) + messageClient( %client, 'MsgVoteItem', "", %key, 'VoteGreedMode', 'disable greed mode', 'Disable GREED Mode' ); + else + messageClient( %client, 'MsgVoteItem', "", %key, 'VoteGreedMode', 'enable greed mode', 'Enable GREED Mode' ); + + if ( %game.HoardMode ) + messageClient( %client, 'MsgVoteItem', "", %key, 'VoteHoardMode', 'disable hoard mode', 'Disable HOARD Mode' ); + else + messageClient( %client, 'MsgVoteItem', "", %key, 'VoteHoardMode', 'enable hoard mode', 'Enable HOARD Mode' ); + } + } + } +} + +function HuntersGame::voteGreedMode( %game, %admin, %player ) +{ + %cause = ""; + %setto = ""; + if ( %admin ) + { + if ( %game.greedMode ) + { + messageAll( 'AdminDisableGreedMode', '\c2The Admin has disabled GREED mode.~wfx/misc/hunters_greed.wav' ); + %game.greedMode = false; + %setto = "disabled"; + } + else + { + messageAll( 'AdminEnableGreedMode', '\c2The Admin has enabled GREED mode.~wfx/misc/hunters_greed.wav' ); + %game.greedMode = true; + %setto = "enabled"; + } + %cause = "(admin)"; + } + else + { + %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; + if ( %totalVotes > 0 && ( %game.totalVotesFor / %totalVotes ) > 0.7 ) + { + if ( %game.greedMode ) + { + messageAll( 'MsgVotePassed', '\c2GREED mode was disabled by vote.~wfx/misc/hunters_greed.wav' ); + %game.greedMode = false; + %setto = "disabled"; + } + else + { + messageAll( 'MsgVotePassed', '\c2GREED mode was enabled by vote.~wfx/misc/hunters_greed.wav' ); + %game.greedMode = true; + %setto = "enabled"; + } + %cause = "(vote)"; +// alxPlay(VotePassSound, 0, 0, 0); + } + else + { + if ( %game.greedMode ) + messageAll( 'MsgVoteFailed', '\c2Disable GREED mode vote did not pass, %1 to %2.', %game.totalVotesFor, %game.totalVotesAgainst ); + else + messageAll( 'MsgVoteFailed', '\c2Enable GREED mode vote did not pass, %1 to %2.', %game.totalVotesFor, %game.totalVotesAgainst ); +// alxPlay(VoteNotPassSound, 0, 0, 0); + } + } + + //send the global message + messageAll('MsgHuntGreedStatus', "", %game.greedMode, %game.GreedMinFlags); + if(%setto !$= "") + logEcho("greed mode "@%setto SPC %cause); + + //store the result + if (%game.teamMode) + $Host::TeamHuntersGreedMode = %game.greedMode; + else + $Host::HuntersGreedMode = %game.greedMode; +} + +function HuntersGame::voteHoardMode( %game, %admin, %player ) +{ + %cause = ""; + %setto = ""; + + if ( %admin ) + { + if ( %game.HoardMode ) + { + messageAll( 'AdminDisableHoardMode', '\c2The Admin has disabled HOARD mode.' ); + %game.HoardMode = false; + %setto = "disabled"; + } + else + { + messageAll( 'AdminEnableHoardMode', '\c2The Admin has enabled HOARD mode.' ); + %game.HoardMode = true; + %setto = "enabled"; + } + %cause = "(admin)"; + } + else + { + %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; + if ( %totalVotes > 0 && ( %game.totalVotesFor / %totalVotes ) > 0.7 ) + { + if ( %game.HoardMode ) + { + messageAll( 'MsgVotePassed', '\c2HOARD mode was disabled by vote.' ); + %game.HoardMode = false; + %setto = "disabled"; + } + else + { + messageAll( 'MsgVotePassed', '\c2HOARD mode was enabled by vote.' ); + %game.HoardMode = true; + %setto = "enabled"; + } + %cause = "(vote)"; +// alxPlay(VotePassSound, 0, 0, 0); + } + else + { + if ( %game.HoardMode ) + messageAll( 'MsgVoteFailed', '\c2Disable HOARD mode vote did not pass, %1 to %2.', %game.totalVotesFor, %game.totalVotesAgainst ); + else + messageAll( 'MsgVoteFailed', '\c2Enable HOARD mode vote did not pass, %1 to %2.', %game.totalVotesFor, %game.totalVotesAgainst ); +// alxPlay(VoteNotPassSound, 0, 0, 0); + } + } + + //send the global message + %curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime(); + messageAll('MsgHuntHoardStatus', "", %game.HoardMode, $Host::TimeLimit, %curTimeLeftMS, %game.HoardStartTime, %game.HoardDuration); + if(%setto !$= "") + logEcho("hoard mode "@%setto SPC %cause); + + //store the result + if (%game.teamMode) + $Host::TeamHuntersHoardMode = %game.HoardMode; + else + $Host::HuntersHoardMode = %game.HoardMode; +} + +function HuntersGame::voteChangeTimeLimit( %game, %admin, %newLimit ) +{ + %oldTimeLimit = $Host::TimeLimit; + DefaultGame::voteChangeTimeLimit(%game, %admin, %newLimit); + + //if the time limit changed, this will affect hoard mode: + if ($Host::TimeLimit != %oldTimeLimit) + { + %game.setupHoardCountdown(); + } +} + +function createDroppedFlag(%data, %value, %player, %game) +{ + %client = %player.client; + %playerPos = %player.getWorldBoxCenter(); + + // create a flag and throw it + %droppedflag = new Item() { + position = %playerPos; + rotation = "0 0 1 " @ (getRandom() * 360); + scale = "1 1 1"; + dataBlock = %data; + collideable = "0"; + static = "0"; + rotate = "0"; + team = "0"; + }; + $FlagGroup.add(%droppedflag); + %droppedFlag.value = %value; + + // set the flags target (for proper skin) + %droppedFlag.setTarget(%data.target); + + //throw the flag randomly away from the body + if (%client.isDead) + { + %vec = (-1.0 + getRandom() * 2.0) SPC (-1.0 + getRandom() * 2.0) SPC getRandom(); + %vec = VectorScale(%vec, 1000 + (getRandom() * 500)); + + // Add player's velocity + %vec = vectorAdd(%vec, %player.getVelocity()); + } + + //else if the player is Out of bounds, throw them in the direction of the nexus + else if (%client.outOfBounds) + { + %towardsNexusVec = VectorSub(%game.nexus.position, %player.position); + %towardsNexusVec = getWord(%towardsNexusVec, 0) SPC getWord(%towardsNexusVec, 1) SPC "0"; + %towardsNexusVec = VectorNormalize(%towardsNexusVec); + + //add a little noise + %vec = getWord(%towardsNexusVec, 0) + (-0.3 + getRandom() * 0.6) SPC + getWord(%towardsNexusVec, 1) + (-0.3 + getRandom() * 0.6) SPC + getWord(%towardsNexusVec, 2); + %vec = VectorScale(%vec, 1000 + (getRandom() * 500)); + } + + //else throw them more or less in the direction the player was facing... + else + { + %playerFacingVec = MatrixMulVector("0 0 0 " @ getWords(%client.player.getTransform(), 3, 6), "0 1 0"); + %playerFacingVec = VectorNormalize(%playerFacingVec); + + //add a little noise + %vec = getWord(%playerFacingVec, 0) + (-0.3 + getRandom() * 0.6) SPC + getWord(%playerFacingVec, 1) + (-0.3 + getRandom() * 0.6) SPC + getWord(%playerFacingVec, 2); + %vec = VectorScale(%vec, 1000 + (getRandom() * 500)); + + // Add player's velocity + %vec = vectorAdd(%vec, %player.getVelocity()); + } + + %droppedflag.applyImpulse(%playerPos, %vec); + %droppedflag.setCollisionTimeout(%player); + schedule(%game.flagLifeTimeMS, %droppedflag, "HuntersStartFlagTimeOut", %droppedflag); +} + +function HuntersGame::throwFlags(%game, %player) +{ + %client = %player.client; + + //find out how many flags to drop + if (%client.isDead) + %numFlags = %client.flagCount; + else + %numFlags = %client.flagCount - 1; + + if (%numFlags <= 0) + return; + //send the flags message right away... + if (isEventPending(%client.flagMsgPending)) + { + cancel(%client.flagMsgPending); + %game.sendFlagCountMessage(%client); + } + + %numFlagsToDrop = %numFlags; + + //reset the count (which doesn't matter if player is dead) + %client.flagCount = 1; + %client.couldSetRecord = false; + + //drop the flags + %flagIncrement = 1; + %db[1] = HuntersFlag1; + %db[2] = HuntersFlag2; + %db[4] = HuntersFlag4; + %db[8] = HuntersFlag8; + + %i = 0; + while (%i < %numFlagsToDrop) + { + for (%j = 0; %j < 5; %j++) + { + %numFlagsLeft = %numFlagsToDrop - %i; + if (%numFlagsLeft >= %flagIncrement) + { + createDroppedFlag(%db[%flagIncrement], %flagIncrement, %player, %game); + %i += %flagIncrement; + } + else + { + // cleanup + if (%numFlagsLeft >= 8) + { + createDroppedFlag(%db[8], 8, %player, %game); + %i += 8; + %numFlagsLeft -= 8; + } + if (%numFlagsLeft >= 4) + { + createDroppedFlag(%db[4], 4, %player, %game); + %i += 4; + %numFlagsLeft -= 4; + } + if (%numFlagsLeft >= 2) + { + createDroppedFlag(%db[2], 2, %player, %game); + %i += 2; + %numFlagsLeft -= 2; + } + if (%numFlagsLeft >= 1) + { + createDroppedFlag(%db[1], 1, %player, %game); + %i += 1; + %numFlagsLeft -= 1; + } + + if (%i != %numFlagsToDrop || %numFlagsLeft != 0) + { + error("Error, missing a flag!"); + } + break; + } + } + + if (%flagIncrement < 8) + %flagIncrement = %flagIncrement * 2; + } + + //yard sale! + if (%numFlags >= 10 && %numFlags <= 24) { + messageAll('MsgHuntYardSale', '\c2YARD SALE!!!~wfx/misc/yardsale.wav'); + + //create a waypoint at player's location... + %yardWaypoint = new WayPoint() + { + position = %player.position; + rotation = "1 0 0 0"; + scale = "1 1 1"; + name = "YARD SALE!"; + dataBlock = "WayPointMarker"; + lockCount = "0"; + homingCount = "0"; + team = "0"; + }; + MissionCleanup.add(%yardWaypoint); + $HuntersYardSaleSet.add(%yardWaypoint); + schedule(30000, %yardWaypoint, "HuntersYardSaleTimeOut", %yardWaypoint); + } + else if (%numFlags >= 25 && %numFlags <= 49) { + messageAll('MsgHuntYardSale', '\c2SUPER YARD SALE!!!~wfx/misc/yardsale.wav'); + + //create a waypoint at player's location... + %yardWaypoint = new WayPoint() + { + position = %player.position; + rotation = "1 0 0 0"; + scale = "1 1 1"; + name = "SUPER YARD SALE!"; + dataBlock = "WayPointMarker"; + lockCount = "0"; + homingCount = "0"; + team = "0"; + }; + + //add the waypoint to the cleanup group + MissionCleanup.add(%yardWaypoint); + $HuntersYardSaleSet.add(%yardWaypoint); + schedule(30000, %yardWaypoint, "HuntersYardSaleTimeOut", %yardWaypoint); + } + else if (%numFlags >= 50) { + messageAll('MsgHuntYardSale', '\c2FLAG CLEARANCE SALE!!!~wfx/misc/yardsale.wav'); + + //create a waypoint at player's location... + %yardWaypoint = new WayPoint() + { + position = %player.position; + rotation = "1 0 0 0"; + scale = "1 1 1"; + name = "FLAG CLEARANCE SALE!"; + dataBlock = "WayPointMarker"; + lockCount = "0"; + homingCount = "0"; + team = "0"; + }; + MissionCleanup.add(%yardWaypoint); + $HuntersYardSaleSet.add(%yardWaypoint); + schedule(30000, %yardWaypoint, "HuntersYardSaleTimeOut", %yardWaypoint); + } + //remove any mounted flag from the player + %player.unMountImage($FlagSlot); + + //update the client's hud + messageClient(%client, 'MsgHuntYouHaveFlags', "", 0); + + //new tracking - *everyone* automatically tracks the "flag hoarder" if they have at least 15 flags + %game.updateFlagHoarder(%client); +} + +function HuntersGame::dropFlag(%game, %player) +{ + //first throw the flags + %game.throwFlags(%player); + + //send the messages + if (%numFlags == 1) + { + messageAllExcept(%client, -1, 'MsgHuntPlayerDroppedFlags', '\c0%1 dropped 1 flag.', %client.name, 1); + messageClient(%client, 'MsgHuntYouDroppedFlags', '\c0You dropped 1 flag.', 1); + } + else if (%numFlags > 1) + { + messageAllExcept(%client, -1, 'MsgHuntPlayerDroppedFlags', '\c0%1 dropped %2 flags.', %client.name, %numFlags); + messageClient(%client, 'MsgHuntYouDroppedFlags', '\c0You dropped %1 flags.', %numFlags); + } + logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") dropped "@%numFlags@" flags"); +} + +function HuntersGame::enterMissionArea(%game, %playerData, %player) +{ + if(%player.getState() $= "Dead") + return; + + %client = %player.client; + %client.outOfBounds = false; + cancel(%client.oobSched); + messageClient(%player.client, 'MsgEnterMissionArea', '\c1You are back in the mission area.'); + logEcho(%player.client.nameBase@" (pl "@%player@"/cl "@%player.client@") entered mission area"); + cancel(%player.alertThread); +} + +function HuntersGame::leaveMissionArea(%game, %playerData, %player) +{ + if(%player.getState() $= "Dead") + return; + + // strip flags and throw them back into the mission area + %client = %player.client; + %client.outOfBounds = true; + if (%player.client.flagCount > 1) + messageClient(%player.client, 'MsgLeaveMissionArea', '\c1You have left the mission area and will lose your flags!~wfx/misc/warning_beep.wav'); + else + messageClient(%player.client, 'MsgLeaveMissionArea', '\c1You have left the mission area.~wfx/misc/warning_beep.wav'); + + %client.oobSched = %game.schedule(%game.oobThrowFlagsDelayMS, "outOfBoundsThrowFlags", %client); + logEcho(%player.client.nameBase@" (pl "@%player@"/cl "@%player.client@") left mission area"); +} + +function HuntersGame::outOfBoundsThrowFlags(%game, %client) +{ + %player = %client.player; + if (!%client.outOfBounds) + return; + + if (%client.flagCount > 1) + { + %game.throwFlags(%player); + messageClient(%player.client, 'MsgLeaveMissionArea', '\c1You are out of the mission area and have lost your flags!~wfx/misc/flag_taken.wav'); + } + + //set the next schedule check + %client.oobSched = %game.schedule(%game.oobThrowFlagsDelayMS, "outOfBoundsThrowFlags", %client); +} + +function HuntersGame::onEnterTrigger(%game, %triggerName, %data, %obj, %colobj) +{ + //schedule a warning in 10 seconds + %client = %colobj.client; + %client.campingThread = %game.schedule(game.nexusCampingTime, "CampingDamage", %client, true); +} + +function HuntersGame::onLeaveTrigger(%game, %triggerName, %data, %obj, %colobj) +{ + %client = %colobj.client; + cancel(%client.campingThread); +} + +function HuntersGame::CampingDamage(%game, %client, %firstWarning) +{ + //make sure we're still alive... + %player = %client.player; + if (!isObject(%player) || %player.getState() $= "Dead") + return; + + //if the match hasn't yet started, don't warn or apply damage yet... + if (!$MatchStarted) + { + %client.campingThread = %game.schedule(game.nexusCampingTime / 2, "CampingDamage", %client, true); + } + else if (%firstWarning) + { + messageClient(%client, 'MsgHuntersNoCampZone', '\c2No camping near the Nexus.', 1); + %client.campingThread = %game.schedule(game.nexusCampingTime / 2, "CampingDamage", %client, false); + } + else + { + %player.setDamageFlash(0.1); + %player.damage(0, %player.position, 0.05, $DamageType::NexusCamping); + %client.campingThread = %game.schedule(1000, "CampingDamage", %client, false); + } + +} + +function HuntersGame::updateScoreHud(%game, %client, %tag) { +$TheGame = %game; +if (%client.SCMPage $= "") %client.SCMPage = 1; +if (%client.SCMPage $= "SM") return; +$TagToUseForScoreMenu = %tag; +messageClient( %client, 'ClearHud', "", %tag, 0 ); +messageClient( %client, 'SetScoreHudHeader', "", "" ); +messageClient( %client, 'SetScoreHudHeader', "", "CommandsClose" ); +messageClient( %client, 'SetScoreHudSubheader', "", "Main Menu" ); +scoreCmdMainMenu(%game,%client,%tag,%client.SCMPage); +} + +function HuntersGame::sendDebriefing( %game, %client ) +{ + // Mission result: + if ( $TeamRank[0, 0].score > 0 ) + messageClient( %client, 'MsgDebriefResult', "", '%1 wins with a score of %2!', $TeamRank[0, 0].name, $TeamRank[0, 0].score ); + else + messageClient( %client, 'MsgDebriefResult', "", 'Nobody wins!' ); + + + if ( %game.highestFlagReturnName !$= "" ) + messageClient( %client, 'MsgDebriefResult', "", '%1 had the highest return count with %2 flags!', %game.highestFlagReturnName, %game.highestFlagReturnCount ); + + if ( $Host::HuntersRecords::Count[$currentMission] !$= "" && $Host::HuntersRecords::Name[$currentMission] !$= "" ) + messageClient( %client, 'MsgDebriefResult', "", '%1 holds the record with a return count of %2 flags!', $Host::HuntersRecords::Name[$currentMission], $Host::HuntersRecords::Count[$currentMission] ); + + if ( %game.greedFlagName !$= "" ) + messageClient( %client, 'MsgDebriefResult', "", '%1 gets the honorary greed award for dropping %2 flags!', %game.greedFlagName, %game.greedFlagCount ); + + // Player scores: + messageClient( %client, 'MsgDebriefAddLine', "", 'PLAYERSCOREKILLS' ); + %count = $TeamRank[0, count]; + for ( %i = 0; %i < %count; %i++ ) + { + %cl = $TeamRank[0, %i]; + if ( %cl.score $= "" ) + %score = 0; + else + %score = %cl.score; + if ( %cl.kills $= "" ) + %kills = 0; + else + %kills = %cl.kills; + messageClient( %client, 'MsgDebriefAddLine', "", ' %1 %2 %3', %cl.name, %score, %kills ); + } + + // Show observers: + %count = ClientGroup.getCount(); + %header = false; + for ( %i = 0; %i < %count; %i++ ) + { + %cl = ClientGroup.getObject( %i ); + if ( %cl.team <= 0 ) + { + if ( !%header ) + { + messageClient( %client, 'MsgDebriefAddLine', "", '\nOBSERVERSSCORE' ); + %header = true; + } + + %score = %cl.score $= "" ? 0 : %cl.score; + messageClient( %client, 'MsgDebriefAddLine', "", ' %1 %2', %cl.name, %score ); + } + } +} + +function HuntersGame::applyConcussion(%game, %player) +{ + //%game.dropFlag( %player ); +} diff --git a/scripts/InfectionGame.cs b/scripts/InfectionGame.cs new file mode 100644 index 0000000..28080e8 --- /dev/null +++ b/scripts/InfectionGame.cs @@ -0,0 +1,649 @@ +// DisplayName = TWM Infection + +//--- GAME RULES BEGIN --- +// Humans vs. Zombies +// 15 Seconds into the Game, A Human becomes a zombie +// The Zombie Tries To Infect all the humans +// Humans Killed By The Zombie, Become Zombies +// Zombies Can Choose What Zombie To Use (Normal, Demon, Lord) +//--- GAME RULES END --- + +$InvBanList[Infection, "GrappleHook"] = 1; + +$InfectionGame::Min2Alphas = 7; +$InfectionGame::Min3Alphas = 10; +$InfectionGame::Rounds = 5; + +// spam fix +function InfectionGame::AIInit(%game) { + //call the default AIInit() function + AIInit(); +} + +function InfectionGame::allowsProtectedStatics(%game) { + return true; +} + +function InfectionGame::pickTeamSpawn(%game, %team) { + %pos = vectorAdd($InfectionGame::SpawnLocation[$CurrentMission], GetRandomPosition(5,1)); + %pos = vectorAdd(%pos,"0 0 5"); + return %pos; +} + + +function InfectionGame::clientMissionDropReady(%game, %client) { + $InfectionGame::Score[%client] = 0; + $InfectionGame::ClientZombie[%client] = "Norm"; + messageClient(%client, 'MsgClientReady',"", "SinglePlayerGame"); + DefaultGame::clientMissionDropReady(%game, %client); +} + +function InfectionGame::onAIRespawn(%game, %client) +{ + //add the default task + if (! %client.defaultTasksAdded) + { + %client.defaultTasksAdded = true; + %client.addTask(AIPickupItemTask); + %client.addTask(AIUseInventoryTask); + %client.addTask(AITauntCorpseTask); + %client.addTask(AIEngageTurretTask); + %client.addTask(AIDetectMineTask); + %client.addTask(AIBountyPatrolTask); + %client.bountyTask = %client.addTask(AIBountyEngageTask); + } + + //set the inv flag + %client.spawnUseInv = true; +} + +function InfectionGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) { + if (%game.testKill(%clVictim, %clKiller)) { //verify victim was an enemy + %game.awardScoreKill(%clKiller); + %game.awardScoreDeath(%clVictim); + } + else if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide + %game.awardScoreSuicide(%clVictim); +} + +function InfectionGame::timeLimitReached(%game) { + logEcho("game over (timelimit)"); + %game.gameOver(); + cycleMissions(); +} + +function InfectionGame::scoreLimitReached(%game) { + logEcho("game over (scorelimit)"); + %game.gameOver(); + cycleMissions(); +} + +function InfectionGame::startMatch(%game) { + activatePackage(InfectionGamePackage); + $TWM::PlayingInfection = 1; + $TWM::TeamWars = 1; + $Host::RankSystem = 0; + $InfectionGame::TimeTilInfect = 15; + $InfectionGame::RoundNumber = 1; + $InfectionGame::ZombieTier = 1; + $InfectionGame::Intermit = 1; + + $InfectionGame::NoRespawning = 0; + messageAll('MsgSPCurrentObjective1', "Selecting Alpha Zombie"); + messageAll('MsgSPCurrentObjective2', "Alpha Zombie Selected In: "@$InfectionGame::TimeTilInfect@" Seconds."); + %game.StartTimeUntilInfect($InfectionGame::TimeTilInfect); + DefaultGame::StartMatch(%game); + Game.NumTeams = 1; + //Disable Killstreaks and Perks + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %client = ClientGroup.getObject(%i); + DisableAllPerkGroup(%client, 1); + DisableAllPerkGroup(%client, 2); + DisableAllPerkGroup(%client, 3); + %client.DisableAllKillstreaks(); + messageClient(%client, 'msgOffline', "\c5INFECTION: All Killstreaks and Perks Disabled."); + } +} + +function InfectionGame::TryInfectAnother(%game) { + %selected = ClientGroup.getObject(GetRandom()*ClientGroup.getCount()); + if($InfectionGame::IsAlpha[%selected] || %selected.team == 0) { + //do not pick observers or already infected + return %game.TryInfectAnother(); + } + return %selected; +} + +function InfectionGame::StartTimeUntilInfect(%game, %time) { + %time--; + if(%time <= 0) { + if (ClientGroup.getCount() <= 1) { + MessageAll('MsgError',"\c5Insufficient Players, Need At Least 2"); + $InfectionGame::TimeTilInfect = 15; + %time = 15; + %game.schedule(1000, "StartTimeUntilInfect", %time); + return; + } + %ZString = ""; + if(ClientGroup.getCount() >= $InfectionGame::Min3Alphas) { + for(%x = 0; %x < 3; %x++) { + %selected = ClientGroup.getObject(GetRandom()*ClientGroup.getCount()); + if($InfectionGame::IsAlpha[%selected]) { //If this one is selected + %selected = %game.TryInfectAnother(); //grab a different client + } + $InfectionGame::Infected[%selected] = 1; + $InfectionGame::IsAlpha[%selected] = 1; + // Game.clientChangeTeam( %selected, 2, 0 ); + $InfectionGame::ClientZombie[%selected] = "Demon"; //we start them as demonz :) + if(isObject(%selected.player)) { + %targetlastpos = %selected.player.getworldboxcenter(); + makePersonZombie(%targetlastpos, %selected, 4); + } + %ZString = ""@%ZString@" "@%selected.namebase@""; + } + for(%i = 0; %i < ClientGroup.getCount(); %i ++) { + %client = ClientGroup.getObject(%i); + messageClient(%client, 'MsgSPCurrentObjective1' ,"", "Alpha Zombies:"@%ZString@""); + messageClient(%client, 'MsgSPCurrentObjective2' ,"", "Score: "@$InfectionGame::Score[%client]@" | TIER 1."); + } + $InfectionGame::Intermit = 0; + %game.timeUpdateLoop = %game.schedule(1, DoTierUpgrades); + return; + } + else if(ClientGroup.getCount() >= $InfectionGame::Min2Alphas && ClientGroup.getCount() < $InfectionGame::Min3Alphas) { + for(%x = 0; %x < 2; %x++) { + %selected = ClientGroup.getObject(GetRandom()*ClientGroup.getCount()); + if($InfectionGame::IsAlpha[%selected]) { //If this one is selected + %selected = %game.TryInfectAnother(); //grab a different client + } + $InfectionGame::Infected[%selected] = 1; + $InfectionGame::IsAlpha[%selected] = 1; + // Game.clientChangeTeam( %selected, 2, 0 ); + $InfectionGame::ClientZombie[%selected] = "Demon"; //we start them as demonz :) + if(isObject(%selected.player)) { + %targetlastpos = %selected.player.getworldboxcenter(); + makePersonZombie(%targetlastpos, %selected, 4); + } + %ZString = ""@%ZString@" "@%selected.namebase@""; + } + for(%i = 0; %i < ClientGroup.getCount(); %i ++) { + %client = ClientGroup.getObject(%i); + messageClient(%client, 'MsgSPCurrentObjective1' ,"", "Alpha Zombies:"@%ZString@""); + messageClient(%client, 'MsgSPCurrentObjective2' ,"", "Score: "@$InfectionGame::Score[%client]@" | TIER 1."); + } + $InfectionGame::Intermit = 0; + %game.timeUpdateLoop = %game.schedule(1, DoTierUpgrades); + return; + } + else { + %selected = ClientGroup.getObject(GetRandom()*ClientGroup.getCount()); + $InfectionGame::Infected[%selected] = 1; + $InfectionGame::IsAlpha[%selected] = 1; + // Game.clientChangeTeam( %selected, 2, 0 ); + $InfectionGame::ClientZombie[%selected] = "Demon"; //we start them as demonz :) + if(isObject(%selected.player)) { + %targetlastpos = %selected.player.getworldboxcenter(); + makePersonZombie(%targetlastpos, %selected, 4); + } + for(%i = 0; %i < ClientGroup.getCount(); %i ++) { + %client = ClientGroup.getObject(%i); + messageClient(%client, 'MsgSPCurrentObjective1' ,"", "Alpha Zombie: "@%selected.namebase@""); + messageClient(%client, 'MsgSPCurrentObjective2' ,"", "Score: "@$InfectionGame::Score[%client]@" | TIER 1."); + } + messageClient(%selected, 'MsgSPCurrentObjective1' ,"", "You are The Alpha Zombie"); + $InfectionGame::Intermit = 0; + + %game.timeUpdateLoop = %game.schedule(1, DoTierUpgrades); + return; + } + } + %game.schedule(1000, "StartTimeUntilInfect", %time); +} + +function InfectionGame::CheckPlayersAndLMS(%game) { + %living = 0; + %count = ClientGroup.getCount(); + for(%i = 0; %i < %count; %i++) { + %client = ClientGroup.getObject(%i); + if(!$InfectionGame::Infected[%client]) { + if(%client.team != 0) + %living++; + } + } + if(%living == 0) { + if($InfectionGame::RoundNumber >= $InfectionGame::Rounds) { + //%game.gameOver(); + //CycleMissions(); + $InfectionGame::NoRespawning = 1; + $InfectionGame::RoundNumber = 1; + MessageAll('MsgAdminForce', "\c5Infection: The Game has completed! Momentarily a vote will be initiated, vote yes to change maps, or no to stay on it."); + messageClient(%client, 'MsgSPCurrentObjective1' ,"", "Game Over: Map Cycle Vote"); + + cancel(%game.timeUpdateLoop); + %game.timeinProgress = 0; + %game.schedule(3500, "startMapCycleVote"); + } + else { + $InfectionGame::RoundNumber++; + %game.Intermission(); + } + } +} + +function InfectionGame::startMapCycleVote(%game) { + if(%game.schedulevote !$="") { + cancel(%game.ScheduleVote); + %Game.scheduleVote = ""; + %Game.kickClient = ""; + clearVotes(); + %count = clientgroup.getcount(); + for(%i = 0; %i < %count; %i++) { + messageClient(clientgroup.getobject(%i), 'closeVoteHud', ""); + } + messageAll('MsgAdminForce', "\c2SERVER: Current vote canceled to allow Infection Map Cycle Vote."); + } + + for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) { + %cl = ClientGroup.getObject( %idx ); + if ( !%cl.isAIControlled() ) { + messageClient( %cl, 'VoteStarted', '\c2SERVER: Change Maps? Vote Yes to change, or no to restart this map at Round 1.'); + %clientsVoting++; + } + } + for ( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ ) { + %cl = ClientGroup.getObject( %clientIndex ); + if ( !%cl.isAIControlled() ) { + messageClient(%cl, 'openVoteHud', "", %clientsVoting, ($Host::VotePassPercent / 100)); + } + } + clearVotes(); + %Game.voteType = "MapCycleVote"; + %Game.scheduleVote = %game.schedule( ($Host::VoteTime * 1000), "MapCycleVoteEval", false); +} + +function InfectionGame::MapCycleVoteEval(%game, %isVP) { + if (%game.scheduleVote !$= "") { + %votesFor = 0; + %votesAgainst = 0; + for (%player = 0; %player < ClientGroup.GetCount(); %player++) { + %client = ClientGroup.getObject(%player); + if ( %client.vote !$= "" ) { + if ( %client.vote ) { + %votesFor++; + } + else { + %votesAgainst++; + } + } + } + //who wins?!!? + if (%VotesFor > %votesAgainst) { + messageAll('MsgVotePassed', '\c1Map changes by vote'); + %game.gameOver(); + CycleMissions(); + $InfectionGame::NoRespawning = 0; + } + else { + messageAll('MsgVoteFailed', '\c2Current map continues. Starting Round 1.'); + + $InfectionGame::NoRespawning = 0; + %count = ClientGroup.getCount(); + for(%i = 0; %i < %count; %i++) { + %client = ClientGroup.getObject(%i); + $InfectionGame::Infected[%client] = 0; + $InfectionGame::IsAlpha[%client] = 0; + $InfectionGame::Intermit = 1; + $InfectionGame::ClientZombie[%client] = "Norm"; + + messageClient(%client, 'MsgSPCurrentObjective1' ,"", "Intermission"); + if(isObject(%client.player)) { + %client.player.scriptKill(0); // no damage type = no infect :) + } + } + $InfectionGame::TimeTilInfect = 30; + $InfectionGame::ZombieTier = 1; + %game.StartTimeUntilInfect($InfectionGame::TimeTilInfect); + } + // Housekeeping time.. + for(%cl = 0; %cl < ClientGroup.getCount(); %cl++) { + %client = ClientGroup.getObject(%cl); + %client.vote = ""; + Game.voteType = ""; + messageClient(%client, 'clearVoteHud', ""); + messageClient(%client, 'closeVoteHud', ""); + } + Game.scheduleVote = ""; + } +} + +function InfectionGame::Intermission(%game) { + MessageAll('MsgComplete',"\c5Intermission, Beginning Round "@$InfectionGame::RoundNumber@" of "@$InfectionGame::Rounds@" in 30 Seconds."); + %count = ClientGroup.getCount(); + for(%i = 0; %i < %count; %i++) { + %client = ClientGroup.getObject(%i); + $InfectionGame::Infected[%client] = 0; + $InfectionGame::IsAlpha[%client] = 0; + $InfectionGame::ClientZombie[%client] = "Norm"; + $InfectionGame::Intermit = 1; + +// Game.clientChangeTeam( %client, 1, 0 ); + + messageClient(%client, 'MsgSPCurrentObjective1' ,"", "Intermission"); + if(isObject(%client.player)) { + %client.player.scriptKill(0); // no damage type = no infect :) + } + } + $InfectionGame::TimeTilInfect = 30; + $InfectionGame::ZombieTier = 1; + %game.StartTimeUntilInfect($InfectionGame::TimeTilInfect); + + cancel(%game.timeUpdateLoop); + %game.timeinProgress = 0; +} + +function InfectionGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation) { + Parent::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation); + if(%clVictim !$= "") { + if($InfectionGame::Intermit == 1) { + CenterPrint(%clVictim, "ALERT: INTERMISSION\nIn Active Game Time, you Would be Infected, Be Advised!.",2,3); + return; + } + if($InfectionGame::Infected[%clKiller] || (%damageType $= $DamageType::Zombie || %damageType $= $DamageType::Suicide || %damageType $= $DamageType::FellOff)) { + if(!$InfectionGame::Infected[%clVictim]) { + $InfectionGame::Infected[%clVictim] = 1; + $InfectionGame::ClientZombie[%clVictim] = "Norm"; +// Game.clientChangeTeam( %client, 2, 0 ); + CenterPrint(%clVictim, "You have been infected.",2,3); + Echo("Infection: "@%clVictim.namebase@" has been infected."); + $InfectionGame::Score[%clKiller] += 10; + messageClient(%clKiller, 'MsgSPCurrentObjective2' ,"", "Score: "@$InfectionGame::Score[%clKiller]@""); + } + else { + CenterPrint(%clKiller, "Blargh, Don't kill your brothers!!! \n -5 Points",2,3); + $InfectionGame::Score[%clKiller] -= 5; + messageClient(%clKiller, 'MsgSPCurrentObjective2' ,"", "Score: "@$InfectionGame::Score[%clKiller]@""); + } + } + else { + if($InfectionGame::Infected[%clVictim]) { + $InfectionGame::Score[%clKiller]++; + messageClient(%clKiller, 'MsgSPCurrentObjective2' ,"", "Score: "@$InfectionGame::Score[%clKiller]@""); + } + else { + CenterPrint(%clKiller, "Don't Kill The Living!!! \n -5 Points",2,3); + $InfectionGame::Score[%clKiller] -= 5; + messageClient(%clKiller, 'MsgSPCurrentObjective2' ,"", "Score: "@$InfectionGame::Score[%clKiller]@""); + } + } + %game.CheckPlayersAndLMS(); + } +} + +function InfectionGame::DoTierUpgrades(%game) { + %game.timeinProgress++; + + %timeToNext = (5*60 + (5*60*($InfectionGame::ZombieTier-1))) - (%game.timeinProgress); + %min = mFloor(%timeToNext / 60); + %sec = %timeToNext % 60; + if(%sec < 10) { + %sec = "0"@%sec; + } + + for(%i = 0; %i < ClientGroup.getCount(); %i ++) { + %client = ClientGroup.getObject(%i); + //messageClient(%client, 'MsgSPCurrentObjective1' ,"", "Alpha Zombie: "@%selected.namebase@""); + if($InfectionGame::ZombieTier < 4) { + messageClient(%client, 'MsgSPCurrentObjective2' ,"", "Score: "@$InfectionGame::Score[%client]@" | TIER "@$InfectionGame::ZombieTier@" ["@%min@":"@%sec@"]."); + } + else { + messageClient(%client, 'MsgSPCurrentObjective2' ,"", "Score: "@$InfectionGame::Score[%client]@" | TIER "@$InfectionGame::ZombieTier@"."); + } + } + + if(%game.timeinProgress >= (5*60) && $InfectionGame::ZombieTier <= 1) { + $InfectionGame::ZombieTier = 2; + CenterPrintAll("TIER 2 ZOMBIE ARMORS UNLOCKED!", 3, 3); + } + if(%game.timeinProgress >= (10*60) && $InfectionGame::ZombieTier <= 2) { + $InfectionGame::ZombieTier = 3; + CenterPrintAll("TIER 3 ZOMBIE ARMORS UNLOCKED!", 3, 3); + } + if(%game.timeinProgress >= (15*60) && $InfectionGame::ZombieTier <= 3) { + $InfectionGame::ZombieTier = 4; + CenterPrintAll("TIER 4 ZOMBIE ARMORS UNLOCKED!\nHIGHEST TIER ACHIEVED!", 3, 3); + } + + %game.timeUpdateLoop = %game.schedule(1000, DoTierUpgrades); +} + +function InfectionArmors(%client, %armorList) { + if ( %client.favorites[0] !$= "Scout") { + %armorList = %armorList TAB "Scout"; + } + return %armorList; +} + +function InfectionGame::forceObserver( %game, %client, %reason ) { + //if($InfectionGame::IsAlpha[%client]) { + // %game.Intermission(); + //} + DefaultGame::forceObserver( %game, %client, %reason ); +} + +function InfectionGame::gameOver(%game) { + //call the default + deactivatePackage(InfectionGamePackage); + $TWM::PlayingInfection = 0; + $TWM::TeamWars = 0; + $Host::RankSystem = 1; + DefaultGame::gameOver(%game); + + //send the winner message + %winner = ""; + messageAll('MsgClearObjHud', ""); + + for(%i = 0; %i < ClientGroup.getCount(); %i ++) { + %client = ClientGroup.getObject(%i); + //reset all vars + $InfectionGame::Infected[%client] = 0; + $InfectionGame::IsAlpha[%client] = 0; + $InfectionGame::Score[%client] = 0; + + %game.resetScore(%client); + } +} + +function InfectionGame::leaveMissionArea(%game, %playerData, %player) { + if(%player.getState() $= "Dead") + return; + + %player.client.outOfBounds = true; + %player.OutsideKill = schedule(7500,0,"KillOutside", %player); + messageClient(%player.client, 'LeaveMissionArea', '\c1You left the mission area, Return or be killed.~wfx/misc/warning_beep.wav'); + +} + +function InfectionGame::enterMissionArea(%game, %playerData, %player) { + if(%player.getState() $= "Dead") + return; + + cancel(%player.OutsideKill); + %player.client.outOfBounds = false; + messageClient(%player.client, 'EnterMissionArea', '\c1You are back in the mission area.'); +} + +function KillOutside(%p) { + if(isObject(%p) && %p.getState() !$= "dead") { + %p.scriptKill(0); + messageClient(%p.client, 'die', '\c1You were killed for being outside of the mission area.'); + MessageAll('Dead',"\c0"@%p.client.namebase@" was killed for leaving the mission area for too long."); + } +} + +function InfectionGame::ResetScore(%client) { + +} + +package InfectionGamePackage { + function GameConnection::onDrop(%client, %reason) { //no changes made + if($InfectionGame::IsAlpha[%client]) { + Game.Intermission(); + } + parent::onDrop(%client, %reason); + } +}; + +function InfectionGame::spawnPlayer( %game, %client, %respawn ) { + if($InfectionGame::NoRespawning) { + CenterPrint(%client, "The Game is Currently in Intermission.",2,3); + return; + } + + Parent::spawnPlayer( %game, %client, %respawn ); +} + + + +$ZArmor[0, 1] = "Norm\t0\tNormal Zombie\tAbility: Jet Key To Lunge"; +$ZArmor[1, 1] = "Demon\t0\tDemon Zombie\tAbility: Jet Key To Throw Fireball"; +$ZArmor[2, 1] = "Lord\t1\tZombie Lord\tAbilities: Jet Key To Fire, Mine Key To Lift"; + +$ZArmor[0, 2] = "Norm\t0\tNormal Zombie\tAbility: Jet Key To Lunge"; +$ZArmor[1, 2] = "Rav\t0\tRavenger Zombie\tAbility: Jet Key To Speed Forward/Lunge"; +$ZArmor[2, 2] = "Lord\t0\tZombie Lord\tAbilities: Jet Key To Fire, Mine Key To Lift"; +$ZArmor[3, 2] = "Demon\t0\tDemon Zombie\tAbility: Jet Key To Throw Fireball"; +$ZArmor[4, 2] = "Rap\t1\tAir Rapier Zombie\tAbility: Jet Key Flies"; + +$ZArmor[0, 3] = "Norm\t0\tNormal Zombie\tAbility: Jet Key To Lunge"; +$ZArmor[1, 3] = "Rav\t0\tRavenger Zombie\tAbility: Jet Key To Speed Forward/Lunge"; +$ZArmor[2, 3] = "Lord\t0\tZombie Lord\tAbilities: Jet Key To Fire, Mine Key To Lift"; +$ZArmor[3, 3] = "Demon\t0\tDemon Zombie\tAbility: Jet Key To Throw Fireball"; +$ZArmor[4, 3] = "Rap\t0\tAir Rapier Zombie\tAbility: Jet Key Flies"; +$ZArmor[5, 3] = "VolRav\t0\tVolatile Ravenger Zombie\tAbility: Jet Key To Detonate C4"; +$ZArmor[6, 3] = "UDem\t1\tUltra Demon Zombie\tAbility: Jet Key To Fire, Mine To Charge Forward"; +$ZArmor[7, 3] = "Wraith\t1\tWraith Spec-Ops Zombie\tAbility: Jet Key To Charge, Armed with MP26-CMDO"; + +$ZArmor[0, 4] = "Norm\t0\tNormal Zombie\tAbility: Jet Key To Lunge"; +$ZArmor[1, 4] = "Rav\t0\tRavenger Zombie\tAbility: Jet Key To Speed Forward/Lunge"; +$ZArmor[2, 4] = "Lord\t0\tZombie Lord\tAbilities: Jet Key To Fire, Mine Key To Lift"; +$ZArmor[3, 4] = "Demon\t0\tDemon Zombie\tAbility: Jet Key To Throw Fireball"; +$ZArmor[4, 4] = "Rap\t0\tAir Rapier Zombie\tAbility: Jet Key Flies"; +$ZArmor[5, 4] = "VolRav\t0\tVolatile Ravenger Zombie\tAbility: Jet Key To Detonate C4"; +$ZArmor[6, 4] = "UDem\t0\tUltra Demon Zombie\tAbility: Jet Key To Fire, Mine To Charge Forward"; +$ZArmor[7, 4] = "Wraith\t0\tWraith Spec-Ops Zombie\tAbility: Jet Key To Charge, Armed with MP26-CMDO"; +$ZArmor[8, 4] = "Rog\t1\tGeneral Rog\tAbilities: Jet Key To fire zMG42, Shielded, Armed with BoV"; + +//Score Hud +$ScoreHudMaxVisible = 19; +function InfectionGame::updateScoreHud(%game, %client, %tag) { + messageClient( %client, 'SetScoreHudHeader', "", "" ); + messageClient( %client, 'SetScoreHudHeader', "", "Infection - Command HudClose" ); + messageClient( %client, 'SetScoreHudSubheader', "", "Infection Player Settings" ); + //The Menu + messageClient( %client, 'SetLineHud', "", %tag, %index, "Settings:"); + %index++; + messageClient( %client, 'SetLineHud', "", %tag, %index, "Zombie Armor [TIER "@$InfectionGame::ZombieTier@"]"); + %index++; + %i = 0; + while(isSet($ZArmor[%i, $InfectionGame::ZombieTier])) { + %z = $ZArmor[%i, $InfectionGame::ZombieTier]; + if(getField(%z, 1) $= "1") { + if($InfectionGame::IsAlpha[%client]) { + messageClient( %client, 'SetLineHud', "", %tag, %index, ""@getField(%z, 2)@" - "@getField(%z, 3)); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, ""@getField(%z, 2)@" - "@getField(%z, 3)); + %index++; + } + %i++; + } + //end + messageClient( %client, 'ClearHud', "", %tag, %index ); +} + +function InfectionGame::processGameLink(%game, %client, %arg1, %arg2, %arg3, %arg4, %arg5){ +%tag = $TagToUseForScoreMenu; +messageClient( %client, 'ClearHud', "", %tag, 1 ); +//Stuff +if(%arg1 $= "") +%arg1 = "Null"; +if(%arg2 $= "") +%arg2 = "Null"; +if(%arg3 $= "") +%arg3 = "Null"; +if(%arg4 $= "") +%arg4 = "Null"; +if(%arg5 $= "") +%arg5 = "Null"; + +echo("[F2] "@%client.namebase@": "@%arg1@", "@%arg2@", "@%arg3@", "@%arg4@", "@%arg5@"."); + switch$ (%arg1){ + case "NULL": + echo("Null Arg"); + return; + + case "GTP": + %game.updateScoreHud(%client, %tag); //Infection Calls This + %client.SCMPage = %arg2; + return; + + case "NAC": + closeScoreHudFSERV(%client); + return; + + case "SetZArmor": + echo("Set Z Armor"); + %armor = %arg2; + + if(getField($ZArmor[%arg3, $InfectionGame::ZombieTier], 1) $= "1") { + if(!$InfectionGame::IsAlpha[%client]) { + MessageClient(%client, 'MsgNo', "\c5INFECTION: Alpha Zombie Status Required."); + closeScoreHudFSERV(%client); + return; + } + } + + $InfectionGame::ClientZombie[%client] = %armor; + MessageClient(%client, 'MsgNo', "\c5INFECTON: Zombie Armor Set To "@%armor@""); + %game.updateScoreHud(%client, %tag); //Infection Calls This + return; + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +$InfectionGame::SpawnLocation["EngelamHimmel"] = "126.7 14.7 181"; +$InfectionGame::SpawnLocation["DerGott"] = "0.0299911 -3.61698 155"; +$InfectionGame::SpawnLocation["Strikers2"] = "-9.76935 149.965 105"; +$InfectionGame::SpawnLocation["Oasis2"] = "-70.435 -46.3061 116.136"; +$InfectionGame::SpawnLocation["MrykWood2"] = "-314 -7.5 103.543"; +$InfectionGame::SpawnLocation["Skyline"] = "-58.8556 -420.953 750.438"; +$InfectionGame::SpawnLocation["GeometricOrder"] = "-172.325 -396.557 159.9"; diff --git a/scripts/JTLmeteorStorm.cs b/scripts/JTLmeteorStorm.cs new file mode 100644 index 0000000..125578e --- /dev/null +++ b/scripts/JTLmeteorStorm.cs @@ -0,0 +1,322 @@ +// JTLmeteorStorm.cs +// +// This script (C) 2002 by JackTL +// +// Use, modify, but give credit +// +// Functions: +// +// JTLMeteorStorm(obj,forcePlayer[1/0],maxRad,numFb,dropAlt,dropAltVariance,dbName,dbType,timeOutMS,randomRot[1/0],randomPulse[1/0],maxPulse,speedVec,offsetSpeedVec[1/0]) +// + +datablock ParticleData(JTLMeteorStormFireballParticle) { + dragCoeffiecient = 0.0; + gravityCoefficient = -0.2; + inheritedVelFactor = 0.0; + + lifetimeMS = 700; + lifetimeVarianceMS = 0; + + textureName = "particleTest"; + + useInvAlpha = false; + spinRandomMin = -160.0; + spinRandomMax = 160.0; + + animateTexture = true; + framesPerSec = 15; + + animTexName[0] = "special/Explosion/exp_0016"; + animTexName[1] = "special/Explosion/exp_0018"; + animTexName[2] = "special/Explosion/exp_0020"; + animTexName[3] = "special/Explosion/exp_0022"; + animTexName[4] = "special/Explosion/exp_0024"; + animTexName[5] = "special/Explosion/exp_0026"; + animTexName[6] = "special/Explosion/exp_0028"; + animTexName[7] = "special/Explosion/exp_0030"; + animTexName[8] = "special/Explosion/exp_0032"; + + colors[0] = "1.0 0.7 0.5 1.0"; + colors[1] = "1.0 0.5 0.2 1.0"; + colors[2] = "1.0 0.25 0.1 0.0"; + sizes[0] = 40.0; + sizes[1] = 15.0; + sizes[2] = 7.5; + times[0] = 0.0; + times[1] = 0.2; + times[2] = 1.0; +}; + +datablock ParticleEmitterData(JTLMeteorStormFireballEmitter) { + ejectionPeriodMS = 5; + periodVarianceMS = 1; + + ejectionVelocity = 0.25; + velocityVariance = 0.0; + + thetaMin = 0.0; + thetaMax = 30.0; + + particles = "JTLMeteorStormFireballParticle"; +}; + +//-------------------------------------------------------------------------- +// Explosion +//-------------------------------------- + +datablock ParticleData(MetExplosionSmoke) +{ + dragCoeffiecient = 0.4; + gravityCoefficient = -0.30; // rises slowly + inheritedVelFactor = 0.025; + + lifetimeMS = 3500; + lifetimeVarianceMS = 400; + + useInvAlpha = true; + spinRandomMin = -100.0; + spinRandomMax = 100.0; + + textureName = "special/Smoke/bigSmoke"; + + colors[0] = "0.7 0.7 0.7 1.0"; + colors[1] = "0.2 0.2 0.2 1.0"; + colors[2] = "0.2 0.2 0.2 1.0"; + colors[3] = "0.2 0.2 0.2 1.0"; + colors[4] = "0.1 0.1 0.1 0.0"; + colors[5] = "0.1 0.1 0.1 0.0"; + sizes[0] = 15.0; + sizes[1] = 18.0; + sizes[2] = 21.0; + sizes[3] = 24.0; + sizes[4] = 27.0; + sizes[5] = 30.0; + times[0] = 0.0; + times[1] = 0.333; + times[2] = 0.666; + times[3] = 1.0; + times[4] = 1.333; + times[5] = 1.666; +}; + +datablock ParticleEmitterData(MetExplosionSmokeEmitter) +{ + ejectionPeriodMS = 2; + periodVarianceMS = 0; + + ejectionOffset = 10.0; + + ejectionVelocity = 15.0; + velocityVariance = 5.0; + + thetaMin = 0.0; + thetaMax = 90.0; + + lifetimeMS = 1500; + + particles = "MetExplosionSmoke"; +}; + +datablock ShockwaveData(MetShockwave) +{ + width = 30.0; + numSegments = 32; + numVertSegments = 6; + velocity = 500; + acceleration = 100.0; + lifetimeMS = 500; + height = 12.0; + verticalCurve = 0.5; + is2D = false; + + texture[0] = "special/shockwave4"; + texture[1] = "special/gradient"; + texWrap = 6.0; + + times[0] = 0.0; + times[1] = 0.5; + times[2] = 1.0; + + colors[0] = "0.4 1.0 0.4 0.50"; + colors[1] = "0.4 1.0 0.4 0.25"; + colors[2] = "0.4 1.0 0.4 0.0"; + + mapToTerrain = true; + orientToNormal = false; + renderBottom = false; +}; + +datablock ExplosionData(MetSubExplosion) +{ + explosionShape = "effect_plasma_explosion.dts"; + faceViewer = true; + delayMS = 0; + offset = 0.0; + playSpeed = 0.15; + + sizes[0] = "35.0 35.0 35.0"; + sizes[1] = "35.0 35.0 35.0"; + times[0] = 0.0; + times[1] = 1.0; +}; + +datablock ExplosionData(MetExplosion) +{ + explosionShape = "effect_plasma_explosion.dts"; + soundProfile = plasmaExpSound; + + particleEmitter = MetExplosionSmokeEmitter; + + shockwave = MetShockwave; + shockwaveOnTerrain = false; + + subExplosion[0] = MetSubExplosion; + particleDensity = 150; + particleRadius = 1.25; + faceViewer = true; + + sizes[0] = "55.0 55.0 55.0"; + sizes[1] = "55.0 55.0 55.0"; + times[0] = 0.0; + times[1] = 1.5; +}; + +//--------------------------------------- +// Projectile +//--------------------------------------- + +datablock GrenadeProjectileData(JTLMeteorStormFireball) { + projectileShapeName = "plasmabolt.dts"; + scale = "40.0 40.0 40.0"; + emitterDelay = -1; + directDamage = 0; + directDamageType = $DamageType::Meteor; + hasDamageRadius = true; // true; + indirectDamage = 5; // 0.5; + damageRadius = 150.0; + radiusDamageType = $DamageType::Meteor; + kickBackStrength = 5000; + explosion = MetExplosion; + splash = PlasmaSplash; + baseEmitter = JTLMeteorStormFireballEmitter; + armingDelayMS = 50; + grenadeElasticity = 0.15; + grenadeFriction = 0.4; + drag = 0.1; + gravityMod = 0.0; + sound = GrenadeProjectileSound; + + hasLight = true; + lightRadius = 20.0; + lightColor = "1 1 0.5"; +}; + +function JTLMeteorStormFireball::onExplode(%data,%proj,%pos,%mod) { + // Ass-ume gravity does not change vec.. (gravityMod = 0.0) :P + %vec = vectorNormalize(%proj.initialDirection); + if (%data.hasDamageRadius) + RadiusExplosion(%proj,vectorAdd(%pos,vectorScale(%vec,-0.1)),%data.damageRadius,%data.indirectDamage,%data.kickBackStrength,%proj.sourceObject,%data.radiusDamageType); + %pPos = %proj.getPosition(); + %surface = containerRayCast(vectorAdd(%pPos,vectorScale(%vec,-0.1)),vectorAdd(%pPos,vectorScale(%vec,1)),-1,%proj); + %tObj = firstWord(%surface); + if (isObject(%tObj)) + %tObj.damage(%proj,%pPos,0.4,%proj.getDataBlock().directDamageType); +// ionStormBeam(vectorAdd(%pPos,"0 0" SPC $IonStorm::Height)); +} + +function JTLMeteorStorm (%obj,%forcePlayer,%maxRad,%numFb,%dropAlt,%dropAltVariance,%dbName,%dbType,%timeOutMS,%randomRot,%randomPulse,%maxPulse,%speedVec,%offsetSpeedVec,%createFB,%pos,%target) { + %pi = 3.1415926535897932384626433832795; // Whoa.. + if (%createFB) { + if (%randomRot) + %rot = "0 0 1" SPC getRandom() * (%pi * 2); + else + %rot = "1 0 0 0"; + %fb = new (%dbType) (JTLMeteor) { + dataBlock = %dbName; + position = %pos; // Needed for non-projectile types + initialPosition = %pos; + initialDirection = %speedVec; +// sourceObject = 0; + sourceSlot = 0; + vehicleObject = 0; + }; + if (isObject(%target) && $JTLMeteorStormSeek == 1 && %dbType $= "SeekerProjectile") + %fb.setObjectTarget(%target); + %fb.setRotation(%rot); + if (%randomPulse) { + %pulse = getRandom() * %maxPulse; + %iPos = vectorNormalize((getRandom() * 2) - 1 SPC (getRandom() * 2) - 1 SPC (getRandom() * 2) - 1); + %iPos = vectorAdd(%pos,%iPos); + %iVec = vectorScale(vectorNormalize(getRandom() SPC getRandom() SPC getRandom()),%pulse); +// Fix this, not for projectiles + %fb.applyImpulse(%iPos,%iVec); + } + if (%dbType $= "Item") + %fb.setVelocity(%speedVec); // Needed for non-projectile types + MissionCleanup.add(%fb); + if (%timeOutMS) { + %fb.schedule(%timeOutMS,setDamageState,Destroyed); + %fb.schedule(%timeOutMS+1000,delete); + } + return; + } + + if (%forcePlayer) { + %obj = %obj.player; + } + else { + if (%obj.getClassName() $= "GameConnection" || %obj.getClassName() $= "AIConnection") { + %obj2 = %obj.getControlObject(); + if (isObject(%obj2)) + %obj = %obj2; + } + } + + if (isObject(%obj)) { + if (%maxRad < 1) + %maxRad = 50; + if (%numFb < 1) + %numFb = 100; + if (%dropAlt < 1) + %dropAlt = 100; + if (%dropAltVariance < 1) + %dropAltVariance = 500; + if (!isObject(%dbName)) + %dbName = "JTLMeteorStormFireball"; + if (%dbType $= "" || %dbType $= "0") + %dbType = "GrenadeProjectile"; + if (%speedVec $= "" || %speedVec $= "0") + %speedVec = "0 0 -2"; + if (%maxPulse < 1) + %maxPulse = 4000; + %p = %obj.getWorldBoxCenter(); + %x = getWord(%p,0); + %y = getWord(%p,1); + %z = getWord(%p,2); + for (%i = 0; %i < %numFb; %i++) { + %dVec = getRandom() * %pi * 2; + %dRad = getRandom() * %maxRad; + %dX =mSin(%dVec) * %dRad; + %dY =mCos(%dVec) * %dRad; + %dZ =%dropAlt + (getRandom() * %dropAltVariance); + if (%offsetSpeedVec) { + %v2 = vectorCross(vectorNormalize(%speedVec),"1 0 0"); + %v3 = vectorCross(vectorNormalize(%speedVec),%v2); + %dPos = vectorAdd(%p,vectorScale(vectorNormalize(%speedVec),-%dZ)); + %dPos = vectorAdd(%dPos,vectorScale(%v2,%dX)); + %dPos = vectorAdd(%dPos,vectorScale(%v3,%dY)); + } + else { + %dX = %x + %dX; + %dY = %y + %dY; + %dZ = %z + %dZ; + %dPos = %dX SPC %dY SPC %dZ; + } + JTLMeteorStorm(0,0,0,0,0,0,%dbName,%dbType,%timeOutMS,%randomRot,%randomPulse,%maxPulse,%speedVec,0,true,%dPos,%obj); + } + } + else { + error("-JTLMeteorStorm- no valid object."); + error("Usage: JTLMeteorStorm(obj,forcePlayer[1/0],maxRad,numFb,dropAlt,dropAltVariance,dbName,dbType,timeOutMS,randomRot[1/0],randomPulse[1/0],maxPulse,speedVec,offsetSpeedVec[1/0])"); + } +} diff --git a/scripts/OptionsDlg.cs b/scripts/OptionsDlg.cs new file mode 100644 index 0000000..fe0ceb7 --- /dev/null +++ b/scripts/OptionsDlg.cs @@ -0,0 +1,2763 @@ +//------------------------------------------------------------------------------ +// +// OptionsDlg.cs +// +//------------------------------------------------------------------------------ +$max_screenerror = 25; +$min_TSScreenError = 2; +$max_TSScreenError = 20; +$min_TSDetailAdjust = 0.6; +$max_TSDetailAdjust = 1.0; +//------------------------------------------------------------------------------ +function OptionsDlg::onWake( %this ) +{ + OP_VideoPane.setVisible( false ); + OP_GraphicsPane.setVisible( false ); + OP_TexturesPane.setVisible( false ); + OP_SoundPane.setVisible( false ); + OP_VoicePane.setVisible( false ); + OP_ControlsPane.setVisible( false ); + OP_NetworkPane.setVisible( false ); + OP_GamePane.setVisible( false ); + + OP_VideoTab.setValue( false ); + OP_GraphicsTab.setValue( false ); + OP_TexturesTab.setValue( false ); + OP_SoundTab.setValue( false ); + OP_VoiceTab.setValue( false ); + OP_ControlsTab.setValue( false ); + OP_NetworkTab.setValue( false ); + OP_GameTab.setValue( false ); + + // Initialize the Video Pane controls: + // First the Video Driver menu: + %buffer = getDisplayDeviceList(); + %count = getFieldCount( %buffer ); + for ( %i = 0; %i < %count; %i++ ) + OP_VideoDriverMenu.add( getField( %buffer, %i ), %i ); + + // Select the current device: + OP_FullScreenTgl.setValue( $pref::Video::fullScreen ); + + %selId = OP_VideoDriverMenu.findText( $pref::Video::displayDevice ); + if ( %selId == -1 ) + %selId = 0; // How did THAT happen? + OP_VideoDriverMenu.setSelected( %selId ); + OP_VideoDriverMenu.onSelect( %selId, "" ); + OP_FullScreenTgl.onAction(); + + OP_ApplyBtn.setActive( false ); + + // Initialize the Graphics Options controls: + OptionsDlg::deviceDependent( %this ); + + // Radeon cards don't switch color depth good until they release their beta drivers which fix this problem. + if( $RadeonRenderer == true ) + OP_BPPMenu.setActive( false ); + + OP_GammaSlider.setValue( $pref::OpenGL::gammaCorrection ); + OP_GammaSlider.setActive( $Video::setGammaCorrectionSupported ); + + OP_TerrainSlider.setValue( $max_screenerror - $pref::Terrain::screenError ); + OP_ShapeSlider.setValue( ( $max_TSScreenError - $pref::TS::screenError ) / ( $max_TSScreenError - $min_TSScreenError ) ); + OP_ShadowSlider.setValue( $pref::Shadows ); + OP_InteriorDetailSlider.setValue( $pref::Interior::detailAdjust ); + OP_VisibleDistanceSlider.setValue( $pref::VisibleDistanceMod ); + OP_ParticleDensitySlider.setValue( 4.0 - $pref::ParticleDensity ); + OP_DynamicLightSlider.setValue( 100 - $pref::Interior::DynamicLightsClipPix ); + updateDynamicLightSliderState(); + OP_SkyDetailMenu.init(); + if ( !$pref::SkyOn ) + %selId = 5; + else if ( $pref::numCloudLayers >= 0 && $pref::numCloudLayers < 4 ) + %selId = 4 - $pref::numCloudLayers; + else + %selId = 1; + OP_SkyDetailMenu.setSelected( %selId ); + OP_SkyDetailMenu.setText( OP_SkyDetailMenu.getTextById( %selId ) ); + OP_PlayerRenderMenu.init(); + %selId = $pref::Player::renderMyPlayer | ( $pref::Player::renderMyItems << 1 ); + OP_PlayerRenderMenu.setSelected( %selId ); + OP_VertexLightTgl.setValue( $pref::Interior::VertexLighting ); + + // Initialize the Textures Options controls: + OP_TerrainTexSlider.setValue( 6 - $pref::Terrain::texDetail ); + + // We're using the noDrawArraysAlpha variable here because we've already + // gone gold (hard to add a new profiling variable). But the Voodoo2/3/3500 + // cards that have the 256x256 texture limitation (in OpenGL) also have the + // noDrawArraysAlpha hack on...so that works out nice + %mipRange = $pref::OpenGL::noDrawArraysAlpha ? 4.0 : 5.0; + OP_ShapeTexSlider.setValue( (5 - $pref::OpenGL::mipReduction) / %mipRange ); + OP_BuildingTexSlider.setValue( (5 - $pref::OpenGL::interiorMipReduction) / %mipRange ); + OP_SkyTexSlider.setValue( (5 - $pref::OpenGL::skyMipReduction) / %mipRange ); + if ( !isDemo() ) + OP_HiResSkinTgl.setValue( $pref::use512PlayerSkins ); + + // Initialize the Sound Options controls: + // provider menu + %count = alxGetContexti(ALC_PROVIDER_COUNT); + for(%i = 0; %i < %count; %i++) + OP_AudioProviderMenu.add(alxGetContextstr(ALC_PROVIDER_NAME, %i), %i); + %selId = alxGetContexti(ALC_PROVIDER); + OP_AudioProviderMenu.setSelected(%selId); + OP_AudioResetProvider.setActive(false); + + // environment provider: disable and uncheck if not an environment provider + %envProvider = audioIsEnvironmentProvider(alxGetContextstr(ALC_PROVIDER_NAME, %selId)); + + if(!%envProvider) + OP_AudioEnvironmentTgl.setValue(false); + OP_AudioEnvironmentTgl.setActive(%envProvider); + + // speaker menu + %count = alxGetContexti(ALC_SPEAKER_COUNT); + for(%i = 0; %i < %count; %i++) + OP_AudioSpeakerMenu.add(alxGetContextstr(ALC_SPEAKER_NAME, %i), %i); + %selId = alxGetContexti(ALC_SPEAKER); + OP_AudioSpeakerMenu.setSelected(%selId); + OP_AudioSpeakerMenu.onSelect(%selId, ""); + + OP_AudioFrequencyMenu.init(); + OP_AudioBitRateMenu.init(); + OP_AudioChannelsMenu.init(); + + // don't allow changing of of mixer settings while in a game... + %active = !isObject(ServerConnection); + OP_AudioFrequencyMenu.setActive(%active); + // Changing these audio settings doesn't help Linux performance + if ( $platform $= "linux" ) + { + OP_AudioBitRateMenu.setActive(false); + OP_AudioChannelsMenu.setActive(false); + } + else + { + OP_AudioBitRateMenu.setActive(%active); + OP_AudioChannelsMenu.setActive(%active); + } + + // only allow for disable + if(!%active) + OP_AudioEnvironmentTgl.setActive(%active); + + OP_AudioProviderMenu.setActive(%active); + OP_AudioSpeakerMenu.setActive(%active); + + OP_MasterVolumeSlider.setValue( $pref::Audio::masterVolume ); + OP_EffectsVolumeSlider.setValue( $pref::Audio::effectsVolume ); + OP_VoiceBindVolumeSlider.setValue( $pref::Audio::radioVolume ); + OP_GuiVolumeSlider.setValue( $pref::Audio::guiVolume ); + OP_MusicTgl.onAction(); + OP_MusicVolumeSlider.setValue( $pref::Audio::musicVolume ); + + // Initialize the Voice Settings controls: + OP_MicrophoneEnabledTgl.onAction(); + OP_MicrophoneVolumeSlider.setValue( $pref::Audio::voiceVolume ); + OP_InputBoostSlider.setValue( $pref::Audio::captureGainScale ); + OP_VoiceListenMenu.init(); + OP_VoiceSendMenu.init(); + OP_VoiceCodecInfo.init(); + updateInputBoost(); + + // Initialize the Control Options controls: + OP_ControlGroupMenu.init(); + + if ( isJoystickDetected() ) + { + OP_JoystickTgl.setValue( $pref::Input::JoystickEnabled ); + OP_JoystickTgl.setActive( true ); + OP_ConfigureJoystickBtn.setActive( $pref::Input::JoystickEnabled ); + } + else + { + OP_JoystickTgl.setValue( false ); + OP_JoystickTgl.setActive( false ); + $pref::Input::JoystickEnabled = false; + OP_ConfigureJoystickBtn.setActive( false ); + } + + // Initialize the Network Options controls: + OP_NetworkDisplayHud.init(); + if( !OP_NetworkPresetsMenu.size() ) + OP_NetworkPresetsMenu.init(); + OP_PacketRateSlider.setValue( $pref::Net::PacketRateToClient ); + OP_PacketSizeSlider.setValue( $pref::Net::PacketSize ); + OP_UpdateRateSlider.setValue( $pref::Net::PacketRateToServer ); + if ( !OP_MasterServerMenu.size() ) + OP_MasterServerMenu.init(); + %selId = OP_MasterServerMenu.findText( $pref::Net::DisplayOnMaster ); + if ( %selId == -1 ) + %selId = 1; + OP_MasterServerMenu.setSelected( %selId ); + if ( !OP_RegionMenu.size() ) + OP_RegionMenu.init(); + OP_RegionMenu.setSelected( $pref::Net::RegionMask ); + + // Initialize the Game Options controls: + OP_ZoomSpeedSlider.setValue( 500 - $pref::Player::zoomSpeed ); + OP_LaunchScreenMenu.init(); + + %selId = OP_LaunchScreenMenu.findText( $pref::Shell::LaunchGui ); + if ( %selId == -1 ) + %selId = 1; + OP_LaunchScreenMenu.setText( OP_LaunchScreenMenu.getTextById( %selId ) ); + OP_LaunchScreenMenu.setSelected( %selId ); + + // Hide controls that are not relevant to the demo: + if ( isDemo() ) + { + OP_MasterServerTxt.setVisible( false ); + OP_MasterServerMenu.setVisible( false ); + OP_CheckEmailTgl.setVisible( false ); + OP_ChatDisconnectTgl.setVisible( false ); + OP_EditChatMenuBtn.setVisible( false ); + OP_LaunchScreenTxt.setVisible( false ); + OP_LaunchScreenMenu.setVisible( false ); + } + + %this.setPane( %this.pane ); +} + +//------------------------------------------------------------------------------ +function OptionsDlg::deviceDependent( %this ) +{ + if ( $SwapIntervalSupported ) + { + OP_VSyncTgl.setValue( $pref::Video::disableVerticalSync ); + OP_VSyncTgl.setActive( true ); + } + else + { + OP_VSyncTgl.setValue( false ); + OP_VSyncTgl.setActive( false ); + } + + if ( isDemo() ) + { + OP_TexQualityMenu.setText( "Palletized" ); + OP_TexQualityMenu.setActive( false ); + } + else + { + OP_TexQualityMenu.init(); + if ( $pref::OpenGL::forcePalettedTexture ) + { + $pref::OpenGL::force16bittexture = false; + %selId = 1; + } + else if ( $pref::OpenGL::force16bittexture ) + %selId = 2; + else + %selId = 3; + OP_TexQualityMenu.setSelected( %selId ); + } + + OP_CompressMenu.init(); + if ( $TextureCompressionSupported && !$pref::OpenGL::disableARBTextureCompression ) + { + OP_CompressLabel.setVisible( true ); + OP_CompressLabel_Disabled.setVisible( false ); + OP_CompressMenu.setActive( true ); + if ( !$pref::OpenGL::allowCompression ) + OP_CompressMenu.setSelected( 1 ); + else if ( $pref::OpenGL::compressionHint $= "GL_NICEST" ) + OP_CompressMenu.setSelected( 3 ); + else + OP_CompressMenu.setSelected( 2 ); + } + else + { + OP_CompressLabel_Disabled.setVisible( true ); + OP_CompressLabel.setVisible( false ); + OP_CompressMenu.setActive( false ); + OP_CompressMenu.setText( "None" ); + } + + if ( $FogCoordSupported ) + { + OP_IntTexturedFogTgl.setValue( $pref::Interior::TexturedFog ); + OP_IntTexturedFogTgl.setActive( true ); + } + else + { + OP_IntTexturedFogTgl.setValue( true ); + OP_IntTexturedFogTgl.setActive( false ); + } + + OP_AnisotropySlider.setValue( $pref::OpenGL::anisotropy ); + OP_AnisotropySlider.setActive( $AnisotropySupported ); + if ( $AnisotropySupported ) + { + OP_AnisotropyLabel.setVisible( true ); + OP_AnisotropyLabel_Disabled.setVisible( false ); + } + else + { + OP_AnisotropyLabel_Disabled.setVisible( true ); + OP_AnisotropyLabel.setVisible( false ); + } + + OP_EnvMapTgl.setValue($pref::environmentMaps); + OP_EnvMapTgl.setActive($pref::OpenGL::allowTexGen); +} + +//------------------------------------------------------------------------------ +function OptionsDlg::onSleep( %this ) +{ + OP_VideoDriverMenu.clear(); + OP_ResMenu.clear(); + OP_BPPMenu.clear(); + OP_AudioProviderMenu.clear(); + OP_AudioSpeakerMenu.clear(); + OP_NetworkDisplayHud.uninit(); + + if ( %this.resetAudio ) + { + echo( "Resetting the audio driver..." ); + audioSetDriver( "none" ); + audioSetDriver( $pref::Audio::activeDriver ); + %this.resetAudio = ""; + + // Play the shell hum: (all sources are gone) + if($HudHandle[shellScreen] $= "") + alxStop($HudHandle[shellScreen]); + + $HudHandle[shellScreen] = alxPlay(ShellScreenHumSound, 0, 0, 0); + } + + if ( isObject( ServerConnection ) && isTextureFlushRequired() ) + MessageBoxYesNo( "WARNING", "You have made changes that require Tribes 2 to flush the texture cache. " + @ "Doing this while the game is running can take a long time. " + @ "Do you wish to continue?", + "OptionsDlg.saveSettings();", "returnFromSettings();" ); + else + %this.saveSettings(); +} + +//------------------------------------------------------------------------------ +function isTextureFlushRequired() +{ + if ( $pref::Interior::VertexLighting != OP_VertexLightTgl.getValue() ) + return( true ); + + // We're using the noDrawArraysAlpha variable here because we've already + // gone gold (hard to add a new profiling variable). But the Voodoo2/3/3500 + // cards that have the 256x256 texture limitation (in OpenGL) also have the + // noDrawArraysAlpha hack on...so that works out nice + %mipRange = $pref::OpenGL::noDrawArraysAlpha ? 4 : 5; + if ( $pref::OpenGL::mipReduction != 5 - mFloor( OP_ShapeTexSlider.getValue() * %mipRange ) ) + return( true ); + + if ( $pref::OpenGL::interiorMipReduction != 5 - mFloor( OP_BuildingTexSlider.getValue() * %mipRange ) ) + return( true ); + + if ( $pref::OpenGL::skyMipReduction != 5 - mFloor( OP_SkyTexSlider.getValue() * %mipRange ) ) + return( true ); + + if ( $AnisotropySupported && $pref::OpenGL::anisotropy != OP_AnisotropySlider.getValue() ) + return( true ); + + if ( !isDemo() ) + { + %id = OP_TexQualityMenu.getSelected(); + if ( $pref::OpenGL::forcePalettedTexture ) + { + if ( %id != 1 ) + return( true ); + } + else if ( $pref::OpenGL::force16bittexture ) + { + if ( %id != 2 ) + return( true ); + } + else if ( %id != 3 ) + return( true ); + } + + if ( $TextureCompressionSupported && !$pref::OpenGL::disableARBTextureCompression ) + { + %id = OP_CompressMenu.getSelected(); + if ( $pref::OpenGL::allowCompression ) + { + if ( $pref::OpenGL::compressionHint $= "GL_FASTEST" ) + { + if ( %id != 2 ) + return( true ); + } + else if ( $pref::OpenGL::compressionHint $= "GL_NICEST" ) + { + if ( %id != 3 ) + return( true ); + } + else if ( %id == 1 ) + return( true ); + } + else if ( %id > 1 ) + return( true ); + } + + return( false ); +} + +//------------------------------------------------------------------------------ +function returnFromSettings() +{ + // to unpause singlePlayerGame when returning from options + if ( isObject( Game ) ) + Game.OptionsDlgSleep(); +} + +//------------------------------------------------------------------------------ +function OptionsDlg::saveSettings( %this ) +{ + // Save off any prefs that don't auto-update: + %flushTextures = false; + + if ( $SwapIntervalSupported && OP_VSyncTgl.getValue() != $pref::Video::disableVerticalSync ) + { + $pref::Video::disableVerticalSync = OP_VSyncTgl.getValue(); + setVerticalSync( !$pref::Video::disableVerticalSync ); + } + + %temp = OP_SkyDetailMenu.getSelected(); + if ( %temp == 5 ) + $pref::SkyOn = false; + else + { + $pref::SkyOn = true; + $pref::numCloudLayers = ( 4 - %temp ); + } + + if ( $FogCoordSupported ) + $pref::Interior::TexturedFog = OP_IntTexturedFogTgl.getValue(); + + if ( $pref::Interior::VertexLighting != OP_VertexLightTgl.getValue() ) + { + $pref::Interior::VertexLighting = OP_VertexLightTgl.getValue(); + %flushTextures = true; + } + + %temp = OP_PlayerRenderMenu.getSelected(); + $pref::Player::renderMyPlayer = %temp & 1; + $pref::Player::renderMyItems = %temp & 2; + + if ( !isDemo() ) + { + switch ( OP_TexQualityMenu.getSelected() ) + { + case 1: // 8-bit + if ( !$pref::OpenGL::forcePalettedTexture || $pref::OpenGL::force16bittexture ) + { + $pref::OpenGL::forcePalettedTexture = true; + $pref::OpenGL::force16bittexture = false; + %flushTextures = true; + } + case 2: // 16-bit + if ( $pref::OpenGL::forcePalettedTexture || !$pref::OpenGL::force16bittexture ) + { + $pref::OpenGL::forcePalettedTexture = false; + $pref::OpenGL::force16bittexture = true; + %flushTextures = true; + } + case 3: // 32-bit + if ( $pref::OpenGL::forcePalettedTexture || $pref::OpenGL::force16bittexture ) + { + $pref::OpenGL::forcePalettedTexture = false; + $pref::OpenGL::force16bittexture = false; + %flushTextures = true; + } + } + OP_TexQualityMenu.clear(); + } + + $pref::Terrain::texDetail = 6 - mFloor( OP_TerrainTexSlider.getValue() ); + + // We're using the noDrawArraysAlpha variable here because we've already + // gone gold (hard to add a new profiling variable). But the Voodoo2/3/3500 + // cards that have the 256x256 texture limitation (in OpenGL) also have the + // noDrawArraysAlpha hack on...so that works out nice + %mipRange = $pref::OpenGL::noDrawArraysAlpha ? 4 : 5; + + %temp = 5 - mFloor( OP_ShapeTexSlider.getValue() * %mipRange ); + if ( $pref::OpenGL::mipReduction != %temp ) + { + $pref::OpenGL::mipReduction = %temp; + setOpenGLMipReduction( $pref::OpenGL::mipReduction ); + %flushTextures = true; + } + + %temp = 5 - mFloor( OP_BuildingTexSlider.getValue() * %mipRange ); + if ( $pref::OpenGL::interiorMipReduction != %temp ) + { + $pref::OpenGL::interiorMipReduction = %temp; + setOpenGLInteriorMipReduction( $pref::OpenGL::interiorMipReduction ); + %flushTextures = true; + } + + %temp = 5 - mFloor( OP_SkyTexSlider.getValue() * %mipRange ); + if ( $pref::OpenGL::skyMipReduction != %temp ) + { + $pref::OpenGL::skyMipReduction = %temp; + setOpenGLSkyMipReduction( $pref::OpenGL::skyMipReduction ); + %flushTextures = true; + } + + if ( $TextureCompressionSupported && !$pref::OpenGL::disableARBTextureCompression ) + { + %temp = OP_CompressMenu.getSelected(); + if ( $pref::OpenGL::allowCompression ) + { + switch ( %temp ) + { + case 2: + if ( $pref::OpenGL::compressionHint !$= "GL_FASTEST" ) + { + $pref::OpenGL::compressionHint = "GL_FASTEST"; + setOpenGLTextureCompressionHint( $pref::OpenGL::compressionHint ); + %flushTextures = true; + } + + case 3: + if ( $pref::OpenGL::compressionHint !$= "GL_NICEST" ) + { + $pref::OpenGL::compressionHint = "GL_NICEST"; + setOpenGLTextureCompressionHint( $pref::OpenGL::compressionHint ); + %flushTextures = true; + } + + default: // None + $pref::OpenGL::allowCompression = false; + %flushTextures = true; + } + } + else if ( %temp > 1 ) + { + $pref::OpenGL::allowCompression = true; + if ( %temp == 3 ) + $pref::OpenGL::compressionHint = "GL_NICEST"; + else + $pref::OpenGL::compressionHint = "GL_FASTEST"; + setOpenGLTextureCompressionHint( $pref::OpenGL::compressionHint ); + %flushTextures = true; + } + } + OP_CompressMenu.clear(); + + if ( $AnisotropySupported ) + { + %temp = OP_AnisotropySlider.getValue(); + if ( $pref::OpenGL::anisotropy != %temp ) + { + $pref::OpenGL::anisotropy = %temp; + setOpenGLAnisotropy( $pref::OpenGL::anisotropy ); + %flushTextures = true; + } + } + + if ( !isDemo() ) + { + if ( OP_HiResSkinTgl.getValue() != $pref::use512PlayerSkins ) + { + $pref::use512PlayerSkins = OP_HiResSkinTgl.getValue(); + if ( Canvas.getContent() == GameGui.getId() && GM_WarriorPane.isVisible() ) + GMW_PlayerModel.update(); + } + } + + $pref::Terrain::screenError = $max_screenerror - mFloor( OP_TerrainSlider.getValue() ); + $pref::TS::screenError = $max_TSScreenError - mFloor( OP_ShapeSlider.getValue() * ( $max_TSScreenError - $min_TSScreenError ) ); + $pref::TS::detailAdjust = $min_TSDetailAdjust + OP_ShapeSlider.getValue() * ( $max_TSDetailAdjust - $min_TSDetailAdjust ); + $pref::Shadows = OP_ShadowSlider.getValue(); + $pref::ParticleDensity = 4.0 - OP_ParticleDensitySlider.getValue(); + %val = 100 - OP_DynamicLightSlider.getValue(); + $pref::Interior::DynamicLightsClipPix = $pref::Terrain::DynamicLightsClipPix = %val; + $pref::Interior::DynamicLightsFadePix = $pref::Terrain::DynamicLightsFadePix = 2 * %val; + setShadowDetailLevel( $pref::Shadows ); + $pref::Interior::detailAdjust = OP_InteriorDetailSlider.getValue(); + $pref::VisibleDistanceMod = OP_VisibleDistanceSlider.getValue(); + + $pref::Audio::musicVolume = OP_MusicVolumeSlider.getValue(); + $pref::Audio::masterVolume = OP_MasterVolumeSlider.getValue(); + $pref::Audio::effectsVolume = OP_EffectsVolumeSlider.getValue(); + alxSetChannelVolume( $EffectAudioType, $pref::Audio::effectsVolume ); + $pref::Audio::voiceVolume = OP_MicrophoneVolumeSlider.getValue(); + alxSetChannelVolume( $VoiceAudioType, $pref::Audio::voiceVolume ); + $pref::Audio::radioVolume = OP_VoiceBindVolumeSlider.getValue(); + alxSetChannelVolume( $ChatAudioType, $pref::Audio::radioVolume ); + $pref::Audio::guiVolume = OP_GuiVolumeSlider.getValue(); + alxSetChannelVolume( $GuiAudioType, $pref::Audio::guiVolume); + $pref::Audio::captureGainScale = OP_InputBoostSlider.getValue(); + if ( !$missionRunning ) + MusicPlayer.stop(); + + if ( $pref::Audio::enableVoiceCapture ) + { + %reinit = false; + %selId = OP_VoiceListenMenu.getSelected(); + if ( $pref::Audio::decodingMask != %selId ) + { + $pref::Audio::decodingMask = %selId; + %reinit = true; + } + + %selId = OP_VoiceSendMenu.getSelected(); + if ( $pref::Audio::encodingLevel != %selId ) + { + $pref::Audio::encodingLevel = %selId; + %reinit = true; + } + + if ( %reinit ) + { + alxCaptureDestroy(); + alxCaptureInit(); + + // If in a game, let the server know about the altered settings: + if ( isObject( ServerConnection ) ) + commandToServer( 'SetVoiceInfo', $pref::Audio::voiceChannels, $pref::Audio::decodingMask, $pref::Audio::encodingLevel ); + } + } + + updateNetworkSettings(); + + $pref::Player::zoomSpeed = 500 - mFloor( OP_ZoomSpeedSlider.getValue() ); + setZoomSpeed( $pref::Player::zoomSpeed ); + + $pref::Shell::LaunchGui = OP_LaunchScreenMenu.getText(); + + export( "$pref::*", "prefs/ClientPrefs.cs", false ); + saveActiveMapFile(); + + if ( %flushTextures ) + { + // Give the Options Dialog a chance to go away: + OptionsDlg.schedule( 0, doTextureFlush ); + } + + returnFromSettings(); +} + +//------------------------------------------------------------------------------ +function OptionsDlg::doTextureFlush( %this ) +{ + MessagePopup( "PLEASE WAIT", "Flushing texture cache...\nThis may take a while" ); + Canvas.repaint(); + flushTextureCache(); + CloseMessagePopup(); +} + +//------------------------------------------------------------------------------ +function OptionsDlg::setPane( %this, %pane ) +{ + if((%this.pane $= "Sound") && !$missionRunning) + MusicPlayer.stop(); + + if ( %this.pane !$= "None" ) + { + %paneCtrl = "OP_" @ %this.pane @ "Pane"; + %paneCtrl.setVisible( false ); + + %tabCtrl = "OP_" @ %this.pane @ "Tab"; + %tabCtrl.setValue( false ); + } + + %paneCtrl = "OP_" @ %pane @ "Pane"; + %paneCtrl.setVisible( true ); + + %tabCtrl = "OP_" @ %pane @ "Tab"; + %tabCtrl.setValue( true ); + + %this.pane = %pane; +} + +//------------------------------------------------------------------------------ +function OptionsDlg::applyGraphicChanges( %this ) +{ + %newDriver = OP_VideoDriverMenu.getText(); + %newRes = OP_ResMenu.getText(); + %newBpp = OP_BPPMenu.getText(); + %newFullScreen = OP_FullScreenTgl.getValue(); + + if ( %newDriver !$= $pref::Video::displayDevice ) + { + setDisplayDevice( %newDriver, firstWord( %newRes ), getWord( %newRes, 1 ), %newBpp, %newFullScreen ); + OptionsDlg::deviceDependent( %this ); + } + else + setScreenMode( firstWord( %newRes ), getWord( %newRes, 1 ), %newBpp, %newFullScreen ); + + OP_ApplyBtn.updateState(); +} + + +//------------------------------------------------------------------------------ +function OP_VideoDriverMenu::onSelect( %this, %id, %text ) +{ + // Attempt to keep the same res and bpp settings: + if ( OP_ResMenu.size() > 0 ) + %prevRes = OP_ResMenu.getText(); + else + %prevRes = getWords( $pref::Video::resolution, 0, 1 ); + + // Check if this device is full-screen only: + if ( isDeviceFullScreenOnly( %this.getText() ) ) + { + OP_FullScreenTgl.setValue( true ); + OP_FullScreenTgl.setActive( false ); + OP_FullScreenTgl.onAction(); + } + else + OP_FullScreenTgl.setActive( true ); + + if ( OP_FullScreenTgl.getValue() ) + { + if ( OP_BPPMenu.size() > 0 ) + %prevBPP = OP_BPPMenu.getText(); + else + %prevBPP = getWord( $pref::Video::resolution, 2 ); + } + + // Fill the resolution and bit depth lists: + OP_ResMenu.init( %this.getText(), OP_FullScreenTgl.getValue() ); + OP_BPPMenu.init( %this.getText() ); + + // Try to select the previous settings: + %selId = OP_ResMenu.findText( %prevRes ); + if ( %selId == -1 ) + %selId = 0; + OP_ResMenu.setSelected( %selId ); + + if ( OP_FullScreenTgl.getValue() ) + { + %selId = OP_BPPMenu.findText( %prevBPP ); + if ( %selId == -1 ) + %selId = 0; + OP_BPPMenu.setSelected( %selId ); + OP_BPPMenu.setText( OP_BPPMenu.getTextById( %selId ) ); + } + else + OP_BPPMenu.setText( "Default" ); + + OP_ApplyBtn.updateState(); +} + +//------------------------------------------------------------------------------ +function OP_ResMenu::init( %this, %device, %fullScreen ) +{ + %this.clear(); + %resList = getResolutionList( %device ); + %resCount = getFieldCount( %resList ); + %deskRes = getDesktopResolution(); + %count = 0; + for ( %i = 0; %i < %resCount; %i++ ) + { + %res = getWords( getField( %resList, %i ), 0, 1 ); + + if ( !%fullScreen ) + { + if ( firstWord( %res ) >= firstWord( %deskRes ) ) + continue; + if ( getWord( %res, 1 ) >= getWord( %deskRes, 1 ) ) + continue; + } + + // Only add to list if it isn't there already: + if ( %this.findText( %res ) == -1 ) + { + %this.add( %res, %count ); + %count++; + } + } +} + +//------------------------------------------------------------------------------ +function OP_ResMenu::onSelect( %this, %id, %text ) +{ + OP_ApplyBtn.updateState(); +} + +//------------------------------------------------------------------------------ +function OP_BPPMenu::init( %this, %device ) +{ + %this.clear(); + + if ( %device $= "Voodoo2" ) + %this.add( "16", 0 ); + else + { + %resList = getResolutionList( %device ); + %resCount = getFieldCount( %resList ); + %count = 0; + for ( %i = 0; %i < %resCount; %i++ ) + { + %bpp = getWord( getField( %resList, %i ), 2 ); + + // Only add to list if it isn't there already: + if ( %this.findText( %bpp ) == -1 ) + { + %this.add( %bpp, %count ); + %count++; + } + } + } +} + +//------------------------------------------------------------------------------ +function OP_BPPMenu::onSelect( %this, %id, %text ) +{ + OP_ApplyBtn.updateState(); +} + +//------------------------------------------------------------------------------ +function OP_FullScreenTgl::onAction( %this ) +{ + // Attempt to maintain current settings: + %selId = OP_ResMenu.getSelected(); + if ( %selId == -1 ) + %selId = 0; + %prevRes = OP_ResMenu.getTextById( %selId ); + + OP_ResMenu.init( OP_VideoDriverMenu.getText(), %this.getValue() ); + + %selId = OP_ResMenu.findText( %prevRes ); + if ( %selId == -1 ) + %selId = 0; + OP_ResMenu.setSelected( %selId ); + + if ( %this.getValue() ) + { + %selId = OP_BPPMenu.findText( getWord( $pref::Video::resolution, 2 ) ); + if ( %selId == - 1 ) + %selId = 0; + OP_BPPMenu.setSelected( %selId ); + OP_BPPMenu.setText( OP_BPPMenu.getTextById( %selId ) ); + OP_BPPMenu.setActive( true ); + } + else + { + OP_BPPMenu.setText( "Default" ); + OP_BPPMenu.setActive( false ); + } + + OP_ApplyBtn.updateState(); +} + +//------------------------------------------------------------------------------ +function OP_ApplyBtn::updateState( %this ) +{ + %active = false; + + if ( OP_VideoDriverMenu.getText() !$= $pref::Video::displayDevice ) + %active = true; + else if ( OP_ResMenu.getText() !$= getWords( $pref::Video::resolution, 0, 1 ) ) + %active = true; + else if ( OP_FullScreenTgl.getValue() != $pref::Video::fullScreen ) + %active = true; + else if ( OP_FullScreenTgl.getValue() ) + { + if ( OP_BPPMenu.getText() !$= getWord( $pref::Video::resolution, 2 ) ) + %active = true; + } + + %this.setActive( %active ); +} + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +// Graphics Settings: +// +function updateGammaCorrection() +{ + $pref::OpenGL::gammaCorrection = OP_GammaSlider.getValue(); + videoSetGammaCorrection( $pref::OpenGL::gammaCorrection ); +} + +//------------------------------------------------------------------------------ +function updateTerrainDetail() +{ + $pref::Terrain::screenError = $max_screenerror - mFloor( OP_TerrainSlider.getValue()); + if ( OP_TerrainSlider.getValue() != $max_screenerror - $pref::Terrain::screenError ) + OP_TerrainSlider.setValue( $max_screenerror - $pref::Terrain::screenError ); +} + +//------------------------------------------------------------------------------ +function updateDynamicLightSliderState() +{ + %on = $pref::Interior::DynamicLights || $pref::Terrain::dynamicLights; + OP_DynamicLightText.setVisible( %on ); + OP_DynamicLightText_Disabled.setVisible( !%on ); + OP_DynamicLightSlider.setActive( %on ); +} + +//------------------------------------------------------------------------------ +function OP_SkyDetailMenu::init( %this ) +{ + %this.clear(); + %this.add( "Full Sky", 1 ); + %this.add( "Two Cloud Layers", 2 ); + %this.add( "One Cloud Layer", 3 ); + %this.add( "Sky Box Only", 4 ); + %this.add( "No Sky", 5 ); +} + +//------------------------------------------------------------------------------ +function OP_PlayerRenderMenu::init( %this ) +{ + %this.clear(); + %this.add( "Player and Items", 3 ); + %this.add( "Player only", 1 ); + %this.add( "Items only", 2 ); + %this.add( "Neither Player nor Items", 0 ); +} + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +// Texture Settings: +// +function OP_CompressMenu::init( %this ) +{ + %this.clear(); + %this.add( "None", 1 ); + %this.add( "Fastest", 2 ); + %this.add( "Nicest", 3 ); +} + +//------------------------------------------------------------------------------ +function OP_TexQualityMenu::init( %this ) +{ + %this.clear(); + if ( $PalettedTextureSupported ) + %this.add( "Palletized", 1 ); + %this.add( "16 bit", 2 ); + %this.add( "32 bit", 3 ); +} + +//------------------------------------------------------------------------------ +function OP_TexQualityMenu::onSelect( %this, %id, %text ) +{ + if ( %id == 1 ) + { + // Disable these with palletized textures by default: + OP_EnvMapTgl.setValue( false ); + //OP_EnvMapTgl.setActive( false ); + OP_IntEnvMapTgl.setValue( false ); + //OP_IntEnvMapTgl.setActive( false ); + } +// else +// { +// OP_EnvMapTgl.setActive( true ); +// OP_IntEnvMapTgl.setActive( true ); +// } +} + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +// Audio Settings: +// +function setAudioProvider(%idx) +{ + alxContexti(ALC_PROVIDER, %idx); + $pref::Audio::provider = alxGetContextstr(ALC_PROVIDER_NAME, %idx); + + %active = audioIsEnvironmentProvider($pref::Audio::provider); + + // unset tgl if cannot be environment provider + if(!%active) + OP_AudioEnvironmentTgl.setValue(false); + OP_AudioEnvironmentTgl.setActive(%active); + + audioUpdateProvider($pref::Audio::provider); + OP_AudioProviderMenu.setSelected(%idx); +} + +//------------------------------------------------------------------------------ +function OP_AudioEnvironmentTgl::onAction(%this) +{ + alxEnableEnvironmental(%this.getValue()); +} + +//------------------------------------------------------------------------------ +function OP_AudioProviderMenu::onSelect(%this, %id, %text) +{ + if(%id != $Audio::originalProvider) + { + if(!%this.seenWarning) + { + MessageBoxOK("Warning", "Changing sound drivers may result in incompatibilities and game oddities. If you experience such oddities, hit \"Reset\" to restore defaults.", ""); + %this.seenWarning = true; + } + OP_AudioResetProvider.setActive(true); + } + setAudioProvider(%id); +} + +//------------------------------------------------------------------------------ +function OP_AudioResetProvider::onAction(%this) +{ + setAudioProvider($Audio::originalProvider); + %this.setActive(false); +} +//------------------------------------------------------------------------------ +function OP_AudioSpeakerMenu::onSelect(%this, %id, %text) +{ + alxContexti(ALC_SPEAKER, %id); + $pref::Audio::speakerType = alxGetContextstr(ALC_SPEAKER_NAME, %id); +} + +//------------------------------------------------------------------------------ +function OP_AudioFrequencyMenu::init( %this ) +{ + %this.clear(); + %this.add( "11 KHz", 0 ); + %this.add( "22 KHz", 1 ); + %this.add( "44 KHz", 2 ); + + switch ( $pref::Audio::frequency ) + { + case 11025: %this.setSelected( 0 ); + case 22050: %this.setSelected( 1 ); + default: %this.setSelected( 2 ); + } +} + +//------------------------------------------------------------------------------ +function OP_AudioFrequencyMenu::onSelect( %this, %id, %text ) +{ + switch ( %id ) + { + case 0: %newVal = 11025; + case 1: %newVal = 22050; + default: %newVal = 44100; + } + + if ( $pref::Audio::frequency != %newVal ) + { + $pref::Audio::frequency = %newVal; + OptionsDlg.resetAudio = true; + } +} + +//------------------------------------------------------------------------------ +function OP_AudioBitRateMenu::init( %this ) +{ + %this.clear(); + %this.add( "8 bit", 0 ); + %this.add( "16 bit", 1 ); + + if ( $pref::Audio::sampleBits == 8 ) + %this.setSelected( 0 ); + else + %this.setSelected( 1 ); +} + +//------------------------------------------------------------------------------ +function OP_AudioBitRateMenu::onSelect( %this, %id, %text ) +{ + %newVal = %id == 0 ? 8 : 16; + if ( $pref::Audio::sampleBits != %newVal ) + { + $pref::Audio::sampleBits = %newVal; + OptionsDlg.resetAudio = true; + } +} + +//------------------------------------------------------------------------------ +function OP_AudioChannelsMenu::init( %this ) +{ + %this.clear(); + %this.add( "One", 0 ); + %this.add( "Two", 1 ); + + if ( $pref::Audio::channels == 1 ) + %this.setSelected( 0 ); + else + %this.setSelected( 1 ); +} + +//------------------------------------------------------------------------------ +function OP_AudioChannelsMenu::onSelect( %this, %id, %text ) +{ + %newVal = %id == 0 ? 1 : 2; + if ( $pref::Audio::channels != %newVal ) + { + $pref::Audio::channels = %newVal; + OptionsDlg.resetAudio = true; + } +} + +//------------------------------------------------------------------------------ +function OP_MusicTgl::onAction( %this ) +{ + %on = %this.getValue(); + OP_MusicVolumeLabel.setVisible( %on ); + OP_MusicVolumeLabel_Disabled.setVisible( !%on ); + OP_MusicVolumeSlider.setActive( %on ); + $pref::Audio::musicEnabled = %on; + + if ( %on ) + MusicPlayer.play(); + else + MusicPlayer.stop(); +} + +//------------------------------------------------------------------------------ +function updateMusicVolume() +{ + %volume = OP_MusicVolumeSlider.getValue(); + alxSetChannelVolume( $MusicAudioType, %volume ); +} + +//------------------------------------------------------------------------------ +function updateGuiVolume() +{ + %volume = OP_GuiVolumeSlider.getValue(); + alxSetChannelVolume( $GuiAudioType, %volume ); +} + +//------------------------------------------------------------------------------ +function updateMasterVolume() +{ + %volume = OP_MasterVolumeSlider.getValue(); + alxListenerf( AL_GAIN_LINEAR, %volume ); +} + + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +// Voice Settings: +// +function OP_MicrophoneEnabledTgl::onAction( %this ) +{ + %on = %this.getValue(); + OP_RecordTestBtn.setActive( %on ); + OP_MicVolumeLabel.setVisible( %on ); + OP_MicVolumeLabel_Disabled.setVisible( !%on ); + OP_MicrophoneVolumeSlider.setActive( %on ); + OP_InputBoostLabel.setVisible( %on ); + OP_InputBoostLabel_Disabled.setVisible( !%on ); + OP_InputBoostSlider.setActive( %on ); + OP_InputBoostPercentTxt.setVisible( %on ); + OP_VoiceListenLabel.setVisible( %on ); + OP_VoiceListenLabel_Disabled.setVisible( !%on ); + OP_VoiceListenMenu.setActive( %on ); + OP_VoiceSendLabel.setVisible( %on ); + OP_VoiceSendLabel_Disabled.setVisible( !%on ); + OP_VoiceSendMenu.setActive( %on ); + + if(%on != alxIsEnabled("capture")) + { + if(%on) + alxCaptureInit(); + else + alxCaptureDestroy(); + } +} + +//------------------------------------------------------------------------------ +function updateInputBoost() +{ + %val = OP_InputBoostSlider.getValue(); + alxSetCaptureGainScale( %val ); + %val = mFloor(%val * 100); + OP_InputBoostPercentTxt.setValue(%val @ "%"); +} + +//------------------------------------------------------------------------------ +function OP_RecordTestBtn::onAction( %this ) +{ + alxCaptureStart(true); +} + +//------------------------------------------------------------------------------ +function localCaptureStart( %method ) +{ + if(%method $= "record") + { + OP_RecordTestBtn.setActive(false); + OP_RecordTestBtn.setValue(">> Recording <<"); + } + else + { + OP_RecordTestBtn.setActive(false); + OP_RecordTestBtn.setValue(">> Playing <<"); + } +} + +//------------------------------------------------------------------------------ +function localCaptureStop( %method ) +{ + if(%method $= "play") + { + OP_RecordTestBtn.setActive(true); + OP_RecordTestBtn.setValue("Test Record"); + } +} + +//------------------------------------------------------------------------------ +function OP_VoiceListenMenu::init( %this ) +{ + %this.clear(); + %this.add( "", 0 ); + if ( $platform !$= "linux" ) { + %this.add( ".v12", 1 ); + %this.add( ".v12 - .v24", 3 ); + %this.add( ".v12 - .v29", 7 ); + } + if ( $platform $= "linux" ) { + %this.add( "GSM" , 8 ); + } + + switch ( $pref::Audio::decodingMask ) + { + case 0 or 3 or 7 or 8: + %this.setSelected( $pref::Audio::decodingMask ); + default: + %this.setSelected( 1 ); + } +} + +//------------------------------------------------------------------------------ +function OP_VoiceSendMenu::init( %this ) +{ + %this.clear(); + if ( $platform !$= "linux" ) { + %this.add( ".v12", 0 ); + %this.add( ".v24", 1 ); + %this.add( ".v29", 2 ); + } + if ( $platform $= "linux" ) { + %this.add( "GSM", 3 ); + } + + %this.setSelected($pref::Audio::encodingLevel); +} + +function OP_VoiceCodecInfo::init( %this ) +{ + %headerStyle = ""; + if ( $platform $= "linux" ) { + %displayText = "" @ %headerStyle @ "Voice Codec Information:" NL + "\n" @ + " GSM: fixed bitrate codec (6.6 kbits/sec linux only)" NL + "\n" @ + "" @ + "Setting your codec levels too high can have adverse" @ + " affects on network performance." @ + ""; + } else { + %displayText = "" @ %headerStyle @ "Voice Codec Information:" NL + "\n" @ + " .v12: variable bitrate codec (~1.2 kbits/sec win only)" NL + " .v24: fixed bitrate codec (2.4 kbits/sec win only)" NL + " .v29: fixed bitrate codec (2.9 kbits/sec win only)" NL + "\n" @ + "" @ + "Setting your codec levels too high can have adverse" @ + " affects on network performance." @ + ""; + } + + %this.setText(%displayText); + %this.setActive(false); +} + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +// Driver Info dialog: +// +function DriverInfoDlg::onWake( %this ) +{ + %headerStyle = ""; + %infoString = getVideoDriverInfo(); + %displayText = "" @ %headerStyle @ "VENDOR:" NL + " " @ getField( %infoString, 0 ) NL + "" @ %headerStyle @ "RENDERER:" NL + " " @ getField( %infoString, 1 ) NL + "" @ %headerStyle @ "VERSION " @ getField( %infoString, 2 ) NL + "\n" @ + "" @ %headerStyle @ "SUPPORTED OPENGL EXTENSIONS:" NL + getField( %infoString, 3 ); + + DriverInfoText.setText( %displayText ); +} + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +// Control remapper section: +// +$RemapCount = 0; +$RemapName[$RemapCount] = "Forward"; +$RemapCmd[$RemapCount] = "moveforward"; +$RemapCount++; +$RemapName[$RemapCount] = "Backward"; +$RemapCmd[$RemapCount] = "movebackward"; +$RemapCount++; +$RemapName[$RemapCount] = "Strafe Left"; +$RemapCmd[$RemapCount] = "moveleft"; +$RemapCount++; +$RemapName[$RemapCount] = "Strafe Right"; +$RemapCmd[$RemapCount] = "moveright"; +$RemapCount++; +$RemapName[$RemapCount] = "Turn Left"; +$RemapCmd[$RemapCount] = "turnLeft"; +$RemapCount++; +$RemapName[$RemapCount] = "Turn Right"; +$RemapCmd[$RemapCount] = "turnRight"; +$RemapCount++; +$RemapName[$RemapCount] = "Look Up"; +$RemapCmd[$RemapCount] = "panUp"; +$RemapCount++; +$RemapName[$RemapCount] = "Look Down"; +$RemapCmd[$RemapCount] = "panDown"; +$RemapCount++; +$RemapName[$RemapCount] = "Jump"; +$RemapCmd[$RemapCount] = "jump"; +$RemapCount++; +$RemapName[$RemapCount] = "Jet Pack"; +$RemapCmd[$RemapCount] = "mouseJet"; +$RemapCount++; +$RemapName[$RemapCount] = "Fire Weapon"; +$RemapCmd[$RemapCount] = "mouseFire"; +$RemapCount++; +$RemapName[$RemapCount] = "Zoom"; +$RemapCmd[$RemapCount] = "toggleZoom"; +$RemapCount++; +$RemapName[$RemapCount] = "Cycle Zoom Level"; +$RemapCmd[$RemapCount] = "setZoomFOV"; +$RemapCount++; +$RemapName[$RemapCount] = "Weapon Slot One"; +$RemapCmd[$RemapCount] = "useFirstWeaponSlot"; +$RemapCount++; +$RemapName[$RemapCount] = "Weapon Slot Two"; +$RemapCmd[$RemapCount] = "useSecondWeaponSlot"; +$RemapCount++; +$RemapName[$RemapCount] = "Weapon Slot Three"; +$RemapCmd[$RemapCount] = "useThirdWeaponSlot"; +$RemapCount++; +$RemapName[$RemapCount] = "Weapon Slot Four"; +$RemapCmd[$RemapCount] = "useFourthWeaponSlot"; +$RemapCount++; +$RemapName[$RemapCount] = "Weapon Slot Five"; +$RemapCmd[$RemapCount] = "useFifthWeaponSlot"; +$RemapCount++; +$RemapName[$RemapCount] = "Weapon Slot Six"; +$RemapCmd[$RemapCount] = "useSixthWeaponSlot"; +$RemapCount++; +$RemapName[$RemapCount] = "Blaster"; +$RemapCmd[$RemapCount] = "useBlaster"; +$RemapCount++; +$RemapName[$RemapCount] = "Plasma Rifle"; +$RemapCmd[$RemapCount] = "usePlasma"; +$RemapCount++; +$RemapName[$RemapCount] = "Chaingun"; +$RemapCmd[$RemapCount] = "useChaingun"; +$RemapCount++; +$RemapName[$RemapCount] = "Spinfusor"; +$RemapCmd[$RemapCount] = "useDisc"; +$RemapCount++; +$RemapName[$RemapCount] = "Grenade Launcher"; +$RemapCmd[$RemapCount] = "useGrenadeLauncher"; +$RemapCount++; +$RemapName[$RemapCount] = "Laser Rifle"; +$RemapCmd[$RemapCount] = "useSniperRifle"; +$RemapCount++; +$RemapName[$RemapCount] = "ELF Projector"; +$RemapCmd[$RemapCount] = "useELFGun"; +$RemapCount++; +$RemapName[$RemapCount] = "Fusion Mortar"; +$RemapCmd[$RemapCount] = "useMortar"; +$RemapCount++; +$RemapName[$RemapCount] = "Missile Launcher"; +$RemapCmd[$RemapCount] = "useMissileLauncher"; +$RemapCount++; +$RemapName[$RemapCount] = "Shocklance"; +$RemapCmd[$RemapCount] = "useShockLance"; +$RemapCount++; +$RemapName[$RemapCount] = "Targeting Laser"; +$RemapCmd[$RemapCount] = "useTargetingLaser"; +$RemapCount++; +$RemapName[$RemapCount] = "Previous Weapon"; +$RemapCmd[$RemapCount] = "prevWeapon"; +$RemapCount++; +$RemapName[$RemapCount] = "Next Weapon"; +$RemapCmd[$RemapCount] = "nextWeapon"; +$RemapCount++; +$RemapName[$RemapCount] = "Throw Grenade"; +$RemapCmd[$RemapCount] = "throwGrenade"; +$RemapCount++; +$RemapName[$RemapCount] = "Place Mine"; +$RemapCmd[$RemapCount] = "placeMine"; +$RemapCount++; +$RemapName[$RemapCount] = "Use Pack"; +$RemapCmd[$RemapCount] = "useBackpack"; +$RemapCount++; +$RemapName[$RemapCount] = "Use Health Kit"; +$RemapCmd[$RemapCount] = "useRepairKit"; +$RemapCount++; +$RemapName[$RemapCount] = "Deploy Beacon"; +$RemapCmd[$RemapCount] = "placeBeacon"; +$RemapCount++; +$RemapName[$RemapCount] = "Inventory"; +$RemapCmd[$RemapCount] = "toggleInventoryHud"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 1"; +$RemapCmd[$RemapCount] = "selectFavorite1"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 2"; +$RemapCmd[$RemapCount] = "selectFavorite2"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 3"; +$RemapCmd[$RemapCount] = "selectFavorite3"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 4"; +$RemapCmd[$RemapCount] = "selectFavorite4"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 5"; +$RemapCmd[$RemapCount] = "selectFavorite5"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 6"; +$RemapCmd[$RemapCount] = "selectFavorite6"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 7"; +$RemapCmd[$RemapCount] = "selectFavorite7"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 8"; +$RemapCmd[$RemapCount] = "selectFavorite8"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 9"; +$RemapCmd[$RemapCount] = "selectFavorite9"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 10"; +$RemapCmd[$RemapCount] = "selectFavorite10"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 11"; +$RemapCmd[$RemapCount] = "selectFavorite11"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 12"; +$RemapCmd[$RemapCount] = "selectFavorite12"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 13"; +$RemapCmd[$RemapCount] = "selectFavorite13"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 14"; +$RemapCmd[$RemapCount] = "selectFavorite14"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 15"; +$RemapCmd[$RemapCount] = "selectFavorite15"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 16"; +$RemapCmd[$RemapCount] = "selectFavorite16"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 17"; +$RemapCmd[$RemapCount] = "selectFavorite17"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 18"; +$RemapCmd[$RemapCount] = "selectFavorite18"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 19"; +$RemapCmd[$RemapCount] = "selectFavorite19"; +$RemapCount++; +$RemapName[$RemapCount] = "Favorite 20"; +$RemapCmd[$RemapCount] = "selectFavorite20"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Energy Pack"; +$RemapCmd[$RemapCount] = "quickPackEnergyPack"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Repair Pack"; +$RemapCmd[$RemapCount] = "quickPackRepairPack"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Shield Pack"; +$RemapCmd[$RemapCount] = "quickPackShieldPack"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Cloaking Pack"; +$RemapCmd[$RemapCount] = "quickPackCloakPack"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Sensor Jammer"; +$RemapCmd[$RemapCount] = "quickPackJammerPack"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Ammo Pack"; +$RemapCmd[$RemapCount] = "quickPackAmmoPack"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Satchel Charge"; +$RemapCmd[$RemapCount] = "quickPackSatchelCharge"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Inv Station"; +$RemapCmd[$RemapCount] = "quickPackDeployableStation"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Spider Turret"; +$RemapCmd[$RemapCount] = "quickPackIndoorTurret"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Landspike Turret"; +$RemapCmd[$RemapCount] = "quickPackOutdoorTurret"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Motion Sensor"; +$RemapCmd[$RemapCount] = "quickPackMotionSensor"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Deploy Pulse"; +$RemapCmd[$RemapCount] = "quickPackPulse"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Plasma Barrel"; +$RemapCmd[$RemapCount] = "quickPackPlasmaBarrel"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Missile Barrel"; +$RemapCmd[$RemapCount] = "quickPackMissileBarrel"; +$RemapCount++; +$RemapName[$RemapCount] = "Select AA Barrel"; +$RemapCmd[$RemapCount] = "quickPackAABarrel"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Mortar Barrel"; +$RemapCmd[$RemapCount] = "quickPackMortarBarrel"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Elf Barrel"; +$RemapCmd[$RemapCount] = "quickPackElfBarrel"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Grenade"; +$RemapCmd[$RemapCount] = "quickPackGrenade"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Flash Grenade"; +$RemapCmd[$RemapCount] = "quickPackFlashGrenade"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Concussion"; +$RemapCmd[$RemapCount] = "quickPackConcussionGrenade"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Camera"; +$RemapCmd[$RemapCount] = "quickPackCameraGrenade"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Flare Grenade"; +$RemapCmd[$RemapCount] = "quickPackFlareGrenade"; +$RemapCount++; +$RemapName[$RemapCount] = "Command Circuit"; +$RemapCmd[$RemapCount] = "toggleCommanderMap"; +$RemapCount++; +$RemapName[$RemapCount] = "Toggle Task List"; +$RemapCmd[$RemapCount] = "toggleTaskListDlg"; +$RemapCount++; +$RemapName[$RemapCount] = "Accept Task"; +$RemapCmd[$RemapCount] = "fnAcceptTask"; +$RemapCount++; +$RemapName[$RemapCount] = "Decline Task"; +$RemapCmd[$RemapCount] = "fnDeclineTask"; +$RemapCount++; +$RemapName[$RemapCount] = "Task Completed"; +$RemapCmd[$RemapCount] = "fnTaskCompleted"; +$RemapCount++; +$RemapName[$RemapCount] = "Reset Task List"; +$RemapCmd[$RemapCount] = "fnResetTaskList"; +$RemapCount++; +$RemapName[$RemapCount] = "Vote Yes"; +$RemapCmd[$RemapCount] = "voteYes"; +$RemapCount++; +$RemapName[$RemapCount] = "Vote No"; +$RemapCmd[$RemapCount] = "voteNo"; +$RemapCount++; +$RemapName[$RemapCount] = "Voice Chat Menu"; +$RemapCmd[$RemapCount] = "activateChatMenuHud"; +$RemapCount++; +$RemapName[$RemapCount] = "Global Chat"; +$RemapCmd[$RemapCount] = "ToggleMessageHud"; +$RemapCount++; +$RemapName[$RemapCount] = "Team Chat"; +$RemapCmd[$RemapCount] = "TeamMessageHud"; +$RemapCount++; +$RemapName[$RemapCount] = "Resize Chat Hud"; +$RemapCmd[$RemapCount] = "resizeChatHud"; +$RemapCount++; +$RemapName[$RemapCount] = "Toggle Microphone"; +$RemapCmd[$RemapCount] = "voiceCapture"; +$RemapCount++; +$RemapName[$RemapCount] = "Toggle Help Text"; +$RemapCmd[$RemapCount] = "toggleHelpGui"; +$RemapCount++; +$RemapName[$RemapCount] = "Score Screen"; +$RemapCmd[$RemapCount] = "toggleScoreScreen"; +$RemapCount++; +$RemapName[$RemapCount] = "Free Look"; +$RemapCmd[$RemapCount] = "toggleFreeLook"; +$RemapCount++; +$RemapName[$RemapCount] = "Exterior View"; +$RemapCmd[$RemapCount] = "toggleFirstPerson"; +$RemapCount++; +$RemapName[$RemapCount] = "Drop Weapon"; +$RemapCmd[$RemapCount] = "throwWeapon"; +$RemapCount++; +$RemapName[$RemapCount] = "Drop Pack"; +$RemapCmd[$RemapCount] = "throwPack"; +$RemapCount++; +$RemapName[$RemapCount] = "Drop Flag"; +$RemapCmd[$RemapCount] = "throwFlag"; +$RemapCount++; +$RemapName[$RemapCount] = "Suicide"; +$RemapCmd[$RemapCount] = "suicide"; +$RemapCount++; +$RemapName[$RemapCount] = "Toggle Personal Wypts"; +$RemapCmd[$RemapCount] = "toggleHudWaypoints"; +$RemapCount++; +$RemapName[$RemapCount] = "Toggle Mission Wypts"; +$RemapCmd[$RemapCount] = "toggleHudMarkers"; +$RemapCount++; +$RemapName[$RemapCount] = "Toggle Beacons"; +$RemapCmd[$RemapCount] = "toggleHudTargets"; +$RemapCount++; +$RemapName[$RemapCount] = "Toggle Commands"; +$RemapCmd[$RemapCount] = "toggleHudCommands"; +$RemapCount++; +$RemapName[$RemapCount] = "Construction Tool"; +$RemapCmd[$RemapCount] = "useConstructionTool"; +$RemapCount++; + +// Construction +$RemapName[$RemapCount] = "Select Light Support Beam"; +$RemapCmd[$RemapCount] = "quickPackLightSupportBeam"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Light Walkway"; +$RemapCmd[$RemapCount] = "quickPackLightWalkway"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Light Blast Wall"; +$RemapCmd[$RemapCount] = "quickPackLightBlastWall"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Medium Support Beam"; +$RemapCmd[$RemapCount] = "quickPackMediumSupportBeam"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Medium Floor"; +$RemapCmd[$RemapCount] = "quickPackMediumFloor"; +$RemapCount++; +//$RemapName[$RemapCount] = "Select Disc Turret"; +//$RemapCmd[$RemapCount] = "quickPackDiscTurret"; +//$RemapCount++; +$RemapName[$RemapCount] = "Select Large Inventory Station"; +$RemapCmd[$RemapCount] = "quickPackLargeInventoryStation"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Generator Pack"; +$RemapCmd[$RemapCount] = "quickPackGeneratorPack"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Solar Panel Pack"; +$RemapCmd[$RemapCount] = "quickPackSolarPanelPack"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Switch Pack"; +$RemapCmd[$RemapCount] = "quickPackSwitchPack"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Medium Sensor Pack"; +$RemapCmd[$RemapCount] = "quickPackMediumSensorPack"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Large Sensor Pack"; +$RemapCmd[$RemapCount] = "quickPackLargeSensorPack"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Teleport Pad"; +$RemapCmd[$RemapCount] = "quickPackTeleportPad"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Deployable Turret Base"; +$RemapCmd[$RemapCount] = "quickPackDeployableTurretBase"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Energizer"; +$RemapCmd[$RemapCount] = "quickPackEnergizer"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Tree Pack"; +$RemapCmd[$RemapCount] = "quickPackTreePack"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Crate Pack"; +$RemapCmd[$RemapCount] = "quickPackCratePack"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Decoration Pack"; +$RemapCmd[$RemapCount] = "quickPackDecorationPack"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Light Pack"; +$RemapCmd[$RemapCount] = "quickPackLightPack"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Tripwire Pack"; +$RemapCmd[$RemapCount] = "quickPackTripwirePack"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Logo Projector Pack"; +$RemapCmd[$RemapCount] = "quickPackLogoProjectorPack"; +$RemapCount++; +//$RemapName[$RemapCount] = "Select Laser Turret"; +//$RemapCmd[$RemapCount] = "quickPackLaserTurret"; +//$RemapCount++; +$RemapName[$RemapCount] = "Select Missile Rack Turret"; +$RemapCmd[$RemapCount] = "quickPackMissileRackTurret"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Force Field"; +$RemapCmd[$RemapCount] = "quickPackForceField"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Gravity Field"; +$RemapCmd[$RemapCount] = "quickPackGravityField"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Jump Pad"; +$RemapCmd[$RemapCount] = "quickPackJumpPad"; +$RemapCount++; +$RemapName[$RemapCount] = "Select Escape Pod"; +$RemapCmd[$RemapCount] = "quickPackEscapePod"; +$RemapCount++; +$RemapName[$RemapCount] = "Pack Setting: Fwd"; +$RemapCmd[$RemapCount] = "cyclePackFwd"; +$RemapCount++; +$RemapName[$RemapCount] = "Pack Setting: Back"; +$RemapCmd[$RemapCount] = "cyclePackBack"; +$RemapCount++; +$RemapName[$RemapCount] = "Pack Setting: FFwd"; +$RemapCmd[$RemapCount] = "cyclePackFFwd"; +$RemapCount++; +$RemapName[$RemapCount] = "Pack Setting: FBack"; +$RemapCmd[$RemapCount] = "cyclePackFBack"; +$RemapCount++; +$RemapName[$RemapCount] = "Emote: Sit Down"; +$RemapCmd[$RemapCount] = "emoteSitDown"; +$RemapCount++; +$RemapName[$RemapCount] = "Emote: Squat"; +$RemapCmd[$RemapCount] = "emoteSquat"; +$RemapCount++; +$RemapName[$RemapCount] = "Emote: Jig"; +$RemapCmd[$RemapCount] = "emoteJig"; +$RemapCount++; +$RemapName[$RemapCount] = "Emote: Lie Down"; +$RemapCmd[$RemapCount] = "emoteLieDown"; +$RemapCount++; +$RemapName[$RemapCount] = "Emote: Heart Attack"; +$RemapCmd[$RemapCount] = "emoteHeartAttack"; +$RemapCount++; +$RemapName[$RemapCount] = "Emote: Sucker Punched"; +$RemapCmd[$RemapCount] = "emoteSuckerPunched"; +$RemapCount++; +$quickPackExtrasBind = true; +// End Construction + +if ( !isDemo() ) +{ + $RemapName[$RemapCount] = "Start Demo Record"; + $RemapCmd[$RemapCount] = "startRecordingDemo"; + $RemapCount++; + $RemapName[$RemapCount] = "Stop Demo Record"; + $RemapCmd[$RemapCount] = "stopRecordingDemo"; + $RemapCount++; +} +$RemapName[$RemapCount] = "Chat Page Up"; +$RemapCmd[$RemapCount] = "pageMessageHudUp"; +$RemapCount++; +$RemapName[$RemapCount] = "Chat Page Down"; +$RemapCmd[$RemapCount] = "pageMessageHudDown"; +$RemapCount++; +$RemapName[$RemapCount] = "Toggle Net Meter"; +$RemapCmd[$RemapCount] = "toggleNetDisplayHud"; +$RemapCount++; + +$ObsRemapCount = 0; +$ObsRemapName[$ObsRemapCount] = "Move Up"; +$ObsRemapCmd[$ObsRemapCount] = "moveup"; +$ObsRemapCount++; +$ObsRemapName[$ObsRemapCount] = "Move Down"; +$ObsRemapCmd[$ObsRemapCount] = "movedown"; +$ObsRemapCount++; +$ObsRemapName[$ObsRemapCount] = "Toggle Observer Mode"; +$ObsRemapCmd[$ObsRemapCount] = "jump"; +$ObsRemapCount++; +$ObsRemapName[$ObsRemapCount] = "Spawn/Previous"; +$ObsRemapCmd[$ObsRemapCount] = "mouseFire"; +$ObsRemapCount++; +$ObsRemapName[$ObsRemapCount] = "Cycle Camera/Next"; +$ObsRemapCmd[$ObsRemapCount] = "mouseJet"; +$ObsRemapCount++; + +//------------------------------------------------------------------------------ +function restoreDefaultMappings() +{ + moveMap.delete(); + exec( "scripts/controlDefaults.cs" ); + $pref::Input::ActiveConfig = "MyConfig"; + OP_RemapList.fillList(); +} + +//------------------------------------------------------------------------------ +function isMapFile( %file ) +{ + %fObject = new FileObject(); + if ( !%fObject.openForRead( %file ) ) + return( false ); + + while ( !%fObject.isEOF() ) + { + %line = %fObject.readLine(); + if ( %line $= "// Tribes 2 Input Map File" ) + { + %fObject.close(); + return( true ); + } + } + + %fObject.close(); + return( false ); +} + +//------------------------------------------------------------------------------ +function isValidMapFileSaveName( %file ) +{ + if (isDemo()) + %basePath = "demo_base/"; + else + %basePath = "base/"; + if ( !isWriteableFileName( %basePath @ %file ) ) + return( false ); + + if ( isFile( %file ) ) + return( isMapFile( %file ) ); + + return( true ); +} + +//------------------------------------------------------------------------------ +function loadMapFile( %filename ) +{ + exec( "prefs/" @ %filename @ ".cs" ); + $pref::Input::ActiveConfig = %filename; + OP_RemapList.fillList(); +} + +//------------------------------------------------------------------------------ +function saveActiveMapFile() +{ + if ( isValidMapFileSaveName( "prefs/" @ $pref::Input::ActiveConfig @ ".cs" ) ) + saveMapFile( $pref::Input::ActiveConfig ); + else + ShellGetSaveFilename( "SAVE CONTROL CONFIG", "prefs/*.cs", "isMapFile", "saveMapFile", "" ); +} + +//------------------------------------------------------------------------------ +function saveMapFile( %filename ) +{ + if ( strcspn( %filename, "\\/?*\"\'<>|" ) < strlen( %filename ) ) + { + MessageBoxOK( "SAVE FAILED", "Filenames may not contain any of the following characters:" NL "\\ / ? * < > \" \' |", + "ShellGetSaveFilename( \"SAVE CONTROL CONFIG\", \"prefs/*.cs\", \"isMapFile\", \"saveMapFile\", $pref::Input::ActiveConfig );" ); + return; + } + + if (isDemo()) + %basePath = "demo_base/"; + else + %basePath = "base/"; + %mapFile = "prefs/" @ %filename @ ".cs"; + if ( !isWriteableFileName( %basePath @ %mapFile ) ) + { + MessageBoxOK( "SAVE FAILED", "That is not a writeable file name. Please choose another file name.", + "ShellGetSaveFilename( \"SAVE CONTROL CONFIG\", \"prefs/*.cs\", \"isMapFile\", \"saveMapFile\", $pref::Input::ActiveConfig );" ); + return; + } + + if ( isFile( %mapFile ) && !isMapFile( %mapFile ) ) + { + MessageBoxOK( "SAVE FAILED", "A file of that name already exists and is not an input configuration file. Please choose another file name.", + "ShellGetSaveFilename( \"SAVE CONTROL CONFIG\", \"prefs/*.cs\", \"isMapFile\", \"saveMapFile\", $pref::Input::ActiveConfig );" ); + return; + } + + moveMap.save( %mapFile ); + // Append the observer action map: + observerMap.save( %mapFile, true ); + + // Write out the console toggle key: + %fObject = new FileObject(); + if ( %fObject.openForAppend( %mapFile ) ) + { + %bind = GlobalActionMap.getBinding( "toggleConsole" ); + if ( %bind !$= "" ) + { + %fObject.writeLine( "GlobalActionMap.bind(keyboard, \"" @ getField( %bind, 1 ) @ "\", toggleConsole);" ); + %fObject.close(); + } + } + %fObject.delete(); + + $pref::Input::ActiveConfig = %filename; +} + +//------------------------------------------------------------------------------ +function getMapDisplayName( %device, %action ) +{ + if ( %device $= "keyboard" ) + return( %action ); + else if ( strstr( %device, "mouse" ) != -1 ) + { + // Substitute "mouse" for "button" in the action string: + %pos = strstr( %action, "button" ); + if ( %pos != -1 ) + { + %mods = getSubStr( %action, 0, %pos ); + %object = getSubStr( %action, %pos, 1000 ); + %instance = getSubStr( %object, strlen( "button" ), 1000 ); + return( %mods @ "mouse" @ ( %instance + 1 ) ); + } + else + error( "Mouse input object other than button passed to getDisplayMapName!" ); + } + else if ( strstr( %device, "joystick" ) != -1 ) + { + // Substitute "joystick" for "button" in the action string: + %pos = strstr( %action, "button" ); + if ( %pos != -1 ) + { + %mods = getSubStr( %action, 0, %pos ); + %object = getSubStr( %action, %pos, 1000 ); + %instance = getSubStr( %object, strlen( "button" ), 1000 ); + return( %mods @ "joystick" @ ( %instance + 1 ) ); + } + else + { + %pos = strstr( %action, "pov" ); + if ( %pos != -1 ) + { + %wordCount = getWordCount( %action ); + %mods = %wordCount > 1 ? getWords( %action, 0, %wordCount - 2 ) @ " " : ""; + %object = getWord( %action, %wordCount - 1 ); + switch$ ( %object ) + { + case "upov": %object = "POV1 up"; + case "dpov": %object = "POV1 down"; + case "lpov": %object = "POV1 left"; + case "rpov": %object = "POV1 right"; + case "upov2": %object = "POV2 up"; + case "dpov2": %object = "POV2 down"; + case "lpov2": %object = "POV2 left"; + case "rpov2": %object = "POV2 right"; + default: %object = "??"; + } + return( %mods @ %object ); + } + else + error( "Unsupported Joystick input object passed to getDisplayMapName!" ); + } + } + + return( "??" ); +} + +//------------------------------------------------------------------------------ +function buildFullMapString( %index ) +{ + switch$ ( OP_ControlsPane.group ) + { + case "Observer": + %actionMap = observerMap; + %name = $ObsRemapName[%index]; + %cmd = $ObsRemapCmd[%index]; + + default: + %actionMap = moveMap; + %name = $RemapName[%index]; + %cmd = $RemapCmd[%index]; + } + + %temp = %actionMap.getBinding( %cmd ); + %device = getField( %temp, 0 ); + %object = getField( %temp, 1 ); + if ( %device !$= "" && %object !$= "" ) + %mapString = getMapDisplayName( %device, %object ); + else + %mapString = ""; + + return( %name TAB %mapString ); +} + +//------------------------------------------------------------------------------ +function OP_ControlGroupMenu::init( %this ) +{ + %selId = %this.getSelected(); + %this.clear(); + %this.add( "Main", 0 ); + %this.add( "Observer", 1 ); + %this.setSelected( %selId ); + %this.onSelect( %selId, %this.getTextById( %selId ) ); +} + +//------------------------------------------------------------------------------ +function OP_ControlGroupMenu::onSelect( %this, %id, %text ) +{ + OP_ControlsPane.group = %text; + OP_RemapList.fillList(); +} + +//------------------------------------------------------------------------------ +function OP_RemapList::fillList( %this ) +{ + switch$ ( OP_ControlsPane.group ) + { + case "Observer": %count = $ObsRemapCount; + default: %count = $RemapCount; + } + + %this.clear(); + for ( %i = 0; %i < %count; %i++ ) + %this.addRow( %i, buildFullMapString( %i ) ); + + // Set the console key: + %bind = GlobalActionMap.getBinding( "toggleConsole" ); + OP_ConsoleKeyBtn.setValue( getField( %bind, 1 ) ); +} + +//------------------------------------------------------------------------------ +function OP_RemapList::onDeleteKey( %this, %rowId ) +{ + switch$ ( OP_ControlsPane.group ) + { + case "Observer": + %actionMap = observerMap; + %cmd = $ObsRemapCmd[%rowId]; + default: + %actionMap = moveMap; + %cmd = $RemapCmd[%rowId]; + } + clearMapping( %actionMap, %cmd ); + %this.setRowById( %rowId, buildFullMapString( %rowId ) ); +} + +//------------------------------------------------------------------------------ +function OP_RemapList::doRemap( %this ) +{ + %selId = %this.getSelectedId(); + switch$ ( OP_ControlsPane.group ) + { + case "Observer": %name = $ObsRemapName[%selId]; + default: %name = $RemapName[%selId]; + } + + RemapFrame.setTitle( "REMAP \"" @ %name @ "\"" ); + RemapInputCtrl.mode = "move"; + RemapInputCtrl.index = %selId; + Canvas.pushDialog( RemapDlg ); +} + +//------------------------------------------------------------------------------ +function OP_ConsoleKeyBtn::doRemap( %this ) +{ + RemapFrame.setTitle( "REMAP \"Toggle Console\"" ); + RemapInputCtrl.mode = "consoleKey"; + RemapInputCtrl.index = 0; + Canvas.pushDialog( RemapDlg ); +} + +//------------------------------------------------------------------------------ +function RemapDlg::onWake( %this ) +{ + $enableDirectInput = "1"; + activateDirectInput(); + + if ( RemapInputCtrl.mode $= "consoleKey" ) + RemapText.setText( "Press a key to assign it to this action" NL "or Esc to cancel..." ); + else + RemapText.setText( "Press a key or button to assign it to this action" NL "or Esc to cancel..." ); +} + +//------------------------------------------------------------------------------ +function RemapDlg::onSleep( %this ) +{ + $enableDirectInput = "1"; + deactivateDirectInput(); +} + +//------------------------------------------------------------------------------ +function findRemapCmdIndex( %command ) +{ + switch$ ( OP_ControlsPane.group ) + { + case "Observer": + for ( %i = 0; %i < $ObsRemapCount; %i++ ) + { + if ( %command $= $ObsRemapCmd[%i] ) + return( %i ); + } + default: + for ( %i = 0; %i < $RemapCount; %i++ ) + { + if ( %command $= $RemapCmd[%i] ) + return( %i ); + } + } + + return( -1 ); +} + +//------------------------------------------------------------------------------ +function clearMapping( %actionMap, %cmd ) +{ + %fullMapString = %actionMap.getBinding( %cmd ); + %mapCount = getRecordCount( %fullMapString ); + for ( %i = 0; %i < %mapCount; %i++ ) + { + %temp = getRecord( %fullMapString, %i ); + %actionMap.unbind( getField( %temp, 0 ), getField( %temp, 1 ) ); + } +} + +//------------------------------------------------------------------------------ +function redoMapping( %actionMap, %device, %action, %cmd, %oldIndex, %newIndex ) +{ + //%actionMap.bind( %device, %action, $RemapCmd[%newIndex] ); + %actionMap.bind( %device, %action, %cmd ); + OP_RemapList.setRowById( %oldIndex, buildFullMapString( %oldIndex ) ); + OP_RemapList.setRowById( %newIndex, buildFullMapString( %newIndex ) ); +} + +//------------------------------------------------------------------------------ +function redoConsoleMapping( %action, %oldIndex ) +{ + moveMap.unbind( "keyboard", %action ); + GlobalActionMap.bind( "keyboard", %action, "toggleConsole" ); + OP_ConsoleKeyBtn.setValue( %action ); + OP_RemapList.setRowById( %oldIndex, buildFullMapString( %oldIndex ) ); +} + +//------------------------------------------------------------------------------ +function RemapInputCtrl::onInputEvent( %this, %device, %action ) +{ + //error( "** onInputEvent called - device = " @ %device @ ", action = " @ %action @ " **" ); + Canvas.popDialog( RemapDlg ); + + // Test for the reserved keystrokes: + if ( %device $= "keyboard" ) + { + // Cancel... + if ( %action $= "escape" ) + { + // Do nothing... + return; + } + } + + if ( %this.mode $= "consoleKey" ) + { + if ( %device !$= "keyboard" ) + { + MessageBoxOK( "REMAP FAILED", "This command can only be bound to keys on the keyboard!" ); + return; + } + + %prevMap = GlobalActionMap.getCommand( %device, %action ); + if ( %prevMap !$= "" ) + { + MessageBoxOK( "REMAP FAILED", "\"" @ getMapDisplayName( %device, %action ) @ "\" is already bound to a non-remappable command!" ); + return; + } + + %mvMap = moveMap.getCommand( %device, %action ); + if ( %mvMap $= "" ) + { + GlobalActionMap.bind( %device, %action, "toggleConsole" ); + OP_ConsoleKeyBtn.setValue( %action ); + } + else + { + %mapName = getMapDisplayName( %device, %action ); + %mvMapIndex = findRemapCmdIndex( %mvMap ); + if ( %mvMapIndex == -1 ) + MessageBoxOK( "REMAP FAILED", "\"" @ %mapName @ "\" is already bound to a non-remappable command!" ); + else + MessageBoxYesNo( "WARNING", "\"" @ %mapName @ "\" is already bound to \"" + @ $RemapName[%mvMapIndex] @ "\"!" + NL "Do you want to undo this mapping?", + "redoConsoleMapping(\"" @ %action @ "\", " @ %mvMapIndex @ ");", "" ); + return; + } + } + else + { + switch$ ( OP_ControlsPane.group ) + { + case "Observer": + %actionMap = observerMap; + %cmd = $ObsRemapCmd[%this.index]; + %name = $ObsRemapName[%this.index]; + + default: + %actionMap = moveMap; + %cmd = $RemapCmd[%this.index]; + %name = $RemapName[%this.index]; + } + + // First check to see if the given action is already mapped: + %prevMap = %actionMap.getCommand( %device, %action ); + if ( %prevMap !$= %cmd ) + { + if ( %prevMap $= "" ) + { + %actionMap.bind( %device, %action, %cmd ); + OP_RemapList.setRowById( %this.index, buildFullMapString( %this.index ) ); + } + else + { + %mapName = getMapDisplayName( %device, %action ); + %prevMapIndex = findRemapCmdIndex( %prevMap ); + if ( %prevMapIndex == -1 ) + MessageBoxOK( "REMAP FAILED", "\"" @ %mapName @ "\" is already bound to a non-remappable command!" ); + else + { + switch$ ( OP_ControlsPane.group ) + { + case "Observer": + %prevCmdName = $ObsRemapName[%prevMapIndex]; + default: + %prevCmdName = $RemapName[%prevMapIndex]; + } + + MessageBoxYesNo( "WARNING", + "\"" @ %mapName @ "\" is already bound to \"" + @ %prevCmdName @ "\"!\nDo you want to undo this mapping?", + "redoMapping(" @ %actionMap @ ", " @ %device @ ", \"" @ %action @ "\", \"" @ %cmd @ "\", " @ %prevMapIndex @ ", " @ %this.index @ ");", "" ); + } + return; + } + } + } +} + +//------------------------------------------------------------------------------ +function OP_JoystickTgl::onAction( %this ) +{ + %on = %this.getValue(); + if ( %on ) + enableJoystick(); + else + disableJoystick(); + + OP_ConfigureJoystickBtn.setActive( %on ); +} + +//------------------------------------------------------------------------------ +function MouseConfigDlg::onWake( %this ) +{ + MouseXSlider.setValue( moveMap.getScale( mouse, xaxis ) / 2 ); + MouseYSlider.setValue( moveMap.getScale( mouse, yaxis ) / 2 ); + InvertMouseTgl.setValue( moveMap.isInverted( mouse, yaxis ) ); + + MouseZActionMenu.clear(); + MouseZActionMenu.add( "Nothing", 1 ); + MouseZActionMenu.add( "Cycle Weapon", 2 ); + MouseZActionMenu.add( "Next Weapon Only", 3 ); +// MouseZActionMenu.add( "Cycle Zoom Level", 4 ); + + %bind = moveMap.getCommand( "mouse", "zaxis" ); + %selId = 1; + switch$ ( %bind ) + { + case "cycleWeaponAxis": + %selId = 2; + case "cycleNextWeaponOnly": + %selId = 3; + } + MouseZActionMenu.setSelected( %selId ); +} + +//------------------------------------------------------------------------------ +function MouseConfigDlg::onOK( %this ) +{ + %xSens = MouseXSlider.getValue() * 2; + %ySens = MouseYSlider.getValue() * 2; + moveMap.bind( mouse, xaxis, "S", %xSens, "yaw" ); + %yFlags = InvertMouseTgl.getValue() ? "SI" : "S"; + moveMap.bind( mouse, yaxis, %yFlags, %ySens, "pitch" ); + + switch ( MouseZActionMenu.getSelected() ) + { + case 2: + moveMap.bind( mouse, zaxis, cycleWeaponAxis ); + case 3: + moveMap.bind( mouse, zaxis, cycleNextWeaponOnly ); + default: + moveMap.unbind( mouse, zaxis ); + } + + Canvas.popDialog( MouseConfigDlg ); +} + +//------------------------------------------------------------------------------ +function MouseXSlider::sync( %this ) +{ + %thisValue = %this.getValue(); + MouseXText.setValue( "(" @ getSubStr( %thisValue, 0, 4 ) @ ")" ); + if ( $pref::Input::LinkMouseSensitivity ) + { + if ( MouseYSlider.getValue() != %thisValue ) + MouseYSlider.setValue( %thisValue ); + } +} + +//------------------------------------------------------------------------------ +function MouseYSlider::sync( %this ) +{ + %thisValue = %this.getValue(); + MouseYText.setValue( "(" @ getSubStr( %thisValue, 0, 4 ) @ ")" ); + if ( $pref::Input::LinkMouseSensitivity ) + { + if ( MouseXSlider.getValue() != %thisValue ) + MouseXSlider.setValue( %thisValue ); + } +} + +//------------------------------------------------------------------------------ +// Joystick Config dialog: +//------------------------------------------------------------------------------ +$JoyRemapCount = 0; +$JoyRemapName[$JoyRemapCount] = "Look Up/Down"; +$JoyRemapCmd[$JoyRemapCount] = "joyPitch"; +$JoyRemapCount++; +$JoyRemapName[$JoyRemapCount] = "Turn Left/Right"; +$JoyRemapCmd[$JoyRemapCount] = "joyYaw"; +$JoyRemapCount++; +$JoyRemapName[$JoyRemapCount] = "Move Forward/Backward"; +$JoyRemapCmd[$JoyRemapCount] = "joystickMoveY"; +$JoyRemapCount++; +$JoyRemapName[$JoyRemapCount] = "Strafe Left/Right"; +$JoyRemapCmd[$JoyRemapCount] = "joystickMoveX"; +$JoyRemapCount++; +$JoyRemapName[$JoyRemapCount] = "Cycle Weapon"; +$JoyRemapCmd[$JoyRemapCount] = "cycleWeaponAxis"; +$JoyRemapCount++; + +//------------------------------------------------------------------------------ +function JoystickConfigDlg::onWake( %this ) +{ + // Add all of the axis tabs: + %temp = getJoystickAxes( 0 ); + %tryCount = getField( %temp, 0 ); + $JoyAxisCount = 0; + + for ( %i = 0; %i < %tryCount; %i++ ) + { + %type = getField( %temp, %i + 1 ); + switch$ ( %type ) + { + case "X": %tabName = "X Axis"; %tabType = "xaxis"; + case "Y": %tabName = "Y Axis"; %tabType = "yaxis"; + case "Z": %tabName = "Z Axis"; %tabType = "zaxis"; + case "R": %tabName = "R Axis"; %tabType = "rxaxis"; + case "U": %tabName = "U Axis"; %tabType = "ryaxis"; + case "V": %tabName = "V Axis"; %tabType = "rzaxis"; + case "S": %tabName = "Slider"; %tabType = "slider"; + case "L": %tabName = "Slider 2"; %tabType = "slider2"; + default: %tabName = ""; + } + + if ( %tabName !$= "" ) + { + $JoyAxisTab[$JoyAxisCount] = new ShellTabButton() { + profile = "ShellTabProfile"; + horizSizing = "right"; + vertSizing = "bottom"; + position = "29" SPC ( 52 + ( %i * 30 ) ); + extent = "100 38"; + minExtent = "48 38"; + visible = "1"; + command = "JoystickConfigDlg.setPane(" @ %i @ ");"; + helpTag = "0"; + text = %tabName; + type = %tabType; + }; + + $JoyAxisCount++; + JoystickConfigFrame.add( $JoyAxisTab[%i] ); + } + } + + // Fill the action menu: + JoyAxisActionMenu.clear(); + for ( %i = 0; %i < $JoyRemapCount; %i++ ) + JoyAxisActionMenu.add( $JoyRemapName[%i], %i ); + JoyAxisActionMenu.add( "Nothing", 255 ); + + // Select the first axis: + %this.setPane( %this.pane ); +} + +//------------------------------------------------------------------------------ +function JoystickConfigDlg::onSleep( %this ) +{ + // Save the current pane's settings: + bindJoystickAxis( %this.pane, JoyAxisActionMenu.getSelected() ); + for ( %i = 0; %i < $JoyAxisCount; %i++ ) + { + JoystickConfigFrame.remove( $JoyAxisTab[%i] ); + $JoyAxisTab[%i].delete(); + } +} + +//------------------------------------------------------------------------------ +function JoystickConfigDlg::setPane( %this, %pane ) +{ + if ( %this.pane != %pane ) + { + // Save the previous axes' settings: + bindJoystickAxis( %this.pane, JoyAxisActionMenu.getSelected() ); + %this.pane = %pane; + } + + for ( %i = 0; %i < $joyAxisCount; %i++ ) + $JoyAxisTab[%i].setValue( %i == %pane ); + + // Update the config controls: + %axisType = $JoyAxisTab[%pane].type; + %bind = moveMap.getCommand( "joystick", %axisType ); + if ( %bind !$= "" ) + { + for ( %i = 0; %i < $JoyRemapCount; %i++ ) + { + if ( $JoyRemapCmd[%i] $= %bind ) + { + JoyAxisActionMenu.setSelected( %i ); + JoyAxisActionMenu.setText( $JoyRemapName[%i] ); + JoyAxisActionMenu.onSelect( %i, "" ); + break; + } + } + + if ( %i == $JoyRemapCount ) + { + JoyAxisActionMenu.setSelected( 255 ); // 255 is the code for "Nothing" + JoyAxisActionMenu.onSelect( 255, "" ); + } + + %scale = moveMap.getScale( "joystick", %axisType ); + JoyAxisSlider.setValue( %scale / 100 ); + %deadZone = moveMap.getDeadZone( "joystick", %axisType ); + if ( %deadZone $= "0 0" ) + DeadZoneSlider.setValue( 0.0 ); + else + DeadZoneSlider.setValue( abs( firstWord( %deadZone ) ) / %scale ); + InvertJoyAxisTgl.setValue( moveMap.isInverted( "joystick", %axisType ) ); + //JoyAxisRelativeTgl.setValue( moveMap.isRelativeAxis( "joystick", %axisType ) ); + } + else + { + JoyAxisActionMenu.setSelected( 255 ); // 255 is the code for "Nothing" + JoyAxisActionMenu.onSelect( 255, "" ); + JoyAxisSlider.setValue( 0.5 ); + DeadZoneSlider.setValue( 0.0 ); + InvertJoyAxisTgl.setValue( false ); + //JoyAxisRelativeTgl.setValue( %axisType $= "slider" ); + } +} + +//------------------------------------------------------------------------------ +function JoyAxisActionMenu::onSelect( %this, %id, %text ) +{ + %on = ( %id < $JoyRemapCount ); + JoyAxisSlider.setActive( %on ); + JoySensText.setVisible( %on ); + DeadZoneSlider.setActive( %on ); + DeadZoneText.setVisible( %on ); + InvertJoyAxisTgl.setActive( %on ); + //JoyAxisRelativeTgl.setActive( %on ); +} + +//------------------------------------------------------------------------------ +function JoySensText::update( %this ) +{ + %this.setValue( "(" @ getSubStr( JoyAxisSlider.getValue(), 0, 4 ) @ ")" ); +} + +//------------------------------------------------------------------------------ +function DeadZoneText::update( %this ) +{ + %val = DeadZoneSlider.getValue(); + %percent = %val * 100; + %temp = strstr( %percent, "." ); + if ( %temp != -1 ) + %percent = getSubStr( %percent, 0, %temp ); + + %this.setValue( "(" @ %percent @ "%)" ); +} + +//------------------------------------------------------------------------------ +function bindJoystickAxis( %axisIndex, %cmdIndex ) +{ + %cmd = $JoyRemapCmd[%cmdIndex]; + %axis = $JoyAxisTab[%axisIndex].type; + if ( %cmdIndex > $JoyRemapCount ) + { + // Make sure the axis is unbound: + moveMap.unbind( "joystick", %axis ); + return; + } + + %sens = JoyAxisSlider.getValue() * 100; + %delta = DeadZoneSlider.getValue() * %sens; + %flags = "S"; + if ( InvertJoyAxisTgl.getValue() ) + %flags = %flags @ "I"; +// if ( JoyAxisRelativeTgl.getValue() ) +// %flags = %flags @ "L"; + if ( %delta > 0 ) + { + %deadZone = "-" @ %delta SPC %delta; + moveMap.bind( "joystick", %axis, %flags @ "D", %deadZone, %sens, %cmd ); + } + else + moveMap.bind( "joystick", %axis, %flags, %sens, %cmd ); +} + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +// Network Settings: +// + +function updateNetworkSettings() +{ + $pref::Net::PacketRateToClient = mFloor( OP_PacketRateSlider.getValue() ); + $pref::Net::PacketSize = mFloor( OP_PacketSizeSlider.getValue() ); + $pref::Net::PacketRateToServer = mFloor( OP_UpdateRateSlider.getValue() ); + + // check the max rate: + if ( isObject( ServerConnection ) ) + ServerConnection.checkMaxRate(); + if ( isObject( ClientGroup ) ) + { + %count = ClientGroup.getCount(); + for ( %i = 0; %i < %count; %i++ ) + { + %cl = ClientGroup.getObject( %i ); + %cl.checkMaxRate(); + } + } +} + +function OP_NetworkDisplayHud::init(%this) +{ + %this.getPrefs(); + + %this.textHeight = 14; + %this.textOffset = 2; + + if(!%this.infoCallback) + { + %this.textProfile = 0; + return; + } + + // profile for the text fields + %this.textProfile = new GuiControlProfile() + { + fontType = $ShellButtonFont; + fontSize = $ShellButtonFontSize; + autoSizeWidth = true; + autoSizeHeight = true; + fontColors[6] = "128 128 128"; + }; + + %yOffset = %this.textOffset; + + for(%i = 0; %i < 6; %i++) + { + // set the text color + %this.textProfile.fontColors[%i] = %this.fieldColors[%i]; + + // create the text field + %this.textField[%i] = new GuiTextCtrl() + { + profile = %this.textProfile; + horizSizing = "right"; + vertSizing = "bottom"; + position = "20 " @ %yOffset; + extent = "190 " @ %this.textHeight; + visible = "1"; + }; + + // create the toggle field + %this.toggleField[%i] = new GuiTextCtrl() + { + profile = ShellActiveTextProfile; + horizSizing = "right"; + vertSizing = "bottom"; + position = "5 " @ %yOffset; + extent = "15 " @ %this.textHeight; + visible = "1"; + }; + + // create a mouse object + %this.mouseField[%i] = new GuiMouseEventCtrl(NetworkDisplayMouseCtrl) + { + profile = GuiDefaultProfile; + horizSizing = "right"; + vertSizing = "bottom"; + position = "10 " @ %yOffset; + extent = "200 " @ %this.textHeight; + visible = "1"; + fieldIndex = %i; + }; + + OP_NetworkDisplayTextFrame.add(%this.textField[%i]); + OP_NetworkDisplayTextFrame.add(%this.toggleField[%i]); + OP_NetworkDisplayTextFrame.add(%this.mouseField[%i]); + + %yOffset += (%this.textHeight + %this.textOffset); + } + %this.infoUpdate(0, 0, 0, 0, 0, 0); +} + +function NetworkDisplayMouseCtrl::onMouseDown(%this) +{ + %b = OP_NetworkDisplayHud.renderField[%this.fieldIndex]; + OP_NetworkDisplayHud.renderField[%this.fieldIndex] = !%b; + OP_NetworkDisplayHud.updateToggles(); +} + +function OP_NetworkDisplayHud::uninit(%this) +{ + if(!%this.infoCallback) + return; + + if(isObject(%this.textProfile)) + %this.textProfile.delete(); + + for(%i = 0; %i < 6; %i++) + { + if(isObject(%this.textField[%i])) + %this.textField[%i].delete(); + + if(isObject(%this.toggleField[%i])) + %this.toggleField[%i].delete(); + + if(isObject(%this.mouseField[%i])) + %this.mouseField[%i].delete(); + } +} + +function OP_NetworkDisplayHud::updateToggles(%this) +{ + // update the toggles + $pref::Net::graphFields = 0; + + for(%i = 0; %i < 6; %i++) + { + $pref::Net::graphFields |= %this.renderField[%i] << %i; + %this.toggleField[%i].setText(%this.renderField[%i] ? "+" : "-"); + } +} + +function OP_NetworkDisplayHud::infoUpdate(%this, %ping, %packetLoss, %sendPackets, %sendBytes, %receivePackets, %receiveBytes) +{ + %this.updateToggles(); + + // set the text + %this.textField[0].setText("\c0Ping: " @ mFormatFloat(%ping, "%4.0f") @ "ms"); + %this.textField[1].setText("\c1Packet Loss: " @ mFormatFloat(%packetLoss, "%3.0f") @ "%"); + %this.textField[2].setText("\c2Send Packets: " @ mFormatFloat(%sendPackets, "%2.1f") @ "pps"); + %this.textField[3].setText("\c3Send Bytes: " @ mFormatFloat(%sendBytes, "%5.0f") @ "bps"); + %this.textField[4].setText("\c4Receive Packets: " @ mFormatFloat(%receivePackets, "%2.1f") @ "pps"); + %this.textField[5].setText("\c5Receive Bytes: " @ mFormatFloat(%receiveBytes, "%5.0f") @ "bps"); +} + +// "" +// [1,32] [8,32] [100,450] +$NetworkPresetCount = 0; +$NetworkPreset[$NetworkPresetCount] = "28.8 Modem\t12\t16\t200"; $NetworkPresetCount++; +$NetworkPreset[$NetworkPresetCount] = "56K Modem\t16\t20\t240"; $NetworkPresetCount++; +$NetworkPreset[$NetworkPresetCount] = "DSL\t20\t24\t350"; $NetworkPresetCount++; +$NetworkPreset[$NetworkPresetCount] = "Cable\t24\t24\t400"; $NetworkPresetCount++; +$NetworkPreset[$NetworkPresetCount] = "T1/LAN\t32\t32\t450"; $NetworkPresetCount++; + +function OP_NetworkPresetsMenu::init( %this ) +{ + %this.clear(); + for(%i = 0; %i < $NetworkPresetCount; %i++) + %this.add( getField($NetworkPreset[%i], 0), %i); + + // don't update settings on init (only update when values change) + %this.updateSettings = false; + %this.setSelected($pref::Net::Preset); + %this.updateSettings = true; +} + +function OP_NetworkPresetsMenu::onSelect( %this, %id, %text ) +{ + OP_PacketRateSlider.setValue( getField($NetworkPreset[%id], 1) ); + OP_UpdateRateSlider.setValue( getField($NetworkPreset[%id], 2) ); + OP_PacketSizeSlider.setValue( getField($NetworkPreset[%id], 3) ); + + if(%this.updateSettings) + updateNetworkSettings(); + $pref::Net::Preset = %id; +} + +//------------------------------------------------------------------------------ +function OP_MasterServerMenu::init( %this ) +{ + %this.clear(); + // You can change these strings, but NOT THE IDS! + %this.add( "Always", 1 ); + %this.add( "When Not Full", 2 ); + %this.add( "Never", 3 ); +} + +//------------------------------------------------------------------------------ +function OP_MasterServerMenu::onSelect( %this, %id, %text ) +{ + switch( %id ) + { + case 2: + $pref::Net::DisplayOnMaster = "NotFull"; + case 3: + $pref::Net::DisplayOnMaster = "Never"; + default: + $pref::Net::DisplayOnMaster = "Always"; + } +} + +//------------------------------------------------------------------------------ +function OP_RegionMenu::init( %this ) +{ + %this.clear(); + %this.add( "North America East", 1 ); + %this.add( "North America West", 2 ); + %this.add( "South America", 4 ); + %this.add( "Australia", 8 ); + %this.add( "Asia", 16 ); + %this.add( "Europe", 32 ); +} + +//------------------------------------------------------------------------------ +function OP_RegionMenu::onSelect( %this, %id, %text ) +{ + $pref::Net::RegionMask = %id; +} + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +// Game Settings: +// +function OP_LaunchScreenMenu::init( %this ) +{ + %this.clear(); + %this.add( "Game", 1 ); + %this.add( "Email", 4 ); + %this.add( "Chat", 5 ); + %this.add( "Browser", 6 ); +} + +//------------------------------------------------------------------------------ +function toggleInvertYAxis() +{ + // Catch the case where this is toggled in-game while in a vehicle: + if ( isObject( passengerKeys ) ) + { + %bind = passengerKeys.getBinding( pitch ); + if ( %bind !$= "" ) + { + %device = getField( %bind, 0 ); + %action = getField( %bind, 1 ); + %flags = $pref::Vehicle::InvertYAxis ? "SDI" : "SD"; + %deadZone = passengerKeys.getDeadZone( %device, %action ); + %scale = passengerKeys.getScale( %device, %action ); + passengerKeys.bind( %device, %action, %flags, %deadZone, %scale, pitch ); + } + } +} + +//------------------------------------------------------------------------------ +function toggleImmersion() +{ + MessageBoxOK( "Force Feedback", "This will take effect the next time you start Tribes 2." ); +} + +//------------------------------------------------------------------------------ +function toggleVehicleTeleportPref() +{ + // If we are in a game, let the server know we've changed; + if ( isObject( ServerConnection ) ) + commandToServer( 'EnableVehicleTeleport', $pref::Vehicle::pilotTeleport ); +} diff --git a/scripts/RankStuff.cs b/scripts/RankStuff.cs new file mode 100644 index 0000000..c5f8571 --- /dev/null +++ b/scripts/RankStuff.cs @@ -0,0 +1,406 @@ +//-------------------------------------------------- +//RANKS +//-------------------------------------------------- +$Prestige::Name[0] = ""; //none! +$Prestige::Name[1] = "Instructive "; +$Prestige::Name[2] = "Excelling "; +$Prestige::Name[3] = "Champion "; +$Prestige::Name[4] = "Prestigious "; +$Prestige::Name[5] = "Supreme "; +$Prestige::Name[6] = "Glorious "; +$Prestige::Name[7] = "Ultimate "; +$Prestige::Name[8] = "Shadowing "; +$Prestige::Name[9] = "Phantom "; +$Prestige::Name[10] = "(*) Phantom "; + +$Ranks::MinPoints[0] = 0; +$Ranks::NewRank[0] = "Private"; +$Ranks::RankTag[0] = "[Pvt]"; + +$Ranks::MinPoints[1] = 25; +$Ranks::NewRank[1] = "Private Grade I"; +$Ranks::RankTag[1] = "[Pvt1]"; + +$Ranks::MinPoints[2] = 50; +$Ranks::NewRank[2] = "Private Grade II"; +$Ranks::RankTag[2] = "[Pvt2]"; + +$Ranks::MinPoints[3] = 100; +$Ranks::NewRank[3] = "Private Grade III"; +$Ranks::RankTag[3] = "[Pvt3]"; + +$Ranks::MinPoints[4] = 150; +$Ranks::NewRank[4] = "Gunnary Private"; +$Ranks::RankTag[4] = "[GPvt]"; + +$Ranks::MinPoints[5] = 200; +$Ranks::NewRank[5] = "Gunnary Private Grade I"; +$Ranks::RankTag[5] = "[GPvt1]"; + +$Ranks::MinPoints[6] = 250; +$Ranks::NewRank[6] = "Gunnary Private Grade II"; +$Ranks::RankTag[6] = "[GPvt2]"; + +$Ranks::MinPoints[7] = 300; +$Ranks::NewRank[7] = "Gunnary Private Grade III"; +$Ranks::RankTag[7] = "[GPvt3]"; + +$Ranks::MinPoints[8] = 400; +$Ranks::NewRank[8] = "Corporal"; +$Ranks::RankTag[8] = "[Cpl]"; + +$Ranks::MinPoints[9] = 500; +$Ranks::NewRank[9] = "Corporal Grade I"; +$Ranks::RankTag[9] = "[Cpl1]"; + +$Ranks::MinPoints[10] = 600; +$Ranks::NewRank[10] = "Corporal Grade II"; +$Ranks::RankTag[10] = "[Cpl2]"; + +$Ranks::MinPoints[11] = 700; +$Ranks::NewRank[11] = "Corporal Grade III"; +$Ranks::RankTag[11] = "[Cpl3]"; + +$Ranks::MinPoints[12] = 900; +$Ranks::NewRank[12] = "Corporal Grade IV"; +$Ranks::RankTag[12] = "[Cpl4]"; + +$Ranks::MinPoints[13] = 1150; +$Ranks::NewRank[13] = "Sergeant"; +$Ranks::RankTag[13] = "[Sgt]"; + +$Ranks::MinPoints[14] = 1400; +$Ranks::NewRank[14] = "Sergeant Grade I"; +$Ranks::RankTag[14] = "[Sgt1]"; + +$Ranks::MinPoints[15] = 1700; +$Ranks::NewRank[15] = "Sergeant Grade II"; +$Ranks::RankTag[15] = "[Sgt2]"; + +$Ranks::MinPoints[16] = 2000; +$Ranks::NewRank[16] = "Sergeant Grade III"; +$Ranks::RankTag[16] = "[Sgt3]"; + +$Ranks::MinPoints[17] = 2500; +$Ranks::NewRank[17] = "Sergeant Grade IV"; +$Ranks::RankTag[17] = "[Sgt4]"; + +$Ranks::MinPoints[18] = 3000; +$Ranks::NewRank[18] = "Gunnary Sergeant"; +$Ranks::RankTag[18] = "[GSgt]"; + +$Ranks::MinPoints[19] = 3500; +$Ranks::NewRank[19] = "Gunnary Sergeant Grade I"; +$Ranks::RankTag[19] = "[GSgt1]"; + +$Ranks::MinPoints[20] = 4000; +$Ranks::NewRank[20] = "Gunnary Sergeant Grade II"; +$Ranks::RankTag[20] = "[GSgt2]"; + +$Ranks::MinPoints[21] = 4500; +$Ranks::NewRank[21] = "Gunnary Sergeant Grade III"; +$Ranks::RankTag[21] = "[GSgt3]"; + +$Ranks::MinPoints[22] = 5000; +$Ranks::NewRank[22] = "Gunnary Sergeant Grade IV"; +$Ranks::RankTag[22] = "[GSgt4]"; + +$Ranks::MinPoints[23] = 6000; +$Ranks::NewRank[23] = "Lieutenant"; +$Ranks::RankTag[23] = "[Lt]"; + +$Ranks::MinPoints[24] = 7000; +$Ranks::NewRank[24] = "Lieutenant Grade I"; +$Ranks::RankTag[24] = "[Lt1]"; + +$Ranks::MinPoints[25] = 8000; +$Ranks::NewRank[25] = "Lieutenant Grade II"; +$Ranks::RankTag[25] = "[Lt2]"; + +$Ranks::MinPoints[26] = 9000; +$Ranks::NewRank[26] = "Lieutenant Grade III"; +$Ranks::RankTag[26] = "[Lt3]"; + +$Ranks::MinPoints[27] = 10000; +$Ranks::NewRank[27] = "Lieutenant Grade IV"; +$Ranks::RankTag[27] = "[Lt4]"; + +$Ranks::MinPoints[28] = 12500; +$Ranks::NewRank[28] = "Captain"; +$Ranks::RankTag[28] = "[Cpt]"; + +$Ranks::MinPoints[29] = 15000; +$Ranks::NewRank[29] = "Captain Grade I"; +$Ranks::RankTag[29] = "[Cpt1]"; + +$Ranks::MinPoints[30] = 20000; +$Ranks::NewRank[30] = "Captain Grade II"; +$Ranks::RankTag[30] = "[Cpt2]"; + +$Ranks::MinPoints[31] = 25000; +$Ranks::NewRank[31] = "Captain Grade III"; +$Ranks::RankTag[31] = "[Cpt3]"; + +$Ranks::MinPoints[32] = 30000; +$Ranks::NewRank[32] = "Major"; +$Ranks::RankTag[32] = "[Maj]"; + +$Ranks::MinPoints[33] = 37500; +$Ranks::NewRank[33] = "Major Grade I"; +$Ranks::RankTag[33] = "[Maj1]"; + +$Ranks::MinPoints[34] = 45000; +$Ranks::NewRank[34] = "Major Grade II"; +$Ranks::RankTag[34] = "[Maj2]"; + +$Ranks::MinPoints[35] = 52500; +$Ranks::NewRank[35] = "Major Grade III"; +$Ranks::RankTag[35] = "[Maj3]"; + +$Ranks::MinPoints[36] = 60000; +$Ranks::NewRank[36] = "Lieutenant Colonel"; +$Ranks::RankTag[36] = "[LCol]"; + +$Ranks::MinPoints[37] = 70000; +$Ranks::NewRank[37] = "Lieutenant Colonel Grade I"; +$Ranks::RankTag[37] = "[LCol1]"; + +$Ranks::MinPoints[38] = 80000; +$Ranks::NewRank[38] = "Lieutenant Colonel Grade II"; +$Ranks::RankTag[38] = "[LCol2]"; + +$Ranks::MinPoints[39] = 90000; +$Ranks::NewRank[39] = "Lieutenant Colonel Grade III"; +$Ranks::RankTag[39] = "[LCol3]"; + +$Ranks::MinPoints[40] = 100000; +$Ranks::NewRank[40] = "Colonel"; +$Ranks::RankTag[40] = "[Col]"; + +$Ranks::MinPoints[41] = 125000; +$Ranks::NewRank[41] = "Colonel Grade I"; +$Ranks::RankTag[41] = "[Col1]"; + +$Ranks::MinPoints[42] = 150000; +$Ranks::NewRank[42] = "Colonel Grade II"; +$Ranks::RankTag[42] = "[Col2]"; + +$Ranks::MinPoints[43] = 175000; +$Ranks::NewRank[43] = "Brigadier"; +$Ranks::RankTag[43] = "[Bri]"; + +$Ranks::MinPoints[44] = 200000; +$Ranks::NewRank[44] = "Brigadier Grade I"; +$Ranks::RankTag[44] = "[Bri1]"; + +$Ranks::MinPoints[45] = 250000; +$Ranks::NewRank[45] = "Brigadier Grade II"; +$Ranks::RankTag[45] = "[Bri2]"; + +$Ranks::MinPoints[46] = 300000; +$Ranks::NewRank[46] = "Brigadier General"; +$Ranks::RankTag[46] = "[BriGn]"; + +$Ranks::MinPoints[47] = 350000; +$Ranks::NewRank[47] = "Brigadier General I"; +$Ranks::RankTag[47] = "[BriGn1]"; + +$Ranks::MinPoints[48] = 425000; +$Ranks::NewRank[48] = "Brigadier General II"; +$Ranks::RankTag[48] = "[BriGn2]"; + +$Ranks::MinPoints[49] = 500000; +$Ranks::NewRank[49] = "General"; +$Ranks::RankTag[49] = "[Gen]"; + +$Ranks::MinPoints[50] = 575000; +$Ranks::NewRank[50] = "2 Star General"; +$Ranks::RankTag[50] = "[2Gen]"; + +$Ranks::MinPoints[51] = 650000; +$Ranks::NewRank[51] = "3 Star General"; +$Ranks::RankTag[51] = "[3Gen]"; + +$Ranks::MinPoints[52] = 800000; +$Ranks::NewRank[52] = "4 Star General"; +$Ranks::RankTag[52] = "[4Gen]"; + +$Ranks::MinPoints[53] = 1000000; +$Ranks::NewRank[53] = "5 Star General"; +$Ranks::RankTag[53] = "[5Gen]"; + +$Ranks::MinPoints[54] = 1250000; +$Ranks::NewRank[54] = "Master General"; +$Ranks::RankTag[54] = "[MGen]"; + +$Ranks::MinPoints[55] = 1500000; +$Ranks::NewRank[55] = "Master General I"; +$Ranks::RankTag[55] = "[MGen1]"; + +$Ranks::MinPoints[56] = 1750000; +$Ranks::NewRank[56] = "Master General II"; +$Ranks::RankTag[56] = "[MGen2]"; + +$Ranks::MinPoints[57] = 2000000; +$Ranks::NewRank[57] = "Commanding General"; +$Ranks::RankTag[57] = "[ComGen]"; + +$Ranks::MinPoints[58] = 2250000; +$Ranks::NewRank[58] = "Fleet Commander"; +$Ranks::RankTag[58] = "[FltCom]"; + +$Ranks::MinPoints[59] = 2500000; +$Ranks::NewRank[59] = "Commanding Officer"; +$Ranks::RankTag[59] = "[ComOcr]"; + +$Ranks::MinPoints[60] = 2750000; +$Ranks::NewRank[60] = "Commander"; +$Ranks::RankTag[60] = "[Cmdr]"; + +$Ranks::MinPoints[61] = 3000000; +$Ranks::NewRank[61] = "Master Commander"; +$Ranks::RankTag[61] = "[MCmdr]"; +$Rank::RankCount = 61; +$canRecalcTop5 = 1; + +//-------------------------------------- +//Misc +//-------------------------------------- + +function getNumberOfWords(%path){ + %number = 0; + for(%i = 0; %i < 1000; %i++){ + if(getWord(%path,%i) !$= "") + %number++; + else + return %number; + } +} + +//TOP RANKS +function findTopRanks() { + %server = ""@$PGDServer@":"@$PGDPort@""; + %filename = "/public/Univ/Ranks/TWM2/top.php"; + if (!isObject(Top_Rank_Grab)) { + %Downloader = new HTTPObject(Top_Rank_Grab){}; + } + else { + %Downloader = Top_Rank_Grab; + } + $TopRanks::LineCount = 0; + //If the server crashes here, let everyone know why + MessageAll('MsgAdminForce', "\c5SERVER: Downloading Top Ranks, Possible Lag."); + %Downloader.get(%server, %filename); + %Downloader.schedule(10000, 0, "Disconnect"); +} + +function Top_Rank_Grab::onLine(%this, %line) { + %strPos = strStr(%line, " Registered Players*"); + %star1 = strStr(%line, "*"); + if(%this.count !$= "") { + $TopRanks::LineCount++; + $TopRanks::Line[$TopRanks::LineCount] = %line; + } + if(%strPos != -1 && %star1 != -1) { + %this.count = getSubStr(%line, %star1+1, %strPos-(%star1+1)); + } +} + +function Top_Rank_Grab::onConnectFailed(%this) { + error("-- Could not connect to PGD."); + error("Top Rank Download: fail (connection)"); +} + +function Top_Rank_Grab::onDisconnect(%this) { + echo("Top Rank Download: OK, "@%this.count@" ranks"); + SortTopRanks(%this); + %this.delete(); +} + +function SortTopRanks(%dlOBJ) { + for(%i = 1; %i <= %dlOBJ.count; %i++) { + %line = $TopRanks::Line[%i]; + //First, lets gather out the rank + %RankName1 = strStr(%line, "title=\""); + %RankName2 = strStr(%line, "width=") - 2; + %RankName = getSubStr(%line, (%rankName1+7), (%rankName2-(%rankName1+7))); + //Second, lets get the name and guid + //GUID is not currently used, but hey, we may need it one day + %GUID1 = strStr(%line, "guid=") + 5; + %GUID2 = strStr(%line, "guid=") + 12; + %GUID = getSubStr(%line, (%GUID1), (%GUID2-(%GUID1))); + // + %PlayerName1 = strStr(%line, "guid=") + 12; + %PlayerName2 = strStr(%line, "") - 1; + %PlayerName = getSubStr(%line, (%PlayerName1)+1, (%PlayerName2-(%PlayerName1))); + //Third, lets gather out the EXP + %EXP1 = strStr(%line, ":") + 5; + %EXP2 = strStr(%line, "

") - 4; + %EXP = getSubStr(%line, (%EXP1), (%EXP2-(%EXP1))); + %EXP = Trim(stripChars(%EXP, ",")); + //Lastly, lets sort the needed data + %rPos = %i; + $Rank::Top[%i] = ""@%PlayerName@""; + $Rank::TopXP[%i] = %EXP; + $Rank::TopRank[%i] = ""@%RankName@""; + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +function DoNameChangeChecks(%client) { + if(!$TWM2::UseRankTags) { + CheckGUID(%client); + return; + } + %stillLooking = 1; + %sO = %client.TWM2Core; + //Obtain the rank number + if(%sO.rankNumber $= "") { + for(%j = 0; %j <= $Rank::RankCount; %j++) { + if(%stillLooking) { + if(getCurrentEXP(%client) >= $Ranks::MinPoints[%j]) { + %sO.rankNumber = %j; + } + else { + %stillLooking = 0; + } + } + } + } + // + %tag = $Ranks::RankTag[%sO.rankNumber]; + // + %name = "\cp\c9" @ %tag @ "\c6" @ %client.namebase @ "\co"; + MessageAll( 'MsgClientNameChanged', "", %client.name, %name, %client ); + removeTaggedString(%client.name); + %client.name = addTaggedString(%name); + setTargetName(%client.target, %client.name); +} diff --git a/scripts/SabotageGame.cs b/scripts/SabotageGame.cs new file mode 100644 index 0000000..dc3a964 --- /dev/null +++ b/scripts/SabotageGame.cs @@ -0,0 +1,638 @@ +// DisplayName = Sabotage + +//--- GAME RULES BEGIN --- +// Secure The Bomb +// Destroy The Enemy Objective With The Bomb +// Protect Your Objective From The Bomb +//--- GAME RULES END --- + +$SaboGame::Rounds = 5; +$Sabotage::ArmTime = 3; +$Sabotage::DefuseTime = 10; +$Sabotage::Fuse = 25; + +datablock StaticShapeData(SabotageObjective) { + className = "StaticShape"; + shapeFile = "stackable2m.dts"; + + maxDamage = 0.5; + destroyedLevel = 0.5; + disabledLevel = 0.3; + + explosion = HandGrenadeExplosion; + expDmgRadius = 1.0; + expDamage = 0.05; + expImpulse = 200; + dynamicType = $TypeMasks::StaticShapeObjectType; + deployedObject = true; + + cmdCategory = "DSupport"; + cmdIcon = CMDSensorIcon; + cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor"; + targetNameTag = '[Sabotage] Objective'; + + deployAmbientThread = true; + debrisShapeName = "debris_generic_small.dts"; + debris = DeployableDebris; + heatSignature = 0; + needsPower = true; +}; + +datablock ItemData(SabotageBomb) { + catagory = "Objectives"; + shapefile = "stackable2s.dts"; + mass = 1; + elasticity = 0.2; + friction = 0.6; + pickupRadius = 3; + pickUpName = "a Bomb"; + computeCRC = true; + + lightType = "PulsingLight"; + lightColor = "0.5 0.5 0.5 1.0"; + lightTime = "1000"; + lightRadius = "3"; + + isInvincible = true; + cmdCategory = "Objectives"; + cmdIcon = CMDFlagIcon; + cmdMiniIconName = "commander/MiniIcons/com_flag_grey"; + targetTypeTag = 'Bomb'; +}; + +function SabotageBomb::onCollision(%data,%obj,%col) { + if (%col.getDataBlock().className $= Armor && !%col.client.isJailed) { + if (%col.isMounted()) + return; + + // a player hit the flag + Game.playerTouchBomb(%col, %obj); + } +} + +function SabotageGame::playerTouchBomb(%game, %player, %bomb) { + if(%player.getState() $= "Dead") { + return; + } + if(%bomb.isArmed) { + + } + else { + cancel(%bomb.resetTime); + messageClient(%player.client, 'MsgYouHasBomb', "\c5SABOTAGE: You have the BOMB, Destroy The Objective"); + %bomb.Carrier = %player; + %bomb.hide(true); + %bomb.startFade(0, 0, false); + if(%player.team == 1) { + %enemyTeam = 2; + } + else { + %enemyTeam = 1; + } + %game.ObjectiveScan(%player, %enemyTeam); + } +} + +function SabotageGame::CheckForDisarm(%game, %bomb) { + InitContainerRadiusSearch(%bomb.getPosition(), 25, $TypeMasks::PlayerObjectType); + while ((%potentialTarget = ContainerSearchNext()) != 0) { + if(%potentialTarget.team != %bomb.ArmTeam) { + if(%bomb.BeingDisarmed) { + return; + } + %bomb.BeingDisarmed = 1; + %game.StartDisarm(%potentialTarget, %bomb, 0); + return; + } + } + %game.schedule(500, "CheckForDisarm", %bomb); +} + +function SabotageGame::ObjectiveScan(%game, %carrier, %enemyTeam) { + if(!isObject(%carrier) || %carrier.getState() $= "Dead") { + return; + } + %EnemyObj = %game.TeamObjective[%enemyTeam]; + if(vectorDist(%carrier.getPosition(), %EnemyObj.getPosition()) <= 5) { + %game.ArmBomb(%carrier, %game.bomb, %enemyTeam, 0); + return; + } + %game.schedule(500, "ObjectiveScan", %carrier, %enemyTeam); +} + +function SabotageGame::ArmBomb(%game, %carrier, %bomb, %ETeam, %ct) { + if(!isObject(%carrier) || %carrier.getState() $= "Dead") { + return; + } + %EnemyObj = %game.TeamObjective[%ETeam]; + if(vectorDist(%carrier.getPosition(), %EnemyObj.getPosition()) > 12) { + %game.schedule(500, "ObjectiveScan", %carrier, %ETeam); + } + else { + BottomPrint(%carrier.client, "ARMING BOMB "@MFloor(%ct)@" / "@$Sabotage::ArmTime*2@"", 1, 2); + //Still In Range, Keep Armin + %ct++; + //7 Seconds To Arm! + if(%ct >= $Sabotage::ArmTime*2) { + %bomb.armTeam = %carrier.team; + recordAction(%carrier, "BOMBARM"); + %game.BombDropped(%bomb, %Carrier); //drop the bomb, cause it's armedz + MessageAll('MsgBombArmed', "\c5SABOTAGE: The Bomb Has Been Planted!!!"); + CompleteNWChallenge(%Carrier, "BombPlanted"); + %game.BombBegin(%bomb, %ETeam, 0); + } + else { + %game.schedule(500, "ArmBomb", %carrier, %bomb, %ETeam, %ct); + } + } +} + +function SabotageGame::StartDisarm(%game, %player, %bomb, %ct) { + if(%Player.getState() $= "dead") { + %bomb.BeingDisarmed = 0; + %game.CheckForDisarm(%bomb); + return; + } + if(!%bomb.BeingDisarmed) { + %game.CheckForDisarm(%bomb); + return; + } + if(vectorDist(%player.getPosition(), %bomb.getPosition()) <= 7) { + %ct++; + BottomPrint(%player.client, "DISARMING BOMB "@MFloor(2)@" / "@$Sabotage::DefuseTime*2@"", 1, 2); + if(%ct >= $Sabotage::DefuseTime*2) { + cancel(%bomb.DetSchedule); + %bomb.isArmed = 0; + %bomb.BeingDisarmed = 0; + %game.playerTouchBomb(%player, %bomb); + messageAll('MsgSPCurrentObjective2', "", "Disarmed"); + recordAction(%player.client, "BOMBDIS"); + MessageAll('MsgBombArmed', "\c5SABOTAGE: The Bomb Has Been Disarmed!!!"); + CompleteNWChallenge(%player.client, "BombDisarmed"); + return; + } + else { + %game.schedule(500, "StartDisarm", %player, %bomb, %ct); + } + } + else { + %game.CheckForDisarm(%bomb); + %bomb.BeingDisarmed = 0; + } +} + +function SabotageGame::BombBegin(%game, %bomb, %ETeam, %ct) { + %bomb.isArmed = 1; + %game.CheckForDisarm(%bomb); + %ct++; + messageAll('MsgSPCurrentObjective2', "", "Fuse Time: "@MFloor(%ct/2)@"/"@$Sabotage::Fuse@""); + if(%ct > $Sabotage::Fuse*2) { + %game.BombExplode(%bomb, %ETeam); + } + else { + %bomb.DetSchedule = %game.schedule(500, "BombBegin", %bomb, %ETeam, %ct); + } +} + +function SabotageGame::BombExplode(%game, %bomb, %ETeam) { + $teamScore[%bomb.armTeam] += 10000; //HA! + $TeamWins[%bomb.armTeam]++; + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + if(%cl.team == %bomb.armTeam) { + recordAction(%cl, "SABWIN"); + switch($TeamWins[%bomb.armTeam]) { + case 1: + CompleteNWChallenge(%cl, "BombDetonated"); + case 3: + CompleteNWChallenge(%cl, "3For5Sabo"); + case 5: + CompleteNWChallenge(%cl, "BaseDestroyer"); + } + } + } + //Boom :) + ServerPlay3D("SatchelChargeExplosionSound", %bomb.getPosition()); + %c4 = new Item() { + datablock = C4Deployed; + position = %bomb.getPosition(); + scale = ".1 .1 .1"; + }; + MissionCleanup.add(%c4); + schedule(770, 0, "C4GoBoom", %c4); + // + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + if(isObject(%cl.player)) { +// %cl.player.clearInventory(); //auto UE + if(%cl.team != %bomb.armTeam) { + %cl.player.setDamageFlash(100); + } + } + if(%cl.team != %bomb.armTeam) { + messageClient(%cl, 'MsgYouHasBomb', "\c5SABOTAGE: We have been defeated... try harder next time..."); + } + else { + messageClient(%cl, 'MsgYouHasBomb', "\c5SABOTAGE: Mission acomplished, great work soldiers. (+250XP)"); + %cl.xp += 250; + UpdateClientRank(%cl); + } + } + %game.Intermit(); +} + +function SabotageGame::ResetBomb(%game, %bomb) { + MessageAll('msgWhoops', "\c5SABOTAGE: Bomb Reset."); + %bomb.setPosition($SabotageGame::BombLocation[$CurrentMission]); +} + +function SabotageGame::BombDropped(%game, %bomb, %Carrier) { + if(!%bomb.IsArmed) { + %bomb.resetTime = %game.schedule(45000,"ResetBomb", %bomb); + } + %bomb.setPosition(%Carrier.getPosition()); //I think the game does this + %bomb.Carrier = 0; //But this is just to be safe + %bomb.hide(false); +} + +function SabotageGame::UpdateBombStatus(%game, %bomb) { + if(%bomb.Carrier == 0 && !%bomb.isArmed) { + %wp = new WayPoint() { + position = %bomb.getWorldBoxCenter(); + dataBlock = "WayPointMarker"; + team = 0; + name = "BOMB"; + }; + messageAll('MsgSPCurrentObjective1', "", "Bomb: Neutral"); + MissionCleanup.add(%wp); + %wp.schedule(2999,delete); + } + else if(%bomb.isArmed) { + %wp = new WayPoint() { + position = %bomb.getWorldBoxCenter(); + dataBlock = "WayPointMarker"; + team = %bomb.armTeam; + name = "ARMED BOMB"; + }; + messageAll('MsgSPCurrentObjective1', "", "Bomb: Armed"); + MissionCleanup.add(%wp); + %wp.schedule(2999,delete); + } + else { + if(!%bomb.Carrier.client.IsActivePerk("Bomb Shadower")) { + %wp = new WayPoint() { + position = %bomb.Carrier.getWorldBoxCenter(); + dataBlock = "WayPointMarker"; + team = %bomb.Carrier.Team; + name = ""@%bomb.Carrier.client.namebase@" - BOMB"; + }; + messageAll('MsgSPCurrentObjective1', "", "Bomb: "@%bomb.carrier.client.namebase@""); + MissionCleanup.add(%wp); + %wp.schedule(2999,delete); + } + else { + messageAll('MsgSPCurrentObjective1', "", "Bomb: Shadowed By Carrier"); + } + } + %game.schedule(3000, "UpdateBombStatus", %bomb); +} + +function SabotageGame::AIInit(%game) { + //call the default AIInit() function + AIInit(); +} + +function SabotageGame::allowsProtectedStatics(%game) { + return true; +} + +function SabotageGame::clientMissionDropReady(%game, %client) { + messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); + messageClient(%client, 'MsgClientReady',"", "SinglePlayerGame"); + DefaultGame::clientMissionDropReady(%game, %client); +} + +function SabotageGame::onAIRespawn(%game, %client) { + //add the default task + if (!%client.defaultTasksAdded) { + %client.defaultTasksAdded = true; + %client.addTask(AIPickupItemTask); + %client.addTask(AIUseInventoryTask); + %client.addTask(AITauntCorpseTask); + %client.addTask(AIEngageTurretTask); + %client.addTask(AIDetectMineTask); + %client.addTask(AIBountyPatrolTask); + %client.bountyTask = %client.addTask(AIBountyEngageTask); + } + + //set the inv flag + %client.spawnUseInv = true; +} + +function SabotageGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) { + if (%game.testKill(%clVictim, %clKiller)) { //verify victim was an enemy + %game.awardScoreKill(%clKiller); + %game.awardScoreDeath(%clVictim); + } + else if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide + %game.awardScoreSuicide(%clVictim); +} + +function SabotageGame::timeLimitReached(%game) { + logEcho("game over (timelimit)"); + %game.gameOver(); + cycleMissions(); +} + +function SabotageGame::scoreLimitReached(%game) { + logEcho("game over (scorelimit)"); + %game.gameOver(); + cycleMissions(); +} + +function SabotageGame::gameOver(%game) { + //call the default + DefaultGame::gameOver(%game); + $TWM2::PlayingSabo = 0; + $FissionEndsGame = 0; + + $Ion::StopIon = 0; + + $TeamWins[1] = 0; + $TeamWins[2] = 0; + + //send the winner message + %winner = ""; + if ($teamScore[1] > $teamScore[2]) + %winner = %game.getTeamName(1); + else if ($teamScore[2] > $teamScore[1]) + %winner = %game.getTeamName(2); + + if (%winner $= 'Storm') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.stowins.wav" ); + else if (%winner $= 'Inferno') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.infwins.wav" ); + else if (%winner $= 'Starwolf') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.swwin.wav" ); + else if (%winner $= 'Blood Eagle') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.bewin.wav" ); + else if (%winner $= 'Diamond Sword') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.dswin.wav" ); + else if (%winner $= 'Phoenix') + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.pxwin.wav" ); + else + messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" ); + + messageAll('MsgClearObjHud', ""); + for(%i = 0; %i < ClientGroup.getCount(); %i ++) { + %client = ClientGroup.getObject(%i); + %game.resetScore(%client); + } + for(%j = 1; %j <= %game.numTeams; %j++) + $TeamScore[%j] = 0; +} + +function SabotageGame::vehicleDestroyed(%game, %vehicle, %destroyer) { + +} + +function SabotageGame::startMatch(%game) { + DefaultGame::StartMatch(%game); + $TWM2::PlayingSabo = 1; + + $Ion::StopIon = 1; + + $FissionEndsGame = 1; + + $TeamWins[1] = 0; + $TeamWins[2] = 0; + + $SaboGame::RoundNumber = 1; + Game.NumTeams = 2; + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + CenterPrint(%cl, "SABOTAGE", 5, 2); + if(isObject(%cl.player)) { + %cl.player.setMoveState(true); + %cl.player.schedule(5000, "setMoveState", false); + } + } + %game.InitialSetup($CurrentMission); + setSensorGroupCount(7); +} + +function SabotageGame::Intermit(%game) { + $SaboGame::RoundNumber++; + if($SaboGame::RoundNumber > $SaboGame::Rounds) { + MessageAll('msgInter', "\c5SABOTAGE: GAME OVER, CHANGING MAP..."); + %game.schedule(10000, "GameOver"); + CycleMissions(); + return; + } + else { + %game.bomb.IsArmed = 0; + %game.bomb.carrier = 0; + %game.ResetBomb(%game.Bomb); + MessageAll('msgInter', "\c5SABOTAGE: INTERMISSION, ROUND "@$SaboGame::RoundNumber@" BEGINNING"); + } +} + +function SabotageGame::InitialSetup(%game, %map) { + //Team 1 Objective + %game.TeamObjective[1] = new StaticShape() { + datablock = SabotageObjective; + position = $SabotageGame::ObjectiveLocation1[%map]; + }; + MissionCleanup.add(%game.TeamObjective[1]); + %game.TeamObjective[1].wp = new WayPoint() { + position = $SabotageGame::ObjectiveLocation1[%map]; + dataBlock = "WayPointMarker"; + team = 1; + name = "TEAM 1 OBJECTIVE"; + }; + MissionCleanup.add(%game.TeamObjective[1].wp); + %game.WPLoop(%game.TeamObjective[1].wp, 1); + %game.TeamObjective[1].Invincible = 1; //HA! No Shootin / C4 For You + + //Team 2 Objective + %game.TeamObjective[2] = new StaticShape() { + datablock = SabotageObjective; + position = $SabotageGame::ObjectiveLocation2[%map]; + }; + MissionCleanup.add(%game.TeamObjective[2]); + %game.TeamObjective[2].wp = new WayPoint() { + position = $SabotageGame::ObjectiveLocation2[%map]; + dataBlock = "WayPointMarker"; + team = 2; + name = "TEAM 2 OBJECTIVE"; + }; + MissionCleanup.add(%game.TeamObjective[2].wp); + %game.WPLoop(%game.TeamObjective[2].wp, 2); + %game.TeamObjective[2].Invincible = 1; //HA! No Shootin / C4 For You + + %game.Bomb = new Item() { + datablock = SabotageBomb; + position = $SabotageGame::BombLocation[%map]; + }; + MissionCleanup.add(%game.Bomb); + %game.UpdateBombStatus(%game.Bomb); + messageAll('MsgSPCurrentObjective1', "", "Bomb: Neutral"); + messageAll('MsgSPCurrentObjective2', "", "-----"); +} + +function SabotageGame::pickTeamSpawn(%game, %team) { + if(%team == 1) { + if(!isObject(%game.TeamObjective[1])) { + //stops the pre-game fall + %pos = vectorAdd($SabotageGame::ObjectiveLocation1[$CurrentMission],GetRandomPosition(5,1)); + %pos = vectorAdd(%pos,"0 0 5"); + } + else { + %pos = vectorAdd(%game.TeamObjective[1].getPosition(),GetRandomPosition(5,1)); + %pos = vectorAdd(%pos,"0 0 4"); + } + return %pos; + } + else if(%team == 2) { + if(!isObject(%game.TeamObjective[2])) { + //stops the pre-game fall + %pos = vectorAdd($SabotageGame::ObjectiveLocation2[$CurrentMission],GetRandomPosition(5,1)); + %pos = vectorAdd(%pos,"0 0 5"); + } + else { + %pos = vectorAdd(%game.TeamObjective[2].getPosition(),GetRandomPosition(5,1)); + %pos = vectorAdd(%pos,"0 0 4"); + } + return %pos; + } +} + +function SabotageGame::WPLoop(%game, %wp, %team) { + %wp.delete(); + if(%team == 2) { + %game.TeamObjective[2].wp = new WayPoint() { + position = $SabotageGame::ObjectiveLocation2[$CurrentMission]; + dataBlock = "WayPointMarker"; + team = 2; + name = "TEAM 2 OBJECTIVE"; + }; + MissionCleanup.add(%game.TeamObjective[2].wp); + %game.schedule(5000, "WPLoop", %game.TeamObjective[2].wp, 2); + } + else { + %game.TeamObjective[1].wp = new WayPoint() { + position = $SabotageGame::ObjectiveLocation1[$CurrentMission]; + dataBlock = "WayPointMarker"; + team = 1; + name = "TEAM 1 OBJECTIVE"; + }; + MissionCleanup.add(%game.TeamObjective[1].wp); + %game.schedule(5000, "WPLoop", %game.TeamObjective[1].wp, 1); + } +} + +//MissionLists +$SabotageGame::ObjectiveLocation1["Strikers2"] = "1.4 148.5 14.2"; +$SabotageGame::ObjectiveLocation2["Strikers2"] = "147.7 7.9 14.4"; +$SabotageGame::BombLocation["Strikers2"] = "54.8 60.1 28.2"; + +$SabotageGame::ObjectiveLocation1["Oasis2"] = "-106.6 53.8 134"; +$SabotageGame::ObjectiveLocation2["Oasis2"] = "-107.8 -125.4 133"; +$SabotageGame::BombLocation["Oasis2"] = "-215.2 -44.7 109.113"; + +$SabotageGame::ObjectiveLocation1["MyrkWood2"] = "-297.849 -232.002 87.1634"; +$SabotageGame::ObjectiveLocation2["MyrkWood2"] = "-162.307 113.314 83.2362"; +$SabotageGame::BombLocation["MyrkWood2"] = "-274 -85 74.7"; + +$SabotageGame::ObjectiveLocation1["DerGott"] = "-2.2 -3.1 157.149"; +$SabotageGame::ObjectiveLocation2["DerGott"] = "-202.631 -210.103 157.493"; +$SabotageGame::BombLocation["DerGott"] = "-103.026 -95.7017 155.149"; + +$SabotageGame::ObjectiveLocation1["SideSwipe"] = "-83 -270 355"; +$SabotageGame::ObjectiveLocation2["SideSwipe"] = "-82.3 -114 355"; +$SabotageGame::BombLocation["SideSwipe"] = "-83.6 -196.2 397"; + +$SabotageGame::ObjectiveLocation1["HarbingerTower"] = "810.5 -401.1 102"; +$SabotageGame::ObjectiveLocation2["HarbingerTower"] = "814.2 -428.7 198"; +$SabotageGame::BombLocation["HarbingerTower"] = "799.4 -402.1 116"; + +$SabotageGame::ObjectiveLocation1["Skyline"] = "-58.8556 -420.953 750.438"; +$SabotageGame::ObjectiveLocation2["Skyline"] = "-59.5177 -259.064 773.837"; +$SabotageGame::BombLocation["Skyline"] = "-7.6 -339.7 774"; + +$SabotageGame::ObjectiveLocation1["GeometricOrder"] = "-172.325 -396.557 159.9"; +$SabotageGame::ObjectiveLocation2["GeometricOrder"] = "-10.7 -573.29 159.9"; +$SabotageGame::BombLocation["GeometricOrder"] = "-79.9 -487.06 165.9"; + + + + + + + + + + + + + + + + + + + + + + + + + +function GenerateSabotageChallengeMenu(%client, %tag, %index) { + if(%client.CheckNWChallengeCompletion("BombDisarmed")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Bomb Disarmed - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Bomb Disarmed - Disarm a enemy bomb."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("BombPlanted")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Bomb Planted - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Bomb Planted - Arm the bomb at the objective."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("BombDetonated")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Bomb Detonated - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Bomb Detonated - Win a Round Of Sabotage."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("3For5Sabo")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Three For Five - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Three For Five - Win 3 Rounds Of Sabotage."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("BaseDestroyer")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Base Destroyer - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Base Destroyer - Go Undefeated in a full game of Sabotage."); + %index++; + } + // + return %index; +} diff --git a/scripts/SinglePlayerGame.cs b/scripts/SinglePlayerGame.cs new file mode 100644 index 0000000..ae7b2c9 --- /dev/null +++ b/scripts/SinglePlayerGame.cs @@ -0,0 +1,1303 @@ +// Training Script +//echo("Running Training Script"); + +datablock AudioProfile(TrainingHudUpdateSound) +{ + filename = "gui/objective_notification.wav"; + description = AudioDefault3d; + preload = true; +}; + +datablock AudioProfile(MessageRecieveSound) +{ + filename = "gui/objective_notification.wav"; + description = AudioDefault3d; + preload = true; +}; + +// for training5 +datablock ForceFieldBareData(defaultNoTeamLavaLightField) +{ + fadeMS = 1000; + baseTranslucency = 1; + powerOffTranslucency = 0; + teamPermiable = false; + otherPermiable = false; + color = "1.0 0.4 0.0"; + targetTypeTag = 'ForceField'; + + texture[0] = "skins/forcef1"; + texture[1] = "skins/forcef2"; + texture[2] = "skins/forcef3"; + texture[3] = "skins/forcef4"; + texture[4] = "skins/forcef5"; + + framesPerSec = 10; + numFrames = 5; + scrollSpeed = 15; + umapping = 1.0; + vmapping = 0.15; +}; + +// load the voice text and wav file +exec("scripts/spDialog.cs"); + + +function setSinglePlayerGlobals() +{ + // server settings + //$MPRestoreBotCount = $Host::BotCount; this one is done automatically in server.cs + $MPRestoreBotMatchBotCount = $Host::BotMatchBotCount; + $MPRestoreBotsEnabled = $Host::BotsEnabled; + $MPRestoreMaxBotDifficulty = $Host::MaxBotDifficulty; + $MPRestoreMaxPlayers = $Host::MaxPlayers; + $MPRestoreMinBotDifficulty = $Host::MinBotDifficulty; + $MPRestoreTimeLimit = $Host::TimeLimit; + $MPRestoreTournamentMode = $Host::TournamentMode; + $MPRestorewarmupTime = $Host::warmupTime; + $MPRestoreTeamDamage = $teamDamage; + + //$Host::BotCount = "0"; + $Host::BotMatchBotCount = "0"; + $Host::BotsEnabled = "0"; + $Host::MaxBotDifficulty = "1"; + $Host::MaxPlayers = "64"; + $Host::MinBotDifficulty = "0"; + $Host::TimeLimit = "9999999"; + $Host::TournamentMode = "false"; + $Host::warmupTime = "0"; + + if($pref::trainingDifficulty < 1 || $pref::trainingDifficulty > 3) + $pref::trainingDifficulty = 1; + + if($pref::trainingDifficulty == 1) + $teamDamage = false; + else + $teamDamage = true; + + + // game settings + $MPRestoreteamSkin[1] = $teamSkin[1]; + $MPRestoreteamName[1] = $teamName[1]; + $MPRestoreholoName[1] = $holoName[1]; + $MPRestoreswitchSkin[1] = $switchSkin[1]; + + $MPRestoreteamSkin[2] = $teamSkin[2]; + $MPRestoreteamName[2] = $teamName[2]; + $MPRestoreholoName[2] = $holoName[2]; + $MPRestoreswitchSkin[2] = $switchSkin[2]; + + $playerTeam = 1; + $teamSkin[$playerTeam] = 'swolf'; + $teamName[$playerTeam] = 'StarWolf'; + $holoName[$playerTeam] = "StarWolf"; + $switchSkin[$playerTeam] = 'swolf'; + $playerLivesAtEasy = 3; + + $EnemyTeam = 2; + $teamSkin[$EnemyTeam] = 'Horde'; + $teamName[$EnemyTeam] = 'Bioderm Horde'; +// $holoName[$enemyTeam] = "Bioderm"; +// $switchSkin[$enemyTeam] = 'Bioderm'; + + if($enemyName $= "") + $EnemyName = "Enemy"; + + $trainingDefenseTauntList = "bas.enemy slf.att.attack slf.def.defend wrn.enemy tgt.acquired gbl.brag slf.def.base vqk.help"; + $trainingOffenseTauntList = "slf.att.attack gbl.brag vqk.help att.distract att.attack ene.disarray glb.awesome need.cover"; +} + +function resetSinglePlayerGlobals() +{ + + //error("================ single player global vars reset!"); + // server settings + //$Host::BotCount = $MPRestoreBotCount; + $Host::BotMatchBotCount = $MPRestoreBotMatchBotCount; + $Host::BotsEnabled = $MPRestoreBotsEnabled; + $Host::MaxBotDifficulty = $MPRestoreMaxBotDifficulty; + $Host::MaxPlayers = $MPRestoreMaxPlayers; + $Host::MinBotDifficulty = $MPRestoreMinBotDifficulty; + $Host::TimeLimit = $MPRestoreTimeLimit; + $Host::TournamentMode = $MPRestoreTournamentMode; + $Host::warmupTime = $MPRestorewarmupTime; + $teamDamage = $MPRestoreTeamDamage; + + // game settings + $teamSkin[1] = $MPRestoreteamSkin[1]; + $teamName[1] = $MPRestoreteamName[1]; + $holoName[1] = $MPRestoreholoName[1]; + $switchSkin[1] = $MPRestoreswitchSkin[1]; + + $teamSkin[2] = $MPRestoreteamSkin[2]; + $teamName[2] = $MPRestoreteamName[2]; + $holoName[2] = $MPRestoreholoName[2]; + $switchSkin[2] = $MPRestoreswitchSkin[2]; +} + +// Actors +//======================================================================================= + +function addEnemies() +{ + %num = $numberOfEnemies[$pref::TrainingDifficulty]; + error("Adding " @ %num @" enemies!"); + + %group = nameToId("MissionGroup/Teams/Team2/DropPoints"); + + for(%i = 0; %i < %num; %i++){ + %name = getUniqueEnemyName(); + %voice = "Derm"@getRandom(1,3); + %voicePitch = 1 - ((getRandom(20) - 10)/100); + + //%client = AIConnect($EnemyName@%i, $EnemyTeam, $missionBotSkill[$pref::TrainingDifficulty], true); + %client = AIConnect(%name, $EnemyTeam, $missionBotSkill[$pref::TrainingDifficulty], true, %voice, %voicePitch); + $Enemy[%i] = %client; + %client.race = "Bioderm"; + + setTargetSkin(%client.target, $teamSkin[$enemyTeam]); + //setTargetVoice(%client.target, addTaggedString(%client.voice)); + + //error("Setting race of "@$Enemy[%i]@" to "@$Enemy[%i].race); + if(%group.getObject(%i).Equipment || %group.getObject(%i).specialObjectives) { + %client.equipment = %group.getObject(%i).Equipment; + //error("Client: "@%client@ " has equipment "@%client.equipment); + %client.SpecialObjectives = %group.getObject(%i).SpecialObjectives; + //error("Client: "@%client@ " has specialEd "@%client.SpecialObjectives); + game.equip(%client.player); + } + + // this seems redundant after equip + %client.player.setArmor(%client.armor); + } +} + +// there are times (missions 2 and 4) where bots are not added with +// addEnemies(). there are x waves of bots with y number in each wave +// i do it a couple of times so im going to localize it here rather than +// do it twice or cut and paste it +function spawnWave(%wave) +{ + for(%i=1; %i<=$numberInWave[$pref::TrainingDifficulty]; %i++) { + %name = getUniqueEnemyName(); + %voice = "Derm"@getRandom(1,3); + %voicePitch = 1 - ((getRandom(20) - 10)/100); + %thisAi = aiConnect(%name, $enemyTeam, $missionBotSkill[$pref::TrainingDifficulty], false, %voice, %voicePitch); + //%thisAi = aiConnect("Wave"@%wave@"num"@%i, $enemyTeam, $missionBotSkill[$pref::TrainingDifficulty], false); + // here we differentiate the different drop points for wave spawned bots (these spawned bots are "!offense") + //error("added enemy "@%thisAi); + %thisAi.race = "Bioderm"; + %thisAi.voice = "Derm"@getRandom(3); + setTargetSkin(%thisAI.target, $teamSkin[$enemyTeam]); + setTargetVoice(%thisAI.target, addTaggedString(%thisAI.voice)); + %equipment = pickEquipment(); + game.equip(%thisAi.player, %equipment); + //%client.player.setArmor(%thisAi.armor); + + //create a little group + game.NumberInWave[%wave]++; + %thisAI.MemberOfWave = %wave; + + //anything mission specific that has to be done with this client + missionSpawnedAI(%thisAi); + } + game.spawnWaveTimer = spawnWaveTimer(%wave, false); +} + + +function addPlayersTeam(%num) +{ + //echo($player.team@"<---------players team on addPlayerTeam"); + + getTeammateGlobals(); + + for(%i=0; %i< %num; %i++){ + $Teammate[%i] = %client = AIConnect($TeammateWarnom[%i], $playerTeam, $teammateSkill[%i], true, $teammateVoice[%i]); + + %client.sex = $teammateGender[%i]; + %client.equipment = $teammateEquipment[%i]; + setTargetSkin(%client.target, $teamSkin[$playerTeam]); + game.equip(%client.player); + %client.player.setArmor(%client.armor); + + if (! %client.defaultTasksAdded) + { + %client.defaultTasksAdded = true; + %client.addTask(AIEngageTask); + %client.addTask(AIPickupItemTask); + %client.addTask(AIUseInventoryTask); + %client.addTask(AIEngageTurretTask); + %client.addtask(AIDetectMineTask); + } + + } + + //add Player=============================================================== + $player.lives = $playerLivesAtEasy - $pref::TrainingDifficulty; + + game.spawnPlayer($player, false); + setTargetSkin($player.target, $teamSkin[$playerTeam]); + +} + +function getUniqueEnemyName() +{ + if(!$enemyNameCount) + return; + + %used = false; + %name = pickUniqueEnemyName(); + %used = enemyNameIsUsed(%name); + while(%used) + { + if(%emergency++ > 1000) + { + //error("Too many times in the name while loop...using DEFAULT"); + return $enemyName; + } + %name = pickUniqueEnemyName(); + %used = enemyNameIsUsed(%name); + } + return %name; +} + +function pickUniqueEnemyName() +{ + %random = getRandom(1, $enemyNameCount); + %name = $EnemyNameList[%random]; + //error("returning" SPC %name SPC "from pick"); + return %name; +} + +function enemyNameIsUsed(%name) +{ + %number = game.usedNameCount; + for(%i = 0; %i <= %number; %i++) + { + if(game.usedName[%i] $= %name) + return true; + } + // the name is unused + game.usedName[game.usedNameCount++] = %name; + return false; +} + +function spawnWaveTimer(%wave, %reset) +{ + //error("SpawnTimer ACTIVATED"); + + if(%reset) + { + cancel(game.spawnWaveTimer); + %timeForAction = 60000 * 2; //2 min + } + else %timeForAction = 60000 * 4; //4 min + + game.spawnWaveTimer = schedule(%timeForAction, game, destroyWave, %wave); +} + +function DestroyWave(%wave) +{ + // this group has enemies in it that are dawdling and + // need to be killed to keep the game progressing + %num = clientGroup.getCount(); + for(%i = 0; %i < %num; %i++) + { + %client = clientGroup.getObject(%i); + if(%client.player && %client.MemberOfWave == %wave) + { + %client.player.applyDamage(%client.player.getDataBlock().maxDamage); + enemyWaveMemberKilled(%client); + } + } +} + + +function SinglePlayerGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement) +{ + if(game.missionOver) + return; + %clVictim.dead = true; + if(%clvictim.team == $enemyTeam && getRandom(1,1000) == 69) + doText(Any_jingo02); + missionClientKilled(%clVictim, %clKiller); + if(%clVictim.MemberOfWave) + enemyWaveMemberKilled(%clVictim ); + + Parent::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement); + cancel(%clVictim.respawnTimer); + + if(%clVictim == $player) { + // dead players are not out of bounds + cancel($player.OOB); + + $player.deaths++; + %num = $player.lives; + if( %num >= 1) { + if(%num == 1) + %textNum = "one life"; + else %textNum = %num SPC "lives"; + messageBoxOk("Restart", "You have" SPC %textNum SPC "remaining.", "spawnSinglePlayer();"); + } + else schedule(3000, $player.player, singlePlayerDead); + } +} + +function enemyWaveMemberKilled(%client) +{ + %wave = %client.MemberOfWave; + %remaining = game.numberInWave[%wave]--; + //error("Debug: Script reports that client " @ %client @ " was a member of wave " @ %wave @ " that now has " @ %remaining @ " members remaining."); + if(%remaining == 0) { + missionWaveDestroyed(%wave); + + if (%wave+1 <= $numberOfWaves[$pref::TrainingDifficulty]) + spawnWave(%wave+1); + //else error("Debug: " @ %wave @ " was the last wave."); + } +} + +function SinglePlayerGame::assignClientTeam(%game, %client) +{ + // The players team is set in singlePlayer::clientMissionDropReady + // and the bots are added to a team with aiConnect + // so this is unnecessary +} + +function singlePlayerGame::AIHasJoined() +{ + // Big deal...my missions are crawling with AI + // lets get rid of this mundane console spam +} + +function SinglePlayerGame::updateKillScores() +{ + // Do nothing other than get rid of the console warning... +} + +function singlePlayerGame::biodermAssume(%game, %client) +{ + //error(%client SPC "might talk."); + // dont do anything if we have just done this + if(%client.spgSpeaking) + return; + + %probability = 2; + %time = 30; // secs + + // we are going to POSSIBLY talk. flag it for %time secs + %client.spgSpeaking = true; + schedule(%time * 1000, %client, resetSpeakingFlag, %client); + + if(getRandom(%probability) == 1) + trainingBiodermSpeaks(%client); + +} + +function resetSpeakingFlag(%client) +{ + //error(%client SPC "can now speak again."); + %client.spgSpeaking = false; +} + +function trainingBiodermSpeaks(%client) +{ + if(%client.offense) // offense = defense? + %tauntlist = $trainingDefenseTauntList; //yes this seem wrong but its not + else + %tauntlist = $trainingOffenseTauntList; + %num = getWordCount(%tauntList); + %random = getRandom(%num - 1); + %use = getWord(%tauntList, %random); + //echo("Derm taunting:" SPC %use); + + playTargetAudio( %client.target, addTaggedString(%use), AudioClose3d, false ); +} + +function singlePlayerDead() +{ + missionFailed($player.miscMsg[trainingDeathLoss]); + AIMissionEnd(); + $objectiveQ[$enemyTeam].clear(); + cancel($player.distanceCheckSchedule); +} + +function SinglePlayerGame::missionLoadDone(%game) +{ + DefaultGame::missionLoadDone(%game); + + setSinglePlayerGlobals(); + $matchStarted = true; + //this has to happen sometime because game.startMatch never gets called + %game.clearDeployableMaxes(); +} + + +function SinglePlayerGame::notifyMatchStart(%game, %time) +{ + //do nothing +} + + +function SinglePlayerGame::clientMissionDropReady(%game, %client) +{ + DefaultGame::clientMissionDropReady(%game, %client); + + //echo(%client @ " is single player Ready!!!"); + messageClient(%client, 'MsgClientReady', "", %game.class); + + $Player = %client; + $player.race = "Human"; + $player.team = $playerTeam; + $player.setTeam($playerTeam); + setTargetSkin($teammate[%i].target, $teamSkin[$playerTeam]); + $player.clearBackpackIcon(); + + createText($player); + HUDMessageVector.clear(); + messageClient(%client, 'MsgMissionDropInfo', "", $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); + + // We don't start in observer mode, so disable: + commandToClient(%client, 'setHudMode', 'Standard'); + + //custom training keymap + %game.createCustomKeyMap(); + + + addEnemies(); + //echo($player.team@"<---------players team on mission drop ready"); + addPlayersTeam($numberOfTeammates); + + //everybody's in, enable the AI system + AISystemEnabled(true); + + $player.setControlObject( $player.player ); + $player.camera = new Camera() + { + dataBlock = Observer; + }; + + startCurrentMission(%game); +} + +function SinglePlayerGame::AIInit(%game) +{ + //error("initializing Bot Q's for SinglePlayerGame..."); + for (%i = 0; %i <= %game.numTeams; %i++) + { + if (!isObject($ObjectiveQ[%i])) + { + $ObjectiveQ[%i] = new AIObjectiveQ(); + MissionCleanup.add($ObjectiveQ[%i]); + } + + //error("team " @ %i @ " objectives load..."); + $ObjectiveQ[%i].clear(); + AIInitObjectives(%i, %game); + } + + AIInit(); + + // Bots never throw grenades on Easy skills + if($pref::TrainingDifficulty == 1) + $AIDisableGrenades = true; +} + +// unlike the MP game, sometimes we start with switches (flipFlops) +// already on one team or the other and they are unskinned +function setFlipFlopSkins(%group) +{ + if(!%group) + %group = nameToID("Teams"); + + for(%i = 0; %i < %group.getCount(); %i++) { + %this = %group.getObject(%i); + if(%this.getClassName() $= "SimGroup") + setFlipFlopSkins(%this); + else if(%this.getDataBlock().getName() $= "FlipFlop") + setTargetSkin(%this.getTarget(), $teamSkin[%this.team]); + } +} + + + +function singlePlayerGame::gameOver(%game) +{ + moveMap.push(); + + ServerConnection.setBlackOut(false, 0); + + $timeScale = 1; + + game.missionOver = true; + + // clear the inventory and weapons hud + // BH: This doesn't actually DO anything... + //error("clearing Inv HUD for client " @ $player); + //$player.SetInventoryHudClearAll(); + + // im gonna try dropping all the clients + %count = clientGroup.getCount(); + echo("count=" SPC %count); + for(%i = 0; %i < %count; %i++) { + %client = clientGroup.getObject(%i); + game.client[%i] = %client; + freeClientTarget(%client); + } + for(%i = 0; %i < %count; %i++) { + %client = game.client[%i]; + echo("client=" SPC %client); + if(%client.isAIControlled()) + %client.drop(); + } + + //disable the AI system + AISystemEnabled(false); + $AIDisableChatResponse = ""; + + game.deactivatePackages(); + + if(isObject( $player.currentWaypoint )) + $player.currentWaypoint.delete(); + + if($player.OOB) + cancel($player.OOB); + + // clear the objective HUD + messageClient($player, 'MsgClearObjHud', ""); + + resetSinglePlayerGlobals(); + + $currentMissionType = ""; + DefaultGame::GameOver(%game); +} + +function singlePlayerGame::deactivatePackages(%game) +{ + error("singlePlayerGame packages deactivated"); + //Deactivate packages...gotta catch'm all + //deactivatepackage(SinglePlayer); + deactivatepackage(Training1); + deactivatepackage(Training2); + deactivatepackage(Training3); + deactivatepackage(Training4); + deactivatepackage(Training5); + deactivatepackage(Training6); + deactivatePackage(singlePlayerMissionAreaEnforce); +} +//------------------------------------------------------------------------------------ + + +// Voice line, text, function and audio parsing +//================================================================================= +// this is how we handle ALL the voice distribition and playing +// its NOT pretty +function doText(%name, %extraTime, %priority) +{ + if($player.text[%name, priority] || %priority) + addToQueueNext(%name); + else addToQueueEnd(%name); + + $player.text[%name, extraTime] = %extraTime; + processText(false); +} + +function processText(%cont) +{ + //we may need to fudge everysound to get it timed right + %universalSoundFudgingConstant = 400; + + if(isEventPending($currentlyPlaying) && !%cont) + return; + + %name = $player.Textque0; + if(%name $= "") + return; + + //echo("processing: "@%name); + if($player.Text[%name, eval] !$= "") + { + if (!isPureServer()) + eval($player.text[%name, eval]); + else + processTextEval($player.text[%name, eval]); + } + if($player.Text[%name, text] !$= "") { + // the old way: messageClient($player, 0, '\c2%1: %2',$trainerName, $player.Text[%name, line]); + messageClient($player, 0, "\c5"@$player.Text[%name, text]); + serverPlay2d(MessageRecieveSound); + } + if($player.Text[%name, wav] !$= "") { + //messageClient($player, 0, "~w"@$player.Text[%name, wav]); + %audio = alxCreateSource( AudioChat, $player.Text[%name, wav] ); + alxPlay( %audio ); + } + + removeFromQueue(); + + %wavLen = alxGetWaveLen($player.text[%name, wav]); + //if(%wavLen < 400) + // %wavLen = 400; // you cant go back in time, vge + + %time = %wavLen + $player.text[%name, extraTime] + %universalSoundFudgingConstant; + //echo("total delay time of"@%time); + + $currentlyPlaying = schedule(%time, $player.player, processText, true); + //if (!isPureServer()) + // schedule(%time, 0, eval, "$currentlyPlaying = false;"); + //else + // schedule(%time, 0, SPUnsetCurrentlyPlaying); +} + +function SPUnsetCurrentlyPlaying() +{ + $currentlyPlaying = ""; +error(getSimTime() SPC "DEBUG setting currentlyPlaying null"); +} + +function processTextEval(%evalStmt) +{ + switch$ (%evalStmt) + { + case "singlePlayerPlayGuiCheck();": + singlePlayerPlayGuiCheck(); + + case "schedule(3000, 0, disconnect);": + schedule(3000, 0, disconnect); + + case "lockArmorHack();autoToggleHelpHud(true);": + lockArmorHack();autoToggleHelpHud(true); + + case "flashMessage();": + flashMessage(); + + case "flashObjective();": + flashObjective(); + + case "flashCompass();": + flashCompass(); + + case "flashHealth();": + flashHealth(); + + case "flashEnergy();": + flashEnergy(); + + case "flashInventory();": + flashInventory(); + + case "flashSensor();": + flashSensor(); + + case "autoToggleHelpHud(false);": + autoToggleHelpHud(false); + + case "setWaypointAt(\"-287.5 393.1 76.2\", \"Health Patches\");movemap.push();$player.player.setMoveState(false);": + setWaypointAt("-287.5 393.1 76.2", "Health Patches");movemap.push();$player.player.setMoveState(false); + + case "$player.hurryUp = schedule(40000, 0, hurryPlayerUp); endOpeningSpiel(); updateTrainingObjectiveHud(obj8);": + $player.hurryUp = schedule(40000, 0, hurryPlayerUp); endOpeningSpiel(); updateTrainingObjectiveHud(obj8); + + case "updateTrainingObjectiveHud(obj7);": + updateTrainingObjectiveHud(obj7); + + case "flashWeapon(0);": + flashWeapon(0); + + case "flashWeapon(2);": + flashWeapon(2); + + case "flashWeapon(3); ": + flashWeapon(3); + + case "flashWeaponsHud();": + flashWeaponsHud(); + + case "use(Blaster);": + use(Blaster); + + case "queEnemySet(0); activatePackage(singlePlayerMissionAreaEnforce);": + queEnemySet(0); activatePackage(singlePlayerMissionAreaEnforce); + + case "setWaypointat(nameToId(Tower).position, \"BE Tower\"); updateTrainingObjectiveHud(obj4);": + setWaypointat(nameToId(Tower).position, "BE Tower"); updateTrainingObjectiveHud(obj4); + + case "flashPack();": + flashPack(); + + case "updateTrainingObjectiveHud(obj3);": + updateTrainingObjectiveHud(obj3); + + case "setWaypointAt(\"-8.82616 -131.779 119.756\", \"Control Switch\");": + setWaypointAt("-8.82616 -131.779 119.756", "Control Switch"); + + case "setWaypointAt(nameToId(InitialPulseSensor).position, \"Sensor\");": + setWaypointAt(nameToId(InitialPulseSensor).position, "Sensor"); + + case "setWaypointAt(\"-8.82616 -131.779 119.756\", \"Tower\");": + setWaypointAt("-8.82616 -131.779 119.756", "Tower"); + + case "setWaypointAt(\"380.262 -298.625 98.9719\", \"Tower\");": + setWaypointAt("380.262 -298.625 98.9719", "Tower"); + + case "firstPersonQuickPan();": + firstPersonQuickPan(); + + case "ThreeAEval();": + ThreeAEval(); + + case "game.ExpectiongSupportButton = true;": + game.ExpectiongSupportButton = true; + + case "game.expectingRepairOrder = true;": + game.expectingRepairOrder = true; + + case "$random = getRandom(20,40);schedule($random, 0, doText, T4_TipDefense06);": + $random = getRandom(20,40);schedule($random, 0, doText, T4_TipDefense06); + + case "training5addSafeDistance();": + training5addSafeDistance(); + } +} + + +function removeFromQueue() +{ + %i = 1; + while($player.textque[%i] !$= "") { + $player.textque[%i-1] = $player.textque[%i]; + %i++; + } + $player.textque[%i-1] = ""; +} + + +function addToQueueEnd(%name) +{ + %q = 0; + while($player.Textque[%q] !$= ""){ + %q++; + } + $player.Textque[%q] = %name; +} + +function addToQueueNext(%name) +{ + %q = 0; + while($player.Textque[%q] !$= ""){ + %q++; + } + for(%i=%q; %i>0; %i--) + $player.textque[%i] = $player.textque[%i-1]; + $player.textque0 = %name; +} + +function echoQueue() +{ + echo("Textque -------------------------------"); + %i = 0; + while($player.Textque[%i] !$= "") { + echo(%i@": "@$player.Textque[%i]); + %i++; + } +} + +function clearQueue() +{ + for(%i=0;%i<100; %i++) + $player.textQue[%i] = ""; +} + +//handy waypoint setting tool +//========================================================================= +function setWaypointAt(%location, %name, %team) +{ + %team = (!%team ? $playerTeam : %team); + // if(!%name) + // %name = ""; + if ( isObject( $player.currentWaypoint ) ) + $player.currentWaypoint.delete(); + + $player.currentWaypoint = new WayPoint(TurretTower) { + position = %location; + rotation = "1 0 0 0"; + scale = "1 1 1"; + dataBlock = "WayPointMarker"; + team = %team; + name = %name; + }; + MissionCleanup.add($player.currentWaypoint); +} + +//this is just a little consolidation of functions +//its a little gregarious but allows text to live in spdialg.cs +//intent is to make hud updating easier and localization easier too ;) +function updateTrainingObjectiveHud( %objectiveNum ) +{ + + //sound + objectiveHud.setVisible(false); + if (!isPureServer()) + schedule(400, game, eval, "objectiveHud.setVisible(true);"); + else + schedule(400, game, setObjHudVisible); + + serverPlay2d(TrainingHudUpdateSound); + + //clear old text + messageClient($player, 'MsgSPCurrentObjective1', "", ' '); + messageClient($player, 'MsgSPCurrentObjective2', "", ' '); + + // find the lines from the spdialog file that are now attached to the sp client + %who = $player; + %mission = $currentMission; + for(%x = 1; %x <= 2; %x++) + %newObjectiveLine[%x] = $player.objHud[%mission, %objectiveNum, %x]; + + //add new text + messageClient($player, 'MsgSPCurrentObjective1', "", %newObjectiveLine1); + if(%newObjectiveLine2 !$= "") + messageClient($player, 'MsgSPCurrentObjective2', "", %newObjectiveLine2); +} + +function setObjHudVisible() +{ + objectiveHud.setVisible(true); +} + + +// Misc/Overwrites +//======================================================================================= + +function isSafe(%object, %radius) +{ + %team = %object.team; + %position = %object.player.getTransform(); + + //check for enemy players + %num = clientGroup.getCount(); + for(%client = 0; %client <= %num; %client++) + { + if(%team != %client.team && %client.player) { + %enemyPos = %client.player.getTransform(); + //okay, just in case we dont have a player for that client + //AND are close to "0 0 0" vge + if(!%enemyPos) + %dist = 100000; + else %dist = vectorDist(%position, %enemyPos); + //error("Debug: Client "@%client@" is "@%dist@" away"); + if ( %dist < %radius){ + //error("Unsafe because of client "@%client@" at a distance of "@%dist@"!!!!"); + return false; + } + } + } + //error("Safe for a radius of "@%radius@"!"); + return true; +} + +function singlePlayerGame::onAIRespawn(%game, %client) +{ + // add the default tasks + + if (! %client.defaultTasksAdded) + { + %client.defaultTasksAdded = true; + %client.addTask(AIEngageTask); + %client.addTask(AIPickupItemTask); + %client.addTask(AIUseInventoryTask); + %client.addTask(AIEngageTurretTask); + %client.addtask(AIDetectMineTask); + if(%client.team == $playerTeam || $pref::trainingDifficulty == 3) + %client.addTask(AITauntCorpseTask); + } +} + + +function singlePlayerGame::onAIKilled(%game, %clVictim, %clAttacker, %damageType, %implement) +{ + // dont respawn AI (this is overwritten in some of the mission packages) +} + + +function singleplayerGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement) +{ + //the DefaultGame will set some vars + DefaultGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement); + + //now see if both were on the same team + if(%clAttacker && %clAttacker != %clVictim && %clVictim.team == %clAttacker.team) + { + %game.friendlyFireMessage(%clVictim, %clAttacker); + } +} + +function singleplayerGame::onAIDamaged(%game, %clVictim, %clAttacker, %damageType, %implement) +{ + if(%clVictim.team != %clAttacker.team && %clVictim.MemberOfWave) + { + spawnWaveTimer(%clVictim.MemberOfWave, true); + } + + if (%clAttacker && %clAttacker != %clVictim && %clAttacker.team == %clVictim.team) + { + schedule(250, %clVictim, "AIPlayAnimSound", %clVictim, %clAttacker.player.getWorldBoxCenter(), "wrn.watchit", -1, -1, 0); + + //clear the "lastDamageClient" tag so we don't turn on teammates... unless it's uberbob! + %clVictim.lastDamageClient = -1; + } +} + +// find number of players on a team +// why isnt this in a std lib +function getPlayersOnTeam(%team) +{ + %num = clientGroup.getCount(); + for(%i=0; %i<%num; %i++){ + %client = clientGroup.getObject(%i); + if(%client.team == %team && %client.player) + %count++; + } + + return %count; +} + + +//mission completion/falure stuff============================================ +function missionComplete(%text) +{ + $player.endMission = schedule(15000, game, forceFinish); + + messageBoxOk("Victory", %text, "forceFinish();"); + + //AI stop + clearQueue(); + AIMissionEnd(); + $objectiveQ[$enemyTeam].clear(); +} + +function forceFinish() +{ + $timeScale = 1; + //kill the thread if we pressed a button to get here... + cancel($player.endMission); + + //make sure we end the game neatly + Game.gameOver(); + + //immediately disconnect - bringing us back to the main menu... + Disconnect(); +} + +function missionFailed(%text) +{ + + $player.endMission = schedule(30000, game, forceFinish); + + MessageBoxYesNo("Failure", %text, "reloadMission();", "forceFinish();"); + + //AI stop + cancel($Player.T1OpeningSpielSchedule); + cancel($Player.distanceCheckSchedule); + clearQueue(); + AIMissionEnd(); + $objectiveQ[$enemyTeam].clear(); +} + +function reloadMission() +{ + cancel($player.endMission); + Game.gameOver(); + Canvas.setContent( LoadingGui ); + loadMission($currentMission, singlePlayer); + debriefContinue(); +} + + +// silly...we fed it a movemap binding it retuns the capitalized key in (almost) english +function findTrainingControlButtons( %name ) +{ + %controlName = moveMap.getBinding(%name); + if (%controlName $= "") + return "[no key binding]"; + %prettyName = strupr(getMapDisplayName(getWord(%controlName, 0), getWord(%controlName, 1))); + %next = 2; + while( getWord( %controlName, %next ) !$= "" ) { + %extra = "-"@strupr(getWord( %controlName, 2 )); + %prettyName = %prettyName @ %extra; + %next++; + } + return %prettyName; +} + +// just a kinda cool little effect +function firstPersonQuickPan() +{ + if($firstperson) { + toggleFirstPerson($player); + schedule(4000, $player.player, toggleFirstPerson, $player); + } + +} + + +// Player spawning/respawning==================================================== +//since we are going through pickTeamSpawn rather than pickPlayerSpawn +// and for a couple other reasons, we are going to need to manually determine +// if this is a respawn or not. +function spawnSinglePlayer() +{ + $player.lives--; + + game.spawnPlayer($player, true); + $player.setControlObject($player.player); + //messageClient($player, 0, "Respawns Remaining: "@$player.lives); +} + + +function singleplayerGame::observerOnTrigger() +{ + //we dont want the player respawning (yet) + return false; +} + +function SinglePlayerGame::spawnPlayer( %game, %client, %respawn ) +{ + //error("Spawn Player: %client = " @%client@" %respawn = "@%respawn); + %spawnPoint = %game.pickPlayerSpawn( %client, %respawn ); + %game.createPlayer( %client, %spawnPoint, %respawn ); +} + +function singlePlayerGame::playerSpawned(%game, %player) +{ + defaultGame::playerSpawned(%game, %player); +} + +function singleplayerGame::pickPlayerSpawn(%game, %client, %respawn) +{ + // the bots, for some reason, always pass in %respawn as true + // well that's horse pucky, since the bots never respawn in SPG + // so I do this stupid thing + if(%client.isAIcontrolled()) + %respawn = false; + + if(!%client.offense) // this is a wave spawned attack bot + %respawn = true; + + + %game.pickTeamSpawn( %client, %respawn); +} + +function singleplayerGame::pickTeamSpawn(%game, %client, %respawn) +{ + %team = %client.team; + + if(%respawn) { + %group = nameToID("MissionGroup/Teams/team"@%team@"/DropPoints/Respawns"); + if(! isObject(%group)) { + //error("Client" SPC %client SPC "is attempting a respawn with no drop point"); + return "0 0 300"; + } + else %spawnLoc = %group.getObject(game.respawnPoint); + //error("REspawn loc is: " @ %spawnLoc); + } + + else { + %group = nameToID("MissionGroup/Teams/team" @ %team @ "/DropPoints"); + %spawnLoc = %group.getObject(game.spawnLoc[%team]); + //error("spawn loc is: "@game.spawnLoc[%team]); + game.spawnLoc[%team]++; + } + return %spawnLoc.getTransform(); +} + + +function SinglePlayerGame::createCustomKeymap(%game) +{ +// new ActionMap(TrainingMap); +// TrainingMap.bindCmd( keyboard, "escape", "escapeFromGame();", "" ); +} + +//======================================================================================= +// Escape dialog functions: +//======================================================================================= +function SinglePlayerEscapeDlg::onWake( %this ) +{ + $timeScale = 0; + + if( OptionsDlg.isAwake()) + { + Canvas.popDialog( OptionsDlg ); + } +} + +function SinglePlayerEscapeDlg::onSleep( %this ) +{ +// spMap.pop(); +// spMap.delete(); +} + + +function SinglePlayerEscapeDlg::leaveGame( %this ) +{ + Canvas.popDialog( SinglePlayerEscapeDlg ); + MessageBoxYesNo( "LEAVE GAME", $player.miscMsg[LeaveGame], "forceFinish();", "$timeScale = 1;" ); +} + +function SinglePlayerEscapeDlg::gotoSettings( %this ) +{ + Canvas.popDialog( SinglePlayerEscapeDlg ); + Canvas.pushDialog( OptionsDlg ); +} + +function SinglePlayerEscapeDlg::returnToGame( %this ) +{ + //error( "** CALLING SinglePlayerEscapeDlg::returnToGame **" ); + $timeScale = 1; + Canvas.popDialog( SinglePlayerEscapeDlg ); + + movemap.push(); + //trainingmap.push(); +} + + +function singlePlayerGame::OptionsDlgSleep(%game) +{ + $enableDirectInput = 1; + activateDirectInput(); + + Canvas.pushDialog( SinglePlayerEscapeDlg ); + // the player may have changed his keys + // we need to reload the big spdialog string table that + // holds all the text related to the players keymappings + createText($player); +} + +// mission Area package +package singlePlayerMissionAreaEnforce { +// -begin mission area package------------------------------------------------- + +// OOB +function SinglePlayerGame::leaveMissionArea(%game, %playerData, %player) +{ + parent::leaveMissionArea(%game, %playerData, %player); + if(%player == $player.player) { + $player.leftMissionArea++; + %timeAllowed = 30; + $player.OOB = schedule(%timeAllowed *1000, 0, wussOut, %player); + clearQueue(); + doText(Any_offcourse); + MessageClient($player, 0, $player.miscMsg[OOB]); + %player.playerLeftMissionArea = true; + } +} +function SinglePlayerGame::enterMissionArea(%game, %playerData, %player) +{ + parent::enterMissionArea(%game, %playerData, %player); + if(%player == $player.player && %player.playerLeftMissionArea) { + //echo("player back in bounds"); + cancel($player.OOB); + clearQueue(); + doText(Any_alright); + MessageClient($player, 0, $player.miscMsg[InBounds]); + } +} +function wussOut(%player) +{ + clearQueue(); + doText(Any_abort); + missionFailed($player.miscMsg[OOBLoss]); +} + +// -end mission area package------------------------------------------------- +}; + +// Custom Particle effects for training5 + +datablock ParticleData(BeforeT5particle) +{ + dragCoefficient = 0; + gravityCoefficient = -0.017094; + inheritedVelFactor = 0.0176125; + constantAcceleration = -0.8; + lifetimeMS = 1248; + lifetimeVarianceMS = 0; + useInvAlpha = 1; + spinRandomMin = -200; + spinRandomMax = 200; + textureName = "particleTest"; + colors[0] = "1.000000 0.677165 0.000000 1.000000"; + colors[1] = "0.708661 0.507812 0.000000 1.000000"; + colors[2] = "0.000000 0.000000 0.000000 0.000000"; + colors[3] = "1.000000 1.000000 1.000000 1.000000"; + sizes[0] = 0.991882; + sizes[1] = 2.99091; + sizes[2] = 4.98993; + sizes[3] = 1; + times[0] = 0; + times[1] = 0.2; + times[2] = 1; + times[3] = 2; +}; + +datablock ParticleData(AfterT5particle) +{ + dragCoefficient = 0; + gravityCoefficient = -0.017094; + inheritedVelFactor = 0.0176125; + constantAcceleration = -1.1129; + lifetimeMS = 2258; + lifetimeVarianceMS = 604; + useInvAlpha = 1; + spinRandomMin = -200; + spinRandomMax = 200; + textureName = "special/Smoke/smoke_001"; + colors[0] = "1.000000 0.677165 0.000000 1.000000"; + colors[1] = "0.181102 0.181102 0.181102 1.000000"; + colors[2] = "0.000000 0.000000 0.000000 0.000000"; + colors[3] = "1.000000 1.000000 1.000000 1.000000"; + sizes[0] = 0.991882; + sizes[1] = 2.99091; + sizes[2] = 4.98993; + sizes[3] = 1; + times[0] = 0; + times[1] = 0.2; + times[2] = 1; + times[3] = 2; +}; + +datablock ParticleEmitterData(BeforeT5) +{ + ejectionPeriodMS = 16; + periodVarianceMS = 10; + ejectionVelocity = 7.45968; + velocityVariance = 0.25; + ejectionOffset = 0; + thetaMin = 0; + thetaMax = 180; + phiReferenceVel = 0; + phiVariance = 360; + overrideAdvances = 0; + orientParticles= 0; + orientToNormal = 0; + orientOnVelocity = 1; + particles = "BeforeT5particle"; +}; + +datablock ParticleEmitterData(AfterT5) +{ + ejectionPeriodMS = 10; + periodVarianceMS = 0; + ejectionVelocity = 10.25; + velocityVariance = 0.25; + ejectionOffset = 0; + thetaMin = 0; + thetaMax = 180; + phiReferenceVel = 0; + phiVariance = 360; + overrideAdvances = 0; + orientParticles= 0; + orientToNormal = 0; + orientOnVelocity = 1; + particles = "AfterT5particle"; +}; diff --git a/scripts/TR2Game.cs b/scripts/TR2Game.cs new file mode 100644 index 0000000..16cb716 --- /dev/null +++ b/scripts/TR2Game.cs @@ -0,0 +1,31 @@ +// Bastardized for Contruction Mod to load the player datablocks +// without screwing up the rest of the game. + +// DisplayName = Team Rabbit 2 + +//--- GAME RULES BEGIN --- +//Get the flag and throw it into the other team's goal +//You can only hold onto the flag for 15 seconds +//Passing the flag increases the size of the Jackpot +//Scoring a goal awards the Jackpot to your team! +//When your health reaches zero, you are knocked down +//Replenish your ammo by pressing your suicide button +//--- GAME RULES END --- + + + +// Team Rabbit 2 +// Created by Codality, Inc. +// www.codality.com +// ------------------------------- +// Michael "KineticPoet" Johnston - Designer, Lead Programmer, Maps +// Dan "daunt" Kolta - Physics design, Maps +// Scott "FSB-AO" Estabrook - Programmer +// John "CObbler" Carter - Bonus sound effects +// Buddy "sLaM" Pritchard - Sound effects +// Gregg "illy" Fellows - 3D models and skins +// Alan "Nefilim" Schwertel; - Maps +// Kenneth "SONOFMAN" Cook - Sky art + + +exec("scripts/TR2Physics.cs"); diff --git a/scripts/TR2heavy_male.cs b/scripts/TR2heavy_male.cs new file mode 100644 index 0000000..d39e3d6 --- /dev/null +++ b/scripts/TR2heavy_male.cs @@ -0,0 +1,41 @@ +datablock TSShapeConstructor(TR2HeavyMaleDts) +{ + baseShape = "TR2heavy_male.dts"; + sequence0 = "TR2heavy_male_root.dsq root"; + sequence1 = "TR2heavy_male_forward.dsq run"; + sequence2 = "TR2heavy_male_back.dsq back"; + sequence3 = "TR2heavy_male_side.dsq side"; + sequence4 = "heavy_male_lookde.dsq look"; + sequence5 = "heavy_male_head.dsq head"; + sequence6 = "TR2heavy_male_fall.dsq fall"; + sequence7 = "TR2heavy_male_jet.dsq jet"; + sequence8 = "TR2heavy_male_land.dsq land"; + sequence9 = "TR2heavy_male_jump.dsq jump"; + sequence10 = "heavy_male_recoilde.dsq light_recoil"; + sequence11 = "heavy_male_idlepda.dsq pda"; + sequence12 = "heavy_male_headside.dsq headside"; + sequence13 = "heavy_male_lookms.dsq lookms"; + sequence14 = "TR2heavy_male_diehead.dsq death1"; + sequence15 = "TR2heavy_male_diechest.dsq death2"; + sequence16 = "TR2heavy_male_dieback.dsq death3"; + sequence17 = "TR2heavy_male_diesidelf.dsq death4"; + sequence18 = "TR2heavy_male_diesidert.dsq death5"; + sequence19 = "TR2heavy_male_dieforward.dsq death6"; // heavy_male_dieleglf + sequence20 = "TR2heavy_male_diechest.dsq death7"; // heavy_male_dielegrt + sequence21 = "TR2heavy_male_dieslump.dsq death8"; + sequence22 = "TR2heavy_male_dieforward.dsq death9"; // heavy_male_dieknees + sequence23 = "TR2heavy_male_dieforward.dsq death10"; + sequence24 = "TR2heavy_male_diespin.dsq death11"; + sequence25 = "TR2heavy_male_celsalute.dsq cel1"; + sequence26 = "TR2heavy_male_celwave.dsq cel2"; + sequence27 = "TR2heavy_male_tauntbest.dsq cel3"; + sequence28 = "TR2heavy_male_tauntimp.dsq cel4"; + sequence29 = "TR2heavy_male_celdance.dsq cel5"; + sequence30 = "TR2heavy_male_celflex.dsq cel6"; + sequence31 = "TR2heavy_male_celtaunt.dsq cel7"; + sequence32 = "TR2heavy_male_celjump.dsq cel8"; + sequence33 = "TR2heavy_male_ski.dsq ski"; + sequence34 = "TR2heavy_male_standjump.dsq standjump"; + sequence35 = "heavy_male_looknw.dsq looknw"; +}; + diff --git a/scripts/TR2medium_male.cs b/scripts/TR2medium_male.cs new file mode 100644 index 0000000..e6b3a1b --- /dev/null +++ b/scripts/TR2medium_male.cs @@ -0,0 +1,43 @@ + +datablock TSShapeConstructor(TR2MediumMaleDts) +{ + baseShape = "TR2medium_male.dts"; + sequence0 = "TR2medium_male_root.dsq root"; + sequence1 = "TR2medium_male_forward.dsq run"; + sequence2 = "TR2medium_male_back.dsq back"; + sequence3 = "TR2medium_male_side.dsq side"; + sequence4 = "medium_male_lookde.dsq look"; + sequence5 = "medium_male_head.dsq head"; + sequence6 = "TR2medium_male_fall.dsq fall"; + sequence7 = "TR2medium_male_jet.dsq jet"; + sequence8 = "TR2medium_male_land.dsq land"; + sequence9 = "TR2medium_male_jump.dsq jump"; + sequence10 = "medium_male_recoilde.dsq light_recoil"; + sequence11 = "medium_male_headside.dsq headside"; + sequence12 = "medium_male_looksn.dsq looksn"; + sequence13 = "medium_male_lookms.dsq lookms"; + sequence14 = "TR2medium_male_sitting.dsq sitting"; + sequence15 = "TR2medium_male_diehead.dsq death1"; + sequence16 = "TR2medium_male_diechest.dsq death2"; + sequence17 = "TR2medium_male_dieback.dsq death3"; + sequence18 = "TR2medium_male_diesidelf.dsq death4"; + sequence19 = "TR2medium_male_diesidert.dsq death5"; + sequence20 = "TR2medium_male_dieleglf.dsq death6"; + sequence21 = "TR2medium_male_diechest.dsq death7"; // medium_male_dielegrt + sequence22 = "TR2medium_male_dieback.dsq death8"; + sequence23 = "TR2medium_male_dieknees.dsq death9"; + sequence24 = "TR2medium_male_dieforward.dsq death10"; + sequence25 = "TR2medium_male_diespin.dsq death11"; + sequence26 = "medium_male_idlepda.dsq pda"; + sequence27 = "TR2medium_male_celsalute.dsq cel1"; + sequence28 = "TR2medium_male_celwave.dsq cel2"; + sequence29 = "TR2medium_male_tauntbest.dsq cel3"; + sequence30 = "TR2medium_male_tauntimp.dsq cel4"; + sequence31 = "TR2medium_male_celdance.dsq cel5"; + sequence32 = "TR2medium_male_celflex.dsq cel6"; + sequence33 = "TR2medium_male_celtaunt.dsq cel7"; + sequence34 = "TR2medium_male_celrocky.dsq cel8"; + sequence35 = "TR2medium_male_ski.dsq ski"; + sequence36 = "TR2medium_male_standjump.dsq standjump"; + sequence37 = "medium_male_looknw.dsq looknw"; +}; diff --git a/scripts/TWM2/AI/DroneAI.cs b/scripts/TWM2/AI/DroneAI.cs new file mode 100644 index 0000000..568c496 --- /dev/null +++ b/scripts/TWM2/AI/DroneAI.cs @@ -0,0 +1,549 @@ +$Drone::DetectDist = 20000; +$Drone::TurnImpulse = 123; +$Drone::FrdImpulse = 525; +//$Drone::TurnImpulse = 675 / 3; +//$Drone::FrdImpulse = 525 * 3; +$Drone::newTargetChance = "1 100"; + +$Drone::paths = 4; +$Drone::path[1,1] = "0 1500 1000"; +$Drone::path[1,2] = "1500 0 1000"; +$Drone::path[1,3] = "0 -1500 1000"; +$Drone::path[1,4] = "-1500 0 1000"; + +$Drone::path[2,1] = "0 -1500 1000"; +$Drone::path[2,2] = "-1500 0 1000"; +$Drone::path[2,3] = "0 1500 1000"; +$Drone::path[2,4] = "1500 0 1000"; + +$Drone::path[3,1] = "0 2500 750"; +$Drone::path[3,2] = "0 2500 1250"; +$Drone::path[3,3] = "0 -2500 1250"; +$Drone::path[3,4] = "0 -2500 750"; + +$Drone::path[4,1] = "2500 0 750"; +$Drone::path[4,2] = "2500 0 1250"; +$Drone::path[4,3] = "-2500 0 1250"; +$Drone::path[4,4] = "-2500 0 750"; + +//-----Manuver Index----- + +$flightManuvers::Behind[0] = Immelman; +$flightManuvers::Behind[1] = HalfFlip; +$flightManuvers::Behind[2] = BreakRight; +$flightManuvers::Behind[3] = BreakLeft; +$flightManuvers::Behind[4] = BarrelRoll; +$flightManuvers::Behind[5] = WingWaggle; +$flightManuvers::Behind[6] = Reversal; + + +//-----Manuvers----- + +//Immelman +$flightManuver::Points[Immelman] = 5; //This signifies how many points are in the manuver +$flightManuver::Point[Immelman,0] = "0 1 0 0 0 1"; //each point represents the 3 numbers of the vector of the desired forward vector, +$flightManuver::Point[Immelman,1] = "0 0 1 0 -1 0"; //and then the 3 numbers of the vector for the desired Up vector +$flightManuver::Point[Immelman,2] = "0 -1 0 0 0 -1"; +$flightManuver::Point[Immelman,3] = "0 -1 0 1 0 0"; +$flightManuver::Point[Immelman,4] = "0 -1 0 0 0 1"; + +//halfFlip +$flightManuver::Points[HalfFlip] = 3; +$flightManuver::Point[HalfFlip,0] = "0 1 0 0 0 1"; +$flightManuver::Point[HalfFlip,1] = "0 0 1 0 -1 0"; +$flightManuver::Point[HalfFlip,2] = "0 -1 0 0 0 -1"; + +//breakRight +$flightManuver::Points[BreakRight] = 3; +$flightManuver::Point[BreakRight,0] = "0 1 0 0 0 1"; +$flightManuver::Point[BreakRight,1] = "0 1 0 1 0 0"; +$flightManuver::Point[BreakRight,2] = "1 0 0 0 -1 0"; + +//BreakLeft +$flightManuver::Points[BreakLeft] = 3; +$flightManuver::Point[BreakLeft,0] = "0 1 0 0 0 1"; +$flightManuver::Point[BreakLeft,1] = "0 1 0 -1 0 0"; +$flightManuver::Point[BreakLeft,2] = "-1 0 0 0 -1 0"; + +//BarrelRoll +$flightManuver::Points[BarrelRoll] = 5; +$flightManuver::Point[BarrelRoll,0] = "0 1 0 0 0 1"; +$flightManuver::Point[BarrelRoll,1] = "0 1 0 1 0 0"; +$flightManuver::Point[BarrelRoll,2] = "0 1 0 0 0 -1"; +$flightManuver::Point[BarrelRoll,3] = "0 1 0 -1 0 0"; +$flightManuver::Point[BarrelRoll,4] = "0 1 0 0 0 1"; + +//WingWaggle +$flightManuver::Points[WingWaggle] = 4; +$flightManuver::Point[WingWaggle,0] = "0 1 0 0 0 1"; +$flightManuver::Point[WingWaggle,1] = "-1 1 0 0 0 1"; +$flightManuver::Point[WingWaggle,2] = "1 1 0 0 0 1"; +$flightManuver::Point[WingWaggle,3] = "0 1 0 0 0 1"; + +//Reversal +$flightManuver::Points[Reversal] = 7; +$flightManuver::Point[Reversal,0] = "0 1 0 0 0 1"; +$flightManuver::Point[Reversal,1] = "0 0 1 0 -1 0"; +$flightManuver::Point[Reversal,2] = "0 0 1 1 0 0"; +$flightManuver::Point[Reversal,3] = "1 0 0 0 0 -1"; +$flightManuver::Point[Reversal,4] = "0 0 -1 -1 0 0"; +$flightManuver::Point[Reversal,5] = "0 0 -1 0 1 0"; +$flightManuver::Point[Reversal,6] = "0 1 0 0 0 1"; + +//This is a function for mass spawning +function DroneBattle(%pos, %radius, %number, %teamlow, %teamhigh, %maxskill, %slth){ + for(%i = 0; %i < %number; %i++){ + %startpos = vectorAdd(%pos,(getRandom(0, %radius) - (%radius / 2))@" "@(getRandom(0, %radius) - (%radius / 2))@" 0"); + %rotation = "0 0 1 "@getRandom(1,360); + if(%teamlow != %teamhigh) + %team = getRandom(%teamlow,%teamhigh); + else + %team = %teamlow; + StartDrone(%startpos,%rotation,%team,getRandom(1,%maxskill), %slth); + } +} + +//This sets up the drone and the functions needed to start the drone. +function StartDrone(%pos, %rotation, %team, %skill, %slth){ + if(%team $= "") + %team = 0; + if(%pos $= "") + %pos = "0 0 300"; + if(%rotation $= "") + %rotation = "1 0 0 0"; + if(%skill !$= "ace"){ + if(%skill $= "" || %skill < 1) + %skill = 1; + else if(%skill > 10) + %skill = 10; + } + %Drone = new FlyingVehicle() + { + dataBlock = ScoutFlyer; + position = %pos; + rotation = %rotation; + team = %team; + }; + MissionCleanUp.add(%Drone); + + setTargetSensorGroup(%Drone.getTarget(), %team); + + %Drone.isdrone = 1; + %drone.dodgeGround = 0; + + if(%slth) { + %Drone.setCloaked(true); + } + + if(%skill $= "ace"){ + %skill = 10; + %drone.isace = 1; + } + + %drone.skill = 0.2 + (%skill / 12.5); + + schedule(100, 0, "DroneForwardImpulse", %drone); + schedule(101, 0, "DronefindTarget", %drone); + schedule(102, 0, "DroneScanGround", %drone); + + return %drone; +} + +function StartAIGunship(%pos, %rotation, %team, %skill, %slth){ + if(%team $= "") + %team = 0; + if(%pos $= "") + %pos = "0 0 300"; + if(%rotation $= "") + %rotation = "1 0 0 0"; + if(%skill !$= "ace"){ + if(%skill $= "" || %skill < 1) + %skill = 1; + else if(%skill > 10) + %skill = 10; + } + %Drone = new FlyingVehicle() + { + dataBlock = HarbingerGunship; + position = %pos; + rotation = %rotation; + team = %team; + }; + MissionCleanUp.add(%Drone); + + setTargetSensorGroup(%Drone.getTarget(), %team); + + %Drone.isdrone = 1; + %drone.dodgeGround = 0; + + if(%slth) { + %Drone.setCloaked(true); + } + + %drone.skill = 0.2 + (%skill / 12.5); + + schedule(100, 0, "DroneForwardImpulse", %drone); + schedule(101, 0, "DronefindTarget", %drone); + schedule(102, 0, "DroneScanGround", %drone); + schedule(30000, 0, "SwitchHarbieGunLoop", %drone); + + return %drone; +} + +function SwitchHarbieGunLoop(%gunship) { + if(!isObject(%gunship)) { + return; + } + if(%gunship.barrel $= "Chain") { + %gunship.barrel = "Collider"; + %gunship.turretObject.mountImage(HarbingerGunshipColliderImage, 0); + } + else { + %gunship.barrel = "Chain"; + %gunship.turretObject.mountImage(HarbingerGunshipCGImage, 0); + } + schedule(30000, 0, "SwitchHarbieGunLoop", %gunship); +} + +function SwitchACGunLoop(%gunship) { + if(!isObject(%gunship)) { + return; + } + %rang = getRandom(1, 3); + switch(%rang) { + case 1: + %gunship.barrel = "Chain"; + %gunship.turretObject.mountImage(AC130GunshipCGImage, 0); + case 2: + %gunship.barrel = "120"; + %gunship.turretObject.mountImage(AC130BigCannonImage, 0); + case 3: + %gunship.barrel = "45"; + %gunship.turretObject.mountImage(AC130LittleCannonImage, 0); + default: + %gunship.barrel = "Chain"; + %gunship.turretObject.mountImage(AC130GunshipCGImage, 0); + } + schedule(30000, 0, "SwitchACGunLoop", %gunship); +} + +//This makes the drone move forward until it dies +function DroneForwardImpulse(%obj){ + if(!isObject(%obj)) + return; + if(!%obj.isace){ + if(vectorLen(%obj.getVelocity()) < 165) + %obj.applyImpulse(%obj.getPosition(),vectorScale(%obj.getForwardVector(),$Drone::FrdImpulse)); + } + else{ + if(vectorLen(%obj.getVelocity()) < 180) + %obj.applyImpulse(%obj.getPosition(),vectorScale(%obj.getForwardVector(),$Drone::FrdImpulse * 1.25)); + } + schedule(100, 0, "DroneForwardImpulse", %obj); +} + +function DroneScanGround(%obj){ + if(!isObject(%obj)) + return; + %vec = %obj.getForwardVector(); + %vector = vectorAdd(%obj.getPosition(),"0 0 -500"); + %searchResult = containerRayCast(%obj.getWorldBoxCenter(), %vector, $TypeMasks::TerrainObjectType, %obj); + if(%searchResult){ + %z = getWord(%vec,2); + %height = vectorDist(%obj.getPosition(),posFromRaycast(%searchresult)); + if(%z < 0){ + if(%height <= (200 + ((%z * -1) * 300))){ + %obj.dodgeground = 1; + schedule(100, 0, "DroneDodgeGround", %obj); + return; + } + } + } + schedule(100, 0, "DroneScanGround", %obj); +} + +function DroneDodgeGround(%obj){ + if(!isObject(%obj)) + return; + %vec = %obj.getForwardVector(); + %z = getWord(%vec,2); + if(%z > 0){ + %obj.dodgeground = 0; + schedule(100, 0, "DronefindTarget", %obj); + schedule(101, 0, "DroneScanGround", %obj); + return; + } + %pos = vectorAdd(%obj.getPosition(),%vec); + %obj.applyImpulse(%pos,vectorScale("0 0 1",$Drone::TurnImpulse * %obj.skill)); + schedule(100, 0, "DroneDodgeGround", %obj); +} + +//This function checks the area around it for any targets. +function DronefindTarget(%obj){ + if(!isObject(%obj)) + return; + %pos = %obj.getposition(); + InitContainerRadiusSearch(%pos, $drone::detectdist + (800 + (600 * %obj.skill)), $TypeMasks::VehicleObjectType | $TypeMasks::PlayerObjectType); + while ((%searchResult = containerSearchNext()) != 0){ + %objtarget = firstWord(%searchResult); + if(isObject(%objtarget) && %objTarget !$= %obj){ + %trgtype = %objtarget.getClassName(); + if((%trgtype $= "FlyingVehicle" || %trgtype $= "HoverVehicle" || %trgtype $= "Player") && %objtarget.team != %obj.team){ + %testPos = %objtarget.getWorldBoxCenter(); + %distance = vectorDist(%objtarget.getPosition(),%pos); + if (%distance > 0){ + %target = %objtarget; + DroneDetermineManuver(%obj, %target); + return; + } + } + } + } + schedule(100, 0, "DronePatrol", %obj); +} + +function DronePatrol(%obj){ + if(!isObject(%obj)) + return; + if($Drone::paths > 0){ + if(%obj.path $= ""){ + %obj.path = getRandom(1,$Drone::paths); + %obj.point = 0; + } + %obj.point++; + if($Drone::path[%obj.path,%obj.point] $= ""){ + schedule(100, 0, "DronefindTarget", %obj); + %obj.path = ""; + %obj.point = ""; + } + else + schedule(100,0,"dronemovetopoint",%obj,$Drone::path[%obj.path,%obj.point]); + } + else + schedule(500, 0, "DronefindTarget", %obj); +} + +function DroneMoveToPoint(%obj,%Tpos){ + if(!isObject(%obj)) + return; + if(%obj.dodgeground == 1) + return; + %pos = %obj.getPosition(); + %objfrd = %obj.getForwardVector(); + %objup = %obj.getUpVector(); + + %dist = vectorDist(%pos,%Tpos); + %aimvec = vectorNormalize(vectorSub(%Tpos,%pos)); + + %vec = vectorSub(%aimvec , %objfrd); + %vec = vectorCross(%vec, %objfrd); + %vec = vectorNormalize(vectorCross(%objfrd, %vec)); + if(vectorDist(%objfrd,vectorNormalize(%aimvec)) < 0.1) + %obj.applyImpulse(vectorAdd(%obj.getPosition(),vectorScale(%objfrd,($Drone::TurnImpulse / 2))),%vec); + else if(vectorDist(%objup, %vec) > 0.1){ + %vec = vectorSub(%vec, %objup); + %vec = vectorCross(%vec, %objup); + %vec = vectorNormalize(vectorCross(%objup, %vec)); + %pos = vectorAdd(%obj.getPosition(),vectorScale(%objup,$Drone::TurnImpulse * 3 * %obj.skill)); + %obj.applyImpulse(%pos,%vec); + } + else + %obj.applyImpulse(vectorAdd(%obj.getPosition(),%objfrd),vectorScale(%vec,$Drone::TurnImpulse * %obj.skill)); + if(getRandom(0,getWord($Drone::newTargetChance,1)) <= (getWord($Drone::newTargetChance,0) * 10)) + schedule(100, 0, "DronefindTarget", %obj, %target); + else if(%dist < 25) + schedule(100, 0, "DronePatrol", %obj); + else + schedule(100, 0, "DroneMoveToPoint", %obj, %tpos); +} + +//This function figures out what the drone should do from where the target is. +function DroneDetermineManuver(%obj, %target){ + if(!isObject(%obj)) + return; + if(!isObject(%target)){ + DronefindTarget(%obj); + return; + } + %pos = %obj.getPosition(); + %Tpos = %Target.getPosition(); + %objfrd = %obj.getForwardVector(); + %trgfrd = %target.getForwardVector(); + %vec = vectorSub(%Tpos,%pos); + %dirdist = vectorDist(%objfrd,vectorNormalize(%vec)); + %vecdist = vectorDist(%objfrd,%trgfrd); + if(%dirdist > 1.41){ + if(%vecdist < 1.41 && vectorDist(%pos,%Tpos) < 2000){ + UnderFireManuver(%obj, $flightManuvers::Behind[getRandom(0,6)], ""); + } + else + TurnToFire(%obj, %target); + } + else + TurnToFire(%obj, %target); + %obj.target = %target; +} + +function TurnToFire(%obj, %target){ + if(!isObject(%obj)) + return; + if(!isObject(%target)){ + DronefindTarget(%obj); + return; + } + if(%obj.dodgeground == 1) + return; + + %pos = %obj.getPosition(); + %Tpos = %target.getPosition(); + %objfrd = %obj.getForwardVector(); + %trgfrd = %target.getForwardVector(); + %objup = %obj.getUpVector(); + %Tvel = %target.getVelocity(); + + %dist = vectorDist(%pos,%Tpos); + %aimPos = vectorAdd(%Tpos, vectorScale(%Tvel,(%dist / 1750))); + %aimvec = vectorNormalize(vectorSub(%aimPos,%pos)); + + if(vectorDist(%objfrd,%aimvec) < 0.1 && %dist <= 1000){ + if((vectorDist(%objfrd,%trgfrd) < 0.2 || vectorDist(%objfrd,%trgfrd) > 1.8) && %obj.missiling != 1){ + %obj.setImageTrigger(4, true); + %obj.missiling = 1; + } + else if(%obj.missiling == 1){ + %obj.setImageTrigger(4, false); + %obj.missiling = 0; + } +// if (%obj.firing != 1){ + %obj.setImageTrigger(2, true); + %obj.setImageTrigger(3, true); + %obj.firing = 1; +// } + } + else{ + if(%obj.firing == 1){ + %obj.setImageTrigger(2, false); + %obj.setImageTrigger(3, false); + %obj.firing = 0; + } + if(%obj.missiling == 1){ + %obj.setImageTrigger(4, false); + %obj.missiling = 0; + } + } + %vec = vectorSub(%aimvec , %objfrd); + %vec = vectorCross(%vec, %objfrd); + %vec = vectorNormalize(vectorCross(%objfrd, %vec)); + if(vectorDist(%objfrd,%trgfrd) > 1.8 && %dist <= 120){ + %vec = vectorScale(%vec, -1); + if(vectorDist(%objfrd,vectorNormalize(%aimvec)) > 1.8) + %obj.applyImpulse(vectorAdd(%obj.getPosition(),vectorScale(%objfrd,($Drone::TurnImpulse / 2))),%vec); + else if(vectorDist(%objup, %vec) > 0.1){ + %vec = vectorSub(%vec, %objup); + %vec = vectorCross(%vec, %objup); + %vec = vectorNormalize(vectorCross(%objup, %vec)); + %pos = vectorAdd(%obj.getPosition(),vectorScale(%objup,$Drone::TurnImpulse * 3 * %obj.skill)); + %obj.applyImpulse(%pos,%vec); + } + else + %obj.applyImpulse(vectorAdd(%obj.getPosition(),%objfrd),vectorScale(%vec,$Drone::TurnImpulse * %obj.skill)); + } + else if(vectorDist(%objfrd,vectorNormalize(%aimvec)) < 0.1) + %obj.applyImpulse(vectorAdd(%obj.getPosition(),vectorScale(%objfrd,($Drone::TurnImpulse / 2))),%vec); + else if(vectorDist(%objup, %vec) > 0.1){ + %vec = vectorSub(%vec, %objup); + %vec = vectorCross(%vec, %objup); + %vec = vectorNormalize(vectorCross(%objup, %vec)); + %pos = vectorAdd(%obj.getPosition(),vectorScale(%objup,$Drone::TurnImpulse * 3 * %obj.skill)); + %obj.applyImpulse(%pos,%vec); + } + else + %obj.applyImpulse(vectorAdd(%obj.getPosition(),%objfrd),vectorScale(%vec,$Drone::TurnImpulse * %obj.skill)); + if(getRandom(0,getWord($Drone::newTargetChance,1)) <= getWord($Drone::newTargetChance,0)) + schedule(100, 0, "DronefindTarget", %obj, %target); + else + schedule(100, 0, "TurnToFire", %obj, %target); +} + +//This function preforms the manuver choosen in Determine Maunver function. +function UnderFireManuver(%obj, %manuver, %point, %count){ + if(!isObject(%obj)) + return; + if(%obj.dodgeground == 1) + return; + if(%count $= "") + %count = 0; + if(%point $= ""){ + %point = 0; + SetPointVectors(%obj, %manuver); + } + if(%count >= 30){ + schedule(100, 0, "DroneDetermineManuver", %obj, %obj.target); + return; + } + %frdvec = %obj.getForwardVector(); + %upvec = %obj.getUpVector(); + if(vectorDist(%frdvec, %obj.pointvecfront[%point]) < 0.15 && vectorDist(%upvec, %obj.pointvectop[%point]) < 0.15){ + %point++; + if(%point < $flightManuver::Points[%manuver]) + schedule(100, 0, "UnderFireManuver", %obj, %manuver, %point, 0); + else + schedule(100, 0, "DroneDetermineManuver", %obj, %obj.target); + return; + } + if(vectorDist(%frdvec, %obj.pointvecfront[%point]) > 0.1){ + %vec = vectorSub(%obj.pointvecfront[%point], %frdvec); + %vec = vectorCross(%vec, %frdvec); + %vec = vectorCross(%frdvec, %vec); + %obj.applyImpulse(vectorAdd(%obj.getPosition(),vectorScale(%frdvec,$Drone::TurnImpulse * %obj.skill)),%vec); + } + if(vectorDist(%upvec, %obj.pointvectop[%point]) > 0.1){ + %vec = vectorSub(%obj.pointvectop[%point], %upvec); + %vec = vectorCross(%vec, %upvec); + %vec = vectorCross(%upvec, %vec); + %pos = vectorAdd(%obj.getPosition(),vectorScale(%upvec,$Drone::TurnImpulse * 3 * %obj.skill)); + %obj.applyImpulse(%pos,%vec); + } + %count++; + schedule(100, 0, "UnderFireManuver", %obj, %manuver, %point, %count); +} + +//This function finds what vectors each point in the manuver is compaired to the drone. +function SetPointVectors(%obj, %manuver){ + %up = %obj.getUpVector(); + %forward = %obj.getForwardVector(); + %right = vectorNormalize(vectorSub(%obj.getEdge("1 0 0"),%obj.getEdge("-1 0 0"))); + for(%i = 0; %i < $flightManuver::Points[%manuver]; %i++){ + %pointdir = $flightManuver::Point[%manuver, %i]; + %topvec = "0 0 0"; + %frontvec = "0 0 0"; + if(getWord(%pointdir, 0) > 0) + %frontvec = vectorAdd(%frontvec, %right); + else if(getWord(%pointdir, 0) < 0) + %frontvec = vectorAdd(%frontvec, vectorScale(%right, -1)); + if(getWord(%pointdir, 1) > 0) + %frontvec = vectorAdd(%frontvec, %forward); + else if(getWord(%pointdir, 1) < 0) + %frontvec = vectorAdd(%frontvec, vectorScale(%forward, -1)); + if(getWord(%pointdir, 2) > 0) + %frontvec = vectorAdd(%frontvec, %up); + else if(getWord(%pointdir, 2) < 0) + %frontvec = vectorAdd(%frontvec, vectorScale(%up, -1)); + + if(getWord(%pointdir, 3) > 0) + %topvec = vectorAdd(%topvec, %right); + else if(getWord(%pointdir, 3) < 0) + %topvec = vectorAdd(%topvec, vectorScale(%right, -1)); + if(getWord(%pointdir, 4) > 0) + %topvec = vectorAdd(%topvec, %forward); + else if(getWord(%pointdir, 4) < 0) + %topvec = vectorAdd(%topvec, vectorScale(%forward, -1)); + if(getWord(%pointdir, 5) > 0) + %topvec = vectorAdd(%topvec, %up); + else if(getWord(%pointdir, 5) < 0) + %topvec = vectorAdd(%topvec, vectorScale(%up, -1)); + + %obj.pointvecfront[%i] = vectorNormalize(%frontvec); + %obj.pointvectop[%i] = vectorNormalize(%topvec); + } +} diff --git a/scripts/TWM2/ArmorFunctions.cs b/scripts/TWM2/ArmorFunctions.cs new file mode 100644 index 0000000..0c60872 --- /dev/null +++ b/scripts/TWM2/ArmorFunctions.cs @@ -0,0 +1,687 @@ +//CUSTOM ARMOR FUNCTIONS +function MicroburstMaleHumanArmor::onTrigger(%data, %player, %triggerNum, %val) { + if (%triggerNum == 4) { + // Throw grenade + if (%val == 1) { + %player.grenTimer = 1; + } + else { + if (%player.grenTimer == 0) { + // Bad throw for some reason + } + else { + %player.use(Grenade); + %player.grenTimer = 0; + } + } + } + else if (%triggerNum == 5) { + // Throw mine + if (%val == 1) { + %player.mineTimer = 1; + } + else { + if (%player.mineTimer == 0) { + // Bad throw for some reason + } + else { + if(%player.inv[C4] > 0) { + %player.use(C4); + %player.mineTimer = 0; + } + else { + %player.use(Mine); + %player.mineTimer = 0; + } + } + } + } + else if (%triggerNum == 3) { + // val = 1 when jet key (LMB) first pressed down + // val = 0 when jet key released + // MES - do we need this at all any more? + if(!%player.CantFireS3Shock) { + %image = %player.getMountedImage($WeaponSlot).getName(); + + if(%image $= "S3RifleImage") { + %obj = %player; + %slot = 0; + //Shocklance Stuff + %muzzlePos = %obj.getMuzzlePoint(%slot); + %muzzleVec = %obj.getMuzzleVector(%slot); + + %endPos = VectorAdd(%muzzlePos, VectorScale(%muzzleVec, S3Shocker.extension)); + + %damageMasks = $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType | + $TypeMasks::StationObjectType | $TypeMasks::GeneratorObjectType | + $TypeMasks::SensorObjectType | $TypeMasks::TurretObjectType; + + %everythingElseMask = $TypeMasks::TerrainObjectType | + $TypeMasks::InteriorObjectType | + $TypeMasks::ForceFieldObjectType | + $TypeMasks::StaticObjectType | + $TypeMasks::MoveableObjectType | + $TypeMasks::DamagableItemObjectType; + + // did I miss anything? players, vehicles, stations, gens, sensors, turrets + %hit = ContainerRayCast(%muzzlePos, %endPos, %damageMasks | %everythingElseMask, %obj); + + %noDisplay = true; + if (%hit !$= "0") { + %obj.setEnergyLevel(%obj.getEnergyLevel() - 15); + + %hitobj = getWord(%hit, 0); + %hitpos = getWord(%hit, 1) @ " " @ getWord(%hit, 2) @ " " @ getWord(%hit, 3); + + if ( %hitObj.getType() & %damageMasks ) { + %hitobj.applyImpulse(%hitpos, VectorScale(%muzzleVec, S3Shocker.impulse)); + %obj.playAudio(0, ShockLanceHitSound); + + // This is truly lame, but we need the sourceobject property present... + %p = new ShockLanceProjectile() { + dataBlock = S3Shocker; + initialDirection = %obj.getMuzzleVector(%slot); + initialPosition = %obj.getMuzzlePoint(%slot); + sourceObject = %obj; + sourceSlot = %slot; + targetId = %hit; + }; + MissionCleanup.add(%p); + %p.WeaponImageSource = "S3RifleImage"; + + %damageMultiplier = 1.0; + + if(%hitObj.getDataBlock().getClassName() $= "PlayerData") { + // Now we see if we hit from behind... + %forwardVec = %hitobj.getForwardVector(); + %objDir2D = getWord(%forwardVec, 0) @ " " @ getWord(%forwardVec,1) @ " " @ "0.0"; + %objPos = %hitObj.getPosition(); + %dif = VectorSub(%objPos, %muzzlePos); + %dif = getWord(%dif, 0) @ " " @ getWord(%dif, 1) @ " 0"; + %dif = VectorNormalize(%dif); + %dot = VectorDot(%dif, %objDir2D); + + // 120 Deg angle test... + // 1.05 == 60 degrees in radians + if (%dot >= mCos(1.05)) { + // Rear hit + %damageMultiplier = 3.0; + } + } + + %totalDamage = S3Shocker.DirectDamage * %damageMultiplier; + %hitObj.getDataBlock().damageObject(%hitobj, %p.sourceObject, %hitpos, %totalDamage, $DamageType::ShockLance); + + %noDisplay = false; + } + } + if( %noDisplay ) { + // Miss + %obj.setEnergyLevel(%obj.getEnergyLevel() - 0); + %obj.playAudio(0, ShockLanceMissSound); + + %p = new ShockLanceProjectile() { + dataBlock = S3Shocker; + initialDirection = %obj.getMuzzleVector(%slot); + initialPosition = %obj.getMuzzlePoint(%slot); + sourceObject = %obj; + sourceSlot = %slot; + }; + MissionCleanup.add(%p); + %p.WeaponImageSource = "S3RifleImage"; + } + //END STUFF + %player.CantFireS3Shock = 1; + schedule(6000, 0, "ResetS3Shock", %player); + } + } + } +} + +function MicroburstFemaleHumanArmor::onTrigger(%data, %player, %triggerNum, %val) { + MicroburstMaleHumanArmor::onTrigger(%data, %player, %triggerNum, %val); +} + +function MicroburstMaleBiodermArmor::onTrigger(%data, %player, %triggerNum, %val) { + MicroburstMaleHumanArmor::onTrigger(%data, %player, %triggerNum, %val); +} + +function ResetS3Shock(%player) { + %player.CantFireS3Shock = 0; +} + + + + + + + + + + + + + + + + + + + + + + + +function ShadowCommandoMaleHumanArmor::onTrigger(%data, %player, %triggerNum, %val) { + if (%triggerNum == 4) { + // Throw grenade + if (%val == 1) { + %player.grenTimer = 1; + } + else { + if (%player.grenTimer == 0) { + // Bad throw for some reason + } + else { + %player.use(Grenade); + %player.grenTimer = 0; + } + } + } + else if (%triggerNum == 5) { + // Throw mine + if (%val == 1) { + %player.mineTimer = 1; + } + else { + if (%player.mineTimer == 0) { + // Bad throw for some reason + } + else { + if(%player.inv[C4] > 0) { + %player.use(C4); + %player.mineTimer = 0; + } + else { + %player.use(Mine); + %player.mineTimer = 0; + } + } + } + } + else if (%triggerNum == 3) { + // val = 1 when jet key (LMB) first pressed down + // val = 0 when jet key released + // MES - do we need this at all any more? + if(%player.RecentAttack["Shade"] == 1) { + return; + } + else { + messageClient(%player.client, 'MsgShd', "\c5TWM2: Activating Shade"); + %player.RecentAttack["Shade"] = 1; + schedule(90000, 0, "ResetPlayerDLAttack", %player, "Shade"); + %player.zapObject(); + %player.setCloaked(true); + %player.setCloakStatus(true); + %player.startFade(2000, 0, true); + %player.schedule(15000, "zapObject"); + %player.schedule(15000, "setCloaked", false); + %player.schedule(15000, "startFade", 5000, 0, false); + %player.schedule(15000, "setCloakStatus", false); + } + } +} + +function Player::setCloakStatus(%player, %status) { + %player.stealthed = %status; +} + +function ShadowCommandoFemaleHumanArmor::onTrigger(%data, %player, %triggerNum, %val) { + ShadowCommandoMaleHumanArmor::onTrigger(%data, %player, %triggerNum, %val); +} + +function ShadowCommandoMaleBiodermArmor::onTrigger(%data, %player, %triggerNum, %val) { + ShadowCommandoMaleHumanArmor::onTrigger(%data, %player, %triggerNum, %val); +} + + + + + + + + + + + + + + + + + + +//ZOMBAHS +function ZombieArmor::onTrigger(%data, %player, %triggerNum, %val) { + if (%triggerNum == 3) { + if(vectorLen(%player.getVelocity()) < 30) { //we dont want hyper speed zombies :) + %player.applyImpulse(%player.getPosition(),vectorScale(%player.getMuzzleVector(0),$Zombie::forwardspeed)); + } + } +} + +function LordZombieArmor::onTrigger(%data, %player, %triggerNum, %val) { + if (%triggerNum == 0) { //shooting + PlayerLordFire1(%player); + } + else if (%triggerNum == 5) { //lifting + playerLiftTarget(%player,0); + } +} + +function DemonZombieArmor::onTrigger(%data, %player, %triggerNum, %val) { + if(%player.isSniperZombie) { + if (%triggerNum == 0) { //shooting + if(%player.RecentAttack["Shot"] == 1) { + return; + } + else { + %player.RecentAttack["Shot"] = 1; + schedule(3000, 0, "ResetPlayerDLAttack", %player, "Shot"); + %p = new TracerProjectile() { //TWM2 Sniper zombies use M1 Snipers :P + dataBlock = M1Bullet; + initialDirection = %player.getMuzzleVector(4); + initialPosition = %player.getMuzzlePoint(4); + sourceObject = %player; + sourceSlot = 4; + }; + ServerPlay3D(M1FireSound, %player.getPosition()); + } + } + if(%triggerNum == 3) { + %pos = %player.getPosition(); + %vector = %player.getMuzzleVector(4); + %x = getWord(%vector, 0); + %y = getWord(%vector, 1); + %finX = %x * -1; + %finY = %y * -1; + %finalVec = %finX SPC %finY SPC 0; + %finalVec = VectorScale(%finalVec, $Zombie::DForwardSpeed * 3); + //Z is unimportant + %player.applyImpulse(%pos, %finalVec); + } + } + else { + if (%triggerNum == 0) { //shooting + if(%player.recharging) { + return; + } + %p = new GrenadeProjectile() { + dataBlock = DemonFireball; + initialDirection = %player.getMuzzleVector(0); + initialPosition = vectoradd(%player.getMuzzlePoint(0), "0 0 1.5"); + sourceObject = %player; + sourceSlot = 6; + }; + MissionCleanup.add(%p); + %player.recharging = 1; + schedule(4000,0,"ResetZombieCharge",%player); + } + } +} + +function RapierZombieArmor::onTrigger(%data, %player, %triggerNum, %val) { + if (%triggerNum == 3) { //flying + if(%val == 1) + %player.isJetting = true; + else { + %player.isJetting = false; + } + } + if (%triggerNum == 0) { //speeding + if(vectorLen(%player.getVelocity()) < 30) { //we dont want hyper speed zombies :) + %player.applyImpulse(%player.getPosition(),vectorScale(%player.getMuzzleVector(0),$Zombie::forwardspeed)); + } + } +} + +function ResetPlayerDLAttack(%player, %attack) { + %player.RecentAttack[""@%attack@""] = 0; +} + +function DemonMotherZombieArmor::onTrigger(%data, %player, %triggerNum, %val) { + if (%triggerNum == 0) { //shooting + PlayerLordFire1(%player); + } + else if (%triggerNum == 3) { //flying + if(%player.RecentAttack["Fly"] == 1) { + return; + } + else { + %attack = getRandom(1, 2); + %targetInfo = ZombieLookforTarget(%player); + %target = getWord(%targetInfo, 0); + if(%target.player.IsAlive()) { + %player.RecentAttack["Fly"] = 1; + schedule(17000, 0, "ResetPlayerDLAttack", %player, "Fly"); + if(%attack == 1) { + PlayerDemonLordFlyAttack(%player, %target.player); + } + else { + PlayerDemonLordPlasmaAttack(%player, %target.player); + } + } + } + } + else if (%triggerNum == 4) { + if(%player.RecentAttack["Missile"] == 1) { + return; + } + else { + %targetInfo = ZombieLookforTarget(%player); + %target = getWord(%targetInfo, 0); + if(%target.player.IsAlive()) { + %player.RecentAttack["Missile"] = 1; + schedule(17000, 0, "ResetPlayerDLAttack", %player, "Missile"); + //t3h missile + %target = %target.player; + %vec = vectorNormalize(vectorSub(%target.getPosition(),%player.getPosition())); + %p = new SeekerProjectile() { + dataBlock = DMMissile; + initialDirection = %vec; + initialPosition = %player.getMuzzlePoint(4); + sourceObject = %player; + sourceSlot = 4; + }; + %beacon = new BeaconObject() { + dataBlock = "SubBeacon"; + beaconType = "vehicle"; + position = %target.getWorldBoxCenter(); + }; + %beacon.team = 0; + %beacon.setTarget(0); + MissionCleanup.add(%beacon); + %p.setObjectTarget(%beacon); + DemonMotherMissileFollow(%target,%beacon,%p); + // + } + } + } + else if (%triggerNum == 5) { + if(%player.RecentAttack["Firestorm"] == 1) { + return; + } + else { + %targetInfo = ZombieLookforTarget(%player); + %target = getWord(%targetInfo, 0); + if(%target.player.IsAlive()) { + %player.RecentAttack["Firestorm"] = 1; + schedule(17000, 0, "ResetPlayerDLAttack", %player, "Firestorm"); + PlayerDemonLordFireRainAttack(%player, %target.player); + } + } + } +} + +function YvexZombieArmor::onTrigger(%data, %player, %triggerNum, %val) { + if (%triggerNum == 0) { //shooting + if(%player.RecentAttack["Pulse"] == 1) { + return; + } + else { + %attack = getRandom(1, 2); + %player.RecentAttack["Pulse"] = 1; + schedule(14000, 0, "ResetPlayerDLAttack", %player, "Pulse"); + if(%attack == 1) { + %p = new LinearFlareProjectile() { + dataBlock = KillerPulse; + initialDirection = %player.getMuzzleVector(0); + initialPosition = %player.getMuzzlePoint(0); + sourceObject = %player; + sourceSlot = 0; + }; + } + else { + %p = new LinearFlareProjectile() { + dataBlock = YvexSniperShot; + initialDirection = %player.getMuzzleVector(0); + initialPosition = %player.getMuzzlePoint(0); + sourceObject = %player; + sourceSlot = 0; + }; + } + } + } + else if (%triggerNum == 3) { //flying + if(%player.RecentAttack["RandNight"] == 1) { + return; + } + else { + %player.RecentAttack["RandNight"] = 1; + schedule(20000, 0, "ResetPlayerDLAttack", %player, "RandNight"); + %client = FindValidTarget(%player); + %counts = 0; + messageClient(%player.client,'msgZombie',"\c3Attempting Random Nightmare."); + if(isObject(%client.player) && %client.player.getState !$= "dead" && !%client.ignoredbyZombs) { + %c = createEmitter(%client.player.position,InfNightmareGlobeEmitter,"1 0 0"); //Rotate it + MissionCleanup.add(%c); // I think This should be used + schedule(3000,0,"killit",%c); + %luck = getrandom(1,5); + switch(%luck) { + case 1: + messageClient(%player.client,'msgZombie',"\c3Success!!!"); + Yvexnightmareloop(%player,%client); + messageClient(%client,'msgClient',"~wfx/misc/diagnostic_on.wav"); + case 2: + messageClient(%player.client,'msgZombie',"\c3Failed."); + case 3: + messageClient(%player.client,'msgZombie',"\c3Success!!!"); + Yvexnightmareloop(%player,%client); + messageClient(%client,'msgClient',"~wfx/misc/diagnostic_on.wav"); + case 4: + messageClient(%player.client,'msgZombie',"\c3Failed."); + case 5: + messageClient(%player.client,'msgZombie',"\c3Success!!!"); + Yvexnightmareloop(%player,%client); + messageClient(%client,'msgClient',"~wfx/misc/diagnostic_on.wav"); + } + } + else { + messageClient(%player.client,'msgZombie',"\c3Failed."); + } + } + } + else if (%triggerNum == 4) { + if(%player.RecentAttack["Missile"] == 1) { + return; + } + else { + %targetInfo = ZombieLookforTarget(%player); + %target = getWord(%targetInfo, 0); + if(%target.player.IsAlive()) { + %player.RecentAttack["Missile"] = 1; + schedule(27500, 0, "ResetPlayerDLAttack", %player, "Missile"); + //t3h missile + %target = %target.player; + %vec = vectorNormalize(vectorSub(%target.getPosition(),%player.getPosition())); + %p = new SeekerProjectile() { + dataBlock = YvexZombieMakerMissile; + initialDirection = %vec; + initialPosition = %player.getMuzzlePoint(4); + sourceObject = %player; + sourceSlot = 4; + }; + %beacon = new BeaconObject() { + dataBlock = "SubBeacon"; + beaconType = "vehicle"; + position = %target.getWorldBoxCenter(); + }; + %beacon.team = 0; + %beacon.setTarget(0); + MissionCleanup.add(%beacon); + %p.setObjectTarget(%beacon); + DemonMotherMissileFollow(%target,%beacon,%p); + // + } + } + } + else if (%triggerNum == 5) { + if(%player.RecentAttack["Summon"] == 1) { + return; + } + else { + %player.RecentAttack["Summon"] = 1; + schedule(40000, 0, "ResetPlayerDLAttack", %player, "Summon"); + PlayerSummon(%player, 5); + } + } +} + +function LordRogZombieArmor::onTrigger(%data, %player, %triggerNum, %val) { + if (%triggerNum == 0) { //shooting + if(%player.RecentAttack["BOV"] == 1) { + return; + } + else { + %player.RecentAttack["BOV"] = 1; + schedule(1000, 0, "ResetPlayerDLAttack", %player, "BOV"); + %p = new (LinearProjectile)() { + dataBlock = BOVhit; + initialDirection = %player.getMuzzleVector(0); + initialPosition = %player.getMuzzlePoint(0); + sourceObject = %player; + sourceSlot = 0; + }; + MissionCleanup.add(%p); + } + } + else if (%triggerNum == 3) { //flying + if(%player.RecentAttack["Summon"] == 1) { + return; + } + else { + %player.RecentAttack["Summon"] = 1; + schedule(35000, 0, "ResetPlayerDLAttack", %player, "Summon"); + PlayerSummon(%player, 6); + } + } + else if (%triggerNum == 5) { + if(%player.RecentAttack["RandAttack"] == 1) { + return; + } + else { + %player.RecentAttack["RandAttack"] = 1; + schedule(27500, 0, "ResetPlayerDLAttack", %player, "RandAttack"); + PlayerLRAbilities(%player); + } + } +} + +function ShifterZombieArmor::onTrigger(%data, %player, %triggerNum, %val) { + if (%triggerNum == 3) { //flying + if(%player.RecentAttack["Teleport"] == 1) { + return; + } + else { + %targetInfo = ZombieLookforTarget(%player); + %target = getWord(%targetInfo, 0); + if(%target.player.IsAlive()) { + %player.RecentAttack["Teleport"] = 1; + schedule(3500, 0, "ResetPlayerDLAttack", %player, "Teleport"); + %player.setVelocity("0 0 10"); + %player.startFade(500, 0, true); + %player.schedule(600, "SetPosition", VectorAdd(%target.player.getPosition(), "0 0 3")); + %player.startFade(750, 0, false); + } + } + } +} + +function SummonerZombieArmor::onTrigger(%data, %player, %triggerNum, %val) { + if (%triggerNum == 3) { //flying + if(%player.RecentAttack["Summon"] == 1) { + return; + } + else { + %player.RecentAttack["Summon"] = 1; + schedule(25000, 0, "ResetPlayerDLAttack", %player, "Summon"); + %Ct = GetRandom(1,3); + %type = GetRandom(1, 8); + if(%type > 5) { + %type += 3; + if(%type == 10) { //summoners don;t summon more summoners + %type = 12; + } + } + %SumPos = vectorAdd(VectorAdd(GetRandomPosition(20, 1), "0 0 7"), %player.getPosition()); + %c = CreateEmitter(%SumPos, NightmareGlobeEmitter, "0 0 1"); + %c.schedule(((%Ct * 1000) + 500), "delete"); + for(%i = 1; %i <= %ct; %i++) { + %time = %i * 1000; + schedule(%time, 0, "StartAZombie", %SumPos, %type); + } + } + } +} + +function DemonUltraZombieArmor::onTrigger(%data, %player, %triggerNum, %val) { + if (%triggerNum == 0) { //shooting + if(%player.recharging) { + return; + } + %p = new GrenadeProjectile() { + dataBlock = DemonFireball; + initialDirection = %player.getMuzzleVector(0); + initialPosition = vectoradd(%player.getMuzzlePoint(0), "0 0 1.5"); + sourceObject = %player; + sourceSlot = 6; + }; + MissionCleanup.add(%p); + %player.recharging = 1; + schedule(1000,0,"ResetZombieCharge",%player); + } + else if (%triggerNum == 3) { + if(vectorLen(%player.getVelocity()) < 30) { //we dont want hyper speed zombies :) + %player.applyImpulse(%player.getPosition(),vectorScale(%player.getMuzzleVector(0),$Zombie::forwardspeed)); + createBiodermProjection(%player); + } + } +} + +function FZombieArmor::onTrigger(%data, %player, %triggerNum, %val) { + if (%triggerNum == 3) { + if(%player.zombieType == 13) { + ServerPlay3D("SatchelChargeExplosionSound", %player.getPosition()); + %c4 = new Item() { + datablock = C4Deployed; + position = %player.getPosition(); + scale = ".1 .1 .1"; + }; + MissionCleanup.add(%c4); + schedule(770, 0, "C4GoBoom", %c4); + + %c4.theClient = %player.client; + return; + } + } +} + +function WraithZombieArmor::onTrigger(%data, %player, %triggerNum, %val) { + if (%triggerNum == 3) { + if(vectorLen(%player.getVelocity()) < 30) { //we dont want hyper speed zombies :) + %player.applyImpulse(%player.getPosition(),vectorScale(%player.getMuzzleVector(0),$Zombie::forwardspeed)); + } + } +} + +function ROGZombieArmor::onTrigger(%data, %player, %triggerNum, %val) { + if (%triggerNum == 3) { + if(%player.state["canUseMG"]) { + playerRogFire(%player); + } + } + + if(%triggerNum == 0) { + %player.SALoop = RapierShieldAttack(%player, %val, 0); + } +} diff --git a/scripts/TWM2/Bosses/BossDatablocks.cs b/scripts/TWM2/Bosses/BossDatablocks.cs new file mode 100644 index 0000000..cc5ef1e --- /dev/null +++ b/scripts/TWM2/Bosses/BossDatablocks.cs @@ -0,0 +1,2369 @@ +//BossDatablocks.cs +//Phantom139 +//Contains all datablocks for bosses... + +// +// BOSS ARMORS / VEHICLES / OBJECTS +// + +// ============================================================================ +// YVEX +// ============================================================================ +datablock PlayerData(YvexZombieArmor) : LightMaleHumanArmor { + boundingBox = "1.63 1.63 2.6"; + maxDamage = 500.0; + minImpactSpeed = 35; + shapeFile = "medium_male.dts"; + + debrisShapeName = "bio_player_debris.dts"; + + //Foot Prints + decalData = HeavyBiodermFootprint; + decalOffset = 0.4; + + waterBreathSound = WaterBreathBiodermSound; + + damageScale[$DamageType::W1700] = 3.0; + damageScale[$DamageType::Bullet] = 0.10; //I deny you shrike n0bs + + max[RepairKit] = 0; + max[Mine] = 0; + max[Grenade] = 0; +}; + +// ============================================================================ +// WINDSHEAR +// ============================================================================ + +// * Windshear's Vehicle Object is handled & Loaded in vehicles/vehicle_WindshearPlatform.cs + +// ============================================================================ +// GHOST OF LIGHTNING +// ============================================================================ +datablock PlayerData(LightningGhostArmor) : MediumMaleHumanArmor { + boundingBox = "1.63 1.63 2.6"; + maxDamage = 550.0; + minImpactSpeed = 35; + shapeFile = "medium_male.dts"; + + debrisShapeName = "bio_player_debris.dts"; + + //Foot Prints + decalData = HeavyBiodermFootprint; + decalOffset = 0.4; + + waterBreathSound = WaterBreathBiodermSound; + + damageScale[$DamageType::Bullet] = 0.10; //I deny you shrike n0bs + + max[RepairKit] = 0; + max[Mine] = 0; + max[Grenade] = 0; +}; + +// ============================================================================ +// VEGENOR +// ============================================================================ +datablock PlayerData(VegenorZombieArmor) : HeavyMaleBiodermArmor { + maxDamage = 600.0; + minImpactSpeed = 50; + speedDamageScale = 0.015; + + damageScale[$DamageType::M1700] = 2.0; + damageScale[$DamageType::Fire] = 0.1; + damageScale[$DamageType::Burn] = 0.1; + damageScale[$DamageType::Bullet] = 0.10; //I deny you shrike n0bs + + max[RepairKit] = 0; + max[Mine] = 0; + max[Grenade] = 0; +}; + +// ============================================================================ +// LORD ROG +// ============================================================================ +datablock PlayerData(LordRogZombieArmor) : HeavyMaleBiodermArmor { + boundingBox = "1.63 1.63 2.6"; + maxDamage = 650.0; + minImpactSpeed = 35; + shapeFile = "bioderm_heavy.dts"; + + debrisShapeName = "bio_player_debris.dts"; + + //Foot Prints + decalData = HeavyBiodermFootprint; + decalOffset = 0.4; + + damageScale[$DamageType::Bullet] = 0.10; //I deny you shrike n0bs + + waterBreathSound = WaterBreathBiodermSound; + + max[RepairKit] = 0; + max[Mine] = 0; + max[Grenade] = 0; +}; + +// ============================================================================ +// INSIGNIA +// ============================================================================ +datablock StaticShapeData(NoCollideBio) : StaticShapeDamageProfile { + className = "player"; + shapeFile = "bioderm_light.dts"; // dmiscf.dts, alternate + mass = 1; + elasticity = 0.1; + friction = 0.9; + collideable = 0; + isInvincible = true; +}; + +datablock StaticShapeData(NoCollideHum) : StaticShapeDamageProfile { + className = "player"; + shapeFile = "light_male.dts"; // dmiscf.dts, alternate + mass = 1; + elasticity = 0.1; + friction = 0.9; + collideable = 0; + isInvincible = true; +}; + +datablock PlayerData(InsigniaZombieArmor) : LightMaleBiodermArmor { + maxDamage = 700.0; + minImpactSpeed = 50; + speedDamageScale = 0.015; + + damageScale[$DamageType::M1700] = 2.0; + damageScale[$DamageType::Bullet] = 0.10; //I deny you shrike n0bs + + max[RepairKit] = 0; + max[Mine] = 0; + max[Grenade] = 0; +}; + +// ============================================================================ +// TREVOR +// ============================================================================ +datablock HoverVehicleData(TreborTank) : CentaurVehicle { + spawnOffset = "0 0 4"; + canControl = true; + floatingGravMag = 4.5; + + catagory = "Vehicles"; + shapeFile = "vehicle_grav_tank.dts"; + multipassenger = false; + computeCRC = true; + renderWhenDestroyed = false; + + mountPose[0] = sitting; + numMountPoints = 0; // <-- Ignore this + isProtectedMountPoint[0] = true; + + maxDamage = 100.15; + destroyedLevel = 100.15; + + isShielded = true; + rechargeRate = 1.0; + energyPerDamagePoint = 135; + maxEnergy = 400; + minJetEnergy = 15; + jetEnergyDrain = 2.0; + + targetNameTag = 'Centaur'; + targetTypeTag = 'MK III'; + + damageScale[$DamageType::Bullet] = 0.10; //I deny you shrike n0bs + ShieldDamageScale[$DamageType::Bullet] = 0.01; //I deny you shrike n0bs +}; + +// ============================================================================ +// LORD VARDISON / D.A. VARDISON +// ============================================================================ +datablock PlayerData(VardisonStage1Armor) : LightMaleHumanArmor { + runForce = 60.20 * 90; + runEnergyDrain = 0.0; + minRunEnergy = 10; + maxForwardSpeed = 9; + maxBackwardSpeed = 7; + maxSideSpeed = 7; + + jumpForce = 14.0 * 90; + + maxDamage = 300.0; + minImpactSpeed = 35; + shapeFile = "light_male.dts"; + jetEmitter = BiodermArmorJetEmitter; + jetEffect = BiodermArmorJetEffect; + + debrisShapeName = "bio_player_debris.dts"; + + //Foot Prints + decalData = LightBiodermFootprint; + decalOffset = 0.3; + + waterBreathSound = WaterBreathBiodermSound; + + damageScale[$DamageType::M1700] = 3.0; + damageScale[$DamageType::Missile] = 0.0000000000000001; + damageScale[$DamageType::Nuclear] = 0.0000000000000001; + damageScale[$DamageType::EMP] = 0.0000000000000001; + damageScale[$DamageType::Bullet] = 0.10; //I deny you shrike n0bs + + max[RepairKit] = 0; + max[Mine] = 0; + max[Grenade] = 0; +}; + +datablock PlayerData(DarkArchmageVardisonArmor) : VardisonStage1Armor { + maxDamage = 1000.0; + minImpactSpeed = 35; + shapeFile = "light_male.dts"; + jetEmitter = BiodermArmorJetEmitter; + jetEffect = BiodermArmorJetEffect; + + damageScale[$DamageType::M1700] = 3.0; + damageScale[$DamageType::Missile] = 0.0000000000000001; + damageScale[$DamageType::Nuclear] = 0.0000000000000001; + damageScale[$DamageType::EMP] = 0.0000000000000001; + damageScale[$DamageType::Bullet] = 0.10; //I deny you shrike n0bs + + max[RepairKit] = 0; + max[Mine] = 0; + max[Grenade] = 0; +}; + +datablock FlyingVehicleData(VardisonStage2Flyer) : ShrikeDamageProfile { + spawnOffset = "0 0 2"; + canControl = false; + catagory = "Vehicles"; + shapeFile = "vehicle_air_bomber.dts"; + multipassenger = false; + computeCRC = true; + + debrisShapeName = "vehicle_air_bomber.dts"; + debris = MeShapeDebris; + renderWhenDestroyed = false; + + drag = 0.15; + density = 1.0; + + mountPose[0] = sitting; + numMountPoints = 1; + isProtectedMountPoint[0] = false; + cameraMaxDist = 15; + cameraOffset = 2.5; + cameraLag = 0.9; + explosion = MeVehicleExplosion; + explosionDamage = 1.0; + explosionRadius = 10.0; + + maxDamage = 50.0; + destroyedLevel = 50.0; + + HDAddMassLevel = 49.9; + HDMassImage = LflyerHDMassImage; + + isShielded = false; + energyPerDamagePoint = 0; + maxEnergy = 5000; // Afterburner and any energy weapon pool + rechargeRate = 4; + + minDrag = 22; // Linear Drag (eventually slows you down when not thrusting...constant drag) + rotationalDrag = 900; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag) + + maxAutoSpeed = 50; // Autostabilizer kicks in when less than this speed. (meters/second) + autoAngularForce = 400; // Angular stabilizer force (this force levels you out when autostabilizer kicks in) + autoLinearForce = 1; // Linear stabilzer force (this slows you down when autostabilizer kicks in) + autoInputDamping = 0.8; // Dampen control input so you don't` whack out at very slow speeds + + + // Maneuvering + maxSteeringAngle = 4.5; // Max radiens you can rotate the wheel. Smaller number is more maneuverable. + horizontalSurfaceForce = 6; // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning) + verticalSurfaceForce = 4; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.) + maneuveringForce = 5250; // Horizontal jets (W,S,D,A key thrust) + steeringForce = 675; // Steering jets (force applied when you move the mouse) + steeringRollForce = 3000; // Steering jets (how much you heel over when you turn) + rollForce = 1; // Auto-roll (self-correction to right you after you roll/invert) + hoverHeight = 2.5; // Height off the ground at rest + createHoverHeight = 1; // Height off the ground when created + maxForwardSpeed = 165; // speed in which forward thrust force is no longer applied (meters/second) + + // Turbo Jet + jetForce = 2500; // Afterburner thrust (this is in addition to normal thrust) + minJetEnergy = 40; // Afterburner can't be used if below this threshhold. + jetEnergyDrain = 10; // Energy use of the afterburners (low number is less drain...can be fractional) // Auto stabilize speed + vertThrustMultiple = 1.25; + + // Rigid body + mass = 150; // Mass of the vehicle + bodyFriction = 0; // Don't mess with this. + bodyRestitution = 0.5; // When you hit the ground, how much you rebound. (between 0 and 1) + minRollSpeed = 0; // Don't mess with this. + softImpactSpeed = 14; // Sound hooks. This is the soft hit. + hardImpactSpeed = 25; // Sound hooks. This is the hard hit. + + // Ground Impact Damage (uses DamageType::Ground) + minImpactSpeed = 20; // If hit ground at speed above this then it's an impact. Meters/second + speedDamageScale = 0.06; + + // Object Impact Damage (uses DamageType::Impact) + collDamageThresholdVel = 23.0; + collDamageMultiplier = 0.02; + + // + minTrailSpeed = 70; // The speed your contrail shows up at. + trailEmitter = JetShadowEmitter; + forwardJetEmitter = JetShadowEmitter; + downJetEmitter = JetShadowEmitter; + + // + jetSound = ScoutFlyerThrustSound; + engineSound = ScoutFlyerEngineSound; + softImpactSound = SoftImpactSound; + hardImpactSound = HardImpactSound; + //wheelImpactSound = WheelImpactSound; + + // + softSplashSoundVelocity = 10.0; + mediumSplashSoundVelocity = 15.0; + hardSplashSoundVelocity = 20.0; + exitSplashSoundVelocity = 10.0; + + exitingWater = VehicleExitWaterMediumSound; + impactWaterEasy = VehicleImpactWaterSoftSound; + impactWaterMedium = VehicleImpactWaterMediumSound; + impactWaterHard = VehicleImpactWaterMediumSound; + waterWakeSound = VehicleWakeMediumSplashSound; + + dustEmitter = VehicleLiftoffDustEmitter; + triggerDustHeight = 4.0; + dustHeight = 1.0; + + damageEmitter[0] = MeLightDamageSmoke; + damageEmitter[1] = MeHeavyDamageSmoke; + damageEmitter[2] = MeDamageBubbles; + damageEmitterOffset[0] = "0.0 -3.0 0.0 "; + damageLevelTolerance[0] = 0.4; + damageLevelTolerance[1] = 0.75; + numDmgEmitterAreas = 1; + + // + max[chaingunAmmo] = 2000; + max[MissileLauncherAmmo] = 200; + max[MortarAmmo] = 200; + + damageScale[$DamageType::Nuclear] = 0.0000000000000001; + damageScale[$DamageType::EMP] = 0.0000000000000001; + damageScale[$DamageType::Bullet] = 0.10; //I deny you shrike n0bs + ShieldDamageScale[$DamageType::Bullet] = 0.01; //I deny you shrike n0bs + + minMountDist = 7; + + splashEmitter[0] = VehicleFoamDropletsEmitter; + splashEmitter[1] = VehicleFoamEmitter; + + shieldImpact = VehicleShieldImpact; + + cmdCategory = "Tactical"; + cmdIcon = CMDFlyingScoutIcon; + cmdMiniIconName = "commander/MiniIcons/com_scout_grey"; + targetNameTag = 'Lord Vardison'; + targetTypeTag = ''; + sensorData = SSTurretBaseSensorObj; + sensorRadius = SSTurretBaseSensorObj.detectRadius; + sensorColor = "9 9 255"; + + checkRadius = 5.5; + observeParameters = "1 10 10"; + + runningLight[0] = ShrikeLight1; +// runningLight[1] = ShrikeLight2; + + shieldEffectScale = "0.937 1.125 0.60"; + + numWeapons = 3; + + replaceTime = 90; +}; + +datablock PlayerData(VardisonStage3Armor) : LightMaleHumanArmor { + runForce = 60.20 * 90; + runEnergyDrain = 0.0; + minRunEnergy = 10; + maxForwardSpeed = 9; + maxBackwardSpeed = 7; + maxSideSpeed = 7; + + jumpForce = 14.0 * 90; + + maxDamage = 500.0; + minImpactSpeed = 35; + shapeFile = "TR2Heavy_Male.dts"; + jetEmitter = BiodermArmorJetEmitter; + jetEffect = BiodermArmorJetEffect; + + debrisShapeName = "bio_player_debris.dts"; + + //Foot Prints + decalData = LightBiodermFootprint; + decalOffset = 0.3; + + boundingBox = "5 5 10"; + + waterBreathSound = WaterBreathBiodermSound; + + damageScale[$DamageType::M1700] = 3.0; + damageScale[$DamageType::PlasmaCannon] = 0.001; + damageScale[$DamageType::Missile] = 0.0000000000000001; + damageScale[$DamageType::Nuclear] = 0.0000000000000001; + damageScale[$DamageType::EMP] = 0.0000000000000001; + damageScale[$DamageType::Bullet] = 0.10; //I deny you shrike n0bs + + max[RepairKit] = 0; + max[Mine] = 0; + max[Grenade] = 0; +}; + +datablock PlayerData(MiniDemonArmor) : LightMaleHumanArmor { + runForce = 60.20 * 90; + runEnergyDrain = 0.0; + minRunEnergy = 10; + maxForwardSpeed = 9; + maxBackwardSpeed = 7; + maxSideSpeed = 7; + + jumpForce = 14.0 * 90; + + maxDamage = 2.8; + minImpactSpeed = 1000; + shapeFile = "bioderm_medium.dts"; + jetEmitter = BiodermArmorJetEmitter; + jetEffect = BiodermArmorJetEffect; + + debrisShapeName = "bio_player_debris.dts"; + + //Foot Prints + decalData = LightBiodermFootprint; + decalOffset = 0.3; + + waterBreathSound = WaterBreathBiodermSound; + + damageScale[$DamageType::M1700] = 3.0; + damageScale[$DamageType::PlasmaCannon] = 0.001; + damageScale[$DamageType::Missile] = 0.0000000000000001; + damageScale[$DamageType::Nuclear] = 0.0000000000000001; + damageScale[$DamageType::EMP] = 0.0000000000000001; + + max[RepairKit] = 0; + max[Mine] = 0; + max[Grenade] = 0; +}; + +// ============================================================================ +// STORMRIDER +// ============================================================================ + +// * See notes on Windshear... + +// ============================================================================ +// GHOST OF FIRE +// ============================================================================ +datablock PlayerData(GhostFireArmor) : MediumPlayerDamageProfile { + emap = true; + + className = Armor; + shapeFile = "medium_male.dts"; + cameraMaxDist = 3; + computeCRC = true; + + debrisShapeName = "debris_player.dts"; + debris = HumanRedPlayerDebris; + + canObserve = true; + cmdCategory = "Clients"; + cmdIcon = CMDPlayerIcon; + cmdMiniIconName = "commander/MiniIcons/com_player_grey"; + + hudImageNameFriendly[0] = "gui/hud_playertriangle"; + hudImageNameEnemy[0] = "gui/hud_playertriangle_enemy"; + hudRenderModulated[0] = true; + + hudImageNameFriendly[1] = "commander/MiniIcons/com_flag_grey"; + hudImageNameEnemy[1] = "commander/MiniIcons/com_flag_grey"; + hudRenderModulated[1] = true; + hudRenderAlways[1] = true; + hudRenderCenter[1] = true; + hudRenderDistance[1] = true; + + hudImageNameFriendly[2] = "commander/MiniIcons/com_flag_grey"; + hudImageNameEnemy[2] = "commander/MiniIcons/com_flag_grey"; + hudRenderModulated[2] = true; + hudRenderAlways[2] = true; + hudRenderCenter[2] = true; + hudRenderDistance[2] = true; + + aiAvoidThis = true; + + minLookAngle = -1.5; + maxLookAngle = 1.5; + maxFreelookAngle = 3.0; + + mass = 70; + drag = 0.3; + maxdrag = 0.5; + density = 10; + maxDamage = 500.0; + maxEnergy = 400; + repairRate = 0.0053; + energyPerDamagePoint = 75.0; // shield energy required to block one point of damage + + rechargeRate = 0.456; + jetForce = 21.22 * 230; + underwaterJetForce = 25.22 * 130 * 1.5; + underwaterVertJetFactor = 1.5; + jetEnergyDrain = 4.0; + underwaterJetEnergyDrain = 1.0; + minJetEnergy = 10; + maxJetHorizontalPercentage = 0.8; + + runForce = 60 * 150; + runEnergyDrain = 0; + minRunEnergy = 0; + maxForwardSpeed = 18; + maxBackwardSpeed = 18; + maxSideSpeed = 18; + + maxUnderwaterForwardSpeed = 10.5; + maxUnderwaterBackwardSpeed = 9.5; + maxUnderwaterSideSpeed = 9.5; + + recoverDelay = 4; + recoverRunForceScale = 0.7; + + // heat inc'ers and dec'ers + heatDecayPerSec = 1.0 / 5.0; // takes 4 seconds to clear heat sig. + heatIncreasePerSec = 1.0 / 2.0; // takes 3.0 seconds of constant jet to get full heat sig. + + jumpForce = 8.3 * 130; + jumpEnergyDrain = 0; + minJumpEnergy = 0; + jumpSurfaceAngle = 75; + jumpDelay = 0; + + // Controls over slope of runnable/jumpable surfaces + runSurfaceAngle = 85; + jumpSurfaceAngle = 85; + + minJumpSpeed = 25; + maxJumpSpeed = 35; + + horizMaxSpeed = 70; + horizResistSpeed = 28; + horizResistFactor = 0.32; + maxJetForwardSpeed = 18; + + upMaxSpeed = 80; + upResistSpeed = 30; + upResistFactor = 0.23; + + minImpactSpeed = 45; + speedDamageScale = 0.006; + + jetSound = ArmorJetSound; + wetJetSound = ArmorWetJetSound; + + jetEmitter = FlammerArmorJetEmitter; //Pyro jets + jetEffect = HumanMediumArmorJetEffect; + + boundingBox = "1.45 1.45 2.4"; + pickupRadius = 0.75; + + // damage location details + boxNormalHeadPercentage = 0.83; + boxNormalTorsoPercentage = 0.49; + boxHeadLeftPercentage = 0; + boxHeadRightPercentage = 1; + boxHeadBackPercentage = 0; + boxHeadFrontPercentage = 1; + + //Foot Prints + decalData = MediumMaleFootprint; + decalOffset = 0.35; + + footPuffEmitter = LightPuffEmitter; + footPuffNumParts = 15; + footPuffRadius = 0.25; + + dustEmitter = LiftoffDustEmitter; + + splash = PlayerSplash; + splashVelocity = 4.0; + splashAngle = 67.0; + splashFreqMod = 300.0; + splashVelEpsilon = 0.60; + bubbleEmitTime = 0.4; + splashEmitter[0] = PlayerFoamDropletsEmitter; + splashEmitter[1] = PlayerFoamEmitter; + splashEmitter[2] = PlayerBubbleEmitter; + mediumSplashSoundVelocity = 10.0; + hardSplashSoundVelocity = 20.0; + exitSplashSoundVelocity = 5.0; + + footstepSplashHeight = 0.35; + //Footstep Sounds + LFootSoftSound = LFootMediumSoftSound; + RFootSoftSound = RFootMediumSoftSound; + LFootHardSound = LFootMediumHardSound; + RFootHardSound = RFootMediumHardSound; + LFootMetalSound = LFootMediumMetalSound; + RFootMetalSound = RFootMediumMetalSound; + LFootSnowSound = LFootMediumSnowSound; + RFootSnowSound = RFootMediumSnowSound; + LFootShallowSound = LFootMediumShallowSplashSound; + RFootShallowSound = RFootMediumShallowSplashSound; + LFootWadingSound = LFootMediumWadingSound; + RFootWadingSound = RFootMediumWadingSound; + LFootUnderwaterSound = LFootMediumUnderwaterSound; + RFootUnderwaterSound = RFootMediumUnderwaterSound; + LFootBubblesSound = LFootMediumBubblesSound; + RFootBubblesSound = RFootMediumBubblesSound; + movingBubblesSound = ArmorMoveBubblesSound; + waterBreathSound = WaterBreathMaleSound; + + impactSoftSound = ImpactMediumSoftSound; + impactHardSound = ImpactMediumHardSound; + impactMetalSound = ImpactMediumMetalSound; + impactSnowSound = ImpactMediumSnowSound; + + skiSoftSound = SkiAllSoftSound; + skiHardSound = SkiAllHardSound; + skiMetalSound = SkiAllMetalSound; + skiSnowSound = SkiAllSnowSound; + + impactWaterEasy = ImpactMediumWaterEasySound; + impactWaterMedium = ImpactMediumWaterMediumSound; + impactWaterHard = ImpactMediumWaterHardSound; + + groundImpactMinSpeed = 10.0; + groundImpactShakeFreq = "4.0 4.0 4.0"; + groundImpactShakeAmp = "1.0 1.0 1.0"; + groundImpactShakeDuration = 0.8; + groundImpactShakeFalloff = 10.0; + + exitingWater = ExitingWaterMediumSound; + + maxWeapons = 2; // Max number of different weapons the player can have + maxGrenades = 1; // Max number of different grenades the player can have + maxMines = 1; // Max number of different mines the player can have + + damageScale[$DamageType::plasma] = 0.05; + damageScale[$DamageType::Burn] = 0.05; + damageScale[$DamageType::Bullet] = 0.10; //I deny you shrike n0bs + + // Inventory restrictions + max[RepairKit] = 4; + max[Mine] = 0; + max[ZapMine] = 0; + max[CrispMine] = 5; + max[flamerAmmoPack] = 1; + max[Deagle] = 1; + max[SPistol] = 1; + max[Pistol] = 1; + max[PistolAmmo] = 10; + max[Pistolclip] = 8; + max[PulsePhaser] = 1; + max[flamer] = 1; + max[flamerAmmo] = 0; + max[Napalm] = 1; + max[NapalmAmmo] = 20; + max[melee] = 1; + max[BOV] = 1; + max[SOmelee] = 1; + max[IncindinaryGrenade] = 7; + max[Beacon] = 3; + // -END + + observeParameters = "0.5 4.5 4.5"; + + shieldEffectScale = "0.7 0.7 1.0"; +}; + +// ============================================================================ +// SHADE LORD +// ============================================================================ +datablock PlayerData(ShadeLordArmor) : LightMaleHumanArmor { + boundingBox = "1.63 1.63 2.6"; + maxDamage = 900.0; + minImpactSpeed = 35; + shapeFile = "bioderm_heavy.dts"; + + debrisShapeName = "bio_player_debris.dts"; + + //Foot Prints + decalData = HeavyBiodermFootprint; + decalOffset = 0.4; + + waterBreathSound = WaterBreathBiodermSound; + + damageScale[$DamageType::Bullet] = 0.10; //I deny you shrike n0bs + damageScale[$DamageType::Fire] = 3.0; + damageScale[$DamageType::Plasma] = 3.0; + damageScale[$DamageType::Burn] = 2.0; + + max[RepairKit] = 0; + max[Mine] = 0; + max[Grenade] = 0; +}; + +// +// PARTICLES +// + +// ============================================================================ +// YVEX +// ============================================================================ +datablock ParticleData(InflictionNightmareGlobeSmoke) { + dragCoefficient = 50;/////////----------------------- + gravityCoefficient = 0.0; + inheritedVelFactor = 1.0; + constantAcceleration = 0.0; + lifetimeMS = 5050; + lifetimeVarianceMS = 0; + useInvAlpha = true; + spinRandomMin = -360.0; + spinRandomMax = 360.0; + textureName = "particleTest"; + colors[0] = "0.5 0.1 0.9 1.0"; + colors[1] = "0.5 0.1 0.9 1.0"; + colors[2] = "0.5 0.1 0.9 1.0"; + colors[3] = "0.5 0.1 0.9"; + sizes[0] = 1.0; + sizes[1] = 1.0; + sizes[2] = 1.0; + sizes[3] = 1.0; + times[0] = 0.0; + times[1] = 0.33; + times[2] = 0.66; + times[3] = 1.0; + mass = 0.7; + elasticity = 0.2; + friction = 1; + computeCRC = true; + haslight = true; + lightType = "PulsingLight"; + lightColor = "0.2 0.0 0.5 1.0"; + lightTime = "200"; + lightRadius = "2.0"; +}; + +datablock ParticleEmitterData(InfNightmareGlobeEmitter) { + ejectionPeriodMS = 0.1; + periodVarianceMS = 0; + ejectionVelocity = 0.0; + velocityVariance = 0.0; + ejectionOffset = 5; + thetaMin = 0; + thetaMax = 180; + overrideAdvances = false; + particles = "InflictionNightmareGlobeSmoke"; +}; + + +datablock ParticleData(NightmareGlobeSmoke) { + dragCoefficient = 50;/////////----------------------- + gravityCoefficient = 0.0; + inheritedVelFactor = 1.0; + constantAcceleration = 0.0; + lifetimeMS = 5050; + lifetimeVarianceMS = 0; + useInvAlpha = true; + spinRandomMin = -360.0; + spinRandomMax = 360.0; + textureName = "particleTest"; + colors[0] = "0.1 0.1 0.1 1.0";// //////////////////// + colors[1] = "0.1 0.1 0.1 1.0";// //////////////////// + colors[2] = "0.1 0.1 0.1 1.0";// \\\\\\\\\\\\\\\\\\\\ + colors[3] = "0.1 0.1 0.1 1.0";// \\\\\\\\\\\\\\\\\\\\ + sizes[0] = 1.0; + sizes[1] = 1.0; + sizes[2] = 1.0; + sizes[3] = 1.0; + times[0] = 0.0; + times[1] = 0.33; + times[2] = 0.66; + times[3] = 1.0; + mass = 0.7; + elasticity = 0.2; + friction = 1; + computeCRC = true; + haslight = true; + lightType = "PulsingLight"; + lightColor = "0.2 0.0 0.5 1.0"; + lightTime = "200"; + lightRadius = "2.0"; +}; + +datablock ParticleEmitterData(NightmareGlobeEmitter) { + ejectionPeriodMS = 0.1; + periodVarianceMS = 0; + ejectionVelocity = 0.0; + velocityVariance = 0.0; + ejectionOffset = 5; + thetaMin = 0; + thetaMax = 180; + overrideAdvances = false; + particles = "NightmareGlobeSmoke"; +}; + +datablock ParticleData(GreenEmitParticle) { + dragCoeffiecient = 1; + gravityCoefficient = -0.3; // rises slowly + inheritedVelFactor = 0; + + lifetimeMS = 300; + lifetimeVarianceMS = 0; + useInvAlpha = false; + spinRandomMin = 0.0; + spinRandomMax = 0.0; + + animateTexture = false; + + textureName = "flareBase"; // "special/Smoke/bigSmoke" + + colors[0] = "0 1 0"; + colors[1] = "0 1 0"; + colors[2] = "0 1 0"; + + sizes[0] = 0.8; + sizes[1] = 0.8; + sizes[2] = 0.8; + + times[0] = 0.0; + times[1] = 1.0; + times[2] = 5.0; + +}; + +datablock ParticleEmitterData(PulseGreenEmitter) { + ejectionPeriodMS = 2; + periodVarianceMS = 1; + + ejectionVelocity = 10; + velocityVariance = 0; + + thetaMin = 89.0; + thetaMax = 90.0; + + orientParticles = false; + + particles = "GreenEmitParticle"; +}; + +datablock ParticleData(PurpleNightmareEmitParticle) { + dragCoeffiecient = 1; + gravityCoefficient = -0.3; // rises slowly + inheritedVelFactor = 0; + + lifetimeMS = 300; + lifetimeVarianceMS = 0; + useInvAlpha = false; + spinRandomMin = 0.0; + spinRandomMax = 0.0; + + animateTexture = false; + + textureName = "flareBase"; // "special/Smoke/bigSmoke" + + colors[0] = "0.5 0.1 0.9 1.0"; + colors[1] = "0.5 0.1 0.9 1.0"; + colors[2] = "0.5 0.1 0.9"; + + sizes[0] = 0.4; + sizes[1] = 0.4; + sizes[2] = 0.4; + + times[0] = 0.0; + times[1] = 1.0; + times[2] = 5.0; + +}; + +datablock ParticleEmitterData(YvexSniperEmitter) { + ejectionPeriodMS = 2; + periodVarianceMS = 1; + + ejectionVelocity = 10; + velocityVariance = 0; + + thetaMin = 89.0; + thetaMax = 90.0; + + orientParticles = false; + + particles = "PurpleNightmareEmitParticle"; +}; + +// ============================================================================ +// WINDSHEAR +// ============================================================================ + +// ============================================================================ +// GHOST OF LIGHTNING +// ============================================================================ +datablock ParticleData(ShockParticle) { + dragCoeffiecient = 0.0; + gravityCoefficient = -0.0; + inheritedVelFactor = 0.0; + + lifetimeMS = 1000; + lifetimeVarianceMS = 0; + + textureName = "particleTest"; + + useInvAlpha = false; + spinRandomMin = -100.0; + spinRandomMax = 100.0; + + numParts = 50; + + animateTexture = true; + framesPerSec = 26; + + animTexName[00] = "special/Explosion/exp_0002"; + animTexName[01] = "special/Explosion/exp_0004"; + animTexName[02] = "special/Explosion/exp_0006"; + animTexName[03] = "special/Explosion/exp_0008"; + animTexName[04] = "special/Explosion/exp_0010"; + animTexName[05] = "special/Explosion/exp_0012"; + animTexName[06] = "special/Explosion/exp_0014"; + animTexName[07] = "special/Explosion/exp_0016"; + animTexName[08] = "special/Explosion/exp_0018"; + animTexName[09] = "special/Explosion/exp_0020"; + animTexName[10] = "special/Explosion/exp_0022"; + animTexName[11] = "special/Explosion/exp_0024"; + animTexName[12] = "special/Explosion/exp_0026"; + animTexName[13] = "special/Explosion/exp_0028"; + animTexName[14] = "special/Explosion/exp_0030"; + animTexName[15] = "special/Explosion/exp_0032"; + animTexName[16] = "special/Explosion/exp_0034"; + animTexName[17] = "special/Explosion/exp_0036"; + animTexName[18] = "special/Explosion/exp_0038"; + animTexName[19] = "special/Explosion/exp_0040"; + animTexName[20] = "special/Explosion/exp_0042"; + animTexName[21] = "special/Explosion/exp_0044"; + animTexName[22] = "special/Explosion/exp_0046"; + animTexName[23] = "special/Explosion/exp_0048"; + animTexName[24] = "special/Explosion/exp_0050"; + animTexName[25] = "special/Explosion/exp_0052"; + + + colors[0] = "0.5 0.5 1.0 1.0"; + colors[1] = "0.5 0.5 1.0 0.5"; + colors[2] = "0.25 0.25 1.0 0.0"; + sizes[0] = 0.5; + sizes[1] = 0.5; + sizes[2] = 0.5; + times[0] = 0.0; + times[1] = 0.5; + times[2] = 1.0; +}; + +datablock ParticleEmitterData(ShockParticleEmitter) { + ejectionPeriodMS = 1; + periodVarianceMS = 0; + + ejectionVelocity = 0.25; + velocityVariance = 0.0; + + thetaMin = 0.0; + thetaMax = 30.0; + + particles = "ShockParticle"; +}; + +datablock ShockwaveData( ShocklanceHit ) { + width = 0.5; + numSegments = 20; + numVertSegments = 1; + velocity = 0.25; + acceleration = 1.0; + lifetimeMS = 600; + height = 0.1; + verticalCurve = 0.5; + + mapToTerrain = false; + renderBottom = false; + orientToNormal = true; + + texture[0] = "special/shocklanceHit"; + texture[1] = "special/gradient"; + texWrap = 3.0; + + times[0] = 0.0; + times[1] = 0.5; + times[2] = 1.0; + + colors[0] = "1.0 1.0 1.0 1.0"; + colors[1] = "1.0 1.0 1.0 0.5"; + colors[2] = "1.0 1.0 1.0 0.0"; +}; + +// ============================================================================ +// VEGENOR +// ============================================================================ + +// ============================================================================ +// LORD ROG +// ============================================================================ +datablock ParticleData(PBCParticle) { + dragCoefficient = 0.5; + WindCoefficient = 0; + gravityCoefficient = 0.0; + inheritedVelFactor = 1; + constantAcceleration = 0; + lifetimeMS = 3000; + lifetimeVarianceMS = 0; + textureName = "special/lightning1frame2"; + useInvAlpha = 0; + + spinRandomMin = -800; + spinRandomMax = 800; + + spinspeed = 50; + colors[0] = "0.1 1.0 0.1 1.0"; + colors[1] = "0.6 0.9 0.6 1.0"; + colors[2] = "0.8 0.8 1.0 1.0"; + colors[3] = "0.8 0.8 1.0 0.0"; + sizes[0] = 0.5; + sizes[1] = 1; + sizes[2] = 1.5; + sizes[3] = 1.5; + times[0] = 0.0; + times[1] = 0.1; + times[2] = 0.3; + times[3] = 1.0; +}; + +datablock ParticleEmitterData(PBCExpEmitter) { + ejectionPeriodMS = 2; + periodVarianceMS = 0; + + ejectionVelocity = 2.5; + velocityVariance = 2.5; + + thetaMin = 0.0; + thetaMax = 180.0; + + lifetimeMS = 200; + + particles = "PBCParticle"; +}; + +// ============================================================================ +// INSIGNIA +// ============================================================================ + +// ============================================================================ +// TREVOR +// ============================================================================ + +// ============================================================================ +// LORD VARDISON / D.A. VARDISON +// ============================================================================ +datablock ParticleData(ShadowBaseParticle) { + dragCoeffiecient = 0.0; + gravityCoefficient = -0.2; + inheritedVelFactor = 0.0; + + lifetimeMS = 800; + lifetimeVarianceMS = 500; + + useInvAlpha = true; + spinRandomMin = -160.0; + spinRandomMax = 160.0; + + animateTexture = true; + framesPerSec = 15; + + textureName = "special/cloudflash"; + + colors[0] = "0.1 0.1 0.1 1.0";// //////////////////// + colors[1] = "0.1 0.1 0.1 1.0";// //////////////////// + colors[2] = "0.1 0.1 0.1 1.0";// \\\\\\\\\\\\\\\\\\\\ + + sizes[0] = 2.5; + sizes[1] = 2.7; + sizes[2] = 3.0; + + times[0] = 0.0; + times[1] = 0.7; + times[2] = 1.0; +}; + +datablock ParticleEmitterData(ShadowBaseEmitter) { + ejectionPeriodMS = 10; + periodVarianceMS = 0; + + ejectionVelocity = 1.5; + velocityVariance = 0.3; + + thetaMin = 0.0; + thetaMax = 30.0; + + particles = "ShadowBaseParticle"; +}; + +datablock ParticleData(SmallShadowBaseParticle) { + dragCoeffiecient = 0.0; + gravityCoefficient = -0.2; + inheritedVelFactor = 0.0; + + lifetimeMS = 9999999999999; + lifetimeVarianceMS = 9999999999999; + + useInvAlpha = true; + spinRandomMin = -160.0; + spinRandomMax = 160.0; + + animateTexture = true; + framesPerSec = 15; + + textureName = "special/cloudflash"; + + colors[0] = "0.1 0.1 0.1 1.0";// //////////////////// + colors[1] = "0.1 0.1 0.1 1.0";// //////////////////// + colors[2] = "0.1 0.1 0.1 1.0";// \\\\\\\\\\\\\\\\\\\\ + + sizes[0] = 0.5; + sizes[1] = 0.7; + sizes[2] = 1.0; + + times[0] = 0.0; + times[1] = 0.7; + times[2] = 1.0; +}; + +datablock ParticleEmitterData(SmallShadowBaseEmitter) { + ejectionPeriodMS = 10; + periodVarianceMS = 0; + + ejectionVelocity = 1.5; + velocityVariance = 0.3; + + thetaMin = 0.0; + thetaMax = 30.0; + + particles = "SmallShadowBaseParticle"; +}; + +datablock ParticleData(JetShadowParticle) { + dragCoeffiecient = 0.0; + gravityCoefficient = 0; + inheritedVelFactor = 0.0; + + lifetimeMS = 2500; + lifetimeVarianceMS = 0; + + textureName = "particleTest"; + + useInvAlpha = true; + spinRandomMin = -160.0; + spinRandomMax = 160.0; + + animateTexture = true; + framesPerSec = 15; + + animTexName[0] = "special/Explosion/exp_0016"; + animTexName[1] = "special/Explosion/exp_0018"; + animTexName[2] = "special/Explosion/exp_0020"; + animTexName[3] = "special/Explosion/exp_0022"; + animTexName[4] = "special/Explosion/exp_0024"; + animTexName[5] = "special/Explosion/exp_0026"; + animTexName[6] = "special/Explosion/exp_0028"; + animTexName[7] = "special/Explosion/exp_0030"; + animTexName[8] = "special/Explosion/exp_0032"; + + colors[0] = "0.1 0.1 0.1 1.0";// //////////////////// + colors[1] = "0.1 0.1 0.1 1.0";// //////////////////// + colors[2] = "0.1 0.1 0.1 1.0";// \\\\\\\\\\\\\\\\\\\\ + sizes[0] = 2.5; + sizes[1] = 1.25; + sizes[2] = 0.625; + times[0] = 0.0; + times[1] = 0.7; + times[2] = 1.0; +}; + +datablock ParticleEmitterData(JetShadowEmitter) { + ejectionPeriodMS = 2; + periodVarianceMS = 0; + + ejectionVelocity = 0; + velocityVariance = 0; + ejectionOffset = 5; + thetaMin = 22.5; + thetaMax = 45; + phiReferenceVel = 0; + phiVariance = 360; + spinRandomMin = "200"; + spinRandomMax = "-200"; + overrideAdvances = false; + particles = "JetShadowParticle"; +}; + +datablock ParticleData(LaserBallGlobeSmoke) { + dragCoefficient = 50;/////////----------------------- + gravityCoefficient = 0.0; + inheritedVelFactor = 1.0; + constantAcceleration = 0.0; + lifetimeMS = 1000; + lifetimeVarianceMS = 0; + useInvAlpha = true; + spinRandomMin = -360.0; + spinRandomMax = 360.0; + textureName = "particleTest"; + colors[0] = "0.1 0.1 0.1 1.0";// //////////////////// + colors[1] = "0.1 0.1 0.1 1.0";// //////////////////// + colors[2] = "0.1 0.1 0.1 1.0";// \\\\\\\\\\\\\\\\\\\\ + colors[3] = "0.1 0.1 0.1 1.0";// \\\\\\\\\\\\\\\\\\\\ + sizes[0] = 1.0; + sizes[1] = 1.0; + sizes[2] = 1.0; + sizes[3] = 1.0; + times[0] = 0.0; + times[1] = 0.33; + times[2] = 0.66; + times[3] = 1.0; + mass = 0.7; + elasticity = 0.2; + friction = 1; + computeCRC = true; + haslight = true; + lightType = "PulsingLight"; + lightColor = "0.2 0.0 0.5 1.0"; + lightTime = "200"; + lightRadius = "2.0"; +}; + +datablock ParticleEmitterData(MiniShadowBallEmitter) { + ejectionPeriodMS = 0.3; + periodVarianceMS = 0; + ejectionVelocity = 0.0; + velocityVariance = 0.0; + ejectionOffset = 2; + thetaMin = 0; + thetaMax = 180; + overrideAdvances = false; + particles = "LaserBallGlobeSmoke"; +}; + +// ============================================================================ +// STORMRIDER +// ============================================================================ +//Seeker Plasma Stuff +//Credit To Abrikcham +//-abirikcham@yahoo.com +datablock ShockwaveData(FakePhotonMissileShockwave) { + width = 0.5; + numSegments = 30; + numVertSegments = 2; + velocity = 8; + verticalcurve = 0; + acceleration = -17.0; + lifetimeMS = 600; + height = 0.00001; + is2D = false; + texture[0] = "special/shockwave4"; + texture[1] = "special/gradient"; + texWrap = 10.0; + mapToTerrain = false; + orientToNormal = true; + renderBottom = true; + times[0] = 0.0; + times[1] = 0.5; + times[2] = 1.0; + colors[0] = "0 1 0 1"; + colors[1] = "0.0 1.1 0.0 0.60";//0.4 0.1 1.0 + colors[2] = "0.0 1.1 0.0 0.0"; +}; + +datablock AudioProfile(FakePhotonMissileShockwaveSound) { + filename = "fx/misc/gridjump.wav"; + description = AudioExplosion3d; + preload = true; +}; + +datablock ExplosionData(FakePhotonShockwaveExp) { + soundProfile = FakePhotonMissileShockwaveSound; + faceViewer = false; + shockwave = FakePhotonMissileShockwave; + + shakeCamera = true; + camShakeFreq = "10.0 6.0 9.0"; + camShakeAmp = "20.0 20.0 20.0"; + camShakeDuration = 0.5; + camShakeRadius = 3.0; +}; + +datablock ParticleData(PhotonMissileExpPart) { + dragCoefficient = 2; + gravityCoefficient = 0.0; + inheritedVelFactor = 0.2; + constantAcceleration = 0.0; + lifetimeMS = 750; + lifetimeVarianceMS = 150; + textureName = "particleTest"; + colors[0] = "0 1 0 1.0"; + colors[1] = "0 1 0 0.0"; + sizes[0] = 3; + sizes[1] = 2; +}; + +datablock ParticleEmitterData(PhotonMissileExpEmit) { + ejectionPeriodMS = 7; + periodVarianceMS = 0; + ejectionVelocity = 3; + velocityVariance = 1.0; + ejectionOffset = 0.0; + thetaMin = 0; + thetaMax = 60; + phiReferenceVel = 0; + phiVariance = 360; + overrideAdvances = false; + particles = "PhotonMissileExpPart"; +}; + +datablock ExplosionData(PhotonMissileExplosion) { + explosionShape = "disc_explosion.dts"; + soundProfile = UnderwaterGrenadeExplosionSound;//plasmaexpsound orig + + shakeCamera = true; + camShakeFreq = "8.0 9.0 7.0"; + camShakeAmp = "25.0 25.0 25.0"; + camShakeDuration = 1.3; + camShakeRadius = 25.0; + + particleEmitter = PhotonMissileExpEmit; + particleDensity = 150; + particleRadius = 3.5; + faceViewer = true; +}; + +// ============================================================================ +// GHOST OF FIRE +// ============================================================================ +datablock ParticleData(GhostflameParticle) { + dragCoeffiecient = 0.0; + gravityCoefficient = -0.1; + inheritedVelFactor = 0.1; + + lifetimeMS = 500; + lifetimeVarianceMS = 50; + + textureName = "particleTest"; + + spinRandomMin = -10.0; + spinRandomMax = 10.0; + + colors[0] = "0 1 0 0.4"; + colors[1] = "0 1 0 0.3"; + colors[2] = "0 1 0 0.0"; + sizes[0] = 2.0; + sizes[1] = 1.0; + sizes[2] = 0.8; + times[0] = 0.0; + times[1] = 0.6; + times[2] = 1.0; +}; + +datablock ParticleEmitterData(GhostflameEmitter) { + ejectionPeriodMS = 3; + periodVarianceMS = 0; + + ejectionOffset = 0.2; + ejectionVelocity = 10.0; + velocityVariance = 0.0; + + thetaMin = 0.0; + thetaMax = 10.0; + + particles = "GhostflameParticle"; +}; + +datablock ParticleData(NapalmExplosionParticle) { + dragCoefficient = 2; + gravityCoefficient = 0.2; + inheritedVelFactor = 0.2; + constantAcceleration = 0.0; + lifetimeMS = 450; + lifetimeVarianceMS = 150; + textureName = "particleTest"; + colors[0] = "1 0 0"; + colors[1] = "1 0 0"; + sizes[0] = 0.5; + sizes[1] = 2; +}; + +datablock ParticleEmitterData(NapalmExplosionEmitter) { + ejectionPeriodMS = 7; + periodVarianceMS = 0; + ejectionVelocity = 5; + velocityVariance = 1.0; + ejectionOffset = 0.0; + thetaMin = 0; + thetaMax = 60; + phiReferenceVel = 0; + phiVariance = 360; + overrideAdvances = false; + particles = "NapalmExplosionParticle"; +}; + +datablock ExplosionData(NapalmExplosion) { + explosionShape = "effect_plasma_explosion.dts"; + soundProfile = plasmaExpSound; + particleEmitter = NapalmExplosionEmitter; + particleDensity = 150; + particleRadius = 1.25; + faceViewer = true; + + sizes[0] = "3.0 3.0 3.0"; + sizes[1] = "3.0 3.0 3.0"; + times[0] = 0.0; + times[1] = 1.5; +}; + +// ============================================================================ +// SHADE LORD +// ============================================================================ +datablock ParticleData(ShadeSwordParticle) { + dragCoeffiecient = 0.0; + gravityCoefficient = -0.2; + inheritedVelFactor = 0.0; + + lifetimeMS = 800; + lifetimeVarianceMS = 500; + + useInvAlpha = false; + spinRandomMin = -160.0; + spinRandomMax = 160.0; + + animateTexture = true; + framesPerSec = 15; + + textureName = "special/cloudflash"; + + colors[0] = "46 46 46 1.0"; + colors[1] = "46 46 46 1.0"; + colors[2] = "46 46 46 1.0"; + + sizes[0] = 2.5; + sizes[1] = 2.7; + sizes[2] = 3.0; + + times[0] = 0.0; + times[1] = 0.7; + times[2] = 1.0; +}; + +datablock ParticleEmitterData(ShadeSwordEmitter) { + ejectionPeriodMS = 10; + periodVarianceMS = 0; + + ejectionVelocity = 1.5; + velocityVariance = 0.3; + + thetaMin = 0.0; + thetaMax = 30.0; + + particles = "ShadeSwordParticle"; +}; + +datablock ParticleData(ShadeStormParticle) { + dragCoefficient = 1.0; + gravityCoefficient = 0.00; + windcoefficient = 0.0; + inheritedVelFactor = 0.0; + constantAcceleration = 10.0; + lifetimeMS = 1000; + lifetimeVarianceMS = 100; + useInvAlpha = true; + spinRandomMin = -90.0; + spinRandomMax = 90.0; + textureName = "special/cloudFlash"; + + colors[0] = "46 46 46 0.5"; + colors[1] = "46 46 46 0.5"; + colors[2] = "46 46 46 0.0"; + sizes[0] = 500; + sizes[1] = 500; + sizes[2] = 500; + times[0] = 0.0; + times[1] = 0.5; + times[2] = 1.0; +}; + +datablock ParticleEmitterData(ShadeStormEmitter) { + ejectionPeriodMS = 1; + periodVarianceMS = 0; + ejectionVelocity = 400.0; + velocityVariance = 150.0; + ejectionOffset = 0.0; + thetaMin = 85; + thetaMax = 85; + phiReferenceVel = 0; + phiVariance = 360; + overrideAdvances = false; + particles = "ShadeStormParticle"; +}; + +datablock ParticleData(dayCloakSmokeParticles) { + dragCoefficient = 50;/////////----------------------- + gravityCoefficient = 0.0; + inheritedVelFactor = 1.0; + constantAcceleration = 1.0; + lifetimeMS = 1000; + lifetimeVarianceMS = 0; + useInvAlpha = true; + spinRandomMin = -360.0; + spinRandomMax = 360.0; + textureName = "particleTest"; + colors[0] = "0.1 0.1 0.1 1.0";// //////////////////// + colors[1] = "0.1 0.1 0.1 1.0";// //////////////////// + colors[2] = "0.1 0.1 0.1 1.0";// \\\\\\\\\\\\\\\\\\\\ + colors[3] = "0.1 0.1 0.1 1.0";// \\\\\\\\\\\\\\\\\\\\ + sizes[0] = 350.0; + sizes[1] = 350.0; + sizes[2] = 350.0; + sizes[3] = 350.0; + times[0] = 0.0; + times[1] = 0.33; + times[2] = 0.66; + times[3] = 1.0; + mass = 0.4; + elasticity = 0.2; + friction = 1; + computeCRC = true; + haslight = true; + lightType = "PulsingLight"; + lightColor = "0.2 0.0 0.5 1.0"; + lightTime = "200"; + lightRadius = "2.0"; +}; + +datablock ParticleEmitterData(dayCloakEmitter) { + ejectionPeriodMS = 50; + periodVarianceMS = 0; + ejectionVelocity = 10.0; + velocityVariance = 0.0; + ejectionOffset = 2; + thetaMin = 0; + thetaMax = 180; + overrideAdvances = false; + particles = "dayCloakSmokeParticles"; +}; + +// +datablock ParticleData(ShadeLordScreamParticle) { + dragCoefficient = 1.0; + gravityCoefficient = 0.00; + windcoefficient = 0.0; + inheritedVelFactor = 0.0; + constantAcceleration = 10.0; + lifetimeMS = 1000; + lifetimeVarianceMS = 100; + useInvAlpha = true; + spinRandomMin = -90.0; + spinRandomMax = 90.0; + textureName = "special/cloudFlash"; + + colors[0] = "156 0 0 0.5"; + colors[1] = "156 0 0 0.5"; + colors[2] = "156 0 0 0.0"; + sizes[0] = 500; + sizes[1] = 500; + sizes[2] = 2; + times[0] = 0.0; + times[1] = 0.5; + times[2] = 1.0; +}; + +datablock ParticleEmitterData(ShadeLordScreamEmitter) { + ejectionPeriodMS = 1; + periodVarianceMS = 0; + ejectionVelocity = 400.0; + velocityVariance = 150.0; + ejectionOffset = 0.0; + thetaMin = 85; + thetaMax = 85; + phiReferenceVel = 0; + phiVariance = 360; + overrideAdvances = false; + particles = "ShadeLordScreamParticle"; +}; + +// +// PROJECTILES +// + +// ============================================================================ +// YVEX +// ============================================================================ +datablock SeekerProjectileData(YvexNightmareMissile){ + casingShapeName = "weapon_missile_casement.dts"; + projectileShapeName = "weapon_missile_projectile.dts"; + hasDamageRadius = true; + indirectDamage = 0.8; + damageRadius = 8.0; + radiusDamageType = $DamageType::Missile; + kickBackStrength = 2000; + + explosion = "MissileExplosion"; + splash = MissileSplash; + velInheritFactor = 1.0; // to compensate for slow starting velocity, this value + // is cranked up to full so the missile doesn't start + // out behind the player when the player is moving + // very quickly - bramage + + delayEmitter = MissileFireEmitter; + puffEmitter = MissilePuffEmitter; + bubbleEmitter = GrenadeBubbleEmitter; + bubbleEmitTime = 1.0; + + exhaustEmitter = MissileLauncherExhaustEmitter; + exhaustTimeMs = 300; + exhaustNodeName = "muzzlePoint1"; + + lifetimeMS = 30000; + muzzleVelocity = 10.0; + maxVelocity = 150.0; + turningSpeed = 110.0; + acceleration = 350.0; + + proximityRadius = 3; + + terrainAvoidanceSpeed = 180; + terrainScanAhead = 25; + terrainHeightFail = 12; + terrainAvoidanceRadius = 100; + + flareDistance = 200; + flareAngle = 30; + + sound = MissileProjectileSound; + + hasLight = true; + lightRadius = 5.0; + lightColor = "0.2 0.05 0"; + + useFlechette = true; + flechetteDelayMs = 550; + casingDeb = FlechetteDebris; + + explodeOnWaterImpact = false; + + baseEmitter = NMMissileBaseEmitter; +}; + +datablock LinearFlareProjectileData(KillerPulse) { + scale = "1.0 1.0 1.0"; + faceViewer = false; + directDamage = 0.00001; + hasDamageRadius = false; + indirectDamage = 0.6; + damageRadius = 10.0; + kickBackStrength = 100.0; + directDamageType = $DamageType::Admin; + indirectDamageType = $DamageType::Admin; + + explosion = "BlasterExplosion"; + splash = PlasmaSplash; + + dryVelocity = 200.0; + wetVelocity = 10; + velInheritFactor = 0.5; + fizzleTimeMS = 30000; + lifetimeMS = 30000; + explodeOnDeath = false; + reflectOnWaterImpactAngle = 0.0; + explodeOnWaterImpact = true; + deflectionOnWaterImpact = 0.0; + fizzleUnderwaterMS = -1; + + baseEmitter = PulseGreenEmitter; + delayEmitter = PulseGreenEmitter; + bubbleEmitter = PulseGreenEmitter; + + //activateDelayMS = 100; + activateDelayMS = -1; + + size[0] = 0.2; + size[1] = 0.2; + size[2] = 0.2; + + + numFlares = 15; + flareColor = "0 1 0"; + flareModTexture = "flaremod"; + flareBaseTexture = "flarebase"; + + sound = MissileProjectileSound; + fireSound = PlasmaFireSound; + wetFireSound = PlasmaFireWetSound; + + hasLight = true; + lightRadius = 3.0; + lightColor = "0 1 0"; + +}; + +datablock LinearFlareProjectileData(YvexSniperShot) { + projectileShapeName = "weapon_missile_projectile.dts"; + scale = "3.0 5.0 3.0"; + faceViewer = true; + directDamage = 0.01; + kickBackStrength = 4000.0; + DirectDamageType = $DamageType::Zombie; + + explosion = "BlasterExplosion"; + + dryVelocity = 150.0; + wetVelocity = -1; + velInheritFactor = 0.3; + fizzleTimeMS = 10000; + lifetimeMS = 10000; + explodeOnDeath = true; + reflectOnWaterImpactAngle = 0.0; + explodeOnWaterImpact = true; + deflectionOnWaterImpact = 0.0; + fizzleUnderwaterMS = -1; + + activateDelayMS = 100; + activateDelayMS = -1; + + baseEmitter = YvexSniperEmitter; + + size[0] = 0.0; + size[1] = 0.0; + size[2] = 0.0; + + + numFlares = 0; + flareColor = "0.0 0.0 0.0"; + flareModTexture = "flaremod"; + flareBaseTexture = "flarebase"; + + sound = PlasmaProjectileSound; + fireSound = PlasmaFireSound; + wetFireSound = PlasmaFireWetSound; + + hasLight = true; + lightRadius = 3.0; + lightColor = "1 0.75 0.25"; +}; + +datablock SeekerProjectileData(YvexZombieMakerMissile) { + casingShapeName = "weapon_missile_casement.dts"; + projectileShapeName = "weapon_missile_projectile.dts"; + hasDamageRadius = true; + indirectDamage = 0.5; + damageRadius = 5.0; + radiusDamageType = $DamageType::Zombie; + kickBackStrength = 2000; + + explosion = "MissileExplosion"; + splash = MissileSplash; + velInheritFactor = 1.0; // to compensate for slow starting velocity, this value + // is cranked up to full so the missile doesn't start + // out behind the player when the player is moving + // very quickly - bramage + + baseEmitter = MortarSmokeEmitter; + delayEmitter = MissileFireEmitter; + puffEmitter = MissilePuffEmitter; + bubbleEmitter = GrenadeBubbleEmitter; + bubbleEmitTime = 1.0; + + exhaustEmitter = MissileLauncherExhaustEmitter; + exhaustTimeMs = 300; + exhaustNodeName = "muzzlePoint1"; + + lifetimeMS = 30000; // z0dd - ZOD, 4/14/02. Was 6000 + muzzleVelocity = 30.0; + maxVelocity = 35.0; // z0dd - ZOD, 4/14/02. Was 80.0 + turningSpeed = 23.0; + acceleration = 15.0; + + proximityRadius = 2.5; + + terrainAvoidanceSpeed = 10; + terrainScanAhead = 7; + terrainHeightFail = 1; + terrainAvoidanceRadius = 3; + + flareDistance = 40; + flareAngle = 20; + minSeekHeat = 0.0; + + sound = MissileProjectileSound; + + hasLight = true; + lightRadius = 5.0; + lightColor = "0.2 0.05 0"; + + useFlechette = true; + flechetteDelayMs = 250; + casingDeb = FlechetteDebris; + + explodeOnWaterImpact = false; +}; + +// ============================================================================ +// WINDSHEAR +// ============================================================================ +datablock SeekerProjectileData(BossMissiles) { + casingShapeName = "weapon_missile_casement.dts"; + projectileShapeName = "weapon_missile_projectile.dts"; + hasDamageRadius = true; + indirectDamage = 0.1; + damageRadius = 6.0; + radiusDamageType = $DamageType::MissileTurret; + kickBackStrength = 500; + + flareDistance = 200; + flareAngle = 30; + minSeekHeat = 0.0; + + explosion = "MissileExplosion"; + velInheritFactor = 1.0; + + splash = MissileSplash; + baseEmitter = MortarSmokeEmitter; + delayEmitter = MissileFireEmitter; + puffEmitter = MissilePuffEmitter; + + lifetimeMS = 15000; // z0dd - ZOD, 4/14/02. Was 6000 + muzzleVelocity = 12.0; + maxVelocity = 225.0; // z0dd - ZOD, 4/14/02. Was 80.0 + turningSpeed = 50.0; + acceleration = 100.0; + + proximityRadius = 4; + + terrainAvoidanceSpeed = 100; + terrainScanAhead = 50; + terrainHeightFail = 50; + terrainAvoidanceRadius = 150; + + useFlechette = true; + flechetteDelayMs = 225; + casingDeb = FlechetteDebris; +}; + +// ============================================================================ +// GHOST OF LIGHTNING +// ============================================================================ +datablock ShockLanceProjectileData(GoLShocker) { + directDamage = 0.45; + radiusDamageType = $DamageType::ShockLance; + kickBackStrength = 2500; + velInheritFactor = 0; + sound = ""; + + zapDuration = 1.0; + impulse = 1800; + boltLength = 50.0; + extension = 50.0; // script variable indicating distance you can shock people from + lightningFreq = 25.0; + lightningDensity = 3.0; + lightningAmp = 0.25; + lightningWidth = 0.05; + + shockwave = ShocklanceHit; + + boltSpeed[0] = 2.0; + boltSpeed[1] = -0.5; + + texWrap[0] = 1.5; + texWrap[1] = 1.5; + + startWidth[0] = 0.3; + endWidth[0] = 0.6; + startWidth[1] = 0.3; + endWidth[1] = 0.6; + + texture[0] = "special/shockLightning01"; + texture[1] = "special/shockLightning02"; + texture[2] = "special/shockLightning03"; + texture[3] = "special/ELFBeam"; + + emitter[0] = ShockParticleEmitter; +}; + +// ============================================================================ +// VEGENOR +// ============================================================================ +datablock SeekerProjectileData(VegenorFireMissile) : YvexZombieMakerMissile { + indirectDamage = 0.5; + damageRadius = 5.0; + radiusDamageType = $DamageType::Fire; +}; + +datablock GrenadeProjectileData(VegenorFireMeteor) : JTLMeteorStormFireball { + projectileShapeName = "plasmabolt.dts"; + scale = "40.0 40.0 40.0"; + emitterDelay = -1; + directDamage = 0; + directDamageType = $DamageType::Fire; + hasDamageRadius = true; // true; + indirectDamage = 0.5; // 0.5; + damageRadius = 150.0; + radiusDamageType = $DamageType::Fire; +}; + +// ============================================================================ +// LORD ROG +// ============================================================================ +datablock SeekerProjectileData(LordRogStiloutte) { + casingShapeName = "weapon_missile_casement.dts"; + projectileShapeName = "weapon_missile_projectile.dts"; + hasDamageRadius = true; + indirectDamage = 0.5; + damageRadius = 5.0; + radiusDamageType = $DamageType::Zombie; + kickBackStrength = 2000; + + explosion = "MissileExplosion"; + splash = MissileSplash; + velInheritFactor = 1.0; // to compensate for slow starting velocity, this value + // is cranked up to full so the missile doesn't start + // out behind the player when the player is moving + // very quickly - bramage + + baseEmitter = MortarSmokeEmitter; + delayEmitter = MissileFireEmitter; + puffEmitter = MissilePuffEmitter; + bubbleEmitter = GrenadeBubbleEmitter; + bubbleEmitTime = 1.0; + + exhaustEmitter = MissileLauncherExhaustEmitter; + exhaustTimeMs = 300; + exhaustNodeName = "muzzlePoint1"; + + lifetimeMS = 20000; // z0dd - ZOD, 4/14/02. Was 6000 + muzzleVelocity = 10.0; + maxVelocity = 80.0; // z0dd - ZOD, 4/14/02. Was 80.0 + turningSpeed = 23.0; + acceleration = 15.0; + + proximityRadius = 2.5; + + terrainAvoidanceSpeed = 10; + terrainScanAhead = 7; + terrainHeightFail = 1; + terrainAvoidanceRadius = 3; + + flareDistance = 40; + flareAngle = 20; + minSeekHeat = 0.0; + + sound = MissileProjectileSound; + + hasLight = true; + lightRadius = 5.0; + lightColor = "0.2 0.05 0"; + + useFlechette = true; + flechetteDelayMs = 250; + casingDeb = FlechetteDebris; + + explodeOnWaterImpact = false; +}; + +// ============================================================================ +// INSIGNIA +// ============================================================================ + +// ============================================================================ +// TREVOR +// ============================================================================ + +// ============================================================================ +// LORD VARDISON / D.A. VARDISON +// ============================================================================ +datablock LinearFlareProjectileData(SuperlaserProjectile) { + scale = "15.0 15.0 15.0"; + faceViewer = false; + directDamage = 1.0; + hasDamageRadius = true; + indirectDamage = 0.9; + damageRadius = 30.0; + kickBackStrength = 1000.0; + radiusDamageType = $DamageType::Explosion; + + explosion[0] = "HyperDevCannonExplosion2"; + explosion[1] = "SatchelMainExplosion"; + splash = PlasmaSplash; + baseEmitter = HyperDevCannonBaseEmitter; + + + dryVelocity = 200.0; + wetVelocity = 200; + velInheritFactor = 0.5; + fizzleTimeMS = 10000; + lifetimeMS = 10000; + explodeOnDeath = false; + reflectOnWaterImpactAngle = 0.0; + explodeOnWaterImpact = true; + deflectionOnWaterImpact = 0.0; + fizzleUnderwaterMS = -1; + + //activateDelayMS = 100; + activateDelayMS = -1; + + size[0] = 9; + size[1] = 10; + size[2] = 11; + + + numFlares = 400; + flareColor = "0.0 1.0 0"; + flareModTexture = "flaremod"; + flareBaseTexture = "flarebase"; + + sound = MissileProjectileSound; + fireSound = PlasmaFireSound; + wetFireSound = PlasmaFireWetSound; + + hasLight = true; + lightRadius = 3.0; + lightColor = "0 0.75 0.25"; + +}; + +datablock LinearFlareProjectileData(ShadowBomb) { + projectileShapeName = "turret_muzzlepoint.dts"; + scale = "1.0 1.0 1.0"; + faceViewer = true; + directDamage = 0.02; + hasDamageRadius = true; + indirectDamage = 0.02; + damageRadius = 4.0; + kickBackStrength = 0.0; + radiusDamageType = $DamageType::Fire; + + explosion = "ThrowerExplosion"; + splash = PlasmaSplash; + + baseEmitter = ShadowBaseEmitter; + + dryVelocity = 50.0; // z0dd - ZOD, 7/20/02. Faster plasma projectile. was 55 + wetVelocity = -1; + velInheritFactor = 0.3; + fizzleTimeMS = 14000; + lifetimeMS = 10000; // z0dd - ZOD, 4/25/02. Was 6000 + explodeOnDeath = false; + reflectOnWaterImpactAngle = 0.0; + explodeOnWaterImpact = true; + deflectionOnWaterImpact = 0.0; + fizzleUnderwaterMS = -1; + + //activateDelayMS = 100; + activateDelayMS = -1; + + size[0] = 0.2; + size[1] = 0.5; + size[2] = 0.1; + + + numFlares = 35; + flareColor = "1 0.18 0.03"; + flareModTexture = "flaremod"; + flareBaseTexture = "flarebase"; + + sound = PlasmaProjectileSound; + fireSound = FlamethrowerFireSound; + wetFireSound = PlasmaFireWetSound; + + hasLight = true; + lightRadius = 10.0; + lightColor = "0.94 0.03 0.12"; +}; + +datablock SeekerProjectileData(VardisonLaserBallMissile) : YvexNightmareMissile { + baseEmitter = ShadowBaseEmitter; +}; + +datablock LinearFlareProjectileData(VardisonSubShadowBomb) : DMPlasma { + explosion = MortarExplosion; + dryVelocity = 500.0; // z0dd - ZOD, 4/25/02. Was 50. Velocity of projectile out of water + wetVelocity = -1; + velInheritFactor = 1.0; + fizzleTimeMS = 14000; + lifetimeMS = 10000; // z0dd - ZOD, 4/25/02. Was 6000 +}; + +datablock SeekerProjectileData(VardisonMiniDemonSpawner) : VardisonNightmareMissile { + baseEmitter = ShadowBaseEmitter; +}; + +datablock GrenadeProjectileData(MiniDemonBlaster) { + projectileShapeName = "plasmabolt.dts"; + emitterDelay = -1; + directDamage = 0.0; + hasDamageRadius = true; + indirectDamage = 0.45; + damageRadius = 5.0; // z0dd - ZOD, 8/13/02. Was 20.0 + radiusDamageType = $DamageType::Demon; + kickBackStrength = 1500; + + explosion = "MortarExplosion"; + underwaterExplosion = "MortarExplosion"; + velInheritFactor = 0; + splash = PlasmaSplash; + depthTolerance = 100.0; + + baseEmitter = DemonFBSmokeEmitter; + bubbleEmitter = DemonFBSmokeEmitter; + + grenadeElasticity = 0; + grenadeFriction = 0.4; + armingDelayMS = -1; // z0dd - ZOD, 4/14/02. Was 2000 + + gravityMod = 0.4; // z0dd - ZOD, 5/18/02. Make mortar projectile heavier, less floaty + muzzleVelocity = 125.0; // z0dd - ZOD, 8/13/02. More velocity to compensate for higher gravity. Was 63.7 + drag = 0; + sound = PlasmaProjectileSound; + + hasLight = true; + lightRadius = 10; + lightColor = "1 0.75 0.25"; + + hasLightUnderwaterColor = true; + underWaterLightColor = "1 0.75 0.25"; +}; + +// ============================================================================ +// STORMRIDER +// ============================================================================ +datablock LinearProjectileData(FakePhotonShockwaveProj) { + projectileShapeName = "turret_muzzlepoint.dts"; + scale = "0.1 0.1 0.1"; + faceViewer = true; + directDamage = 0; + hasDamageRadius = false; + indirectDamage = 0.1; + damageRadius = 10; + kickBackStrength = 1; + radiusDamageType = $DamageType::Photon; + explosion = "FakePhotonShockwaveExp"; + dryVelocity = 0.0001; + wetVelocity = 0.00001; + velInheritFactor = 0.0; + lifetimeMS = 0.00000001; + explodeOnDeath = true; + reflectOnWaterImpactAngle = 0.0; + explodeOnWaterImpact = true; + deflectionOnWaterImpact = 0.0; +}; + +datablock LinearFlareProjectileData(PhotonMissileProj) { + scale = "4 4 4";//6 + sound = PlasmaProjectileSound; + + faceViewer = true; + directDamage = 0.0; + hasDamageRadius = true; + indirectDamage = 1.0; + damageRadius = 10.0; + kickBackStrength = 4000; + radiusDamageType = $DamageType::Photon; //obviously change this + + explosion = "PhotonMissileExplosion"; + underwaterExplosion = "PhotonMissileExplosion"; + splash = BlasterSplash; + + dryVelocity = 200.0; + wetVelocity = 200.0; + velInheritFactor = 0.6; + fizzleTimeMS = 8000; + lifetimeMS = 8000; + explodeOnDeath = true; + + reflectOnWaterImpactAngle = 0.0; + explodeOnWaterImpact = false; + deflectionOnWaterImpact = 0.0; + fizzleUnderwaterMS = 15000; + + activateDelayMS = 0; + numFlares = 35; + flareColor = "0.0 1.1 0"; + flareModTexture = "flaremod"; + flareBaseTexture = "flarebase"; + + size[0] = 1; + size[1] = 10; + size[2] = 2; + + + hasLight = true; + lightRadius = 1.0; + lightColor = "0.6 1.1 0"; +}; + +// ============================================================================ +// GHOST OF FIRE +// ============================================================================ +datablock LinearFlareProjectileData(GhostFlameboltMain) { + projectileShapeName = "turret_muzzlepoint.dts"; + scale = "1.0 1.0 1.0"; + faceViewer = true; + directDamage = 0.05; + hasDamageRadius = true; + indirectDamage = 0.1; + damageRadius = 4.0; + kickBackStrength = 0.0; + radiusDamageType = $DamageType::Plasma; + + explosion = "ThrowerExplosion"; + splash = PlasmaSplash; + + baseEmitter = GhostflameEmitter; + + dryVelocity = 50.0; // z0dd - ZOD, 7/20/02. Faster plasma projectile. was 55 + wetVelocity = -1; + velInheritFactor = 0.3; + fizzleTimeMS = 250; + lifetimeMS = 30000; + explodeOnDeath = false; + reflectOnWaterImpactAngle = 0.0; + explodeOnWaterImpact = true; + deflectionOnWaterImpact = 0.0; + fizzleUnderwaterMS = -1; + + //activateDelayMS = 100; + activateDelayMS = -1; + + size[0] = 0.2; + size[1] = 0.5; + size[2] = 0.1; + + + numFlares = 35; + flareColor = "1 0.18 0.03"; + flareModTexture = "flaremod"; + flareBaseTexture = "flarebase"; + + sound = PlasmaProjectileSound; + fireSound = FlamethrowerFireSound; + wetFireSound = PlasmaFireWetSound; + + hasLight = true; + lightRadius = 10.0; + lightColor = "0.94 0.03 0.12"; +}; + +datablock LinearProjectileData(NapalmShot) { + projectileShapeName = "mortar_projectile.dts"; + emitterDelay = -1; + directDamage = 0.0; + hasDamageRadius = true; + indirectDamage = 0.5; + damageRadius = 20.0; + radiusDamageType = $DamageType::Plasma; + kickBackStrength = 3000; + + explosion = "NapalmExplosion"; +// underwaterExplosion = "UnderwaterNapalmExplosion"; + velInheritFactor = 0.5; +// splash = NapalmSplash; + depthTolerance = 10.0; // depth at which it uses underwater explosion + + baseEmitter = MissileFireEmitter; + bubbleEmitter = GrenadeBubbleEmitter; + + grenadeElasticity = 0.15; + grenadeFriction = 0.4; + armingDelayMS = 2000; + muzzleVelocity = 63.7; + drag = 0.1; + + sound = MortarProjectileSound; + + hasLight = true; + lightRadius = 4; + lightColor = "1.00 0.9 1.00"; + + hasLightUnderwaterColor = true; + underWaterLightColor = "0.05 0.075 0.2"; + + dryVelocity = 90; + wetVelocity = 50; + velInheritFactor = 0.5; + fizzleTimeMS = 5000; + lifetimeMS = 2700; + explodeOnDeath = true; + reflectOnWaterImpactAngle = 15.0; + explodeOnWaterImpact = true; + deflectionOnWaterImpact = 0.0; + fizzleUnderwaterMS = 5000; + +}; + +// ============================================================================ +// SHADE LORD +// ============================================================================ +datablock SeekerProjectileData(ShadeLordSword){ + casingShapeName = "weapon_missile_casement.dts"; + projectileShapeName = "weapon_missile_projectile.dts"; + hasDamageRadius = true; + indirectDamage = 0.8; + damageRadius = 8.0; + radiusDamageType = $DamageType::Missile; + kickBackStrength = 2000; + + explosion = "MissileExplosion"; + splash = MissileSplash; + velInheritFactor = 1.0; // to compensate for slow starting velocity, this value + // is cranked up to full so the missile doesn't start + // out behind the player when the player is moving + // very quickly - bramage + + delayEmitter = MissileFireEmitter; + puffEmitter = MissilePuffEmitter; + bubbleEmitter = GrenadeBubbleEmitter; + bubbleEmitTime = 1.0; + + exhaustEmitter = MissileLauncherExhaustEmitter; + exhaustTimeMs = 300; + exhaustNodeName = "muzzlePoint1"; + + lifetimeMS = 30000; + muzzleVelocity = 10.0; + maxVelocity = 250.0; + turningSpeed = 110.0; + acceleration = 450.0; + + proximityRadius = 3; + + terrainAvoidanceSpeed = 180; + terrainScanAhead = 25; + terrainHeightFail = 12; + terrainAvoidanceRadius = 100; + + flareDistance = 200; + flareAngle = 30; + + sound = MissileProjectileSound; + + hasLight = true; + lightRadius = 5.0; + lightColor = "0.2 0.05 0"; + + useFlechette = true; + flechetteDelayMs = 550; + casingDeb = FlechetteDebris; + + explodeOnWaterImpact = false; + + baseEmitter = ShadeSwordEmitter; +}; + diff --git a/scripts/TWM2/Bosses/ColonelWindshear.cs b/scripts/TWM2/Bosses/ColonelWindshear.cs new file mode 100644 index 0000000..f3572ed --- /dev/null +++ b/scripts/TWM2/Bosses/ColonelWindshear.cs @@ -0,0 +1,263 @@ +//This sets up the drone and the functions needed to start the drone. +function StartWindshear(%pos){ + %team = 6; + %rotation = "1 0 0 0"; + %skill = 10; + + %Drone = new FlyingVehicle() { + dataBlock = WindshearPlatform; + position = %pos; + rotation = %rotation; + team = %team; + }; + MissionCleanUp.add(%Drone); + + setTargetSensorGroup(%Drone.getTarget(), %team); + + %Drone.isdrone = 1; + %drone.dodgeGround = 0; + + %drone.isace = 1; + + %drone.skill = 0.2 + (%skill / 12.5); + + schedule(100, 0, "WSForwardImpulse", %drone); //special impulse + schedule(101, 0, "DronefindTarget", %drone); + schedule(102, 0, "WSScanGround", %drone); + + InitiateBoss(%drone, "CnlWindshear"); + + //Helpers + %pos2 = vectoradd(%pos, "15 0 0"); + %pos3 = vectoradd(%pos, "-15 0 0"); + %d2 = StartAIGunship(%pos2, "", 6, "ace", 0); + %d3 = StartAIGunship(%pos3, "", 6, "ace", 0); + %d2.isUltrally = 1; + %d3.isUltrally = 1; + // + + WindshearAttacks(%drone); + + return %drone; +} + +function WSForwardImpulse(%obj){ + if(!isObject(%obj)) { + return; + } + if(vectorLen(%obj.getVelocity()) < 500) { + %obj.applyImpulse(%obj.getPosition(),vectorScale(%obj.getForwardVector(),$Drone::FrdImpulse)); + } + schedule(100, 0, "WSForwardImpulse", %obj); +} + +function WSScanGround(%obj){ + if(!isObject(%obj)) + return; + %vec = %obj.getForwardVector(); + %vector = vectorAdd(%obj.getPosition(),"0 0 -350"); + %searchResult = containerRayCast(%obj.getWorldBoxCenter(), %vector, $TypeMasks::TerrainObjectType, %obj); + if(%searchResult){ + %z = getWord(%vec,2); + %height = vectorDist(%obj.getPosition(),posFromRaycast(%searchresult)); + if(%z < 0){ + if(%height <= (200 + ((%z * -1) * 300))){ + %obj.dodgeground = 1; + schedule(100, 0, "WSDodgeGround", %obj); + return; + } + } + } + schedule(100, 0, "WSScanGround", %obj); +} + +function WSDodgeGround(%obj){ + if(!isObject(%obj)) + return; + %vec = %obj.getForwardVector(); + %z = getWord(%vec,2); + if(%z > 0){ + %obj.dodgeground = 0; + schedule(100, 0, "DronefindTarget", %obj); + schedule(101, 0, "WSScanGround", %obj); + return; + } + %pos = vectorAdd(%obj.getPosition(),%vec); + %obj.applyImpulse(%pos,vectorScale("0 0 1",$Drone::TurnImpulse * %obj.skill)); + schedule(100, 0, "WSDodgeGround", %obj); +} + +function DroneFindNearestPilot(%radius, %drone) { + %pos = %drone.getposition(); + %wbpos = %drone.getworldboxcenter(); + %count = ClientGroup.getCount(); + %closestClient = -1; + %closestDistance = %radius; + for(%i = 0; %i < %count; %i++) + { + %cl = ClientGroup.getObject(%i); + if(isObject(%cl.player)){ + %testPos = %cl.player.getWorldBoxCenter(); + %distance = vectorDist(%wbpos, %testPos); + if (%distance > 0 && %distance < %closestDistance) + { + %closestClient = %cl; + %closestDistance = %distance; + } + } + } + return %closestClient; +} + +function WindshearAttacks(%drone) { + if(!isObject(%drone)) { + return; + } + schedule(30000, 0, "WindshearAttacks", %drone); + %rand = getRandom(1, 4); + switch(%rand) { + case 1: + schedule(700, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(1400, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(2100, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(2800, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(3500, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(4200, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(4900, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(5600, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(6300, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(7000, 0, "WindshearAttack_FUNC", "Flare", %drone); + // Quick Shots + schedule(8000, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(8100, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(8200, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(8300, 0, "WindshearAttack_FUNC", "Flare", %drone); + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Windshear"]@": Did you actually think, your fucking missiles could hit me?"); + case 2: + %target = DroneFindNearestPilot(2000,%drone); + if(%target.player) { + WindshearAttack_FUNC("SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(700, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(1400, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(2100, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(2800, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(3500, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(4200, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(4900, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(5600, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(6300, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(7000, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + // Quick Shots + schedule(8000, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(8100, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(8200, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(8300, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Windshear"]@": You fuckin' Chasing me "@getTaggedString(%target.name)@"!?!? WATCH THIS BITCH!!!"); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Windshear"]@": FUCK, My missile strike was ready."); + } + case 3: + %target = DroneFindNearestPilot(2000,%drone); + if(%target.player) { + schedule(700, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(1400, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(2100, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(2800, 0, "WindshearAttack_FUNC", "Flare", %drone); + WindshearAttack_FUNC("SidewinderLaunch", %drone SPC %target.player SPC 3); + // Quick Shots + schedule(1000, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(1100, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(1200, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(1300, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(1400, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Windshear"]@": I'ma kill me a fuckin' "@getTaggedString(%target.name)@"!"); + } + else { + schedule(700, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(1400, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(2100, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(2800, 0, "WindshearAttack_FUNC", "Flare", %drone); + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Windshear"]@": FUCK!!! Oh well, Flares will fucking do..."); + } + default: + schedule(700, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(1400, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(2100, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(2800, 0, "WindshearAttack_FUNC", "Flare", %drone); + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Windshear"]@": FUCK!!! Oh well, Flares will fucking do..."); + } +} + +//Attack Function +function WindshearAttack_FUNC(%att, %args) { + switch$(%att) { + case "Flare": + %d = getWord(%args, 0); + if(!isObject(%d)) { + return; + } + %SPos = vectorAdd(%d.getPosition(),"0 0 0"); + %p1 = new FlareProjectile() { + dataBlock = FlareGrenadeProj; + initialDirection = "5 0 -3"; + initialPosition = %SPos; + sourceObject = %d; + sourceSlot = 6; + }; + %p2 = new FlareProjectile() { + dataBlock = FlareGrenadeProj; + initialDirection = "-5 0 -3"; + initialPosition = %SPos; + sourceObject = %d; + sourceSlot = 6; + }; + FlareSet.add(%p1); + FlareSet.add(%p2); + MissionCleanup.add(%p1); + MissionCleanup.add(%p2); + + case "HeatLoop": + %t = getWord(%args, 0); + %v = getWord(%args, 1); + + if(!isObject(%t) || %t.getState() $= "dead") { + return; + } + if(%v > 200) { + return; + } + %v++; + %t.setHeat(100); + schedule(100, 0, "WindshearAttack_FUNC", "HeatLoop", %t SPC %v); + + case "MissileDrop": + %t = getWord(%args, 0); + %m = getWord(%args, 1); + + %t.setHeat(100); + %m.setObjectTarget(%t); + //HeatLoop(%t,0); + WindshearAttack_FUNC("HeatLoop", %t SPC 0); + + case "SidewinderLaunch": + %d = getWord(%args, 0); + %t = getWord(%args, 1); + %TTL = getWord(%args, 2); + + if(!isObject(%d) || !isObject(%t) || %t.getState() $= "dead") { + return; + } + %SPos = vectorAdd(%d.getPosition(),"0 0 3"); + %p1 = new SeekerProjectile() { + dataBlock = BossMissiles; + initialDirection = "0 0 10"; + initialPosition = %SPos; + sourceObject = %d; + sourceSlot = 6; + }; + MissionCleanup.add(%p1); + schedule(%TTL * 1000, 0, "WindshearAttack_FUNC", "MissileDrop", %t SPC %p1); + } +} + diff --git a/scripts/TWM2/Bosses/GeneralVegenor.cs b/scripts/TWM2/Bosses/GeneralVegenor.cs new file mode 100644 index 0000000..c41ed39 --- /dev/null +++ b/scripts/TWM2/Bosses/GeneralVegenor.cs @@ -0,0 +1,208 @@ +function SpawnVegenor(%position) { + %Zombie = new player(){ + Datablock = "VegenorZombieArmor"; + }; + %Cpos = vectorAdd(%position, "0 0 5"); + MessageAll('MsgBossSpawn', "\c4"@$TWM2::BossName["Vegenor"]@": Time to engage the enemy soldiers!!!"); + + %command = "Vegenormovetotarget"; + %zombie.ticks = 0; + InitiateBoss(%zombie, "Vengenor"); + VegenorAttack_FUNC("Summon", %zombie); + VegenorAttack(%zombie); + + %Zombie.team = 30; + %zname = $TWM2::BossName["Vegenor"]; // <- To Hosts, Enjoy, You can + //Change the Zombie Names now!!! + %zombie.target = createTarget(%zombie, %zname, "", "Derm3", '', %zombie.team, PlayerSensor); + setTargetSensorData(%zombie.target, PlayerSensor); + setTargetSensorGroup(%zombie.target, 30); + setTargetName(%zombie.target, addtaggedstring(%zname)); + setTargetSkin(%zombie.target, 'Horde'); + // + %zombie.type = %type; + %Zombie.setTransform(%cpos); + %zombie.canjump = 1; + %zombie.hastarget = 1; + %zombie.isZombie = 1; + MissionCleanup.add(%Zombie); + schedule(1000, %zombie, %command, %zombie); +} + +function Vegenormovetotarget(%zombie){ + if(!isobject(%zombie)) + return; + if(%zombie.getState() $= "dead") + return; + %pos = %zombie.getworldboxcenter(); + %closestClient = ZombieLookForTarget(%zombie); + %z = getWord(%pos, 2); + if(%z < -300) { + %zombie.startFade(400, 0, true); + %zombie.startFade(1000, 0, false); + %zombie.setPosition(vectorAdd(vectoradd(%closestclient.player.getPosition(), "0 0 20"), getRandomPosition(25, 1))); + %zombie.setVelocity("0 0 0"); + MessageAll('msgAntiFall', "\c4"@$TWM2::BossName["Vegenor"]@": Fuck Falling!!!!"); + } + %closestDistance = getWord(%closestClient,1); + %closestClient = getWord(%closestClient,0).Player; + if(%closestDistance <= $zombie::detectDist){ + //Random Repeling + if(%closestDistance < 25) { + %zombie.playShieldEffect("1 1 1"); + %RepChance = getRandom(1, 5); + if(%RepChance == 3) { + RepelZombie(%closestClient, %zombie); + } + //FIAH!!! + else { + %vec = vectorsub(%closestClient.getworldboxcenter(),vectorAdd(%zombie.getPosition(), "0 0 1")); + %vec = vectoradd(%vec, vectorscale(%closestClient.getvelocity(),vectorlen(%vec)/100)); + %p = new LinearFlareProjectile() { + dataBlock = FlamethrowerBolt; //burn :) + initialDirection = %vec; + initialPosition = vectorAdd(%zombie.getPosition(), "0 0 1"); + sourceObject = %zombie; + sourceSlot = 0; + }; + } + } + if(%zombie.hastarget != 1){ + serverPlay3d("ZombieHOWL",%zombie.getWorldBoxCenter()); + %zombie.hastarget = 1; + } + %chance = (getrandom() * 20); + if(%chance >= 19) + serverPlay3d("ZombieMoan",%zombie.getWorldBoxCenter()); + + %vector = ZgetFacingDirection(%zombie,%closestClient,%pos); + + %vector = vectorscale(%vector, $Zombie::DForwardSpeed); + %upvec = "150"; + %x = Getword(%vector,0); + %y = Getword(%vector,1); + %z = Getword(%vector,2); + if(%z >= ($Zombie::DForwardSpeed)) + %upvec = (%upvec * 5); + %vector = %x@" "@%y@" "@%upvec; + %zombie.applyImpulse(%pos, %vector); + } + else if(%zombie.hastarget == 1){ + %zombie.hastarget = 0; + %zombie.zombieRmove = schedule(100, %zombie, "ZSetRandomMove", %zombie); + } + %zombie.moveloop = schedule(500, %zombie, "Vegenormovetotarget", %zombie); +} + +function VegenorAttack_FUNC(%att, %args) { + switch$(%att) { + case "Summon": + %z = getWord(%args, 0); + if(!isobject(%z) || %z.getState() $= "dead") { + return; + } + //schedule the next one + schedule(30000, 0, "VegenorAttack_FUNC", "Summon", %z); + //-------------------- + %type = getRandomZombieType("1 2 3 4 5 9 12 13 14"); + %msg = getrandom(1,2); + switch(%msg) { + case 1: + messageall('MsgSummon',"\c4"@$TWM2::BossName["Vegenor"]@": Attack the enemy"); + case 2: + messageall('MsgSummon',"\c4"@$TWM2::BossName["Vegenor"]@": Hunt them all down"); + } + for(%i = 0; %i < 6; %i++) { + %pos = vectoradd(%z.getPosition(), getRandomPosition(10,1)); + %fpos = vectoradd("0 0 5",%pos); + StartAZombie(%fpos, %type); + } + %z.setMoveState(true); + %z.setActionThread($Zombie::RAAMThread, true); + %z.schedule(3500, "setMoveState", false); + case "SetFire": + %t = getWord(%args, 0); + if(%t.maxfirecount $= "") { + %t.maxfirecount = 0; + } + %t.maxfirecount = %t.maxfirecount + (30 * (0.05/0.2)); + if(%t.onfire == 0 || %t.onfire $= ""){ + %t.onfire = 1; + schedule(10, %t, "burnloop", %t); + } + case "FlameMissileSingle": + %Tobj = getWord(%args, 0); + %vec = vectorNormalize(vectorSub(%Tobj.getPosition(), %z.getPosition())); + %p = new SeekerProjectile() { + dataBlock = VegenorFireMissile; + initialDirection = %vec; + initialPosition = %z.getMuzzlePoint(4); + sourceObject = %z; + sourceSlot = 4; + }; + %beacon = new BeaconObject() { + dataBlock = "SubBeacon"; + beaconType = "vehicle"; + position = %Tobj.getWorldBoxCenter(); + }; + %beacon.team = 0; + %beacon.setTarget(0); + MissionCleanup.add(%beacon); + %p.setObjectTarget(%beacon); + DemonMotherMissileFollow(%Tobj, %beacon,%p); + case "MeteorDrop": + %t = getWord(%args, 0); + %fpos = vectoradd(%t.getposition(), getRandomposition(50, 0)); + %pos2 = vectoradd(%fpos, "0 0 700"); + schedule(500, 0, spawnprojectile, VegenorFireMeteor, GrenadeProjectile, %pos2, "0 0 -10"); + } +} + +function VegenorAttack(%z) { + if(!isobject(%z) || %z.getState() $= "dead") { + return; + } + schedule(30000, 0, "VegenorAttack", %z); + %z.setVelocity("0 0 0"); + //Attacks + %AttackNum = getRandom(1, 4); + switch(%AttackNum) { + case 1: + %target = FindValidTarget(%z); + if(isObject(%target.player) && !%target.ignoredbyZombs) { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Vegenor"]@": Flame on "@getTaggedString(%target.name)@"!"); + VegenorAttack_FUNC("SetFire", %target.player); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Vegenor"]@": heh, "@getTaggedString(%target.name)@" is already dead!"); + } + case 2: + %target = FindValidTarget(%z); + if(isObject(%target.player) && !%target.ignoredbyZombs) { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Vegenor"]@": Lets insert some fire into your life, "@getTaggedString(%target.name)@"!"); + VegenorAttack_FUNC("FlameMissileSingle", %target.player); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Vegenor"]@": Hiding from me "@getTaggedString(%target.name)@"?"); + } + case 3: + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Vegenor"]@": Fire Missiles For ALL!!"); + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + if(isObject(%cl.player) && %cl.player.getState() !$= "dead") { + VegenorAttack_FUNC("FlameMissileSingle", %cl.player); + } + } + case 4: + %target = FindValidTarget(%z); + if(isObject(%target.player) && !%target.ignoredbyZombs) { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Vegenor"]@": Hey "@getTaggedString(%target.name)@", LOOK UP!!!"); + VegenorAttack_FUNC("MeteorDrop", %target.player); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Vegenor"]@": Hiding does not beat me "@getTaggedString(%target.name)@"!!!"); + } + default: + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Vegenor"]@": I shall wait!!!"); + } +} diff --git a/scripts/TWM2/Bosses/GhostOfFire.cs b/scripts/TWM2/Bosses/GhostOfFire.cs new file mode 100644 index 0000000..30477df --- /dev/null +++ b/scripts/TWM2/Bosses/GhostOfFire.cs @@ -0,0 +1,426 @@ +//Ghost of Fire +//Phantom139 +//Ported From TWM1 + +function StartGhostFire(%pos) { + %Ghost = new player(){ + Datablock = "GhostFireArmor"; + }; + %Ghost.setTransform(%pos); + %Ghost.team = 30; + %Ghost.hastarget = 1; + %Ghost.isGOF = 1; + %Ghost.isBoss = 1; + MissionCleanup.add(%Ghost); + %Ghost.target = createTarget(%Ghost, ""@$TWM2::BossName["GoF"]@"", "", "Male3", '', %Ghost.team, PlayerSensor); + setTargetSensorData(%Ghost.target, PlayerSensor); + setTargetSensorGroup(%Ghost.target, 30); + setTargetName(%Ghost.target, addtaggedstring($TWM2::BossName["GoF"])); + + GOFAttack_FUNC("ConsiderFlamethrower", %Ghost); + GOFDoRandomAttacks(%ghost); + + InitiateBoss(%ghost, "GhostOfFire"); + + schedule(500, 0, "GOFLookforTarget", %Ghost); +} + +function GOFLookforTarget(%Ghost) { + if(!isObject(%Ghost)) + return; + if(%Ghost.getState() $= "dead") + return; + %pos = %Ghost.getposition(); + %wbpos = %Ghost.getworldboxcenter(); + %count = ClientGroup.getCount(); + %closestClient = -1; + %closestDistance = 32767; + for(%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject(%i); + if(isObject(%cl.player)){ + %testPos = %cl.player.getWorldBoxCenter(); + %distance = vectorDist(%wbpos, %testPos); + if (%distance > 0 && %distance < %closestDistance) { + %closestClient = %cl; + %closestDistance = %distance; + } + } + } + if(%closestClient) { + GOFPerformMove(%Ghost,%closestClient,%closestDistance); + } + %Ghost.Targeting = schedule(500, %Ghost, "GOFLookforTarget", %Ghost); +} + +function GOFPerformMove(%ghost,%closestClient,%closestDistance) { + %ghost.TargetCL = %closestClient; + %ghost.DistToTarg = %closestDistance; + %zposition = %ghost.getPosition(); + %Zzaxis = getword(%zposition,2); + if(%Zzaxis < $zombie::falldieheight) { + %ghost.scriptkill($DamageType::Suicide); + } + %pos = %ghost.getworldboxcenter(); + %closestClient = %closestClient.Player; + if(%closestDistance <= $zombie::detectDist){ + if(%ghost.hastarget != 1){ + %ghost.hastarget = 1; + } + + //target is coming in for an easy kill, lets tele + if(%closestDistance < 15) { + GOFAttack_FUNC("BurnTeleport", %ghost); + } + + %clpos = %closestClient.getPosition(); + %vector = vectorNormalize(vectorSub(%clpos, %pos)); + %v1 = getword(%vector, 0); + %v2 = getword(%vector, 1); + %nv1 = %v2; + %nv2 = (%v1 * -1); + %none = 0; + %vector2 = %nv1@" "@%nv2@" "@%none; + %ghost.setRotation(fullrot("0 0 0",%vector2)); + + %fmultiplier = $Zombie::ForwardSpeed; + %vector = vectorscale(%vector, %Fmultiplier); + %upvec = "150"; + + %x = Getword(%vector,0); + %y = Getword(%vector,1); + %z = Getword(%vector,2); + if(%z >= 600) + %upvec = (%upvec * 5); + %vector = %x@" "@%y@" "@%upvec; + %ghost.applyImpulse(%pos, %vector); + } +} + + +//ATTACKS +function GOFAttack_FUNC(%att, %args) { + switch$(%att) { + case "ConsiderFlamethrower": + %g = getWord(%args, 0); + if(!isObject(%g) || %g.getState() $= "dead") { + return; + } + %target = %g.TargetCL; + %distance = %g.DistToTarg; + if(isObject(%target.player) && %target.player.getState() !$= "dead") { + //We have a target, time to scan distance + if(%distance <= 35) { + //The idiot is in range, crisp em :) + %vec = vectorsub(%target.player.getworldboxcenter(),vectorAdd(%g.getPosition(), "0 0 1")); + %vec = vectoradd(%vec, vectorscale(%target.player.getvelocity(),vectorlen(%vec)/100)); + %p = new LinearFlareProjectile() { + dataBlock = FlamethrowerBolt; //burn :) + initialDirection = %vec; + initialPosition = vectorAdd(%g.getPosition(), "0 0 1"); + sourceObject = %g; + sourceSlot = 0; + }; + schedule(200, 0, "GOFAttack_FUNC", "ConsiderFlamethrower", %g); + } + else { + schedule(750, 0, "GOFAttack_FUNC", "ConsiderFlamethrower", %g); + } + } + //no target, lets use a longer loop + else { + schedule(750, 0, "GOFAttack_FUNC", "ConsiderFlamethrower", %g); + } + + case "Fireball": + %g = getWord(%args, 0); + %t = getWord(%args, 1); + if(!isObject(%t) || %t.getState() $= "dead") { + return; + } + if(!isObject(%g) || %g.getState() $= "dead") { + return; + } + %vec = vectorsub(%t.getworldboxcenter(), %g.getMuzzlePoint(0)); + %vec = vectoradd(%vec, vectorscale(%t.getvelocity(), vectorlen(%vec)/100)); + %p = new LinearProjectile() { + dataBlock = NapalmShot; //burn :) + initialDirection = %vec; + initialPosition = %g.getMuzzlePoint(0); + sourceObject = %g; + sourceSlot = 0; + }; + MissionCleanup.add(%p); + + case "FBSpiral": + %g = getWord(%args, 0); + %msDelay = getWord(%args, 1); + if(!isObject(%g) || %g.getState() $= "dead") { + return; + } + if(!isSet(%msDelay)) { + %msDelay = 100; + } + %dir[0] = "1 0 0"; + %dir[1] = "1 1 0"; + %dir[2] = "0 1 0"; + %dir[3] = "-1 1 0"; + %dir[4] = "-1 0 0"; + %dir[5] = "-1 -1 0"; + %dir[6] = "0 -1 0"; + %dir[7] = "1 -1 0"; + // + for(%i = 0; %i < 8; %i++) { + %time = %i * %msDelay; + schedule(%time, 0, spawnprojectile, NapalmShot, LinearProjectile, %g.getPosition(), %dir[%i], %g); + } + + case "FireBlast": + //CAREFUL!!! note the change from getWord to getField!!! + %g = getField(%args, 0); + %pos = getField(%args, 1); + + if(!isObject(%g) || %g.getState() $= "dead") { + return; + } + %p = new TracerProjectile() { + dataBlock = napalmSubExplosion; + initialDirection = "0 0 -10"; + initialPosition = %pos; + sourceObject = %g; + sourceSlot = 5; + }; + %p.vector = "0 0 -10"; + %p.count = 1; + + case "BurnTeleport": + %g = getWord(%args, 0); + if(!isObject(%g) || %g.getState() $= "dead") { + return; + } + %cP = %g.getPosition(); + %nP = getRandomPosition(55, 0); + %nP2 = vectorAdd(%np, "0 0 100"); + %fP = vectorAdd(%cP, %nP2); + GOFAttack_FUNC("FireBlast", %g TAB %cP); + %g.setTransform(%fP); + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": ehehehehe.. Burn out..."); + + case "Flamecano": + %g = getWord(%args, 0); + if(!isObject(%g) || %g.getState() $= "dead") { + return; + } + //First, Specify All Directions + %vec[1] = vectorscale(vectornormalize("1 0 0"), 24); // +X 0Y + %vec[2] = vectorscale(vectornormalize("1 1 0"), 24); // +X +Y + %vec[3] = vectorscale(vectornormalize("1 -1 0"), 24); // +X -Y + %vec[4] = vectorscale(vectornormalize("-1 0 0"), 24); // -X 0Y + %vec[5] = vectorscale(vectornormalize("-1 1 0"), 24); // -X +Y + %vec[6] = vectorscale(vectornormalize("-1 -1 0"), 24); //-X -Y + %vec[7] = vectorscale(vectornormalize("0 1 0"), 24); // 0X +Y + %vec[8] = vectorscale(vectornormalize("0 -1 0"), 24); // 0X -Y + //Oh.. long crap + for(%i = 1; %i <= 8; %i++) { + %p = new TracerProjectile() { + dataBlock = napalmSubExplosion; + initialDirection = "0 0 -30"; + initialPosition = vectorAdd(%g.getPosition(), "0 0 -3"); + sourceObject = %g; + sourceSlot = 5; + }; + %p.maxCount = 5; + %p.vector = %vec[%i]; + %p.count = 1; + } + + case "Ultracano": + %g = getWord(%args, 0); + %TPos = getWords(%args, 1); + + if(!isObject(%g) || %g.getState() $= "dead") { + return; + } + //First, Specify All Directions + %vec[1] = vectorscale(vectornormalize("1 0 0"), 24); // +X 0Y + %vec[2] = vectorscale(vectornormalize("1 1 0"), 24); // +X +Y + %vec[3] = vectorscale(vectornormalize("1 -1 0"), 24); // +X -Y + %vec[4] = vectorscale(vectornormalize("-1 0 0"), 24); // -X 0Y + %vec[5] = vectorscale(vectornormalize("-1 1 0"), 24); // -X +Y + %vec[6] = vectorscale(vectornormalize("-1 -1 0"), 24); //-X -Y + %vec[7] = vectorscale(vectornormalize("0 1 0"), 24); // 0X +Y + %vec[8] = vectorscale(vectornormalize("0 -1 0"), 24); // 0X -Y + //Oh.. long crap + for(%i = 1; %i <= 8; %i++) { + %p = new TracerProjectile() { + dataBlock = napalmSubExplosion; + initialDirection = "0 0 -30"; + initialPosition = vectorAdd(%TPos, "0 0 3"); + sourceSlot = 5; + maxCount = 15; + }; + %p.sourceObject = %g; + %p.vector = %vec[%i]; + %p.count = 1; + } + + case "LaunchSeekfire": + %g = getWord(%args, 0); + %t = getWord(%args, 1); + %stDelay = getWord(%args, 2); + + %proj = createSeekingProjectile("GhostFlameboltMain", "LinearFlareProjectile", VectorAdd(%g.getPosition(), "0 0 5"), "0 0 1", %g, %t, %stDelay); + } +} + +function GOFDoFlameCano(%g, %target) { + if(!isObject(%g) || %g.getState() $= "dead") { + return; + } + %g.setPosition(VectorAdd(%target.player.getPosition(), "0 0 70")); + %Pad = new StaticShape() { + dataBlock = DeployedSpine; + scale = ".1 .1 1"; + position = VectorAdd(%target.player.getPosition(), "0 0 69"); + }; + %g.setMoveState(true); + %Pad.setCloaked(true); + %Pad.schedule(3000, "setPosition", vectorSub(%Pad.getPosition(), "0 0 10")); + %Pad.schedule(4000, "setPosition", vectorSub(%Pad.getPosition(), "0 0 20")); + %Pad.schedule(5000, "setPosition", vectorSub(%Pad.getPosition(), "0 0 30")); + %Pad.schedule(6000, "setPosition", vectorSub(%Pad.getPosition(), "0 0 40")); + %g.schedule(6500, "SetMoveState", false); + %pad.schedule(6500, "Delete"); + //The Vector Crap + schedule(2500, 0, "GOFAttack_FUNC", "Flamecano", %g); +} + +function GOFDoRandomAttacks(%g) { + if(!isObject(%g) || %g.getState() $= "dead") { + return; + } + %rand = getRandom(1,15); + %target = FindValidTarget(%g); + switch(%rand) { + case 1: + if(isObject(%target.player)) { + GOFAttack_FUNC("FireBlast", %g TAB %target.player.getPosition()); + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Time to heat things up "@getTaggedString(%target.name)@"."); + } + else { + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Frightened of my fire? Good."); + } + case 2: + if(isObject(%target.player)) { + GOFAttack_FUNC("Fireball", %g SPC %target.player); + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Lets see how you dodge this, "@getTaggedString(%target.name)@"."); + } + else { + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Frightened of this? Good."); + } + case 3: + if(isObject(%target.player)) { + GOFAttack_FUNC("Fireball", %g SPC %target.player); + schedule(400, 0, GOFAttack_FUNC, "Fireball", %g SPC %target.player); + schedule(800, 0, GOFAttack_FUNC, "Fireball", %g SPC %target.player); + schedule(1200, 0, GOFAttack_FUNC, "Fireball", %g SPC %target.player); + schedule(1600, 0, GOFAttack_FUNC, "Fireball", %g SPC %target.player); + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Flame Storm "@getTaggedString(%target.name)@", cooked up nicely for you."); + } + else { + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": I love Fire.. it's Good your scared."); + } + case 4: + if(isObject(%target.player)) { + GOFAttack_FUNC("FireBlast", %g TAB vectorAdd(%target.player.getPosition(), "0 0 25")); + schedule(400, 0, GOFAttack_FUNC, "FireBlast", %g TAB vectorAdd(%target.player.getPosition(), "0 0 30")); + schedule(800, 0, GOFAttack_FUNC, "FireBlast", %g TAB vectorAdd(%target.player.getPosition(), "0 0 35")); + schedule(1200, 0, GOFAttack_FUNC, "FireBlast", %g TAB vectorAdd(%target.player.getPosition(), "0 0 40")); + schedule(1600, 0, GOFAttack_FUNC, "FireBlast", %g TAB vectorAdd(%target.player.getPosition(), "0 0 45")); + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Engage Dictator Strike!!!"); + } + else { + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Frightened Of Fire? Good."); + } + case 5: + if(isObject(%target.player)) { + GOFDoFlameCano(%g, %target); + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": I Intend Every Moment... FLAMECANO!"); + } + else { + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Oh Well, The Volcanic Explosion Can Wait."); + } + case 6: + if(isObject(%target.player)) { + GOFAttack_FUNC("LaunchSeekfire", %g SPC %target.player SPC 1); + GOFAttack_FUNC("LaunchSeekfire", %g SPC %target.player SPC 1500); + GOFAttack_FUNC("LaunchSeekfire", %g SPC %target.player SPC 3000); + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Clensic Flames Will Persue You "@getTaggedString(%target.name)@"!"); + } + else { + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Darn, I Love Cursed Fire."); + } + case 7: + if(isObject(%target.player)) { + GOFAttack_FUNC("LaunchSeekfire", %g SPC %target.player SPC 1); + GOFAttack_FUNC("LaunchSeekfire", %g SPC %target.player SPC 1500); + GOFAttack_FUNC("LaunchSeekfire", %g SPC %target.player SPC 3000); + GOFAttack_FUNC("LaunchSeekfire", %g SPC %target.player SPC 4500); + GOFAttack_FUNC("LaunchSeekfire", %g SPC %target.player SPC 6000); + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Clensic Flames Will Persue You "@getTaggedString(%target.name)@", MANY FLAMES!"); + } + else { + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Darn, I Love Mega Cursed Fire."); + } + case 8: + if(isObject(%target.player)) { + GOFAttack_FUNC("Fireball", %g SPC %target.player); + for(%i = 1; %i <= 9; %i++) { + %time = %i * 100; + schedule(%time, 0, GOFAttack_FUNC, "Fireball", %g SPC %target.player); + } + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Lets unleash the fireballs upon "@getTaggedString(%target.name)@"!!!"); + } + else { + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": I love Fire.. it's Good your scared."); + } + case 9: + GOFAttack_FUNC("FBSpiral", %g SPC 200); + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Let the flaming spinner begin!"); + case 10: + GOFAttack_FUNC("FBSpiral", %g SPC 200); + schedule(1000, 0, GOFAttack_FUNC, "FBSpiral", %g SPC 200); + schedule(2000, 0, GOFAttack_FUNC, "FBSpiral", %g SPC 200); + schedule(3000, 0, GOFAttack_FUNC, "FBSpiral", %g SPC 200); + schedule(4000, 0, GOFAttack_FUNC, "FBSpiral", %g SPC 200); + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": CLENSE ALL!"); + case 11: + GOFAttack_FUNC("Ultracano", %g SPC "0 0" SPC getTerrainHeight("0 0 0")); + schedule(3000, 0, GOFAttack_FUNC, "Ultracano", %g SPC "0 0" SPC getTerrainHeight("0 0 0")); + schedule(6000, 0, GOFAttack_FUNC, "Ultracano", %g SPC "0 0" SPC getTerrainHeight("0 0 0")); + schedule(9000, 0, GOFAttack_FUNC, "Ultracano", %g SPC "0 0" SPC getTerrainHeight("0 0 0")); + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": ERUPT!!! MY VOLCANO!!!!"); + case 12: + GOFAttack_FUNC("Ultracano", %g SPC "0 0" SPC getTerrainHeight("0 0 0")); + schedule(3000, 0, GOFAttack_FUNC, "Ultracano", %g SPC "0 0" SPC getTerrainHeight("0 0 0")); + schedule(6000, 0, GOFAttack_FUNC, "Ultracano", %g SPC "0 0" SPC getTerrainHeight("0 0 0")); + schedule(9000, 0, GOFAttack_FUNC, "Ultracano", %g SPC "0 0" SPC getTerrainHeight("0 0 0")); + schedule(12000, 0, GOFAttack_FUNC, "Ultracano", %g SPC "0 0" SPC getTerrainHeight("0 0 0")); + schedule(15000, 0, GOFAttack_FUNC, "Ultracano", %g SPC "0 0" SPC getTerrainHeight("0 0 0")); + schedule(18000, 0, GOFAttack_FUNC, "Ultracano", %g SPC "0 0" SPC getTerrainHeight("0 0 0")); + schedule(20000, 0, GOFAttack_FUNC, "Ultracano", %g SPC "0 0" SPC getTerrainHeight("0 0 0")); + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": YES YES YES!!!! SUPERVOLCANO GO!!!!!"); + case 13 or 14 or 15: + if(isObject(%target.player)) { + %store = %target.player.getPosition(); + GOFAttack_FUNC("Ultracano", %g SPC %store); + schedule(3000, 0, GOFAttack_FUNC, "Ultracano", %g SPC %store); + schedule(6000, 0, GOFAttack_FUNC, "Ultracano", %g SPC %store); + schedule(9000, 0, GOFAttack_FUNC, "Ultracano", %g SPC %store); + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Rise Mt. Death... Cleanse "@getTaggedString(%target.name)@"!"); + } + else { + messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Mt Death can await...."); + } + } + schedule(25000,0,"GOFDoRandomAttacks", %g); +} diff --git a/scripts/TWM2/Bosses/GhostOfLightning.cs b/scripts/TWM2/Bosses/GhostOfLightning.cs new file mode 100644 index 0000000..37d1008 --- /dev/null +++ b/scripts/TWM2/Bosses/GhostOfLightning.cs @@ -0,0 +1,192 @@ +//DBS + + +//CREATION + +function SpawnGhostOfLightning(%position) { + %Ghost = new player(){ + Datablock = "LightningGhostArmor"; + }; + %Cpos = vectorAdd(%position, "0 0 5"); + MessageAll('MsgDarkraireturn', "\c4"@$TWM2::BossName["GoL"]@": It's time to show you the shocking power of electricity"); + + %command = "GoLmovetotarget"; + InitiateBoss(%Ghost, "GhostOfLightning"); + + %Ghost.team = 30; + %zname = CollapseEscape("\c7"@$TWM2::BossName["GoL"]@""); + DoGoLAttacks(%ghost); + + %Ghost.target = createTarget(%Ghost, %zname, "", "Derm3", '', %Ghost.team, PlayerSensor); + setTargetSensorData(%Ghost.target, PlayerSensor); + setTargetSensorGroup(%Ghost.target, 30); + setTargetName(%Ghost.target, addtaggedstring(%zname)); + setTargetSkin(%Ghost.target, 'Horde'); + // + %Ghost.type = %type; + %Ghost.setTransform(%cpos); + %Ghost.canjump = 1; + %Ghost.hastarget = 1; + %Ghost.isGhost = 1; + MissionCleanup.add(%Ghost); + schedule(1000, %Ghost, %command, %Ghost); +} + +function GoLmovetotarget(%Ghost){ + if(!isobject(%Ghost)) + return; + if(%Ghost.getState() $= "dead") + return; + %pos = %Ghost.getworldboxcenter(); + %closestClient = ZombieLookForTarget(%Ghost); + %z = getWord(%pos, 2); + if(%z < -300) { + %Ghost.startFade(400, 0, true); + %Ghost.startFade(1000, 0, false); + %Ghost.setPosition(vectorAdd(%ghost.getPosition(), "0 0 500")); + %Ghost.setVelocity("0 0 0"); + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": I'm back!!!"); + } + %closestDistance = getWord(%closestClient,1); + %closestClient = getWord(%closestClient,0).Player; + if(%closestDistance < 20) { + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": I don't think so!"); + //ATTACK + %p = new ShockLanceProjectile() { + dataBlock = GoLShocker; + initialDirection = %Ghost.getMuzzleVector(0); + initialPosition = %Ghost.getMuzzlePoint(0); + sourceObject = %Ghost; + sourceSlot = 0; + targetId = %closestClient; + }; + MissionCleanup.add(%p); + // + %totalDamage = 50; + %closestClient.getDataBlock().damageObject(%closestClient, %ghost, %closestClient.getPosition(), %totalDamage, $DamageType::ShockLance); + // + %Ghost.startFade(400, 0, true); + %Ghost.startFade(1000, 0, false); + %new = VectorAdd(%Ghost.getPosition(), GetRandomPosition(50, 1)); + %new = VectorAdd(%new, "0 0 5"); + %Ghost.setPosition(%new); + %Ghost.setVelocity("0 0 0"); + } + if(%closestDistance <= $Zombie::detectDist){ + %Ghost.hastarget = 0; + %vector = ZgetFacingDirection(%Ghost,%closestClient,%pos); + + %vector = vectorscale(%vector, $Zombie::DForwardSpeed); + + %x = Getword(%vector,0); + %y = Getword(%vector,1); + %z = Getword(%vector,2); + + %vector = %x@" "@%y@" "@%z; + %Ghost.applyImpulse(%pos, %vector); + } + else if(%Ghost.hastarget == 1){ + %Ghost.hastarget = 0; + %Ghost.GhostRmove = schedule(100, %Ghost, "ZSetRandomMove", %Ghost); + } + %Ghost.moveloop = schedule(500, %Ghost, "GoLmovetotarget", %Ghost); +} + +function DoGoLAttacks(%ghost) { + if(!isObject(%ghost) || %ghost.getState() $= "dead") { + return; + } + // + %type = getRandom(1, 5); + switch(%type) { + case 1: + %target = FindValidTarget(%ghost); + if(!isObject(%target.player)) { + schedule(35000, 0, "DoGoLAttacks", %ghost); + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": Meh, no targets for me."); + return; + } + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": Lightning Strike Away!!!"); + %p = discharge2(%target.player.getPosition(),"0 0 -1"); + %p.setEnergyPercentage(1); + addToShock(%p); + %p.schedule(1000,"delete"); + case 2: + %target = FindValidTarget(%ghost); + if(!isObject(%target.player)) { + schedule(35000, 0, "DoGoLAttacks", %ghost); + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": Meh, no targets for me."); + return; + } + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": Watch Electricity Chase You!!!"); + %vec = vectorNormalize(vectorSub(%target.player.getPosition(),%ghost.getPosition())); + %p = new SeekerProjectile() { + dataBlock = IonMissile; + initialDirection = %vec; + initialPosition = %ghost.getMuzzlePoint(0); + sourceObject = %ghost; + sourceSlot = 4; + }; + %beacon = new BeaconObject() { + dataBlock = "SubBeacon"; + beaconType = "vehicle"; + position = %target.player.getWorldBoxCenter(); + }; + %beacon.team = 0; + %beacon.setTarget(0); + MissionCleanup.add(%beacon); + %p.setObjectTarget(%beacon); + DemonMotherMissileFollow(%target.player,%beacon,%p); + case 3: + %target = FindValidTarget(%ghost); + if(!isObject(%target.player)) { + schedule(35000, 0, "DoGoLAttacks", %ghost); + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": Meh, no targets for me."); + return; + } + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": Die Now..."); + %target = %target.player; + %p = new ShockLanceProjectile() { + dataBlock = GoLShocker; + initialDirection = %Ghost.getMuzzleVector(0); + initialPosition = %Ghost.getMuzzlePoint(0); + sourceObject = %Ghost; + sourceSlot = 0; + targetId = %target; + }; + MissionCleanup.add(%p); + // + %totalDamage = 50; + %target.getDataBlock().damageObject(%target, %ghost, %target.getPosition(), %totalDamage, $DamageType::ShockLance); + case 4: + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": Its Storm Time"); + ionStorm(35 , 1000); + case 5: + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": Lightning Missiles For ALL!!"); + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + if(isObject(%cl.player) && %cl.player.getState() !$= "dead") { + %vec = vectorNormalize(vectorSub(%cl.player.getPosition(),%ghost.getPosition())); + %p = new SeekerProjectile() { + dataBlock = IonMissile; + initialDirection = %vec; + initialPosition = %ghost.getMuzzlePoint(0); + sourceObject = %ghost; + sourceSlot = 4; + }; + %beacon = new BeaconObject() { + dataBlock = "SubBeacon"; + beaconType = "vehicle"; + position = %cl.player.getWorldBoxCenter(); + }; + %beacon.team = 0; + %beacon.setTarget(0); + MissionCleanup.add(%beacon); + %p.setObjectTarget(%beacon); + DemonMotherMissileFollow(%cl.player,%beacon,%p); + } + } + } + // + schedule(30000, 0, "DoGoLAttacks", %ghost); +} diff --git a/scripts/TWM2/Bosses/LordRog.cs b/scripts/TWM2/Bosses/LordRog.cs new file mode 100644 index 0000000..a1ad5e7 --- /dev/null +++ b/scripts/TWM2/Bosses/LordRog.cs @@ -0,0 +1,325 @@ +function SpawnLordRog(%position) { + %Zombie = new player(){ + Datablock = "LordRogZombieArmor"; + }; + %Cpos = vectorAdd(%position, "0 0 5"); + MessageAll('MsgDarkraireturn', "\c4"@$TWM2::ZombieName[8]@": I AM ALIVE!!! I SHALL KILL YOU ALL"); + + %zombie.iszombie = 1; + StartLRAbilities(%zombie); + schedule(5000, 0, LordRogAttack_FUNC, "ZombieSummon", %zombie); + + %command = "LordRogmovetotarget"; + + %zombie.ticks = 0; + InitiateBoss(%zombie, "LordRog"); + + %Zombie.team = 30; + %zname = $TWM2::ZombieName[8]; // <- To Hosts, Enjoy, You can + //Change the Zombie Names now!!! + %zombie.target = createTarget(%zombie, %zname, "", "Derm3", '', %zombie.team, PlayerSensor); + setTargetSensorData(%zombie.target, PlayerSensor); + setTargetSensorGroup(%zombie.target, 30); + setTargetName(%zombie.target, addtaggedstring(%zname)); + setTargetSkin(%zombie.target, 'Horde'); + // + %zombie.type = %type; + %Zombie.setTransform(%cpos); + %zombie.canjump = 1; + %zombie.hastarget = 1; + %zombie.isZombie = 1; + MissionCleanup.add(%Zombie); + schedule(1000, %zombie, %command, %zombie); +} + +function LordRogmovetotarget(%zombie){ + if(!isobject(%zombie)) + return; + if(%zombie.getState() $= "dead") + return; + %pos = %zombie.getworldboxcenter(); + %closestClient = ZombieLookForTarget(%zombie); + %z = getWord(%pos, 2); + if(%z < -300) { + %zombie.startFade(400, 0, true); + %zombie.startFade(1000, 0, false); + %zombie.setPosition(vectorAdd(vectoradd(%closestclient.player.getPosition(), "0 0 20"), getRandomPosition(25, 1))); + %zombie.setVelocity("0 0 0"); + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::ZombieName[8]@": You think I will fall to my death!?!?"); + } + %closestDistance = getWord(%closestClient,1); + %closestClient = getWord(%closestClient,0).Player; + if(%closestDistance <= $zombie::detectDist){ + + //Sword Mount / Unmount + if(%closestDistance < 12) { + if(!%zombie.ImageMounted) { + %zombie.ImageMounted = 1; + %zombie.mountImage(BoVSwing, 7); + ServerPlay3D(BlasterSwitchSound, %zombie.getPosition()); + } + } + else { + %zombie.unMountImage(7); + %zombie.ImageMounted = 0; + } + + if(%zombie.hastarget != 1){ + serverPlay3d("ZombieHOWL",%zombie.getWorldBoxCenter()); + %zombie.hastarget = 1; + } + %chance = (getrandom() * 20); + if(%chance >= 19) + serverPlay3d("ZombieMoan",%zombie.getWorldBoxCenter()); + + %vector = ZgetFacingDirection(%zombie,%closestClient,%pos); + + %vector = vectorscale(%vector, $Zombie::DForwardSpeed); + %upvec = "150"; + %x = Getword(%vector,0); + %y = Getword(%vector,1); + %z = Getword(%vector,2); + if(%z >= ($Zombie::DForwardSpeed)) + %upvec = (%upvec * 5); + %vector = %x@" "@%y@" "@%upvec; + %zombie.applyImpulse(%pos, %vector); + } + else if(%zombie.hastarget == 1){ + %zombie.hastarget = 0; + %zombie.zombieRmove = schedule(100, %zombie, "ZSetRandomMove", %zombie); + } + %zombie.moveloop = schedule(500, %zombie, "LordRogmovetotarget", %zombie); +} + +function LordRogAttack_FUNC(%att, %args) { + switch$(%att) { + case "ZombieSummon": + %z = getWord(%args, 0); + if(!isobject(%z) || %z.getState() $= "dead") { + return; + } + schedule(30000, 0, LordRogAttack_FUNC, "ZombieSummon", %z); + //-------------------- + %type = getRandomZombieType("1 2 3 5 9 12 13 15 17"); //omit 4 in place of 17: Demon -> Elite Demon + messageall('RogMsg',"\c4"@$TWM2::ZombieName[8]@": Attack my target!"); + for(%i = 0; %i < 5; %i++) { + %pos = vectoradd(%z.getPosition(), getRandomPosition(10,1)); + %fpos = vectoradd("0 0 5",%pos); + StartAZombie(%fpos, %type); + } + %z.setMoveState(true); + %z.setActionThread($Zombie::RAAMThread, true); + %z.schedule(3500, "setMoveState", false); + + case "DropshipReinforce": + %z = getWord(%args, 0); + if(!isobject(%z) || %z.getState() $= "dead") { + return; + } + + %type = getRandomZombieType("1 2 3 5 9 12 13 15 17"); + MessageAll('MessageAll', "\c4"@$TWM2::ZombieName[8]@": Additional Reinforcements!!! NOW!"); + %typeCaller = %type SPC %type SPC %type SPC %type; + %callPos = vectorAdd(%z.getPosition(), "2000 0 400"); + spawnHunterDropship(%callPos, "AA", %typeCaller); + + case "TwinLaunch": + %z = getWord(%args, 0); + %target = getWord(%args, 1); + + if(!isobject(%z) || %z.getState() $= "dead") { + return; + } + if(!isobject(%target) || %target.getState() $= "dead") { + return; + } + + %SPos1 = vectorAdd(%z.getPosition(), "1 0 0"); + %SPos2 = vectorAdd(%z.getPosition(), "-1 0 0"); + %p1 = new SeekerProjectile() { + dataBlock = LordRogStiloutte; + initialDirection = "0 0 1"; + initialPosition = %SPos1; + sourceObject = %z; + sourceSlot = 6; + }; + %p2 = new SeekerProjectile() { + dataBlock = LordRogStiloutte; + initialDirection = "0 0 1"; + initialPosition = %SPos2; + sourceObject = %z; + sourceSlot = 6; + }; + MissionCleanup.add(%p1); + MissionCleanup.add(%p2); + schedule(5000, 0, "WindshearAttack_FUNC", "MissileDrop", %target SPC %p1); + schedule(5000, 0, "WindshearAttack_FUNC", "MissileDrop", %target SPC %p2); + + case "LaunchStorm": + %z = getWord(%args, 0); + %target = getWord(%args, 1); + LordRogAttack_FUNC("TwinLaunch", %z SPC %target); + schedule(1000, 0, LordRogAttack_FUNC, "TwinLaunch", %z SPC %target); + schedule(2000, 0, LordRogAttack_FUNC, "TwinLaunch", %z SPC %target); + + case "LaserStrike": + %z = getWord(%args, 0); + %t = getWord(%args, 1); + if(!isObject(%t) || %t.getState() $= "dead") { + %z.Storming = 0; + return; + } + if(!isObject(%z) || %z.getState() $= "dead") { + return; + } + %z.laserStormSount++; + if(%z.laserStormSount < 40) { + %vec = vectorsub(%t.getworldboxcenter(), %z.getMuzzlePoint(6)); + %vec = vectoradd(%vec, vectorscale(%t.getvelocity(), vectorlen(%vec)/100)); + %p = new LinearFlareProjectile() { + dataBlock = LaserShot; + initialDirection = %vec; + initialPosition = %z.getMuzzlePoint(6); + sourceObject = %z; + sourceSlot = 6; + }; + MissionCleanup.add(%p); + } + else { + %z.Storming = 0; + return; + } + schedule(100, 0, LordRogAttack_FUNC, "LaserStrike", %z SPC %t); + + case "MetrosMaul": + %t = getWord(%args, 0); + %fpos = vectoradd(%t.getposition(), getRandomposition(50,0)); + %pos2 = vectoradd(%fpos, "0 0 700"); + schedule(500, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + schedule(1000, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + schedule(1500, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + + case "MeteorOblivion": + %t = getWord(%args, 0); + %fpos = vectoradd(%t.getposition(), getRandomposition(50, 0)); + %pos2 = vectoradd(%fpos, "0 0 700"); + schedule(500, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + schedule(1000, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + schedule(1500, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + schedule(2000, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + schedule(2500, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + schedule(3000, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + schedule(3500, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + schedule(4000, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + schedule(4500, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + schedule(5000, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + schedule(5500, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + schedule(6000, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + schedule(6500, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + schedule(7000, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + schedule(7500, 0, spawnprojectile, JTLMeteorStormFireball, GrenadeProjectile, %pos2, "0 0 -10"); + + case "StaticDischarge": + %z = getWord(%args, 0); + if(!isobject(%z) || %z.getState() $= "dead") { + return; + } + %z.setMoveState(true); + %z.schedule(7000, setMoveState, false); + %TargetSearchMask = $TypeMasks::PlayerObjectType; + %c = createEmitter(%z.getPosition(), FlashLEmitter, "1 0 0"); //Rotate it + %c.schedule(1000, delete); + InitContainerRadiusSearch(%z.getPosition(), 200, %TargetSearchMask); + while ((%potentialTarget = ContainerSearchNext()) != 0){ + if (%potentialTarget.getPosition() != %z.getPosition() && !%potentialtarget.client.ignoredbyZombs) { + %potentialTarget.staticTicks = 0; + LordRogAttack_FUNC("SCDLoop", %potentialTarget); + } + } + + case "SCDLoop": + %obj = getWord(%args, 0); + if(!isobject(%obj) || %obj.getState() $= "dead") { + return; + } + if(%obj.staticTicks > 15) { + %obj.setMoveState(false); + return; + } + %c = createEmitter(%obj.getPosition(), PBCExpEmitter, "1 0 0"); //Rotate it + %c.schedule(1000, delete); + %obj.setMoveState(true); + %obj.staticTicks++; + %obj.damage(0, %obj.getPosition(), 0.05, $DamageType::Zombie); + schedule(1000, 0, LordRogAttack_FUNC, "SCDLoop", %obj); + } +} + +function StartLRAbilities(%zombie) { + if(!isobject(%zombie) || %zombie.getState() $= "dead") { + return; + } + %z = %zombie; //< Im lazy =-P + %z.setVelocity("0 0 0"); + %rand = getRandom(1, 9); + switch(%rand) { + case 1: + %target = FindValidTarget(%z); + if(isObject(%target.player) && !%target.ignoredbyZombs) { + MessageAll('MessageAll', "\c4"@$TWM2::ZombieName[8]@": Launch!"); + LordRogAttack_FUNC("TwinLaunch", %z SPC %target.player); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::ZombieName[8]@": Fools, you cannot withstand my power!"); + } + + case 2: + %target = FindValidTarget(%z); + if(isObject(%target.player) && !%target.ignoredbyZombs) { + %z.laserStormSount = 0; + MessageAll('MessageAll', "\c4"@$TWM2::ZombieName[8]@": Laser Storm Begin!"); + LordRogAttack_FUNC("LaserStrike", %z SPC %target.player); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::ZombieName[8]@": Fools, you cannot withstand my power!"); + } + + case 3: + %target = FindValidTarget(%z); + if(isObject(%target.player) && !%target.ignoredbyZombs) { + MessageAll('MessageAll', "\c4"@$TWM2::ZombieName[8]@": Metros Maul!"); + LordRogAttack_FUNC("MetrosMaul", %target.player); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::ZombieName[8]@": Fools, you cannot withstand my power!"); + } + + case 4: + %target = FindValidTarget(%z); + if(isObject(%target.player) && !%target.ignoredbyZombs) { + MessageAll('MessageAll', "\c4"@$TWM2::ZombieName[8]@": Storm Begins!"); + LordRogAttack_FUNC("LaunchStorm", %z SPC %target.player); + } + + case 5 or 6: + LordRogAttack_FUNC("StaticDischarge", %z); + MessageAll('MessageAll', "\c4"@$TWM2::ZombieName[8]@": Static Discharge!"); + + case 7: + %target = FindValidTarget(%z); + if(isObject(%target.player) && !%target.ignoredbyZombs) { + MessageAll('MessageAll', "\c4"@$TWM2::ZombieName[8]@": Metros EXTREMITY!!!!"); + LordRogAttack_FUNC("MeteorOblivion", %target.player); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::ZombieName[8]@": Fools, you cannot withstand my power!"); + } + + case 8: + LordRogAttack_FUNC("DropshipReinforce", %z); + + default: + LordRogAttack_FUNC("DropshipReinforce", %z); + } + schedule(30000, 0, "StartLRAbilities", %zombie); +} diff --git a/scripts/TWM2/Bosses/LordVardison.cs b/scripts/TWM2/Bosses/LordVardison.cs new file mode 100644 index 0000000..2a7a8e2 --- /dev/null +++ b/scripts/TWM2/Bosses/LordVardison.cs @@ -0,0 +1,954 @@ +//LORD \/ARDISON & Dark Archmage Vardison +//THIS BOSS WILL MURDER OCCULTBADBOY +//Yeah, he really will +function VardisonLaserBallMissile::OnExplode(%data, %proj, %pos, %mod) { + //LaserBall + %ball = CreateEmitter(%pos, "MiniShadowBallEmitter", "0 0 0 0"); + %ball.schedule(10000, "Delete"); + LaserBallStrike(vectorAdd(%pos, "0 0 3"), 0); +} + +function LaserBallStrike(%position, %count) { + %count++; + if(%count > 100) { + %p = new LinearFlareProjectile() { + dataBlock = VardisonSubShadowBomb; + initialDirection = "0 0 -1"; + initialPosition = %position; + }; + return; //stop here + } + else { + if(%count % 3 == 0) { //multiples of 3 == strike + %p = new TracerProjectile() { + dataBlock = PlasmaCannonMainProj; + initialDirection = vectorAdd(%postition, getRandomPosition(25,0)); + initialPosition = %position; + }; + } + } + schedule(100, 0, "LaserBallStrike", %position, %count); +} + +function StartDAVardison(%pos) { + %Vardison = new player() { + Datablock = "DarkArchmageVardisonArmor"; + }; + %Cpos = vectorAdd(%pos, "0 0 5"); + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["DAVardison"]@": Rise forces of darkness, as our enemies shall face their demise"); + + %command = "DAVardisonmovetotarget"; + %Vardison.ticks = 0; + InitiateBoss(%Vardison, "DAVardison"); + + %Vardison.team = 30; + %zname = CollapseEscape("\c7"@$TWM2::BossName["DAVardison"]@""); // <- To Hosts, Enjoy, You can + //Change the Demon Names now!!! + %Vardison.target = createTarget(%Vardison, %zname, "", "Derm3", '', %Vardison.team, PlayerSensor); + setTargetSensorData(%Vardison.target, PlayerSensor); + setTargetSensorGroup(%Vardison.target, 30); + setTargetName(%Vardison.target, addtaggedstring(%zname)); + setTargetSkin(%Vardison.target, 'Inferno'); + // + %Vardison.setPosition(%cpos); + %Vardison.canjump = 1; + %Vardison.hastarget = 1; + MissionCleanup.add(%Vardison); + schedule(1000, %Vardison, %command, %Vardison); + + DAVardisonAttacks(%Vardison); +} + +function StartVardison1(%pos) { + + %Vardison = new player(){ + Datablock = "VardisonStage1Armor"; + }; + %Cpos = vectorAdd(%pos, "0 0 5"); + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["Vardison"]@": "@$TWM2::BossName["Vardison"]@", Checking into duty, and about to slaughter some fuckin' enemies!!!"); + + %command = "Vardison1movetotarget"; + %Vardison.ticks = 0; + InitiateBoss(%Vardison, "Vardison1"); + + %Vardison.team = 30; + %zname = CollapseEscape("\c7"@$TWM2::BossName["Vardison"]@""); // <- To Hosts, Enjoy, You can + //Change the Demon Names now!!! + %Vardison.target = createTarget(%Vardison, %zname, "", "Derm3", '', %Vardison.team, PlayerSensor); + setTargetSensorData(%Vardison.target, PlayerSensor); + setTargetSensorGroup(%Vardison.target, 30); + setTargetName(%Vardison.target, addtaggedstring(%zname)); + setTargetSkin(%Vardison.target, 'Inferno'); + // + %Vardison.setPosition(%cpos); + %Vardison.canjump = 1; + %Vardison.hastarget = 1; + MissionCleanup.add(%Vardison); + schedule(1000, %Vardison, %command, %Vardison); + + VardisonAttacks(%Vardison); +} + +function StartVardison2(%pos) { + %StartPos = VectorAdd(%pos, "0 0 100"); + %team = 30; + %rotation = "1 0 0 0"; + %skill = 10; + + %Drone = new FlyingVehicle() { + dataBlock = VardisonStage2Flyer; + position = %StartPos; + rotation = %rotation; + team = %team; + }; + MissionCleanUp.add(%Drone); + + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["Vardison"]@": HA! I'm nowhere near finished with you, Lets take this to the skies.. shall we."); + + setTargetSensorGroup(%Drone.getTarget(), %team); + + %Drone.isdrone = 1; + %drone.dodgeGround = 0; + + %drone.isace = 1; + + %drone.skill = 0.2 + (%skill / 12.5); + + schedule(100, 0, "DroneForwardImpulse", %drone); //special impulse + schedule(101, 0, "DronefindTarget", %drone); + schedule(102, 0, "DroneScanGround", %drone); + + InitiateBoss(%drone, "Vardison2"); + VardisonDroneAttacks(%drone); +} + +function StartVardison3(%pos) { + %Vardison = new player(){ + Datablock = "VardisonStage3Armor"; + }; + %Cpos = vectorAdd(%pos, "0 0 5"); + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["Vardison"]@": Now you will see the full power of a shadow demon!!!"); + + %command = "Vardison3movetotarget"; + %Vardison.ticks = 0; + InitiateBoss(%Vardison, "Vardison3"); + + %Vardison.team = 30; + %zname = CollapseEscape("\c7"@$TWM2::BossName["Vardison"]@""); // <- To Hosts, Enjoy, You can + //Change the Demon Names now!!! + %Vardison.target = createTarget(%Vardison, %zname, "", "Derm3", '', %Vardison.team, PlayerSensor); + setTargetSensorData(%Vardison.target, PlayerSensor); + setTargetSensorGroup(%Vardison.target, 30); + setTargetName(%Vardison.target, addtaggedstring(%zname)); + setTargetSkin(%Vardison.target, 'Inferno'); + // + %Vardison.setTransform(%cpos); + %Vardison.canjump = 1; + %Vardison.hastarget = 1; + MissionCleanup.add(%Vardison); + schedule(1000, %Vardison, %command, %Vardison); + + VardisonDemonAttacks(%Vardison); + + //SpawnVardHelper(%Vardison, vectorAdd(%Vardison.getPosition(), "15 0 100")); + +} + +function DAVardisonmovetotarget(%Demon){ + if(!isobject(%Demon)) + return; + if(%Demon.getState() $= "dead") + return; + %pos = %Demon.getworldboxcenter(); + %closestClient = ZombieLookForTarget(%Demon); + %z = getWord(%pos, 2); + if(%z < -300) { + %Demon.startFade(400, 0, true); + %Demon.startFade(1000, 0, false); + %Demon.setPosition(vectorAdd(vectoradd(%closestclient.player.getPosition(), "0 0 20"), getRandomPosition(25, 1))); + %Demon.setVelocity("0 0 0"); + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["DAVardison"]@": I'm back...."); + } + %closestDistance = getWord(%closestClient,1); + %closestClient = getWord(%closestClient,0).Player; + if(%closestDistance <= $Zombie::detectDist){ + if(%closestDistance < 15) { + if(!%closestClient.vardKilling) { + %closestClient.vardKilling = 1; + DoVardisonSuperCloseKill(%Demon, %closestClient, 0); + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["DAVardison"]@": Die.... Human...."); + } + } + if(%Demon.hastarget != 1){ + //LZDoYell(%Demon); + %Demon.hastarget = 1; + } + + %vector = ZgetFacingDirection(%Demon,%closestClient,%pos); + + %vector = vectorscale(%vector, $Zombie::DForwardSpeed); + %upvec = "150"; + %x = Getword(%vector,0); + %y = Getword(%vector,1); + %z = Getword(%vector,2); + if(%z >= ($Zombie::DForwardSpeed)) + %upvec = (%upvec * 5); + %vector = %x@" "@%y@" "@%upvec; + %Demon.applyImpulse(%pos, %vector); + } + else if(%Demon.hastarget == 1){ + %Demon.hastarget = 0; + %Demon.DemonRmove = schedule(100, %Demon, "ZSetRandomMove", %Demon); + } + %Demon.moveloop = schedule(500, %Demon, "DAVardisonmovetotarget", %Demon); +} + +function Vardison1movetotarget(%Demon){ + if(!isobject(%Demon)) + return; + if(%Demon.getState() $= "dead") + return; + %pos = %Demon.getworldboxcenter(); + %closestClient = ZombieLookForTarget(%Demon); + %z = getWord(%pos, 2); + if(%z < -300) { + %Demon.startFade(400, 0, true); + %Demon.startFade(1000, 0, false); + %Demon.setPosition(vectorAdd(vectoradd(%closestclient.player.getPosition(), "0 0 20"), getRandomPosition(25, 1))); + %Demon.setVelocity("0 0 0"); + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["Vardison"]@": I'm back...."); + } + %closestDistance = getWord(%closestClient,1); + %closestClient = getWord(%closestClient,0).Player; + if(%closestDistance <= $Zombie::detectDist){ + if(%closestDistance < 15) { + if(!%closestClient.vardKilling) { + %closestClient.vardKilling = 1; + DoVardisonSuperCloseKill(%Demon, %closestClient, 0); + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["Vardison"]@": Die.... Human...."); + } + } + if(%Demon.hastarget != 1){ + //LZDoYell(%Demon); + %Demon.hastarget = 1; + } + + %vector = ZgetFacingDirection(%Demon,%closestClient,%pos); + + %vector = vectorscale(%vector, $Zombie::DForwardSpeed); + %upvec = "150"; + %x = Getword(%vector,0); + %y = Getword(%vector,1); + %z = Getword(%vector,2); + if(%z >= ($Zombie::DForwardSpeed)) + %upvec = (%upvec * 5); + %vector = %x@" "@%y@" "@%upvec; + %Demon.applyImpulse(%pos, %vector); + } + else if(%Demon.hastarget == 1){ + %Demon.hastarget = 0; + %Demon.DemonRmove = schedule(100, %Demon, "ZSetRandomMove", %Demon); + } + %Demon.moveloop = schedule(500, %Demon, "Vardison1movetotarget", %Demon); +} + +function Vardison3movetotarget(%Demon){ + if(!isobject(%Demon)) + return; + if(%Demon.getState() $= "dead") + return; + %pos = %Demon.getworldboxcenter(); + %closestClient = ZombieLookForTarget(%Demon); + %z = getWord(%pos, 2); + if(%z < -300) { + %Demon.startFade(400, 0, true); + %Demon.startFade(1000, 0, false); + %Demon.setPosition(vectorAdd(vectoradd(%closestclient.getPosition(), "0 0 20"), getRandomPosition(25, 1))); + %Demon.setVelocity("0 0 0"); + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["Vardison"]@": I'm back...."); + } + %closestDistance = getWord(%closestClient,1); + %closestClient = getWord(%closestClient,0).Player; + if(%closestDistance <= $Zombie::detectDist){ + if(%closestDistance < 10) { + %closestClient.scriptKill(0); + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["Vardison"]@": DIE!!!!!!"); + } + if(%Demon.hastarget != 1){ + %Demon.hastarget = 1; + } + + %vector = ZgetFacingDirection(%Demon,%closestClient,%pos); + + %vector = vectorscale(%vector, $Zombie::DForwardSpeed*1.8); + %upvec = "150"; + %x = Getword(%vector,0); + %y = Getword(%vector,1); + %z = Getword(%vector,2); + if(%z >= ($Zombie::DForwardSpeed)) + %upvec = (%upvec * 5); + %vector = %x@" "@%y@" "@%upvec; + %Demon.applyImpulse(%pos, %vector); + } + else if(%Demon.hastarget == 1){ + %Demon.hastarget = 0; + %Demon.DemonRmove = schedule(100, %Demon, "ZSetRandomMove", %Demon); + } + %Demon.moveloop = schedule(500, %Demon, "Vardison3movetotarget", %Demon); +} + +//ATTACKS + +function DoVardisonSuperCloseKill(%source, %target, %count) { + %count++; + if(!isObject(%source) || %source.getState() $= "dead") { + %target.setMoveState(false); + return; + } + %source.setMoveState(true); + %target.setMoveState(true); + %target.clearInventory(); //ha, no guns for You! + //lift + if(%count <= 15) { + %ZPos = %count * 0.025; + %newpos = vectoradd(%target.getPosition(),"0 0 "@%ZPos@""); + %target.setTransform(%newpos); + %target.setvelocity("0 0 0"); + } + else if(%count == 16) { + //MessageAll('MsgDIE', "\c4"@%source.client.namebase@": You're so.... weak..."); + %newpos = vectoradd(%target.getPosition(),"0 0 "@%ZPos * -1@""); + %target.setTransform(%newpos); + %target.setvelocity("0 0 0"); + } + else if(%count == 17) { + %target.setvelocity("1000 1000 1000"); + %target.blowup();//BAM! + ServerPlay3d(BOVHitSound, %target.getPosition()); + ServerPlay3d(BOVHitSound, %target.getPosition()); + ServerPlay3d(BOVHitSound, %target.getPosition()); + %target.damage(%source, %target.getposition(), 9999, $DamageType::BladeOfVengance); + %source.setMoveState(false); + return; + } + schedule(100, 0, "DoVardisonSuperCloseKill", %source, %target, %count); +} + +function GOVDoFlameCano(%g, %target) { + if(!isObject(%g) || %g.getState() $= "dead") { + return; + } + %g.setPosition(VectorAdd(%target.getPosition(), "0 0 70")); + %Pad = new StaticShape() { + dataBlock = DeployedSpine; + scale = ".1 .1 1"; + position = VectorAdd(%target.getPosition(), "0 0 69"); + }; + %g.setMoveState(true); + %Pad.setCloaked(true); + %Pad.schedule(3000, "setPosition", vectorSub(%Pad.getPosition(), "0 0 10")); + %Pad.schedule(4000, "setPosition", vectorSub(%Pad.getPosition(), "0 0 20")); + %Pad.schedule(5000, "setPosition", vectorSub(%Pad.getPosition(), "0 0 30")); + %Pad.schedule(6000, "setPosition", vectorSub(%Pad.getPosition(), "0 0 40")); + %g.schedule(6500, "SetMoveState", false); + %pad.schedule(6500, "Delete"); + //The Vector Crap + schedule(2500,0,"DropFlameCano2", %g, %target); +} + +function DropFlameCano2(%g, %target) { + if(!isObject(%g) || %g.getState() $= "dead") { + return; + } + //First, Specify All Directions + %vec[1] = vectorscale(vectornormalize("1 0 0"), 24); // +X 0Y + %vec[2] = vectorscale(vectornormalize("1 1 0"), 24); // +X +Y + %vec[3] = vectorscale(vectornormalize("1 -1 0"), 24); // +X -Y + %vec[4] = vectorscale(vectornormalize("-1 0 0"), 24); // -X 0Y + %vec[5] = vectorscale(vectornormalize("-1 1 0"), 24); // -X +Y + %vec[6] = vectorscale(vectornormalize("-1 -1 0"), 24); //-X -Y + %vec[7] = vectorscale(vectornormalize("0 1 0"), 24); // 0X +Y + %vec[8] = vectorscale(vectornormalize("0 -1 0"), 24); // 0X -Y + //Oh.. long crap + for(%i = 1; %i <= 8; %i++) { + %p = new LinearFlareProjectile() { + dataBlock = ShadowBomb; + initialDirection = "0 0 -30"; + initialPosition = vectorAdd(%g.getPosition(), "0 0 -3"); + sourceObject = %g; + sourceSlot = 5; + }; + %p.vector = %vec[%i]; + %p.count = 1; + %p.MaxExplode = 15; + } +} + +//The evilness Begins Here +function DAVardisonAttacks(%boss) { + if(!isObject(%boss) || %boss.getState() $= "dead") { + return; + } + schedule(23500, 0, "DAVardisonAttacks", %boss); + %attack = getRandom(1, 10); + switch(%attack) { + case 1: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + VardisonAttack(%boss, "NMM", %target); + } + case 2: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + VardisonAttack(%boss, "LBM", %target); + } + case 3: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + VardisonAttack(%boss, "ShadowBombDirect", %target SPC 2); + } + case 4: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + GOVDoFlameCano(%boss, %target); + } + case 5: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + VardisonAttack(%boss, "ShadowBombDirect", %target SPC 4); + } + case 6: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + for(%i = 0; %i < 10; %i++) { + %timeInt = %i * 200; + schedule(%timeInt, 0, VardisonAttack, %boss, "ShadowBombLaunchAbove", %target SPC 4); + } + } + case 7: + %boss.setMoveState(true); + %vS[0] = "10 10 0"; + %vS[1] = "-10 10 0"; + %vS[2] = "10 -10 0"; + %vS[3] = "-10 -10 0"; + for(%i = 0; %i < 4; %i++) { + CreateDemon(vectorAdd(%boss.getPosition(), %vS[%i])); + } + %boss.schedule(5000, setMoveState, false); + case 8: + %boss.setMoveState(true); + //four charge-up beams + createLifeEmitter(%boss.getPosition(), PrebeamEmitter, 5000); + createLifeEmitter(%boss.getPosition(), PrebeamEmitter, 5000); + createLifeEmitter(%boss.getPosition(), PrebeamEmitter, 5000); + createLifeEmitter(%boss.getPosition(), PrebeamEmitter, 5000); + //the actual attack + for(%i = 0; %i < 50; %i++) { + %timeAtt = 5000 + (%i *150); + //-------------------------- + %vec = %boss.GetMuzzleVector(4); + %pos = %boss.GetMuzzlePoint(4); + schedule(%timeAtt, 0, VardisonAttack, %boss, "HyperspeedPlasmaBolt", %pos TAB %vec); + } + %boss.schedule(12500, setMoveState, false); + case 9: + VardisonAttack(%boss, "LinearFlameWall"); + case 10: + VardisonAttack(%boss, "SeekingRapiers", %target); + } +} + +function VardisonAttacks(%boss) { + if(!isObject(%boss) || %boss.getState() $= "dead") { + return; + } + schedule(23500, 0, "VardisonAttacks", %boss); + %attack = getRandom(1, 8); + switch(%attack) { + case 1: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + VardisonAttack(%boss, "NMM", %target); + } + case 2: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + VardisonAttack(%boss, "LBM", %target); + } + case 3: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + VardisonAttack(%boss, "ShadowBombDirect", %target SPC 2); + } + case 4: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + GOVDoFlameCano(%boss, %target); + } + case 5: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + VardisonAttack(%boss, "ShadowBombDirect", %target SPC 4); + } + case 6: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + for(%i = 0; %i < 10; %i++) { + %timeInt = %i * 200; + schedule(%timeInt, 0, VardisonAttack, %boss, "ShadowBombLaunchAbove", %target SPC 4); + } + } + case 7: + %boss.setMoveState(true); + %vS[0] = "10 10 0"; + %vS[1] = "-10 10 0"; + %vS[2] = "10 -10 0"; + %vS[3] = "-10 -10 0"; + for(%i = 0; %i < 4; %i++) { + CreateDemon(vectorAdd(%boss.getPosition(), %vS[%i])); + } + %boss.schedule(5000, setMoveState, false); + case 8: + %boss.setMoveState(true); + //four charge-up beams + createLifeEmitter(%boss.getPosition(), PrebeamEmitter, 5000); + createLifeEmitter(%boss.getPosition(), PrebeamEmitter, 5000); + createLifeEmitter(%boss.getPosition(), PrebeamEmitter, 5000); + createLifeEmitter(%boss.getPosition(), PrebeamEmitter, 5000); + //the actual attack + for(%i = 0; %i < 50; %i++) { + %timeAtt = 5000 + (%i *150); + //-------------------------- + %vec = %boss.GetMuzzleVector(4); + %pos = %boss.GetMuzzlePoint(4); + schedule(%timeAtt, 0, VardisonAttack, %boss, "HyperspeedPlasmaBolt", %pos TAB %vec); + } + %boss.schedule(12500, setMoveState, false); + } +} + +function VardisonDroneAttacks(%boss) { + if(!isObject(%boss)) { + return; + } + schedule(10000, 0, "VardisonDroneAttacks", %boss); + %attack = getRandom(1,3); + switch(%attack) { + case 1: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + VardisonAttack(%boss, "NMM", %target.player); + } + case 2: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + VardisonAttack(%boss, "LBM", %target); + } + case 3: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + VardisonAttack(%boss, "SuperLaser", %target); + } + } +} + +function VardisonDemonAttacks(%boss) { + if(!isObject(%boss) || %boss.getState() $= "dead") { + return; + } + //create a mini-demon + CreateDemon(vectorAdd(%boss.getPosition(), getRandomPosition(10, 1))); + // + %boss.setMoveState(true); + schedule(15000, 0, "VardisonDemonAttacks", %boss); + %attack = getRandom(1,8); + switch(%attack) { + case 1: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + VardisonAttack(%boss, "LBM", %target); + schedule(2500, 0, VardisonAttack, %boss, "LBM", %target); + schedule(3500, 0, VardisonAttack, %boss, "LBM", %target); + schedule(5000, 0, VardisonAttack, %boss, "LBM", %target); + schedule(5100, 0, VardisonAttack, %boss, "LBM", %target); + %boss.schedule(5100, "SetMoveState", false); + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["Vardison"]@": I've got some missiles for you "@getTaggedString(%target.client.name)@"."); + return; + } + %boss.schedule(1, "SetMoveState", false); + case 2: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + VardisonAttack(%boss, "NMM", %target.player); + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["Vardison"]@": It's time to invoke darkness upon "@getTaggedString(%target.name)@"."); + %boss.schedule(1000, "SetMoveState", false); + return; + } + %boss.schedule(1, "SetMoveState", false); + case 3: + setgravity(-1000); + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["Vardison"]@": I'll disorient you all!"); + schedule(3000, 0, "SetGravity", 1000); + schedule(7500, 0, "SetGravity", -20); + %boss.schedule(7500, "SetMoveState", false); + //%boss.InvokeLoop = InvokeStillwallLoop(%boss); + schedule(7500, 0, "Cancel", %boss.InvokeLoop); + case 4: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + VardisonAttack(%boss, "LaserDrop", %target); + %boss.schedule(3000, "SetMoveState", false); + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["Vardison"]@": Your time has come "@getTaggedString(%target.client.name)@"."); + return; + } + %boss.schedule(1, "SetMoveState", false); + case 5: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + %target = %target.player; + for(%i = 0; %i < 25; %i++) { + schedule(50+(%i*150), 0, VardisonAttack, %boss, "SuperLaser", %target); + } + %boss.schedule(10000, "SetMoveState", false); + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["Vardison"]@": BLAAAAHAAHAHAHAAHA!!!"); + return; + } + %boss.schedule(1, "SetMoveState", false); + case 6: + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %target = ClientGroup.getObject(%i); + if(isObject(%target.player)) { + VardisonAttack(%boss, "NMM", %target.player); + } + } + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["Vardison"]@": All must suffer!!!"); + %boss.schedule(1000, "SetMoveState", false); + return; + case 7: + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %target = ClientGroup.getObject(%i); + if(isObject(%target.player)) { + %target = %target.player; + for(%l = 0; %l < 25; %l++) { + schedule(50+(%l*150), 0, VardisonAttack, %boss, "SuperLaser", %target); + } + } + } + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["Vardison"]@": Everyone DIES NOW!!!!"); + %boss.schedule(10000, "SetMoveState", false); + return; + case 8: + %target = FindValidTarget(%boss); + if(isObject(%target.player)) { + for(%i = 0; %i < 15; %i++) { + %time = %i * 150; + %mType = getRandom(0, 1); + switch(%mType) { + case 0: + schedule(%time, 0, VardisonAttack, %boss, "NMM", %target.player); + case 1: + schedule(%time, 0, VardisonAttack, %boss, "LBM", %target.player); + default: + schedule(%time, 0, VardisonAttack, %boss, "NMM", %target.player); + } + } + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["Vardison"]@": "@getTaggedString(%target.name)@" Will Feel the Power of My Missiles."); + %boss.schedule(1000, "SetMoveState", false); + return; + } + %boss.schedule(1, "SetMoveState", false); + } +} + +function VardisonAttack(%boss, %att, %arg) { + if(!isObject(%boss) || %boss.getState() $= "dead") { + return; + } + switch$(%att) { + case "ShadowBombDirect": + %target = getWord(%arg, 0); + %detCt = getWord(%arg, 1); + if(!isObject(%target) || %target.getState() $= "dead") { + return; + } + %vec = vectorNormalize(vectorSub(%target.getPosition(),%boss.getPosition())); + %p = new LinearFlareProjectile() { + dataBlock = ShadowBomb; + initialDirection = vectorScale(%vec, 10); + initialPosition = %boss.getPosition(); + sourceObject = %boss; + sourceSlot = 4; + }; + //%p.maxExplode = %detCt; + MissionCleanup.add(%p); + + case "ShadowBombLaunchAbove": + %target = getWord(%arg, 0); + %detCt = getWord(%arg, 1); + if(!isObject(%target) || %target.getState() $= "dead") { + return; + } + %vec = vectorNormalize(vectorSub(%target.getPosition(), vectorAdd(%boss.getPosition(), "0 0 35"))); + %p = new LinearFlareProjectile() { + dataBlock = ShadowBomb; + initialDirection = vectorScale(%vec, 10); + initialPosition = vectorAdd(%boss.getPosition(), "0 0 35"); + sourceSlot = 4; + }; + %p.maxExplode = %detCt; + %p.sourceObject = %boss; + MissionCleanup.add(%p); + + case "HyperspeedPlasmaBolt": + %boss.playShieldEffect("1 1 1"); + %pos = getField(%arg, 0); + %dir = getField(%arg, 1); + %p = new TracerProjectile() { + dataBlock = PlasmaCannonMainProj; + initialDirection = %dir; + initialPosition = %pos; + sourceObject = %boss; + sourceSlot = 4; + }; + MissionCleanup.add(%p); + + case "LaserDrop": + %toDie = %arg; + if(!isObject(%toDie) || %toDie.getState() $= "dead") { + return; + } + %p = new LinearFlareProjectile() { + dataBlock = HyperDevestatorBeam; + initialDirection = "0 0 -10"; + initialPosition = vectoradd(%target.getPosition(), "0 0 500"); + sourceObject = %boss; + sourceSlot = 4; + }; + MissionCleanup.add(%p); + + case "SuperLaser": + %toDie = %arg; + if(!isObject(%toDie) || %toDie.getState() $= "dead") { + return; + } + %vec = vectorNormalize(vectorSub(%toDie.getPosition(), %boss.getPosition())); + %p = new LinearFlareProjectile() { + dataBlock = SuperlaserProjectile; + initialDirection = %vec; + initialPosition = %boss.getPosition(); + sourceObject = %boss; + sourceSlot = 4; + }; + MissionCleanup.add(%p); + + case "NMM": + %target = %arg; + %vec = vectorNormalize(vectorSub(%target.getPosition(), %boss.getPosition())); + %p = new SeekerProjectile() { + dataBlock = YvexNightmareMissile; + initialDirection = %vec; + initialPosition = %boss.getPosition(); + sourceObject = %boss; + sourceSlot = 4; + }; + %beacon = new BeaconObject() { + dataBlock = "SubBeacon"; + beaconType = "vehicle"; + position = %target.getWorldBoxCenter(); + }; + %beacon.team = 0; + %beacon.setTarget(0); + MissionCleanup.add(%p); + MissionCleanup.add(%beacon); + %p.setObjectTarget(%beacon); + DemonMotherMissileFollow(%target,%beacon,%p); + + case "LBM": + %target = %arg; + %vec = vectorNormalize(vectorSub(%target.getPosition(), %boss.getPosition())); + %p = new SeekerProjectile() { + dataBlock = VardisonLaserBallMissile; + initialDirection = %vec; + initialPosition = %boss.getPosition(); + sourceObject = %boss; + sourceSlot = 4; + }; + %beacon = new BeaconObject() { + dataBlock = "SubBeacon"; + beaconType = "vehicle"; + position = %target.getWorldBoxCenter(); + }; + %beacon.team = 0; + %beacon.setTarget(0); + MissionCleanup.add(%p); + MissionCleanup.add(%beacon); + %p.setObjectTarget(%beacon); + DemonMotherMissileFollow(%target,%beacon,%p); + + case "LinearFlameWall": + %fVec = %boss.getEyeVector(); + %fPos = %boss.getEyePosition(); + %lPos = vectorAdd(%fPos, vectorScale(%fVec, 10)); + %vec = vectorScale(%fVec, 24); + //drop a line fire hire + %p = new TracerProjectile() { + dataBlock = napalmSubExplosion; + initialDirection = "0 0 -30"; + initialPosition = vectorAdd(%lPos, "0 0 3"); + sourceSlot = 5; + maxCount = 15; + }; + %p.sourceObject = %g; + %p.vector = %vec; + %p.count = 1; + + case "SeekingRapiers": + %target = %arg; + %iVec[0] = "1 0 0"; + %iVec[1] = "0 1 0"; + %iVec[2] = "-1 0 0"; + %iVec[3] = "0 -1 0"; + for(%i = 0; %i < 4; %i++) { + createSeekingProjectile("RapierShieldForwardProjectile", "LinearFlareProjectile", %boss.getPosition(), %iVec[%i], %boss, %target, 3000); + } + } +} + +function InvokeStillwallLoop(%boss) { + if(!isObject(%boss) || %boss.getState() $= "dead") { + return; + } + %boss.setVelocity("0 0 0"); + %boss.InvokeLoop = schedule(100, 0, "InvokeStillwallLoop", %boss); +} + +//============================================================================== +function VardisonMiniDemonSpawner::OnExplode(%data, %proj, %pos, %mod) { + //LaserBall + %ball = CreateEmitter(%pos, "MiniShadowBallEmitter", "0 0 0 0"); + %ball.schedule(1000, "Delete"); + %Fire = CreateEmitter(%pos, "burnEmitter", "0 0 0 0"); + %Fire.schedule(2500, "Delete"); + CreateDemonAT(vectorAdd(%pos, "0 0 3")); +} + +function CreateDemon(%pos) { + %p = new SeekerProjectile() { + dataBlock = VardisonMiniDemonSpawner; + initialDirection = "0 0 -10"; + initialPosition = vectorAdd(%pos, "0 0 500"); + //sourceObject = %boss; + //sourceSlot = 4; + }; +} + +function CreateDemonAT(%Pos) { + %Demon = new player(){ + Datablock = "MiniDemonArmor"; + }; + %Demon.setTransform(%Pos); + %Demon.type = 1; + %Demon.canjump = 1; + %Demon.hastarget = 1; + %Demon.isBoss = 1; //grant boss-like ability + + %Demon.team = 30; + + %Demon.target = createTarget(%Demon, "Shadow Warrior", "", "Derm3", '', %Demon.team, PlayerSensor); + setTargetSensorData(%Demon.target, PlayerSensor); + setTargetSensorGroup(%Demon.target, 30); + setTargetName(%Demon.target, addtaggedstring("Shadow Warrior")); + setTargetSkin(%Demon.target, 'Horde'); + + MissionCleanup.add(%Demon); + schedule(1000, %Demon, "MiniDemonMoveToTarget", %Demon); +} + +function MiniDemonMoveToTarget(%Demon){ + if(!isobject(%Demon)) + return; + if(%Demon.getState() $= "dead") + return; + %pos = %Demon.getworldboxcenter(); + %closestClient = ZombieLookForTarget(%Demon); + %closestDistance = getWord(%closestClient,1); + %closestClient = getWord(%closestClient,0).Player; + %Demon.counter++; + if(%Demon.counter >= 5) { + %Demon.counter = 0; + %Demon.canFire = 1; + } + if(%closestDistance <= $Zombie::detectDist) { + if(%Demon.hastarget != 1){ + %Demon.hastarget = 1; + } + %upvec = "250"; + %fmultiplier = $Zombie::FForwardSpeed; + + %vector = ZgetFacingDirection(%Demon,%closestClient,%pos); + + %vector = vectorscale(%vector, %Fmultiplier); + %x = Getword(%vector,0); + %y = Getword(%vector,1); + %z = Getword(%vector,2); + if(%z >= "1200" && %Demon.canjump == 1){ + %Demon.setvelocity("0 0 0"); + %upvec = (%upvec * 8); + %x = (%x * 0.5); + %y = (%y * 0.5); + %Demon.canjump = 0; + schedule(2500, %Demon, "Zsetjump", %Demon); + } + + if(%Demon.canFire) { + MiniDemonFire(%Demon, %closestclient); + } + + %vector = %x@" "@%y@" "@%upvec; + %Demon.applyImpulse(%pos, %vector); + } + else if(%Demon.hastarget == 1) { + %Demon.hastarget = 0; + %Demon.DemonRmove = schedule(100, %Demon, "ZSetRandomMove", %Demon); + } + %Demon.moveloop = schedule(500, %Demon, "MiniDemonMoveToTarget", %Demon); +} + +function MiniDemonFire(%demon, %closestclient){ + %pos = %demon.getMuzzlePoint(4); + %tpos = %closestclient.getWorldBoxCenter(); + %tvel = %closestclient.getvelocity(); + %vec = vectorsub(%tpos,%pos); + %dist = vectorlen(%vec); + %velpredict = vectorscale(%tvel,(%dist / 125)); + %vector = vectoradd(%vec,%velpredict); + %ndist = vectorlen(%vector); + %upvec = "0 0 "@((%ndist / 125) * (%ndist / 125) * 2); + %vector = vectornormalize(vectoradd(%vector,%upvec)); + + %p = new GrenadeProjectile() { + dataBlock = MiniDemonBlaster; + initialDirection = %vector; + initialPosition = %pos; + sourceObject = %demon; + sourceSlot = 4; + }; + + %demon.canFire = 0; +} diff --git a/scripts/TWM2/Bosses/LordYvex.cs b/scripts/TWM2/Bosses/LordYvex.cs new file mode 100644 index 0000000..be63622 --- /dev/null +++ b/scripts/TWM2/Bosses/LordYvex.cs @@ -0,0 +1,372 @@ +//BLOCK FUNCTIONS +function YvexNightmareMissile::OnExplode(%data, %proj, %pos, %mod) { + %source = %proj.SourceObject; + InitContainerRadiusSearch(%proj.getPosition(), 6, $TypeMasks::PlayerObjectType); + while ((%potentialTarget = ContainerSearchNext()) != 0) { + %cl = %potentialTarget.client; + if(%cl !$= "") + Yvexnightmareloop(%source, %cl); + } +} + +function KillerPulse::onCollision(%data,%projectile,%targetObject,%modifier,%position,%normal) { + if (%targetObject.getClassName() $= "Player" && %targetObject.isBoss) { + messageall('msgkillcurse', "\c5"@getTaggedString(%targetObject.client.name)@" Took a fatal Hit from "@$TWM2::ZombieName[7]@"'s Dark Energy"); + %targetObject.throwWeapon(); + %targetObject.clearinventory(); + YvexAttack_FUNC("KillLoop", %targetObject); + } +} + +function YvexZombieMakerMissile::OnExplode(%data, %proj, %pos, %mod) { + %c = CreateEmitter(%pos, NightmareGlobeEmitter, "0 0 1"); + %rand = getRandom(1, 6); + %c.schedule(%rand * 750, "delete"); + for(%i = 0; %i < %rand; %i++) { + %time = %i * 750; + %type = getRandomZombieType("1 2 3 4 5 9 12 13"); + schedule(%time, 0, "StartAZombie", vectoradd(%pos, "0 0 1"), %type); + } +} + +function YvexSniperShot::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal) { + if(!isplayer(%targetObject)) { + return; + } + %targ = %targetObject.client; + %Zombie = %projectile.sourceObject; + %targ.nightmareticks = 0; + Yvexnightmareloop(%zombie,%targ); + %randMessage = getrandom(3)+1; + switch(%randMessage) { + case 1: + MessageAll('MessageAll', "\c4"@$TWM2::ZombieName[7]@": Let the revenge begin, "@getTaggedString(%targ.name)@"."); + case 2: + MessageAll('MessageAll', "\c4"@$TWM2::ZombieName[7]@": Taste my vengance... "@getTaggedString(%targ.name)@"."); + case 3: + MessageAll('MessageAll', "\c4"@$TWM2::ZombieName[7]@": Sleep Forever... "@getTaggedString(%targ.name)@"."); + default: + MessageAll('MessageAll', "\c4"@$TWM2::ZombieName[7]@": This Nightmare will lock you forever "@getTaggedString(%targ.name)@"!"); + } +} + +//CREATION +function SpawnYvex(%position) { + %Zombie = new player(){ + Datablock = "YvexZombieArmor"; + }; + %Cpos = vectorAdd(%position, "0 0 5"); + MessageAll('MsgYvexreturn', "\c4"@$TWM2::ZombieName[7]@": Did you miss me? Because... I WANT MY REVENGE!!!"); + + %command = "Yvexmovetotarget"; + %zombie.ticks = 0; + InitiateBoss(%zombie, "Yvex"); + + YvexAttack_FUNC("ZombieSummon", %zombie); + YvexAttacks(%zombie); + + %Zombie.team = 30; + %zname = $TWM2::ZombieName[7]; // <- To Hosts, Enjoy, You can + //Change the Zombie Names now!!! + %zombie.target = createTarget(%zombie, %zname, "", "Derm3", '', %zombie.team, PlayerSensor); + setTargetSensorData(%zombie.target, PlayerSensor); + setTargetSensorGroup(%zombie.target, 30); + setTargetName(%zombie.target, addtaggedstring(%zname)); + setTargetSkin(%zombie.target, 'Horde'); + // + %zombie.type = %type; + %Zombie.setTransform(%cpos); + %zombie.canjump = 1; + %zombie.hastarget = 1; + %zombie.isZombie = 1; + MissionCleanup.add(%Zombie); + schedule(1000, %zombie, %command, %zombie); +} + + +//AI + +function Yvexmovetotarget(%zombie){ + if(!isobject(%zombie)) + return; + if(%zombie.getState() $= "dead") + return; + %pos = %zombie.getworldboxcenter(); + %z = getWord(%pos, 2); + if(%z < -300) { + %zombie.startFade(400, 0, true); + %zombie.startFade(1000, 0, false); + %zombie.setPosition(vectorAdd(vectoradd(%closestclient.player.getPosition(), "0 0 20"), getRandomPosition(25, 1))); + %zombie.setVelocity("0 0 0"); + MessageAll('msgYvexAttack', "\c4"@$TWM2::ZombieName[7]@": I shall not fall to my end!"); + } + %closestClient = ZombieLookForTarget(%zombie); + %closestDistance = getWord(%closestClient,1); + %closestClient = getWord(%closestClient,0).Player; + if(%closestDistance <= $zombie::detectDist){ + if(%zombie.hastarget != 1){ + serverPlay3d("ZombieHOWL",%zombie.getWorldBoxCenter()); + %zombie.hastarget = 1; + } + %chance = (getrandom() * 20); + if(%chance >= 19) + serverPlay3d("ZombieMoan",%zombie.getWorldBoxCenter()); + + %vector = ZgetFacingDirection(%zombie,%closestClient,%pos); + + %zombie.ticks++; + %vector = vectorscale(%vector, $Zombie::DForwardSpeed / 2); + %upvec = "150"; + %x = Getword(%vector,0); + %y = Getword(%vector,1); + %z = Getword(%vector,2); + if(%z >= ($Zombie::DForwardSpeed / 3 * 2)) + %upvec = (%upvec * 5); + %vector = %x@" "@%y@" "@%upvec; + %zombie.applyImpulse(%pos, %vector); + } + else if(%zombie.hastarget == 1){ + %zombie.hastarget = 0; + %zombie.zombieRmove = schedule(100, %zombie, "ZSetRandomMove", %zombie); + } + %zombie.moveloop = schedule(500, %zombie, "Yvexmovetotarget", %zombie); +} + +//ATTACKS +function YvexAttacks(%yvex) { + if(!isObject(%yvex) || %yvex.getState() $= "dead") { + return; + } + %closestClient = ZombieLookForTarget(%zombie); + %closestDistance = getWord(%closestClient,1); + %closestClient = getWord(%closestClient,0).Player; + + if(%closestClient) { + if(%closestDistance <= 150) { + %att = getRandom(1, 3); + switch(%att) { + case 1: + YvexAttack_FUNC("FireCurse", %yvex SPC %closestClient); + case 2: + YvexAttack_FUNC("FireSniper", %yvex SPC %closestClient); + case 3: + YvexAttack_FUNC("LaunchSummonMissile", %yvex SPC %closestClient); + } + } + else { + %att = getRandom(1, 3); + switch(%att) { + case 1: + YvexAttack_FUNC("RiftPulse", %yvex SPC %closestClient); + case 2: + YvexAttack_FUNC("NightmareMissile", %yvex SPC %closestClient); + case 3: + YvexAttack_FUNC("LaunchSummonMissile", %yvex SPC %closestClient); + } + } + } + + schedule(25000, 0, "YvexAttacks", %yvex); +} + +function YvexAttack_FUNC(%att, %args) { + switch$(%att) { + case "ZombieSummon": + %z = getWord(%args, 0); + if(!isobject(%z) || %z.getState() $= "dead") { + return; + } + //schedule the next one + schedule(40000, 0, "YvexAttack_FUNC", "ZombieSummon", %z); + //-------------------- + %type = getRandomZombieType("1 2 3 4 5 9 12 13"); + %msg = getrandom(1, 3); + switch(%msg) { + case 1: + messageall('YvexMsg',"\c4"@$TWM2::ZombieName[7]@": Enlisted for revenge... ATTACK"); + case 2: + messageall('YvexMsg',"\c4"@$TWM2::ZombieName[7]@": Attack my soldiers.. REVENGE is ours"); + case 3: + messageall('YvexMsg',"\c4"@$TWM2::ZombieName[7]@": Take out the enemy, ALL OF THEM!"); + } + for(%i = 0; %i < 5; %i++) { + %pos = vectoradd(%z.getPosition(), getRandomPosition(10,1)); + %fpos = vectoradd("0 0 5",%pos); + StartAZombie(%fpos, %type); + } + %z.setMoveState(true); + %z.setActionThread($Zombie::RAAMThread, true); + %z.schedule(3500, "setMoveState", false); + + case "FireCurse": + MessageAll('msgWTFH', "\c4"@$TWM2::ZombieName[7]@": DIE!!!"); + %zombie = getWord(%args, 0); + %target = getWord(%args, 1); + + %vec = vectorsub(%target.getworldboxcenter(),%zombie.getMuzzlePoint(0)); + %vec = vectoradd(%vec, vectorscale(%target.getvelocity(),vectorlen(%vec)/100)); + %p = new LinearFlareProjectile() { + dataBlock = YvexSniperShot; + initialDirection = %vec; + initialPosition = %zombie.getMuzzlePoint(0); + sourceObject = %zombie; + sourceSlot = 0; + }; + + case "FireSniper": + %zombie = getWord(%args, 0); + %target = getWord(%args, 1); + + %vec = vectorsub(%target.getworldboxcenter(),%zombie.getMuzzlePoint(0)); + %vec = vectoradd(%vec, vectorscale(%target.getvelocity(),vectorlen(%vec)/100)); + %p = new LinearFlareProjectile() { + dataBlock = YvexSniperShot; + initialDirection = %vec; + initialPosition = %zombie.getMuzzlePoint(0); + sourceObject = %zombie; + sourceSlot = 0; + }; + + case "LaunchSummonMissile": + %z = getWord(%args, 0); + %t = getWord(%args, 1); + %vec = vectorNormalize(vectorSub(%t.getPosition(),%z.getPosition())); + %p = new SeekerProjectile() { + dataBlock = YvexZombieMakerMissile; + initialDirection = %vec; + initialPosition = %z.getMuzzlePoint(4); + sourceObject = %z; + sourceSlot = 4; + }; + %beacon = new BeaconObject() { + dataBlock = "SubBeacon"; + beaconType = "vehicle"; + position = %t.getWorldBoxCenter(); + }; + %beacon.team = 0; + %beacon.setTarget(0); + MissionCleanup.add(%beacon); + %p.setObjectTarget(%beacon); + DemonMotherMissileFollow(%t, %beacon, %p); + + case "RiftPulse": + %t = getWord(%args, 0); + %ct = getWord(%args, 1); + + if(!isObject(%t)) { + return; + } + %t.setMoveState(true); + %ct++; + if(%ct > 30) { + %t.setMoveState(false); + } + schedule(500, 0, "YvexAttack_FUNC", "RiftPulse", %t SPC %ct); + + case "NightmareMissile": + %z = getWord(%args, 0); + %t = getWord(%args, 1); + %vec = vectorNormalize(vectorSub(%t.getPosition(),%z.getPosition())); + %p = new SeekerProjectile() { + dataBlock = YvexNightmareMissile; + initialDirection = %vec; + initialPosition = %z.getMuzzlePoint(4); + sourceObject = %z; + sourceSlot = 4; + }; + %beacon = new BeaconObject() { + dataBlock = "SubBeacon"; + beaconType = "vehicle"; + position = %t.getWorldBoxCenter(); + }; + %beacon.team = 0; + %beacon.setTarget(0); + MissionCleanup.add(%beacon); + %p.setObjectTarget(%beacon); + DemonMotherMissileFollow(%t, %beacon, %p); + + case "KillLoop": + %player = getWord(%args, 0); + if(isObject(%player)) { + %player.disablemove(true); + if (%player.getState() $= "dead") { + return; + } + %player.setActionThread("Death2"); + if(%player.beats == 1) { + messageclient(%player.client, 'MsgClient', "\c2You feel the life slowly leave you."); + messageclient(%player.client, 'MsgClient', "~wfx/misc/heartbeat.wav"); + } + if(%player.beats < 10) { + %player.setWhiteOut(%player.beats * 0.2); + } + else { + %player.setDamageFlash(1); + %player.scriptKill(0); + } + } + %player.beats++; + Schedule(600, 0, "YvexAttack_FUNC", "KillLoop", %player); + } +} + +function Yvexnightmareloop(%zombie,%viewer) { + %enum = getRandom(1,5); + switch(%enum) { + case 1: + %emote = "sitting"; + case 2: + %emote = "standing"; + case 3: + %emote = "death3"; + case 4: + %emote = "death2"; + case 5: + %emote = "death4"; + } + if(!isobject(%viewer.player) || %viewer.player.getState() $= "dead") { + %viewer.nightmared = 0; + return; + } + if(!isobject(%zombie)) { + %viewer.nightmared = 0; + %viewer.player.setMoveState(false); + return; + } + if(%viewer.nightmareticks > 30) { + %viewer.player.setMoveState(false); + %viewer.nightmareticks = 0; + %viewer.nightmared = 0; + return; + } + %c = createEmitter(%viewer.player.position,NightmareGlobeEmitter,"1 0 0"); //Rotate it + MissionCleanup.add(%c); // I think This should be used + schedule(500,0,"killit",%c); + %viewer.nightmareticks++; + %viewer.player.setMoveState(true); + %viewer.nightmared = 1; + %viewer.player.setActionThread(%emote,true); + %viewer.player.setWhiteout(1.8); + %viewer.player.setDamageFlash(1.5); + + %zombie.playShieldEffect("1 1 1"); + serverPlay3D(NightmareScreamSound, %viewer.player.position); + schedule(500,0,"Yvexnightmareloop",%zombie, %viewer); + %viewer.player.damage(0, %viewer.player.position, 0.01, $DamageType::Zombie); + %zombie.setDamageLevel(%zombie.getDamageLevel() - 0.1); + + BottomPrint(%viewer,"You are locked in "@$TWM2::ZombieName[7]@"'s Nightmare.",5,1); + schedule(1, 0, "messageclient", %viewer, 'MsgClient', "~wvoice/fem1/avo.deathcry_02.wav"); + schedule(5, 0, "messageclient", %viewer, 'MsgClient', "~wvoice/fem2/avo.deathcry_02.wav"); + schedule(10, 0, "messageclient", %viewer, 'MsgClient', "~wvoice/fem3/avo.deathcry_02.wav"); + schedule(15, 0, "messageclient", %viewer, 'MsgClient', "~wvoice/fem4/avo.deathcry_02.wav"); + schedule(20, 0, "messageclient", %viewer, 'MsgClient', "~wvoice/fem5/avo.deathcry_02.wav"); + schedule(25, 0, "messageclient", %viewer, 'MsgClient', "~wvoice/male1/avo.deathcry_02.wav"); + schedule(30, 0, "messageclient", %viewer, 'MsgClient', "~wvoice/male2/avo.deathcry_02.wav"); + schedule(35, 0, "messageclient", %viewer, 'MsgClient', "~wvoice/male3/avo.deathcry_02.wav"); + schedule(40, 0, "messageclient", %viewer, 'MsgClient', "~wvoice/male4/avo.deathcry_02.wav"); + schedule(45, 0, "messageclient", %viewer, 'MsgClient', "~wvoice/male5/avo.deathcry_02.wav"); + schedule(50, 0, "messageclient", %viewer, 'MsgClient', "~wvoice/derm1/avo.deathcry_02.wav"); + schedule(55, 0, "messageclient", %viewer, 'MsgClient', "~wvoice/derm2/avo.deathcry_02.wav"); + schedule(60, 0, "messageclient", %viewer, 'MsgClient', "~wvoice/derm3/avo.deathcry_02.wav"); +} diff --git a/scripts/TWM2/Bosses/LordraniusTrebor.cs b/scripts/TWM2/Bosses/LordraniusTrebor.cs new file mode 100644 index 0000000..e042f4c --- /dev/null +++ b/scripts/TWM2/Bosses/LordraniusTrebor.cs @@ -0,0 +1,418 @@ +function StartTrebor(%pos){ + %team = 6; + %rotation = "1 0 0 0"; + %skill = 10; + + %tank = new HoverVehicle() { + dataBlock = TreborTank; + position = %pos; + rotation = %rotation; + team = %team; + }; + MissionCleanUp.add(%tank); + + setTargetSensorGroup(%tank.getTarget(), %team); + %tank.isdrone = 1; + %tank.skill = 0.2 + (%skill / 12.5); + + %tank.CanUseSpec = 1; + %tank.SpecTicks = 0; + InitiateBoss(%tank, "Trebor"); + + TreborDetermineAttack(%tank); + TreborMove(%tank); + MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trebor"]@": It's time to test the harbinger clan's ultimate siege weapon. ON YOU!"); + + return %tank; +} + +function TreborTank::onAdd(%this, %obj) { + Parent::onAdd(%this, %obj); + + %turret = TurretData::create(CentaurTurret); + %turret.selectedWeapon = 1; + MissionCleanup.add(%turret); + %turret.team = 6; + %turret.setSelfPowered(); + %obj.mountObject(%turret, 10); + + %turret.mountImage(Cent50CalBarrel, 0); + %obj.barrel = "Chain"; + + %obj.turretObject = %turret; + %turret.source = %obj; + + %turret.setCapacitorRechargeRate(999); + %turret.setAutoFire(true); + + %obj.schedule(6000, "playThread", $ActivateThread, "activate"); + + // set the turret's target info + setTargetSensorGroup(%obj.getTarget(), 6); + setTargetAlwaysVisMask(%obj.getTarget(), 0xffffffff); + setTargetSensorGroup(%turret.getTarget(), 6); + setTargetAlwaysVisMask(%turret.getTarget(), 0xffffffff); +} +function TreborTank::deleteAllMounted(%data, %obj) { + CentaurVehicle::deleteAllMounted(%data, %obj); +} + +function TreborLocateTarget(%tank) { + %wbpos = %tank.getworldboxcenter(); + %count = ClientGroup.getCount(); + %closestClient = -1; + %closestDistance = 32767; + for(%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject(%i); + if(isObject(%cl.player)){ + %testPos = %cl.player.getWorldBoxCenter(); + %distance = vectorDist(%wbpos, %testPos); + if (%distance > 0 && %distance < %closestDistance) { + %closestClient = %cl; + %closestDistance = %distance; + } + } + } + return %closestClient SPC %closestDistance; +} + +function TreborRotateAndVec(%tank, %tPl){ + if(!isObject(%tPl)) { + return; + } + // + %cPos = %tank.getPosition(); + %vector = vectorNormalize(vectorSub(%cpos, %tPl.getPosition())); + %v1 = getword(%vector, 0); + %v2 = getword(%vector, 1); + %v3 = getword(%vector, 2); + %nv1 = (%v2*-1); + %nv2 = (%v1); + %set = %nv1@" "@%nv2@" "@%v3; + %tank.setRotation(fullrot("0 0 0", %Set)); + // + return %set; +} + +function TreborMove(%tank) { + if(!isObject(%tank)) { + return; + } + if(%tank.performingSpec) { //Specials make the tank do things that this must be off to work + schedule(250, 0, "TreborMove", %tank); + return; + } + %target = TreborLocateTarget(%tank); + if(!isObject(%target.player)) { + schedule(100, 0, "TreborMove", %tank); + return; + } + %vec = TreborRotateAndVec(%tank, %target.player); //turns the tank + %dist = VectorDist(%target.player.getPosition(), %tank.getPosition()); //The all important + //don't ask how we would get this far + //but we simply move + if(%dist > 1500) { + %vector = vectorscale(%tank.getForwardVector(), 6000); + %tank.applyImpulse(%tank.getPosition(), %vector); + //throw in another speed boost + %tank.setImageTrigger(3, true); //the jets + } + else if(%dist <= 1500 && %dist > 200) { + %vector = vectorscale(%tank.getForwardVector(), 3000); + %tank.applyImpulse(%tank.getPosition(), %vector); + //decent move, we like this range + } + //This range is potentially deadly, so take it slower + else { + if(%dist < 10 && !%tank.teleporting) { + //interesting... trying to cut it close? + %tank.teleporting = 1; + MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trebor"]@": Trying to do that huhn? I think not!"); + PhaseShift(%tank); + } + %vector = vectorscale(%tank.getForwardVector(), 1150); + %tank.applyImpulse(%tank.getPosition(), %vector); + } + schedule(100, 0, "TreborMove", %tank); +} + +function TreborDetermineAttack(%tank) { + if(!isObject(%tank)) { + return; + } + if(%tank.performingSpec) { //Specials make the tank do things that this must be off to work + schedule(250, 0, "TreborDetermineAttack", %tank); + return; + } + %target = TreborLocateTarget(%tank); + if(!isObject(%target)) { + schedule(250, 0, "TreborDetermineAttack", %tank); + return; + } + %dist = VectorDist(%target.player.getPosition(), %tank.getPosition()); //The all important + if(%dist < 175) { //in CG Range + //Collider? + if(%tank.barrel $= "Collider") { + %tank.barrel = "Chain"; + //unmount first, we no likey UEs + %tank.turretObject.schedule(500, "unmountImage", 0); + %tank.turretObject.schedule(500, "unmountImage", 1); + // + %tank.turretObject.schedule(3500, "mountImage", Cent50CalBarrel, 0); + } + } + //striking range for collider + else { + if(%tank.barrel $= "Chain") { + %tank.barrel = "Collider"; + //unmount first, we no likey UEs + %tank.turretObject.schedule(500, "unmountImage", 0); + %tank.turretObject.schedule(500, "unmountImage", 1); + // + %tank.turretObject.schedule(3500, "mountImage", CentaurColliderBarrel, 0); + } + } + if(%tank.CanUseSpec) { + %tank.CanUseSpec = 0; + schedule(20000, 0, "eval", "%tank.CanUseSpec = 1;"); + if(%dist < 150) { //in CG Range + //Now, Lets try an attack + %attackNum = GetRandom(1, 3); + //1. Ramming Run: Tank boosts to ram the target + //2. CG Slide: Tank slides around the target and CGs it + //3. Phase Shift: Tank Shifts to collider range + switch(%attackNum) { + case 1: + MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trebor"]@": Dodge this "@getTaggedString(%target.name)@"!!!"); + RammingSpeed(%tank, %target); + case 2: + MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trebor"]@": Engage sideswipe boosters"); + SlideTarget(%tank, %target); + case 3: + MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trebor"]@": Engage Phase Shift!"); + PhaseShift(%tank); + } + } + //striking range for collider (and some of my other goodies) + else { + %attackNum = getRandom(1,3); + switch(%attackNum) { + case 1: + MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trebor"]@": Engage missile storm on "@getTaggedString(%target.name)@"!!!"); + MissileStorm(%tank, %target); + case 2: + MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trebor"]@": Let a firey storm of missiles rain upon you, "@getTaggedString(%target.name)@"!!!"); + MissileRain(%tank, %target); + case 3: + MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trebor"]@": Engage missile storm on "@getTaggedString(%target.name)@"!!!"); + MissileStorm(%tank, %target); + } + } + } + schedule(250, 0, "TreborDetermineAttack", %tank); +} + +//Attackz0rs +function RammingSpeed(%tank, %target) { + //get ready to blast into them + if(!isObject(%tank)) { + return; + } + if(!isObject(%target.player)) { + %tank.performingSpec = 0; + %tank.SpecTicks = 0; + %tank.barrel = "Chain"; + %tank.turretObject.schedule(3500, "mountImage", Cent50CalBarrel, 0); + echo("done"); + return; + } + %tank.SpecTicks++; + if(%tank.SpecTicks == 1) { + echo("prep"); + %tank.performingSpec = 1; + %tank.barrel = ""; + %tank.turretObject.schedule(100, "unMountImage", 0); + } + else { + %vec = TreborRotateAndVec(%tank, %target.player); //turns the tank + %vector = vectorscale(%tank.getForwardVector(), 15000); + %tank.applyImpulse(%tank.getPosition(), %vector); + //%tank.setImageTrigger(3, true); + //echo("boost"); + } + if(%tank.SpecTicks > 150) { + %tank.performingSpec = 0; + %tank.SpecTicks = 0; + %tank.barrel = "Chain"; + %tank.turretObject.schedule(15000, "mountImage", Cent50CalBarrel, 0); + echo("done"); + return; + } + schedule(100, 0, "RammingSpeed", %tank, %target); +} + +function SlideTarget(%tank, %target) { + if(!isObject(%tank)) { + return; + } + if(!isObject(%target.player)) { + %tank.performingSpec = 0; + return; + } + %tank.SpecTicks++; + if(%tank.SpecTicks == 1) { + %tank.performingSpec = 1; + } + else { + %vec = TreborRotateAndVec(%tank, %target.player); //turns the tank + %x = Getword(%vec,0); + %y = Getword(%vec,1); + %nv1 = %y; + %nv2 = (%x * -1); + %vector = %nv1@" "@%nv2@" 0"; + %vector = vectorscale(%vector, 8000); + %tank.applyImpulse(%tank.getPosition(), %vector); + } + if(%tank.SpecTicks > 100) { + %tank.performingSpec = 0; + %tank.SpecTicks = 0; + return; + } + schedule(100, 0, "SlideTarget", %tank, %target); +} + +function PhaseShift(%tank) { + %tank.setCloaked(true); + %tank.setFrozenState(true); + %tank.schedule(2500, "setCloaked", false); + %tank.schedule(2500, "setFrozenState", false); + %CPos = %tank.getPosition(); + %rand = getRandomPosition(250, 1); + %fin = vectorAdd(%CPos, %rand); + %xy = getwords(%fin, 0, 1); + %z = getTerrainHeight(%fin) + 9; + %goto = %xy SPC %z; + %tank.schedule(1000, "SetPosition", %goto); + %tank.SpecTicks = 0; + %tank.performingSpec = 0; + schedule(2500, 0, eval, ""@%tank@".teleporting = 0;"); +} + +// hack +function CentaurTurret::selectTarget(%this, %turret) { + if(%turret.source.isboss) { + %turretTarg = %turret.getTarget(); + if(%turretTarg == -1) + return; + + // if the turret isn't on a team, don't fire at anyone + if(getTargetSensorGroup(%turretTarg) == 0) { + %turret.clearTarget(); + return; + } + + // stop firing if turret is disabled or if it needs power and isn't powered + if((!%turret.isPowered()) && (!%turret.needsNoPower)) { + %turret.clearTarget(); + return; + } + + %TargetSearchMask = $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType; + + InitContainerRadiusSearch(%turret.getMuzzlePoint(0), %turret.getMountedImage(0).attackRadius, + %TargetSearchMask); + + // TODO - clean up this mess + GameBaseData::hasLOS() + + while ((%potentialTarget = ContainerSearchNext()) != 0) { + if (%potentialtarget && %potentialTarget != %turret.source) { + %potTargTarg = %potentialTarget.getTarget(); + if (%potentialTarget.homingCount > 0 && !%secondTarg) { + if (!%firstTarg) + %firstTarg = %potentialTarget; + else + %secondTarg = %potentialTarget; + } + else { + %turret.setTargetObject(%potentialTarget); + %turret.aquireTime = getSimTime(); + return; + } + } + } + if (%secondTarg) { + %turret.setTargetObject(%firstTarg); + %turret.aquireTime = getSimTime(); + return; + } + if (%firstTarg) { + %turret.setTargetObject(%firstTarg); + %turret.aquireTime = getSimTime(); + return; + } + } + else { + TurretData::selectTarget(%this, %turret); + } +} + +function MissileStorm(%tank, %target) { + schedule(700,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 5); + schedule(1400,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 5); + schedule(2100,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 5); + schedule(2800,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 5); + schedule(3500,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 5); + schedule(4200,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 5); + schedule(4900,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 5); + schedule(5600,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 3); + schedule(6300,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 3); + schedule(7000,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 3); + // Quick Shots + schedule(8000,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(8100,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(8200,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(8300,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(8400,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(8500,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(8600,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(8700,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + %tank.SpecTicks = 0; + %tank.performingSpec = 0; +} + +//ultimate evil +function MissileRain(%tank, %target) { + schedule(100,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(200,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(300,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(400,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(500,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(600,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(700,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(800,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(900,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(1000,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + // Quick Shots + schedule(1100,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(1200,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(1300,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(1400,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(1500,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(1600,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(1700,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(1800,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(1900,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(2000,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(2100,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(2200,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(2300,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(2400,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(2500,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(2600,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(2700,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(2800,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(2900,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + schedule(3000,0,"WindshearAttack_FUNC", "SidewinderLaunch", %tank SPC %target.player SPC 1); + %tank.SpecTicks = 0; + %tank.performingSpec = 0; +} diff --git a/scripts/TWM2/Bosses/MajorInsignia.cs b/scripts/TWM2/Bosses/MajorInsignia.cs new file mode 100644 index 0000000..57e8a78 --- /dev/null +++ b/scripts/TWM2/Bosses/MajorInsignia.cs @@ -0,0 +1,341 @@ +//Major Insignia +//Gravity Zombie Boss + +//Stops console spammage +function NoCollideBio::shouldApplyImpulse(%targetObject) { + return false; +} +function NoCollideHum::shouldApplyImpulse(%targetObject) { + return false; +} + +//CREATION +function SpawnInsignia(%position) { + %Zombie = new player(){ + Datablock = "InsigniaZombieArmor"; + }; + %Cpos = vectorAdd(%position, "0 0 5"); + MessageAll('MsgDarkraireturn', "\c4"@$TWM2::BossName["Insignia"]@": Oh, a battle, lets see if I know how to do this..."); + + %command = "Insigniamovetotarget"; + %zombie.ticks = 0; + InitiateBoss(%zombie, "Insignia"); + schedule(5000, 0, InsigniaAttack_FUNC, "ZombieSummon", %zombie); + InsigniaAttack(%zombie); + + %Zombie.team = 30; + %zname = $TWM2::BossName["Insignia"]; // <- To Hosts, Enjoy, You can + //Change the Zombie Names now!!! + %zombie.target = createTarget(%zombie, %zname, "", "Derm3", '', %zombie.team, PlayerSensor); + setTargetSensorData(%zombie.target, PlayerSensor); + setTargetSensorGroup(%zombie.target, 30); + setTargetName(%zombie.target, addtaggedstring(%zname)); + setTargetSkin(%zombie.target, 'Horde'); + // + %zombie.type = %type; + %Zombie.setTransform(%cpos); + %zombie.canjump = 1; + %zombie.hastarget = 1; + %zombie.isZombie = 1; + MissionCleanup.add(%Zombie); + schedule(1000, %zombie, %command, %zombie); +} + + +//AI + +function Insigniamovetotarget(%zombie){ + if(!isobject(%zombie)) + return; + if(%zombie.getState() $= "dead") + return; + %pos = %zombie.getworldboxcenter(); + %closestClient = ZombieLookForTarget(%zombie); + %z = getWord(%pos, 2); + if(%z < -300) { + %zombie.startFade(400, 0, true); + %zombie.startFade(1000, 0, false); + %zombie.setPosition(vectorAdd(vectoradd(%closestclient.player.getPosition(), "0 0 20"), getRandomPosition(25, 1))); + %zombie.setVelocity("0 0 0"); + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": OH FALLING IS NOT FUN!!!!"); + } + %closestDistance = getWord(%closestClient,1); + %closestClient = getWord(%closestClient,0).Player; + if(%closestDistance <= $zombie::detectDist){ + if(%zombie.hastarget != 1){ + serverPlay3d("ZombieHOWL",%zombie.getWorldBoxCenter()); + %zombie.hastarget = 1; + } + %chance = (getrandom() * 20); + if(%chance >= 19) + serverPlay3d("ZombieMoan",%zombie.getWorldBoxCenter()); + + %vector = ZgetFacingDirection(%zombie,%closestClient,%pos); + + %vector = vectorscale(%vector, $Zombie::DForwardSpeed); + %upvec = "150"; + %x = Getword(%vector,0); + %y = Getword(%vector,1); + %z = Getword(%vector,2); + if(%z >= ($Zombie::DForwardSpeed)) + %upvec = (%upvec * 5); + %vector = %x@" "@%y@" "@%upvec; + %zombie.applyImpulse(%pos, %vector); + } + else if(%zombie.hastarget == 1){ + %zombie.hastarget = 0; + %zombie.zombieRmove = schedule(100, %zombie, "ZSetRandomMove", %zombie); + } + %zombie.moveloop = schedule(500, %zombie, "Insigniamovetotarget", %zombie); +} + +// +function InsigniaAttack_FUNC(%att, %args) { + switch$(%att) { + case "ZombieSummon": + %z = getWord(%args, 0); + if(!isobject(%z) || %z.getState() $= "dead") { + return; + } + schedule(30000, 0, InsigniaAttack_FUNC, "ZombieSummon", %z); + //-------------------- + %type = getRandomZombieType("1 2 3 5 9 12 13 15 17"); //omit 4 in place of 17: Demon -> Elite Demon + messageall('RogMsg',"\c4"@$TWM2::BossName["Insignia"]@": Slay the humans!!!"); + for(%i = 0; %i < 6; %i++) { + %pos = vectoradd(%z.getPosition(), getRandomPosition(10,1)); + %fpos = vectoradd("0 0 5",%pos); + StartAZombie(%fpos, %type); + } + %z.setMoveState(true); + %z.setActionThread($Zombie::RAAMThread, true); + %z.schedule(3500, "setMoveState", false); + + case "Reinforce": + %zombie = getWord(%args, 0); + %type = getRandomZombieType("1 2 3 5 9 12 13 15 17"); + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Insignia"]@": It's time for you to take on my reinforcements!"); + %typeCaller = %type SPC %type SPC %type SPC %type; + %callPos1 = vectorAdd(%zombie.getPosition(), "2000 100 400"); + spawnHunterDropship(%callPos1, "AA", %typeCaller); + %callPos2 = vectorAdd(%zombie.getPosition(), "2000 -100 400"); + spawnHunterDropship(%callPos2, "AA", %typeCaller); + + case "GravShot": + %plyr = getWord(%args, 0); + %vec = getWords(%args, 1); + if(%plyr.isAlive()) { + %plyr.applyImpulse(%plyr.getPosition(), VectorScale(%vec, 2000)); + %plyr.flight = 1; + schedule(4000, 0, "eval", ""@%plyr@".flight = 0;"); + for( %i = 0; %i < 20; %i++ ) { + schedule(%i * 80, 0, InsigniaAttack_FUNC, "Projection_Bio", %plyr); + } + } + + case "Projection_Bio": + %plyr = getWord(%args, 0); + if(isPlayer(%plyr)) { + %trans2 = %plyr.getTransform(); + %player = new StaticShape(){ + Datablock = "NoCollideBio"; + }; + %player.setTransform(%trans2); + %player.startfade(2000, 0, true); + %player.schedule(5000, "Delete"); + } + + case "Projection_Hum": + %plyr = getWord(%args, 0); + if(isPlayer(%plyr)) { + %trans2 = %plyr.getTransform(); + %player = new StaticShape(){ + Datablock = "NoCollideHum"; + }; + %player.setTransform(%trans2); + %player.startfade(2000, 0, true); + %player.schedule(5000, "Delete"); + } + + case "AcidShot_Single": + %zombie = getWord(%args, 0); + %target = getWord(%args, 1); + if(isobject(%zombie) && isobject(%target)){ + %vec = vectorsub(%target.getworldboxcenter(),%zombie.getMuzzlePoint(6)); + %vec = vectoradd(%vec, vectorscale(%target.getvelocity(),vectorlen(%vec)/100)); + %p = new TracerProjectile() { + dataBlock = LZombieAcidBall; + initialDirection = %vec; + initialPosition = %zombie.getMuzzlePoint(6); + sourceObject = %zombie; + sourceSlot = 6; + }; + } + + case "AcidStorm": + %zombie = getWord(%args, 0); + %target = getWord(%args, 1); + if(!isobject(%zombie) || %zombie.getState() $= "dead") { + return; + } + if(!isobject(%target) || %target.getState() $= "dead") { + return; + } + + %zombie.setMoveState(true); + InsigniaAttack_FUNC("AcidShot_Single", %zombie SPC %target); + schedule(500, 0, InsigniaAttack_FUNC, "AcidShot_Single", %zombie SPC %target); + schedule(1000, 0, InsigniaAttack_FUNC, "AcidShot_Single", %zombie SPC %target); + schedule(1500, 0, InsigniaAttack_FUNC, "AcidShot_Single", %zombie SPC %target); + schedule(2000, 0, InsigniaAttack_FUNC, "AcidShot_Single", %zombie SPC %target); + schedule(2500, 0, InsigniaAttack_FUNC, "AcidShot_Single", %zombie SPC %target); + schedule(3000, 0, InsigniaAttack_FUNC, "AcidShot_Single", %zombie SPC %target); + schedule(3500, 0, InsigniaAttack_FUNC, "AcidShot_Single", %zombie SPC %target); + schedule(4000, 0, InsigniaAttack_FUNC, "AcidShot_Single", %zombie SPC %target); + schedule(4500, 0, InsigniaAttack_FUNC, "AcidShot_Single", %zombie SPC %target); + %zombie.schedule(5000, "setMoveState", false); + + case "AcidMachineGun": + %zombie = getWord(%args, 0); + %target = getWord(%args, 1); + if(!isobject(%zombie) || %zombie.getState() $= "dead") { + return; + } + if(!isobject(%target) || %target.getState() $= "dead") { + return; + } + for(%i = 0; %i < 40; %i++) { + schedule(%i * 100, 0, InsigniaAttack_FUNC, "AcidShot_Single", %zombie SPC %target); + } + + case "LapseStrike": + %zombie = getWord(%args, 0); + %target = getWord(%args, 1); + %ct = getWord(%args, 2); + if(!isObject(%zombie) || %zombie.getState() $= "dead") { + return; + } + if(!isObject(%target) || %target.getState() $= "dead") { + return; + } + if(%ct > 30) { + return; + } + %ct++; + schedule(200, 0, InsigniaAttack_FUNC, "LapseStrike", %zombie SPC %target SPC %ct); + if(%ct < 5) { + %zombie.setVelocity("0 0 10"); + } + else if(%ct >= 5 && %ct <= 10) { + %zombie.startFade(400, 0, true); + %zombie.startFade(1000, 0, false); + %zombie.schedule(700, "setPosition", vectorAdd(%target.getPosition(), "20 0 50")); + } + else if(%ct == 10 || %ct == 11) { + schedule(1, 0, InsigniaAttack_FUNC, "AcidShot_Single", %zombie SPC %target); + } + else if(%ct >= 12 && %ct <= 17) { + %zombie.startFade(400, 0, true); + %zombie.startFade(1000, 0, false); + %zombie.schedule(700, "setPosition", vectorAdd(%target.getPosition(), "-20 0 50")); + } + else if(%ct == 18 || %ct == 19 || %ct == 20) { + schedule(1, 0, InsigniaAttack_FUNC, "AcidShot_Single", %zombie SPC %target); + } + else if(%ct > 20 && %ct <= 25) { + %zombie.setVelocity("0 0 10"); + %zombie.startFade(400, 0, true); + %zombie.startFade(1000, 0, false); + %zombie.schedule(700, "setPosition", vectorAdd(%target.getPosition(), "-20 20 50")); + } + else if(%ct > 26 && %ct < 30) { + %zombie.setVelocity("0 0 10"); + } + + case "DropSummon": + %target = getWord(%args, 0); + %target.setMoveState(true); + %target.schedule(1500, "SetMoveState", false); + %target.setPosition(vectorAdd(%zombie.getPosition(), "0 0 20")); + InsigniaAttack_FUNC("GravShot", %target@" 0 0 -1"); + } +} +// + +//ATTACKS + +function InsigniaAttack(%zombie) { + if(!isObject(%zombie) || %zombie.getState() $= "dead") { + return; + } + schedule(27000, 0, "InsigniaAttack", %zombie); + %attack = getRandom(1, 7); + switch(%attack) { + case 1: + %target = FindValidTarget(%zombie); + %target = %target.player; + if(!isObject(%target) || %target.getState() $= "Dead") { + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": I suppose I can wait..."); + return; + } + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": Lets shorten the distance... "@getTaggedString(%target.client.name)@"."); + %vec = vectorsub(%target.getworldboxcenter(), %zombie.getMuzzlePoint(0)); + %vec = vectoradd(%vec, vectorscale(%target.getvelocity(), vectorlen(%vec)/100)); + InsigniaAttack_FUNC("GravShot", %zombie SPC %vec); + + case 2: + %target = FindValidTarget(%zombie); + %target = %target.player; + if(!isObject(%target) || %target.getState() $= "Dead") { + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": I suppose I can wait..."); + return; + } + InsigniaAttack_FUNC("GravShot", %zombie SPC "0 0 200"); + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": Death from above "@getTaggedString(%target.client.name)@"."); + %vec = vectorsub(%target.getworldboxcenter(),%zombie.getMuzzlePoint(0)); + %vec = vectoradd(%vec, vectorscale(%target.getvelocity(),vectorlen(%vec)/100)); + schedule(1500, 0, InsigniaAttack_FUNC, "GravShot", %zombie SPC %vec); + + case 3: + %target = FindValidTarget(%zombie); + %target = %target.player; + if(!isObject(%target) || %target.getState() $= "Dead") { + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": I suppose I can wait..."); + return; + } + InsigniaAttack_FUNC("AcidStorm", %zombie SPC %target); + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": Acid Storm, just for you... "@getTaggedString(%target.client.name)@"."); + + case 4: + %target = FindValidTarget(%zombie); + %target = %target.player; + if(!isObject(%target) || %target.getState() $= "Dead") { + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": I suppose I can wait..."); + return; + } + InsigniaAttack_FUNC("LapseStrike", %zombie SPC %target SPC 0); + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": Hey, "@getTaggedString(%target.client.name)@". Watch this."); + + case 5: + %target = FindValidTarget(%zombie); + %target = %target.player; + if(!isObject(%target) || %target.getState() $= "Dead") { + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": I suppose I can wait..."); + return; + } + InsigniaAttack_FUNC("AcidMachineGun", %zombie SPC %target); + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": ENOUGH, "@getTaggedString(%target.client.name)@". DIE."); + + case 6: + %target = FindValidTarget(%zombie); + %target = %target.player; + if(!isObject(%target) || %target.getState() $= "Dead") { + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": I suppose I can wait..."); + return; + } + MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": C'Mere, "@getTaggedString(%target.client.name)@"."); + InsigniaAttack_FUNC("DropSummon", %target); + + case 7: + InsigniaAttack_FUNC("Reinforce", %zombie); + } +} diff --git a/scripts/TWM2/Bosses/ShadeLord.cs b/scripts/TWM2/Bosses/ShadeLord.cs new file mode 100644 index 0000000..33118a3 --- /dev/null +++ b/scripts/TWM2/Bosses/ShadeLord.cs @@ -0,0 +1,548 @@ +//SHADE LORD +function ShadeLordSword::OnExplode(%data, %proj, %pos, %mod) { + %source = %proj.SourceObject; + InitContainerRadiusSearch(%pos, 6, $TypeMasks::PlayerObjectType); + while ((%potentialTarget = ContainerSearchNext()) != 0) { + if(%potentialTarget != %source) { + serverPlay3D(BOVHitSound,%potentialTarget.getPosition()); + MessageAll('msgDeath', "\c0"@%potentialTarget.client.namebase@" was killed by the shadowy forces of death."); + %potentialTarget.blowUp(); + %potentialTarget.scriptKill(); + createBlood(%potentialTarget); + //=========================== + %potentialTarget.schedule(750, Blowup); + schedule(750, 0, createBlood, %potentialTarget); + %potentialTarget.schedule(1250, Blowup); + schedule(1250, 0, createBlood, %potentialTarget); + + schedule(1250, 0, doReturnMissile, %potentialTarget, %source); + } + } + + if(isObject(%proj.targetedPlayer) && %proj.targetedPlayer.getState() !$= "dead") { + %proj.targetedPlayer.setMoveState(false); //free to move. + } +} + +function doReturnMissile(%ini, %src) { + %final = vectorAdd(%ini.getPosition(), vectorAdd(getRandomPosition(70, 1), "0 0 250")); + %vec = vectorNormalize(vectorSub(%final, %ini.getPosition())); + %p = new SeekerProjectile() { + dataBlock = ShadeLordSword; + initialDirection = %vec; + initialPosition = %ini.getPosition(); + }; + %p.sourceObject = %src; +} + +// +function SpawnShadeLord(%position) { + %Boss = new player(){ + Datablock = "ShadeLordArmor"; + }; + %Cpos = vectorAdd(%position, "0 0 5"); + MessageAll('MsgBossSpawn', "\c4"@$TWM2::BossName["ShadeLord"]@": Take your stand, and prepare to face your destined fate of death!"); + schedule(3000, 0, MessageAll, 'MsgBossSpawn', "\c4"@$TWM2::BossName["ShadeLord"]@": And so it begins... Let's see how you face your fears..."); + schedule(3500, 0, shadeLordToggleCondition, %Boss, 1); + + %command = "shadelorddomove"; + + %Boss.ticks = 0; + InitiateBoss(%Boss, "ShadeLord"); + + %Boss.team = 30; + %zname = $TWM2::BossName["ShadeLord"]; // <- To Hosts, Enjoy, You can + //Change the Zombie Names now!!! + + $ShadeLordBoss::AllowedNighttime = 1; + %Boss.target = createTarget(%Boss, %zname, "", "Derm3", '', %Boss.team, PlayerSensor); + setTargetSensorData(%Boss.target, PlayerSensor); + setTargetSensorGroup(%Boss.target, 30); + setTargetName(%Boss.target, addtaggedstring(%zname)); + setTargetSkin(%Boss.target, 'Horde'); + // + %Boss.setTransform(%cpos); + %Boss.canjump = 1; + %Boss.hastarget = 1; + MissionCleanup.add(%Boss); + schedule(7500, %Boss, %command, %Boss); +} + +function ShadeLordToggleCondition(%Boss, %on) { + if(!isObject(%Boss) || %Boss.getState() $= "dead") { + return; + } + cancel(%boss.attacks); + if(%on) { + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + %Boss.setMoveState(true); + %Boss.setActionThread("cel4",true); + %Boss.schedule(3500, "SetMoveState", false); + skyVeryDark(); + + %boss.attacks = ShadeLordDarkAttacks(%Boss); + } + else { + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + %Boss.setMoveState(true); + %Boss.setActionThread("death1",true); + %Boss.schedule(3000, "setActionThread", "cel4", true); + %Boss.schedule(4500, "SetMoveState", false); + skyDusk(); + + cancel(%boss.antiSky); + cancel(%boss.randomFX); + + %boss.antiSky = ""; + %boss.randomFX = ""; + %boss.attacks = schedule(4500, 0, "ShadeLordLightAttacks", %Boss); + } +} + +function ShadeStormAntiSky(%boss) { + if(!isObject(%boss) || %boss.getState() $= "Dead") { + return; + } + if(!$ShadeLordBoss::AllowedNighttime) { + return; + } + %killHeight = getWord(%boss.getPosition(), 2) + 50; + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + if(isObject(%cl.player) && %cl.player.getState() !$= "dead") { + if(getWord(%cl.player.getPosition(), 2) >= %killHeight) { + ShadeDropKill(%boss, %cl.player); + } + } + } + %boss.antiSky = schedule(2500, 0, "ShadeStormAntiSky", %boss); +} + +function ShadeStormFX(%boss) { + if(!isObject(%boss) || %boss.getState() $= "Dead") { + return; + } + %bPos = %boss.getPosition(); + %start1 = vectorAdd(%bPos, "300 -300 50"); + %go = vectorAdd(%bPos, "-300 300 50"); + %interval = 15; + for(%i = 0; %i < 20; %i++) { + %neg = %i % 2 == 0 ? 1 : -1; + %start = vectorAdd(%start1, %neg*%interval*%i@" 0 0"); + %vec = vectorNormalize(vectorSub(%go,%start)); + %p = new SeekerProjectile() { + dataBlock = ShadeLordSword; + initialDirection = %vec; + initialPosition = %start; + }; + %p.sourceObject = %boss; + } + + %boss.randomFX = schedule(getRandom(10000, 25000), 0, ShadeStormFX, %boss); +} + +function ShadeLordDarkAttacks(%boss) { + if(!isObject(%boss) || %boss.getState() $= "Dead") { + return; + } + + if(isObject(%boss.dayCloak)) { + %boss.dayCloak.delete(); + } + + if(%boss.randomFX $= "") { + %boss.randomFX = ShadeStormFX(%boss); + } + if(%boss.antiSky $= "") { + %boss.antiSky = ShadeStormAntiSky(%boss); + } + + %attack = getRandom(1, 3); + switch(%attack) { + case 1: + MessageAll('MsgBossSpawn', "\c4"@$TWM2::BossName["ShadeLord"]@": SHALDORVAAAAAAAAAAAAAAH!!!!!!!"); + ShadeLordPerformScream(%boss); + case 2: + ShadeLordStormDescendAttack(%boss, 0); + MessageAll('MsgBossSpawn', "\c4"@$TWM2::BossName["ShadeLord"]@": Descend Mighty Shade Storm, Destroy all who dare oppose us!"); + case 3: + %target = FindValidTarget(%z); + if(isObject(%target.player)) { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["ShadeLord"]@": Come forth my shade, Destroy "@getTaggedString(%target.name)@"!"); + %boss.setMoveState(true); + %boss.schedule(5000, setMoveState, false); + %boss.setActionThread($Zombie::RogThread,true); + // + %bPos = %boss.getPosition(); + %start1 = vectorAdd(%bPos, "300 -300 50"); + %go = vectorAdd(%bPos, "-300 300 50"); + %interval = 15; + for(%i = 0; %i < 20; %i++) { + %neg = %i % 2 == 0 ? 1 : -1; + %start = vectorAdd(%start1, %neg*%interval*%i@" 0 0"); + %vec = vectorNormalize(vectorSub(%go,%start)); + %p = new SeekerProjectile() { + dataBlock = ShadeLordSword; + initialDirection = %vec; + initialPosition = %start; + }; + %p.sourceObject = %boss; + %p.targetedPlayer = %target.player; + %beacon = new BeaconObject() { + dataBlock = "SubBeacon"; + beaconType = "vehicle"; + position = %target.player.getWorldBoxCenter(); + }; + %beacon.team = 0; + %beacon.setTarget(0); + MissionCleanup.add(%beacon); + %p.setObjectTarget(%beacon); + DemonMotherMissileFollow(%target.player,%beacon,%p); + } + // + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["ShadeLord"]@": Hiding in death does not save you "@getTaggedString(%target.name)@""); + } + } + + %boss.attacks = schedule(25000, 0, "ShadeLordDarkAttacks", %boss); +} + +function ShadeLordLightAttacks(%boss) { + if(!isObject(%boss) || %boss.getState() $= "Dead") { + return; + } + + if(isObject(%boss.shadeStorm)) { + %boss.shadeStorm.delete(); + } + if(!isObject(%boss) || !%boss.getState() $= "dead") { + if(isObject(%boss.dayCloak)) { + %boss.dayCloak.delete(); + } + if(isObject(%boss.shadeStorm)) { + %boss.shadeStorm.delete(); + } + return; + } + + %attack = getRandom(1, 1); + switch(%attack) { + case 1: + MessageAll('MsgBossSpawn', "\c4"@$TWM2::BossName["ShadeLord"]@": SHALDORVAAAAAAAAAAAAAAH!!!!!!!"); + ShadeLordPerformScream(%boss); + case 2: + MessageAll('MsgBossEvilness', "\c4"@$TWM2::BossName["ShadeLord"]@": Come forth, and return to me my power of the shadows!"); + ShadeLordBeginHealSequ(%boss, 0); + } + %boss.attacks = schedule(25000, 0, "ShadeLordLightAttacks", %boss); +} + +/////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////// +function ShadeLordBeginHealSequ(%boss, %count) { + if(!isObject(%boss) || %boss.getState() $= "dead") { + return; + } + + if(%count == 0) { + %boss.setMoveState(true); + %boss.setPosition(vectorAdd(%boss.getPosition(), getRandomPosition(700, 1))); + cancel(%boss.moveLoop); + } + if(%count < 25) { + %boss.setDamageLevel(%boss.getDamageLevel() - 1.0); + createLifeEmitter(%boss.getPosition(), PrebeamEmitter, 5000); + } + else { + %boss.schedule(3000, setMoveState, false); + %boss.moveLoop = schedule(3000, %boss, "shadelorddomove", %boss); + return; + } + schedule(200, 0, "ShadeLordBeginHealSequ", %boss, %count++); +} + +function ShadeLordStormDescendAttack(%boss, %count) { + if(%count == 0) { + cancel(%boss.moveLoop); + %boss.rapierShield = 1; + %boss.setMoveState(true); + // + if(isObject(%boss.shadeStorm)) { + %boss.shadeStorm.delete(); + } + } + else if(%count > 0 && %count <= 25) { + %pos = "0 0 "@ 250 - (10 * %count); + if(isObject(%boss.shadeStorm)) { + %boss.shadeStorm.delete(); + } + %boss.shadeStorm = new ParticleEmissionDummy(){ + position = vectoradd(%boss.getPosition(), %pos); + dataBlock = "defaultEmissionDummy"; + emitter = "ShadeStormEmitter"; //ShadeStormEmitter + }; + //%boss.shadeStorm.setPosition(vectorAdd(%boss.getPosition(), %pos)); + } + else if(%count == 26) { + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + if(isObject(%cl.player) && %cl.player.getState() !$= "dead") { + ShadeDropKill(%boss, %cl.player); + } + } + + if(isObject(%boss.shadeStorm)) { + %boss.shadeStorm.delete(); + } + %boss.shadeStorm = new ParticleEmissionDummy(){ + position = vectoradd(%Demon.getPosition(), "0 0 0.5"); + dataBlock = "defaultEmissionDummy"; + emitter = "ShadeStormEmitter"; //ShadeStormEmitter + }; + } + else if(%count > 26 && %count < 40) { + if(isObject(%boss.shadeStorm)) { + %boss.shadeStorm.delete(); + } + %boss.shadeStorm = new ParticleEmissionDummy(){ + position = vectoradd(%boss.getPosition(), "0 0 1.5"); + dataBlock = "defaultEmissionDummy"; + emitter = "ShadeStormEmitter"; //ShadeStormEmitter + }; + } + else if(%count == 40) { + %boss.rapierShield = 0; + %boss.setMoveState(false); + %boss.moveLoop = schedule(3000, %boss, "shadelorddomove", %boss); + + //flash all + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + if(isObject(%cl.player) && %cl.player.getState() !$= "dead") { + %cl.player.setWhiteout(1.0); + } + } + return; + } + + %count++; + schedule(300, 0, "ShadeLordStormDescendAttack", %boss, %count); +} + +function ShadeLordPerformScream(%boss) { + cancel(%boss.moveloop); + %boss.setMoveState(true); + %boss.schedule(5000, setMoveState, false); + //create emitter + %screamEmit = new ParticleEmissionDummy(){ + position = vectoradd(%boss.getPosition(),"0 0 0.5"); + dataBlock = "defaultEmissionDummy"; + emitter = "ShadeLordScreamEmitter"; //ShadeStormEmitter + }; + %screamEmit.schedule(5000, "delete"); + + //knock down and throw weapons in radius. + %TargetSearchMask = $TypeMasks::PlayerObjectType; + InitContainerRadiusSearch(%boss.getPosition(), 200, %TargetSearchMask); + while ((%potentialTarget = ContainerSearchNext()) != 0) { + if(isSet(%potentialTarget.client)) { + //throw guns, knock down. + %potentialTarget.setActionThread("death1", true); + %potentialTarget.throwweapon(1); + %potentialTarget.throwweapon(0); + %potentialTarget.setMoveState(true); + %potentialTarget.schedule(3000, setMoveState, false); + } + } + // + + %boss.moveLoop = schedule(5000, %boss, "shadelorddomove", %boss); +} + + +/////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////// +function ShadeLordDoDeath(%boss) { + %boss.RapierShield = 1; + %boss.inDeath = 1; + if(isObject(%boss.dayCloak)) { + %boss.dayCloak.delete(); + } + if(isObject(%boss.shadeStorm)) { + %boss.shadeStorm.delete(); + } + //set on fire + %fire = new ParticleEmissionDummy(){ + position = vectoradd(%boss.getPosition(),"0 0 0.5"); + dataBlock = "defaultEmissionDummy"; + emitter = "BurnEmitter"; + }; + MissionCleanup.add(%fire); + %fire.schedule(5000, delete); + // + %Boss.setMoveState(true); + %boss.setActionThread("death1", true); + %boss.schedule(5000, "blowup"); + %boss.schedule(5000, "scriptkill"); + schedule(4999, 0, eval, ""@%boss@".rapierShield = 0;"); + + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); + Serverplay3D($Ion::ThunderSound[mFloor(getRandom() * $Ion::ThunderSoundCount)],%boss.getPosition()); +} + +function shadelorddomove(%Demon){ + if(!isobject(%Demon) || %Demon.getState() $= "Dead") { + if(isObject(%Demon.dayCloak)) { + %Demon.dayCloak.delete(); + } + if(isObject(%Demon.shadeStorm)) { + %Demon.shadeStorm.delete(); + } + return; + } + + if(%demon.getDamageLeftPct() < 0.005) { + ShadeLordDoDeath(%Demon); + } + + if(%demon.getDamageLeftPct() < 0.4) { + if($ShadeLordBoss::AllowedNighttime == 1) { + $ShadeLordBoss::AllowedNighttime = 0; + ShadeLordToggleCondition(%Demon, 0); + MessageAll('MsgBossSpawn', "\c4"@$TWM2::BossName["ShadeLord"]@": No, You will not break the barrier of dark!"); + } + } + else { + if($ShadeLordBoss::AllowedNighttime == 0) { + $ShadeLordBoss::AllowedNighttime = 1; + ShadeLordToggleCondition(%Demon, 1); + MessageAll('MsgBossSpawn', "\c4"@$TWM2::BossName["ShadeLord"]@": Awaken, mighty storm of shade, bring forth the doom of our foes!"); + } + } + + if(isObject(%Demon.dayCloak) && !%Demon.inDeath) { + %Demon.dayCloak.delete(); + %Demon.dayCloak = new ParticleEmissionDummy(){ + position = vectoradd(%Demon.getPosition(),"0 0 0.5"); + dataBlock = "defaultEmissionDummy"; + emitter = "dayCloakEmitter"; //ShadeStormEmitter + }; + MissionCleanup.add(%Demon.dayCloak); + } + else { + if($ShadeLordBoss::AllowedNighttime == 0) { + %Demon.dayCloak = new ParticleEmissionDummy(){ + position = vectoradd(%Demon.getPosition(),"0 0 0.5"); + dataBlock = "defaultEmissionDummy"; + emitter = "dayCloakEmitter"; //ShadeStormEmitter + }; + } + } + + + if(isObject(%Demon.shadeStorm)) { + %Demon.shadeStorm.delete(); + %Demon.shadeStorm = new ParticleEmissionDummy(){ + position = vectoradd(%Demon.getPosition(),"0 0 250"); + dataBlock = "defaultEmissionDummy"; + emitter = "ShadeStormEmitter"; //ShadeStormEmitter + }; + } + else { + if($ShadeLordBoss::AllowedNighttime == 1) { + %Demon.shadeStorm = new ParticleEmissionDummy(){ + position = vectoradd(%Demon.getPosition(),"0 0 250"); + dataBlock = "defaultEmissionDummy"; + emitter = "ShadeStormEmitter"; //ShadeStormEmitter + }; + } + } + + %pos = %Demon.getworldboxcenter(); + %closestClient = ZombieLookForTarget(%Demon); + %z = getWord(%pos, 2); + if(%z < -300) { + %Demon.startFade(400, 0, true); + %Demon.startFade(1000, 0, false); + %Demon.setPosition(vectorAdd(vectoradd(%closestclient.getPosition(), "0 0 20"), getRandomPosition(25, 1))); + %Demon.setVelocity("0 0 0"); + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["ShadeLord"]@": I'm back...."); + } + %closestDistance = getWord(%closestClient,1); + %closestClient = getWord(%closestClient,0).Player; + if(%closestDistance <= $Zombie::detectDist){ + if(%closestDistance < 10) { + ShadeDropKill(%Demon, %closestClient); + MessageAll('MsgVardison', "\c4"@$TWM2::BossName["ShadeLord"]@": Feel The Vengeance of the Shadows "@getTaggedString(%closestClient.client.name)@"."); + %closestClient.setMoveState(true); + ShadeLordRandomTeleport(%Demon); + } + if(%Demon.hastarget != 1){ + %Demon.hastarget = 1; + } + + %vector = ZgetFacingDirection(%Demon,%closestClient,%pos); + + %vector = vectorscale(%vector, $Zombie::DForwardSpeed); + %upvec = "150"; + %x = Getword(%vector,0); + %y = Getword(%vector,1); + %z = Getword(%vector,2); + if(%z >= ($Zombie::DForwardSpeed)) + %upvec = (%upvec * 5); + %vector = %x@" "@%y@" "@%upvec; + %Demon.applyImpulse(%pos, %vector); + } + else if(%Demon.hastarget == 1){ + %Demon.hastarget = 0; + %Demon.DemonRmove = schedule(100, %Demon, "ZSetRandomMove", %Demon); + } + %Demon.moveloop = schedule(500, %Demon, "shadelorddomove", %Demon); +} + +function ShadeDropKill(%boss, %target) { + %incoming = vectorAdd(%target.getPosition(), vectorAdd(getRandomPosition(70, 1), "0 0 250")); + %vec = vectorNormalize(vectorSub(%target.getPosition(),%incoming)); + %p = new SeekerProjectile() { + dataBlock = ShadeLordSword; + initialDirection = %vec; + initialPosition = %incoming; + }; + %p.sourceObject = %boss; + %p.targetedPlayer = %target; + %beacon = new BeaconObject() { + dataBlock = "SubBeacon"; + beaconType = "vehicle"; + position = %target.getWorldBoxCenter(); + }; + %beacon.team = 0; + %beacon.setTarget(0); + MissionCleanup.add(%beacon); + %p.setObjectTarget(%beacon); + DemonMotherMissileFollow(%target,%beacon,%p); +} + +function ShadeLordRandomTeleport(%boss) { + if(!isObject(%boss) || %boss.getState() $= "dead") { + return; + } + + %newPosition = vectorAdd(%boss.getPosition(), getRandomPosition(150, 1)); + %boss.setPosition(%newPosition); +} diff --git a/scripts/TWM2/Bosses/Stormrider.cs b/scripts/TWM2/Bosses/Stormrider.cs new file mode 100644 index 0000000..17bec57 --- /dev/null +++ b/scripts/TWM2/Bosses/Stormrider.cs @@ -0,0 +1,379 @@ +//Stormrider.cs +//Ported From TWM1 +//Code Updated By Phantom139 +// * 2-18-14: Did some housecleaning, harvested some unneeded functions here. + +function UltrDroneBattle(%pos, %radius, %number, %teamlow, %teamhigh, %maxskill, %slth){ + for(%i = 0; %i < %number; %i++){ + %startpos = vectorAdd(%pos,(getRandom(0, %radius) - (%radius / 2))@" "@(getRandom(0, %radius) - (%radius / 2))@" 0"); + %rotation = "0 0 1 "@getRandom(1,360); + if(%teamlow != %teamhigh) { + %team = getRandom(%teamlow, %teamhigh); + } + else { + %team = %teamlow; + } + StartUltrDrone(%startpos,%rotation,%team,getRandom(1,%maxskill), %slth); + } +} + +//This sets up the drone and the functions needed to start the drone. +function StartUltrDrone(%pos, %rotation, %team, %skill, %slth) { + if(%team $= "") { + %team = 0; + } + if(%pos $= "") { + %pos = "0 0 300"; + } + if(%rotation $= "") { + %rotation = "1 0 0 0"; + } + if(%skill !$= "ace") { + if(%skill $= "" || %skill < 1) { + %skill = 10; + } + else if(%skill > 10) { + %skill = 10; + } + } + %Drone = new FlyingVehicle() { + dataBlock = StormSeigeDrone; + position = %pos; + rotation = %rotation; + team = %team; + }; + MissionCleanUp.add(%Drone); + + setTargetSensorGroup(%Drone.getTarget(), %team); + + %Drone.isdrone = 1; + %drone.dodgeGround = 0; + + if(%slth) { + %Drone.setCloaked(true); + } + + if(%skill $= "ace"){ + %skill = 10; + %drone.isace = 1; + } + + %drone.skill = 0.2 + (%skill / 12.5); + + schedule(100, 0, "DroneForwardImpulse", %drone); + schedule(101, 0, "DronefindTarget", %drone); + schedule(102, 0, "DroneScanGround", %drone); + + return %drone; +} + +function StartStormrider(%position) { + %pos = vectoradd(%position, "0 0 500"); + %pos2 = vectoradd(%position, "15 0 500"); + %pos3 = vectoradd(%position, "-15 0 500"); + %drone = UltrDroneBattle(%pos, 500, 1, 6, 6, "ace", 0); //yes this bad guy is stealthed + %d2 = DroneBattle(%pos2, 500, 1, 6, 6, 100, 0); //his Pal + %d3 = DroneBattle(%pos3, 500, 1, 6, 6, 100, 0); //his Other Pal + %drone.isUltr = 1; + %drone.isBoss = 1; + %d2.isUltrally = 1; + %d3.isUltrally = 1; + UltraBossAbilities(%drone); + + InitiateBoss(%drone, "Stormrider"); +} + +function UltraBossAbilities(%drone) { + if(!isObject(%drone)) { + return; + } + %drone.setCloaked(false); //disable cloak? + %rand = getRandom(1,13); + + switch(%rand) { + + //1: Double Missile Strike: Targets Single Player with Two Missiles + case 1: + %target = DroneFindNearestPilot(2000, %drone); + if(%target.player) { + %SPos1 = vectorAdd(%drone.getPosition(),"3 0 0"); + %SPos2 = vectorAdd(%drone.getPosition(),"-3 0 0"); + %p1 = new SeekerProjectile() { + dataBlock = LordRogStiloutte; + initialDirection = "0 0 10"; + initialPosition = %SPos1; + sourceObject = %drone; + sourceSlot = 6; + }; + %p2 = new SeekerProjectile() { + dataBlock = LordRogStiloutte; + initialDirection = "0 0 10"; + initialPosition = %SPos1; + sourceObject = %drone; + sourceSlot = 6; + }; + MissionCleanup.add(%p1); + MissionCleanup.add(%p2); + schedule(1000, 0, WindshearAttack_FUNC, "MissileDrop", %target.player SPC %p1); + schedule(1000, 0, WindshearAttack_FUNC, "MissileDrop", %target.player SPC %p2); + MessageAll('MessageAll', "\c4Stormrider: Fire!"); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": No targets for me!"); + } + + //2: Quad Strike: Fire Four Missiles out in a + pattern which then aquire a single target. + case 2: + %target = DroneFindNearestPilot(2000, %drone); + if(%target.player) { + %SPos = vectorAdd(%drone.getPosition(),"0 0 3"); + %dirs = "5 0 0\t-5 0 0\t0 5 0\t0 -5 0"; + for(%i = 0; %i < getFieldCount(%dirs); %i++) { + %newMissile = new SeekerProjectile() { + dataBlock = ShoulderMissile; + initialDirection = getField(%dirs, %i); + initialPosition = %SPos; + sourceObject = %drone; + sourceSlot = 6; + }; + MissionCleanup.add(%newMissile); + schedule(1000, 0, WindshearAttack_FUNC, "MissileDrop", %target.player SPC %newMissile); + } + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": Have fun with these "@getTaggedString(%target.name)@"!"); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": Bah, no targets, no fun."); + } + + //3: IR Beam: A single enemy target gets locked on with a heat beam making missiles 100% accurate for a time period + case 3: + %target = DroneFindNearestPilot(2000, %drone); + if(%target.player) { + HeatLoop(%target.player, 0); + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": Lets see what happens when missiles are completely precice on you, "@getTaggedString(%target.name)@"!"); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": I guess it's time to start scanning."); + } + + //4: Auxilary Pod Swarm: Unleash a swarm of hybrid strike missiles on a single enemy target + case 4: + %target = DroneFindNearestPilot(2000, %drone); + if(%target.player) { + FireanotherSidewinder(%drone, %target.player, 3); + schedule(700, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(1400, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(2100, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(2800, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(3500, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(4200, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(4900, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + //Rapid Shot Missiles + schedule(5000, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(5200, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(5400, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(5600, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(5800, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(6000, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(6200, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(6400, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(6500, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": Taste my fury "@getTaggedString(%target.name)@"!"); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": Aww, My missiles were ready."); + } + + //5: Focused Missile Fire: Similar to APS, but more accurate with less shots near the end + case 5: + %target = DroneFindNearestPilot(2000, %drone); + if(%target.player) { + FireanotherSidewinder(%drone, %target.player, 3); + schedule(700, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(1400, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(2100, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(2800, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(3500, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(4200, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(4900, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(5600, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(6300, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + schedule(7000, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 3); + // Quick Shots + schedule(8000, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(8100, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(8200, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + schedule(8300, 0, "WindshearAttack_FUNC", "SidewinderLaunch", %drone SPC %target.player SPC 1); + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": I have missiles with your name on them "@getTaggedString(%target.name)@"!"); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": Aww, My missile strike was ready."); + } + + //6: Clear Skies: Launch a wave on anti-missile flares blocking all missiles from striking Stormrider for a short time. + case 6: + schedule(700, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(1400, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(2100, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(2800, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(3500, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(4200, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(4900, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(5600, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(6300, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(7000, 0, "WindshearAttack_FUNC", "Flare", %drone); + // Quick Shots + schedule(8000, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(8100, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(8200, 0, "WindshearAttack_FUNC", "Flare", %drone); + schedule(8300, 0, "WindshearAttack_FUNC", "Flare", %drone); + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": Hahaha, Your Missiles are worthless Now!"); + + //7: Anti-Ground Chaingun: Fire a rapid strike anti-matter chaingun which does heavy damage to hit targets + case 7: + %target = DroneFindNearestPilot(2000, %drone); + if(%target.player) { + FireSniperShots(%drone, %target.player, 3); + for(%i = 0; %i < 700; %i++) { + %time = %i * 10; + schedule(%time, 0,"FireSniperShots",%drone, %target.player); + } + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": Time to Use My CG, "@getTaggedString(%target.name)@"!"); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": We'll see who can withstand the CG... Oh wait, there's nobody there."); + } + + //8: Photon Seekers: Launch a wave of Photon Seekers to strike a single target + case 8: + %target = DroneFindNearestPilot(2000, %drone); + if(%target.player) { + FireSeekerPhotons(%drone, %target.player); + schedule(1500, 0, "FireSeekerPhotons", %drone, %target.player); + schedule(3000, 0, "FireSeekerPhotons", %drone, %target.player); + schedule(4500, 0, "FireSeekerPhotons", %drone, %target.player); + schedule(6000, 0, "FireSeekerPhotons", %drone, %target.player); + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": Here, "@getTaggedString(%target.name)@", Catch!"); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": Close up the Seekers. No Targets To hit."); + } + + //9: Advanced Photon Wave: Launch an additional Photon Missile compared to #8 + case 9: + %target = DroneFindNearestPilot(2000,%drone); + if(%target.player) { + FireSeekerPhotons(%drone,%target.player); + schedule(700, 0, "FireSeekerPhotons",%drone,%target.player); + schedule(1400, 0, "FireSeekerPhotons",%drone,%target.player); + schedule(2100, 0, "FireSeekerPhotons",%drone,%target.player); + schedule(2800, 0, "FireSeekerPhotons",%drone,%target.player); + schedule(3500, 0, "FireSeekerPhotons",%drone,%target.player); + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": Try these out for size, "@getTaggedString(%target.name)@"!"); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": Heh, No enemies in the area."); + } + + //10: Photon Storm: Launch Photon Missiles to the point of overheating the internal system. + case 10: + %target = DroneFindNearestPilot(2000, %drone); + if(%target.player) { + FireSeekerPhotons(%drone, %target.player); + schedule(500, 0, "FireSeekerPhotons", %drone, %target.player); + schedule(1000, 0, "FireSeekerPhotons", %drone, %target.player); + schedule(1500, 0, "FireSeekerPhotons", %drone, %target.player); + schedule(2000, 0, "FireSeekerPhotons", %drone, %target.player); + schedule(2500, 0, "FireSeekerPhotons", %drone, %target.player); + schedule(3000, 0, "FireSeekerPhotons", %drone, %target.player); + schedule(3500, 0, "FireSeekerPhotons", %drone, %target.player); + schedule(4000, 0, "FireSeekerPhotons", %drone, %target.player); + schedule(4500, 0, "FireSeekerPhotons", %drone, %target.player); + schedule(5000, 0, "FireSeekerPhotons", %drone, %target.player); + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": I have some fun plasma missiles for you, "@getTaggedString(%target.name)@"!"); + } + else { + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": Meh, No targets for my plasma seekers."); + } + + //11: Tactical Camo: Engage an invisibility module to blend in with the sky. + case 11: + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": Engage Stealth!"); + %drone.setCloaked(true); + + //11: Wingmen: Call in 4 Harbinger Aerial Drones to engage air and ground targets. + case 12: + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": My Buddies will handle You!"); + %SPos1 = vectorAdd(%drone.getPosition(), "15 0 0"); + %SPos2 = vectorAdd(%drone.getPosition(), "-15 0 0"); + %SPos3 = vectorAdd(%drone.getPosition(), "0 15 0"); + %SPos4 = vectorAdd(%drone.getPosition(), "0 -15 0"); + %d2 = DroneBattle(%SPos1, 500, 1, 6, 6, 100, 0); //his Pal + %d3 = DroneBattle(%SPos2, 500, 1, 6, 6, 100, 0); //his Other Pal + %d4 = DroneBattle(%SPos3, 500, 1, 6, 6, 100, 0); //his Pal's Pal + %d5 = DroneBattle(%SPos4, 500, 1, 6, 6, 100, 0); //his Pal's Pal's Buddy + %d2.isUltrally = 1; + %d3.isUltrally = 1; + %d4.isUltrally = 1; + %d5.isUltrally = 1; + + //DE: Reinforcements: Call in support from Harbinger Drones + default: + %SPos1 = vectorAdd(%drone.getPosition(),"15 0 0"); + %SPos2 = vectorAdd(%drone.getPosition(),"15 0 0"); + %d2 = DroneBattle(%SPos1, 500, 1, 6, 6, 100, 0); //his Pal + %d3 = DroneBattle(%SPos2, 500, 1, 6, 6, 100, 0); //his Other Pal + %d2.isUltrally = 1; + %d3.isUltrally = 1; + MessageAll('MessageAll', "\c4"@$TWM2::BossName["Stormrider"]@": Get Moving, targets to be hunted!"); + } + schedule(30000,0,"UltraBossAbilities",%drone); +} + +function FireSniperShots(%drone,%target){ +if(!isObject(%drone) || !isObject(%target) || %target.getState() $= "dead") { +return; +} + + %vec = vectorsub(%target.getworldboxcenter(),%drone.getMuzzlePoint(6)); + %vec = vectoradd(%vec, vectorscale(%target.getvelocity(),vectorlen(%vec)/100)); + + %x = (getRandom() - 0.5) * 2 * 3.1415926 * (6/1000); + %y = (getRandom() - 0.5) * 2 * 3.1415926 * (6/1000); + %z = (getRandom() - 0.5) * 2 * 3.1415926 * (6/1000); + %mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z); + %nvec = MatrixMulVector(%mat, %vec); + +%p = new TracerProjectile() +{ +dataBlock = M1Bullet; +initialDirection = %nvec; +initialPosition = %drone.getMuzzlePoint(6); +sourceObject = %drone; +sourceSlot = 6; +}; +} + +function FireSeekerPhotons(%drone,%target){ + if(!isObject(%drone) || !isObject(%target) || %target.getState() $= "dead") { + return; + } + + %proj = createSeekingProjectile(PhotonMissileProj, linearflareprojectile, vectorAdd(%drone.getPosition(), "0 0 5") + , "0 0 3", %drone, %target, 100); + + MissionCleanup.add(%proj); + %proj.PhotonMuzVec = %drone.getMuzzleVector(5); + schedule( 100,0, "PhotonShockwaveFunc" ,%drone,%Proj); +} + +//********************************** +//* Projectiles * +//********************************** +function PhotonMissileProj::onExplode(%data, %proj, %pos, %mod)// ok this is where everything is canceled... the scheds.. this is the buggy part +{ +parent::onexplode(%data, %proj, %pos, %mod); +cancel(%proj.seeksched); +cancel(%proj.PhotonShockwaveSched); +cancel(%proj.seekschedcheck); +} diff --git a/scripts/TWM2/ChatCommands/Admin.cs b/scripts/TWM2/ChatCommands/Admin.cs new file mode 100644 index 0000000..1fc9b7c --- /dev/null +++ b/scripts/TWM2/ChatCommands/Admin.cs @@ -0,0 +1,1007 @@ +function parseAdminCommands(%sender, %command, %args) { + switch$(strLwr(%command)) { + //admincmds: lists the avaliable mod admin commands + case "admincmds": + if (!%sender.isadmin) { + return 2; + } + messageclient(%sender, 'MsgClient', '\c5TWM2 Admin Commands.'); + messageclient(%sender, 'MsgClient', '\c3/moveme, /moveto, /kill, /goto, /summon'); + messageclient(%sender, 'MsgClient', '\c3/removePieces, /giveOrphans, /forcePieces'); + messageclient(%sender, 'MsgClient', '\c3/myname, /setname, /cancelVote, /A, /getPos'); + messageclient(%sender, 'MsgClient', '\c3/bp, /cp, /confiscate, /gag, /ZCmds, /passVote'); + messageclient(%sender, 'MsgClient', '\c3/getDBs, /giveGun, /TwoTeams, /slap, /freeze'); + messageclient(%sender, 'MsgClient', '\c3/warn'); + return 1; + + //moveme: moves a player in worldspace coords + case "moveme": + if (!%sender.isadmin) { + return 2; + } + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2You must have a player object.'); + return 1; + } + %currentpos = %sender.player.getposition(); + %movepos = %args; + if(mAbs(getWord(%movePos, 0)) > 5000 || mAbs(getWord(%movePos, 1)) > 5000 || mAbs(getWord(%movePos, 2)) > 5000) { + messageclient(%sender, 'MsgClient', '\c2Invalid coordinate provided.'); + return 1; + } + %gototarget = vectoradd(%currentpos, %movepos); + %sender.player.settransform(%gototarget); + messageclient(%sender,'MsgClient', "\c5Moving "@%args@"."); + return 1; + + //moveto: teleports directly to the given worldspace coords + case "moveto": + if (!%sender.isadmin) { + return 2; + } + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2You must have a player object.'); + return 1; + } + %movepos = %args; + if(mAbs(getWord(%movePos, 0)) > 10000 || mAbs(getWord(%movePos, 1)) > 10000 || mAbs(getWord(%movePos, 2)) > 10000) { + messageclient(%sender, 'MsgClient', '\c2Invalid coordinate provided.'); + return 1; + } + %sender.player.settransform(%movepos); + messageclient(%sender,'MsgClient', "\c2Moving to \c3"@%args@"."); + return 1; + + //kill: simple enough, smite a player dead + case "kill": + if (!%sender.isadmin) { + return 2; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if(!isObject(%target.player) || %target.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2The Target Player must have a player object.'); + return 1; + } + %target.player.scriptkill($DamageType::Admin); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 killed \c3"@ %target.namebase@"\c2."); + messageclient(%target, 'MsgClient', "\c5you were Pinged by "@ %sender.namebase@", Enjoy your pain"); + return 1; + + //goto: teleport to a given player + case "goto": + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2The Target Player must have a player object.'); + return 1; + } + if (!%sender.isadmin) { + return 2; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if(!isObject(%target.player) || %target.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2The Target Player must have a player object.'); + return 1; + } + %targetpos = %target.player.getposition(); + %transoffset = getrandom(-2,2) SPC getrandom(-2,2) SPC getrandom(-2,2); + %gototarget = vectoradd(%targetpos, %transoffset); + %sender.player.settransform(%gototarget); + %sender.player.setvelocity("0 0 0"); + messageclient(%sender,'MsgClient', "\c5you warped to " @ %target.namebase @ "."); + messageclient(%target,'MsgClient', "\c5" @ %sender.namebase @ " has come to you."); + return 1; + + //summon: teleport a player to you + case "summon": + if (!%sender.isadmin) { + return 2; + } + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2You must have a player object.'); + return 1; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if(!isObject(%target.player) || %target.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2The Target Player must have a player object.'); + return 1; + } + if(%target.player.isPilot() == true) { + messageclient(%sender, 'MsgClient', '\c2You cant summon pilots.'); + return 1; + } + %senderpos = %sender.player.getposition(); + %transoffset = getrandom(-2,2) SPC getrandom(-2,2) SPC 2; + %gotosender = vectoradd(%senderpos, %transoffset); + %target.player.settransform(%gotosender); + %target.player.setvelocity("0 0 0"); + messageclient(%sender, 'MsgClient', "\c3You summoned "@%target.namebase@ "."); + messageclient(%target, 'MsgClient', "\c3The admin has summoned you."); + return 1; + + //removePieces: delete a specific player's pieces + case "removepieces": + if (!%sender.isadmin) { + return 2; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if (%target.isadmin && %sender.isadmin) { + messageclient(%sender, 'MsgClient', '\c2You cant remove Other Admin pieces.'); + return 1; + } + if (%target.issuperadmin && %sender.isadmin) { + messageclient(%sender, 'MsgClient', '\c2You cant remove SA pieces.'); + return 1; + } + if (%target.issuperadmin && %sender.issuperadmin) { + messageclient(%sender, 'MsgClient', '\c2You cant remove Other SA pieces.'); + return 1; + } + if (%target == %sender) { + messageclient(%sender, 'MsgClient', '\c2The Command for self piece removal is /delmypieces'); + return 1; + } + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Removed \c3"@ %target.namebase@"'s\c2 Pieces for Violations."); + %group = nameToID("MissionCleanup/Deployables"); + %count = %group.getCount(); + for (%i = 0; %i < %count; %i++) { + %obj = %group.getObject(%i); + if (%obj.getOwner() == %target) { + %random = getRandom(500,3000); + %obj.getDataBlock().schedule(%random,"disassemble",%sender.player,%obj); + } + } + return 1; + + //giveOrphans: give all unowned pieces to a player + case "giveorphans": + if (!%sender.isadmin) { + return 2; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 gave all orphanned pieces to \c3"@ %target.namebase@"\c2."); + %group = nameToID("MissionCleanup/Deployables"); + %count = %group.getCount(); + for (%i = 0; %i < %count; %i++) { + %obj = %group.getObject(%i); + if (%obj.getOwner() $= "") { + %obj.owner = %target; + %obj.ownerGuid = %target.guid; + } + } + return 1; + + //forcePieces: same effect as giveorphans, but it gives an owned players pieces away + case "forcepieces": + if (!%sender.isadmin) { + return 2; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such target player.'); + return 1; + } + // + %nametotest2 = getword(%args,1); + %target2 = plnametocid(%nametotest2); + if (%target2 == 0) { + messageclient(%sender, 'MsgClient', '\c2Reciving player not located, Giving to you.'); + %target2 = %sender; + return 1; + } + // + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 gave \c3"@%target.namebase@"'s\c2 pieces to \c3"@ %target2.namebase@"\c2."); + %group = nameToID("MissionCleanup/Deployables"); + %count = %group.getCount(); + for (%i = 0; %i < %count; %i++) { + %obj = %group.getObject(%i); + if (%obj.getOwner() $= %target) { + %obj.owner = %target2; + %obj.ownerGuid = %target2.guid; + } + } + return 1; + + //myname: change your player name + case "myname": + if (!%sender.isadmin) { + return 2; + } + %name = getwords(%args,0); + if(strstr(%name, "Phantom139") != -1) { + if(%sender.guid !$= "2000343") { + messageclient(%sender, 'MsgClient', '\c2That name is reserved.'); + return 1; + } + } + %oldname = %sender.namebase; + if (%name $= "default") { + %authInfo = %sender.getAuthInfo(); + %name = getField( %authInfo, 0 ); + %tag = getField(%authInfo, 6); + %append = getField(%authInfo, 7 ); + if ( %append ) { + %name = "\cp\c6" @ %name @ "\c7" @ %tag @ "\co"; + } + else { + %name = "\cp\c7" @ %tag @ "\c6" @ %name @ "\co"; + } + messageclient(%sender, 'MsgClient', "\c2Your Name Has Reset"); + MessageAll( 'MsgClientNameChanged', "", %sender.name, %name, %sender ); + removeTaggedString(%sender.name); + %sender.name = addTaggedString(%name); + setTargetName(%sender.target, %sender.name); + checkGUID(%sender); + return 1; + } + %oldName = getTaggedString(%sender.name); + %sender.name = addTaggedString(collapseEscape(%name)); + setTargetName(%sender.target, %sender.name); + messageAll('MsgClientNameChanged', "", %oldName, %sender.name, %sender); + messageclient(%sender, 'MsgClient', "\c2Your Name Has Been Set To "@%args@""); + return 1; + + //setname: change another player's name + case "setname": + if (!%sender.isadmin) { + return 2; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + %nametoset=getwords(%args,1); + %oldname = %target.namebase; + if(strstr(%nametoset, "Phantom139") != -1) { + if(%target.guid !$= "2000343") { + messageclient(%sender, 'MsgClient', '\c2That name is reserved.'); + return 1; + } + } + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if (%target.isdev) { + messageclient(%sender, 'MsgClient', '\c2No changing Dev names.'); + return 1; + } + if (%target.isadmin && %sender.isadmin && !%sender.isSuperAdmin && !%sender.isDev) { + messageclient(%sender, 'MsgClient', "\c2Error: ranking Issue, "@%target.namebase@" is your level of admin."); + return 1; + } + if (%target.issuperadmin && %sender.isadmin && %sender.isSuperAdmin && !%sender.isDev) { + messageclient(%sender, 'MsgClient', "\c2Error: ranking Issue, "@%target.namebase@" is your level of admin."); + return 1; + } + if (%target.issuperadmin && %sender.isadmin && !%sender.isSuperAdmin && !%sender.isDev) { + messageclient(%sender, 'MsgClient', "\c2Error: Over-ranking Issue, "@%target.namebase@" outranks you"); + return 1; + } + if (%nametoset $= "default") { + %authInfo = %target.getAuthInfo(); + %name = getField( %authInfo, 0 ); + %tag = getField(%authInfo, 6); + %append = getField(%authInfo, 7 ); + if ( %append ) { + %name = "\cp\c6" @ %name @ "\c7" @ %tag @ "\co"; + } + else { + %name = "\cp\c7" @ %tag @ "\c6" @ %name @ "\co"; + } + messageclient(%sender, 'MsgClient', "\c2"@%oldname@"'s Name Has Reset"); + messageclient(%target, 'MsgClient', "\c2"@%sender.namebase@" Reset your name"); + MessageAll( 'MsgClientNameChanged', "", %target.name, %name, %target ); + removeTaggedString(%target.name); + %target.name = addTaggedString(%name); + setTargetName(%target.target, %target.name); + checkGUID(%target); + return 1; + } + %oldName = getTaggedString(%Target.name); + %Target.name = addTaggedString(collapseEscape(%nametoset)); + setTargetName(%Target.target, %Target.name); + messageAll('MsgClientNameChanged', "", %oldName, %Target.name, %Target); + messageclient(%target, 'MsgClient', "\c2Your Name Has Been Set To "@%name@""); + return 1; + + //cancelvote: cancel a current vote in progress + case "cancelvote": + if (!%sender.isadmin) { + return 2; + } + if(game.schedulevote !$="") { + cancel(game.ScheduleVote); + Game.scheduleVote = ""; + Game.kickClient = ""; + clearVotes(); + %count = clientgroup.getcount(); + for(%i = 0; %i < %count; %i++) { + messageClient(clientgroup.getobject(%i), 'closeVoteHud', ""); + } + messageAll('MsgAdminForce', "\c2Vote Canceled by \c3"@%sender.namebase@"\c2."); + return 1; + } + else { + messageclient(%sender, 'MsgClient', '\c2No Vote To Cancel.'); + return 1; + } + + //a: admin only chat + case "a": + if (!%sender.isadmin) { + return 2; + } + %count = ClientGroup.getCount(); + for (%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject( %i ); + if(%cl.isadmin) { + messageclient(%cl, 'MsgClient', "\c5[A]"@%sender.namebase@" : \c4"@%args@""); + } + } + return 1; + + //getPos: get your current worldspace positions + case "getpos": + if (!%sender.isadmin) { + return 2; + } + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2You must have a player object.'); + return 1; + } + messageclient(%sender, 'MsgClient', "\c2Your current map position is: \c3"@%sender.player.getPosition()@"\c2."); + return 1; + + //bp: bottom print message to everyone + case "bp": + if (!%sender.isadmin) { + return 2; + } + MessageAll('MsgAdminPrint',"\c5[BP]"@%sender.namebase@": \c4"@%args@""); + BottomPrintAll(""@%sender.namebase@" : "@%args, 5, 3); + return 1; + + //cp: center print message to everyone + case "cp": + if (!%sender.isadmin) { + return 2; + } + MessageAll('MsgAdminPrint',"\c5[CP]"@%sender.namebase@": \c4"@%args@""); + CenterPrintAll(""@%sender.namebase@" : "@%args, 5, 3); + return 1; + + //confiscate: revoke a player's admin weapons + case "confiscate": + if (!%sender.isadmin) { + return 2; + } + if(%sender.isAdmin && !%sender.isSuperAdmin) { + if (%sender.isconfiscated) { + if(%sender.Confisc["BySA"]) { + messageclient(%sender, 'MsgClient', '\c5You cannot undo an SA confiscate'); + return 1; + } + else { + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 can now use his weapons again"); + messageclient(%sender, 'MsgClient', '\c5 You are re-allowed to your weapons'); + %sender.isconfiscated =0; + return 1; + } + } + else { + %sender.isconfiscated =1; + %sender.getsadminguns = 0; + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + return 1; + } + else { + %sender.player.use(SuperChaingun); + %sender.player.throwweapon(1); + %sender.player.throwweapon(0); + } + %Gender = (%sender.sex $= "Male" ? 'his' : 'her'); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Revoked "@getTaggedString(%gender)@" admin Weapons"); + messageclient(%sender, 'MsgClient', '\c5 You lost all of your admin weapons'); + return 1; + } + } + else { + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if(%nametotest $= "") { + if (%sender.isconfiscated) { + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 can now use his weapons again"); + messageclient(%sender, 'MsgClient', '\c5 You are re-allowed to your weapons'); + %sender.isconfiscated =0; + return 1; + } + else { + %sender.isconfiscated =1; + %sender.getsadminguns = 0; + %sender.getsSAguns = 0; + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + return 1; + } + else { + %sender.player.use(SuperChaingun); + %sender.player.throwweapon(1); + %sender.player.throwweapon(0); + } + %Gender = (%sender.sex $= "Male" ? 'his' : 'her'); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Revoked "@getTaggedString(%gender)@" admin Weapons"); + messageclient(%sender, 'MsgClient', '\c5 You lost all of your admin weapons'); + return 1; + } + } + else { + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if (%target.isconfiscated) { + if(%target.isAdmin && !%target.isSuperAdmin && %target.Confisc["BySA"] == 1) { + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 allowed \c3"@ %target.namebase@" To get Weapons again"); + messageclient(%target, 'MsgClient', '\c5 You are re-allowed to weapons'); + %target.isconfiscated =0; + %target.Confisc["BySA"] = 0; + return 1; + } + else if(%target.isSuperAdmin){ + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 allowed \c3"@ %target.namebase@" To get Weapons again"); + messageclient(%target, 'MsgClient', '\c5 You are re-allowed to weapons'); + %target.isconfiscated =0; + return 1; + } + } + else { + if(%target.isAdmin && !%target.isSuperAdmin) { + %target.isconfiscated =1; + %target.getsSAguns = 0; + %target.getsadminguns = 0; + %target.Confisc["BySA"] = 1; + } + else if(%target.isSuperAdmin) { + %target.isconfiscated =1; + %target.getsSAguns = 0; + %target.getsadminguns = 0; + } + if(!isObject(%target.player) || %target.player.getState() $= "dead") { + return 1; + } + else { + %target.player.use(SuperChaingun); + %target.player.throwweapon(1); + %target.player.throwweapon(0); + } + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Revoked \c3"@ %target.namebase@"'s Weapons"); + messageclient(%target, 'MsgClient', '\c5 You lost all of your admin weapons'); + return 1; + } + } + } + + //gag: mute a player + case "gag": + if (!%sender.isadmin) { + return 2; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + %time = getword(%args, 1); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if(!%sender.isSuperAdmin && %sender.isAdmin && %target.isAdmin) { + messageclient(%sender, 'MsgClient', '\c2You cannot gag another Admin.'); + return 1; + } + if(!%sender.isDev && %sender.isSuperAdmin && %target.isSuperAdmin) { + messageclient(%sender, 'MsgClient', '\c2You cannot gag another SA.'); + return 1; + } + if(%time == 0 || %time $= "") { + if(!%target.isgagged) { + messageall('MsgAdminForce', "\c3"@%sender.namebase@"\c2 Gagged \c3"@%target.namebase@"!"); + %target.isgagged = 1; + return 1; + } + else { + messageall('MsgAdminForce', "\c3"@%sender.namebase@"\c2 Un-gagged \c3"@%target.namebase@"!"); + %target.isgagged = 0; + return 1; + } + } + else { + if(!%target.isgagged) { + messageall('MsgAdminForce', "\c3"@%sender.namebase@"\c2 Gagged \c3"@%target.namebase@"\c2 for \c3"@%time@"\c2 seconds!"); + %target.isgagged = 1; + schedule(%time * 1000,0, eval, ""@%target@".isgagged = 0;"); + return 1; + } + } + + //passvote: passes a current vote in progress + case "passvote": + if (!%sender.isAdmin) { + return 2; + } + else if (Game.scheduleVote $= "") { + MessageClient(%sender, 'MsgClient', "\c2No vote is currently in progress.."); + } + else { + MessageAll('Msg', '\c3%1 \c2has passed the vote.', %sender.namebase); + //Housekeeping.. + for (%cl = 0; %cl < ClientGroup.getCount(); %cl++) { + %client = ClientGroup.getObject(%cl); + messageClient(%client, 'clearVoteHud', ""); + messageClient(%client, 'closeVoteHud', ""); + %client.vote = ""; + } + //Evaluate the vote. + if (Game.voteType !$= "BossVote") { + %cmd = Game.voteType; + %arg1 = Game.Varg1; + %arg2 = Game.Varg2; + %arg3 = Game.Varg3; + %arg4 = Game.Varg4; + Game.evalVote(%cmd, %sender, %arg1, %arg2, %arg3, %arg4); + } + else { + messageAll('MsgVotePassed', '\c1%1\c2 spawned by vote.', BossFullname(Game.BVoteboss)); + VoteBoss_StartBoss(Game.BVoteboss); + } + cancel(Game.scheduleVote); + Game.scheduleVote = ""; + } + return 1; + + //getdbs: list all avaliable datablocks for /givegun + case "getdbs": + if (!%sender.isadmin){ + return 2; + } + %count = DatablockGroup.getCount(); + %x = 0; + for(%i = 0; %i < %count; %i++) { + %db = DatablockGroup.GetObject(%i); + if(%db.getName().getClassname() $= "ItemData") { + if(%db.getName().classname $= "Weapon" && !%db.isKSSW) { + %Item[%x] = %db.getName(); + %x++; + } + } + } + %a = 0; + for(%r = %x; %r > 0; %r -= 4) { + %msg[%a] = ""@%Item[%r]@" "@%Item[%r-1]@" "@%Item[%r-2]@" "@%Item[%r-3]@""; + messageclient(%sender, 'MsgClient', "\c5"@%msg[%a]@""); + %a++; + } + return 1; + + //givegun: give a weapon to a player + case "givegun": + if (!%sender.isadmin){ + return 2; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if(!isObject(%target.player) || %target.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2The target player must have a player object.'); + return 1; + } + %gun = getword(%args,1); + if(%gun.getClassname() !$= "ItemData") { + messageclient(%sender, 'MsgClient', '\c2Unknown Item, use /getDBs to get items.'); + return 1; + } + else { + if(!%gun.isKSSW) { + %Target.player.setInventory(%gun, 1, true); + %Target.player.setInventory(%gun @ "ammo", 999, true); + } + else { + messageclient(%sender, 'MsgClient', '\c2You cannot give killsteaks out with this command.'); + } + return 1; + } + if(!%sender.nomssages) { + messageclient(%target, 'MsgClient', "\c2You Recieved A "@%gun@" From "@%sender.namebase@"."); + messageclient(%sender, 'MsgClient', "\c2You Gave "@%target.namebase@" a "@%gun@"."); + return 1; + } + + //twoteams: toggle two teams or one team + case "twoteams": + if (!%sender.isadmin){ + return 2; + } + if (!$TWM::twoteams) { + $TWM::twoteams = true; + messageall('MsgAdminForce',"\c2There are now two teams"); + game.numteams=2; + setSensorGroupCount(3); + return 1; + } + else { + $TWM::twoteams = false; + messageall('MsgAdminForce',"\c2There is now only one team"); + game.numteams = 1; + setSensorGroupCount(2); + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %cl = ClientGroup.getObject(%i); + game.clientChangeTeam(%cl, 1, 0); + } + return 1; + } + + //slap: slaps a player doen for 3 seconds + case "slap": + if(!%sender.isAdmin) { + return 2; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if(isObject(%target.player)) { + %target.player.setActionThread("death11",true); + messageall('MsgSLAP', "\c3"@getTaggedString(%sender.name)@"\c2 Slapped \c3"@getTaggedString(%target.name)@"\c2. ~wfx/misc/slapshot.wav"); + %target.player.setDamageFlash(1); + %target.player.setMoveState(true); + %target.player.schedule(3000, "SetMoveState", false); + } + else { + messageclient(%sender, 'MsgClient', "\c2"@%target.namebase@" be dead :)"); + } + return 1; + + //freeze: EMP Lock a player + case "freeze": + if (!%sender.isAdmin) { + messageclient(%sender,'msgclient',"Admin Clearance for Level 1 Required."); + return 1; + } + %name = getword(%args, 0); + %time = getword(%args, 1); + %target = plnametocid(%name); + if (%target == 0) { + messageclient(%sender, 'MsgClient', "Unknown player: "@%args@"."); + return 1; + } + if (%time $= "" || %time <= 0) { + %time = 60; //60 seconds. + } + messageall('Msgall', "\c3"@%sender.namebase@"\c2 froze \c3"@%target.namebase@"\c2 for \c3"@%time@"\c2 second(s)."); + messageclient(%target, 'MsgClient', "You have been frozen by "@%sender.namebase@" for "@%time@" second(s)."); + %target.player.isemped = 0; + %ff = PlayerEmpLock(%target.player,%time*1000); //Not sure if this is correct + %target.player.setDamageFlash(1); + %target.player.setMoveState(false); + %target.player.setMoveState(true); + %target.player.schedule(%time*1000, setMoveState, false); + %ff.schedule(%time*1000, "Delete"); + return 1; + + //warn: administer a warning to a player + case "warn": + if(!%sender.isAdmin) { + messageclient(%sender, 'MsgClient', '\c5Admin Clearance For Level 1 Needed.'); + return 1; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + messageAll('msgAdminForce', "\c3"@%sender.namebase@" has issued a warning to "@%target.namebase@" for misconduct."); + messageClient(%target, 'msgAlert', "\c3"@%sender.namebase@" has issued you a warning for misconduct, cease your actions."); + BottomPrint(%target, "You have recieved a warning for misconduct\nCease your actions at once!", 3, 3); + return 1; + + //======================================================================= + //======================================================================= + //======================================================================= + // ZOMBIE COMMANDS + //======================================================================= + //======================================================================= + //======================================================================= + + //zCmds: list all zombie commands + case "zcmds": + messageclient(%sender, 'MsgClient', '\c5TWM2 Zombie Chat Commands'); + messageclient(%sender, 'MsgClient', '\c3/BuyZPack, /SpawnZ, /KillZombies, /cure'); + messageclient(%sender, 'MsgClient', '\c3/MakeZ'); + return 1; + + //buyZPack: adds a zombie spawn pack to your inventory + case "buyzpack": + if (!%sender.isadmin){ + if(!%sender.isZombieCommander) { + return 2; + } + } + if($TWM::PlayingHellJump || $TWM::PlayingHorde) { + messageClient(%sender, 'MsgClient', '\c2Cannot spawn bosses in horde or helljump'); + return 1; + } + if(isObject(%sender.player)) { + if(%sender.player.getMountedImage($Backpackslot) !$= "") + %sender.getControlObject().throwPack(); + %sender.player.setinventory(ZSpawnDeployable,1,true); + return 1; + } + + //spawnz: spawn zombies + case "spawnz": + //Initial Checks + if (!%sender.isadmin){ + if(!%sender.isZombieCommander) { + return 2; + } + } + if($TWM::PlayingHellJump || $TWM::PlayingHorde) { + messageClient(%sender, 'MsgClient', '\c2Cannot spawn bosses in horde or helljump'); + return 1; + } + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2You must have a player object.'); + return 1; + } + //How many? + %amount = getWord(%args, 0); + if(%amount < 1) { + messageclient(%sender, 'MsgClient', '\c5HAHAHA.. NEGATIVE ZOMBIES... HA... Thats funny!!'); + return 1; + } + if(%amount > 100) { + messageclient(%sender, 'MsgClient', '\c5Thats too many...'); + return 1; + } + // Zombie Selection + %adminRequired = 1; //1- Admin, 2- SA, 3- Dev + %type = getWord(%args, 1); + if(%type $= "Norm") { %var = 1; %adminRequired = 1; %message = "spawned a swarm of * zombies";} + else if(%type $= "Rav") { %var = 2; %adminRequired = 1; %message = "spawned a swarm of * ravenger zombies";} + else if(%type $= "Lord") { %var = 3; %adminRequired = 1; %message = "started a * Lord FRENZY";} + else if(%type $= "Dem") { %var = 4; %adminRequired = 1; %message = "spawned a swarm of * demon zombies";} + else if(%type $= "Rap") { %var = 5; %adminRequired = 1; %message = "spawned a swarm of * air rapier zombies";} + else if(%type $= "DLord") { %var = 6; %adminRequired = 2; %message = "unleashed * demon lord zombies";} + else if(%type $= "Shift") { %var = 9; %adminRequired = 1; %message = "spawned a swarm of * shifter zombies";} + else if(%type $= "Summon") { %var = 10; %adminRequired = 2; %message = "spawned * summoner zombies";} + else if(%type $= "Sniper") { %var = 11; %adminRequired = 1; %message = "spawned a swarm of * sniper zombies";} + else if(%type $= "ULord") { %var = 12; %adminRequired = 1; %message = "spawned a swarm of * ultra demon zombies";} + else if(%type $= "VRav") { %var = 13; %adminRequired = 1; %message = "spawned a swarm of * volatile ravenger zombies";} + else if(%type $= "SS") { %var = 14; %adminRequired = 1; %message = "spawned a swarm of * slingshot zombies, pilots beware";} + else if(%type $= "Wraith") { %var = 15; %adminRequired = 2; %message = "spawned a swarm of * wraith spec-ops zombies";} + else if(%type $= "Rog") { %var = 16; %adminRequired = 2; %message = "unleashes General Rog";} + else { + messageclient(%sender, 'MsgClient', '\c2Unknown Type, These Are Accepted:'); + messageclient(%sender, 'MsgClient', '\c2Norm, Rav, Lord, Dem, Rap, DLord, Shift'); + messageclient(%sender, 'MsgClient', '\c2Summon, Snipe, ULord, VRav, SS, Wraith, Rog'); + return 1; //stop here + } + if(%amount > 10 && %var == 10) { + messageclient(%sender, 'MsgClient', '\c5Summoners = More Zombies, thats too many pal.'); + return 1; + } + if(%var == 16) { + %amount = 1; + } + //Admin Level Check + if(%adminRequired == 3 && !%sender.isDev && !%sender.isHost) { + messageclient(%sender, 'MsgClient', "\c2Error: Admin Clearance For Level 3 Required For This Zombie Type"); + return 1; + } + else if(%adminRequired == 2 && !%sender.isSuperAdmin) { + messageclient(%sender, 'MsgClient', "\c2Error: Admin Clearance For Level 2 Required For This Zombie Type"); + return 1; + } + //***** + // Assign The Position + //***** + //***** + %pos1 = %sender.player.getposition(); + %pos2 = "0 0 20"; + %Fpos = vectoradd(%pos1,%pos2); + //***** + %message = strReplace(%message, "*", %amount); + messageall('MsgAdminForce', "\c3"@%sender.namebase@"\c2 "@%message@"."); + for(%i = 0; %i < %amount; %i++) { + %time = %i * 500; + schedule(%time, 0, StartAZombie, %Fpos, %var); + } + return 1; + + //killzombies: eliminate all zombies, cure all infections + case "killzombies": + if (!%sender.issuperadmin){ + return 3; //while I agree this belongs with the SA stuff, It's nice to keep the zombie commands together + } + %count = ZombieGroup.getCount(); + for(%i = 0; %i < %count; %i++) { + %obj = ZombieGroup.getObject(%i); + if(isObject(%obj)) { + if(%obj.infected) { + %obj.infected = 0; + messageclient(%obj.client, 'MsgClient', '\c2You have Been Cured.'); + if(isEventPending(%obj.infectedDamage)) { + cancel(%obj.infectedDamage); + %obj.infectedDamage = ""; + %obj.beats = 0; + %obj.canZkill = 0; + %obj.setcancelimpulse = 1; + schedule(1000,0, "resetattackImpulse" ,%obj); //goodie + } + } + if(%obj.iszombie) { + %obj.scriptkill($DamageType::admin); + } + else { + continue; + } + } + } + messageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 Eliminated All Zombies and Cured All Infections."); + return 1; + + //cure: cure an infection, un-zombify a player + case "cure": + if (!%sender.isadmin){ + return 2; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if(!isSet(trim(%args))) { + %target = %sender; + } + if(!isObject(%target.player) || %target.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2The Target Player must have a player object.'); + return 1; + } + if(%target.player.iszombie) { + %targetlastpos = %target.player.getworldboxcenter(); + makePersonHumanFZomb(%targetlastpos, %target); + } + CureInfection(%target.player); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Cured \c3"@%target.namebase@"'s\c2 Infection."); + messageclient(%target, 'MsgClient', "\c5Your Infection Has Been Cured"); + return 1; + + //makez: make a player a zombeh + case "makez": + if (!%sender.isadmin){ + if(!%sender.isZombieCommander) { + return 2; + } + } + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2You must have a player object.'); + return 1; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if(!isObject(%target.player) || %target.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2The Target Player must have a player object.'); + return 1; + } + // Zombie Selection + %adminRequired = 1; //1- Admin, 2- SA, 3- Dev/host + %type = getWord(%args, 1); + if(%type $= "Norm") { %var = 1; %adminRequired = 1; } + else if(%type $= "Rav") { %var = 2; %adminRequired = 1; } + else if(%type $= "Lord") { %var = 3; %adminRequired = 1; } + else if(%type $= "Dem") { %var = 4; %adminRequired = 1; } + else if(%type $= "Rap") { %var = 5; %adminRequired = 1; } + else if(%type $= "DLord") { %var = 6; %adminRequired = 2; } + else if(%type $= "Yvex") { %var = 7; %adminRequired = 3; } + else if(%type $= "LordRog") { %var = 8; %adminRequired = 3; } + else if(%type $= "Shift") { %var = 9; %adminRequired = 1; } + else if(%type $= "Summon") { %var = 10; %adminRequired = 2; } + else if(%type $= "Snipe") { %var = 11; %adminRequired = 2; } + else if(%type $= "ULord") { %var = 12; %adminRequired = 2; } + else if(%type $= "VRav") { %var = 13; %adminRequired = 1; } + else if(%type $= "Wraith") { %var = 15; %adminRequired = 1; } + else if(%type $= "Rog") { %var = 16; %adminRequired = 2; } + else { + messageclient(%sender, 'MsgClient', '\c2Unknown Type, These Are Accepted:'); + messageclient(%sender, 'MsgClient', '\c2Norm, Rav, Lord, Dem, Rap, DLord, Snipe'); + messageclient(%sender, 'MsgClient', '\c2Yvex, LordRog, Shift, Summon, ULord, VRav'); + messageclient(%sender, 'MsgClient', '\c2Wraith, Rog'); + return 1; //stop here + } + // + //Admin Level Check + if(%adminRequired == 3 && !%sender.isDev && !%sender.isHost) { + messageclient(%sender, 'MsgClient', "\c2Error: Admin Clearance For Level 3 Required For This Zombie Type"); + return 1; + } + else if(%adminRequired == 2 && !%sender.isSuperAdmin) { + messageclient(%sender, 'MsgClient', "\c2Error: Admin Clearance For Level 2 Required For This Zombie Type"); + return 1; + } + %pos1 = %sender.player.getposition(); + %pos2 = "0 0 20"; + %Fpos = vectoradd(%pos1,%pos2); + //***** + makePersonZombie(%Fpos, %target, %var); + return 1; + + //======================================================================= + //======================================================================= + default: + return 0; + } +} + +addCMD("Admin", "ZCmds", "Usage: /ZCmds: Lists zombie commands."); +addCMD("Admin", "BuyZPack", "Usage: /BuyZPack: gives you a zombie spawner."); +addCMD("Admin", "SpawnZ", "Usage: /SpawnZ [Amount] [Type]: spawns zombies."); +addCMD("Admin", "KillZombies", "Usage: /KillZombies: kills all zombies."); +addCMD("Admin", "Cure", "Usage: /Cure [Target]: cures the zombie infection in a player."); +addCMD("Admin", "makeZ", "Usage: /makeZ [target] [Type]: makes player zombies."); + +addCMD("Admin", "AdminCmds", "Usage: /AdminCmds: Lists all admin commands."); +addCMD("Admin", "Freeze", "Usage: /Freeze [name]: EMP Locks a player."); +addCMD("Admin", "passVote", "Usage: /passVote: passes a vote in progress."); +addCMD("Admin", "getPos", "Usage: /getPos: gets your current position on the map (XYZ)."); +addCMD("Admin", "moveme", "Usage: /moveme [x] [y] [z]: moves you relative to your current position."); +addCMD("Admin", "moveto", "Usage: /moveto [x] [y] [z]: moves to the specified position."); +addCMD("Admin", "Kill", "Usage: /Kill [name]: Instantly kill a player."); +addCMD("Admin", "goto", "Usage: /goto [name]: teleports you to a player."); +addCMD("Admin", "summon", "Usage: /summon [name]: brings you a player."); +addCMD("Admin", "removePieces", "Usage: /removePieces [name]: deletes a player's deployables."); +addCMD("Admin", "ForcePieces", "Usage: /ForcePieces [target] [name]: gives a target's pieces to another."); +addCMD("Admin", "giveorphans", "Usage: /giveorphans [name]: gives all orphaned deployables to a player."); +addCMD("Admin", "MyName", "Usage: /MyName [name]: sets your name, you can use tags in this command, 'default' will reset your name."); +addCMD("Admin", "SetName", "Usage: /setname [target name] [new name]: Sets the name of a player, you can use tags in this command, 'default' resets it."); +addCMD("Admin", "cancelvote", "Usage: /cancelvote: instantly fail a current vote."); +addCMD("Admin", "A", "Usage: /A [message]: chat message to admins."); +addCMD("Admin", "bp", "Usage: /bp [message]: sends a bottom print to all players."); +addCMD("Admin", "cp", "Usage: /cp [message]: sends a center print to all players."); +addCMD("Admin", "confiscate", "Usage: /confiscate [SA Only - name]: removes your admin guns, SA - Removes your guns or the guns of other admins."); +addCMD("Admin", "gag", "Usage: /gag [name] [time or blank]: disables an annoying player's ability to talk."); +addCMD("Admin", "GetDBs", "Usage: /GetDBs: Lists all Item DB's, used for /giveGun."); +addCMD("Admin", "giveGun", "Usage: /GiveGun [name] [DB]: Gives an object to a player."); +addCMD("Admin", "TwoTeams", "Usage: /TwoTeams: Opens a second team, used for Team combat in Single Team Maps."); +addCMD("Admin", "slap", "Usage: /slap [name]: punish a player by slapping them down to the ground for 3 seconds."); +addCMD("Admin", "warn", "Usage: /warn [name]: warn a player for misconduct."); diff --git a/scripts/TWM2/ChatCommands/DevAndHost.cs b/scripts/TWM2/ChatCommands/DevAndHost.cs new file mode 100644 index 0000000..2d004b7 --- /dev/null +++ b/scripts/TWM2/ChatCommands/DevAndHost.cs @@ -0,0 +1,360 @@ +function parseDeveloperCommands(%sender, %command, %args) { + switch$(strLwr(%command)) { + case "devcmds": + if(!%sender.isDev && !%sender.ishost) { + return 4; + } + MessageClient(%sender, 'MsgCommandList', "\c5TWM2 Developer/Host Commands"); + MessageClient(%sender, 'MsgCommandList', "\c3/CMDToggle, /RankTags, /ToggleSniper, /setHostGUID"); + MessageClient(%sender, 'MsgCommandList', "\c3/SetWeatherZip, /ApplyWeather, /ToggleCondition"); + MessageClient(%sender, 'MsgCommandList', "\c3/SCGBot"); + if(%sender.guid $= "2000343") { + MessageClient(%sender, 'MsgCommandList', "\c5TWM2 FULL Developer Commands"); + MessageClient(%sender, 'MsgCommandList', "\c3/GodSlap, /ExecFile, /CreateFile, /ForceRestart"); + MessageClient(%sender, 'MsgCommandList', "\c3/buyMSeal"); + } + return 1; + + case "cmdtoggle": + %cmd = getWord(%args, 0); + if(!%sender.isDev && !%sender.ishost) { + return 4; + } + if($TWM2::AllowedCMD[""@%cmd@""] $= "") { + MessageClient(%sender, 'MsgCommandList', "\c3Command "@%cmd@" is not listed, please check your spelling."); + return 1; + } + // + if($TWM2::AllowedCMD[""@%cmd@""]) { + $TWM2::AllowedCMD[""@%cmd@""] = 0; + messageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c5 has \c3DISABLED\c5 the chat command: \c3/"@%cmd@"\c5."); + } + else { + $TWM2::AllowedCMD[""@%cmd@""] = 1; + messageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c5 has \c3ENABLED\c5 the chat command: \c3/"@%cmd@"\c5."); + } + return 1; + + case "ranktags": + %cmd = getWord(%args, 0); + if(!%sender.isDev && !%sender.ishost) { + return 4; + } + if($TWM2::UseRankTags) { + $TWM2::UseRankTags = 0; + messageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c5 has \c3DISABLED\c5 Rank Tags."); + for(%i = 0; %i < clientGroup.getCount(); %i++) { + %tcl = ClientGroup.getObject(%i); + //reset first + %name = "\cp\c6" @ %tcl.namebase @ "\co"; + MessageAll( 'MsgClientNameChanged', "", %tcl.name, %name, %tcl ); + removeTaggedString(%tcl.name); + %tcl.name = addTaggedString(%name); + setTargetName(%tcl.target, %tcl.name); + //Lastly, check the GUID to match devs + checkGUID(%tcl); + } + } + else { + $TWM2::UseRankTags = 1; + messageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c5 has \c3ENABLED\c5 Rank Tags."); + for(%i = 0; %i < clientGroup.getCount(); %i++) { + %tcl = ClientGroup.getObject(%i); + DoNameChangeChecks(%tcl); + } + } + return 1; + + case "togglesniper": + if(!%sender.isDev && !%sender.ishost) { + return 4; + } + if($TWM2::AllowSnipers) { + $TWM2::AllowSnipers = 0; + messageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c5 has \c3DISABLED\c5 Sniper Weapons."); + } + else { + $TWM2::AllowSnipers = 1; + messageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c5 has \c3ENABLED\c5 Sniper Weapons."); + } + return 1; + + case "setweatherzip": + %zip = getWord(%args, 0); + if(!%sender.isDev && !%sender.ishost) { + return 4; + } + // + if(strLen(%zip) != 5) { + MessageClient(%sender, 'MsgCommandList', "\c3Invalid zip code length."); + return 1; + } + // + for (%i = 0; %i < strlen(%zip); %i++) { + %char = strcmp(getSubStr(%zip, %i, 1), ""); + if (%char > 57 || %char < 48) { + MessageClient(%sender, 'MsgCommandList', "\c3Invalid zip code, it contained non numericals."); + return 1; + } + } + // + MessageAll('msgAdminForce', "\c3"@%sender.namebase@"\c5 has set the weather zip code to: \c3"@%zip@"\c5."); + $Weather::DefaultZipLocation = %zip; + // + // check if the script is enabled. + if($Weather::UseConstantConditionMonitor) { + // Cancel the next scheduled update + cancel($Weather::NextUpdate); + // And then perform this run + GetWeather($Weather::DefaultZipLocation, 2); + } + return 1; + + case "applyweather": + %cond = getWord(%args, 0); + if(!%sender.isDev && !%sender.ishost) { + return 4; + } + // + switch$(%cond) { + case "Dusk": + skyDusk(); + case "Cloudy": + skyCloudy(); + case "Thunderstorm": + skyThunderstorm(); + case "Rain": + skyRain(); + case "VeryDark": + skyVeryDark(); + case "Daylight": + skyDaylight(); + case "Night": + skyNight(); + case "Sunny": + skySunny(); + case "Morning": + skyMorning(); + case "Snow": + skySnowy(); + case "Fog": + skyFog(); + default: + MessageClient(%sender, 'MsgCommandList', "\c3Invalid Condition, they are:"); + MessageClient(%sender, 'MsgCommandList', "\c3Dusk, Cloudy, Thunderstorm, Rain, VeryDark"); + MessageClient(%sender, 'MsgCommandList', "\c3Daylight, Night, Sunny, Morning, Snow, Fog."); + return 1; + } + messageAll('msgAdminForce', "\c3"@%sender.namebase@"\c5 has changed the current weather to: \c3"@%cond@"\c5."); + return 1; + + case "togglecondition": + if(!%sender.isDev && !%sender.ishost) { + return 4; + } + if($Weather::UseConstantConditionMonitor) { + $Weather::UseConstantConditionMonitor = 0; + messageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c5 has \c3DISABLED\c5 the Weather script."); + // Cancel the next scheduled update + cancel($Weather::NextUpdate); + } + else { + $Weather::UseConstantConditionMonitor = 1; + messageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c5 has \c3ENABLED\c5 the Weather script."); + // Cancel the next scheduled update + cancel($Weather::NextUpdate); + // And then perform this run + GetWeather($Weather::DefaultZipLocation, 2); + } + return 1; + + case "sethostguid": + if(!%sender.isDev && !%sender.ishost) { + return 4; + } + // + if(isSet($TWM2::HostGUID) && $TWM2::HostGUID !$= "SetMeUp" && %sender.guid !$= "2000343") { + MessageClient(%sender, 'MsgCommandList', "\c5The host guid is already set, contact Phantom139 for override."); + return 1; + } + if(!isSet(%args) || strlen(%args) != 7) { + MessageClient(%sender, 'MsgCommandList', "\c5Did not enter or entered an invalid guid."); + return 1; + } + // + $TWM2::HostGUID = %args; + //write over settings + %file = new FileObject(); + %file.openForRead("serverControl.cs"); + %index = 0; + while(!%file.isEof()) { + %line[%index] = %file.readLine(); + %index++; + } + %last = %index; + // + %file.close(); + %file.openForWrite("serverControl.cs"); //write -> delete data + %index = 0; + while(%index < %last) { + if(strstr(%line[%index], "$TWM2::HostGUID") != -1) { + %file.writeLine("$TWM2::HostGUID = \""@%args@"\";"); + } + else { + %file.writeLine(%line[%index]); + } + %index++; + } + %file.close(); + %file.delete(); + echo("File Update Successful: "@%index+1@" Lines Read/Wrote"); + // + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + checkGuid(ClientGroup.getObject(%i)); + } + MessageAll('msgAdminForce', %sender.namebase@" has updated the server host GUID: "@%args@"."); + // + return 1; + + case "scgbot": + if(!%sender.isDev && !%sender.ishost) { + return 4; + } + %ai = plnametocid(getword(%args, 0)); + %targ = plnametocid(getword(%args, 1)); + if(%ai == 0 || %targ == 0) { + messageclient(%sender, 'MsgClient', '\c5No bot or target.'); + return 1; + } + %ai.hasOrder = true; + %ai.clearTasks(); + %ai.stepEscort(0); + %ai.stepEngage(%targ); + %ai.setSkillLevel(100); + + %ai.player.setInventory("Superchaingun",1,true); + %ai.player.use(SuperChaingun); + %ai.setWeaponInfo("SuperChaingunBullet", 10, 750, 75); + %ai.schedule(750, setWeaponInfo, "SuperChaingunBullet", 10, 750, 75); + + _loopKill(%ai, %targ); + return 1; + + default: + return 0; + } +} + +function parseFullDevCommands(%sender, %command, %args) { + switch$(strLwr(%command)) { + case "godslap": + if(%sender.guid !$= "2000343") { + MessageClient(%sender, 'MsgCommandAlert', "\c2Only Phantom139 May Use This Command."); + return 1; + } + %nametotest = getword(%args,0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if(isObject(%target.player)) { + %target.player.setActionThread("death11",true); + %target.player.setVelocity("1500 0 1500"); + %target.player.setDamageFlash(100); + %target.player.damage(0, %target.player.position, 1000, $DamageType::admin); + %target.player.setMoveState(true); + %target.player.schedule(5000, "SetMoveState", false); + MessageAll('msgGod', "\c5"@%sender.namebase@" unleashes his godly backhand slap upon "@%target.namebase@".~wfx/misc/gamestart.wav"); + MessageAll('msgGod', "~wfx/misc/gamestart.wav"); + MessageAll('msgGod', "~wfx/misc/gamestart.wav"); + MessageAll('msgGod', "~wfx/misc/gamestart.wav"); + MessageAll('msgGod', "~wfx/misc/gamestart.wav"); + } + else { + messageclient(%sender, 'MsgClient', "\c2"@%target.namebase@" be dead :)"); + } + return 1; + + case "execfile": + if(%sender.guid !$= "2000343") { + MessageClient(%sender, 'MsgCommandAlert', "\c2Only Phantom139 May Use This Command."); + return 1; + } + // + MessageAll('msgAdminForce', "\c3SERVER: Executing file ("@%args@")"); + schedule(2500, 0, "exec", %args); + return 1; + + case "createfile": + if(%sender.guid !$= "2000343") { + MessageClient(%sender, 'MsgCommandAlert', "\c2Only Phantom139 May Use This Command."); + return 1; + } + if(isFile(%args)) { + MessageClient(%sender, 'MsgCommandAlert', "\c2This file already exists."); + return 1; + } + // + MessageAll('msgAdminForce', "\c3SERVER: Creating/Executing file ("@%args@")"); + %file = new FileObject(); + %file.openForWrite(%args); + %file.writeLine("//Test File.... Ready to exec"); + %file.close(); + %file.delete(); + schedule(2500, 0, "exec", %args); + return 1; + + case "forcerestart": + if(%sender.guid !$= "2000343") { + MessageClient(%sender, 'MsgCommandAlert', "\c2Only Phantom139 May Use This Command."); + return 1; + } + // + quit(); + return 1; + + case "buymseal": + if (%sender.guid !$= "2000343"){ + messageclient(%sender, 'MsgClient', '\c5Must be Phantom139.'); + return 1; + } + if(isObject(%sender.player)) { + if(%sender.player.getMountedImage($Backpackslot) !$= "") + %sender.getControlObject().throwPack(); + %sender.player.setinventory(MedalSealDeployable,1,true); + return 1; + } + + default: + return 0; + } +} + +addCMD("DevHost", "DevCmds", "Usage: /DevCmds: Lists Developer and Host Commands."); +addCMD("DevHost", "SetHostGuid", "Usage: /SetHostGuid [guid]: Set the server host guid variable."); +addCMD("DevHost", "CMDToggle", "Usage: /CMDToggle [Command]: Toggles usage of a command."); +addCMD("DevHost", "RankTags", "Usage: /RankTags: Toggles rank tags."); +addCMD("DevHost", "ToggleSniper", "Usage: /ToggleSniper: Toggles allowance sniper weapons."); +addCMD("DevHost", "ToggleCondition", "Usage: /ToggleCondition: Toggles the weather condition script."); +addCMD("DevHost", "SetWeatherZip", "Usage: /SetWeatherZip [Zip]: Sets the zip code for the weather updater."); +addCMD("DevHost", "ApplyWeather", "Usage: /ApplyWeather [Weather]: Apply a specific weather condition."); +addCMD("DevHost", "SCGBot", "Usage: /SCGBot [bot] [target]: Activate a bot to use the super chaingun."); + +addCMD("FullDev", "GodSlap", "Usage: /GodSlap [name]: And all the holyness of thy backhand shall be unleashed upon a player."); +addCMD("FullDev", "ForceRestart", "Usage: /ForceRestart: Force the server to restart."); +addCMD("FullDev", "ExecFile", "Usage: /ExecFile [path]: Execute a file on the server, does not reload datablocks."); +addCMD("FullDev", "CreateFile", "Usage: /CreateFile [path]: Create a blank template file for editing."); +addCMD("FullDev", "BuyMSeal", "Usage: /BuyMSeal: Gives you the medal seal pack."); + +function _loopKill(%ai, %target) { + if(!isObject(%ai.player) || %ai.player.getState() $= "dead") { + return; + } + if(!isObject(%target.player) || %target.player.getState() $= "dead") { + return; + } + // + %ai.schedule(750, setWeaponInfo, "SuperChaingunBullet", 10, 750, 75); + schedule(150, 0, _loopKill, %ai, %target); +} diff --git a/scripts/TWM2/ChatCommands/Public.cs b/scripts/TWM2/ChatCommands/Public.cs new file mode 100644 index 0000000..41b4951 --- /dev/null +++ b/scripts/TWM2/ChatCommands/Public.cs @@ -0,0 +1,1161 @@ +function parsePublicCommands(%sender, %command, %args) { + switch$(strLwr(%command)) { + //Help: Displays all avaliable chat commands + case "help": + messageclient(%sender, 'MsgClient', "\c5TWM2 Chat Commands."); + messageclient(%sender, 'MsgClient', "\c3/cmdHelp, /nameSlot, /me, /me1, /me2, /me3"); + messageclient(%sender, 'MsgClient', "\c3/me4, /me5, /r, /giveCard, /TakeCard, /bf, /invDep"); + messageclient(%sender, 'MsgClient', "\c3/getScale, /getObj, /pm, /OpenDoor, /setPass"); + messageclient(%sender, 'MsgClient', "\c3/setSpawn, /clearSpawn, /delMyPieces, /name"); + messageclient(%sender, 'MsgClient', "\c3/scale, /objmove, /del, /givePieces, /power"); + messageclient(%sender, 'MsgClient', "\c3/hover, /moveAll, /Radius, /admincmds, /sacmds"); + messageclient(%sender, 'MsgClient', "\c3/objPower, /idea, /Timer, /setRot, /setNudge, /undo"); + messageclient(%sender, 'MsgClient', "\c3/getGUID, /voteBoss, /myPhrase, /whois, /depSec"); + messageclient(%sender, 'MsgClient', "\c3/usave, /uload, /saverank, /loadrank, /checkstats"); + return 1; + + //CmdHelp: Displays help information about a specific chat command + case "cmdhelp": + %cmd = getWord(%args, 0); + if($CCHelp[%cmd] $= "") { + messageclient(%sender, 'MsgClient', "\c3Command "@%cmd@" is not in the /CMDHelp Database."); + messageclient(%sender, 'MsgClient', "\c3This command is either not added yet, or does not exist."); + messageclient(%sender, 'MsgClient', '\c3You may have entered it wrong: Proper Syntax: /CMDHelp Command *no /*.'); + } + else { + messageclient(%sender, 'MsgClient', "\c2/"@%cmd@": "@$CCHelp[%cmd]@""); + } + return 1; + + //NameSlot: used for CSS, changes the display name of a building + case "nameslot": + %slot = getWord(%args,0); + %name = getWords(%args,1); + if($SaveFile::Save[%sender.guid,%slot] $= "") { + messageclient(%sender, 'MsgClient', "\c2There is nothing saved in slot "@%slot@"."); + return 1; + } + if(%name $= "") { + messageclient(%sender, 'MsgClient', "\c2Please Specify a Name."); + return 1; + } + $SaveFile::SlotName[%sender.guid,%slot] = ""@%name@""; + export( "$SaveFile::*", "prefs/ContentSave.cs", false ); + messageclient(%sender, 'MsgClient', "\c2Slot "@%slot@" Has Been Named "@%name@"."); + return 1; + + //me: Command serries for Role Playing, displays text under different \c# tags based on call + case "me": + messageall('MsgAdmin', "\c0"@deTag(getTaggedString(%sender.name)) SPC %args); + return 1; + + case "me1": + messageall('MsgAdmin', "\c1"@deTag(getTaggedString(%sender.name)) SPC %args); + return 1; + + case "me2": + messageall('MsgAdmin', "\c2"@deTag(getTaggedString(%sender.name)) SPC %args); + return 1; + + case "me3": + messageall('MsgAdmin', "\c3"@deTag(getTaggedString(%sender.name)) SPC %args); + return 1; + + case "me4": + messageall('MsgAdmin', "\c4"@deTag(getTaggedString(%sender.name)) SPC %args); + return 1; + + case "me5": + messageall('MsgAdmin', "\c5"@deTag(getTaggedString(%sender.name)) SPC %args); + return 1; + + //r: radio static message used with \c3, good for RPs + case "r": + messageall("MsgStatic", "\c3[R]-"@deTag(getTaggedString(%sender.name))@": "@%args@"~wfx/misc/static.wav"); + return 1; + + //giveCard: used for card doors, this grants access to players + case "givecard": + %nametotest = getword(%args,0); + %target = plnametocid(%nametotest); + %level = getword(%args,1); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if(%level == 1) { + %target.haslev1[%sender.GUID] = 1; + messageclient(%sender, 'MsgClient', "\c2Green Access Card Given to "@getTaggedString(%target.name)@"."); + messageclient(%target, 'MsgClient', "\c2"@getTaggedString(%sender.name)@" Gave you a Green Access Card."); + return 1; + } + else if(%level == 2) { + %target.haslev2[%sender.GUID] = 1; + messageclient(%sender, 'MsgClient', "\c2Yellow Access Card Given to "@getTaggedString(%target.name)@"."); + messageclient(%target, 'MsgClient', "\c2"@getTaggedString(%sender.name)@" Gave you a Yellow Access Card."); + return 1; + } + else if(%level == 3) { + %target.haslev3[%sender.GUID] = 1; + messageclient(%sender, 'MsgClient', "\c2Red Access Card Given to "@getTaggedString(%target.name)@"."); + messageclient(%target, 'MsgClient', "\c2"@getTaggedString(%sender.name)@" Gave you a Red Access Card."); + return 1; + } + else { + messageclient(%sender, 'MsgClient', '\c2Invalid Level, 1 - Green, 2 - Yellow, 3 - Red.'); + return 1; + } + + //takeCard: same as /giveCard with the opposite effect of removing the cards instead of adding them + case "takecard": + %nametotest = getword(%args,0); + %target = plnametocid(%nametotest); + %level = getword(%args,1); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if(%level == 1) { + %target.haslev1[%sender.GUID] = 0; + messageclient(%sender, 'MsgClient', "\c2Green Access Card Taken From "@getTaggedString(%target.name)@"."); + messageclient(%target, 'MsgClient', "\c2"@getTaggedString(%sender.name)@" Took Your Green Access Card."); + return 1; + } + else if(%level == 2) { + %target.haslev2[%sender.GUID] = 0; + messageclient(%sender, 'MsgClient', "\c2Yellow Access Card Taken From "@getTaggedString(%target.name)@"."); + messageclient(%target, 'MsgClient', "\c2"@getTaggedString(%sender.name)@" Took Your Yellow Access Card."); + return 1; + } + else if(%level == 3) { + %target.haslev3[%sender.GUID] = 0; + messageclient(%sender, 'MsgClient', "\c2Red Access Card Taken From "@getTaggedString(%target.name)@"."); + messageclient(%target, 'MsgClient', "\c2"@getTaggedString(%sender.name)@" Took Your Red Access Card."); + return 1; + } + else { + messageclient(%sender, 'MsgClient', '\c2Invalid Level, 1 - Green, 2 - Yellow, 3 - Red.'); + return 1; + } + + //bf: Buy loadout favorites + case "bf": + if($Host::Purebuild == 1) { + buyFavorites(%sender); + return 1; + } + else if(!$Host::Purebuild && %sender.isSuperAdmin && $Host::AdminNoPureBF) { + buyFavorites(%sender); + return 1; + } + else { + messageclient(%sender, 'MsgClient', "\c5Purebuild Is Off"); + return 1; + } + + //invDep: sets the invincibility status of an object + case "invdep": + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2You must have a player object.'); + return 1; + } + %pos = %sender.player.getMuzzlePoint($WeaponSlot); + %vec = %sender.player.getMuzzleVector($WeaponSlot); + %targetpos = vectoradd(%pos, vectorscale(%vec, 100)); + %obj = containerraycast(%pos, %targetpos, $typemasks::staticshapeobjecttype, %sender.player); + %obj = getword(%obj, 0); + %dataBlock = %obj.getDataBlock(); + %className = %dataBlock.className; + + if (!isObject(%obj)) { + messageclient(%sender, 'MsgClient', '\c5No Object in range.'); + return 1; + } + if (%obj.ownerguid != %sender.guid && !%sender.isSuperAdmin){ + messageclient(%sender, 'MsgClient', "\c2You do not own this."); + return 1; + } + if (!Deployables.isMember(%obj)) { + messageClient(%sender, 'MsgClient', "\c2That piece is part of the map and cannot be deleted."); + return 1; + } + %obj.Invincible = !%obj.Invincible; + messageclient(%sender, 'MsgClient', "\c2object invincibility toggled to "@%obj.Invincible@"."); + return 1; + + //getScale: returns the piecewise scale of an object + case "getscale": + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2You must have a player object.'); + return 1; + } + %pos = %sender.player.getMuzzlePoint($WeaponSlot); + %vec = %sender.player.getMuzzleVector($WeaponSlot); + %targetpos = vectoradd(%pos,vectorscale(%vec, 100)); + %obj = containerraycast(%pos, %targetpos, $typemasks::staticshapeobjecttype, %sender.player); + %obj = getword(%obj, 0); + %dataBlock = %obj.getDataBlock(); + %className = %dataBlock.className; + %owner = %obj.owner; + if (!isObject(%obj)) { + messageclient(%sender, 'MsgClient', '\c5No object in range.'); + return 1; + } + %scale = %obj.getRealSize(); + messageclient(%sender, 'MsgClient', "\c5This object's ("@%obj@") scale is "@%scale@"."); + return 1; + + //getObj: returns details about an object + case "getobj": + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2You must have a player object.'); + return 1; + } + %pos = %sender.player.getMuzzlePoint($WeaponSlot); + %vec = %sender.player.getMuzzleVector($WeaponSlot); + %targetpos = vectoradd(%pos,vectorscale(%vec,100)); + %obj = containerraycast(%pos,%targetpos,$AllObjMask,%sender.player); + %obj = getword(%obj,0); + %dataBlock = %obj.getDataBlock(); + %className = %dataBlock.className; + %owner = %obj.owner; + if (!isObject(%obj)) { + messageclient(%sender, 'MsgClient', '\c5No object in range.'); + return 1; + } + messageclient(%sender, 'MsgClient', "\c5ObjectID: ("@%obj@") DB: "@%obj.getDatablock().getName()@"."); + return 1; + + //pm: private messaging + case "pm": + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + %message = getwords(%args, 1); + if (%target==0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + messageclient(%target, 'MsgClient',"\c1From "@%sender.namebase@": "@%message); + messageclient(%sender, 'MsgClient',"\c1To "@%target.namebase@": "@%message); + echo("\c2Private Message from: "@%sender.namebase@" to: "@%target.namebase@"\c1 "@%message); + return 1; + + //opendoor: used to open doors... obvious enough. + case "opendoor": + %pos = %sender.player.getMuzzlePoint($WeaponSlot); + %vec = %sender.player.getMuzzleVector($WeaponSlot); + %targetpos = vectoradd(%pos,vectorscale(%vec, 100)); + %obj = containerraycast(%pos, %targetpos, $typemasks::staticshapeobjecttype, %sender.player); + %obj = getword(%obj, 0); + %dataBlock = %obj.getDataBlock(); + %className = %dataBlock.className; + %owner = %obj.owner; + %obj.issliding = 0; + if (%obj.Collision == true) { + return 1; + } + if (%obj.canmove == false) { + return 1; + } + if (%obj.isdoor != 1){ + messageclient(%sender, 'MsgClient', '\c5No door in range.'); + return 1; + } + if (!isObject(%obj)) { + messageclient(%sender, 'MsgClient', '\c5No door in range.'); + return 1; + } + if (%obj.powercontrol == 1) { + messageclient(%sender, 'MsgClient', '\c5This door is controlled by a power supply.'); + return 1; + } + %pass = %args; + if (%obj.pw $= %pass) { + if (%obj.toggletype ==1){ + if (%obj.moving $= "close" || %obj.moving $= "") { + schedule(10,0,"open",%obj); + return 1; + } + else if (%obj.moving $="open"){ + schedule(10,0,"close",%obj); + return 1; + } + } + else { + schedule(10,0,"open",%obj); + return 1; + } + } + if (%obj.pw !$= %pass) { + messageclient(%sender,'MsgClient',"\c2Password Denied."); + return 1; + } + + //setPass: set the password on a door + case "setpass": + %pos = %sender.player.getMuzzlePoint($WeaponSlot); + %vec = %sender.player.getMuzzleVector($WeaponSlot); + %targetpos = vectoradd(%pos, vectorscale(%vec, 100)); + %obj = containerraycast(%pos, %targetpos, $typemasks::staticshapeobjecttype, %sender.player); + %obj = getword(%obj, 0); + %dataBlock = %obj.getDataBlock(); + %className = %dataBlock.className; + if (%classname !$= "door") { + messageclient(%sender, 'MsgClient', '\c2No door in range.'); + return 1; + } + if (%obj.owner != %sender && %obj.owner !$="") { + messageclient(%sender, 'MsgClient', '\c2You do not own this door.'); + return 1; + } + if (!isobject(%obj)) { + messageclient(%sender, 'MsgClient', '\c2No door in range.'); + return 1; + } + if (%obj.Collision $= true) { + messageclient(%sender, 'MsgClient', '\c2Collision doors can not have passwords.'); + return 1; + } + if(isObject(%obj) && %obj.owner == %sender) { + %pw = getword(%args,0); + %obj.pw = %pw; + messageclient(%sender, 'MsgClient', '\c2Password set, password is %1.',%pw); + return 1; + } + + //setSpawn: sets the player's spawnpoint to a spawnpoint object + case "setspawn": + %pos = %sender.player.getMuzzlePoint($WeaponSlot); + %vec = %sender.player.getMuzzleVector($WeaponSlot); + %targetpos = vectoradd(%pos, vectorscale(%vec, 100)); + %obj = containerraycast(%pos, %targetpos, $typemasks::staticshapeobjecttype, %sender.player); + %obj = getword(%obj, 0); + %dataBlock = %obj.getDataBlock(); + if (!isobject(%obj) || %datablock.isSpawnpoint != 1) { + messageclient(%sender, 'MsgClient', '\c2No spawn point in range.'); + return 1; + } + if ((%obj.owner != %sender) && (%obj.isPersonal == 1)) { + messageclient(%sender, 'MsgClient', '\c2This is a personal spawn point, you cannot spawn here.'); + return 1; + } + if (%obj.team != %sender.team) { + messageclient(%sender, 'MsgClient', '\c2This spawn point is not on your team.'); + return 1; + } + %sender.spawnpoint = %obj; + messageclient(%sender, 'MsgClient', '\c2Spawn point set to this location, use /clearSpawn to reset'); + return 1; + + //clearSpawn: resets the spawnpoint of a player to the map default + case "clearspawn": + %sender.spawnpoint =0; + messageclient(%sender, 'MsgClient', '\c2Spawn point set to default location.'); + return 1; + + //delMyPieces: remove all of the pieces belonging to the calling player + case "delmypieces": + messageclient(%sender, 'MsgClient', "\c2You have deleted your pieces."); + %group = nameToID("MissionCleanup/Deployables"); + %count = %group.getCount(); + for (%i = 0; %i < %count; %i++) { + %obj = %group.getObject(%i); + if (%obj.getOwner() == %sender) { + %random = getRandom(500, 5000); + %obj.getDataBlock().schedule(%random, "disassemble", %sender.player, %obj); + } + } + return 1; + + //name: rename an object + case "name": + %pos = %sender.player.getMuzzlePoint($WeaponSlot); + %vec = %sender.player.getMuzzleVector($WeaponSlot); + %targetpos = vectoradd(%pos, vectorscale(%vec, 100)); + %obj = containerraycast(%pos, %targetpos, $typemasks::staticshapeobjecttype, %sender.player); + %obj = getword(%obj, 0); + %dataBlock = %obj.getDataBlock(); + %className = %dataBlock.className; + + if (%obj.getowner() != %sender && !%sender.isadmin){ + messageclient(%sender, 'MsgClient', "\c2You do not own this."); + return 1; + } + if (%className $= "waypoint"){ + %obj.wp.schedule(10, "delete"); + %waypoint = new (WayPoint)(){ + dataBlock = WayPointMarker; + position = %obj.getPosition(); + name = %args; + scale = "0.1 0.1 0.1"; + team = %sender.team; + }; + MissionCleanup.add(%waypoint); + %obj.nametoset = %args; + %obj.wp = %waypoint; + return 1; + } + else { + setTargetName(%Obj.target, addTaggedString(collapseEscape(%args))); + %obj.nametoset = %args; + return 1; + } + + //scale: resize an object to any given coords + case "scale": + %pos = %sender.player.getMuzzlePoint($WeaponSlot); + %vec = %sender.player.getMuzzleVector($WeaponSlot); + %targetpos = vectoradd(%pos, vectorscale(%vec, 100)); + %obj = containerraycast(%pos, %targetpos, $typemasks::staticshapeobjecttype, %sender.player); + %obj = getword(%obj,0); + if (%obj < 1) { + return 1; + } + %objectScale = getwords(%obj.getScale(), 0, 2); + %dataBlock = %obj.getDataBlock(); + %name = %dataBlock.getname(); + %className = %dataBlock.className; + %old = %obj.getRealSize(); + if (!isObject(%obj)) { + messageclient(%sender, 'MsgClient', '\c5No Object in range.'); + return 1; + } + if (!Deployables.isMember(%obj)) { + messageClient(%sender, 'MsgClient', "\c2That piece is part of the map and cannot be resized."); + return 1; + } + if (%obj.ownerguid != %sender.guid && (%sender.isAdmin !=1 && (%obj.ownerguid !$="" && %obj.powerfreq !$=""))){ + messageclient(%sender, 'MsgClient', "\c2You do not own this."); + return 1; + } + + %x = getWord(%args, 0); + %y = getWord(%args, 1); + %z = getWord(%args, 2); + + if((%x < 0.1 || %x > 500) && %x !$= "x") { + messageclient(%sender, 'MsgClient', "\c2Error: X Size Not Specified or Invalid"); + return 1; + } + if((%y < 0.1 || %y > 500) && %y !$= "x") { + messageclient(%sender, 'MsgClient', "\c2Error: Y Size Not Specified or Invalid"); + return 1; + } + if((%z < 0.1 || %z > 500) && %z !$= "x") { + messageclient(%sender, 'MsgClient', "\c2Error: Z Size Not Specified or Invalid"); + return 1; + } + if(%x $= "x") { + %x = getword(%obj.getScale(), 0); + } + if(%y $= "x") { + %y = getword(%obj.getScale(), 1); + } + if(%z $= "x") { + %z = getword(%obj.getScale(), 2); + } + if(%x <= 0 || %y <= 0 || %z <= 0) { + messageclient(%sender, 'MsgClient', "\c2Error: Missing Side Value"); + return 1; + } + %set = %x SPC %y SPC %z; + %fullscale = %set; + //Redone 6/19/09 + if(%classname $= "spine" || %classname $= "mspine" || %classname $= "spine2" || %classname $= "wall" || %classname $= "wwall" || %classname $= "floor" || %classname $= "door") { + %fullscale = VectorMultiply(%fullscale, "0.250 0.333333 2"); //thanks krash. + } + //APPLY + //ensure sizes have not been modified + %obj.setCloaked(true); + %obj.schedule(150, "setCloaked", false); + // + messageclient(%sender, 'MsgClient', "\c2Rescaling "@%obj@", To "@%set@", From "@%old@"."); + %obj.SetRealSize(%fullscale); + %obj.scale = %fullscale; + %obj.settransform(%obj.gettransform()); + + PostOperationCheck(%obj); + return 1; + + //objMove: chat command based piece nudge + case "objmove": + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2You must have a player object.'); + return 1; + } + %pos = %sender.player.getMuzzlePoint($WeaponSlot); + %vec = %sender.player.getMuzzleVector($WeaponSlot); + %targetpos = vectoradd(%pos, vectorscale(%vec, 100)); + %obj = containerraycast(%pos, %targetpos, $typemasks::staticshapeobjecttype, %sender.player); + %obj = getword(%obj,0); + %dataBlock = %obj.getDataBlock(); + %className = %dataBlock.className; + %objpos = %obj.getposition(); + %move = getwords(%args, 0); + %moveto = vectorAdd(%objpos, %move); + + if (!isObject(%obj)) { + messageclient(%sender, 'MsgClient', '\c5No Object in range.'); + return 1; + } + if (%obj.ownerguid != %sender.guid && (!%sender.isAdmin && (%obj.ownerguid !$="" && %obj.powerfreq !$=""))){ + messageclient(%sender, 'MsgClient', "\c2You do not own this."); + return 1; + } + if (!Deployables.isMember(%obj)) { + messageClient(%sender, 'MsgClient', "\c2That piece is part of the map and cannot be moved."); + return 1; + } + if (%obj.isdoor == 1) { //only move doors that are fully closed and not moving + if (%obj.canmove == false){ + messageclient(%sender, 'MsgClient', "\c2You cannot move a door that is already moving."); + return 1; + } + if(%obj.state !$= "closed" && %obj.state !$= ""){ + messageclient(%sender, 'MsgClient', "\c2You can only move fully closed doors."); + return 1; + } + } + + if(mAbs(getWord(%args, 0)) > 5000 || mAbs(getWord(%args, 1)) > 5000 || (mAbs(getWord(%args, 2)) > 5000 && getWord(%args, 2) !$= "grd")) { + messageclient(%sender, 'MsgClient', '\c2Invalid coordinate provided.'); + return 1; + } + + %z = getWord(%args, 2); + %obj.setCloaked(true); + %obj.schedule(150, "setCloaked", false); + %obj.setposition(%moveto); + if(%z $= "grd") { + %NewPos = %obj.getPosition(); + %x = getWord(%NewPos, 0); + %y = getWord(%NewPos, 1); + %z = GetTerrainHeight(%NewPos); //fun fun :) + %goto = ""@%x@" "@%y@" "@%z@""; + %obj.setposition(%goto); + } + adjustTrigger(%obj); //inv fix + messageclient(%sender, 'MsgClient', "\c2object moved "@%move@"."); + + PostOperationCheck(%obj); + return 1; + + //del: deletes an object belonging to the player + case "del": + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2You must have a player object.'); + return 1; + } + %pos = %sender.player.getMuzzlePoint($WeaponSlot); + %vec = %sender.player.getMuzzleVector($WeaponSlot); + %targetpos = vectoradd(%pos, vectorscale(%vec, 100)); + %obj = containerraycast(%pos, %targetpos, $typemasks::staticshapeobjecttype, %sender.player); + %obj = getword(%obj, 0); + %dataBlock = %obj.getDataBlock(); + %className = %dataBlock.className; + + if (!isObject(%obj)) { + messageclient(%sender, 'MsgClient', '\c5No Object in range.'); + return 1; + } + if (%obj.ownerguid != %sender.guid && !%sender.isSuperAdmin){ + messageclient(%sender, 'MsgClient', "\c2You do not own this."); + return 1; + } + if (!Deployables.isMember(%obj)) { + messageClient(%sender, 'MsgClient', "\c2That piece is part of the map and cannot be deleted."); + return 1; + } + %obj.delete(); + messageclient(%sender, 'MsgClient', "\c2object deleted."); + return 1; + + //givePieces: call a piece transfer to another player + case "givepieces": + %nametotest = getword(%args, 0); + %target=plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + // + %target.recipientOf[%sender] = 1; + %target.canAcceptDenyPieces = 1; + %target.pieceTransferFrom = %sender; + messageClient(%sender, 'msgCli', "\c3Offering your pieces to "@%target.namebase@"."); + messageClient(%target, 'msgCli', "\c3"@%sender.namebase@" wants to transfer his pieces to you."); + messageClient(%target, 'msgCli', "\c3Press INSERT to accept or DELETE to deny."); + // + return 1; + + //power: sets the player's current power frequence + case "power": + %client = %sender.player; + if(%args > 150) { + %client.powerfreq = 1; + messageclient(%sender, 'MsgClient', "\c5Max Freq 150"); + messageclient(%sender, 'MsgClient', "\c2Setting To Freq 1"); + return 1; + } + %sender.player.powerFreq = %args; + messageclient(%sender, 'MsgClient', "\c2Setting To Freq "@%args@"."); + return 1; + + //hover: used to create a moving hoverpad for a player + case "hover": + if (!IsObject(%Sender.player)){ + messageclient(%sender, 'MsgClient', '\c5No player object.'); + return 1; + } + if (!$host::Purebuild){ + messageclient(%sender, 'MsgClient', '\c5Purebuild is off.'); + return 1; + } + if (%Sender.ishovering == 0){ + %Pad = new StaticShape() { + dataBlock = DeployedSpine; + scale = ".3 .3 1"; + position = "0 0 0"; + }; + %Pad.setCloaked(true); + %Pad.setowner(%Sender); + %Pad.isHoverPad = 1; + %Sender.HoverPad = %Pad; + %Sender.ishovering = 1; + Hover(%Sender); + messageclient(%sender, 'MsgClient', '\c5Now hovering...'); + return 1; + } + else { + %Sender.ishovering = 0; + messageclient(%sender, 'MsgClient', '\c5Stopped hovering.'); + %Sender.HoverPad.delete(); + return 1; + } + + //moveAll: moves every piece owned by the player some coordinate value + case "moveall": + if(%sender.cantMoveAll) { + messageclient(%sender, 'MsgClient', "\c5You have only recently moved all deployables."); + return 1; + } + %x = getWord(%args, 0); + %y = getWord(%args, 1); + %z = getWord(%args, 2); + if(%x $= "" || (%x > 5000 && !%sender.isAdmin)) { + messageclient(%sender, 'MsgClient', "\c5Missing or Invalid 'X' Variable."); + return 1; + } + if(%y $= "" || (%y > 5000 && !%sender.isAdmin)) { + messageclient(%sender, 'MsgClient', "\c5Missing or Invalid 'Y' Variable."); + return 1; + } + if(%z $= "" || (%z > 5000 && !%sender.isAdmin)) { + messageclient(%sender, 'MsgClient', "\c5Missing or Invalid 'Z' Variable."); + return 1; + } + %move = %x SPC %y SPC %z; + %group = nameToID("MissionCleanup/Deployables"); + %count = %group.getCount(); + for (%i = 0; %i < %count; %i++) { + %obj = %group.getObject(%i); + if (%obj.getOwner() == %sender) { + %newPos = vectorAdd(%obj.getPosition(), %move); + %obj.setPosition(%newPos); + adjustTrigger(%obj); + + PostOperationCheck(%obj); + } + } + schedule(30000,0,eval, ""@%sender@".cantMoveAll = 0;"); + %sender.cantMoveAll = 1; + messageclient(%sender, 'MsgClient', "\c5Moving your pieces "@%move@"."); + return 1; + + //radius: sets the power radius on a generator, solar panel, or a switch + case "radius": + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2You must have a player object.'); + return 1; + } + %pos = %sender.player.getMuzzlePoint($WeaponSlot); + %vec = %sender.player.getMuzzleVector($WeaponSlot); + %targetpos = vectoradd(%pos, vectorscale(%vec, 100)); + %obj = containerraycast(%pos, %targetpos, $typemasks::staticshapeobjecttype, %sender.player); + %obj = getword(%obj, 0); + %dataBlock = %obj.getDataBlock(); + %name = %dataBlock.getname(); + if (%obj < 1) { + return 1; + } + %rad = getword(%args, 0); + %obj.setCloaked(true); + %obj.schedule(150, "setCloaked", false); + %obj.switchRadius = %rad; + messageclient(%sender, 'MsgClient', "\c5Radius Set to "@%rad@"."); + return 1; + + //objPower: set the power frequency a specific object uses + case "objpower": + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2You must have a player object.'); + return 1; + } + %pos = %sender.player.getMuzzlePoint($WeaponSlot); + %vec = %sender.player.getMuzzleVector($WeaponSlot); + %targetpos = vectoradd(%pos, vectorscale(%vec, 100)); + %obj = containerraycast(%pos, %targetpos, $typemasks::staticshapeobjecttype, %sender.player); + %obj = getword(%obj, 0); + %dataBlock = %obj.getDataBlock(); + %className = %dataBlock.className; + %owner = %obj.GetOwner(); + if (!isObject(%obj)) { + messageclient(%sender, 'MsgClient', '\c5No object in range.'); + return 1; + } + if(%owner != %sender) { + messageclient(%sender, 'MsgClient', '\c5You do not own this.'); + return 1; + } + %freq = getWord(%args, 0); + if(%freq < 0 || %freq > 150) { + messageclient(%sender, 'MsgClient', '\c5Invalid Power Freq.'); + return 1; + } + %obj.setCloaked(true); + %obj.schedule(300, "SetCloaked", false); + %obj.powerFreq = %freq; + checkPowerObject(%obj); + messageclient(%sender, 'MsgClient', "\c5Object "@%obj@", power Freq Set To "@%freq@"."); + return 1; + + //timer: used by timed switches, sets the turn off/on time for these objects + case "timer": + if(!isObject(%sender.player) || %sender.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2You must have a player object.'); + return 1; + } + %pos = %sender.player.getMuzzlePoint($WeaponSlot); + %vec = %sender.player.getMuzzleVector($WeaponSlot); + %targetpos = vectoradd(%pos, vectorscale(%vec, 100)); + %obj = containerraycast(%pos, %targetpos, $typemasks::staticshapeobjecttype, %sender.player); + %obj = getword(%obj, 0); + %dataBlock = %obj.getDataBlock(); + %className = %dataBlock.className; + %owner = %obj.GetOwner(); + if (!isObject(%obj)) { + messageclient(%sender, 'MsgClient', '\c5No object in range.'); + return 1; + } + if(%owner != %sender) { + messageclient(%sender, 'MsgClient', '\c5You do not own this.'); + return 1; + } + if(%dataBlock.getName() !$= "DeployedSwitch") { + messageclient(%sender, 'MsgClient', '\c5Object is not a switch.'); + return 1; + } + %time = getWord(%args, 0); + if(%time < 1.5) { + messageclient(%sender, 'MsgClient', '\c5Time must be larger than 1.5 seconds.'); + return 1; + } + %obj.SwitchTimer = %time * 1000; + messageclient(%sender, 'MsgClient', "\c5Switch "@%obj@", time delay Set To "@%time@" seconds."); + return 1; + + //setRot: set the rotate angle on the construction tool + case "setrot": + if(%args $= "" || %args < 0 || %args > 360) { + %sender.RotateAngle = 22.5; + messageclient(%sender, 'MsgClient', "\c2Rotate Angle Reset."); + return 1; + } + messageclient(%sender, 'MsgClient', "\c2Rotate Angle Set To \c3"@%args@"\c2."); + %sender.RotateAngle = %args; + return 1; + + //setNudge: set's the power of the Nudge function on MIST + case "setnudge": + if(%args $= "" || (%args < 0) || %args > 100) { + %sender.MoveSetting = 0.1; + MessageClient(%sender, 'MsgClient', "\c2Move Tool Nudge Set To Default (0.1)."); + return 1; + } + %sender.MoveSetting = %args; + MessageClient(%sender, 'MsgClient', "\c2Move Tool Nudge Set To "@%args@"."); + return 1; + + //undo: un-do the previous construction action. + case "undo": + messageClient(%sender, 'msgClient', "\c3Undoing previous action."); + %sender.undoLastConstructionAction(); + return 1; + + //getGUID: returns the player's GUID # to them + case "getguid": + MessageClient(%sender, 'MsgClient', "\c2Your GUID is: \c3"@%sender.guid@"\c2."); + return 1; + + //voteBoss: start a vote to spawn a boss + case "voteboss": + if(!$TWM2::AllowBossVotes) { + messageclient(%sender, 'MsgClient', '\c2The server host has disabled boss votes.'); + return 1; + } + if($TWM::PlayingHorde || $TWM::PlayingHelljump) { + messageclient(%sender, 'MsgClient', '\c2No bosses allowed in horde or helljump.'); + return 1; + } + if($TWM2::BossAllowTimer != 0) { + %min = mFloor($TWM2::BossAllowTimer / 60); + %sec = $TWM2::BossAllowTimer % 60; + if(%sec < 10) { + %sec = "0"@%sec; + } + messageclient(%sender, 'MsgClient', "\c2Boss Votes Not allowed for another "@%min@":"@%sec@""); + return 1; + } + %Boss = getWord(%args, 0); + if (!isObject(RndCli())) { + messageclient(%sender, 'MsgClient', '\c2No Players seem to be spawned..'); + return 1; + } + else if (!%sender.canvote) { + messageclient(%sender, 'MsgClient', '\c2You cannot vote yet.'); + return 1; + } + else if($TWM2::BossGoing) { + messageclient(%sender, 'MsgClient', '\c2A Boss Is Already Spawned.'); + return 1; + } + else if (!isBoss(strlwr(%Boss))) { + messageclient(%sender, 'MsgClient', '\c2Invalid Boss Name.'); + messageclient(%sender, 'MsgClient', '\c2Bosses: Yvex, CnlWindshear, GOL, GOF, Stormrider, DAVardison.'); + messageclient(%sender, 'MsgClient', '\c2GenVeg, LordRog, Insignia, Trebor, Vardison, ShadeLord.'); + return 1; + } + else { + if ( Game.scheduleVote !$= "" ) { + messageclient(%sender, 'MsgClient', '\c2A Vote is in progress..'); + return 1; + } + %BossFName = BossFullname(%Boss); //get the boss' full name + for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) { + %cl = ClientGroup.getObject( %idx ); + if ( !%cl.isAIControlled() ) { + messageClient( %cl, 'VoteStarted', '\c2%1 wants to start boss \c1%2\c2!', %sender.name, %BossFName); + %clientsVoting++; + } + } + for ( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ ) { + %cl = ClientGroup.getObject( %clientIndex ); + if ( !%cl.isAIControlled() ) { + messageClient(%cl, 'openVoteHud', "", %clientsVoting, ($Host::VotePassPercent / 100)); + } + } + $TWM2::BossAllowTimer = 20 * 60; //60 sec * 60 = 60 minutes, or 1 hour + schedule(1000, 0, "LowerBossAllowTime"); + clearVotes(); + %sender.canVote = false; + schedule(20*1000, 0, resetVotePrivs, %sender); + Game.voteType = "BossVote"; + Game.BVoteboss = %Boss; + Game.scheduleVote = schedule( ($Host::VoteTime * 1000), 0, "BossVoteEval", %Boss, false); + %sender.vote = true; + messageAll('addYesVote', ""); + return 1; + } + + //myPhrase: sets the players custom phrase as shown on F2 and PGD Connect + case "myphrase": + %clientController = %sender.TWM2Core; + %clientController.phrase = %args; + messageClient(%sender, 'msgClient', "\c5TWM2: You have set your phrase to: "@$Rank::Phrase[%sender.GUID]@""); + updateClientRank(%sender); + UpdateRankFile(%sender); + return 1; + + //whoIs: displays player information given their auth info + case "whois": + if (!strlen(trim(%args))) { + messageClient(%sender, 'NoArgs', "\c2No Name/GUID?"); + } + else { + %reqcl = plnametocid(%args); + if (%reqcl == 0) { + //search through clients and look for a matching guid + %isguid = 1; + %count = ClientGroup.getCount(); + for (%i = 0; %i < %count; %i++) { + %c = ClientGroup.getObject(%i); + if (%c.guid == %args) { + %reqcl = %c; + break; + } + } + if (%reqcl == 0) { + messageClient(%sender, 'NoCl', "\c2No Client was found with that name/guid."); + return 1; + } + } + %auth = %reqcl.getAuthInfo(); + %name = stripChars(detag(getTaggedString(%reqcl.name)), "\cp\co\c6\c7\c8\c9"); + %namebase = stripChars(detag(%reqcl.namebase),"\cp\co\c6\c7\c8\c9" ); + %realname = stripChars(detag(getField(%auth,0)), "\cp\co\c6\c7\c8\c9"); + %guid = %reqcl.guid; + %lastjoin = %reqcl.joinedtime; + %ip = strReplace(%reqcl.getAddress(), "IP:", ""); + %ip = getSubStr(%ip, 0, strPos(%ip, ":")); + %admin = %reqcl.isAdmin + %reqcl.isSuperadmin; + + %isastr = (%admin == 2 ? "is a Super Admin" : (%admin == 0 ? "isn't an Admin" : "is an Admin")); + %smurf = (strcmp(%name, %realname) == 0 ? 0 : 1); + %nstr = (%smurf == 1 ? "("@%realname@")" : ""); + if (%isguid) { + %nstr = trim(%nstr) SPC "is" SPC %guid; + } + messageClient(%sender, 'WhoisReply', "\c2"@%name SPC %nstr); + messageClient(%sender, 'WhoisReply', "\c2\t" SPC %name SPC "is" SPC (%smurf ? "not a Smurf" : "a Smurf")); + messageClient(%sender, 'WhoisReply', "\c2\t" SPC %name @ "'s GUID is" SPC %guid); + messageClient(%sender, 'WhoisReply', "\c2\t" SPC %name SPC "is connecting from" SPC %ip); + messageClient(%sender, 'WhoisReply', "\c2\t" SPC %name SPC (%reqcl.isAIControlled() ? "is" : "isn't") SPC "a bot"); + messageClient(%sender, 'WhoisReply', "\c2\t" SPC %name SPC (%reqcl.isPGDConnected() ? "is" : "isn't") SPC "PGD Connected"); + messageClient(%sender, 'WhoisReply', "\c2\t" SPC %name SPC "last connected on" SPC %lastjoin); + messageClient(%sender, 'WhoisReply', "\c2\t" SPC %name SPC %isastr); + } + return 1; + + //depSec: toggles permission to build on or near a players pieces + case "depsec": + %statString = %sender.pieceSecured ? "are no longer" : "are now"; + %sender.pieceSecured = !%sender.pieceSecured; + messageClient(%sender, 'msgClient', "\c3Deploy rights on your pieces "@%statString@" secured."); + return 1; + + //uSave: univerally save a building in a CSS slot + case "usave": + if(!%sender.IsPGDConnected()) { + messageClient(%client, 'msgPGDRequired', "\c5PGD: PGD Connect account required to perform this action."); + return 1; + } + else { + echo("Client:" SPC %sender.namebase SPC "requests universal save."); + %file = strReplace(%args, ".cs", ""); + %file = %file @ ".cs"; + %file = "Buildings/Admin/"@%sender.guid@"/" @ %file; + if(isFile(%file)) { + MessageAll('MsgAdminForce', "\c3"@%sender.namebase@" is universally saving a building."); + Univ_ServerConnect(%sender, %file, "Save"); + } + else { + messageClient(%client, 'msgPGDRequired', "\c5PGD: That slot/file does not exist"); + } + return 1; + } + + //uLoad: load a universally saved building + case "uload": + if(!%sender.IsPGDConnected()) { + messageClient(%sender, 'msgPGDRequired', "\c5PGD: PGD Connect account required to perform this action."); + return 1; + } + if(%sender.cantLoad) { + messageClient(%sender, 'msgPGDRequired', "\c5PGD: You have only recently loaded."); + return 1; + } + $SaveTime::TimeLeft[%sender.guid, "Load"] = $TWM::CSSTimeLoad*60; //5 mins + %sender.cantLoad = 1; + schedule(1,0,"ResetLoad",%sender); + %args = strReplace(%args, ".cs", ""); + LoadUniversalBuilding(%sender, %args); + return 1; + + //saveRank: save your rank to PGD + case "saverank": + if(!%sender.canSaveRank) { + messageClient(%sender, 'MsgClient', "\c5PGD: You have only recently saved your rank."); + return 1; + } + if(!%sender.IsPGDConnected()) { + messageClient(%sender, 'msgPGDRequired', "\c5PGD: PGD Connect account required to perform this action."); + return; + } + if($IsAuthed $= false) { + messageClient(%sender, 'msgPGDRequired', "\c5PGD: This is a Satellite Server, only core servers can save ranks."); + return; + } + SaveClientFile(%sender); + PrepareUpload(%sender); + %sender.canSaveRank = 0; + schedule(60000 * 5, 0, "eval", ""@%sender@".canSaveRank = 1;"); + return 1; + + //loadRank: load your rank from PGD + case "loadrank": + if(!%sender.canLoadRank) { + messageClient(%sender, 'MsgClient', "\c5PGD: You have only recently re-loaded your rank."); + return 1; + } + if(!%sender.IsPGDConnected()) { + messageClient(%sender, 'msgPGDRequired', "\c5PGD: PGD Connect account required to perform this action."); + return; + } + LoadUniversalRank(%sender); + %sender.canLoadRank = 0; + schedule(60000 * 5, 0, "eval", ""@%sender@".canLoadRank = 1;"); + return 1; + + //checkStats: check the current rank information on a player + case "checkstats": + %clientController = %sender.TWM2Core; + %todaysDate = sha1sum(formattimestring("yymmdd")); + if(%args $= "") { + if(%clientController.officer $= "") { + %clientController.officer = 0; + } + %name = %sender.NameBase; + %Rank = ""@$Prestige::Name[%clientController.officer]@""@%clientController.rank@""; + %Stats = getCurrentEXP(%sender); + for(%i = $Rank::RankCount; %i >= 0; %i--){ + if(%stats >= $Ranks::MinPoints[%i]){ + %nextrank = ""@$Prestige::Name[%clientController.officer]@""@$Ranks::NewRank[(%i + 1)]@""; + %nextrankXP = $Ranks::MinPoints[(%i + 1)]; + %i = 0; + } + } + if(%Stats >= $Ranks::MinPoints[$Rank::RankCount]) { + messageClient(%sender, 'MsgClient', "\c2Your Rank is "@%Rank@", You Currently Have "@%stats@" XP, and you have gained "@%clientController.xpGain[%todaysDate]@" EXP today."); + return 1; + } + else { + messageClient(%sender, 'MsgClient', "\c2Your Rank is "@%Rank@", You Currently Have "@%stats@" XP, and you have gained "@%clientController.xpGain[%todaysDate]@" EXP today. Your next rank is "@%nextrank@" and you need "@(%nextrankXP - %stats)@" XP."); + return 1; + } + } + else { + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target==0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + // + %targetController = %target.TWM2Core; + if(%targetController.officer $= "") { + %targetController.officer = 0; + } + %Rank = ""@$Prestige::Name[%targetController.officer]@""@%targetController.rank@""; + %Stats = getCurrentEXP(%target); + messageClient(%sender, 'MsgClient', "\c2"@%target.namebase@"'s Rank is "@%Rank@" and "@%target.namebase@"'s XP is "@%stats@"."); + return 1; + } + + //setEmail: used for the PGD IGC interface + case "setemail": + if(!isSet(%args)) { + return 1; + } + %sender.emailSet = %args; + messageClient(%sender, 'msgSent', "\c3SERVER: Email set to "@%args@""); + return 1; + + case "msset": + %pos = %sender.player.getMuzzlePoint($WeaponSlot); + %vec = %sender.player.getMuzzleVector($WeaponSlot); + %targetpos = vectoradd(%pos, vectorscale(%vec, 100)); + %obj = containerraycast(%pos, %targetpos, $typemasks::staticshapeobjecttype, %sender.player); + %obj = getword(%obj,0); + %dataBlock = %obj.getDataBlock().getName(); + %className = %dataBlock.className; + %owner = %obj.owner; + if (!isobject(%obj)) { + messageclient(%sender, 'MsgClient', '\c5No object in range.'); + return 1; + } + if(%obj.getOwner() != %sender) { + messageclient(%sender, 'MsgClient', '\c5Not yours.'); + return 1; + } + if(%dataBlock !$= "DeployedMedalSeal") { + messageclient(%sender, 'MsgClient', '\c5Not a Medal Seal.'); + return 1; + } + // + %arg1 = strLwr(getWord(%args, 0)); + %arg2 = strLwr(getWord(%args, 1)); + switch$(%arg1) { + case "set": + switch$(%arg2) { + case "challengreq": + %medal = getWord(%args, 2); + %obj.targetNeeds = %medal; + messageclient(%sender, 'MsgClient', "\c5Requirement Set: "@%medal@""); + case "notmetmsg": + %msg = getWords(%args, 2); + %obj.targetNeedsInvalid = %msg; + messageclient(%sender, 'MsgClient', "\c5Message Set: "@%msg@""); + default: + messageclient(%sender, 'MsgClient', '\c5Unknown Second Argument - notmetmsg/challengreq.'); + return 1; + } + default: + messageclient(%sender, 'MsgClient', '\c5Unknown First Argument - set.'); + return 1; + } + return 1; + + //None Matching Case: + default: + return 0; + } +} + +addCMD("Public", "Help", "Usage: /help: displays mod help commands."); +addCMD("Public", "Whois", "Usage: /Whois [name or guid]: displays information about a player."); +addCMD("Public", "MyPhrase", "Usage: /MyPhrase [phrase]: sets your personal phrase for your rank card."); +addCMD("Public", "VoteBoss", "Usage: /VoteBoss [name]: votes to start a boss."); +addCMD("Public", "getGUID", "Usage: /getGUID: gives you your GUID."); +addCMD("Public", "SetNudge", "Usage: /SetNudge [Val]: sets your move tool's move snap."); +addCMD("Public", "SetRot", "Usage: /SetRot [Angle]: set your construction tool's rotation angle."); +addCMD("Public", "CMDHelp", "Usage: /CMDHelp [Command]: tells you about a command."); +addCMD("Public", "NameSlot", "Usage: /NameSlot [Save Slot] [Name]: Names a CSS Slot."); +addCMD("Public", "me", "Usage: /me [Text]: Sends a message under the \c0 Tag."); +addCMD("Public", "me1", "Usage: /me1 [Text]: Sends a message under the \c1 Tag."); +addCMD("Public", "me2", "Usage: /me2 [Text]: Sends a message under the \c2 Tag."); +addCMD("Public", "me3", "Usage: /me3 [Text]: Sends a message under the \c3 Tag."); +addCMD("Public", "me4", "Usage: /me4 [Text]: Sends a message under the \c4 Tag."); +addCMD("Public", "me5", "Usage: /me5 [Text]: Sends a message under the \c5 Tag."); +addCMD("Public", "r", "Usage: /r [Text]: Sends a radio message with the \c3 tag, good for RPs."); +addCMD("Public", "givecard", "Usage: /givecard [name] [Level# 1,2,or 3]: Gives a player a card for leveled doors."); +addCMD("Public", "takecard", "Usage: /takecard [name] [Level# 1,2,or 3]: remove a player's card for leveled doors."); +addCMD("Public", "GetScale", "Usage: /GetScale: Displays the size of an object."); +addCMD("Public", "getobj", "Usage: /getobj: Displays object information."); +addCMD("Public", "pm", "Usage: /pm [name] [message]: sends a private message to clients, ![name] [message] is another way."); +addCMD("Public", "opendoor", "Usage: /opendoor [pass ?]: opens a door."); +addCMD("Public", "setpass", "Usage: /setpass [pass]: sets a password on Normal & Toggle Doors."); +addCMD("Public", "bf", "Usage: /bf: gives you your current loadout in the inventory, purebuild must be on."); +addCMD("Public", "setSpawn", "Usage: /setSpawn: sets your spawn point."); +addCMD("Public", "clearspawn", "Usage: /clearspawn: sets you to spawn at the default location."); +addCMD("Public", "DelMyPieces", "Usage: /Delmypieces: deletes all objects you have deployed."); +addCMD("Public", "name", "Usage: /name [name]: names an object, you can use tags in this command."); +addCMD("Public", "scale", "Usage: /scale [# or x] [# or x] [# or x]: Sets the size of an object, 'x' will leave the current size on that axis."); +addCMD("Public", "objmove", "Usage: /objmove [#] [#] [#|Grd]: moves an object."); +addCMD("Public", "del", "Usage: /del: Deletes an object you own."); +addCMD("Public", "invDep", "Usage: /invDep: Toggles Object Invincibility."); +addCMD("Public", "power", "Usage: /power [#]: sets your current power frequency."); +addCMD("Public", "givePieces", "Usage: /givePieces [name]: gives your pieces to another player."); +addCMD("Public", "hover", "Usage: /hover: allows you to maintain your position in mid air."); +addCMD("Public", "radius", "Usage: /radius [#]: sets the radius of a switch."); +addCMD("Public", "MoveAll", "Usage: /MoveAll [X] [Y] [Z]: Moves All You Your Pieces"); +addCMD("Public", "ObjPower", "Usage: /ObjPower [freq]: sets the power freq of an object."); +addCMD("Public", "Timer", "Usage: /Timer [time > 1.5]: sets the switch delay on a switch."); +addCMD("Public", "DepSec", "Usage: /DepSec: secure deploy rights on your pieces."); +addCMD("Public", "undo", "Usage: /undo: undo your last construction action."); +addCMD("Public", "checkStats", "Usage: /checkStats [name or blank]: check the current rank info on a player."); +addCMD("Public", "uSave", "Usage: /uSave [slot #]: Save a building on the PGD server for loading in other servers."); +addCMD("Public", "uLoad", "Usage: /uLoad [slot #]: Load a universally saved building."); +addCMD("Public", "LoadRank", "Usage: /LoadRank: load your universal rank if it failed."); +addCMD("Public", "SaveRank", "Usage: /SaveRank: save your universal rank if it failed."); +addCMD("Public", "setEmail", "Usage: /setEmail [email]: set email for PGD IGC."); +addCMD("Public", "msSet", "Usage: /msSet [set] [args]: Medal Seal setup."); diff --git a/scripts/TWM2/ChatCommands/SuperAdmin.cs b/scripts/TWM2/ChatCommands/SuperAdmin.cs new file mode 100644 index 0000000..d0269c5 --- /dev/null +++ b/scripts/TWM2/ChatCommands/SuperAdmin.cs @@ -0,0 +1,769 @@ +function parseSuperAdminCommands(%sender, %command, %args) { + switch$(strLwr(%command)) { + //sacmds: list all super admin commands + case "sacmds": + if(!%sender.isSuperAdmin) { + return 3; + } + MessageClient(%sender, 'MsgCommandList', "\c5TWM2 Super Admin Commands"); + MessageClient(%sender, 'MsgCommandList', "\c3/TkToggle, /Sa, /MakeSA, /BlowVehs"); + MessageClient(%sender, 'MsgCommandList', "\c3/startBoss, /makePRG, /override"); + MessageClient(%sender, 'MsgCommandList', "\c3/givews, /giveKSSW, /turrets, /jail"); + MessageClient(%sender, 'MsgCommandList', "\c3/megaSlap, /Zap, /DroneSpawns, /pieceBan"); + return 1; + + //tktoggle: enable/disable Friendly Fire EXP gain + case "tktoggle": + if(!%sender.isSuperAdmin) { + return 3; + } + if($TWM2::FFAMode) { + $TWM2::FFAMode = 0; + MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 Disabled FFA Mode."); + } + else { + $TWM2::FFAMode = 1; + MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 Enabled FFA Mode."); + } + return 1; + + //sa: SA chat only + case "sa": + if (!%sender.issuperadmin) { + return 3; + } + %count = ClientGroup.getCount(); + for (%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject( %i ); + if(%cl.issuperadmin) { + messageclient(%cl, 'MsgClient', "\c5[SA]"@%sender.namebase@" : \c4"@%args@""); + } + } + return 1; + + //makeSA: obvious enough + case "makesa": + if (!%sender.issuperadmin) { + return 3; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target==0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + %target.isAdmin = true; + %target.isSuperAdmin = true; + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Made \c3"@ %target.namebase@"\c2 SA."); + messageclient(%target, 'MsgClient', '\c5 You are now a Super-Admin'); + //Re-add them to the list with the SA tag. + messageAll('MsgClientDrop', "", Game.kickClientName, %target); + messageAll('MsgClientJoin', "", %target.name, %target, %target.target, %target.isAIControlled(), %target.isAdmin, %target.isSuperAdmin, %target.isSmurf, %target.Guid); + %target.setSensorGroup(%target.team); + setTargetSensorGroup(%target.target, %target.team); + //hit here. + CheckGUID(%target); + // + return 1; + + //blowvehs: destroy all active vehic;es + case "blowvehs": + if (!%sender.issuperadmin){ + return 3; + } + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Destroyed All Vehicles."); + echo("All Vehicles Have Been Destroyed Via /Blowvehs"); + %count = MissionCleanup.getCount(); + for (%i = 0; %i < %count; %i++) { + %obj = MissionCleanup.getObject(%i); + if (%obj) { + if ((%obj.getType() & $TypeMasks::VehicleObjectType)) { + %random = getRandom() * 1000; + %obj.schedule(%random, setDamageState , Destroyed); + } + } + } + return 1; + + //startBoss: spawn a boss + case "startboss": + if (!%sender.issuperadmin){ + return 3; + } + if($TWM::PlayingHellJump || $TWM::PlayingHorde) { + messageClient(%sender, 'MsgClient', '\c2Cannot spawn bosses in horde or helljump'); + return 1; + } + if($TWM2::BossGoing) { + messageclient(%sender, 'MsgClient', '\c2A Boss Is Already Going.'); + return 1; + } + if(!isObject(%sender.player) || %sender.player.getState() $= "Dead") { + messageclient(%sender, 'MsgClient', '\c2Player Object Required.'); + return 1; + } + switch$(%args) { + case "Yvex": + %pos = VectorAdd(%sender.player.getPosition(), "0 0 5"); + SpawnYvex(%pos); + MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 spawned lord Yvex."); + case "CnlWindshear": + %pos = VectorAdd(%sender.player.getPosition(), "0 0 150"); + StartWindshear(%pos); + MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 spawned Colonel Windshear."); + case "GhostOfLightning": + %pos = VectorAdd(%sender.player.getPosition(), "0 0 5"); + SpawnGhostOfLightning(%pos); + MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 spawned the ghost of lightning."); + case "GenVegenor": + %pos = VectorAdd(%sender.player.getPosition(), "0 0 5"); + SpawnVegenor(%pos); + MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 spawned Yvex's General Vegenor."); + case "LordRog": + %pos = VectorAdd(%sender.player.getPosition(), "0 0 5"); + SpawnLordRog(%pos); + MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 Spawned Lord Rog."); + case "Insignia": + %pos = VectorAdd(%sender.player.getPosition(), "0 0 5"); + SpawnInsignia(%pos); + MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 spawned Rog's major insignia."); + case "Trebor": + %pos = VectorAdd(%sender.player.getPosition(), "0 0 15"); + StartTrebor(%pos); + MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 spawned Lordranius Trebor, leader of the harbinger clan."); + case "GhostOfFire": + %pos = VectorAdd(%sender.player.getPosition(), "0 0 15"); + StartGhostFire(%pos); + MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 spawned The Ghost Of Fire... RUN AWAY!!!"); + case "Stormrider": + %pos = VectorAdd(%sender.player.getPosition(), "0 0 15"); + StartStormrider(%pos); + MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 spawned Commander Stormrider, the aerial harbinger clan commander."); + case "Vardison": + %pos = VectorAdd(%sender.player.getPosition(), "0 0 5"); + StartVardison1(%pos); + MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 spawned Lord Vardison, go hide noobs."); + case "DAVardison": + %pos = VectorAdd(%sender.player.getPosition(), "0 0 5"); + StartDAVardison(%pos); + MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 spawned Dark Archmage Vardison, run in fear n0bs."); + case "ShadeLord": + %pos = VectorAdd(%sender.player.getPosition(), "0 0 5"); + SpawnShadeLord(%pos); + MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 has unleashed the relentless Shade Lord."); + default: + messageclient(%sender, 'MsgClient', '\c2Invalid Boss Name.'); + messageclient(%sender, 'MsgClient', '\c2Bosses: Yvex, CnlWindshear, GhostOfLightning.'); + messageclient(%sender, 'MsgClient', '\c2GenVegenor, LordRog, Insignia, Trebor, Vardison.'); + messageclient(%sender, 'MsgClient', '\c2Stormrider, GhostOfFire, ShadeLord, DAVardison.'); + } + return 1; + + //makePRG: transform a turret into a plasma railgun + case "makeprg": + if (!%sender.issuperadmin) { + return 3; + } + %pos = %sender.player.getMuzzlePoint($WeaponSlot); + %vec = %sender.player.getMuzzleVector($WeaponSlot); + %targetpos = vectoradd(%pos, vectorscale(%vec, 100)); + %obj = containerraycast(%pos, %targetpos, $typemasks::staticshapeobjecttype, %sender.player); + %obj = getword(%obj, 0); + %dataBlock = %obj.getDataBlock(); + %className = %dataBlock.className; + %owner = %obj.owner; + if (!isObject(%obj)) { + messageclient(%sender, 'MsgClient', '\c5No object in range.'); + return 1; + } + %classname = %obj.getDataBlock().getName(); + if(%classname $= "TurretBaseLarge" || %classname $= "TurretDeployedBase") { + messageclient(%sender, 'MsgClient', '\c5Mounting Plasma Railgun Barrel.'); + %obj.mountImage("PlasmaCannonBarrelLarge", 0); + return 1; + } + else { + messageclient(%sender, 'MsgClient', '\c5No turret in range.'); + return 1; + } + + //override: override the save/load reset timers + case "override": + if (!%sender.issuperadmin){ + return 3; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target==0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + %type = getWord(%args, 1); + if(%type $= "save") { + if(!%target.cantSave) { + messageclient(%sender, 'MsgClient', "\c2"@%target.namebase@" can already save."); + return 1; + } + else { + $SaveTime::TimeLeft[%target.guid, "Save"] = 1; + messageclient(%sender, 'MsgClient', "\c2"@%target.namebase@" has been granted a save override."); + return 1; + } + } + else if(%type $= "load") { + if(!%target.cantLoad) { + messageclient(%sender, 'MsgClient', "\c2"@%target.namebase@" can already load."); + return 1; + } + else { + $SaveTime::TimeLeft[%target.guid, "Load"] = 1; + messageclient(%sender, 'MsgClient', "\c2"@%target.namebase@" has been granted a load override."); + return 1; + } + } + else { + messageclient(%sender, 'MsgClient', "\c2Invalid, must be 'Save' or 'Load'."); + return 1; + } + return 1; + + //givews: spawn a windshear platform + case "givews": + if (!%sender.issuperadmin){ + return 3; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if(!isObject(%target.player) || %target.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2The Target Player must have a player object.'); + return 1; + } + if ($Host::Vehicles == 0) { + messageclient(%sender, 'MsgClient', '\c2Vehicles are disabled.'); + return 1; + } + messageclient(%target, 'MsgClient', "\c3"@ %sender.namebase@"\c5 Gave you a WS Platform."); + %pos = vectoradd(%target.player.getposition(), "0 0 100"); + %Horent = new FlyingVehicle() { + dataBlock = "WindshearPlatform"; + position = %pos; + respawn = "0"; + teamBought = %target.team; + team = %target.team; + }; + %Horent.getDataBlock().schedule(100, "mountDriver", %Horent, %target.player); + return 1; + + //givekssw: gives killstreaks + case "givekssw": + if (!%sender.issuperadmin){ + return 3; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + %sw = getWord(%args,1); + switch$(%sw) { + case "UAV": + %target.HasUAV = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" a UAV Recon."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you a UAV Beacon."); + case "Airstrike": + %target.HasAirstrike = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" an airstrike beacon."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you an airstrike."); + case "UAMS": + %target.HasGM = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" a UAMS beacon."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you a UAMS Strike."); + case "UnlimUAMS": + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" a fully loaded UAMS."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you a fully loaded UAMS."); + CreateMissileSat(%target, 1); + case "Helicopter": + %target.HasHeli = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" a Helicopter beacon."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you a Helicopter beacon."); + case "HeliGunner": + MakeTheHeli(%target, 1); + messageClient(%sender, 'MsgClient', "\c2You made "@%target.namebase@" a chopper gunner."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" has granted you Helicopter Gunner Access."); + case "Harbingers": + %target.HasHarbinsWrath = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" a Harbinger's Wrath beacon."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you a Harbinger's Wrath beacon."); + case "UnlimHarbin": + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" gunship support."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you gunship support."); + startHarbingersWrath(%target, 1, 1); + case "UnlimAC130": + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" AC-130 gunship support."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you AC-130 gunship support."); + startAC130(%target, 1, 1); + case "GunHeli": + %target.HasGunshipHeli = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" a Gunship Helicopter beacon."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you a Gunship Helicopter beacon."); + case "Apache": + %target.HasChopperGunner = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" an Apache Gunner beacon."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you an Apache Gunner beacon."); + case "Artillery": + %target.HasArtillery = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" a Centaur Artillery beacon."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you a Centaur Artillery beacon."); + case "Nuke": + %target.HasNuke = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" a Nuclear Strike beacon."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you a Nuclear Strike beacon."); + case "ZBomb": + %target.HasZBomb = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" a Zombie-Bomb beacon."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you a Zombie-Bomb beacon."); + case "Harrier": + %target.HasHarrier = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" a Harrier Airstrike beacon."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you a Harrier Airstrike beacon."); + case "Stealth": + %target.HasSlthAirstrike = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" a Stealth Airstrike beacon."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you a Stealth Airstrike beacon."); + case "AC130": + %target.HasAcGunner = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" an AC-130 beacon."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you an AC-130 beacon."); + case "SatNuke": + %target.HasOLS = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" a Orbital Laser Strike beacon."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you a Orbital Laser Strike beacon."); + case "Fission": + %target.HasFission = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" a Fission Bomb :D."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you a Fission Bomb :D."); + case "EMP": + %target.HasMassEMP = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" a Mass EMP Beacon."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you a Mass EMP Beacon."); + case "Napalm": + %target.HasNapalmHarrier = 1; + messageClient(%sender, 'MsgClient', "\c2You gave "@%target.namebase@" a Napalm Airstrike beacon."); + messageClient(%target, 'MsgClient', "\c2"@%sender.namebase@" gave you a Napalm Airstrike beacon."); + default: + messageclient(%sender, 'MsgClient', "\c2Killstreaks: UAV, Airstrike, UAMS, Helicopter"); + messageclient(%sender, 'MsgClient', "\c2HeliGunner, Harbingers, UnlimUAMS, UnlimHarbin"); + messageclient(%sender, 'MsgClient', "\c2GunHeli, Apache, Artillery, Nuke, ZBomb, Harrier"); + messageclient(%sender, 'MsgClient', "\c2Stealth, UnlimAC130, AC130, SatNuke, Fission, EMP"); + messageclient(%sender, 'MsgClient', "\c2Napalm"); + } + GiveTWM2Weapons(%target); //<- this gives beacons + return 1; + + //turrets: enable/disable turrets + case "turrets": + if (%sender.isSuperadmin) { + if ($TWM2::TurretsDisabled) { + $TWM2::TurretsDisabled = 0; + MessageAll('MsgAdminforce', '\c3%1\c2 has enabled turrets.', %sender.namebase); + } + else { + $TWM2::TurretsDisabled = 1; + MessageAll('MsgAdminforce', '\c3%1\c2 has disabled turrets.', %sender.namebase); + } + } + else { + return 3; + } + return 1; + + //jail: put a player in jail + case "jail": + if (!%sender.issuperadmin) { + return 3; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if(!isObject(%target.player) || %target.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2The Target Player must have a player object.'); + return 1; + } + if (!$Host::Prison::Enabled) { + messageclient(%sender, 'MsgClient', '\c2Jail Disabled.'); + return 1; + } + if (%target.isjailed) { + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 released \c3"@ %target.namebase@"\c2 from Jail."); + %target.player.setPosition($Prison::ReleasePos); + %target.isjailed = 0; + buyfavorites(%target); + return 1; + } + %target.player.setPosition($Prison::JailPos); + %target.isjailed = 1; + %target.player.clearinventory(); + %Gender = (%target.sex $= "Male" ? 'him' : 'her'); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Arrested \c3"@ %target.namebase@"\c2 And Put "@getTaggedString(%gender)@" In Jail."); + return 1; + + //megaslap: slap with added damage + case "megaslap": + if(!%sender.isSuperAdmin) { + return 3; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if(isObject(%target.player)) { + %target.player.setActionThread("death11", true); + %target.player.setVelocity("15 0 20"); + %target.player.setDamageFlash(100); + %target.player.damage(0, %target.player.position, 0.5, $DamageType::admin); + %target.player.setMoveState(true); + %target.player.schedule(5000, "SetMoveState", false); + messageall('MsgSLAP', "\c3"@getTaggedString(%sender.name)@"\c2 Slapped \c3"@getTaggedString(%target.name)@"\c2 with great force. ~wfx/misc/slapshot.wav"); + } + else { + messageclient(%sender, 'MsgClient', "\c2"@%target.namebase@" be dead :)"); + } + return 1; + + //zap: unleash the fury of lightning + case "zap": + if (!%sender.issuperadmin){ + return 3; + } + %nametotest = getword(%args, 0); + %target = plnametocid(%nametotest); + if (%target == 0) { + messageclient(%sender, 'MsgClient', '\c2No such player.'); + return 1; + } + if(!isObject(%target.player) || %target.player.getState() $= "dead") { + messageclient(%sender, 'MsgClient', '\c2The Target Player must have a player object.'); + return 1; + } + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 unleased Lightning On \c3"@ %target.namebase@"\c2."); + messageclient(%target, 'MsgClient', '\c5 BIG BOLTS OF FURY!!!!!!.'); + %zap = new Lightning(Lightning) { + position = %target.player.position; + rotation = "1 0 0 0"; + scale = "55 55 100"; + dataBlock = "DefaultStorm"; + lockCount = "0"; + homingCount = "0"; + strikesPerMinute = "500"; + strikeWidth = "2.5"; + chanceToHitTarget = "100"; + strikeRadius = "10"; + boltStartRadius = "20"; //altitude the lightning starts from + color = "0.314961 1.000000 0.576000 1.000000"; + fadeColor = "0.560000 0.860000 0.260000 1.000000"; + useFog = "1"; + shouldCloak = 0; + }; + %zap.schedule(3000, delete); + return 1; + + //pieceban: enable or disable player building abilities + case "pieceban": + if(!%sender.isSuperAdmin) { + return 3; + } + %nameToTest = getWords(%args, 0); + %target = plnametocid(%nameToTest); + if(%target == 0) { + MessageClient(%sender, 'msgFail', "\c3No Such Player"); + return 1; + } + %target.cannotBuild = !%target.cannotBuild; + %msg = %target.cannotBuild ? "BANNED" : "RE-ALLOWED"; + + messageAll('MsgAdminForce', "\c3"@ %sender.namebase @" has "@%msg@" "@%target.namebase@"'s building permissions."); + return 1; + + //======================================================================= + //======================================================================= + //======================================================================= + // DRONE COMMANDS + //======================================================================= + //======================================================================= + //======================================================================= + + //droneType: displays info about specific types of drones + case "dronetype": + if (!%sender.issuperadmin) { + return 3; + } + %Type = getWord(%args, 0); + if (%Type $= "Normal") { + messageclient(%sender, 'MsgClient', "\c2Normal drones are basic drones, They can come in a group of any amount, and be on multiple teams."); + return 1; + } + else if (%Type $= "Stlth") { + messageclient(%sender, 'MsgClient', "\c2Stealth Drones are fast and cloaked, they are a little more challenging to beat but come in less amounts."); + return 1; + } + else if (%Type $= "Strike") { + messageclient(%sender, 'MsgClient', "\c2Strike drones will do anything to take out a target, they dont mind blowing themselves up to destroy you."); + return 1; + } + else if (%Type $= "Elite") { + messageclient(%sender, 'MsgClient', "\c2Elite drones are Deadly, they strike quick and are hard to beat, use caution when fighting these drones."); + return 1; + } + else if (%Type $= "Ace") { + messageclient(%sender, 'MsgClient', "\c2If Elite wasn't enough, Ace drones are worse, they are quick, and will always get their kill, use extreme caution."); + return 1; + } + else if (%Type $= "Ultra") { + messageclient(%sender, 'MsgClient', "\c2Ultra Drones are extremely Rare to find, but they are the deadliest of them all, they employ methods from every other type to destroy you."); + return 1; + } + else { + messageclient(%sender, 'MsgClient', "\c2That type of drone doesnt exist."); + messageclient(%sender, 'MsgClient', "\c2These however, do : Normal, Stlth, Strike, Elite, Ace, Ultra."); + return 1; + } + + //dronebattle: spawns drones + case "dronebattle": + %pos = vectoradd(%sender.player.getposition(), "0 0 1000"); + %Amount = getword(%args, 0); + if (!%sender.issuperadmin){ + return 3; + } + if(%Amount < 1 || %Amount > 50) { + messageclient(%sender, 'MsgClient', '\c5Error: Invalid Amount.'); + return 1; + } + DroneBattle(%pos, 500, %Amount, 1, 100, 5, 0); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Spawned "@%Amount@", Normal Type Fighters 1000M above himself."); + return 1; + + //dronebattlelow: see above, but @ lower alt. + case "dronebattlelow": + %pos = vectoradd(%sender.player.getposition(), "0 0 200"); + %Amount = getword(%args, 0); + if (!%sender.issuperadmin){ + return 3; + } + if(%Amount < 1 || %Amount > 50) { + messageclient(%sender, 'MsgClient', '\c5Error: Invalid Amount.'); + return 1; + } + DroneBattle(%pos, 500, %Amount, 1, 100, 5, 0); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Spawned "@%Amount@", Normal Type Fighters 200M above himself."); + return 1; + + //dronebattlet: spawns drones on a specific team + case "dronebattlet": + %pos = vectoradd(%sender.player.getposition(), "0 0 500"); + %Amount = getword(%args, 0); + %teamtobe = getword(%args, 1); + if (!%sender.issuperadmin){ + messageclient(%sender, 'MsgClient', '\c5 Admin Clearance For Level 2 Needed.'); + return 1; + } + if(%Amount < 1 || %Amount > 50) { + messageclient(%sender, 'MsgClient', '\c5Error: Invalid Amount.'); + return 1; + } + if(%teamtobe < 1 || %teamtobe > 99) { + messageclient(%sender, 'MsgClient', '\c5Error: Invalid Team.'); + return 1; + } + DroneBattle(%pos, 500, %Amount, %teamtobe, %teamtobe, 5, 0); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Spawned "@%Amount@", Normal Type Fighters 500M On team "@%teamtobe@" above himself."); + return 1; + + //dronebattleTH: same as above, but at a really high alt. + case "dronebattleth": + %pos = vectoradd(%sender.player.getposition(), "0 0 5000"); + %Amount = getword(%args, 0); + %teamtobe = getword(%args, 1); + if (!%sender.issuperadmin){ + return 3; + } + if(%Amount < 1 || %Amount > 50) { + messageclient(%sender, 'MsgClient', '\c5Error: Invalid Amount.'); + return 1; + } + if(%teamtobe < 1 || %teamtobe > 99) { + messageclient(%sender, 'MsgClient', '\c5Error: Invalid Team.'); + return 1; + } + DroneBattle(%pos, 500, %Amount, %teamtobe, %teamtobe, 5, 0); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Spawned "@%Amount@", Normal Type Fighters 5000M On team "@%teamtobe@" above himself."); + return 1; + + //dronespawns: list drone spawning commands + case "dronespawns": + if (!%sender.issuperadmin){ + return 3; + } + messageclient(%sender, 'MsgClient', '\c5 TWM 2 Drone Help Menu '); + messageclient(%sender, 'MsgClient', '\c2 >>> Drones <<< '); + messageclient(%sender, 'MsgClient', '\c5 /Dronebattle, /dronebattlet, /dronebattleth'); + messageclient(%sender, 'MsgClient', '\c5 /Dronebattlelow, /dronetype'); + messageclient(%sender, 'MsgClient', '\c5 /1Slth, /5Slth - Spawn Stealth Drones'); + messageclient(%sender, 'MsgClient', '\c5 /1stri, /5stri, /10stri - Spawn Strike Drones'); + messageclient(%sender, 'MsgClient', '\c5 /1eli, /5eli, /10eli - Spawn Elite Drones'); + messageclient(%sender, 'MsgClient', '\c5 /1Ace, /5Ace - Spawn Ace Drones'); + messageclient(%sender, 'MsgClient', '\c5 /1Ultr - Spawn an ultra drone'); + return 1; + + //All of the below commands are related to the drone spawns above. + case "1slth": + if (!%sender.issuperadmin){ + return 3; + } + %pos = vectoradd(%sender.player.getposition(), "0 0 500"); + DroneBattle(%pos, 500, 1, 96, 96, 20, 1); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Spawned A Stealth Type Fighter."); + return 1; + + case "5slth": + if (!%sender.issuperadmin){ + return 3; + } + %pos = vectoradd(%sender.player.getposition(), "0 0 500"); + DroneBattle(%pos, 500, 5, 96, 96, 20, 1); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Spawned Five Stealth Type Fighters."); + return 1; + + case "1stri": + if (!%sender.issuperadmin){ + return 3; + } + %pos = vectoradd(%sender.player.getposition(), "0 0 500"); + DroneBattle(%pos, 500, 1, 97, 97, 35, 0); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Spawned A Strike Type Fighter."); + return 1; + + case "5stri": + if (!%sender.issuperadmin){ + return 3; + } + %pos = vectoradd(%sender.player.getposition(), "0 0 500"); + DroneBattle(%pos, 500, 5, 97, 97, 35, 0); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Spawned Five Strike Type Fighters."); + return 1; + + case "10stri": + if (!%sender.issuperadmin){ + return 3; + } + %pos = vectoradd(%sender.player.getposition(), "0 0 500"); + DroneBattle(%pos, 500, 10, 97, 97, 35, 0); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Spawned Ten Strike Type Fighters."); + return 1; + + case "1eli": + if (!%sender.issuperadmin){ + return 3; + } + %pos = vectoradd(%sender.player.getposition(), "0 0 500"); + DroneBattle(%pos, 500, 1, 98, 98, 50, 0); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Spawned A Elite Type Fighter."); + return 1; + + case "5eli": + if (!%sender.issuperadmin){ + return 3; + } + %pos = vectoradd(%sender.player.getposition(), "0 0 500"); + DroneBattle(%pos, 500, 5, 98, 98, 50, 0); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Spawned Five Elite Type Fighters."); + return 1; + + case "10eli": + if (!%sender.issuperadmin){ + return 3; + } + %pos = vectoradd(%sender.player.getposition(), "0 0 500"); + DroneBattle(%pos, 500, 5, 98, 98, 50, 0); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Spawned Ten Elite Type Fighters."); + return 1; + + case "1ace": + if (!%sender.issuperadmin){ + return 3; + } + %pos = vectoradd(%sender.player.getposition(), "0 0 500"); + DroneBattle(%pos, 500, 1, 99, 99, 70, 0); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Spawned A Ace Type Fighter."); + return 1; + + case "5ace": + if (!%sender.issuperadmin){ + return 3; + } + %pos = vectoradd(%sender.player.getposition(), "0 0 500"); + DroneBattle(%pos, 500, 5, 99, 99, 70, 0); + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Spawned Five Ace Type Fighters."); + return 1; + + case "1ultr": + if (!%sender.issuperadmin){ + return 3; + } + %pos = vectoradd(%sender.player.getposition(), "0 0 500"); + %drone = DroneBattle(%pos, 500, 1, 99, 99, 100, 1); //yes this bad guy is stealthed + messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 Spawned An Ultra Fighter, Pilots Beware."); + return 1; + + //======================================================================= + //======================================================================= + //======================================================================= + + default: + return 0; + } +} + +addCMD("SuperAdmin", "SaCmds", "Usage: /SaCmds: Lists Super Admin Commands."); +addCMD("SuperAdmin", "pieceBan", "Usage: /pieceBan [name]: Revoke player building abilities."); +addCMD("SuperAdmin", "turrets", "Usage: /turrets: toggle allowance of turrets."); +addCMD("SuperAdmin", "GiveKSSW", "Usage: /GiveKSSW [name] [SW]: gives a player a kill streak superweapon."); +addCMD("SuperAdmin", "TkToggle", "Usage: /TkToggle: toggles FFA mode."); +addCMD("SuperAdmin", "SA", "Usage: /SA [message]: chat message to super-admins."); +addCMD("SuperAdmin", "MakeSA", "Usage: /MakeSA [target]: makes someone Super-Admin."); +addCMD("SuperAdmin", "blowvehs", "Usage: /blowvehs: destroy all vehicles."); +addCMD("SuperAdmin", "StartBoss", "Usage: /StartBoss [name]: starts a TWM2 Boss."); +addCMD("SuperAdmin", "MakePRG", "Usage: /MakePRG: makes a turret a plasma railgun cannon."); +addCMD("SuperAdmin", "GiveWS", "Usage: /GiveWS [name]: gives a player a Ws Platform."); +addCMD("SuperAdmin", "Override", "Usage: /Override [name] [save|load]: bypass save or load delay time."); +addCMD("SuperAdmin", "Jail", "Usage: /Jail [name]: send a player to jail."); +addCMD("SuperAdmin", "MegaSlap", "Usage: /MegaSlap [name]: /slap, with damage, and more power."); +addCMD("SuperAdmin", "Zap", "Usage: /Zap [name]: unleash lightning on a player."); +addCMD("SuperAdmin", "DroneHelp", "Usage: /DroneHelp: Lists AI Vehicle Commands."); +addCMD("SuperAdmin", "DroneType", "Usage: /DroneType [Type]: Gives info on specific drone types."); +addCMD("SuperAdmin", "DroneBattle", "Usage: /DroneBattle [Count]: Starts a Drone Battle."); +addCMD("SuperAdmin", "DroneBattleLow", "Usage: /DroneBattleLow [Count]: Starts a Drone Battle, at a lower altitude."); +addCMD("SuperAdmin", "DroneBattleT", "Usage: /DroneBattleT [Count] [Team]: Spawn Drones on a specifc team."); +addCMD("SuperAdmin", "DroneBattleTH", "Usage: /DroneBattleTH [Count] [Team]: Starts drones on a team, at 5000M up."); +addCMD("SuperAdmin", "DroneSpawns", "Usage: /DroneSpawns: List drone spawns for non-normal drones."); +addCMD("SuperAdmin", "1Slth", "Usage: /1Slth: Spawn 1 Stealth Drone."); +addCMD("SuperAdmin", "5Slth", "Usage: /5Slth: Spawn 5 Stealth Drones."); +addCMD("SuperAdmin", "1Stri", "Usage: /1Stri: Spawn 1 Strike Drone."); +addCMD("SuperAdmin", "5Stri", "Usage: /5Stri: Spawn 5 Strike Drones."); +addCMD("SuperAdmin", "10Stri", "Usage: /10Stri: Spawn 10 Strike Drones."); +addCMD("SuperAdmin", "1Eli", "Usage: /1Eli: Spawn 1 Elite Drone."); +addCMD("SuperAdmin", "5Eli", "Usage: /5Eli: Spawn 5 Elite Drones."); +addCMD("SuperAdmin", "10Eli", "Usage: /10Eli: Spawn 10 Elite Drones."); +addCMD("SuperAdmin", "1Ace", "Usage: /1Ace: Spawn 1 Ace Drone."); +addCMD("SuperAdmin", "5Ace", "Usage: /5Ace: Spawn 5 Ace Drones."); +addCMD("SuperAdmin", "1Ultr", "Usage: /1Ultr: Spawn 1 Ultra Drone."); diff --git a/scripts/TWM2/CustomArmors.cs b/scripts/TWM2/CustomArmors.cs new file mode 100644 index 0000000..5710bac --- /dev/null +++ b/scripts/TWM2/CustomArmors.cs @@ -0,0 +1,1149 @@ +//MICROBUSRT ARMOR +//2 WEAPONS +//SPEC ABILITY: SHOCK LAUNCHER on S3 +datablock PlayerData(MicroburstMaleHumanArmor) : MediumPlayerDamageProfile { + emap = true; + + className = Armor; + shapeFile = "medium_male.dts"; + cameraMaxDist = 3; + computeCRC = true; + + debrisShapeName = "debris_player.dts"; + debris = HumanRedPlayerDebris; + + canObserve = true; + cmdCategory = "Clients"; + cmdIcon = CMDPlayerIcon; + cmdMiniIconName = "commander/MiniIcons/com_player_grey"; + + hudImageNameFriendly[0] = "gui/hud_playertriangle"; + hudImageNameEnemy[0] = "gui/hud_playertriangle_enemy"; + hudRenderModulated[0] = true; + + hudImageNameFriendly[1] = "commander/MiniIcons/com_flag_grey"; + hudImageNameEnemy[1] = "commander/MiniIcons/com_flag_grey"; + hudRenderModulated[1] = true; + hudRenderAlways[1] = true; + hudRenderCenter[1] = true; + hudRenderDistance[1] = true; + + hudImageNameFriendly[2] = "commander/MiniIcons/com_flag_grey"; + hudImageNameEnemy[2] = "commander/MiniIcons/com_flag_grey"; + hudRenderModulated[2] = true; + hudRenderAlways[2] = true; + hudRenderCenter[2] = true; + hudRenderDistance[2] = true; + + // z0dd - ZOD, 10/06/02. Was missing these parameters. + cameraDefaultFov = 90.0; + cameraMinFov = 5.0; + cameraMaxFov = 120.0; + + aiAvoidThis = true; + + minLookAngle = -1.5; + maxLookAngle = 1.5; + maxFreelookAngle = 3.0; + + mass = 130; + drag = 0.3; + maxdrag = 0.5; + density = 10; + maxDamage = 1.6; + maxEnergy = 80; + repairRate = 0.0033; + energyPerDamagePoint = 75.0; // shield energy required to block one point of damage + + rechargeRate = 0.256; + jetForce = 0; + underwaterJetForce = 25.22 * 130 * 1.5; + underwaterVertJetFactor = 1.5; + jetEnergyDrain = 1.0; + underwaterJetEnergyDrain = 0.6; + minJetEnergy = 1; + maxJetHorizontalPercentage = 0.8; + + runForce = 46 * 130; + runEnergyDrain = 0; + minRunEnergy = 0; + maxForwardSpeed = 12; + maxBackwardSpeed = 10; + maxSideSpeed = 10; + + maxUnderwaterForwardSpeed = 8.5; + maxUnderwaterBackwardSpeed = 7.5; + maxUnderwaterSideSpeed = 7.5; + + recoverDelay = 9; + recoverRunForceScale = 1.2; + + // heat inc'ers and dec'ers + heatDecayPerSec = 1.0 / 4.0; // takes 4 seconds to clear heat sig. + heatIncreasePerSec = 1.0 / 3.0; // takes 3.0 seconds of constant jet to get full heat sig. + + jumpForce = 8.3 * 130; + jumpEnergyDrain = 0; + minJumpEnergy = 0; + jumpSurfaceAngle = 75; + jumpDelay = 0; + + // Controls over slope of runnable/jumpable surfaces + runSurfaceAngle = 70; + jumpSurfaceAngle = 80; + + minJumpSpeed = 15; + maxJumpSpeed = 25; + + horizMaxSpeed = 60; + horizResistSpeed = 28; + horizResistFactor = 0.32; + maxJetForwardSpeed = 22; + + upMaxSpeed = 70; + upResistSpeed = 30; + upResistFactor = 0.23; + + minImpactSpeed = 40; + speedDamageScale = 0.015; + + jetSound = ArmorJetSound; + wetJetSound = ArmorWetJetSound; + + jetEmitter = HumanArmorJetEmitter; + jetEffect = HumanMediumArmorJetEffect; + + boundingBox = "1.45 1.45 2.4"; + pickupRadius = 0.75; + + // damage location details + boxNormalHeadPercentage = 0.83; + boxNormalTorsoPercentage = 0.49; + boxHeadLeftPercentage = 0; + boxHeadRightPercentage = 1; + boxHeadBackPercentage = 0; + boxHeadFrontPercentage = 1; + + //Foot Prints + decalData = MediumMaleFootprint; + decalOffset = 0.35; + + footPuffEmitter = LightPuffEmitter; + footPuffNumParts = 15; + footPuffRadius = 0.25; + + dustEmitter = LiftoffDustEmitter; + + splash = PlayerSplash; + splashVelocity = 4.0; + splashAngle = 67.0; + splashFreqMod = 300.0; + splashVelEpsilon = 0.60; + bubbleEmitTime = 0.4; + splashEmitter[0] = PlayerFoamDropletsEmitter; + splashEmitter[1] = PlayerFoamEmitter; + splashEmitter[2] = PlayerBubbleEmitter; + mediumSplashSoundVelocity = 10.0; + hardSplashSoundVelocity = 20.0; + exitSplashSoundVelocity = 5.0; + + footstepSplashHeight = 0.35; + //Footstep Sounds + LFootSoftSound = LFootMediumSoftSound; + RFootSoftSound = RFootMediumSoftSound; + LFootHardSound = LFootMediumHardSound; + RFootHardSound = RFootMediumHardSound; + LFootMetalSound = LFootMediumMetalSound; + RFootMetalSound = RFootMediumMetalSound; + LFootSnowSound = LFootMediumSnowSound; + RFootSnowSound = RFootMediumSnowSound; + LFootShallowSound = LFootMediumShallowSplashSound; + RFootShallowSound = RFootMediumShallowSplashSound; + LFootWadingSound = LFootMediumWadingSound; + RFootWadingSound = RFootMediumWadingSound; + LFootUnderwaterSound = LFootMediumUnderwaterSound; + RFootUnderwaterSound = RFootMediumUnderwaterSound; + LFootBubblesSound = LFootMediumBubblesSound; + RFootBubblesSound = RFootMediumBubblesSound; + movingBubblesSound = ArmorMoveBubblesSound; + waterBreathSound = WaterBreathMaleSound; + + impactSoftSound = ImpactMediumSoftSound; + impactHardSound = ImpactMediumHardSound; + impactMetalSound = ImpactMediumMetalSound; + impactSnowSound = ImpactMediumSnowSound; + + skiSoftSound = SkiAllSoftSound; + skiHardSound = SkiAllHardSound; + skiMetalSound = SkiAllMetalSound; + skiSnowSound = SkiAllSnowSound; + + impactWaterEasy = ImpactMediumWaterEasySound; + impactWaterMedium = ImpactMediumWaterMediumSound; + impactWaterHard = ImpactMediumWaterHardSound; + + groundImpactMinSpeed = 10.0; + groundImpactShakeFreq = "4.0 4.0 4.0"; + groundImpactShakeAmp = "1.0 1.0 1.0"; + groundImpactShakeDuration = 0.8; + groundImpactShakeFalloff = 10.0; + + exitingWater = ExitingWaterMediumSound; + + maxWeapons = 2; // Max number of different weapons the player can have + maxGrenades = 1; // Max number of different grenades the player can have + maxMines = 1; // Max number of different mines the player can have + + // Inventory restrictions + max[RepairKit] = 1; + max[Mine] = 4; + max[StaticGrenade] = 6; + max[RepairGun] = 1; + max[RepairPack] = 1; + max[AmmoPack] = 1; + max[SatchelCharge] = 1; + max[TargetingLaser] = 1; + max[Beacon] = 3; + + max[ShockLance] = 1; + max[S3Rifle] = 1; + max[S3RifleAmmo] = 10; + max[ShadowRifle] = 0; + max[IonLauncher] = 1; + max[IonLauncherAmmo] = 2; + max[IonRifle] = 1; + max[MiniColliderCannon] = 1; + max[PulsePhaser] = 1; + max[LD06Savager] = 1; + max[LD06SavagerAmmo] = 10; + max[G17SniperRifle] = 1; + max[G17SniperRifleAmmo] = 1; + max[GrappleHook] = 1; + max[pistol] = 1; + max[pistolAmmo] = 10; + max[Dualpistol] = 1; + max[DualpistolAmmo] = 20; + max[SCD343] = 0; + max[SCD343Ammo] = 0; + max[Model1887] = 1; + max[Model1887Ammo] = 7; + max[DEagle] = 1; + max[DEagleAmmo] = 7; + max[melee] = 1; + max[BOV] = 1; + max[C4] = 5; + max[MedPack] = 1; + max[ConcussionGun] = 1; + max[ConcussionGunAmmo] = 1; + max[GravityAxe] = 0; + max[spiker] = 1; + max[Plasmasaber] = 1; + max[SA2400] = 0; + max[SA2400Ammo] = 0; + max[Javelin] = 1; + max[JavelinAmmo] = 1; + max[Stinger] = 1; + max[StingerAmmo] = 1; + max[M4A1] = 0; + max[M4A1Ammo] = 0; + max[RPG] = 1; + max[RPGAmmo] = 1; + max[PulseRifle] = 1; + max[PulseRifleAmmo] = 20; + max[PulseSMG] = 1; + max[PulseSMGAmmo] = 45; + max[ALSWPSniperRifle] = 1; + max[ALSWPSniperRifleAmmo] = 10; + max[P90] = 1; + max[P90Ammo] = 65; + max[PlasmaTorpedo] = 1; + max[MRXX] = 1; + max[MRXXAmmo] = 150; + max[m93] = 1; + max[m93Ammo] = 15; + max[CrimsonHawk] = 1; + max[CrimsonHawkAmmo] = 15; + max[ParachutePack] = 1; + + observeParameters = "0.5 4.5 4.5"; + shieldEffectScale = "0.7 0.7 1.0"; +}; + +datablock PlayerData(MicroburstFemaleHumanArmor) : MicroburstMaleHumanArmor +{ + shapeFile = "medium_female.dts"; + waterBreathSound = WaterBreathFemaleSound; + jetEffect = HumanArmorJetEffect; +}; + +datablock PlayerData(MicroburstMaleBiodermArmor) : MicroburstMaleHumanArmor +{ + shapeFile = "bioderm_medium.dts"; + jetEmitter = BiodermArmorJetEmitter; + jetEffect = BiodermArmorJetEffect; + + debrisShapeName = "bio_player_debris.dts"; + debris = BiodermPlayerDebris; + + //Foot Prints + decalData = MediumBiodermFootprint; + decalOffset = 0.35; + + waterBreathSound = WaterBreathBiodermSound; +}; + + + + + + + + + + + + + + + + + +//SHADOW COMMANDO ARMOR +//2 WEAPONS +//SPEC ABILITY: SHADE (Short Full Armor Camo) +datablock PlayerData(ShadowCommandoMaleHumanArmor) : MediumPlayerDamageProfile { + emap = true; + + className = Armor; + shapeFile = "medium_male.dts"; + cameraMaxDist = 3; + computeCRC = true; + + debrisShapeName = "debris_player.dts"; + debris = HumanRedPlayerDebris; + + canObserve = true; + cmdCategory = "Clients"; + cmdIcon = CMDPlayerIcon; + cmdMiniIconName = "commander/MiniIcons/com_player_grey"; + + hudImageNameFriendly[0] = "gui/hud_playertriangle"; + hudImageNameEnemy[0] = "gui/hud_playertriangle_enemy"; + hudRenderModulated[0] = true; + + hudImageNameFriendly[1] = "commander/MiniIcons/com_flag_grey"; + hudImageNameEnemy[1] = "commander/MiniIcons/com_flag_grey"; + hudRenderModulated[1] = true; + hudRenderAlways[1] = true; + hudRenderCenter[1] = true; + hudRenderDistance[1] = true; + + hudImageNameFriendly[2] = "commander/MiniIcons/com_flag_grey"; + hudImageNameEnemy[2] = "commander/MiniIcons/com_flag_grey"; + hudRenderModulated[2] = true; + hudRenderAlways[2] = true; + hudRenderCenter[2] = true; + hudRenderDistance[2] = true; + + // z0dd - ZOD, 10/06/02. Was missing these parameters. + cameraDefaultFov = 90.0; + cameraMinFov = 5.0; + cameraMaxFov = 120.0; + + aiAvoidThis = true; + + minLookAngle = -1.5; + maxLookAngle = 1.5; + maxFreelookAngle = 3.0; + + mass = 130; + drag = 0.3; + maxdrag = 0.5; + density = 10; + maxDamage = 1.6; + maxEnergy = 80; + repairRate = 0.0033; + energyPerDamagePoint = 75.0; // shield energy required to block one point of damage + + rechargeRate = 0.256; + jetForce = 0; + underwaterJetForce = 25.22 * 130 * 1.5; + underwaterVertJetFactor = 1.5; + jetEnergyDrain = 1.0; + underwaterJetEnergyDrain = 0.6; + minJetEnergy = 1; + maxJetHorizontalPercentage = 0.8; + + runForce = 46 * 130; + runEnergyDrain = 0; + minRunEnergy = 0; + maxForwardSpeed = 12; + maxBackwardSpeed = 10; + maxSideSpeed = 10; + + maxUnderwaterForwardSpeed = 8.5; + maxUnderwaterBackwardSpeed = 7.5; + maxUnderwaterSideSpeed = 7.5; + + recoverDelay = 9; + recoverRunForceScale = 1.2; + + // heat inc'ers and dec'ers + heatDecayPerSec = 1.0 / 4.0; // takes 4 seconds to clear heat sig. + heatIncreasePerSec = 1.0 / 3.0; // takes 3.0 seconds of constant jet to get full heat sig. + + jumpForce = 8.3 * 130; + jumpEnergyDrain = 0; + minJumpEnergy = 0; + jumpSurfaceAngle = 75; + jumpDelay = 0; + + // Controls over slope of runnable/jumpable surfaces + runSurfaceAngle = 70; + jumpSurfaceAngle = 80; + + minJumpSpeed = 15; + maxJumpSpeed = 25; + + horizMaxSpeed = 60; + horizResistSpeed = 28; + horizResistFactor = 0.32; + maxJetForwardSpeed = 22; + + upMaxSpeed = 70; + upResistSpeed = 30; + upResistFactor = 0.23; + + minImpactSpeed = 40; + speedDamageScale = 0.015; + + jetSound = ArmorJetSound; + wetJetSound = ArmorWetJetSound; + + jetEmitter = HumanArmorJetEmitter; + jetEffect = HumanMediumArmorJetEffect; + + boundingBox = "1.45 1.45 2.4"; + pickupRadius = 0.75; + + // damage location details + boxNormalHeadPercentage = 0.83; + boxNormalTorsoPercentage = 0.49; + boxHeadLeftPercentage = 0; + boxHeadRightPercentage = 1; + boxHeadBackPercentage = 0; + boxHeadFrontPercentage = 1; + + //Foot Prints + decalData = MediumMaleFootprint; + decalOffset = 0.35; + + footPuffEmitter = LightPuffEmitter; + footPuffNumParts = 15; + footPuffRadius = 0.25; + + dustEmitter = LiftoffDustEmitter; + + splash = PlayerSplash; + splashVelocity = 4.0; + splashAngle = 67.0; + splashFreqMod = 300.0; + splashVelEpsilon = 0.60; + bubbleEmitTime = 0.4; + splashEmitter[0] = PlayerFoamDropletsEmitter; + splashEmitter[1] = PlayerFoamEmitter; + splashEmitter[2] = PlayerBubbleEmitter; + mediumSplashSoundVelocity = 10.0; + hardSplashSoundVelocity = 20.0; + exitSplashSoundVelocity = 5.0; + + footstepSplashHeight = 0.35; + //Footstep Sounds + LFootSoftSound = LFootMediumSoftSound; + RFootSoftSound = RFootMediumSoftSound; + LFootHardSound = LFootMediumHardSound; + RFootHardSound = RFootMediumHardSound; + LFootMetalSound = LFootMediumMetalSound; + RFootMetalSound = RFootMediumMetalSound; + LFootSnowSound = LFootMediumSnowSound; + RFootSnowSound = RFootMediumSnowSound; + LFootShallowSound = LFootMediumShallowSplashSound; + RFootShallowSound = RFootMediumShallowSplashSound; + LFootWadingSound = LFootMediumWadingSound; + RFootWadingSound = RFootMediumWadingSound; + LFootUnderwaterSound = LFootMediumUnderwaterSound; + RFootUnderwaterSound = RFootMediumUnderwaterSound; + LFootBubblesSound = LFootMediumBubblesSound; + RFootBubblesSound = RFootMediumBubblesSound; + movingBubblesSound = ArmorMoveBubblesSound; + waterBreathSound = WaterBreathMaleSound; + + impactSoftSound = ImpactMediumSoftSound; + impactHardSound = ImpactMediumHardSound; + impactMetalSound = ImpactMediumMetalSound; + impactSnowSound = ImpactMediumSnowSound; + + skiSoftSound = SkiAllSoftSound; + skiHardSound = SkiAllHardSound; + skiMetalSound = SkiAllMetalSound; + skiSnowSound = SkiAllSnowSound; + + impactWaterEasy = ImpactMediumWaterEasySound; + impactWaterMedium = ImpactMediumWaterMediumSound; + impactWaterHard = ImpactMediumWaterHardSound; + + groundImpactMinSpeed = 10.0; + groundImpactShakeFreq = "4.0 4.0 4.0"; + groundImpactShakeAmp = "1.0 1.0 1.0"; + groundImpactShakeDuration = 0.8; + groundImpactShakeFalloff = 10.0; + + exitingWater = ExitingWaterMediumSound; + + maxWeapons = 2; // Max number of different weapons the player can have + maxGrenades = 1; // Max number of different grenades the player can have + maxMines = 1; // Max number of different mines the player can have + + // Inventory restrictions + max[RepairKit] = 1; + max[Mine] = 4; + max[StaticGrenade] = 6; + max[RepairGun] = 1; + max[RepairPack] = 1; + max[AmmoPack] = 1; + max[SatchelCharge] = 1; + max[TargetingLaser] = 1; + max[Beacon] = 3; + + max[GravityAxe] = 1; + max[ShockLance] = 1; + max[S3Rifle] = 1; + max[S3RifleAmmo] = 10; + max[PulsePhaser] = 1; + max[LD06Savager] = 1; + max[LD06SavagerAmmo] = 10; + max[ShadowRifle] = 1; + max[G17SniperRifle] = 1; + max[G17SniperRifleAmmo] = 1; + max[GrappleHook] = 1; + max[pistol] = 1; + max[pistolAmmo] = 10; + max[Dualpistol] = 1; + max[DualpistolAmmo] = 20; + max[DEagle] = 1; + max[DEagleAmmo] = 7; + max[MiniColliderCannon] = 0; + max[M4A1] = 0; + max[M4A1Ammo] = 0; + max[melee] = 1; + max[BOV] = 1; + max[Plasmasaber] = 1; + max[C4] = 5; + max[MedPack] = 1; + max[MRXX] = 1; + max[MRXXAmmo] = 150; + max[SA2400] = 0; + max[SA2400Ammo] = 0; + max[RPG] = 1; + max[RPGAmmo] = 1; + max[Javelin] = 1; + max[JavelinAmmo] = 1; + max[Stinger] = 1; + max[StingerAmmo] = 1; + max[PulseRifle] = 1; + max[PulseRifleAmmo] = 20; + max[PulseSMG] = 1; + max[PulseSMGAmmo] = 45; + max[SCD343] = 0; + max[SCD343Ammo] = 0; + max[ALSWPSniperRifle] = 1; + max[ALSWPSniperRifleAmmo] = 10; + max[P90] = 1; + max[P90Ammo] = 65; + max[PlasmaTorpedo] = 1; + max[m93] = 1; + max[m93Ammo] = 15; + max[CrimsonHawk] = 1; + max[CrimsonHawkAmmo] = 15; + max[spiker] = 1; + max[Model1887] = 1; + max[Model1887Ammo] = 7; + max[ParachutePack] = 1; + + observeParameters = "0.5 4.5 4.5"; + shieldEffectScale = "0.7 0.7 1.0"; +}; + +datablock PlayerData(ShadowCommandoFemaleHumanArmor) : ShadowCommandoMaleHumanArmor +{ + shapeFile = "medium_female.dts"; + waterBreathSound = WaterBreathFemaleSound; + jetEffect = HumanArmorJetEffect; +}; + +datablock PlayerData(ShadowCommandoMaleBiodermArmor) : ShadowCommandoMaleHumanArmor +{ + shapeFile = "bioderm_medium.dts"; + jetEmitter = BiodermArmorJetEmitter; + jetEffect = BiodermArmorJetEffect; + + debrisShapeName = "bio_player_debris.dts"; + debris = BiodermPlayerDebris; + + //Foot Prints + decalData = MediumBiodermFootprint; + decalOffset = 0.35; + + waterBreathSound = WaterBreathBiodermSound; +}; + + + + + +//RETURN TO THE CLASSICS!! +//NALCIDIC ARMOR +//2 WEAPONS +//ABILITY: GAUSSIAN FIRE JETPACK + + + +datablock ParticleData(FlammerArmorJetParticle) +{ + dragCoefficient = 0.0; + gravityCoefficient = 0; + inheritedVelFactor = 0.2; + constantAcceleration = 0.0; + lifetimeMS = 500; + lifetimeVarianceMS = 0; + textureName = "particleTest"; + colors[0] = "0.6 0.2 0.0 1.0"; + colors[1] = "0.4 0.0 0.0 0"; + sizes[0] = 0.40; + sizes[1] = 0.15; +}; + +datablock ParticleEmitterData(FlammerArmorJetEmitter) +{ + ejectionPeriodMS = 3; + periodVarianceMS = 0; + ejectionVelocity = 10; + velocityVariance = 2.9; + ejectionOffset = 0.0; + thetaMin = 0; + thetaMax = 5; + phiReferenceVel = 0; + phiVariance = 360; + overrideAdvances = false; + particles = "FlammerArmorJetParticle"; +}; + +datablock PlayerData(FlameMaleHumanArmor) : MediumPlayerDamageProfile +{ + emap = true; + + className = Armor; + shapeFile = "medium_male.dts"; + cameraMaxDist = 3; + computeCRC = true; + + debrisShapeName = "debris_player.dts"; + debris = HumanRedPlayerDebris; + + canObserve = true; + cmdCategory = "Clients"; + cmdIcon = CMDPlayerIcon; + cmdMiniIconName = "commander/MiniIcons/com_player_grey"; + + hudImageNameFriendly[0] = "gui/hud_playertriangle"; + hudImageNameEnemy[0] = "gui/hud_playertriangle_enemy"; + hudRenderModulated[0] = true; + + hudImageNameFriendly[1] = "commander/MiniIcons/com_flag_grey"; + hudImageNameEnemy[1] = "commander/MiniIcons/com_flag_grey"; + hudRenderModulated[1] = true; + hudRenderAlways[1] = true; + hudRenderCenter[1] = true; + hudRenderDistance[1] = true; + + hudImageNameFriendly[2] = "commander/MiniIcons/com_flag_grey"; + hudImageNameEnemy[2] = "commander/MiniIcons/com_flag_grey"; + hudRenderModulated[2] = true; + hudRenderAlways[2] = true; + hudRenderCenter[2] = true; + hudRenderDistance[2] = true; + + aiAvoidThis = true; + + minLookAngle = -1.5; + maxLookAngle = 1.5; + maxFreelookAngle = 3.0; + + mass = 70; + drag = 0.3; + maxdrag = 0.5; + density = 10; + maxDamage = 1.5; + maxEnergy = 100; + repairRate = 0.0053; + energyPerDamagePoint = 75.0; // shield energy required to block one point of damage + + rechargeRate = 0.456; + jetForce = 21.22 * 230; + underwaterJetForce = 25.22 * 130 * 1.5; + underwaterVertJetFactor = 1.5; + jetEnergyDrain = 4.0; + underwaterJetEnergyDrain = 1.0; + minJetEnergy = 10; + maxJetHorizontalPercentage = 0.8; + + runForce = 60 * 150; + runEnergyDrain = 0; + minRunEnergy = 0; + maxForwardSpeed = 18; + maxBackwardSpeed = 18; + maxSideSpeed = 18; + + maxUnderwaterForwardSpeed = 10.5; + maxUnderwaterBackwardSpeed = 9.5; + maxUnderwaterSideSpeed = 9.5; + + recoverDelay = 4; + recoverRunForceScale = 0.7; + + // heat inc'ers and dec'ers + heatDecayPerSec = 1.0 / 5.0; // takes 4 seconds to clear heat sig. + heatIncreasePerSec = 1.0 / 2.0; // takes 3.0 seconds of constant jet to get full heat sig. + + jumpForce = 8.3 * 130; + jumpEnergyDrain = 0; + minJumpEnergy = 0; + jumpSurfaceAngle = 75; + jumpDelay = 0; + + // Controls over slope of runnable/jumpable surfaces + runSurfaceAngle = 85; + jumpSurfaceAngle = 85; + + minJumpSpeed = 25; + maxJumpSpeed = 35; + + horizMaxSpeed = 70; + horizResistSpeed = 28; + horizResistFactor = 0.32; + maxJetForwardSpeed = 18; + + upMaxSpeed = 80; + upResistSpeed = 30; + upResistFactor = 0.23; + + minImpactSpeed = 40; + speedDamageScale = 0.009; + + jetSound = ArmorJetSound; + wetJetSound = ArmorWetJetSound; + + jetEmitter = FlammerArmorJetEmitter; //Pyro jets + jetEffect = HumanMediumArmorJetEffect; + + boundingBox = "1.45 1.45 2.4"; + pickupRadius = 0.75; + + // damage location details + boxNormalHeadPercentage = 0.83; + boxNormalTorsoPercentage = 0.49; + boxHeadLeftPercentage = 0; + boxHeadRightPercentage = 1; + boxHeadBackPercentage = 0; + boxHeadFrontPercentage = 1; + + //Foot Prints + decalData = MediumMaleFootprint; + decalOffset = 0.35; + + footPuffEmitter = LightPuffEmitter; + footPuffNumParts = 15; + footPuffRadius = 0.25; + + dustEmitter = LiftoffDustEmitter; + + splash = PlayerSplash; + splashVelocity = 4.0; + splashAngle = 67.0; + splashFreqMod = 300.0; + splashVelEpsilon = 0.60; + bubbleEmitTime = 0.4; + splashEmitter[0] = PlayerFoamDropletsEmitter; + splashEmitter[1] = PlayerFoamEmitter; + splashEmitter[2] = PlayerBubbleEmitter; + mediumSplashSoundVelocity = 10.0; + hardSplashSoundVelocity = 20.0; + exitSplashSoundVelocity = 5.0; + + footstepSplashHeight = 0.35; + //Footstep Sounds + LFootSoftSound = LFootMediumSoftSound; + RFootSoftSound = RFootMediumSoftSound; + LFootHardSound = LFootMediumHardSound; + RFootHardSound = RFootMediumHardSound; + LFootMetalSound = LFootMediumMetalSound; + RFootMetalSound = RFootMediumMetalSound; + LFootSnowSound = LFootMediumSnowSound; + RFootSnowSound = RFootMediumSnowSound; + LFootShallowSound = LFootMediumShallowSplashSound; + RFootShallowSound = RFootMediumShallowSplashSound; + LFootWadingSound = LFootMediumWadingSound; + RFootWadingSound = RFootMediumWadingSound; + LFootUnderwaterSound = LFootMediumUnderwaterSound; + RFootUnderwaterSound = RFootMediumUnderwaterSound; + LFootBubblesSound = LFootMediumBubblesSound; + RFootBubblesSound = RFootMediumBubblesSound; + movingBubblesSound = ArmorMoveBubblesSound; + waterBreathSound = WaterBreathMaleSound; + + impactSoftSound = ImpactMediumSoftSound; + impactHardSound = ImpactMediumHardSound; + impactMetalSound = ImpactMediumMetalSound; + impactSnowSound = ImpactMediumSnowSound; + + skiSoftSound = SkiAllSoftSound; + skiHardSound = SkiAllHardSound; + skiMetalSound = SkiAllMetalSound; + skiSnowSound = SkiAllSnowSound; + + impactWaterEasy = ImpactMediumWaterEasySound; + impactWaterMedium = ImpactMediumWaterMediumSound; + impactWaterHard = ImpactMediumWaterHardSound; + + groundImpactMinSpeed = 10.0; + groundImpactShakeFreq = "4.0 4.0 4.0"; + groundImpactShakeAmp = "1.0 1.0 1.0"; + groundImpactShakeDuration = 0.8; + groundImpactShakeFalloff = 10.0; + + exitingWater = ExitingWaterMediumSound; + + maxWeapons = 2; // Max number of different weapons the player can have + maxGrenades = 1; // Max number of different grenades the player can have + maxMines = 1; // Max number of different mines the player can have + + damageScale[$DamageType::plasma] = 0.2; + damageScale[$DamageType::burn] = 0.1; + + // Inventory restrictions + max[ShockLance] = 1; + max[S3Rifle] = 1; + max[S3RifleAmmo] = 10; + max[PulsePhaser] = 1; + max[LD06Savager] = 1; + max[LD06SavagerAmmo] = 10; + max[GrappleHook] = 0; + max[pistol] = 1; + max[pistolAmmo] = 10; + max[Dualpistol] = 1; + max[DualpistolAmmo] = 20; + max[DEagle] = 1; + max[DEagleAmmo] = 7; + max[M4A1] = 1; + max[M4A1Ammo] = 30; + max[melee] = 1; + max[BOV] = 1; + max[Plasmasaber] = 1; + max[C4] = 5; + max[MedPack] = 1; + max[SA2400] = 1; + max[SA2400Ammo] = 21; + max[RPG] = 1; + max[RPGAmmo] = 1; + max[m93] = 1; + max[m93Ammo] = 15; + max[CrimsonHawk] = 1; + max[CrimsonHawkAmmo] = 15; + max[flamer] = 1; + max[flamerAmmo] = 100; + max[spiker] = 0; + max[Napalm] = 1; + max[NapalmAmmo] = 1; + // -END + + observeParameters = "0.5 4.5 4.5"; + + shieldEffectScale = "0.7 0.7 1.0"; +}; + +datablock PlayerData(FlameFemaleHumanArmor) : FlameMaleHumanArmor +{ + shapeFile = "medium_female.dts"; + waterBreathSound = WaterBreathFemaleSound; + jetEffect = HumanMediumArmorJetEffect; +}; + +datablock PlayerData(FlameMaleBiodermArmor) : FlameMaleHumanArmor +{ + shapeFile = "bioderm_medium.dts"; + jetEmitter = FlammerArmorJetEmitter; + jetEffect = BiodermArmorJetEffect; + + + debrisShapeName = "bio_player_debris.dts"; + + //Foot Prints + decalData = LightBiodermFootprint; + decalOffset = 0.3; + + waterBreathSound = WaterBreathBiodermSound; +}; + + + + + + + + + + + + + + + + + + + + + + + + + + + +//TECH +datablock PlayerData(TechMaleHumanArmor) : LightMaleHumanArmor +{ + + maxEnergy = 60; + mass = 115; + rechargeRate = 0.456; + jetForce = 21.22 * 230; + underwaterJetForce = 25.22 * 130 * 1.5; + underwaterVertJetFactor = 1.5; + jetEnergyDrain = 4.0; + underwaterJetEnergyDrain = 1.0; + minJetEnergy = 10; + maxJetHorizontalPercentage = 0.8; + + minImpactSpeed = 50; + speedDamageScale = 0.008; + + maxWeapons = 4; // Max number of different weapons the player can have + maxGrenades = 1; // Max number of different grenades the player can have + maxMines = 0; // Max number of different mines the player can have + + // Inventory restrictions + max[RepairKit] = 0; + max[Mine] = 0; + max[Grenade] = 0; + max[Blaster] = 0; + max[Plasma] = 0; + max[PlasmaAmmo] = 0; + max[Disc] = 0; + max[DiscAmmo] = 0; + max[SniperRifle] = 0; + max[GrenadeLauncher] = 0; + max[GrenadeLauncherAmmo] = 0; + max[Mortar] = 0; + max[MortarAmmo] = 0; + max[MissileLauncher] = 0; + max[MissileLauncherAmmo] = 0; + max[MiniChaingun] = 0; + max[MiniChaingunAmmo] = 0; + max[ShadowRifle] = 0; + max[PulseRifle] = 0; + max[PulseRifleAmmo] = 0; + max[PulseSMG] = 0; + max[PulseSMGAmmo] = 0; + max[RepairGun] = 1; + max[CloakingPack] = 0; + max[SensorJammerPack] = 0; + max[EnergyPack] = 0; + max[RepairPack] = 1; + max[ShieldPack] = 0; + max[AmmoPack] = 0; + max[SatchelCharge] = 0; + max[MortarBarrelPack] = 1; + max[MissileBarrelPack] = 1; + max[AABarrelPack] = 1; + max[PlasmaBarrelPack] = 1; + max[ELFBarrelPack] = 1; + max[InventoryDeployable] = 1; + max[MotionSensorDeployable] = 1; + max[PulseSensorDeployable] = 1; + max[TurretOutdoorDeployable] = 1; + max[TurretIndoorDeployable] = 1; + max[FlashGrenade] = 0; + max[ConcussionGrenade] = 0; + max[FlareGrenade] = 5; + max[TargetingLaser] = 1; + max[ELFGun] = 0; + max[GravityAxe] = 0; + max[ShockLance] = 0; + max[CameraGrenade] = 2; + max[Beacon] = 5; + //Guns + max[ConstructionTool] = 1; + max[NerfGun] = 1; + max[NerfBallLauncher] = 1; + max[NerfBallLauncherAmmo] = 25; + max[SuperChaingun] = 0; + max[SuperChaingunAmmo] = 0; + max[MergeTool] = 1; + max[EditorGun] = 1; + max[EditTool] = 1; + max[ConcussionGun] = 0; + max[ConcussionGunAmmo] = 0; + max[Stinger] = 0; + max[StingerAmmo] = 0; + + max[ALSWPSniperRifle] = 0; + max[ALSWPSniperRifleAmmo] = 0; + max[P90] = 0; + max[P90Ammo] = 0; + max[PlasmaTorpedo] = 0; + max[m93] = 1; + max[m93Ammo] = 15; + max[CrimsonHawk] = 1; + max[CrimsonHawkAmmo] = 15; + max[MRXX] = 0; + max[MRXXAmmo] = 0; + max[spiker] = 0; + + //Building parts + max[CardPackDeployable] = 1; + max[SpawnPointPack] = 1; + max[spineDeployable] = 1; + max[mspineDeployable] = 1; + max[wWallDeployable] = 1; + max[floorDeployable] = 1; + max[WallDeployable] = 1; + //Turrets + max[TurretLaserDeployable] = 1; + max[TurretMissileRackDeployable]= 1; + max[DiscTurretDeployable] = 0; + //Largepacks + max[EnergizerDeployable] = 0; + max[TreeDeployable] = 1; + max[CrateDeployable] = 1; + max[DecorationDeployable] = 1; + max[LogoProjectorDeployable] = 1; + max[LightDeployable] = 1; + max[TripwireDeployable] = 1; + max[TelePadPack] = 1; + max[TurretBasePack] = 1; + max[LargeInventoryDeployable] = 1; + max[GeneratorDeployable] = 1; + max[SolarPanelDeployable] = 1; + max[SwitchDeployable] = 1; + max[MediumSensorDeployable] = 1; + max[LargeSensorDeployable] = 1; + max[DoorDeployable] = 1; + max[ParachutePack] = 1; + //Misc + max[JumpadDeployable] = 1; + max[EscapePodDeployable] = 1; + max[ForceFieldDeployable] = 1; + max[GravityFieldDeployable] = 1; + + max[S3Rifle] = 0; + max[S3RifleAmmo] = 0; + max[Javelin] = 0; + max[JavelinAmmo] = 0; + max[C4] = 0; + max[M1700] = 0; + max[M1700Ammo] = 0; + max[Model1887] = 0; + max[Model1887Ammo] = 0; + max[G41Rifle] = 0; + max[G41RifleAmmo] = 0; + max[R700SniperRifle] = 0; + max[R700SniperRifleAmmo] = 0; + max[MP26] = 0; + max[MP26Ammo] = 0; + max[Pg700] = 0; + max[Pg700Ammo] = 0; + max[M1SniperRifle] = 0; + max[M1SniperRifleAmmo] = 0; + max[MissileLauncher] = 0; + max[MissileLauncherAmmo] = 0; + max[M4A1] = 0; + max[M4A1Ammo] = 0; + max[RP432] = 0; + max[RP432Ammo] = 0; + max[Chaingun] = 0; + max[ChaingunAmmo] = 0; + max[Wp400] = 0; + max[Wp400Ammo] = 0; + max[SCD343] = 0; + max[SCD343Ammo] = 0; + max[lasergun] = 0; + max[lasergunamo] = 0; + max[RPG] = 0; + max[RPGAmmo] = 0; + max[GravityCannon] = 0; + max[PulsePhaser] = 1; + max[LD06Savager] = 1; + max[LD06SavagerAmmo] = 10; + max[GrappleHook] = 1; + max[pistol] = 1; + max[pistolAmmo] = 10; + max[Dualpistol] = 1; + max[DualpistolAmmo] = 20; + max[DEagle] = 1; + max[DEagleAmmo] = 7; + max[G17SniperRifle] = 0; + max[G17SniperRifleAmmo] = 0; + max[SA2400] = 0; + max[SA2400Ammo] = 0; + + //Some small additions + //Note all that keeps us from full plugin compability is this code. + max[TractorGun] = 1; + max[TransGun] = 1; + max[VehiclePadPack] = 1; + max[EmitterDepPack] = 1; + max[AudioDepPack] = 1; + max[DispenserDepPack] = 1; + max[DetonationDepPack] = 1; + max[TransDepPack] = 1; + max[ClipBox] = 9999; + + observeParameters = "0.5 4.5 4.5"; + shieldEffectScale = "0.7 0.7 1.0"; +}; + + +//---------------------------------------------------------------------------- +datablock PlayerData(TechFemaleHumanArmor) : TechMaleHumanArmor +{ + shapeFile = "light_female.dts"; + waterBreathSound = WaterBreathFemaleSound; + jetEffect = HumanMediumArmorJetEffect; +}; + +datablock PlayerData(TechMaleBiodermArmor) : TechMaleHumanArmor +{ + shapeFile = "bioderm_light.dts"; + jetEmitter = BiodermArmorJetEmitter; + jetEffect = BiodermArmorJetEffect; + + debrisShapeName = "bio_player_debris.dts"; + debris = BiodermPlayerDebris; + + //Foot Prints + decalData = LightBiodermFootprint; + decalOffset = 0.3; + + waterBreathSound = WaterBreathBiodermSound; +}; diff --git a/scripts/TWM2/CustomCamera.cs b/scripts/TWM2/CustomCamera.cs new file mode 100644 index 0000000..f00c51b --- /dev/null +++ b/scripts/TWM2/CustomCamera.cs @@ -0,0 +1,296 @@ +datablock CameraData(TWM2ControlCamera) { + mode = "AirstrikeCall"; + firstPersonOnly = true; +}; + +function CameraMessageLoop(%cl, %obj, %mode) { + if(!isObject(%obj)) { + return; + } + if(!isObject(%cl.player) || %cl.player.getState() $= "dead") { + %obj.delete(); + return; + } + if(%cl.getControlObject() != %obj) { + return; + } + switch$ (%mode) { + case "AirstrikeCall": + BottomPrint(%cl, "AIRSTRIKE, MOVE TO POSITION, LOOK IN THE ONCOMING DIRECTION \n PRESS JET TO LAUNCH", 1, 2); + case "HarrierCall": + BottomPrint(%cl, "HARRIER AIRSTRIKE, MOVE TO POSITION, LOOK IN THE ONCOMING DIRECTION \n PRESS JET TO LAUNCH", 1, 2); + case "NapalmHarrierCall": + BottomPrint(%cl, "NAPALM AIRSTRIKE, MOVE TO POSITION, LOOK IN THE ONCOMING DIRECTION \n PRESS JET TO LAUNCH", 1, 2); + case "StlhAirstrikeCall": + BottomPrint(%cl, "STEALTH BOMBER, MOVE TO POSITION, LOOK IN THE ONCOMING DIRECTION \n PRESS JET TO LAUNCH", 1, 2); + case "ArtilleryCall": + BottomPrint(%cl, "ARTILLERY, MOVE TO POSITION, AND PRESS JET TO LAUNCH", 1, 2); + case "OLSCall": + BottomPrint(%cl, "ORBITAL LASER STRIKE, MOVE TO POSITION, AND PRESS JET TO LAUNCH", 1, 2); + case "NukeCall": + BottomPrint(%cl, "NUCLEAR STRIKE, MOVE TO POSITION, AND PRESS JET TO LAUNCH", 1, 2); + } + schedule(1000, 0, "CameraMessageLoop", %cl, %obj, %mode); +} + +function TWM2ControlCamera::onTrigger(%data,%obj,%trigger,%state) { + if (%state == 0) + return; + + //first, give the game the opportunity to prevent the observer action + if (!Game.ObserverOnTrigger(%data, %obj, %trigger, %state)) + return; + + //now observer functions if you press the "throw" + if (%trigger >= 4) + return; + + %client = %obj.getControllingClient(); + if (%client == 0) + return; + + switch$ (%obj.mode) { + case "AirstrikeCall": + //press JET + if (%trigger == 3) { + //Can we Call in this airstrike? + if(!%client.HasAirstrike && !%client.UnlimitedAS) { + if(isObject(%client.player)) { + %obj.schedule(1000, "delete"); + %client.setControlObject(%client.player); + bottomPrint(%client, "You cannot call in an airstrike", 5, 2); + return; + } + } + else { + // + %trns = %obj.getTransform(); + %position = getWords(%trns, 0, 2); + %xyVec = getWords(%obj.getForwardVector(), 0, 1); + //cast the camera out 700M and get a location + %vector = %xyvec SPC 0; + if(getWord(%vector, 1) < 0.1 && getWord(%vector, 1) > -0.1) { + %vector = getWord(%vector, 0) SPC (getWord(%vector, 1) * 7) SPC 0; + } + %direction = vectoradd(%position, vectorscale(%vector, 700)); + //echo(%direction); + // + if(isObject(%client.player)) { + %obj.schedule(1000, "delete"); + %client.setControlObject(%client.player); + if(!%client.UnlimitedAS) { + %client.HasAirstrike = 0; + GainExperience(%client, 35, "Airstrike called in "); + } + bottomPrint(%client, "Coordinates Confirmed, Calling In Airstrike", 5, 2); + messageTeam(%client.team, 'MsgAirstrike', "\c5TWM2: Airstrike Called In From "@%client.namebase@""); + Airstrike(%client, %position, %direction); + } + else { + bottomPrint(%client, "Player Object Required", 5, 2); + } + } + } + case "HarrierCall": + //press JET + if (%trigger == 3) { + //Can we Call in this airstrike? + if(!%client.HasHarrier) { + if(isObject(%client.player)) { + %obj.schedule(1000, "delete"); + %client.setControlObject(%client.player); + bottomPrint(%client, "You cannot call in a harrier airstrike", 5, 2); + return; + } + } + else { + // + %trns = %obj.getTransform(); + %position = getWords(%trns, 0, 2); + %xyVec = getWords(%obj.getForwardVector(), 0, 1); + //cast the camera out 700M and get a location + %vector = %xyvec SPC 0; + if(getWord(%vector, 1) < 0.1 && getWord(%vector, 1) > -0.1) { + %vector = getWord(%vector, 0) SPC (getWord(%vector, 1) * 7) SPC 0; + } + %direction = vectoradd(%position, vectorscale(%vector, 700)); + if(isObject(%client.player)) { + %obj.schedule(1000, "delete"); + %client.setControlObject(%client.player); + %client.HasHarrier = 0; + GainExperience(%client, 150, "Harrier Airstrike called in "); + messageTeam(%client.team, 'MsgAirstrike', "\c5TWM2: "@%client.namebase@"'s Harrier Airstrike is Approaching."); + bottomPrint(%client, "Coordinates Confirmed, Calling In Harriers", 5, 2); + HarrierAirstrike(%client, %position, %direction); + } + else { + bottomPrint(%client, "Player Object Required", 5, 2); + } + } + } + case "NapalmHarrierCall": + //press JET + if (%trigger == 3) { + //Can we Call in this airstrike? + if(!%client.HasNapalmHarrier) { + if(isObject(%client.player)) { + %obj.schedule(1000, "delete"); + %client.setControlObject(%client.player); + bottomPrint(%client, "You cannot call in a napalm airstrike", 5, 2); + return; + } + } + else { + // + %trns = %obj.getTransform(); + %position = getWords(%trns, 0, 2); + %xyVec = getWords(%obj.getForwardVector(), 0, 1); + //cast the camera out 700M and get a location + %vector = %xyvec SPC 0; + if(getWord(%vector, 1) < 0.1 && getWord(%vector, 1) > -0.1) { + %vector = getWord(%vector, 0) SPC (getWord(%vector, 1) * 7) SPC 0; + } + %direction = vectoradd(%position, vectorscale(%vector, 700)); + if(isObject(%client.player)) { + %obj.schedule(1000, "delete"); + %client.setControlObject(%client.player); + %client.HasNapalmHarrier = 0; + GainExperience(%client, 350, "Napalm Airstrike called in "); + messageTeam(%client.team, 'MsgAirstrike', "\c5TWM2: "@%client.namebase@"'s Napalm Airstrike is coming in hot."); + bottomPrint(%client, "Coordinates Confirmed, Calling In Strike Fighters", 5, 2); + NapalmHarrierAirstrike(%client, %position, %direction); + } + else { + bottomPrint(%client, "Player Object Required", 5, 2); + } + } + } + case "OLSCall": + //press JET + if (%trigger == 3) { + //Can we Call in this airstrike? + if(!%client.HasOLS) { + if(isObject(%client.player)) { + %obj.schedule(1000, "delete"); + %client.setControlObject(%client.player); + bottomPrint(%client, "You cannot call in an orbital laser strike", 5, 2); + return; + } + } + else { + // + %position = %obj.getPosition(); + if(isObject(%client.player)) { + %obj.schedule(1000, "delete"); + %client.setControlObject(%client.player); + %client.HasOLS = 0; + GainExperience(%client, 350, "Orbital Laser Strike Called In "); + messageTeam(%client.team, 'MsgAirstrike', "\c5TWM2: "@%client.namebase@"'s Laser Strike is Incoming."); + bottomPrint(%client, "Coordinates Confirmed, Spinning Laser Cannon", 5, 2); + OrbitalLaserStrike(%client, %position); + } + else { + bottomPrint(%client, "Player Object Required", 5, 2); + } + } + } + case "StlhAirstrikeCall": + //press JET + if (%trigger == 3) { + //Can we Call in this airstrike? + if(!%client.HasSlthAirstrike) { + if(isObject(%client.player)) { + %obj.schedule(1000, "delete"); + %client.setControlObject(%client.player); + bottomPrint(%client, "You cannot call in a stealth bomber", 5, 2); + return; + } + } + else { + // + %trns = %obj.getTransform(); + %position = getWords(%trns, 0, 2); + %xyVec = getWords(%obj.getForwardVector(), 0, 1); + //cast the camera out 700M and get a location + %vector = %xyvec SPC 0; + if(getWord(%vector, 1) < 0.1 && getWord(%vector, 1) > -0.1) { + %vector = getWord(%vector, 0) SPC (getWord(%vector, 1) * 7) SPC 0; + } + %direction = vectoradd(%position, vectorscale(%vector, 700)); + if(isObject(%client.player)) { + %obj.schedule(1000, "delete"); + %client.setControlObject(%client.player); + %client.HasSlthAirstrike = 0; + GainExperience(%client, 150, "Stealth Bomber Airstrike called in "); + bottomPrint(%client, "Coordinates Confirmed, Calling In Stealth Bomber", 5, 2); + StealthAirstrike(%client, %position, %direction); + } + else { + bottomPrint(%client, "Player Object Required", 5, 2); + } + } + } + case "ArtilleryCall": + //press JET + if (%trigger == 3) { + //Can we Call in this airstrike? + if(!%client.HasArtillery) { + if(isObject(%client.player)) { + %obj.schedule(1000, "delete"); + %client.setControlObject(%client.player); + bottomPrint(%client, "You cannot call in artillery", 5, 2); + return; + } + } + else { + // + %position = %obj.getPosition(); + if(isObject(%client.player)) { + %obj.schedule(1000, "delete"); + %client.setControlObject(%client.player); + //if(!%client.UnlimitedAS) { + %client.HasArtillery = 0; + GainExperience(%client, 250, "Artillery called in "); + //} + bottomPrint(%client, "Coordinates Confirmed, Calling In Artillery", 5, 2); + messageTeam(%client.team, 'MsgAirstrike', "\c5TWM2: Artillery Called In From "@%client.namebase@""); + Artillery(%client, %position); + } + else { + bottomPrint(%client, "Player Object Required", 5, 2); + } + } + } + case "NukeCall": + //press JET + if (%trigger == 3) { + //Can we Call in this airstrike? + if(!%client.HasNuke) { + if(isObject(%client.player)) { + %obj.schedule(1000, "delete"); + %client.setControlObject(%client.player); + bottomPrint(%client, "You cannot call in a nuclear missile", 5, 2); + return; + } + } + else { + // + %position = %obj.getPosition(); + if(isObject(%client.player)) { + %obj.schedule(1000, "delete"); + %client.setControlObject(%client.player); + //if(!%client.UnlimitedAS) { + %client.HasNuke = 0; + GainExperience(%client, 500, "Nuclear Missile called in "); + //} + bottomPrint(%client, "Coordinates Confirmed, Launching Missile", 5, 2); + messageAll('msgDanger', "\c5TWM2 ALERT: "@%client.namebase@" has activated a nuclear missile!!! ~wfx/misc/red_alert.wav"); + Nuke(%client, %position); + } + else { + bottomPrint(%client, "Player Object Required", 5, 2); + } + } + } + } +} diff --git a/scripts/TWM2/ExteriorFunctioning/ArmorDamageEffects.cs b/scripts/TWM2/ExteriorFunctioning/ArmorDamageEffects.cs new file mode 100644 index 0000000..0550b72 --- /dev/null +++ b/scripts/TWM2/ExteriorFunctioning/ArmorDamageEffects.cs @@ -0,0 +1,114 @@ +datablock ParticleData(burnParticle) { + dragCoeffiecient = 0.0; + gravityCoefficient = -0.1; + inheritedVelFactor = 0.1; + + lifetimeMS = 500; + lifetimeVarianceMS = 50; + + textureName = "special/cloudflash"; + + spinRandomMin = -10.0; + spinRandomMax = 10.0; + + colors[0] = "1 0.18 0.03 0.4"; + colors[1] = "1 0.18 0.03 0.3"; + colors[2] = "1 0.18 0.03 0.0"; + sizes[0] = 2.0; + sizes[1] = 1.0; + sizes[2] = 0.8; + times[0] = 0.0; + times[1] = 0.6; + times[2] = 1.0; +}; + +datablock ParticleEmitterData(burnEmitter) { + ejectionPeriodMS = 3; + periodVarianceMS = 0; + + ejectionOffset = 0.2; + ejectionVelocity = 10.0; + velocityVariance = 0.0; + + thetaMin = 0.0; + thetaMax = 10.0; + + particles = "burnParticle"; +}; + +function burnloop(%obj){ + if(!isobject(%obj)) { + return; + } + if(%obj.onfire == 0) { + return; + } + if(%obj.firecount >= %obj.maxfirecount){ + %obj.firecount = ""; + %obj.maxfirecount = 0; + %obj.onfire = 0; + return; + } + else { + %obj.damage(0, %obj.getposition(), 0.01, $DamageType::Burn); + %obj.lastDamagedImage = "flamerImage"; + %fire = new ParticleEmissionDummy(){ + position = vectoradd(%obj.getPosition(),"0 0 0.5"); + dataBlock = "defaultEmissionDummy"; + emitter = "BurnEmitter"; + }; + MissionCleanup.add(%fire); + %fire.schedule(100, "delete"); + %obj.firecount++; + schedule(100, %obj, "burnloop", %obj); + } +} + +function ApplyEMP(%client) { + if(%client.isEMPd) { + //applying second emp = laggy + bad + return; + } + %client.isEMPd = 1; + EMPEKill(%client.player); + //echo("EMP: applied EMP to "@%client@" - "@%client.player@""); +} + +function KillEMP(%client) { + %client.isEMPd = 0; + %client.player.stopZap(); + messageClient(%client, 'msgDieEMP', "\c5Armor: Electronic Stability has returned."); + //echo("EMP: kill EMP: "@%client@""); +} + +function EMPEKill(%obj) { + if(%obj.client.isEMPd) { + if(!isObject(%obj) || %obj.getState() $= "Dead") { + //echo("EMP: "@%obj@" dead, sending Re-EMP to "@%obj.client@""); + ReEMPLoop(%obj.client); + return; + } + %obj.setEnergyLevel(0.0); + %obj.zapObject(); + schedule(100, 0, "EMPEKill", %obj); + } + else { + %obj.stopZap(); + return; + } +} + +function ReEMPLoop(%client) { + if(!%client.isEMPd) { + //echo("EMP: RE-EMP: "@%client@" no longer EMP"); + return; + } + if(!isObject(%client.player) || %client.player.getState() $= "Dead") { + //echo("EMP: RE: dead, trying to re-loop on "@%client@""); + schedule(500, 0, "ReEMPLoop", %client); + return; + } + EMPLoop(%client.player); + EMPEKill(%client.player); + //echo("EMP: Re-EMP: "@%client@" - "@%client.player@""); +} diff --git a/scripts/TWM2/ExteriorFunctioning/BloodEffects.cs b/scripts/TWM2/ExteriorFunctioning/BloodEffects.cs new file mode 100644 index 0000000..b3ee399 --- /dev/null +++ b/scripts/TWM2/ExteriorFunctioning/BloodEffects.cs @@ -0,0 +1,617 @@ +//------------------------------------------------------------------------------ +// Human Death Effects v3.0 +// Effects By: LuCiD +//============================================================================== + +// see player.cs for functions. +datablock AudioProfile(BloodSplashSound) +{ + filename = "fx/armor/general_water_exit.wav"; + description = AudioClosest3d; + preload = true; + +}; + +//------------------------------------------------------------------------------ +// Splash Mist +//============================================================================== +datablock ParticleData(HumanRedPlayerSplashMist) +{ + dragCoefficient = 2.0; + gravityCoefficient = -0.05; + inheritedVelFactor = 0.0; + constantAcceleration = 0.0; + lifetimeMS = 600; + lifetimeVarianceMS = 100; + useInvAlpha = false; + spinRandomMin = -90.0; + spinRandomMax = 500.0; + textureName = "particleTest"; + colors[0] = "0.9 0.1 0.1 0.5"; + colors[1] = "0.6 0.05 0.05 0.5"; + colors[2] = "0.4 0.0 0.0 0.0"; + sizes[0] = 0.5; + sizes[1] = 0.5; + sizes[2] = 0.8; + times[0] = 0.0; + times[1] = 0.5; + times[2] = 1.0; +}; + +datablock ParticleEmitterData(HumanRedPlayerSplashMistEmitter) +{ + ejectionPeriodMS = 26; + periodVarianceMS = 21; + ejectionVelocity = 4.0; + velocityVariance = 2.0; + ejectionOffset = 0.0; + thetaMin = 85; + thetaMax = 85; + phiReferenceVel = 0; + phiVariance = 360; + overrideAdvances = false; + lifetimeMS = 450; + particles = "HumanRedPlayerSplashMist"; +}; + +//------------------------------------------------------------------------------ +// Human Red Pool +//============================================================================== +datablock ShockwaveData(RedBloodHit) +{ + width = 3.0; + numSegments = 64; + numVertSegments = 35; + velocity = -1.5; + acceleration = 2.0; + lifetimeMS = 800; + height = 0.1; + verticalCurve = 0.5; + + mapToTerrain = false; + renderBottom = true; + orientToNormal = true; + + texture[0] = "special/shockwave4"; + texture[1] = "special/droplet";//"special/gradient"; + texWrap = 8.0; + + times[0] = 0.0; + times[1] = 0.5; + times[2] = 1.0; + + colors[0] = "0.9 0.1 0.1 0.5"; + colors[1] = "0.6 0.05 0.05 0.5"; + colors[2] = "0.4 0.0 0.0 0.0"; +}; + +//------------------------------------------------------------------------------ +// Human Red Blood +//============================================================================== +datablock ParticleData(HumanRedBloodParticle) +{ + dragCoeffiecient = 0.0; + gravityCoefficient = 120.0; + inheritedVelFactor = 0.0; + + lifetimeMS = 1600; + lifetimeVarianceMS = 000; + + textureName = "snowflake8x8";//"particletest"; + + useInvAlpha = true; + spinRandomMin = -30.0; + spinRandomMax = 30.0; + + colors[0] = "0.9 0.1 0.1 0.5"; + colors[1] = "0.6 0.05 0.05 0.5"; + colors[2] = "0.4 0.0 0.0 0.0"; + + sizes[0] = 0.2; + sizes[1] = 0.05; + sizes[2] = 0.06; + + times[0] = 0.0; + times[1] = 0.2; + times[2] = 1.0; +}; + +datablock ParticleEmitterData(HumanRedBloodEmitter) +{ + ejectionPeriodMS = 15; + periodVarianceMS = 5; + + ejectionVelocity = 1.25; + velocityVariance = 0.50; + + thetaMin = 0.0; + thetaMax = 90.0; + + particles = "HumanRedBloodParticle"; +}; + +//------------------------------------------------------------------------------ +// Human Red Droplets Particle +//============================================================================== +datablock ParticleData( HumanRedDropletsParticle ) +{ + dragCoefficient = 1; + gravityCoefficient = 0.5; + inheritedVelFactor = 0.5; + constantAcceleration = 0.1; + lifetimeMS = 300; + lifetimeVarianceMS = 100; + textureName = "special/droplet"; + colors[0] = "0.9 0.1 0.1 1.0"; + colors[1] = "0.6 0.05 0.05 1.0"; + colors[2] = "0.4 0.0 0.0 0.0"; + sizes[0] = 0.8; + sizes[1] = 0.3; + sizes[2] = 0.0; + times[0] = 0.0; + times[1] = 0.5; + times[2] = 1.0; +}; + +datablock ParticleEmitterData( HumanRedDropletsEmitter ) +{ + ejectionPeriodMS = 7; + periodVarianceMS = 0; + ejectionVelocity = 2; + velocityVariance = 1.0; + ejectionOffset = 0.0; + thetaMin = 60; + thetaMax = 80; + phiReferenceVel = 0; + phiVariance = 360; + overrideAdvances = false; + orientParticles = true; + particles = "HumanRedDropletsParticle"; +}; + +//------------------------------------------------------------------------------ +// Human Red Explosion +//============================================================================== +datablock ExplosionData(HumanRedExplosion) +{ + soundProfile = BloodSplashSound; + particleEmitter = HumanRedBloodEmitter; + particleDensity = 15; + particleRadius = 2.25; + faceViewer = true; + + emitter[0] = HumanRedPlayerSplashMistEmitter; + emitter[1] = HumanRedDropletsEmitter; + shockwave = RedBloodHit; +}; + +datablock GrenadeProjectileData(HumanBlood) +{ + projectileShapeName = "turret_muzzlepoint.dts"; //Really small and hard to see + emitterDelay = -1; + directDamage = 0.0; + hasDamageRadius = false; + indirectDamage = 0.0; + damageRadius = 0.0; + radiusDamageType = $DamageType::Default; + kickBackStrength = 0; + bubbleEmitTime = 1.0; + //sound = BloodSplashSound; + explosion = HumanRedExplosion; + //explodeOnMaxBounce = true; + velInheritFactor = 0.5; + baseEmitter[0] = HumanRedBloodEmitter; + + grenadeElasticity = 0.4; + grenadeFriction = 0.2; + armingDelayMS = 100; // was 400 + muzzleVelocity = 0; + drag = 0.1; + +}; + +//------------------------------------------------------------------------------ +// Bioderm Death Effects v3.0 +// Effects by: LuCiD +//============================================================================== + +// see player.cs for functions. +//------------------------------------------------------------------------------ +// Splash Mist +//============================================================================== +datablock ParticleData(BiodermPlayerSplashMist) +{ + dragCoefficient = 2.0; + gravityCoefficient = -0.05; + inheritedVelFactor = 0.0; + constantAcceleration = 0.0; + lifetimeMS = 600; + lifetimeVarianceMS = 100; + useInvAlpha = false; + spinRandomMin = -90.0; + spinRandomMax = 500.0; + textureName = "particleTest"; + colors[0] = "0.1 0.9 0.1 0.5"; + colors[1] = "0.2 0.09 0.05 0.5"; + colors[2] = "0.0 0.4 0.0 0.0"; + sizes[0] = 0.5; + sizes[1] = 0.5; + sizes[2] = 0.8; + times[0] = 0.0; + times[1] = 0.5; + times[2] = 1.0; +}; + +datablock ParticleEmitterData(BiodermPlayerSplashMistEmitter) +{ + ejectionPeriodMS = 26; + periodVarianceMS = 21; + ejectionVelocity = 3.0; + velocityVariance = 2.0; + ejectionOffset = 0.0; + thetaMin = 85; + thetaMax = 85; + phiReferenceVel = 0; + phiVariance = 360; + overrideAdvances = false; + lifetimeMS = 450; + particles = "BiodermPlayerSplashMist"; +}; + +//------------------------------------------------------------------------------ +// Bioderm Green Pool +//============================================================================== +datablock ShockwaveData(GreenBloodHit) +{ + width = 3.0; + numSegments = 64; + numVertSegments = 35; + velocity = -1.5; + acceleration = 2.0; + lifetimeMS = 800; + height = 0.1; + verticalCurve = 0.5; + + mapToTerrain = false; + renderBottom = true; + orientToNormal = true; + + texture[0] = "special/shockwave4"; + texture[1] = "special/droplet";//"special/gradient"; + texWrap = 8.0; + + times[0] = 0.0; + times[1] = 0.5; + times[2] = 1.0; + + colors[0] = "0.1 0.9 0.1 0.5"; + colors[1] = "0.5 0.06 0.05 0.5"; + colors[2] = "0.0 0.4 0.0 0.0"; +}; + +//------------------------------------------------------------------------------ +// Bioderm Blood +//============================================================================== +datablock ParticleData(BiodermBloodParticle) +{ + dragCoeffiecient = 0.0; + gravityCoefficient = 120.0; // drops quickly + inheritedVelFactor = 0; + + lifetimeMS = 1600; // lasts 2 second + lifetimeVarianceMS = 000; // ...more or less + + textureName = "snowflake8x8";//"particletest"; + + useInvAlpha = true; + spinRandomMin = -30.0; + spinRandomMax = 30.0; + + colors[0] = "0.1 0.9 0.1 0.5"; + colors[1] = "0.2 0.06 0.05 0.5"; + colors[2] = "0.0 0.4 0.0 0.0"; + + sizes[0] = 0.2; + sizes[1] = 0.05; + sizes[2] = 0.06; + + times[0] = 0.0; + times[1] = 0.2; + times[2] = 1.0; +}; + +datablock ParticleEmitterData(BiodermBloodEmitter) +{ + ejectionPeriodMS = 15; + periodVarianceMS = 5; + + ejectionVelocity = 1.25; + velocityVariance = 0.50; + + thetaMin = 0.0; + thetaMax = 90.0; + + particles = "BiodermBloodParticle"; +}; + +//------------------------------------------------------------------------------ +// Bioderm Droplets Particle +//============================================================================== +datablock ParticleData( BiodermDropletsParticle ) +{ + dragCoefficient = 1; + gravityCoefficient = 0.5; + inheritedVelFactor = 0.5; + constantAcceleration = 0.1; + lifetimeMS = 300; + lifetimeVarianceMS = 100; + textureName = "special/droplet"; + colors[0] = "0.1 0.9 0.1 1.0"; + colors[1] = "0.2 0.06 0.05 1.0"; + colors[2] = "0.0 0.4 0.0 0.0"; + sizes[0] = 0.8; + sizes[1] = 0.3; + sizes[2] = 0.0; + times[0] = 0.0; + times[1] = 0.5; + times[2] = 1.0; +}; + +datablock ParticleEmitterData( BiodermDropletsEmitter ) +{ + ejectionPeriodMS = 27; + periodVarianceMS = 21; + ejectionVelocity = 2; + velocityVariance = 1.0; + ejectionOffset = 0.0; + thetaMin = 60; + thetaMax = 80; + phiReferenceVel = 0; + phiVariance = 360; + overrideAdvances = false; + orientParticles = true; + particles = "BiodermDropletsParticle"; +}; + +//------------------------------------------------------------------------------ +// Bioderm Explosion +//============================================================================== +datablock ExplosionData(BiodermExplosion) +{ + soundProfile = BloodSplashSound; + particleEmitter = BiodermBloodEmitter; + particleDensity = 25; + particleRadius = 2.25; + faceViewer = true; + + emitter[0] = BiodermPlayerSplashMistEmitter; + emitter[1] = BiodermDropletsEmitter; + shockwave = GreenBloodHit; +}; + +datablock GrenadeProjectileData(BiodermBlood) +{ + projectileShapeName = "turret_muzzlepoint.dts"; //Really small and hard to see + emitterDelay = -1; + directDamage = 0.15; + hasDamageRadius = false; + indirectDamage = 0.0; + damageRadius = 0.15; + radiusDamageType = $DamageType::ArmorDeath; + kickBackStrength = 0; + bubbleEmitTime = 1.0; + //sound = BloodSplashSound; + explosion = BiodermExplosion; + //explodeOnMaxBounce = true; + velInheritFactor = 0.5; + baseEmitter[0] = BiodermBloodEmitter; + + grenadeElasticity = 0.4; + grenadeFriction = 0.2; + armingDelayMS = 100; // was 400 + muzzleVelocity = 0; + drag = 0.1; + +}; +//------------------------------------------------------------------------------ +// Purple Bioderm blood +//============================================================================== + +//------------------------------------------------------------------------------ +// Purple Splash Mist +//============================================================================== +datablock ParticleData(PurpleBiodermPlayerSplashMist) +{ + dragCoefficient = 2.0; + gravityCoefficient = -0.05; + inheritedVelFactor = 0.0; + constantAcceleration = 0.0; + lifetimeMS = 600; + lifetimeVarianceMS = 100; + useInvAlpha = false; + spinRandomMin = -90.0; + spinRandomMax = 500.0; + textureName = "particleTest"; + colors[0] = "0.25 0.12 0.40 0.5"; + colors[1] = "0.25 0.12 0.40 0.5"; + colors[2] = "0.4 0.0 0.5 0.0"; + sizes[0] = 0.5; + sizes[1] = 0.5; + sizes[2] = 0.8; + times[0] = 0.0; + times[1] = 0.5; + times[2] = 1.0; +}; + +datablock ParticleEmitterData(PurpleBiodermPlayerSplashMistEmitter) +{ + ejectionPeriodMS = 26; + periodVarianceMS = 21; + ejectionVelocity = 3.0; + velocityVariance = 2.0; + ejectionOffset = 0.0; + thetaMin = 85; + thetaMax = 85; + phiReferenceVel = 0; + phiVariance = 360; + overrideAdvances = false; + lifetimeMS = 450; + particles = "PurpleBiodermPlayerSplashMist"; +}; + +//------------------------------------------------------------------------------ +// Bioderm Purple Pool +//============================================================================== +datablock ShockwaveData(PurpleBloodHit) +{ + width = 3.0; + numSegments = 64; + numVertSegments = 35; + velocity = -1.5; + acceleration = 2.0; + lifetimeMS = 800; + height = 0.1; + verticalCurve = 0.5; + + mapToTerrain = false; + renderBottom = true; + orientToNormal = true; + + texture[0] = "special/shockwave4"; + texture[1] = "special/droplet";//"special/gradient"; + texWrap = 8.0; + + times[0] = 0.0; + times[1] = 0.5; + times[2] = 1.0; + + colors[0] = "0.25 0.12 0.40 0.5"; + colors[1] = "0.25 0.12 0.40 0.5"; + colors[2] = "0.4 0.0 0.5 0.0"; +}; + +//------------------------------------------------------------------------------ +// Purple Bioderm Blood +//============================================================================== +datablock ParticleData(PurpleBiodermBloodParticle) +{ + dragCoeffiecient = 0.0; + gravityCoefficient = 120.0; // drops quickly + inheritedVelFactor = 0; + + lifetimeMS = 1550; // lasts 2 second + lifetimeVarianceMS = 300; // ...more or less + + textureName = "snowflake8x8";//"particletest"; + + useInvAlpha = true; + spinRandomMin = -30.0; + spinRandomMax = 30.0; + + colors[0] = "0.25 0.12 0.40 0.5"; + colors[1] = "0.25 0.12 0.40 0.5"; + colors[2] = "0.4 0.0 0.5 0.0"; + + sizes[0] = 0.2; + sizes[1] = 0.05; + sizes[2] = 0.05; + + times[0] = 0.0; + times[1] = 0.2; + times[2] = 1.0; +}; + +datablock ParticleEmitterData(PurpleBiodermBloodEmitter) +{ + ejectionPeriodMS = 15; + periodVarianceMS = 5; + + ejectionVelocity = 1.25; + velocityVariance = 0.50; + + thetaMin = 0.0; + thetaMax = 90.0; + + particles = "PurpleBiodermBloodParticle"; +}; + +//------------------------------------------------------------------------------ +// purple Bioderm Droplets Particle +//============================================================================== +datablock ParticleData( PurpleBiodermDropletsParticle ) +{ + dragCoefficient = 1; + gravityCoefficient = 0.5; + inheritedVelFactor = 0.5; + constantAcceleration = -0.0; + lifetimeMS = 300; + lifetimeVarianceMS = 100; + textureName = "special/droplet"; + colors[0] = "0.25 0.12 0.40 0.5"; + colors[1] = "0.25 0.12 0.40 0.5"; + colors[2] = "0.4 0.0 0.5 0.0"; + sizes[0] = 0.8; + sizes[1] = 0.3; + sizes[2] = 0.0; + times[0] = 0.0; + times[1] = 0.5; + times[2] = 1.0; +}; + +datablock ParticleEmitterData( PurpleBiodermDropletsEmitter ) +{ + ejectionPeriodMS = 27; + periodVarianceMS = 21; + ejectionVelocity = 2; + velocityVariance = 1.0; + ejectionOffset = 0.0; + thetaMin = 60; + thetaMax = 80; + phiReferenceVel = 0; + phiVariance = 360; + overrideAdvances = false; + orientParticles = true; + particles = "PurpleBiodermDropletsParticle"; +}; + +//------------------------------------------------------------------------------ +// Purple Bioderm Explosion +//============================================================================== +datablock ExplosionData(PurpleBiodermExplosion) +{ + soundProfile = BloodSplashSound; + particleEmitter = PurpleBiodermBloodEmitter; + particleDensity = 25; + particleRadius = 2.25; + faceViewer = true; + + emitter[0] = PurpleBiodermPlayerSplashMistEmitter; + emitter[1] = PurpleBiodermDropletsEmitter; + shockwave = PurpleBloodHit; +}; + +datablock GrenadeProjectileData(PurpleBiodermBlood) +{ + projectileShapeName = "turret_muzzlepoint.dts"; //Really small and hard to see + emitterDelay = -1; + directDamage = 0.0; + hasDamageRadius = false; + indirectDamage = 0.0; + damageRadius = 0.0; + radiusDamageType = $DamageType::Default; + kickBackStrength = 0; + bubbleEmitTime = 1.0; + //sound = BloodSplashSound; + explosion = PurpleBiodermExplosion; + //explodeOnMaxBounce = true; + velInheritFactor = 0.5; + baseEmitter[0] = PurpleBiodermBloodEmitter; + + grenadeElasticity = 0.4; + grenadeFriction = 0.2; + armingDelayMS = 100; // was 400 + muzzleVelocity = 0; + drag = 0.1; +}; + + diff --git a/scripts/TWM2/ExteriorFunctioning/KillTrigger.cs b/scripts/TWM2/ExteriorFunctioning/KillTrigger.cs new file mode 100644 index 0000000..ee0c5bf --- /dev/null +++ b/scripts/TWM2/ExteriorFunctioning/KillTrigger.cs @@ -0,0 +1,172 @@ +datablock TriggerData(deathTrigger) { + tickPeriodMS = 1000; +}; + +function deathTrigger::onEnterTrigger(%data, %obj, %colObj) { + if(%colObj == game.Bomb) { + MessageAll('msgWhoops', "\c5SABOTAGE: Bomb Reset."); + Game.bomb.setPosition($SabotageGame::BombLocation[$CurrentMission]); + + } + if(!isObject(%colObj) || %colObj.getState() $= "dead") { + return; + } + %colObj.setInvinc(false); + %colObj.scriptkill($DamageType::FellOff); +} +function deathTrigger::onLeaveTrigger(%data, %obj, %colObj) { +//Nothing +} + +function deathTrigger::onTickTrigger(%data, %obj, %colObj) { +//Nothing +} + + + + + + + + +datablock TriggerData(TransTrigger) { + tickPeriodMS = 1000; +}; +//-------------------------------- +function TransTrigger::onEnterTrigger(%data, %obj, %colObj) +{ + if(!isObject(%colObj) || %colObj.getState() $= "dead") { + return; + } + if($CurrentMission $= "SideSwipe") {//< ServerReturnDate()) { + error("GLOBAL-BAN: "@%name@" Added, Expires: "@%EplDate@", Reason: "@%reason@"."); + $Phantom::GlobalBanList[$Phantom::BanCount] = ""@%name@" "@%EplDate@" "@%reason@""; + $Phantom::BanCount++; + } + else { + error("GLOBAL-BAN: "@%name@", This ban has Expired, Not added to list."); + } +} + +function BanGet::onConnectFailed() { + echo("-- Could not connect to PGD."); + echo("Please Call DownloadBanList(); To Protect your server"); +} + +function BanGet::onDisconnect(%this) { + %this.delete(); +} + +function CheckBans(%client) { + for(%i= 0; %i < $Phantom::BanCount; %i++) { + %nametotest = getWord($Phantom::GlobalBanList[%i], 0); + %target = plnametocid(%nametotest); + if(%target != 0) { + %EplDate = getWord($Phantom::GlobalBanList[%i], 1); + if(%EplDate > ServerReturnDate()) { + %reason = getWords($Phantom::GlobalBanList[%i], 2); + banthesucker(%target, %reason, %EplDate); + } + else { + echo(""@getTaggedString(%client.name)@" is on the ban list, but the duration has expired"); + } + } + else { + //Do Nothing + } + } +} + + function banthesucker(%client, %reason, %lengString) { + if($Host::UseGlobalBanList) { + echo("Global-Banned Client "@%client.namebase@" Attempting to Connect"); + MessageAll('Message', "\c2"@%client.namebase@" is Banned Until "@%lengString@" - "@%reason@"."); + if(%lengString > 90000000) { + ban(%client); + %client.setDisconnectReason( "You are Perm. Banned From This Server, "@%reason@"" ); + $HostGamePlayerCount = ClientGroup.getCount(); + return; + } + ban(%client); + %client.setDisconnectReason( "You are G-Banned Until "@%lengString@", "@%reason@"" ); + $HostGamePlayerCount = ClientGroup.getCount(); + } + else { + echo("Global-Banned Client "@%client.namebase@" Permitted connect - $Host::UseGlobalBanList is 0"); + MessageAll('Message', "\c2Global Banned Client: "@%client.namebase@" Permitted Access, $Host::UseGlobalBanList is 0."); + } + } + +DownloadBanList(); //download the list +package ServerRunFunctioning { + function GameConnection::onConnect(%client, %name, %raceGender, %skin, %voice, %voicePitch) { + parent::onConnect(%client, %name, %raceGender, %skin, %voice, %voicePitch); + checkBans(%client); + } +}; +activatePackage(ServerRunFunctioning); +////////// + +function spawnprojectile(%proj,%type,%pos,%direction,%src) { +if(%src $= "" || !%src) { + %src = ""; +} +%p = new (%type)() { +dataBlock = %proj; +initialDirection = %direction; +initialPosition = %pos; +damageFactor = 1; +sourceObject = %src; +}; +MissionCleanup.add(%p); +//%p.sourceObject = %src; //fun fun +return %p; +} + +function spawnprojectileSourceMod(%proj,%type,%pos,%direction,%src) { +if(%src $= "" || !%src) { + %src = ""; +} +%p = new (%type)() { +dataBlock = %proj; +initialDirection = %direction; +initialPosition = %pos; +damageFactor = 1; +//sourceObject = %src; +}; +MissionCleanup.add(%p); +%p.sourceObject = %src; //fun fun +return %p; +} + +///------------------------------------------------------------------------------- +///------------------------------------------------------------------------------- +//--- Object Commanding +function RenameObject(%Obj) +{ +if (%className $= "Generator" || %className $= "Switch"){ + %obj.nametag = %args; + %freq = %obj.powerfreq; + setTargetName(%obj.target,addTaggedString("\c8"@%args@"\c6 Frequency "@%freq)); + return; +} + +else if (%className $= "teleport"){ + %freq = %obj.Frequency; + %obj.nametag = %args; + setTargetName(%obj.target,addTaggedString("\c8"@%args@"\c6 Frequency "@%freq)); + return; + } +else if (%className $= "waypoint"){ +%obj.wp.schedule(10, "delete"); + %waypoint = new (WayPoint)(){ + dataBlock = WayPointMarker; + position = %obj.getPosition(); + name = %args; + scale = "0.1 0.1 0.1"; + team = getRandom(0,2); + }; + MissionCleanup.add(%waypoint); + %obj.wp=%waypoint; + return; + } +else + setTargetName(%obj.target,addTaggedString("\c8"@%args@"\c6")); +} + +//--- Various Kill Commands and Kill Functions in The Mod +function KillClientByType(%client,%type) +{ +if(%type==1){ //Kill Client +%client.player.scriptkill($DamageType::Admin); +} +else if(%type==2){ //Blow Up Client +%client.player.blowup(); +%client.player.scriptkill($DamageType::Admin); +} +else if(%type==3){ //Nuke Client +BunkerBusterball::onExplode("" ,"",%client.player.position); +} +else if(%type==4){ //3 Second Storm +%zap= new Lightning(Lightning) + { + position = %client.player.position; + rotation = "1 0 0 0"; + scale = "55 55 100"; + dataBlock = "DefaultStorm"; + lockCount = "0"; + homingCount = "0"; + strikesPerMinute = "500"; + strikeWidth = "2.5"; + chanceToHitTarget = "100"; + strikeRadius = "10"; + boltStartRadius = "20"; //altitude the lightning starts from + color = "0.314961 1.000000 0.576000 1.000000"; + fadeColor = "0.560000 0.860000 0.260000 1.000000"; + useFog = "1"; + shouldCloak = 0; + }; +%zap.schedule(3000, delete); +} +else if(%type==5){ //1 Second Violent Shock +%shock= new Lightning(Lightning) + { + position = %target.player.position; + rotation = "1 0 0 0"; + scale = "55 55 4"; + dataBlock = "DefaultStorm"; + lockCount = "0"; + homingCount = "0"; + strikesPerMinute = "10000"; + strikeWidth = "2.5"; + chanceToHitTarget = "100"; + strikeRadius = "10"; + boltStartRadius = "1"; //altitude the lightning starts from + color = "0.314961 1.000000 0.576000 1.000000"; + fadeColor = "0.560000 0.860000 0.260000 1.000000"; + useFog = "1"; + shouldCloak = 0; + }; +%shock.schedule(1000, delete); +} +} + +//////////////////////////Defaultgame.cs - Need to fix this +// if (%missionTypeId $= "LoadBuildingConf") { +// %file = stripChars(%missionDisplayName,":\\/"); +// %dir = "Buildings/" @ $Phantom::LoadFolder; +// if (%file $= "") +// return; +// else { +// if (strStr(%file,"..") != -1) +// return; +// } +// %file = %dir @ %file; +// if (isFile(%file) && getSubStr(%file,strLen(%file)-3,3) $= ".cs") { +// // Message is sent first, so clients know what happened in case server crashes +// messageAll('MsgAdminForce', '\c2The Admin has loaded a building file. \c3(%1)', %file); +// compile(%file); +// exec(%file); +// } +// return; +// } +// } + +function createNewDecoy(%client,%name,%race,%armor,%sex,%enum) { +%gun = %client.givingto; +if(%enum == 1) +%emote = "sitting"; +else if(%enum == 2) +%emote = "standing"; +//armor +if(%race == 1 && %armor == 1 && %sex == 1) +%mountimage = LightMaleHumanArmor; +else if(%race == 1 && %armor == 2 && %sex == 1) +%mountimage = MediumMaleHumanArmor; +else if(%race == 1 && %armor == 3 && %sex == 1) +%mountimage = HeavyMaleHumanArmor; +else if(%race == 1 && %armor == 1 && %sex == 2) +%mountimage = LightFemaleHumanArmor; +else if(%race == 1 && %armor == 2 && %sex == 2) +%mountimage = MediumFemaleHumanArmor; +else if(%race == 1 && %armor == 3 && %sex == 2) +%mountimage = HeavyFemaleHumanArmor; +else if(%race == 2 && %armor == 1 && %sex == 1) +%mountimage = LightMaleBiodermArmor; +else if(%race == 2 && %armor == 2 && %sex == 1) +%mountimage = MediumMaleBiodermArmor; +else if(%race == 2 && %armor == 3 && %sex == 1) +%mountimage = HeavyMaleBiodermArmor; + %objdecoy = new Player() + { + dataBlock = %mountimage; + Position = %client.player.getPosition(); + }; + %objdecoy.target = createTarget(%objdecoy, %name, "", "Male1", '', 0, PlayerSensor); + setTargetDataBlock(%objdecoy.target, %objdecoy.getDatablock()); + setTargetSensorData(%objdecoy.target, PlayerSensor); + setTargetSensorGroup(%objdecoy.target, 0); + setTargetName(%objdecoy.target, addtaggedstring(%name)); + %objdecoy.setActionThread(%emote,true); + %objdecoy.isStatic = true; + %client.player.decoy = %objdecoy; + %objdecoy.isDecodic = 1; + %objdecoy.setTransform(VectorAdd(%client.player.getPosition(),"0 0 0") SPC rot(%client.player)); + %objdecoy.disableMove(true); +} + +function gougeloop(%client) { +if(!%client.blinded){ +return; +} +else { +%client.player.setDamageFlash(1); +} +schedule(100,0,"gougeloop",%client); +} + +//Scream Sound +datablock AudioProfile(NightmareScreamSound) +{ + filename = "voice/male1/avo.deathcry_02.wav"; + description = AudioClose3d; + preload = true; +}; + +function nightmareloop(%causer,%viewer,%type) { +if(%type == 1) { //slow drain to death + %enum = getRandom(1,5); + switch(%enum) { + case 1: + %emote = "sitting"; + case 2: + %emote = "standing"; + case 3: + %emote = "death3"; + case 4: + %emote = "death2"; + case 5: + %emote = "death4"; + } + if(!isobject(%viewer.player) || %viewer.player.getState() $= "dead") { + %viewer.nightmared = 0; + return; + } + if(!isobject(%causer.player) || %causer.player.getState() $= "dead") { + %viewer.nightmared = 0; + %viewer.player.setMoveState(false); + messageclient(%sender, 'MsgClient', '\c2The source of your nightmare has been destroyed.'); + return; + } + %viewer.player.setMoveState(true); + %viewer.nightmared = 1; + %viewer.player.setActionThread(%emote,true); + %viewer.player.setWhiteout(1.8); + %viewer.player.setDamageFlash(1.5); + %causer.player.playShieldEffect("1 1 1"); + serverPlay3D(NightmareScreamSound, %viewer.player.position); + schedule(500,0,"nightmareloop",%causer, %viewer, %type); + %viewer.player.damage(0, %viewer.player.position, 0.01, $DamageType::admin); + %causer.player.applyRepair(0.01); + BottomPrint(%viewer,""@%causer.namebase@"'s Nightmare Is Draining your will to live.",5,1); + BottomPrint(%causer,"Your life is being replenished by sucking "@%viewer.namebase@"'s Dream Energy.",5,1); + messageclient(%viewer, 'MsgClient', "~wvoice/fem1/avo.deathcry_02.wav"); + messageclient(%viewer, 'MsgClient', "~wvoice/fem2/avo.deathcry_02.wav"); + messageclient(%viewer, 'MsgClient', "~wvoice/fem3/avo.deathcry_02.wav"); + messageclient(%viewer, 'MsgClient', "~wvoice/fem4/avo.deathcry_02.wav"); + messageclient(%viewer, 'MsgClient', "~wvoice/fem5/avo.deathcry_02.wav"); + messageclient(%viewer, 'MsgClient', "~wvoice/male1/avo.deathcry_02.wav"); + messageclient(%viewer, 'MsgClient', "~wvoice/male2/avo.deathcry_02.wav"); + messageclient(%viewer, 'MsgClient', "~wvoice/male3/avo.deathcry_02.wav"); + messageclient(%viewer, 'MsgClient', "~wvoice/male4/avo.deathcry_02.wav"); + messageclient(%viewer, 'MsgClient', "~wvoice/male5/avo.deathcry_02.wav"); + messageclient(%viewer, 'MsgClient', "~wvoice/derm1/avo.deathcry_02.wav"); + messageclient(%viewer, 'MsgClient', "~wvoice/derm2/avo.deathcry_02.wav"); + messageclient(%viewer, 'MsgClient', "~wvoice/derm3/avo.deathcry_02.wav"); + } +else if(%type == 2) { // Sleep = death + if(!isobject(%viewer.player) || %viewer.player.getState() $= "dead") { + %viewer.tirednightmared = 0; + return; + } + if(!%viewer.tirednightmared) { + %viewer.Nightmareticks = 0; + return; + } + if(%viewer.nightmareticks $= "") { + %viewer.nightmareticks = 0; + } + %viewer.Nightmareticks++; + schedule(500,0,"nightmareloop",%causer, %viewer, %type); + if(%viewer.Nightmareticks < 20) { + %viewer.player.setWhiteout(0.3); + BottomPrint(%viewer,"Something is happening, you suddenly feel tired.",5,1); + } + else if(%viewer.Nightmareticks >= 20 && %viewer.Nightmareticks < 70) { + %viewer.player.setWhiteout(0.5); + %viewer.player.damage(0, %viewer.player.position, 0.01, $DamageType::admin); //Maybe they will understand... + BottomPrint(%viewer,"You feel really fatigued, and are slowly drifting to sleep.",5,1); + } + else if(%viewer.Nightmareticks >= 70 && %viewer.Nightmareticks < 100) { + %viewer.player.setWhiteout(0.8); + %viewer.player.damage(0, %viewer.player.position, 0.02, $DamageType::admin); //Maybe they will understand... + CenterPrint(%viewer,"HURRY GET TO THE INVENTORY STATION!!!",5,1); + BottomPrint(%viewer,"YOU UNDERSTAND NOW, THIS NIGHTMARE IS GOING TO KILL YOU",5,1); + } + else if(%viewer.Nightmareticks >= 100) { + %viewer.player.setWhiteout(1.8); + %viewer.player.damage(0, %viewer.player.position, 100.0, $DamageType::admin); + BottomPrint(%viewer,"You fell asleep, and the nightmare killed you.",10,1); + } + } +else if(%type == 3) { //I believe I can fly, I DONT belive in GRAVITY!!! + if(!isobject(%viewer.player) || %viewer.player.getState() $= "dead") { + %viewer.flynightmared = 0; + return; + } + if(!%viewer.flynightmared) { + %viewer.Nightmareticks = 0; + return; + } + if(%viewer.nightmareticks $= "") { + %viewer.nightmareticks = 0; + } + %viewer.Nightmareticks++; + schedule(500,0,"nightmareloop",%causer, %viewer, %type); + if(%viewer.nightmareticks < 25) { + %viewer.player.setVelocity("0 0 300"); + BottomPrint(%viewer,"WOOOOOOOOOOHOOOOOOO FLYING",5,1); + } + else if(%viewer.nightmareticks >= 25 && %viewer.nightmareticks < 27) { + %viewer.player.setVelocity("0 0 -300"); + BottomPrint(%viewer,"Oh s***!!!!!",5,1); + } + else if(%viewer.nightmareticks > 27) { + CenterPrint(%viewer,"Only now you realized that even Nightmares... Are Real.",10,1); + %viewer.flynightmared = 0; + } + } +} + +function LockCLLoop(%client) { + if(!%client.cllock) { + %client.notReady = false; + %client.camera.getDataBlock().setMode( %client.camera, "observer", %client.player ); + %client.setControlObject( %client.player ); + return; + } + %client.notReady = true; + %client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player ); + %client.setControlObject( %client.camera ); + CenterPrint(%client,"Your Soul is gone, Please Press Alt+F4 To Exit the game.",1,1); + schedule(1000,0,"LockCLLoop",%client); +} diff --git a/scripts/TWM2/ExteriorFunctioning/ProtPatch.cs b/scripts/TWM2/ExteriorFunctioning/ProtPatch.cs new file mode 100644 index 0000000..3c3811d --- /dev/null +++ b/scripts/TWM2/ExteriorFunctioning/ProtPatch.cs @@ -0,0 +1,62 @@ +// A lil' sumthin' by Alviss +// 05/06/09 +//------------------------------------------------------------------------------ + +// A simple patch meant for CCM and it's variants. +// The patch will keep Zombies from infecting and hurting repawning players +// and keep respawning players from doing damage to other players +// under the protection of respawn cloaking/invincibility + +//------------------------------------------------------------------------------ +// if you want people to be able to shoot while respawn-invincible, +// put: +// $Host::NoSpawnShooting = false; +// into your console + +if ($Host::NoSpawnShooting $= "") + $Host::NoSpawnShooting = true; + +//------------------------------------------------------------------------------ + +package SimpCCMPatch +{ + // Where the infecting business happens + function Armor::onCollision(%this,%obj,%col,%forceVehicleNode) + { + // if the colliding object is a zombie and you're respawning + if ((%col.IsZombie) && %obj.respawnCloakThread !$= "") + return; // you'll be safe. + + Parent::onCollision(%this,%obj,%col,%forceVehicleNode); + } + + // Where shooting damage happens + function ShapeBase::damage(%this, %sourceObject, %position, %amount, %damageType) + { + // if the variable is active + if ($Host::SpawnShooting) + { + // if all the parties check out + if (isObject(%sourceObject) && %this.isEnabled() && (!%this.isZombie)) + { + // if the client just respawned + if (%sourceObject.respawnCloakThread !$= "") + { + // pull them out of invincibiltiy and stop the damaging process + %sourceObject.setInvincible(false); + %sourceObject.setRespawnCloakOff(); + return; + } + } + } + // continue the routine normally + Parent::damage(%this, %sourceObject, %position, %amount, %damageType); + } + +}; + +if (!isActivePackage(SimpCCMPatch)) { + echo("Activating CCM Prot Patch"); + ActivatePackage(SimpCCMPatch); + $Host::NoSpawnShooting = true; +} diff --git a/scripts/TWM2/ExteriorFunctioning/pulsestuff.cs b/scripts/TWM2/ExteriorFunctioning/pulsestuff.cs new file mode 100644 index 0000000..6c6afb3 --- /dev/null +++ b/scripts/TWM2/ExteriorFunctioning/pulsestuff.cs @@ -0,0 +1,742 @@ +datablock ShockwaveData(BaseShockWave) { + className = "ShockwaveData"; + scale = "1 1 1"; + delayMS = "0"; + delayVariance = "0"; + lifetimeMS = "12000"; + lifetimeVariance = "0"; + width = "5"; + numSegments = "20"; + numVertSegments = "10"; + velocity = "-30"; + height = "20"; + verticalCurve = "5"; + acceleration = "5"; + times[0] = "0"; + times[1] = "0.5"; + times[2] = "1"; + times[3] = "1"; + colors[0] = "0.000000 0.000000 0.500000 0.100000"; //1.0 0.9 0.9 + colors[1] = "0.500000 0.500000 1.000000 1.000000"; //0.6 0.6 0.6 + colors[2] = "0.500000 0.500000 1.000000 0.100000"; //0.6 0.6 0.6 + colors[3] = "1.000000 1.000000 1.000000 1.000000"; + texture[0] = "special/shockwave4"; + texture[1] = "special/gradient"; + texWrap = "7"; + is2D = "0"; + mapToTerrain = "0"; + orientToNormal = "1"; + renderBottom = "1"; + renderSquare = "0"; +}; + +datablock ExplosionData(BaseExplosion) + { + className = "ExplosionData"; + particleDensity = "10"; + particleRadius = "1"; + explosionScale = "1 1 1"; + playSpeed = "1"; + Shockwave = "BaseShockWave"; + shockwaveOnTerrain = "0"; + lifetimeMS = "1000"; + }; + +datablock TracerProjectileData(BaseProjectile) { + className = "TracerProjectileData"; + Explosion = "BaseExplosion"; + dryVelocity = "0.1"; + wetVelocity = "0.1"; + fizzleTimeMS = "32"; + lifetimeMS = "32"; + explodeOnDeath = "1"; + crossSize = "0.1"; + renderCross = "0"; + isFXUnit = "1"; + }; + +function shockwave(%pos,%nrm,%dat) +{ +if (%dat $= "") +%dat = BaseProjectile; + +%p1 = new TracerProjectile() +{ +dataBlock = %dat; +initialDirection = %nrm; +initialPosition = %pos; +}; +} + +//Shockwaves + +datablock ShockwaveData(RepairWave) { +className = "ShockwaveData"; +scale = "1 1 1"; +delayMS = "0"; +delayVariance = "0"; +lifetimeMS = "10000"; +lifetimeVariance = "0"; +width = "1"; +numSegments = "60"; +numVertSegments = "30"; +velocity = "10"; +height = "20"; +verticalCurve = "5"; +acceleration = "1"; +times[0] = "0"; +times[1] = "0.25"; +times[2] = "0.9"; +times[3] = "1"; +colors[0] = "1.000000 0.200000 0.200000 1.000000"; //1.0 0.9 0.9 +colors[1] = "1.000000 0.200000 0.200000 1.000000"; //0.6 0.6 0.6 +colors[2] = "1.000000 0.200000 0.200000 1.000000"; //0.6 0.6 0.6 +colors[3] = "1.000000 0.200000 0.200000 0.000000"; +texture[0] = "special/redbump2"; +texture[1] = "special/shockwave4"; //gradient"; +texWrap = "1"; +is2D = "0"; +mapToTerrain = "0"; +orientToNormal = "1"; +renderBottom = "1"; +renderSquare = "0"; +}; + +datablock ShockwaveData(CloakWave):RepairWave +{ +colors[0] = "1 1 1 1"; +colors[1] = "1 1 1 1"; +colors[2] = "1 1 1 1"; +colors[3] = "1 1 1 0"; +texture[0] = "special/cloakTexture"; +texture[1] = "special/shockwave4"; +texWrap = "5"; +}; + +datablock ShockwaveData(DisWave):RepairWave +{ +colors[0] = "0.2 0.2 1 1"; +colors[1] = "0.2 0.2 1 1"; +colors[2] = "0.2 0.2 1 1"; +colors[3] = "0.2 0.2 1 0"; +texture[0] = "special/shockwave5"; +texture[1] = "special/shockwave4"; +texWrap = "1"; +}; + +datablock ShockwaveData(EspWave):RepairWave +{ +colors[0] = "0.8 0.2 1 1"; +colors[1] = "0.8 0.2 1 1"; +colors[2] = "0.8 0.2 1 1"; +colors[3] = "0.8 0.2 1 0"; +texture[0] = "special/shockwave5"; +texture[1] = "special/shockwave4"; +texWrap = "1"; +}; + +datablock ShockwaveData(MORWave):RepairWave +{ +colors[0] = "0.8 1 0.2 1"; +colors[1] = "0.8 1 0.2 1"; +colors[2] = "0.8 1 0.2 1"; +colors[3] = "0.8 1 0.2 0"; +texture[0] = "special/shockwave5"; +texture[1] = "special/shockwave4"; +texWrap = "1"; +}; + +datablock ShockwaveData(KillWave):RepairWave { +className = "ShockwaveData"; +scale = "1 1 1"; +delayMS = "0"; +delayVariance = "0"; +lifetimeMS = "30000"; +lifetimeVariance = "0"; +width = "1"; +numSegments = "60"; +numVertSegments = "30"; +velocity = "10"; +height = "20"; +verticalCurve = "5"; +acceleration = "5"; +times[0] = "0"; +times[1] = "0.25"; +times[2] = "0.9"; +times[3] = "1"; +colors[0] = "1.000000 0.600000 0.200000 1.000000"; //1.0 0.9 0.9 +colors[1] = "1.000000 0.600000 0.200000 1.000000"; //0.6 0.6 0.6 +colors[2] = "1.000000 0.600000 0.200000 1.000000"; //0.6 0.6 0.6 +colors[3] = "1.000000 0.600000 0.200000 0.000000"; +texture[0] = "terraintiles/molten1"; +texture[1] = "special/shockwave4"; //gradient"; +texWrap = "1"; +is2D = "0"; +mapToTerrain = "0"; +orientToNormal = "1"; +renderBottom = "1"; +renderSquare = "0"; +}; + +//Emitters + +datablock ParticleData(RepairWave_P) +{ +dragCoeffiecient = 0.0; +gravityCoefficient = 0.0; +inheritedVelFactor = 0.0; + +lifetimeMS = 10000; +lifetimeVarianceMS = 0; +constantAcceleration = 0.1; + +spinRandomMin = -30.0; +spinRandomMax = 30.0; +windcoefficient = 0; +textureName = "special/redflare"; + +colors[0] = "1 0.2 0.2 1"; +colors[1] = "1 0.2 0.2 1"; +colors[2] = "1 0.2 0.2 1"; +colors[3] = "1 0.2 0.2 0"; + +sizes[0] = 1; +sizes[1] = 2; +sizes[2] = 4; +sizes[3] = 5; + +times[0] = "0"; +times[1] = "0.25"; +times[2] = "0.9"; +times[3] = "1"; + +}; + +datablock ParticleData(CloakWave_P):RepairWave_P +{ +textureName = "flarebase"; +constantAcceleration = 0.1; +colors[0] = "1 1 1 1"; +colors[1] = "1 1 1 1"; +colors[2] = "1 1 1 1"; +colors[3] = "1 1 1 0"; +}; + +datablock ParticleData(DISWave_P):RepairWave_P +{ +textureName = "flarebase"; +constantAcceleration = 0.1; +colors[0] = "0.2 0.2 1 1"; +colors[1] = "0.2 0.2 1 1"; +colors[2] = "0.2 0.2 1 1"; +colors[3] = "0.2 0.2 1 0"; +}; + +datablock ParticleData(ESPWave_P):RepairWave_P +{ +textureName = "flarebase"; +constantAcceleration = 0.1; +colors[0] = "0.8 0.2 1 1"; +colors[1] = "0.8 0.2 1 1"; +colors[2] = "0.8 0.2 1 1"; +colors[3] = "0.8 0.2 1 0"; +}; + +datablock ParticleData(MORWave_P):RepairWave_P +{ +textureName = "flarebase"; +constantAcceleration = 0.1; +colors[0] = "0.8 1 0.2 1"; +colors[1] = "0.8 1 0.2 1"; +colors[2] = "0.8 1 0.2 1"; +colors[3] = "0.8 1 0.2 0"; +}; + +datablock ParticleEmitterData(RepairWave_E) +{ +lifetimeMS = 1000; +ejectionPeriodMS = 1; +periodVarianceMS = 0; + +ejectionVelocity = 10; +velocityVariance = 0; +ejectionoffset = 5; +thetaMin = 0.0; +thetaMax = 180.0; + +phiReferenceVel = "0"; +phiVariance = "360"; +orientParticles = false; +orientOnVelocity = false; + +particles = "RepairWave_P"; +}; + +datablock ParticleEmitterData(CLOAKWave_E):RepairWave_E +{ +lifetimeMS = 1000; +ejectionPeriodMS = 1; +ejectionVelocity = 10; +ejectionoffset = 5; +velocityVariance = 0; +particles = "CloakWave_P"; +thetaMin = 0.0; +thetaMax = 180.0; + +phiReferenceVel = "0"; +phiVariance = "360"; +}; + +datablock ParticleEmitterData(DISWave_E):RepairWave_E +{ +lifetimeMS = 1000; +ejectionPeriodMS = 1; +ejectionVelocity = 10; +ejectionoffset = 5; +velocityVariance = 0; +particles = "DISWave_P"; +thetaMin = 0.0; +thetaMax = 180.0; + +phiReferenceVel = "0"; +phiVariance = "360"; +}; + + +datablock ParticleEmitterData(ESPWave_E):RepairWave_E +{ +lifetimeMS = 1000; +ejectionPeriodMS = 1; +ejectionVelocity = 10; +velocityVariance = 0; +ejectionoffset = 5; +particles = "ESPWave_P"; +thetaMin = 0.0; +thetaMax = 180.0; + +phiReferenceVel = "0"; +phiVariance = "360"; +}; + + +datablock ParticleEmitterData(MORWave_E):RepairWave_E +{ +lifetimeMS = 1000; +ejectionPeriodMS = 1; +ejectionVelocity = 10; +velocityVariance = 0; +ejectionoffset = 5; +particles = "MORWave_P"; +thetaMin = 0.0; +thetaMax = 180.0; + +phiReferenceVel = "0"; +phiVariance = "360"; +}; + + +datablock ExplosionData(RepairPulseExplosion):BaseExplosion //From blast.cs +{ +emitter[0] = "RepairWave_E"; +Shockwave = "RepairWave"; +}; + + +datablock ExplosionData(CloakPulseExplosion):BaseExplosion //From blast.cs +{ +emitter[0] = "CloakWave_E"; +Shockwave = "CloakWave"; +}; + +datablock ExplosionData(DisPulseExplosion):BaseExplosion //From blast.cs +{ +emitter[0] = "DISWave_E"; +Shockwave = "DisWave"; +}; + +datablock ExplosionData(ESPPulseExplosion):BaseExplosion //From blast.cs +{ +emitter[0] = "ESPWave_E"; +Shockwave = "ESPWave"; +}; + +datablock ExplosionData(KillPulseExplosion):BaseExplosion //From blast.cs +{ +emitter[0] = "ESPWave_E"; +Shockwave = "KillWave"; +}; + +datablock ExplosionData(MORPulseExplosion):BaseExplosion //From blast.cs +{ +emitter[0] = "MORWave_E"; +Shockwave = "MORWave"; +}; + +datablock TracerProjectileData(RepairPulseProjectile):BaseProjectile +{ +Explosion = "RepairPulseExplosion"; +}; + +datablock TracerProjectileData(CloakPulseProjectile):BaseProjectile +{ +Explosion = "CloakPulseExplosion"; +}; + +datablock TracerProjectileData(DisPulseProjectile):BaseProjectile +{ +Explosion = "DisPulseExplosion"; +}; + +datablock TracerProjectileData(ESPPulseProjectile):BaseProjectile +{ +Explosion = "ESPPulseExplosion"; +}; +datablock TracerProjectileData(KillPulseProjectile):BaseProjectile +{ +Explosion = "KillPulseExplosion"; +}; + + +datablock TracerProjectileData(MORPulseProjectile):BaseProjectile +{ +Explosion = "MORPulseExplosion"; +}; + +function Aidpulse(%pos,%owner,%type,%nrm) +{ +schedule(200,0,"Serverplay3D",FlashGrenadeExplosionSound,%pos); +%types = "RepairPulseProjectile CloakPulseProjectile DisPulseProjectile ESPPulseProjectile MORPulseProjectile KillPulseProjectile"; +%proj = GetWord(%types,%type); +%nrm = !%nrm ? "0 0 -1" : %nrm; +shockwave(%pos,%nrm,%proj); +%waveblock = %proj.explosion.shockwave; +%accel = %waveblock.acceleration; //accel of wave +%speed = %waveblock.velocity; //speed of wave +%mtime = %waveblock.lifetimeMS/1000; //time the wave lasts +%lastdist = 0; +%checks = %mtime/2; //2 per second +AidPulseWaved(%pos,%mtime,%speed,%accel,%waveblock,%owner); +Cancel(%owner.resetmorphsch); +%owner.resetmorphsch = Schedule(%mtime*1000+5000,%owner,"resetmorphsize",%owner); +for (%i = 1;%i<20;%i++) +{ +%time = %i/2; +%dist = %time*%speed+1/2 * mPow(%time,2)*%accel+10; +schedule(%time*1000,0,"AidpulseWaver",%pos,%dist,%lastdist-2,%waveblock,%owner); +%lastdist = %dist; +} +} + + + +function solveadist(%accel,%speed,%dist) +{ +%awn = mSolveQuadratic(%accel/2,%speed,-1*%dist); +if (getWord(%awn,0) <0 || getWord(%awn,1) > 0) +return 0; +else +return -1*getWord(%awn,1); +} + +function AidPulseWaved(%pos,%time,%speed,%accel,%wave,%owner) +{ +%area = %time*%speed+1/2 * mPow(%time,2)*%accel+10; + +InitContainerRadiusSearch(%pos, %area, $TypeMasks::StaticShapeObjectType | $TypeMasks::ForceFieldObjectType ); + + +while ((%targetObject = containerSearchNext()) != 0) +{ +%dist = containerSearchCurrRadDamageDist(); +%ttime = solveadist(%accel,%speed,%dist-10); +if (%ttime != 0 || %ttime < %time) +%wave.schedule(%ttime*1000,"AidEffect",%targetobject,%owner,%pos); +} +} + +function AidpulseWaver(%pos,%area,%lastar,%wave,%owner) +{ + +InitContainerRadiusSearch(%pos, %area, $TypeMasks::VehicleObjectType | $TypeMasks::PlayerObjectType |$TypeMasks::ItemObjectType | $TypeMasks::CorpseObjectType ); + + +while ((%targetObject = containerSearchNext()) != 0) +{ +%dist = containerSearchCurrRadDamageDist(); + +if (%dist > %area || %dist < %lastar) +continue; + +%wave.AidEffect(%targetobject,%owner,%pos); +} + +} + +function RepairWave::AidEffect(%block,%obj,%owner,%pos) { + if (!isObject(%obj) || %obj.isforceField()) + return ""; + // + if(%obj.isPlayer()) { + if(%obj.getState() $= "dead") { + return; + } + } + %obj.playShieldEffect("1 1 1"); + %obj.setDamageLevel(0); +} + +function KillWave::AidEffect(%block,%obj,%owner,%pos) { + if (!isObject(%obj) || %obj.isforceField() || %obj.isBoss) + return ""; + %obj.playShieldEffect("1 1 1"); + %obj.setInvinc(false); + %obj.damage(%owner, %obj.getposition(), 9999, $DamageType::FissionBomb); +} + +function CloakWave::AidEffect(%block,%obj,%owner,%pos) +{ +if (!isObject(%obj) || %obj.isforceField()) +return ""; +Cancel(%obj.uncloaksch); +%obj.setCloaked(True); +%obj.uncloaksch = %obj.schedule(60000,"setCloaked",False); +} + +function DisWave::AidEffect(%block,%obj,%owner,%Pos) +{ + +if (%obj.isRemoved || !isObject(%owner) || !isObject(%obj)) +return; +%dataBlockName = %obj.getDataBlock().getName(); +if (%dataBlockName $= "StationInventory" || +%dataBlockName $= "GeneratorLarge" || +%dataBlockName $= "SolarPanel" || +%dataBlockName $= "SensorMediumPulse" || +%dataBlockName $= "SensorLargePulse") +if (%obj.deployed != true) +return; +if ($reverseDeployItem[%obj.getDataBlock().getName()] $= "") +return; +if (%obj.team != %owner.team && +!(%owner.isAdmin || %owner.isSuperAdmin)) +return; +if ($Host::OnlyOwnerCascade == 1 && +%obj.getOwner() != %owner && +!(%owner.isAdmin || %owner.isSuperAdmin)) +return; + +%obj.getDataBlock().disassemble(%owner, %obj); // Run Item Specific code. + +} + +function ESPWave::AidEffect(%block,%obj,%owner,%pos) +{ +if (!isObject(%obj)) +return ""; +%hadsch = %obj.uncloacksch ? 1 : 0; +Cancel(%obj.uncloaksch); +if (!%obj.isforcefield()) +%obj.setCloaked(FALSE); +Cancel(%obj.unemplockschd); +if (%obj.isVehicle()) +vehemplock(%obj); +else if (%obj.isPlayer()) +PlayerEmpLock(%obj); +else if (%obj.getDatablock().maxEnergy !$= "") +{ +if (%obj.getDataBlock().className $= "Generator" && %obj.lastState) +{ +if (!%hadsch) +toggleGenerator(%obj,0); +%obj.unemplockschd = schedule(30000,%obj," toggleGenerator",%obj,0); +} +%obj.setEnergyLevel(0); +} +} + +function MORWave::AidEffect(%block,%obj,%owner,%pos) +{ +if (%obj.isRemoved || +!isObject(%owner) || +!isObject(%obj) || +%obj.isPLayer() || +%obj.isVehicle()) +return; +if (!(deployables.isMember(%obj))) +return; +%dataBlockName = %obj.getDataBlock().getName(); +if (%dataBlockName $= "StationInventory" || +%dataBlockName $= "GeneratorLarge" || +%dataBlockName $= "SolarPanel" || +%dataBlockName $= "SensorMediumPulse" || +%dataBlockName $= "SensorLargePulse") +if (%obj.deployed != true) +return; + +if (%obj.team != %owner.team && +!(%owner.isAdmin || %owner.isSuperAdmin)) +return; +if ($Host::OnlyOwnerCascade == 1 && +%obj.getOwner() != %owner && +!(%owner.isAdmin || %owner.isSuperAdmin)) +return; + +Cancel(%obj.unmorphsch); +%obj.unmorphsch = Schedule(30000,%obj,"ResetMorphObject",%obj); +if (%obj.morphed) +return; + +%obj.oldcenter = %obj.getEdge("0 0 0"); +%obj.oldrealsize = %obj.getrealSize(); +%obj.morphed = 1; + +%size = %owner.morphpulsesize ? %owner.morphpulsesize : 0.1; +%scale = VectorScale("1 1 1",%size); +%offset = VectorMultiply(VectorSub(%obj.getEdge("0 0 0"),%pos),%scale); +%obj.setRealSize(VectorMultiply(%obj.getRealSize(),%scale)); +%obj.setEdge(VectorAdd(%pos,%offset),"0 0 0"); +if (!%obj.isforcefield()) +%obj.startfade(500,0,0); +if (isObject(%obj.pzone)) +{ +%obj.pzone.setScale(%Obj.getScale); +%obj.pzone.setTransform(%obj.getTransform()); +} +if (isObject(%obj.emitter)) +{ +%obj.emitter.oldsize = %obj.getScale(); +%obj.emitter.setScale(VectorScale(%obj.emitter.getScale(),%size)); +%obj.emitter.setTransform(%obj.getTransform()); +} +if (isObject(%obj.trigger)) +{ +%obj.trigger.oldsize = %obj.getScale(); +%obj.trigger.setScale(VectorScale(%obj.trigger.getScale(),%size)); +%obj.trigger.setTransform(%obj.getTransform()); +} +} + +//ESP functions + +function vehemplock(%vehicle) +{ +Cancel(%vehicle.unemplockschd); +Cancel(%vehicle.lockff.unemplockschd); +%vehicle.setFrozenState(true); +%vehicle.zapObject(); +forceFieldLock(%vehicle); +%vehicle.unemplockschd = Schedule(30000,%vehicle,"vehUnEmpLock",%vehicle); +%vehicle.lockff.unemplockschd = %vehicle.lockff.Schedule(30000,"delete"); +} + +function vehUnEmpLock(%vehicle) +{ +Cancel(%vehicle.unemplockschd); +Cancel(%vehicle.lockff.unemplockschd); +%vehicle.lockff.delete(); +%vehicle.setFrozenState(false); +} + +function PlayerEmpLock(%player) { +Cancel(%player.unemplockschd); +Cancel(%player.lockff.unemplockschd); +Cancel(%player.lock.unemplockschd); +if (!%player.isemped) { + %lock = new StaticShape() { + dataBlock = SelectionPad; + scale = "0.01 0.01 0.01"; + }; +%lock.startFade(0,0,1); +%vec = VectorNormalize(%player.getVelocity()); +%vec = (VectorLen(%vec)>0.1) ? %vec : "0 0 1"; +%center = %player.getEdge("0 0 0"); +%rot = fullrot(%vec,VectorCross(%player.getEyeVector(),%vec)); +%player.setTransform(%player.getEdge("0 0 -1") SPC %rot); +%player.setEdge(%center,"0 0 0"); +%lock.setTransform(getWords(%player.getTransform(),0,2) SPC %rot); +%lock.mountObject(%player,0); +%lock.player = %player; +%player.emplock = %lock; +%player.isemped = 1; +%player.zapObject(); +%ff = forceFieldLock(%player); +} +%player.unemplockschd = Schedule(30000,%player,"PlayerUnEmpLock",%player); +if (isObject(%player.lock)) +%player.lock.unemplockschd = %player.lock.Schedule(30000,"delete"); +if (isObject(%player.lockff)) +%player.lockff.unemplockschd = %player.lockff.Schedule(30000,"delete"); +if(!isObject(%ff)) { + return ""; +} +return %ff; +} + +function PlayerUnEmpLock(%player) +{ +%player.isemped = 0; +Cancel(%player.unemplockschd); +Cancel(%player.lockff.unemplockschd); +Cancel(%player.lock.unemplockschd); +%player.lockff.delete(); +%player.unMount(); +if (isObject(%player.emplock)) +%player.emplock.delete(); +} + +function forceFieldLock(%obj) { +if (!isObject(%obj.lockff)) { +%ff = new ForceFieldBare() { +dataBlock = DeployedForceField5; +scale = "1 1 1"; +}; +%ff.noSlow = true; +// Eolk - needed a fix here to prevent console spam... +if(isObject(%ff.pzone)) +%ff.pzone.delete(); + +%ff.pzone = ""; +%obj.lockff = %ff; +%ff.obj = %obj; +%ff.setScale(%obj.getRealSize()); +%ff.setTransform(%obj.getEdge("-1 -1 -1") SPC %Obj.getRotation()); +return %ff; +} +} + +//Morph functions + +function ResetMorphObject(%obj) +{ +Cancel(%obj.unmorphsch); +if (!%obj.isforcefield()) +%obj.startfade(500,0,0); +%obj.setRealSize(%obj.oldrealsize); +%obj.setEdge(%obj.oldcenter,"0 0 0"); +if (isObject(%obj.pzone)) +{ +%obj.pzone.setScale(%Obj.getScale); +%obj.pzone.setTransform(%obj.getTransform()); +} +if (isObject(%obj.emitter)) +{ +%obj.emitter.setTransform(%obj.getTransform()); +%obj.emitter.setScale(%obj.trigger.oldsize); +} +if (isObject(%obj.trigger)) +{ +%obj.trigger.setTransform(%obj.getTransform()); +%obj.trigger.setScale(%obj.trigger.oldsize); +} +%obj.oldrealsize = ""; +%obj.oldcenter = ""; +%obj.morphed = ""; +} + +function resetmorphsize(%owner) +{ +%size = (getRandom()*0.9+0.1); +%dir = (Getrandom()*2 > 1); +%owner.morphpulsesize = %dir ? %size : 1+%size+getRandom()*3; +} + diff --git a/scripts/TWM2/LoadMod.cs b/scripts/TWM2/LoadMod.cs new file mode 100644 index 0000000..8440c55 --- /dev/null +++ b/scripts/TWM2/LoadMod.cs @@ -0,0 +1,155 @@ +// TWM 2, Mod Load Script, Place any Scripts To Be Executed In Here + +Error("********************************************"); +Error("********************************************"); +Error("******** EXECUTING TWM2 MOD SCRIPTS ********"); +Error("********************************************"); +Error("********************************************"); + //Mod Systems +exec("serverControl.cs"); //Server Settings + +exec("scripts/TWM2/Systems/Directorate.cs"); //Client Container Objects +exec("scripts/TWM2/Systems/AdvancedRankSystem.cs"); //Adv. Ranks +exec("scripts/TWM2/Systems/MainControl.cs"); //TWM2 Core Functions +exec("scripts/TWM2/Systems/Scoremenucmds.cs"); //Score Menu +exec("scripts/TWM2/Systems/BossSystem.cs"); //Bosses +exec("scripts/TWM2/Systems/Medals.cs"); //Medals +exec("scripts/TWM2/Systems/NewsPanel.cs"); //Scoremenu News Page +exec("scripts/TWM2/Systems/Perks.cs"); //Special Perks +exec("scripts/TWM2/Systems/WeaponChallenges.cs"); //Weapon Challenges +exec("scripts/TWM2/Systems/NWChallengeIndex.cs"); //Non-Weapon Challenges +exec("scripts/TWM2/Systems/ClientSettings.cs"); //Save Client Settings +exec("scripts/TWM2/Systems/ChatLog.cs"); //Chat / Connection Logging +exec("scripts/TWM2/Systems/ChatBot.cs"); //Chat Monitoring/Commands +exec("scripts/TWM2/Systems/Weather.cs"); //Weather functions +exec("scripts/TWM2/Systems/Keystrokes.cs"); //Insert/Delete functions +exec("scripts/TWM2/Systems/Killstreak.cs"); //Killstreak Superweapons +exec("scripts/TWM2/Missions/MissionCore.cs"); //Missions +exec("scripts/TWM2/Systems/ScoreHudInventory.cs"); //F2 Inventory +exec("scripts/TWM2/Systems/Scoremenucmds.cs"); //Score Menu load again to update the inv. changes +exec("scripts/TWM2/Systems/SuccessiveKills.cs"); //Successive Kills +exec("scripts/TWM2/Systems/PieceData.cs"); //Piece Data, /undo Command +exec("scripts/TWM2/Systems/DChalg.cs"); //Daily Challenges +exec("scripts/TWM2/Systems/ArmorEnergyShields.cs"); //Armor Shields +exec("scripts/TWM2/Systems/Store.cs"); //Mula + +exec("scripts/TWM2/AI/DroneAI.cs"); //Drones + +exec("scripts/TWM2/Objects/MissileSatellite.cs"); //Missile Satellite +exec("scripts/TWM2/Objects/MedalSeal.cs"); +exec("scripts/TWM2/Systems/HarbingersWrath.cs"); //Harbinger's Wrath + + //Mod Dependancies + +exec("scripts/TWM2/loadmenu.cs"); //loadscreen +exec("scripts/TWM2/WeaponFunctions.cs"); //TWM2 Weapon Functions +exec("scripts/TWM2/Zombie/LoadZombieScripts.cs"); //TWM2 Zombie Script Load +exec("scripts/TWM2/Soldier/LoadSoldierScripts.cs");//TWM2 Soldier Script Load +exec("scripts/TWM2/CustomCamera.cs"); //TWM2 Cameras +exec("scripts/TWM2/CustomArmors.cs"); //TWM2 Armors +exec("scripts/TWM2/ArmorFunctions.cs"); //TWM2 Armors Functions +exec("scripts/TWM2/VehicleReticles.cs"); //Vehicle Reticles + + //Universal Systems +exec("scripts/TWM2/PGDConnect/ConnectionQueue.cs"); //TCP Connection List +exec("scripts/TWM2/PGDConnect/UniversalSupport.cs"); //Support Script +exec("scripts/TWM2/PGDConnect/UniversalSaving_Client.cs");//Saver +exec("scripts/TWM2/PGDConnect/UniversalLoading.cs"); //Loading +exec("scripts/TWM2/PGDConnect/UniversalRanks.cs"); //Ranks +exec("scripts/TWM2/PGDConnect/ServerInteraction.cs"); //Server Connection + +schedule(1000, 0, "CheckCore"); + + //Exterior Functioning + +exec("scripts/TWM2/ExteriorFunctioning/PulseStuff.cs"); //Aid Pulses +exec("scripts/TWM2/ExteriorFunctioning/killTrigger.cs"); //TWM2 Kill Trigger +exec("scripts/TWM2/ExteriorFunctioning/BloodEffects.cs");//TWM2 Gore Mod +exec("scripts/TWM2/ExteriorFunctioning/ProtPatch.cs"); //Alv's CCM Patch +exec("scripts/TWM2/ExteriorFunctioning/PConFunctions.cs");//P-Con Functions 1.7 +exec("scripts/TWM2/ExteriorFunctioning/ArmorDamageEffects.cs");//Loop Damages + + //Chat Commands + +exec("scripts/TWM2/ChatCommands/Public.cs"); //Public CCs +exec("scripts/TWM2/ChatCommands/Admin.cs"); //Admin CCs +exec("scripts/TWM2/ChatCommands/Zombie.cs"); //Zombie CCs +exec("scripts/TWM2/ChatCommands/SuperAdmin.cs"); //SuperAdmin CCs +exec("scripts/TWM2/ChatCommands/DevAndHost.cs"); //Dev/Host CCs + + //Server Dependancies +LoadRanksBase(); //Load Ranks +DownloadNewsPage(); //Load News Page + + //Weapons +exec("scripts/weapons/Pistols/Colt.cs"); //Colt Pistol +exec("scripts/weapons/Melee/melee.cs"); //Gun Blade +exec("scripts/weapons/Rifles/S3.cs"); //S3 Combat Rifle +exec("scripts/weapons/Equipment/C4.cs"); //C4 Mines +exec("scripts/weapons/Shotguns/M1700.cs"); //M1700 Shotgun +exec("scripts/weapons/Rifles/G41.cs"); //G41 Semi Auto Rifle +exec("scripts/weapons/Rifles/R700Sniper.cs"); //R700 Sniper Rifle +exec("scripts/weapons/SMGs/MP26.cs"); //MP26 SMG +exec("scripts/weapons/SMGs/Pg700.cs"); //Pg700 SMG +exec("scripts/weapons/Equipment/SWBeaconer.cs"); //Killstreak Superweapon Datablocks +exec("scripts/weapons/Rifles/M1Sniper.cs"); //M1 Sniper Rifle +exec("scripts/weapons/MGs/RP432.cs"); //RP432 Machine Gun +exec("scripts/weapons/Shotguns/Wp400.cs"); //Wp400 Shotgun +reload("scripts/weapons/SMGs/chaingun.cs"); //Mini Chaingun +exec("scripts/weapons/Rifles/RSALaserRifle.cs"); //RSA Laser Rifle +exec("scripts/weapons/Equipment/RPG7.cs"); //RPG-7 +exec("scripts/weapons/Melee/BOV.cs"); //Blade Of Vengeance +exec("scripts/weapons/Construction/EditGun.cs"); //Manipulator Tool +exec("scripts/weapons/Pistols/PulsePhaser.cs"); //ES-77 Pulse Phaser +exec("scripts/weapons/Pistols/LD06Savager.cs"); //LD06 Savager +exec("scripts/weapons/Other/IonLauncher.cs"); //LUX-4 Ion Launcher +exec("scripts/weapons/Other/IonRifle.cs"); //LUST Ion Rifle +reload("scripts/weapons/T2Guns/Shocklance.cs"); //Shocklance & Shock Projs +exec("scripts/weapons/MGs/MG42.cs"); //MG42 Machine Gun +exec("scripts/weapons/Other/Flamethrower.cs"); //A|V|X Flamethrower +exec("scripts/weapons/Grenades/staticGrenade.cs"); //Static Grenade +exec("scripts/weapons/Rifles/G17Sniper.cs"); //G17 Sniper Rifle +exec("scripts/weapons/Other/ConcussionGun.cs"); //Concussion Gun +exec("scripts/weapons/Other/ShadowRifle.cs"); //Shadow Rifle +exec("scripts/weapons/Pistols/GrappleHook.cs"); //NeX 4 Grapple Hook +exec("scripts/weapons/Other/MiniCollider.cs"); //PRTCL-995 MCC +exec("scripts/weapons/Rifles/S3S.cs"); //S3-S Combat Rifle +exec("scripts/weapons/SMGs/MP26CMDO.cs"); //MP26-CMDO SMG +exec("scripts/weapons/Melee/Plasmasabre.cs"); //Plasma Saber +exec("scripts/weapons/Shotguns/SA2400.cs"); //SA2400 Shotgun +exec("scripts/weapons/Pistols/DesertEagle.cs"); //Desert Eagle +exec("scripts/weapons/Equipment/Javelin.cs"); //Javelin +exec("scripts/weapons/Shotguns/SCD343.cs"); //SCD343 Shotgun +exec("scripts/weapons/Rifles/M4A1.cs"); //M4A1 Assault Rifle +exec("scripts/weapons/Rifles/PulseRifle.cs"); //Pulse Rifle +exec("scripts/weapons/SMGs/PulseSMG.cs"); //Pulse SMG +exec("scripts/weapons/SMGs/P90.cs"); //P90 SMG +exec("scripts/weapons/Rifles/ALSWPSniper.cs"); //ALSWP Sniper Rifle +exec("scripts/weapons/Other/PlasmaTorpedo.cs"); //Plasma Torpedo Cannon +exec("scripts/weapons/Pistols/M93.cs"); //M93 Pistol +exec("scripts/weapons/Pistols/CrimsonHawk.cs"); //Crimson Hawk Pistol +exec("scripts/weapons/Equipment/Stinger.cs"); //Stinger +exec("scripts/weapons/MGs/MRXX.cs"); //MRXX ZC4 Machine Gun +exec("scripts/weapons/Shotguns/Model1887.cs"); //Model 1887 Shotgun +exec("scripts/weapons/Other/AcidCannon.cs"); //Zombie Lord/Demon Lord Acid Cannon +exec("scripts/weapons/Other/NapalmLauncher.cs"); //ZH7C8 Napalm Launcher +exec("scripts/weapons/Construction/RCMissile.cs"); //RC Launcher + +BuildDeconList(); //build decon. list (con tool) + +exec("scripts/TWM2/Bosses/LordVardison.cs"); //load him last + +error("Loading custom scripts"); +exec("scripts/Customize/CustomScripts.cs"); + +schedule(5500, 0, "establishPGDConnection"); + +cleanChallenges(); +$ChallengeIndex = 0; +schedule(7000, 0, "downloadChallenges"); + +Error("********************************************"); +Error("********************************************"); +Error("************* EXECUTE COMPLETE *************"); +Error("********************************************"); +Error("********************************************"); diff --git a/scripts/TWM2/Missions/EnemyAc130Above.cs b/scripts/TWM2/Missions/EnemyAc130Above.cs new file mode 100644 index 0000000..63a6419 --- /dev/null +++ b/scripts/TWM2/Missions/EnemyAc130Above.cs @@ -0,0 +1,217 @@ +package TWM2Mission_EnemyAc130Above { + function TWM2MissionClass::initiateSettings(%group) { + %group.commandName = "Command"; + %group.failMessage = "Your squad has been eliminated, mission failed"; + %group.BonusCompleteMessage = "Excellent work soldiers, you showed those assholes who's in charge!"; + %group.CompleteMessageNoTime = "The enemy AC-130 has been neutralized, good job. return to base."; + %group.bonusEXP = 2500; + %group.completionEXP = 2000; + } + + function TWM2MissionClass::OnTimeZero(%group) { + %group.MessageMissionGroup("\c5"@%group.commandName@": The enemy AC-130 is leaving the area, mission acomplished"); + //%group.AddMissionTime(10); + for(%i = 1; %i <= %group.participants; %i++) { + %spF = game.pickPlayerSpawn( %group.participant[%i], false ); + %group.participant[%i].player.setPosition(%spF); + + AwardClient(%group.participant[%i], 33); + } + + %group.CompleteMission(); + } + + function TWM2MissionClass::StartTWM2Mis(%group) { + %missionPosCenter = "8000 9000 105"; + //Spawn the building + + // + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8036.76 9462.89 100.25";rotation = "0.66138 0.353776 0.661377 141.035";scale = "0.125 0.166666 32";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8047.85 9465.1 100";rotation = "4.7988e-06 -4.11945e-06 1 213.714";scale = "3.8739 4.99873 1";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8045.71 9475.85 100.25";rotation = "-0.797515 -0.426599 -0.426594 102.854";scale = "0.125 0.166666 32";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8037.11 9462.96 100.25";rotation = "-0.797515 -0.426599 -0.426594 102.854";scale = "0.125 0.166666 32";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8058.67 9466.9 100.25";rotation = "-0.919162 0.278512 0.278519 94.824";scale = "0.125 0.166666 29.9826";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8063.25 9474.5 100.5";rotation = "0 0 1 211.042";scale = "3.992 0.166666 16";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DispenserDep";position = "8066.11 9475.42 100.5";rotation = "0 0 -1 5.85046";scale = "1.5 1.5 0.5";team = "1";ownerGUID = "2000343";powerFreq = "1";set1 = "6";set2 = "8";packBlock = "StingerAmmo";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();schedule(100, 0, "respawnpack", %building); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8056.73 9478.72 106.048";rotation = "0.656598 0.371165 0.656594 139.273";scale = "0.976 0.166666 30.0194";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8061.15 9486 104.096";rotation = "0.870536 0.492104 6.23787e-07 180";scale = "3.24015 0.166666 7.192";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DispenserDep";position = "8067.37 9474.22 100.5";rotation = "0 0 -1 6.42179";scale = "1.5 1.5 0.5";team = "1";ownerGUID = "2000343";powerFreq = "1";set1 = "6";set2 = "7";packBlock = "Stinger";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();schedule(100, 0, "respawnpack", %building); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8063.32 9474.19 100.25";rotation = "0.192695 0.693856 0.693853 201.814";scale = "4.12805 0.166666 32.0056";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8063.38 9474.72 108.25";rotation = "0.656598 0.371165 0.656594 139.273";scale = "0.125 5.3325 30.0194";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "SolarPanel";position = "8071.83 9473.28 105.04";rotation = "-0.371166 0.656597 0.656594 139.273";scale = "1 1 1";team = "1";ownerGUID = "2000343";deployed = "1";powerFreq = "1";};setTargetSensorGroup(%building.getTarget(),1);TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.setSelfPowered();setTargetName(%building.target,addTaggedString("[ON]  Frequency" SPC %obj.powerFreq));%building.playThread($AmbientThread,"ambient"); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8018.66 9479.12 100.5";rotation = "0 0 1 123.326";scale = "0.125 0.166666 20";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8064.61 9491.78 100.5";rotation = "0 0 1 211.042";scale = "0.125 0.166666 16";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8065.9 9491 108";rotation = "0.26759 0.963533 1.22137e-06 180";scale = "0.62472 0.166666 6.1";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8074.3 9476.9 100.5";rotation = "0 0 -1 58.9579";scale = "3.9981 0.166666 16";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8070.25 9488.4 104.45";rotation = "0.26759 0.963533 1.22137e-06 180";scale = "3.16162 0.166666 7.9";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedDecoration9";position = "8055.02 9500.28 100";rotation = "0 0 1 212.035";scale = "1 1 1";team = "1";ownerGUID = "2000343";needsfit = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8014.06 9472.58 102.289";rotation = "-0.795143 -0.428806 -0.428804 103.02";scale = "3.86835 1.19267 1";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8078.1 9483.66 104.7";rotation = "0.258497 0.930784 0.258496 94.1066";scale = "0.125 0.166666 30.9974";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8018.52 9478.91 104.328";rotation = "-0.428806 0.795143 -0.428804 103.021";scale = "0.125 0.166666 30.9468";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8018.5 9478.92 105.191";rotation = "-0.428806 0.795143 -0.428804 103.021";scale = "0.30676 0.166666 30.9468";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8018.5 9478.92 107.445";rotation = "-0.428806 0.795143 -0.428804 103.021";scale = "0.247501 0.166666 30.9468";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8078.1 9483.66 108.25";rotation = "0.258497 0.930784 0.258496 94.1066";scale = "0.125 0.166666 30.9974";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8018.52 9478.91 108.19";rotation = "-0.428806 0.795143 -0.428804 103.021";scale = "0.125 0.166666 30.9468";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8018.5 9478.92 109.47";rotation = "-0.428806 0.795143 -0.428804 103.021";scale = "0.515005 0.166666 30.9468";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8074.85 9485.6 108";rotation = "0.26759 0.963533 1.22137e-06 180";scale = "1.89069 0.166666 6.1";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedDecoration8";position = "8062 9501.65 100";rotation = "0 0 1 122.683";scale = "1 1 1";team = "1";ownerGUID = "2000343";needsfit = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8018.45 9479.26 104.338";rotation = "0.275632 0.920899 0.275631 94.7162";scale = "0.125 0.166666 29.966";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8018.46 9479.28 105.164";rotation = "0.275632 0.920899 0.275631 94.7162";scale = "0.28801 0.166666 29.966";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedDecoration6";position = "8057.43 9504.67 100";rotation = "0 0 1 212.667";scale = "1 1 1";team = "1";ownerGUID = "2000343";needsfit = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DispenserDep";position = "8057.43 9504.67 103.3";rotation = "0 0 1 218.336";scale = "1.5 1.5 0.5";team = "1";ownerGUID = "2000343";powerFreq = "1";set1 = "7";set2 = "8";packBlock = "JavelinAmmo";};%building.setCloaked(true);TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();schedule(100, 0, "respawnpack", %building); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8018.46 9479.28 107.492";rotation = "0.275632 0.920899 0.275631 94.7162";scale = "0.250012 0.166666 29.966";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8018.45 9479.26 108.168";rotation = "0.275632 0.920899 0.275631 94.7162";scale = "0.125 0.166666 29.966";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8009.88 9465.77 100.5";rotation = "0 0 1 123.326";scale = "0.125 0.166666 20";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8018.46 9479.28 109.459";rotation = "0.275632 0.920899 0.275631 94.7162";scale = "0.520505 0.166666 29.966";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedDecoration7";position = "8053.24 9506.69 100";rotation = "0 0 -1 87.9301";scale = "1 1 1";team = "1";ownerGUID = "2000343";needsfit = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8010.9 9484.2 104.088";rotation = "0.286739 0.958009 1.21436e-06 180";scale = "2.9892 0.166666 7.176";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8038.76 9507.65 100.5";rotation = "0 0 1 118.629";scale = "0.125 0.166666 8";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8002.34 9482.02 104.308";rotation = "-0.795142 -0.428807 -0.428806 103.02";scale = "3.16805 0.166666 29.966";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8013.1 9482.46 108.168";rotation = "0.207056 0.691784 -0.691782 156.604";scale = "3.1244 0.166666 30.9484";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8014.48 9472.31 100.25";rotation = "-0.356303 0.660697 0.660702 140.777";scale = "4.11938 0.166666 31.9628";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8005.95 9468.65 100.751";rotation = "0.207055 0.691782 0.691785 203.397";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8005.59 9468.89 101.282";rotation = "0.207055 0.691782 0.691785 203.397";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8040.21 9510.3 100.5";rotation = "0 0 1 118.629";scale = "0.125 0.166666 7";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8035.37 9509.78 102.25";rotation = "-0.940626 0.240021 0.240026 93.5044";scale = "1.87402 1.16667 1";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8005.12 9469.2 101.766";rotation = "0.207055 0.691782 0.691785 203.397";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8038.54 9507.77 100.25";rotation = "-0.386926 0.65203 0.652032 137.695";scale = "0.125 0.166666 16";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8038.54 9507.77 104.25";rotation = "0.240018 0.940629 0.240018 93.505";scale = "0.125 0.166666 14.9922";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8042.47 9514.45 100.25";rotation = "-0.454554 0.766004 -0.454553 105.096";scale = "0.125 0.166666 16";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8004.81 9469.4 102.287";rotation = "0.207055 0.691782 0.691785 203.397";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8038.88 9507.87 104.25";rotation = "0.652032 0.386924 0.65203 137.695";scale = "0.125 0.166666 13.9883";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8004.55 9469.57 102.86";rotation = "0.207055 0.691782 0.691785 203.397";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8004.14 9469.84 103.319";rotation = "0.207055 0.691782 0.691785 203.397";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8032.61 9512.55 104.25";rotation = "-0.386919 0.652033 -0.652033 222.306";scale = "0.560377 0.166666 14.9913";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8003.76 9470.09 103.766";rotation = "0.207055 0.691782 0.691785 203.397";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8041.5 9512.15 102.25";rotation = "-0.386925 0.652028 0.652034 137.695";scale = "0.993457 1.16667 1";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8003.32 9470.38 103.817";rotation = "0.207055 0.691782 0.691785 203.397";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DispenserDep";position = "8006.27 9485.36 104.558";rotation = "0 0 1 158.069";scale = "1.5 1.5 0.5";team = "1";ownerGUID = "2000343";powerFreq = "1";set1 = "6";set2 = "8";packBlock = "StingerAmmo";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();schedule(100, 0, "respawnpack", %building); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8003.28 9469.81 102.284";rotation = "0.207056 0.691782 0.691784 203.397";scale = "3.74347 1.189 1";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DispenserDep";position = "8005.53 9484.17 104.558";rotation = "0 0 1 139.212";scale = "1.5 1.5 0.5";team = "1";ownerGUID = "2000343";powerFreq = "1";set1 = "6";set2 = "8";packBlock = "StingerAmmo";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();schedule(100, 0, "respawnpack", %building); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8009.67 9465.91 104.317";rotation = "0.275632 0.920899 0.275631 94.7162";scale = "0.125 0.166666 29.9478";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8003.55 9470.24 106.257";rotation = "-0.920898 0.275631 0.275636 94.7163";scale = "3.74347 1.12667 1";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8031.74 9511.48 100.5";rotation = "0 0 1 208.629";scale = "0.125 0.166666 8";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8038.53 9516.02 100.25";rotation = "0.177564 0.695872 -0.695869 159.863";scale = "2.00136 0.166666 13.9883";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DispenserDep";position = "8004.56 9482.77 104.558";rotation = "0 0 1 133.509";scale = "1.5 1.5 0.5";team = "1";ownerGUID = "2000343";powerFreq = "1";set1 = "6";set2 = "7";packBlock = "Stinger";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();schedule(100, 0, "respawnpack", %building); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8009.67 9465.91 108.197";rotation = "0.275632 0.920899 0.275631 94.7162";scale = "0.125 0.166666 29.9478";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8009.66 9465.89 109.473";rotation = "0.275632 0.920899 0.275631 94.7162";scale = "0.5135 0.166666 29.9478";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8003.95 9484.49 108.207";rotation = "-0.795142 -0.428807 -0.428806 103.02";scale = "1.66624 0.166666 5.0086";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8005.72 9487.63 100.5";rotation = "0 0 1 123.326";scale = "0.125 0.166666 20";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8042.35 9514.23 100.5";rotation = "0 0 1 118.629";scale = "0.125 0.166666 8";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DispenserDep";position = "8003.59 9481.59 104.558";rotation = "0 0 1 115.788";scale = "1.5 1.5 0.5";team = "1";ownerGUID = "2000343";powerFreq = "1";set1 = "6";set2 = "7";packBlock = "Stinger";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();schedule(100, 0, "respawnpack", %building); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8001.94 9481.41 107.582";rotation = "-0.795143 -0.428806 -0.428804 103.02";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8001.67 9481 106.942";rotation = "-0.795143 -0.428806 -0.428804 103.02";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8001.44 9480.66 106.439";rotation = "-0.795143 -0.428806 -0.428804 103.02";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8001.24 9480.34 105.934";rotation = "-0.795143 -0.428806 -0.428804 103.02";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8001.03 9480.02 105.333";rotation = "-0.795143 -0.428806 -0.428804 103.02";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8000.17 9472.42 104.317";rotation = "0.207056 0.691784 0.691782 203.396";scale = "1.74176 0.166666 5.64626";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8000.76 9479.61 104.808";rotation = "-0.795143 -0.428806 -0.428804 103.02";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8001.54 9480.82 102.279";rotation = "-0.356301 0.660698 0.660702 140.778";scale = "3.86835 1.186 1";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8033.32 9514.89 102.25";rotation = "-0.766004 -0.454555 -0.454552 105.095";scale = "1.74854 1.16667 1";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "7997.09 9474.49 104.308";rotation = "0.660701 0.356304 0.660698 140.778";scale = "0.125 0.166666 30.9468";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8035.21 9517.84 104.25";rotation = "-0.454554 0.766004 -0.454553 105.096";scale = "0.125 0.166666 13.9883";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8038.96 9516.36 102.25";rotation = "-0.940626 0.240021 0.240026 93.5044";scale = "1.87402 1.16667 1";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8001.13 9481.09 106.257";rotation = "-0.795143 -0.428806 -0.428804 103.02";scale = "3.86835 1.133 1";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8042.13 9514.35 100.25";rotation = "-0.386926 0.65203 0.652032 137.695";scale = "0.125 0.166666 16";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8035.55 9517.94 104.25";rotation = "0.695871 -0.177567 0.695869 200.138";scale = "0.125 0.166666 14.9922";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "7997.09 9474.49 108.207";rotation = "0.660701 0.356304 0.660698 140.778";scale = "0.125 0.166666 30.9468";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "7997.1 9474.49 109.479";rotation = "0.660701 0.356304 0.660698 140.778";scale = "0.51075 0.166666 30.9468";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8035.33 9518.06 100.5";rotation = "0 0 1 208.629";scale = "0.125 0.166666 8";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "7996.95 9474.28 100.5";rotation = "0 0 1 123.326";scale = "0.125 0.166666 20";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8069.66 9516.38 100.5";rotation = "0 0 1 210.3";scale = "0.125 0.166666 16";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8069.42 9516.52 102.432";rotation = "0.252855 0.933878 0.252855 93.9169";scale = "0.966 0.166666 29.9736";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8069.44 9516.51 108.25";rotation = "0.252855 0.933878 0.252855 93.9169";scale = "0.125 0.166666 29.9736";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8066.08 9518.75 104.114";rotation = "0.188038 0.694492 0.694494 201.3";scale = "2.02012 0.166666 5.3064";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8070.65 9518.4 100.5";rotation = "0 0 1 210.3";scale = "0.125 1.32505 6.804";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8056.28 9524.2 100.5";rotation = "0 0 1 210.3";scale = "0.125 0.166666 16";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8059.29 9522.73 100.984";rotation = "0.188038 0.694492 0.694494 201.3";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8058.8 9523.01 101.584";rotation = "0.188038 0.694492 0.694494 201.3";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8058.44 9523.23 101.976";rotation = "0.188038 0.694492 0.694494 201.3";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8058.01 9523.48 102.559";rotation = "0.188038 0.694492 0.694494 201.3";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8057.61 9523.71 103.074";rotation = "0.188038 0.694492 0.694494 201.3";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8057.22 9523.94 103.552";rotation = "0.188038 0.694492 0.694494 201.3";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8056.88 9524.14 104.114";rotation = "0.188038 0.694492 0.694494 201.3";scale = "0.125 0.166666 4";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8075.11 9525.7 105.951";rotation = "-0.445587 0.77647 -0.445586 104.344";scale = "1.02451 0.166666 21.0544";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8080.18 9517 100.25";rotation = "0.776469 0.445585 -0.445589 104.344";scale = "1.05726 0.166666 17.0477";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8075.1 9525.68 108.25";rotation = "-0.445587 0.77647 -0.445586 104.344";scale = "0.125 0.166666 21.0544";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8072.66 9521.01 100.25";rotation = "-0.376007 0.655224 0.65521 138.786";scale = "2.88203 0.166666 32";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8059.92 9529.99 104.136";rotation = "-0.77647 -0.44559 -0.445583 104.344";scale = "1.97186 0.166666 30.018";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8056.4 9524.41 102.436";rotation = "0.65522 0.376005 0.655216 138.787";scale = "0.967755 0.166666 21.0376";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8061.71 9533.5 108.25";rotation = "-0.445587 0.77647 -0.445586 104.344";scale = "0.125 0.166666 21.0376";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8083.77 9506.81 100.25";rotation = "0.188039 0.694495 0.694491 201.299";scale = "4.11753 0.166666 31.9386";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8074.25 9524.2 100.5";rotation = "0 0 1 210.3";scale = "0.125 1.13073 6.804";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8063.7 9530.36 106.154";rotation = "0.694493 -0.188045 0.694492 201.299";scale = "0.625005 0.166666 23.8676";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DispenserDep";position = "8073.55 9525.75 104.386";rotation = "0 0 -1 56.6959";scale = "1.5 1.5 0.5";team = "1";ownerGUID = "2000343";powerFreq = "1";set1 = "7";set2 = "7";packBlock = "Javelin";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();schedule(100, 0, "respawnpack", %building); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8088.71 9503.94 108.25";rotation = "0.188039 0.69449 0.694496 201.299";scale = "1.00168 0.166666 30.862";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8075.23 9525.9 100.5";rotation = "0 0 1 210.3";scale = "0.125 0.166666 16";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8098.73 9516.6 104.5";rotation = "-0.445587 0.77647 -0.445586 104.344";scale = "2 0.166666 31.9658";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8075.02 9526.02 102.451";rotation = "0.252855 0.933878 0.252855 93.9169";scale = "0.975258 0.166666 29.9994";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8075.01 9526.03 108.25";rotation = "0.252855 0.933878 0.252855 93.9169";scale = "0.125 0.166666 29.9994";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8061.84 9533.72 100.5";rotation = "0 0 1 210.3";scale = "0.125 0.166666 16";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8083.5 9522.56 108.25";rotation = "0.376003 -0.655217 0.65522 138.786";scale = "0.998218 0.166666 23.8784";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedSpine";position = "8098.39 9516.47 104.5";rotation = "0.252855 0.933878 0.252855 93.9169";scale = "2 0.166666 31.9254";team = "1";ownerGUID = "2000343";needsfit = "1";powerFreq = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + TWM2PowerCheck(); + // + + //Move The Players + %sp = "8045 9471 105"; + for(%i = 1; %i <= %group.participants; %i++) { + %spF = vectorAdd(%sp, getRandomPosition(5, 1)); + %group.participant[%i].player.setPosition(%spF); + // + %player = %group.participant[%i].player; + %player.setArmor("Medium"); //commando! + %player.clearInventory(); + %player.setInventory(MissileLauncher, 1, true); + %player.setInventory(MissileLauncherAmmo, 5, true); + //%player.setInventory(pistol, 1, true); + //%player.setInventory(pistolAmmo, 10, true); //I'm nice for your first clip :) + //%player.ClipCount[pistolImage.ClipName] = pistolImage.InitialClips; + %player.ClipCount[StingerImage.ClipName] = 15; + %player.ClipCount[JavelinImage.ClipName] = 15; + // + %player.setInventory(TargetingLaser, 1, true); + %player.setInventory(RepairKit,3); + %player.setInventory(Grenade,5); + %player.use(MissileLauncher); + } + //Spawn The Evil AC-130 of doom + %obj = new FlyingVehicle() { + dataBlock = AC130; + position = vectoradd(%missionPosCenter, "-600 700 400"); + rotation = "0 0 0 1"; + team = 2; + }; + TWM2MissionAspectsGroup.add(%obj); + %obj.TurretObject.barrel = "Chain"; + SwitchACGunLoop(%obj); //randomly switch weapons + + ACAboveMissionLoop(%group, %obj); + + %obj.isHarbinsWrathShip = 1; + %obj.isUltrAlly = 1; // ah what the heck, you should get 1000 XP for blowing one of these + // bastages up. + + setTargetSensorGroup(%obj.getTarget(), 2); + + %obj.GoPoint = 1; + %obj.CanFlare = 1; + GunshipForwardImpulse(%obj); + %obj.ScanLoop = GetNextGunshipPoint(%obj); + + schedule(15*60*1000, 0, "EndGunship", %obj, ""); + } + + function ACAboveMissionLoop(%group, %obj) { + if(!isObject(%obj)) { + + for(%i = 1; %i <= %group.participants; %i++) { + AwardClient(%group.participant[%i], 34); + } + + %group.CompleteMission(); + return; + } + schedule(1000, 0, "ACAboveMissionLoop", %group, %obj); + } +}; diff --git a/scripts/TWM2/Missions/Invasion.cs b/scripts/TWM2/Missions/Invasion.cs new file mode 100644 index 0000000..475ad62 --- /dev/null +++ b/scripts/TWM2/Missions/Invasion.cs @@ -0,0 +1,99 @@ +package TWM2Mission_Invasion { + function TWM2MissionClass::initiateSettings(%group) { + %group.commandName = "Command"; + %group.failMessage = "Your squad has been eliminated, mission failed"; + %group.BonusCompleteMessage = "Excellent work soldiers, You've held back a major storm!"; + %group.CompleteMessageNoTime = "All enemy dropships neutralized, good work team."; + %group.bonusEXP = 2500; + %group.completionEXP = 2000; + } + + function TWM2MissionClass::OnTimeZero(%group) { + %group.MessageMissionGroup("\c5"@%group.commandName@": Enemy dropships have been eliminated, good work team!"); + for(%i = 1; %i <= %group.participants; %i++) { + %spF = game.pickPlayerSpawn( %group.participant[%i], false ); + %group.participant[%i].player.setPosition(%spF); + + AwardClient(%group.participant[%i], 37); + } + %group.AddMissionTime(10); //surviving = success with reward + %group.CompleteMission(); + } + + function TWM2MissionClass::StartTWM2Mis(%group) { + %sp = "19528 17981 105"; + for(%i = 1; %i <= %group.participants; %i++) { + %spF = vectorAdd(%sp, getRandomPosition(5, 1)); + %group.participant[%i].player.setPosition(%spF); + // + %player = %group.participant[%i].player; + %player.setArmor("Medium"); //commando! + %player.clearInventory(); + %player.setInventory(S3SRifle, 1, true); + %player.setInventory(S3SRifleAmmo, 30, true); + %player.ClipCount[S3SRifleImage.ClipName] = mfloor(S3SRifleImage.InitialClips * 1.5); + %player.setInventory(Mp26CMDO, 1, true); + %player.setInventory(Mp26CMDOAmmo, 50, true); + %player.ClipCount[Mp26CMDOImage.ClipName] = mfloor(Mp26CMDOImage.InitialClips * 1.5); + %player.setInventory(pistol, 1, true); + %player.setInventory(pistolAmmo, 10, true); + %player.ClipCount[pistolImage.ClipName] = pistolImage.InitialClips; + %player.setInventory(TargetingLaser, 1, true); + %player.setInventory(RepairKit,3); + %player.setInventory(Grenade,5); + %player.use(S3Rifle); + } + // + spawnDropshipWave(%group, %sp); + schedule(30000, 0, spawnDropshipWave, %group, %sp); + schedule(60000, 0, spawnDropshipWave, %group, %sp); + schedule(90000, 0, spawnDropshipWave, %group, %sp); + schedule(120000, 0, spawnDropshipWave, %group, %sp); + schedule(150000, 0, spawnDropshipWave, %group, %sp); + schedule(180000, 0, spawnDropshipWave, %group, %sp); + schedule(190000, 0, spawnDropshipWave, %group, %sp); + } + + function spawnHunterDropship_Mission(%position, %dropPosition, %dropType) { + %dropT = %dropType SPC %dropType SPC %dropType SPC %dropType; + //spawn dropship + %drop = new FlyingVehicle() { + dataBlock = "HunterDropship"; + position = %position; + respawn = "0"; + teamBought = 30; + team = 30; + }; + MissionCleanup.add(%drop); + //attach waypoint, spawn pilot/passengers + %wraith = StartAZombie(vectorAdd(%position, "0 0 100"), 15); + %wraith.isInTheMission = 1; + %drop.mountObject(%wraith, 0); + for(%i = 0; %i < getWordCount(%dropT); %i++) { + %z = StartAZombie(vectorAdd(%position, "0 0 100"), getWord(%dropT, %i)); + %z.isInTheMission = 1; + if(isObject(%z)) { + %drop.mountObject(%z, %i+2); + //%z.mountObject(%drop, %i+2); + } + } + dropshipMarkerLoop(%drop); + //engage dropship AI + BeginDropshipAI(%drop, %dropPosition); + } + + function spawnDropshipWave(%group, %start) { + if(!isObject(%group)) { + return; + } + %pos[0] = vectorAdd(%start, "2000 0 400"); + %pos[1] = vectorAdd(%start, "-2000 0 400"); + %pos[2] = vectorAdd(%start, "0 2000 400"); + %pos[3] = vectorAdd(%start, "0 -2000 400"); + + spawnHunterDropship_Mission(%pos[0], %start, 1); + schedule(2500, 0, "spawnHunterDropship_Mission", %pos[1], %start, 1); + schedule(5000, 0, "spawnHunterDropship_Mission", %pos[2], %start, 1); + schedule(7500, 0, "spawnHunterDropship_Mission", %pos[3], %start, 1); + } +}; diff --git a/scripts/TWM2/Missions/MissionCore.cs b/scripts/TWM2/Missions/MissionCore.cs new file mode 100644 index 0000000..3ca6765 --- /dev/null +++ b/scripts/TWM2/Missions/MissionCore.cs @@ -0,0 +1,512 @@ +//MISSIONS +//Phantom139, for TWM2 2.5 +//DO you have what it takes to complete them? + +//Missions are little tasks that are performed by players. +//Some tasks require multiple players, while some only require one. + +//These tasks are timed, and can only be played in the "Construction/FlatlandBig" +//If the task is completed within the given time limit, an additional +//XP Bonus is awarded, If not, oh well =p + +//So, without further ado, lets begin +//Mission Vars! +$Mission::TWM2Mision[0] = "RainDown"; +$Mission::TWM2Mision[1] = "EnemyAc130Above"; +$Mission::TWM2Mision[2] = "Surrounded"; +$Mission::TWM2Mision[3] = "Surrounded2\t1"; +$Mission::TWM2Mision[4] = "Invasion\t1"; + +$Mission::VarSet["RainDown", "TaskDetails"] = "Rain Down\tClear The Zombies with the AC130\t3:00/Gunship Support"; +$Mission::VarSet["RainDown", "Orders"] = "Using the turret, eliminate all zombies, you have 3 minutes."; +$Mission::VarSet["RainDown", "Requirement"] = "Challenge\tGunship3"; +$Mission::VarSet["RainDown", "Difficulty"] = "Moderate"; +$Mission::VarSet["RainDown", "TimeLimit"] = 3 * 60; //3 minutes +$Mission::VarSet["RainDown", "PlayerReq"] = 1; //1 Person +$Mission::VarSet["RainDown", "PlayerLimit"] = 1; //1 Person +// +$Mission::VarSet["EnemyAc130Above", "TaskDetails"] = "Enemy AC-130 Above\tEscape or destroy the enemy AC130\t15:00/Survival-Escape Mission"; +$Mission::VarSet["EnemyAc130Above", "Orders"] = "An enemy AC130 is attacking, escape it, or destroy it, your choice."; +$Mission::VarSet["EnemyAc130Above", "Requirement"] = "Challenge\tGunship3"; +$Mission::VarSet["EnemyAc130Above", "Difficulty"] = "Extremely Challenging"; +$Mission::VarSet["EnemyAc130Above", "TimeLimit"] = 15 * 60; //15 minutes +$Mission::VarSet["EnemyAc130Above", "PlayerReq"] = 1; //1 Person +$Mission::VarSet["EnemyAc130Above", "PlayerLimit"] = 3; //3 People +// +$Mission::VarSet["TheShallowedCity", "TaskDetails"] = "The Shallowed City\tReach the city center in 10 minutes"; +$Mission::VarSet["TheShallowedCity", "Orders"] = "Reach the city center, clear enemies in your path, you have 10 minutes."; +$Mission::VarSet["TheShallowedCity", "Requirement"] = "XP\t2750000"; +$Mission::VarSet["TheShallowedCity", "Difficulty"] = "Hard"; +$Mission::VarSet["TheShallowedCity", "TimeLimit"] = 10 * 60; //10 minutes +$Mission::VarSet["TheShallowedCity", "PlayerReq"] = 2; //2 People +$Mission::VarSet["TheShallowedCity", "PlayerLimit"] = 4; //4 People +// +$Mission::VarSet["Surrounded", "TaskDetails"] = "Surrounded!\tHold out against endless amounts of zombies for 5 minutes\t5:00/Survival Mission"; +$Mission::VarSet["Surrounded", "Orders"] = "We're SURROUNDED! Survive the onslaught for 5 minutes!"; +$Mission::VarSet["Surrounded", "Requirement"] = "XP\t2750000"; +$Mission::VarSet["Surrounded", "Difficulty"] = "Moderate"; +$Mission::VarSet["Surrounded", "TimeLimit"] = 5 * 60; //10 minutes +$Mission::VarSet["Surrounded", "PlayerReq"] = 1; //1 Person +$Mission::VarSet["Surrounded", "PlayerLimit"] = 6; //6 People +// +$Mission::VarSet["Surrounded2", "TaskDetails"] = "Surrounded 2.0!\tThe onslaught continues, now even bigger and badder with demons and a 10 mintue survival time\t10:00/Survival Mission"; +$Mission::VarSet["Surrounded2", "Orders"] = "We're SURROUNDED! Survive the onslaught for 10 minutes!"; +$Mission::VarSet["Surrounded2", "Requirement"] = "XP\t2750000"; +$Mission::VarSet["Surrounded2", "Difficulty"] = "Hard"; +$Mission::VarSet["Surrounded2", "TimeLimit"] = 10 * 60; //10 minutes +$Mission::VarSet["Surrounded2", "PlayerReq"] = 1; //1 Person +$Mission::VarSet["Surrounded2", "PlayerLimit"] = 6; //6 People +// +$Mission::VarSet["Invasion", "TaskDetails"] = "Invasion\tDefend your position against an invasion of hunter dropships\t5:00/Survival Mission"; +$Mission::VarSet["Invasion", "Orders"] = "Team, hold position.. enemy dropships have been detected approaching your position."; +$Mission::VarSet["Invasion", "Requirement"] = "XP\t2750000"; +$Mission::VarSet["Invasion", "Difficulty"] = "Hard"; +$Mission::VarSet["Invasion", "TimeLimit"] = 5 * 60; //10 minutes +$Mission::VarSet["Invasion", "PlayerReq"] = 1; //1 Person +$Mission::VarSet["Invasion", "PlayerLimit"] = 6; //6 People +// +$Mission::VarSet["RogVeg1", "TaskDetails"] = "Rog's Vengeance I: Rise of Darkness\tAssault a human suburb base, plant the shadow conductors\t20:00/Siege Mission"; +$Mission::VarSet["RogVeg1", "Orders"] = "General Rog, Assault the Human Forces, Destroy all hostiles and plant the shadow conductors, let them know fear."; +$Mission::VarSet["RogVeg1", "Requirement"] = "XP\t2750000"; +$Mission::VarSet["RogVeg1", "Difficulty"] = "Easy"; +$Mission::VarSet["RogVeg1", "TimeLimit"] = 20 * 60; +$Mission::VarSet["RogVeg1", "PlayerReq"] = 1; +$Mission::VarSet["RogVeg1", "PlayerLimit"] = 3; +// +$Mission::VarSet["RogVeg2", "TaskDetails"] = "Rog's Vengeance II: Slicing the Light\tAttack a human controlled power grid, further the darkness\t20:00/Siege Mission"; +$Mission::VarSet["RogVeg2", "Orders"] = "Excellent work my general, now push further into their suburb, cut their electrical power source so the darkness can come."; +$Mission::VarSet["RogVeg2", "Requirement"] = "XP\t2750000"; +$Mission::VarSet["RogVeg2", "Difficulty"] = "Moderate"; +$Mission::VarSet["RogVeg2", "TimeLimit"] = 20 * 60; +$Mission::VarSet["RogVeg2", "PlayerReq"] = 1; +$Mission::VarSet["RogVeg2", "PlayerLimit"] = 3; +// +$Mission::VarSet["RogVeg3", "TaskDetails"] = "Rog's Vengeance III: Yvex's Storm\tPrepare to invade the city and unleash the shade storm's wrath\t20:00/Siege Mission"; +$Mission::VarSet["RogVeg3", "Orders"] = "The time has come my general, lead the attack into the human city, decimate all forces so the storm may cleanse the city."; +$Mission::VarSet["RogVeg3", "Requirement"] = "XP\t2750000"; +$Mission::VarSet["RogVeg3", "Difficulty"] = "Hard"; +$Mission::VarSet["RogVeg3", "TimeLimit"] = 20 * 60; +$Mission::VarSet["RogVeg3", "PlayerReq"] = 1; +$Mission::VarSet["RogVeg3", "PlayerLimit"] = 3; +// +$Mission::VarSet["RogVeg4", "TaskDetails"] = "Rog's Vengeance IV: Rog's Vengeance\tUnleash the fury of the Fist of Vengeance\t20:00/Siege Mission"; +$Mission::VarSet["RogVeg4", "Orders"] = "With the shade storm in place, it is time my shade lord, to clease the city. Destroy them all!"; +$Mission::VarSet["RogVeg4", "Requirement"] = "XP\t2750000"; +$Mission::VarSet["RogVeg4", "Difficulty"] = "Hard"; +$Mission::VarSet["RogVeg4", "TimeLimit"] = 20 * 60; +$Mission::VarSet["RogVeg4", "PlayerReq"] = 1; +$Mission::VarSet["RogVeg4", "PlayerLimit"] = 3; +// + +//datablocks and functions +datablock TriggerData(MissionTrigger) { + tickPeriodMS = 200; +}; + +function MissionTrigger::onEnterTrigger(%data, %obj, %colObj) { + %function = %obj.callFunction; + + if(%obj.isUsed) { + return; + } + %obj.isUsed = 1; + %group = nameToID("TWM2Mission"); + eval(""@%group@"."@%function@"("@%obj@", "@%colObj@");"); +} +// + +function CheckMissionRequirement(%client, %mission) { + %req = $Mission::VarSet[%mission, "Requirement"]; + // + %type = getField(%req, 0); + %reqName = getField(%req, 1); + // + switch$(%type) { + case "XP": + %clXP = getCurrentEXP(%client); + if(%clXP < %reqName) { + return 0; + } + else { + return 1; + } + case "Challenge": + if(%client.CheckNWChallengeCompletion(%reqName)) { + return 1; + } + else { + return 0; + } + } +} + +function CreateTWM2Mission(%client, %mission) { + %group = NameToID("TWM2Mission"); + if(%group.inProgress) { + messageClient(%client, 'msgNope', "\c5MISSION: A mission has been ordered or is in progress."); + return; + } + if(!isObject(%client.player) || %client.player.getState() $= "Dead") { + messageClient(%client, 'msgNope', "\c5MISSION: Dead people cannot order missions."); + return; + } + if(getCurrentEXP(%client) < $Ranks::MinPoints[59] && %client.TWM2Core.officer < 1) { + messageClient(%client, 'msgNope', "\c5MISSION: You must be a Commanding Officer (or Higher) to order missions."); + return; + } + if($CurrentMissionType !$= "Construction") { + error("TWM2 Mission: Must be in construction, aborted."); + messageClient(%client, 'msgNope', "\c5MISSION: Missions an only be ordered in the construction game mode."); + return; + } + if($CurrentMission !$= "FlatlandBig" && $CurrentMission !$= "Flatland") { + error("TWM2 Mission: Must be in FLBig, aborted."); + messageClient(%client, 'msgNope', "\c5MISSION: Missions can only be ordered on Flatland."); + return; + } + %timeleft = $Mission::VarSet[%mission, "TimeLimit"]; + %playerlimit = $Mission::VarSet[%mission, "PlayerLimit"]; + %playerreq = $Mission::VarSet[%mission, "PlayerReq"]; + %missionname = GetField($Mission::VarSet[%mission, "TaskDetails"], 0); + %group = new ScriptObject(TWM2Mission) { + class = "TWM2MissionClass"; + + mission = %mission; + MissionName = %missionname; + Status = "Failed"; //start here, we change it if you win + timer = %timeleft; + playerRequire = %playerreq; + playerLimit = %playerlimit; + timeToBegin = 30; //30 seconds + Participant[1] = %client; + ParticipantAlive[1] = true; + Participants = 1; + InProgress = 2; + }; + new SimGroup(TWM2MissionAspectsGroup) { + //this group holds our mission aspects + }; + + echo("TWM2: Activating Mission Package: "@%mission); + activatePackage("TWM2Mission_"@%mission@""); + %group.initiateSettings(); + + %group.schedule(%group.timeToBegin * 1000, "StartTWM2MissionTimer"); + if(%group.playerLimit > 1) { + //Phantom139: Added TWM2 3.8, obviously we don't want to ask people to join a 1 player mission. + messageAll('msgMission', "\c5MISSION: "@%client.namebase@" has ordered a mission, press [F2] -> Mission to join in."); + CompleteNWChallenge(%client, "SimonSays"); + } +} + +function AddClientToMission(%client) { + %group = nameToID("TWM2Mission"); + if(%group.InProgress == 0) { + messageClient(%client, 'msgFailed', "\c5MISSION: There is no mission to join."); + return; + } + if(%group.InProgress == 1) { + messageClient(%client, 'msgFailed', "\c5MISSION: You cannot join a mission in progress."); + return; + } + if(!isObject(%client.player) || %client.player.getState() $= "Dead") { + messageClient(%client, 'msgNope', "\c5MISSION: Dead people cannot join missions."); + return; + } + //add them + if(%group.Participants >= %group.playerLimit) { + messageClient(%client, 'msgFailed', "\c5MISSION: This mission cannot take any more soldiers."); + return; + } + //last check, for lulz + for(%i = 1; %i <= %group.Participants; %i++) { + if(%client == %group.Participant[%i]) { + messageClient(%client, 'msgFailed', "\c5MISSION: Trying to join twice eh?"); + return; + } + } + // + %group.Participants++; + %group.Participant[%group.Participants] = %client; + %group.ParticipantAlive[%group.Participants] = true; + messageClient(%client, 'msgFailed', "\c5MISSION: Added to the mission squad, prepare for orders."); + CompleteNWChallenge(%client, "FromTheTop"); +} + +function TWM2MissionClass::StartTWM2MissionTimer(%group) { + %counter = %group.Participants; + //cleanup check + for(%i = 0; %i < clientGroup.getCount(); %i++) { + %cl = clientGroup.getObject(%i); + for(%r = 1; %r <= %counter; %r++) { + if(%cl == %group.Participant[%r]) { + if(!isObject(%cl.player) || %cl.player.getState() $= "Dead") { + messageClient(%cl, 'msgNope', "\c5MISSION: You have been released from the mission for being dead."); + %cl.missionReady = false; + } + else { + messageClient(%cl, 'msgNope', "\c5MISSION: Standby.... Relaying orders...."); + %cl.missionReady = true; + } + } + } + } + //echo("checking"); + for(%r2 = 1; %r2 <= %counter; %r2++) { + if(%group.Participant[%r2].missionReady) { + %group.Participant[%r2].missionReady = ""; //clear the storage var + } + //missing clientz0r :P + else { + %group.Participant[%r2] = ""; + %group.ParticipantAlive[%r2] = ""; + %group.Participants--; + } + } + // + //echo("checking 2"); + if(%group.Participants < %req) { + for(%lol = 1; %lol <= %group.Participants; %lol++) { + messageClient(%group.Participant[%lol], 'msgFailed', "\c5MISSION: Not enough participants, Aborted."); + } + %group.EndTWM2Mission(); + //echo("NaP"); + return; + } + else { + %group.Participants = %counter; //reset this so we don't miss out on clients. + } + // + //echo("Starting"); + %group.StartTWM2Mission(); +} + +function TWM2MissionClass::AddMissionTime(%group, %time) { + if(nameToID("TWM2Mission") == -1) { + return; + } + %group.timer += %time; +} + +function TWM2MissionClass::TWM2MissionTimerLoop(%group) { + if(nameToID("TWM2Mission") == -1) { + return; + } + // + if(%group.timer > 0) { + %group.timer--; + } + else { + if(%group.mission !$= "") { + %group.OnTimeZero(); + } + } + // + %min = getField(FormatTWM2Time(%group.timer), 0); + %sec = getField(FormatTWM2Time(%group.timer), 1); + // + for(%i = 1; %i <= %group.Participants; %i++) { + if(%group.ParticipantAlive[%i]) { + messageClient(%group.Participant[%i], 'MsgSPCurrentObjective1', "", ""@%group.MissionName@" - "@%min@":"@%sec@""); + } + else { + messageClient(%group.Participant[%i], 'MsgSPCurrentObjective1', "", ""@%group.MissionName@" - DEAD"); + } + } + // + %group.schedule(1000, "TWM2MissionTimerLoop"); +} + +function TWM2MissionClass::EndTWM2Mission(%group) { + if(%group.Status $= "Failed") { + for(%i = 1; %i <= %group.Participants; %i++) { + messageClient(%group.Participant[%i], 'msgFailed', "\c5"@%group.commandName@": "@%group.failMessage@"~wfx/misc/flag_lost.wav"); + messageClient(%group.Participant[%i], 'MsgSPCurrentObjective1', "", ""@%group.MissionName@" - Mission Failed"); + schedule(5000, 0, messageClient, %group.Participant[%i], 'MsgSPCurrentObjective1' ,"", "Welcome to TWM2!"); + CompleteNWChallenge(%group.Participant[%i], "EpicFailure"); + } + } + else { + if(%group.timer > 0) { + for(%i = 1; %i <= %group.Participants; %i++) { + messageClient(%group.Participant[%i], 'msgFailed', "\c5"@%group.commandName@": "@%group.BonusCompleteMessage@"~wfx/misc/hunters_horde.wav"); + GainExperience(%group.Participant[%i], %group.bonusEXP + %group.completionEXP, "Mission Accomplished, Bonus EXP Recieved "); + messageClient(%group.Participant[%i], 'MsgSPCurrentObjective1', "", ""@%group.MissionName@" - Mission Accomplished (Time!)"); + schedule(5000, 0, messageClient, %group.Participant[%i], 'MsgSPCurrentObjective1' ,"", "Welcome to TWM2!"); + CompleteNWChallenge(%group.Participant[%i], "GoldStar"); + } + } + else { + for(%i = 1; %i <= %group.Participants; %i++) { + messageClient(%group.Participant[%i], 'msgFailed', "\c5"@%group.commandName@": "@%group.CompleteMessageNoTime@"~wfx/misc/flag_capture.wav"); + GainExperience(%group.Participant[%i], %group.completionEXP, "Mission Accomplished! "); + messageClient(%group.Participant[%i], 'MsgSPCurrentObjective1', "", ""@%group.MissionName@" - Mission Accomplished"); + schedule(5000, 0, messageClient, %group.Participant[%i], 'MsgSPCurrentObjective1' ,"", "Welcome to TWM2!"); + CompleteNWChallenge(%group.Participant[%i], "Faster"); + } + } + } + // + + deactivatePackage("TWM2Mission_"@%group.MissionName@""); + + CleanGroupAspects(NameToID("TWM2MissionAspectsGroup")); + for(%i = 1; %i <= %group.Participants; %i++) { + %group.Participant[%i] = ""; + %group.ParticipantAlive[%i] = ""; + } + %group.Participants = 0; + %group.inProgress = 0; + %group.delete(); +} + +function DoTWM2MissionChecks(%client) { + %group = nameToID("TWM2Mission"); + if(%group == -1) { + return; + } + %plyr = %client.player; + if(!isObject(%plyr) || %plyr.getState() $= "dead") { + for(%i = 1; %i <= %group.Participants; %i++) { + if(%group.Participant[%i] == %client) { + %group.ParticipantAlive[%i] = false; + %group.CheckMissionFailure(); + } + } + } +} + +function TWM2MissionClass::CheckMissionFailure(%group) { + %living = 0; + for(%i = 1; %i <= %group.Participants; %i++) { + if(!%group.ParticipantAlive[%i]) { + + } + else { + %living++; + } + } + // + if(!%living) { + %group.Status = "Failed"; + %group.EndTWM2Mission(); + } +} + +function TWM2MissionClass::CompleteMission(%group) { + %group = nameToID("TWM2Mission"); + if(%group == -1) { + return; + } + %group.Status = "Success"; + %group.EndTWM2Mission(); +} + +function TWM2MissionClass::StartTWM2Mission(%group) { + if(nameToID("TWM2Mission") == -1) { + return; + } + if(%group.mission !$= "") { + echo("Mission start: "@%group@"("@%group.getName()@")"); + %group.RelayMissionOrders(); + %group.TWM2MissionTimerLoop(); + + %group.StartTWM2Mis(); + + %group.InProgress = 1; + } +} + +function TWM2MissionClass::RelayMissionOrders(%group) { + for(%i = 1; %i <= %group.Participants; %i++) { + messageClient(%group.Participant[%i], 'msgFailed', "\c5"@%group.commandName@": "@$Mission::VarSet[%group.mission, "Orders"]@"."); + } +} + +function TWM2MissionClass::MessageMissionGroup(%group, %message) { + for(%i = 1; %i <= %group.Participants; %i++) { + messageClient(%group.Participant[%i], 'msgGroup', ""@collapseEscape(%message)@""); + } +} + +function isInTWM2Mission(%client) { + %group = nameToID("TWM2Mission"); + if(%group == -1) { + return 0; + } + + for(%i = 1; %i <= %group.Participants; %i++) { + if(%group.Participant[%i] == %client) { + return 1; + } + } +} + +//This is not the TWM2MissionClass group, but the MissionAspectsGroup which +//is used to store all of the objects and commands specific to the mission +function CleanGroupAspects(%group) { + //kill all zombies part of the mission + %count = ZombieGroup.getCount(); + for(%i = 0; %i < %count; %i++) { + %obj = ZombieGroup.getObject(%i); + if(isObject(%obj)) { + if(%obj.iszombie) { + if(%obj.isInTheMission) { + %obj.scriptkill($DamageType::admin); + } + } + else { + continue; + } + } + } + //kill all soldiers part of the mission + %count = SoldierGroup.getCount(); + for(%i = 0; %i < %count; %i++) { + %obj = SoldierGroup.getObject(%i); + if(isObject(%obj)) { + if(%obj.isSoldier) { + if(%obj.isInTheMission) { + %obj.scriptkill($DamageType::admin); + } + } + else { + continue; + } + } + } + // + for(%i = 0; %i < %group.getCount(); %i++) { + %obj = %group.getObject(%i); + if(%obj.isPlayer()) { + %obj.scriptKill(0); //DIE! + %obj.delete(); + } + else { + %obj.delete(); + } + } + %group.delete(); +} + + +//OnTimeZeroMissionName +//StartTWM2MisMissionName + + + + + + + +//MISSION EXEC +function LoadMissions() { + %search = "scripts/twm2/missions/*.cs"; + for(%file = findFirstFile(%search); %file !$= ""; %file = findNextFile(%search)) { + %type = fileBase(%file); // get the name of the script + if(%type !$= "MissionCore") { + exec("scripts/twm2/missions/" @ %type @ ".cs"); + } + } +} +LoadMissions(); diff --git a/scripts/TWM2/Missions/RainDown.cs b/scripts/TWM2/Missions/RainDown.cs new file mode 100644 index 0000000..6d02439 --- /dev/null +++ b/scripts/TWM2/Missions/RainDown.cs @@ -0,0 +1,82 @@ +package TWM2Mission_RainDown { + function TWM2MissionClass::initiateSettings(%group) { + %group.commandName = "AC-130 Pilot"; + %group.failMessage = "Our mission has failed, we'll get them next time"; + %group.BonusCompleteMessage = "Nice run gunner! let's head back home!"; + %group.CompleteMessageNoTime = "Good work, We've neutralized the enemy forces just in time."; + %group.bonusEXP = 2500; + %group.completionEXP = 5000; + } + + function TWM2MissionClass::OnTimeZero(%group) { + MessageClient(%group.Participant[1], 'msgShip', "\c5"@%group.commandName@": We're low on fuel, we need to turn back now."); + %group.EndTWM2Mission(); + } + + function RainDownMissionLoop(%group, %zgroup) { + if(%group.InProgress == 0 || %group.InProgress $= "") { + echo("complete."); + return; + } + %living = 0; + for(%i = 0; %i < %zGroup.getCount(); %i++) { + %zombie = %zGroup.getObject(%i); + if(%zombie.isZombie && %zombie.isInTheMission) { + if(!isObject(%zombie) || %zombie.getState() $= "dead") { + + } + else { + %living++; + } + } + } + // + if(%living == 0) { + AwardClient(%group.participant[1], 32); + %group.CompleteMission(); + } + schedule(1000, 0, "RainDownMissionLoop", %group, %zgroup); + } + + function TWM2MissionClass::StartTWM2Mis(%group) { + %missionPosCenter = "5400 12000 110"; + for(%i = 0; %i < 15; %i++) { + %posx = vectorAdd(%missionPosCenter, GetRandomPosition(25, 1)); + %zombie = StartAZombie(%posx, 1); + %zombie.isInTheMission = 1; + } + RainDownMissionLoop(%group, MissionCleanup); + + // + %client = %group.Participant[1]; + + %obj = new FlyingVehicle() { + dataBlock = AC130; + position = vectoradd(%missionPosCenter, "0 700 400"); + rotation = "0 0 0 1"; + team = %client.team; + }; + MissionCleanUp.add(%obj); + %obj.TurretObject.barrel = "Chain"; + %obj.TurretObject.schedule(2000, SetFrozenState, false); + %obj.TurretObject.schedule(2000, SetMoveState, false); + + %obj.isHarbinsWrathShip = 1; + %obj.isUltrAlly = 1; + + setTargetSensorGroup(%obj.getTarget(), %client.team); + + %obj.GoPoint = 1; + %obj.CanFlare = 1; + GunshipForwardImpulse(%obj); + %obj.ScanLoop = GetNextGunshipPoint(%obj); + + schedule(180*1000, 0, "EndGunship", %obj, %client); + %client.schedule(1000, "setControlObject", %obj.turretObject); + commandToClient(%client, 'ControlObjectResponse', true, getControlObjectType(%obj.turretObject,%client.player)); + %client.gunshipControlLoop = schedule(1000, 0, "GunshipControlLoop", %client, %obj); + messageClient(%client, 'msgControls', "\c3GUNSHIP: Press the [Mine] key to toggle weapons"); + %client.player.lastTransformStuff = %client.player.getTransform(); + %client.player.setPosition(VectorAdd(%x SPC %y SPC 0,$Prison::JailPos)); + } +}; diff --git a/scripts/TWM2/Missions/Surrounded.cs b/scripts/TWM2/Missions/Surrounded.cs new file mode 100644 index 0000000..05fd13e --- /dev/null +++ b/scripts/TWM2/Missions/Surrounded.cs @@ -0,0 +1,64 @@ +package TWM2Mission_Surrounded { + function TWM2MissionClass::initiateSettings(%group) { + %group.commandName = "Command"; + %group.failMessage = "Your team has been eliminated, mission failed"; + %group.BonusCompleteMessage = "Excellent work team, you held off those zombies perfectly."; + %group.CompleteMessageNoTime = "Nice job team, head on back to base."; + %group.bonusEXP = 2500; + %group.completionEXP = 1000; + } + + function TWM2MissionClass::OnTimeZero(%group) { + %group.MessageMissionGroup("\c5"@%group.commandName@": You have survived!!! mission acomplished"); + for(%i = 1; %i <= %group.participants; %i++) { + %spF = game.pickPlayerSpawn( %group.participant[%i], false ); + %group.participant[%i].player.setPosition(%spF); + + AwardClient(%group.participant[%i], 35); + } + %group.AddMissionTime(10); //surviving = success with reward + %group.CompleteMission(); + } + + function TWM2MissionClass::StartTWM2Mis(%group) { + // + %building = new (StaticShape) () {datablock = "GeneratorLarge";position = "9526.46 7984.89 93";rotation = "0 0 -1 21.2091";scale = "1 1 1";team = "1";ownerGUID = "2000343";deployed = "1";powerFreq = "1";isSwitchedOn = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9488.05 8001.65 100";rotation = "0 0 1 115.894";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9571.97 7971.99 100";rotation = "0 0 -1 76.7506";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9557.85 7947.1 100";rotation = "0 0 -1 40.5343";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9510.12 8024.52 100";rotation = "0 0 1 157.406";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9535.39 7934.75 100";rotation = "0 0 -1 9.23422";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9512.93 7935.66 100";rotation = "0 0 1 17.4571";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9478.97 7983.36 100";rotation = "0 0 1 91.0928";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9493.53 7946.49 100";rotation = "0 0 1 43.5003";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9528.58 8031.41 100";rotation = "0 0 1 181.104";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9550.88 8025.84 100";rotation = "0 0 1 208.169";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9572.8 8003.44 100";rotation = "0 0 -1 114.945";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9482.44 7961.31 100";rotation = "0 0 1 64.9402";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + TWM2PowerCheck(); + // + + %sp = "9528 7981 105"; + for(%i = 1; %i <= %group.participants; %i++) { + %spF = vectorAdd(%sp, getRandomPosition(5, 1)); + %group.participant[%i].player.setPosition(%spF); + // + %player = %group.participant[%i].player; + %player.setArmor("Medium"); //commando! + %player.clearInventory(); + %player.setInventory(S3Rifle, 1, true); + %player.setInventory(S3RifleAmmo, 10, true); + %player.ClipCount[S3RifleImage.ClipName] = mfloor(S3RifleImage.InitialClips * 1.5); + %player.setInventory(M1700, 1, true); + %player.setInventory(M1700Ammo, 1, true); + %player.ClipCount[M1700Image.ClipName] = mfloor(M1700Image.InitialClips * 1.5); + %player.setInventory(pistol, 1, true); + %player.setInventory(pistolAmmo, 10, true); + %player.ClipCount[pistolImage.ClipName] = pistolImage.InitialClips; + %player.setInventory(TargetingLaser, 1, true); + %player.setInventory(RepairKit,3); + %player.setInventory(Grenade,5); + %player.use(S3Rifle); + } + } +}; diff --git a/scripts/TWM2/Missions/Surrounded2.cs b/scripts/TWM2/Missions/Surrounded2.cs new file mode 100644 index 0000000..fc7b4cc --- /dev/null +++ b/scripts/TWM2/Missions/Surrounded2.cs @@ -0,0 +1,64 @@ +package TWM2Mission_Surrounded2 { + function TWM2MissionClass::initiateSettings(%group) { + %group.commandName = "Command"; + %group.failMessage = "Your team has been eliminated, mission failed"; + %group.BonusCompleteMessage = "Excellent work team, you held off those zombies perfectly."; + %group.CompleteMessageNoTime = "Nice job team, head on back to base."; + %group.bonusEXP = 2500; + %group.completionEXP = 2500; + } + + function TWM2MissionClass::OnTimeZero(%group) { + %group.MessageMissionGroup("\c5"@%group.commandName@": You have survived the second horde!!! mission acomplished"); + for(%i = 1; %i <= %group.participants; %i++) { + %spF = game.pickPlayerSpawn( %group.participant[%i], false ); + %group.participant[%i].player.setPosition(%spF); + + AwardClient(%group.participant[%i], 36); + } + %group.AddMissionTime(10); //surviving = success with reward + %group.CompleteMission(); + } + + function TWM2MissionClass::StartTWM2Mis(%group) { + // + %building = new (StaticShape) () {datablock = "GeneratorLarge";position = "9526.46 7984.89 93";rotation = "0 0 -1 21.2091";scale = "1 1 1";team = "1";ownerGUID = "2000343";deployed = "1";powerFreq = "1";isSwitchedOn = "1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered(); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9488.05 8001.65 100";rotation = "0 0 1 115.894";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9571.97 7971.99 100";rotation = "0 0 -1 76.7506";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9557.85 7947.1 100";rotation = "0 0 -1 40.5343";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "4";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9510.12 8024.52 100";rotation = "0 0 1 157.406";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9535.39 7934.75 100";rotation = "0 0 -1 9.23422";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9512.93 7935.66 100";rotation = "0 0 1 17.4571";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "4";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9478.97 7983.36 100";rotation = "0 0 1 91.0928";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9493.53 7946.49 100";rotation = "0 0 1 43.5003";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9528.58 8031.41 100";rotation = "0 0 1 181.104";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "4";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9550.88 8025.84 100";rotation = "0 0 1 208.169";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9572.8 8003.44 100";rotation = "0 0 -1 114.945";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + %building = new (StaticShape) () {datablock = "DeployedZSpawnBase";position = "9482.44 7961.31 100";rotation = "0 0 1 64.9402";scale = "1 1 1";team = "1";ownerGUID = "2000343";powerFreq = "1";ZType = "1";isInTheMission="1";};TWM2MissionAspectsGroup.add(%building);%building.setSelfPowered();%building.getDatablock().gainPower(%building);%building.ZCLoop = schedule(1000, 0, "ZcreateLoop", %building); + TWM2PowerCheck(); + // + + %sp = "9528 7981 105"; + for(%i = 1; %i <= %group.participants; %i++) { + %spF = vectorAdd(%sp, getRandomPosition(5, 1)); + %group.participant[%i].player.setPosition(%spF); + // + %player = %group.participant[%i].player; + %player.setArmor("Medium"); //commando! + %player.clearInventory(); + %player.setInventory(S3Rifle, 1, true); + %player.setInventory(S3RifleAmmo, 10, true); + %player.ClipCount[S3RifleImage.ClipName] = mfloor(S3RifleImage.InitialClips * 2.5); + %player.setInventory(M1700, 1, true); + %player.setInventory(M1700Ammo, 1, true); + %player.ClipCount[M1700Image.ClipName] = mfloor(M1700Image.InitialClips * 2.5); + %player.setInventory(pistol, 1, true); + %player.setInventory(pistolAmmo, 10, true); + %player.ClipCount[pistolImage.ClipName] = pistolImage.InitialClips; + %player.setInventory(TargetingLaser, 1, true); + %player.setInventory(RepairKit,3); + %player.setInventory(Grenade,5); + %player.use(S3Rifle); + } + } +}; diff --git a/scripts/TWM2/Missions/TheShallowedCity.cs b/scripts/TWM2/Missions/TheShallowedCity.cs new file mode 100644 index 0000000..7f6544e --- /dev/null +++ b/scripts/TWM2/Missions/TheShallowedCity.cs @@ -0,0 +1,14 @@ +function OnTimeZeroTheShallowedCity(%group) { + for(%i = 1; %i <= %group.Participants; %i++) { + MessageClient(%group.Participant[%i], 'msgShip', "\c5Command: 10 minutes have expired, speed it up!."); + } +} + +function StartTWM2MisTheShallowedCity(%group) { + loadShallowedCity(%group); +} + +// +function loadShallowedCity(%group) { + +} diff --git a/scripts/TWM2/Objects/MedalSeal.cs b/scripts/TWM2/Objects/MedalSeal.cs new file mode 100644 index 0000000..47e643f --- /dev/null +++ b/scripts/TWM2/Objects/MedalSeal.cs @@ -0,0 +1,224 @@ +//-------------------------------------------------------------------------- +// Jumpad +//-------------------------------------------------------------------------- + +$TeamDeployableMax[MedalSealDeployable] = 9999; + +datablock StaticShapeData(DeployedMedalSeal) : StaticShapeDamageProfile { + className = "jumpad"; + shapeFile = "nexusbase.dts"; // dmiscf.dts, alternate + maxDamage = 2.0; + destroyedLevel = 2.0; + disabledLevel = 2.0; + mass = 1; + elasticity = 0.1; + friction = 0.9; + collideable = 1; + pickupRadius = 1; + sticky=false; + + impulse = 5000; + + hasLight = true; + lightType = "PulsingLight"; + lightColor = "0.1 0.8 0.8 1.0"; + lightTime = "100"; + lightRadius = "3"; + + explosion = HandGrenadeExplosion; + expDmgRadius = 3.0; + expDamage = 0.1; + expImpulse = 200.0; + dynamicType = $TypeMasks::StaticShapeObjectType; + deployedObject = true; + cmdCategory = "DSupport"; + cmdIcon = CMDSensorIcon; + cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor"; + + targetNameTag = 'SEAL'; + targetTypeTag = ''; + deployAmbientThread = true; + debrisShapeName = "debris_generic_small.dts"; + debris = DeployableDebris; + heatSignature = 0; +}; + +datablock ShapeBaseImageData(MedalSealDeployableImage) { + mass = 1; + emap = true; + shapeFile = "stackable1s.dts"; + item = MedalSealDeployable; + mountPoint = 1; + offset = "0 0 0"; + deployed = DeployedMedalSeal; + heatSignature = 0; + collideable = 1; + stateName[0] = "Idle"; + stateTransitionOnTriggerDown[0] = "Activate"; + + stateName[1] = "Activate"; + stateScript[1] = "onActivate"; + stateTransitionOnTriggerUp[1] = "Idle"; + + isLarge = true; + maxDepSlope = 360; // 30 + deploySound = ItemPickupSound; + + minDeployDis = 0.5; + maxDeployDis = 5.0; +}; + +datablock ItemData(MedalSealDeployable) { + className = Pack; + catagory = "Deployables"; + shapeFile = "stackable1s.dts"; + mass = 1; + elasticity = 0.2; + friction = 0.6; + pickupRadius = 1; + rotate = true; + image = "MedalSealDeployableImage"; + pickUpName = "a jump pad pack"; + heatSignature = 0; + emap = true; +}; + +function MedalSealDeployable::onPickup(%this, %obj, %shape, %amount) { + // created to prevent console errors +} + +function MedalSealDeployableImage::onDeploy(%item, %plyr, %slot) { + %className = "StaticShape"; + + %playerVector = vectorNormalize(-1 * getWord(%plyr.getEyeVector(),1) SPC getWord(%plyr.getEyeVector(),0) SPC "0"); + + if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1") + %item.surfaceNrm2 = %playerVector; + else + %item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 -1")); + + %deplObj = new (%className)() { + dataBlock = %item.deployed; + scale = "1 1 .2"; + }; + + // set orientation + %deplObj.setDeployRotation(getWords(%item.surfacePt, 0, 1) SPC getWord(%item.surfacePt, 2) + 0.1, %item.surfaceNrm); + + // set the recharge rate right away + if (%deplObj.getDatablock().rechargeRate) + %deplObj.setRechargeRate(%deplObj.getDatablock().rechargeRate); + + if (%deplObj.getTarget() != -1) + setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team); + + // set team, owner, and handle + %deplObj.team = %plyr.client.Team; + %deplObj.setOwner(%plyr); + + %deplObj.powerFreq = %plyr.powerFreq; + + // place the deployable in the MissionCleanup/Deployables group (AI reasons) + addToDeployGroup(%deplObj); + + //let the AI know as well... + AIDeployObject(%plyr.client, %deplObj); + + // play the deploy sound + serverPlay3D(%item.deploySound, %deplObj.getTransform()); + + $TeamDeployedCount[%plyr.team, %item.item]++; + + addDSurface(%item.surface,%deplObj); + return %deplObj; +} + +function DeployedMedalSeal::onCollision(%data,%obj,%col) { + if (%col.getClassName() !$= "Player") + return; + // + %needs = %obj.targetNeeds; + %error = %obj.targetNeedsInvalid; + // + if(%col.client.CheckNWChallengeCompletion(%needs)) { + toggleMedalSwitch(%obj, -1, %col); + } + else { + BottomPrint(%col.client, %error, 3, 5); + } +} + +function DeployedMedalSeal::onDestroyed(%this, %obj, %prevState) { + if (%obj.isRemoved) + return; + %obj.isRemoved = true; + Parent::onDestroyed(%this, %obj, %prevState); + $TeamDeployedCount[%obj.team, MedalSealDeployable]--; + remDSurface(%obj); + %obj.schedule(500, "delete"); + fireBallExplode(%obj,1); +} + +function MedalSealDeployableImage::onMount(%data, %obj, %node) { + %obj.hasJumpad = true; // set for jumpadcheck + %obj.packSet = 0; +} + +function MedalSealDeployableImage::onUnmount(%data, %obj, %node) { + %obj.hasJumpad = ""; + %obj.packSet = 0; +} + +function toggleMedalSwitch(%obj,%state,%col) { + if (%obj.isRemoved) + return; + // TODO - prevent switching while waiting for timed delay / cancel timed delay if switch is hit? + %switchDelay = 1000; + if (%state $= "") + %state = -1; + if (%col == 0 || %col $= "") + %force = true; + if (!%force) { + if (%col.getClassName() !$= "Player") + return; + if (%col.getState() $= "Dead" || %col.FFZapped == true) + return; + if (!(%obj.switchTime < getSimTime())) { + messageClient(%col.client, 'msgClient', '\c2Must wait %1 seconds between switching states.',mCeil((%obj.switchTime - getSimTime())/1000)); + return; + } + } + if ((%obj.isSwitchedOff || (%force == true && %state == true)) && !(%force == true && %state == false)) { + %state = true; + %obj.isSwitchedOff = ""; + } + else { + %state = false; + %obj.isSwitchedOff = true; + } + %switchCount = 0; + %count = getWordCount($PowerList); + // TODO - report number of successes and failures + for(%i=0;%i<%count;%i++) { + %powerObj = getWord($PowerList,%i); + if (vectorDist(%obj.getPosition(),%powerObj.getPosition()) < 200 + && !%powerObj.isRemoved && %obj.powerFreq == %powerObj.powerFreq + && %obj.team == %powerObj.team) { + toggleGenerator(%powerObj,%state); + %switchCount++; + } + } + if (%state == true) { + %obj.play3D(SwitchToggledSound); + %obj.playThread($AmbientThread,"ambient"); + if (!%force) + messageClient(%col.client, 'msgClient', '\c2%1 objects attempted switched on.',%switchCount); + } + else { + %obj.play3D(SwitchToggledSound); + %obj.stopThread($AmbientThread); + if (!%force) + messageClient(%col.client, 'msgClient', '\c2%1 objects attempted switched off.',%switchCount); + } + %obj.switchTime = getSimTime() + %switchDelay; +} diff --git a/scripts/TWM2/Objects/MissileSatellite.cs b/scripts/TWM2/Objects/MissileSatellite.cs new file mode 100644 index 0000000..f14370d --- /dev/null +++ b/scripts/TWM2/Objects/MissileSatellite.cs @@ -0,0 +1,203 @@ +// +datablock StaticShapeData(MissileShape) : StaticShapeDamageProfile { + shapeFile = "weapon_missile_projectile.dts"; + mass = 1.0; + repairRate = 0; + dynamicType = $TypeMasks::StaticShapeObjectType; + heatSignature = 0; +}; + +function CruiseMissileVehicle::onAdd(%this, %obj) { + Parent::onAdd(%this, %obj); + setTargetSensorGroup(%obj.getTarget(), %obj.team); + + %body = new StaticShape() { + scale = "20 20 20"; + datablock = MissileShape; + }; + MissionCleanup.add(%body); + %obj.mountObject(%body, 1); + %body.vehicleMounted = %obj; + + %obj.startFade(0,100,1); +} + +function CruiseMissileVehicle::deleteAllMounted(%data, %obj) { + + %body = %obj.getMountNodeObject(1); + if(!%body) { + return; + } + %body.delete(); +} +// +function CreateMissileSat(%client, %unlim, %rem) { + if(%unlim $= "" || !%unlim) { + %unlim = 0; + %rem = 0; + } + + if($Killstreak::GunshipSpawnLocation[$CurrentMission] $= "") { + %spawn = "0 -1000 400"; + } + else { + %spawn = $Killstreak::GunshipSpawnLocation[$CurrentMission]; + } + %sat = new FlyingVehicle() { + dataBlock = UAVVehicle; + position = %spawn; + rotation = "0 0 0 1"; + team = %client.team; + }; + MissionCleanUp.add(%sat); + setTargetSensorGroup(%sat.getTarget(), %client.team); + + %sat.GoPoint = 1; + GunshipForwardImpulse(%sat); + %sat.ScanLoop = schedule(500, 0, "GetNextGunshipPoint", %sat); + %client.player.lastTransformStuff = %client.player.getTransform(); + + %sat.team = %client.Team; + %sat.setOwner(%client.player); + + %sat.canLaucnhStrike = 1; + %sat.isUnlimitedSat = %unlim; + + MessageClient(%client, 'msgSatcom', "\c3UAMS: Satellite Moving to Position, Standby...."); + + if(!%unlim) { + %client.player.setPosition(VectorAdd(%x SPC %y SPC 0,$Prison::JailPos)); + + %client.setControlObject(%sat.turretObject); + %client.schedule(499, setControlObject, %sat.turretObject); + MissileSatControlLoop(%client, %sat); + } + else { + %client.setControlObject(%sat.turretObject); + commandToClient(%client, 'ControlObjectResponse', true, getControlObjectType(%sat.turretObject,%client.player)); + } + + if(%rem) { + %sat.turretObject.setAutoFire(true); + } +} + +function FireSatHornet(%sat, %slot, %source) { + %muzzlePos = %sat.getMuzzlePoint(%slot); + %muzzleVec = %sat.getMuzzleVector(%slot); + //Fiah + spawnprojectileSourceMod(HornetStrikeMissile, SeekerProjectile, %muzzlePos, %muzzleVec, %source); + ServerPlay3d(EscapePodLaunchSound, %sat.getPosition()); + ServerPlay3d(EscapePodLaunchSound2, %sat.getPosition()); +} + +function MissileSatelliteBarrel::onFire(%data, %obj, %slot) { + //echo(%obj); + if(%obj.mountobj.canLaucnhStrike) { + %client = %obj.getControllingClient(); + %source = %client.player; //muhaha + + %obj.mountobj.canLaucnhStrike = 0; + + FireSatHornet(%obj, %slot, %source); + schedule(1500, 0, "FireSatHornet", %obj, %slot, %source); + schedule(3000, 0, "FireSatHornet", %obj, %slot, %source); + + if(!%obj.mountobj.isUnlimitedSat) { + schedule(4000, 0, "MakeCruiseMissile", %client, %obj); + schedule(4000, 0, "ServerPlay3d", EscapePodLaunchSound2, %obj.getPosition()); + } + else { + schedule(30000, 0, "ResetSat", %obj.mountobj); + // + } + } + else { + if(!%obj.mountobj.isUnlimitedSat) { + return; + } + %client = %obj.getControllingClient(); + bottomPrint(%client, "Missiles are still reloading... standby.", 2, 2); + if(isObject(%client.player) && %client.player.getState() !$= "dead") { + %client.setControlObject(%client.player); + } + } +} + +function ResetSat(%sat) { + if(isObject(%sat)) { + %sat.canLaucnhStrike = 1; + } +} + +function MakeCruiseMissile(%client, %sat) { + if(%client.getControlObject() != %sat) { + return; + } + %Missile = new FlyingVehicle() { + dataBlock = "CruiseMissileVehicle"; + scale = "1 1 1"; + team = %client.team; + mountable = "0"; //drive only + }; + + setTargetSensorGroup(%Missile.getTarget(), %Missile.team); + %Missile.setTransform(vectorAdd(%sat.getPosition(), "0 0 -5") SPC rotFromTransform(%sat.getTransform())); + + %Missile.controller = %client; + %sat.GuidedMissile = %Missile; + MissionCleanup.add(%Missile); + %client.setControlObject(%Missile); + + MissileSatGuidedLoop(%client, %Missile); +} + +function ReMoveClientSW(%client) { + if(!isObject(%client.player) || %client.player.getState() $= "dead") { + return; + } + else { + %sp = Game.pickPlayerSpawn(%client, false); + //2 sec Invincibility please? + %client.player.setInvinc(1); + %client.player.schedule(2000, "setInvinc", 0); + %client.player.setTransform(%client.player.lastTransformStuff); //%sp for new spawn + %client.setControlObject(%client.player); + } +} + +//just a good function to delete the satelite if the client reliquishes control +function MissileSatControlLoop(%client, %sat) { + if(!isObject(%sat)) { + if(isObject(%client.player)) { + ReMoveClientSW(%client); + } + return; + } + if((%client.getControlObject() != %sat.turretObject) && !%sat.isUnlimitedSat) { + //lets check if they are in the missile now... + if(%client.getControlObject() == %sat.turretObject.GuidedMissile) { + //MissileSatGuidedLoop(%client, %sat.turretObject.GuidedMissile); + } + //No, they reliquished all control before the guided fired... + else { + if(isObject(%client.player)) { + ReMoveClientSW(%client); + } + } + %sat.schedule(1000, "Delete"); + return; + } + //%client.setControlObject(%sat.turretObject); + schedule(100, 0, "MissileSatControlLoop", %client, %sat); +} + +function MissileSatGuidedLoop(%client, %missile) { + if(%client.getControlObject() != %missile) { + if(isObject(%client.player)) { + ReMoveClientSW(%client); + } + return; + } + schedule(100, 0, "MissileSatGuidedLoop", %client, %missile); +} diff --git a/scripts/TWM2/PGDConnect/ConnectionQueue.cs b/scripts/TWM2/PGDConnect/ConnectionQueue.cs new file mode 100644 index 0000000..938d7bb --- /dev/null +++ b/scripts/TWM2/PGDConnect/ConnectionQueue.cs @@ -0,0 +1,265 @@ +//ConnectionQueue.cs +//Phantom139 for TWM2 +//This script manages multiple connection handlers. + +$TCP::GenericServerPort = 80; +$TCP::ConnectionContainer = new ScriptObject() { + class = "TCPConnectionList"; + + connectionStatus = 0; //Current status indicated by object + currentConnection = ""; //Current web address connected to + currentSeparator = ""; //Used for FORM POST data separation + currentTask = ""; //Current function being used by the container + dropConnection = 1; //Auto Drop after task completion + dropTimer = 7500; //time in MS until autoDrop is performed + + useHTTP = 0; //switch to the HTTP Object + + requestData = ""; + + //create the inner TCP object for controlling the connections + //TCPConnection = new TCPObject(PGDConnection) {}; + TCPQueue[0] = ""; +}; +$TCP::ConnectionObject = new TCPObject(PGDConnection); +$HTTP::ConnectionObject = new HTTPObject(PGDConnection_HTTP); +$BufferLine = 0; + +//control functions for the connection list +function TCPConnectionList::establishConnection(%this) { + %this.currentTask = %this@".establishConnection();"; + if(%this.TCPQueue[0] $= "") { + error("Task breakoff, queue slot 0 is empty but attempt to a connection?"); + return; + } + + if(%this.useHTTP) { + //echo("* Switching to HTTP Object connection for file download"); + echo("Getting: "@getField(%this.TCPQueue[0], 0)@" => "@getField(%this.TCPQueue[0], 1)@""); + $Buffer[$HTTP::ConnectionObject] = -1; + $HTTP::ConnectionObject.get(getField(%this.TCPQueue[0], 0)@":80", getField(%this.TCPQueue[0], 1)); + %this.useHTTP = 0; + } + else { + //%request = %this.call(getField(%this.TCPQueue[0], 2), getField(%this.TCPQueue[0], 3)); + //echo(%this@"."@getField(%this.TCPQueue[0], 2)@"("@getField(%this.TCPQueue[0], 3)@");"); + %request = eval(%this@"."@getField(%this.TCPQueue[0], 2)@"("@getField(%this.TCPQueue[0], 3)@");"); + //echo("Request: "@%request); + %this.requestData = %request; + + if(%this.requestData $= "NIL_REQUEST") { + //task has been invalidated for some reason, push next one on the queue + %this.performNextTask(); + return; + } + + $TCP::ConnectionObject.connect(getField(%this.TCPQueue[0], 0) @ ":" @ $TCP::GenericServerPort); + if(%this.dropConnection) { + %this.autoDrop = $TCP::ConnectionObject.schedule(%this.dropTimer, "disconnect"); + } + } +} + +function TCPConnectionList::addTaskToList(%this, %host, %location, %task, %args) { + %this.currentTask = %this@".addTaskToList("@%host@", "@%location@", "@%task@", "@%args@");"; + //echo("Adding TCP: "@%host@":"@%location@" === "@%task@" ("@%args@")"); + + if(%this.TCPQueue[0] $= "") { + //front of the list. + %this.TCPQueue[0] = %host TAB %location TAB %task TAB %args; + if(%task $= "http") { + %this.useHTTP = 1; + } + %this.establishConnection(); //connect now. + } + else { + %check = 1; + while(%this.TCPQueue[%check] !$= "") { + %check++; + } + %this.TCPQueue[%check] = %host TAB %location TAB %task TAB %args; + } +} + +function TCPConnectionList::performNextTask(%this) { + cancel(%this.autoDrop); + %this.currentTask = %this@".performNextTask();"; + + if(%this.TCPQueue[1] !$= "") { + //there is another task in the list, update the list + %this.TCPQueue[0] = ""; //this task is complete + %check = 1; + while(%this.TCPQueue[%check] !$= "") { + %this.TCPQueue[%check-1] = %this.TCPQueue[%check]; + %this.TCPQueue[%check] = ""; + %check++; + } + echo("Performing next task"); + if(getField(%this.TCPQueue[0], 2) $= "http") { + %this.useHTTP = 1; + } + %this.establishConnection(); + } + else { + echo("No next task, completing"); + %this.TCPQueue[0] = ""; + } +} + +function TCPConnectionList::getRandomSeperator(%this, %length) { + %this.currentTask = %this@".getRandomSeperator("@%length@");"; + + %alphanumeric = "abcdefghijklmnopqrstuvwxyz0123456789"; + for(%i = 0; %i < %length; %i++) { + %index = getRandom(strLen(%alphanumeric)); + %letter = getSubStr(%alphanumeric, %index, 1); + %UpperC = getRandom(0, 1); + if(%UpperC) { + %letter = strUpr(%letter); + } + else { + %letter = strLwr(%letter); + } + %seq = %seq @ %letter; + } + + %this.currentSeparator = %seq; +} + +function TCPConnectionList::makeDisposition(%this, %_name, %_content, %_isEnd) { + %this.currentTask = %this@".makeDisposition("@%_name@", "@%_content@", "@%_isEnd@");"; + + if(%_isEnd) { + %dispo = "--" @ %this.currentSeparator @ "\r\nContent-Disposition: form-data; name=\""@%_name@"\"\r\n\r\n"@%_content@"\r\n--" @ %this.currentSeparator @ "--"; + } + else { + %dispo = "--" @ %this.currentSeparator @ "\r\nContent-Disposition: form-data; name=\""@%_name@"\"\r\n\r\n"@%_content@"\r\n"; + } + return %dispo; +} + +function TCPConnectionList::makeUploadDisposition(%this, %_name, %_content, %_fileContent, %_isEnd) { + %this.currentTask = %this@".makeUploadDisposition("@%_name@", "@%_content@", "@%_fileContent@", "@%_isEnd@");"; + + if(%_isEnd) { + %dispo = "--" @ %this.currentSeparator @ "\r\nContent-Disposition: form-data; name=\""@%_name@"\"; filename=\""@%_content@"\"\r\nContent-Type: application/octet-stream\r\n"@%_fileContent@"\r\n--" @ %this.currentSeparator @ "--"; + } + else { + %dispo = "--" @ %this.currentSeparator @ "\r\nContent-Disposition: form-data; name=\""@%_name@"\"; filename=\""@%_content@"\"\r\nContent-Type: application/octet-stream\r\n"@%_fileContent@"\r\n"; + } + return %dispo; +} + +function TCPConnectionList::assembleHTTP1_1Header(%this, %_command, %_userAgent, %_extra) { + %this.currentTask = %this@".assembleHTTP1_1Header("@%_command@", "@%_userAgent@", "@%_extra@");"; + %header = %_command SPC getField(%this.TCPQueue[0], 1) SPC "HTTP/1.1\r\n" @ + "Host: "@getField(%this.TCPQueue[0], 0)@"\r\n" @ + "User-Agent: "@%_userAgent@"\r\nConnection: close\r\n" @ + %_extra; + return %header; +} + +function TCPConnectionList::dropConnection(%this) { + %this.currentTask = %this@".dropConnection();"; + $TCP::ConnectionObject.disconnect(); +} + +//functions for the TCP object alone +function PGDConnection::onConnected(%this) { + //--$PGDConnection::Connected = true; + if($DebugMode) { + echo("DEBUG: "@$TCP::ConnectionContainer.requestData); + } + $TCP::ConnectionContainer.connectionStatus = 0; + %this.doingSomething = true; + %this.response = ""; + %this.send($TCP::ConnectionContainer.requestData); +} + +function PGDConnection::onConnectFailed( %this ) { + //--$PGDConnection::Connected = false; + $TCP::ConnectionContainer.connectionStatus = 1; + %this.response = "CERROR_CONNECTFAILED"; + //CloseMessagePopup(); + //MessageBoxOK("Connection Error", "Unable to connect to a server \nPlease try again later."); + error("Connection Error Occured"); + //move up the task list + $TCP::ConnectionContainer.currentConnection = ""; + $TCP::ConnectionContainer.currentTask = ""; + $TCP::ConnectionContainer.performNextTask(); +} + +function PGDConnection::onDNSFailed( %this ) { + //--$PGDConnection::Connected = false; + $TCP::ConnectionContainer.connectionStatus = 2; + %this.response = "CERROR_DNSFAIL"; + //CloseMessagePopup(); + //MessageBoxOK("DNS Error", "Your DNS server was unable to resolve a host name \nPlease try again later."); + error("DNS Error Occured"); + //move up the task list + $TCP::ConnectionContainer.currentConnection = ""; + $TCP::ConnectionContainer.currentTask = ""; + $TCP::ConnectionContainer.performNextTask(); +} + +function PGDConnection::onLine(%this, %line) { + if($debugMode) { + echo(%line); + } + + if (trim(%line) $= "") { //is the line a HTTP header? + if (!%this.readyToRead) { + %this.readyToRead = true; + } + } + if(!%this.readyToRead) { + return; //we have no use for this. + } + + %this.response = %this.response @ %line; + if(%this.lineEval !$= "") { + eval(%this@"."@%this.lineEval@"("@%line@");"); + //%this.call(%this.lineEval, %line); + } +} + +function PGDConnection::onDisconnect(%this) { + $TCP::ConnectionContainer.connectionStatus = 0; + $TCP::ConnectionContainer.currentConnection = ""; + $TCP::ConnectionContainer.currentTask = ""; + // + $TCP::ConnectionContainer.performNextTask(); + // + if(isSet(%this.finishFunction)) { + eval(%this@"."@%this.finishFunction@"("@%this.response@");"); + //%this.call(%this.finishFunction, %this.response); + } +} + +//===== HTTP ===== +function PGDConnection_HTTP::onLine(%this, %line) { + if($debugMode) { + echo(%line); + } + + //full line evaluations are not supported by HTTP objects + //we must use a buffer to safely transmit data instead + $Buffer[%this, $Buffer[%this]++] = %line; + if(%this.lineEval !$= "") { + eval(%this@"."@%this.lineEval@"("@%line@");"); + //%this.call(%this.lineEval, %line); + } +} + +function PGDConnection_HTTP::onDisconnect(%this) { + $TCP::ConnectionContainer.connectionStatus = 0; + $TCP::ConnectionContainer.currentConnection = ""; + $TCP::ConnectionContainer.currentTask = ""; + // + $TCP::ConnectionContainer.performNextTask(); + // + if(isSet(%this.finishFunction)) { + eval(%this@"."@%this.finishFunction@"();"); + //%this.call(%this.finishFunction, %this.response); + } +} diff --git a/scripts/TWM2/PGDConnect/ServerInteraction.cs b/scripts/TWM2/PGDConnect/ServerInteraction.cs new file mode 100644 index 0000000..dd4840b --- /dev/null +++ b/scripts/TWM2/PGDConnect/ServerInteraction.cs @@ -0,0 +1,96 @@ +// ============================================================ +// Project : TWM2 +// File : .\scripts\TWM2\PGDConnect\ServerInteraction.cs +// Copyright : 2010, Phantom Games Development +// Author : Robert Fritzen (Phantom139) +// Created on : Tuesday, November 02, 2010 9:15 AM +// +// Editor : TorqueDev v. 1.2.3430.42233 +// +// Description : Handles the server interactions with PGD +// : Servers: [CORE] [SATELITE] +// ============================================================ + +$Generic_Rank_Cap = 75000; //if we cannot get a valid connection +$TWM2Core_Interface = "www.phantomdev.net" TAB "www.tacticaluprising.phantomdev.net"; //don't touch, server connections +$TWM2ServerInfo_Loc = "/ssiInterface.php"; + +//connects to the server +function establishPGDConnection() { + echo("ServerInteraction Initiated... wait for connection..."); + if (!isObject(serverInterfacing)) { + %connection = new TCPObject(serverInterfacing); + } + else { + %connection = serverInterfacing; + } + %connection.connect(getField($TWM2Core_Interface, 1) @ ":" @ $PGDPort); + //set the code! + $TWM2Core_Code = sha1sum($TWM2Core_Interface TAB formattimestring("yymmdd")); + //schedule next interaction with the server + schedule(60000 * 30, 0, "establishPGDConnection"); //every 30 minutes is good. +} + +function establishPGDConnection_manual() { + echo("ServerInteraction Initiated... wait for connection..."); + if (!isObject(serverInterfacing)) { + %connection = new TCPObject(serverInterfacing); + } + else { + %connection = serverInterfacing; + } + %connection.connect(getField($TWM2Core_Interface, 1) @ ":" @ $PGDPort); + //set the code! + $TWM2Core_Code = sha1sum($TWM2Core_Interface TAB formattimestring("yymmdd")); +} + +// +function serverInterfacing::onConnected(%this) { + echo("Connection established with Phantom Games Development (www.phantomdev.net)"); + %this.schedule(15000, "disconnect"); + %loc = $TWM2ServerInfo_Loc; + %query = "GET" SPC %loc SPC "HTTP/1.1\x0aHost: "@getField($TWM2Core_Interface, 1)@"\r\n\r\n"; + + echo("Sending Request Query to Phantom Games Server."); + %this.send(%query); +} + +function serverInterfacing::onLine(%this, %line) { + if (trim(%line) $= "") { //is the line a HTTP header? + if (!%this.readyToRead) { + %this.readyToRead = true; + } + } + if(!%this.readyToRead) { + return; //we have no use for this. + } + //read necessary data + switch$(getWord(%line, 0)) { + case "SetEXPCap": + $EXPCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))] = getWord(%line, 1); + echo("PGD: Daily Rank Cap Has Been Set To: "@getWord(%line, 1)@""); + for(%i = 0; %i < ClientGroup.getCount(); %i++) { + %client = ClientGroup.getObject(%i); + %client.TWM2Core.noMoreEXP[sha1sum(formattimestring("yymmdd"))] = 0; + } + case "ApplyDevList": + %list = getWords(%line, 1); + %list = strreplace(%list, "TAB", "\t"); //boom! + for(%i = 0; %i < getFieldCount(%list); %i++) { + %FieldGUID = getSubStr(getField(%list, %i), 0, strstr(getField(%list, %i), ":")); + %FieldLEVEL = getSubStr(getField(%list, %i), strLen(%FieldGUID) + 1, strLen(getField(%list, %i))); + $DeveloperList[%i] = %FieldGUID; + $DeveloperLevel[%i] = %FieldLEVEL; + echo("Developers "@%i@": "@$DeveloperList[%i]@" -> "@$DeveloperLevel[%i]@""); + } + case "SetHighRank": + $RankCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))] = getWord(%line, 1); + echo("PGD: Highest Rank Set To "@getWord(%line, 1)@""); + case "SetHighOfficer": + $OfficerCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))] = getWord(%line, 1); + echo("PGD: Highest Officer Rank Set To "@getWord(%line, 1)@""); + case "SetEXPMultiplier": + $EXPMulti[$TWM2Core_Code, formattimestring("yymmdd"), sha1sum($TWM2Core_Code TAB FormatTWM2Time(formattimestring("yymmdd")))] = getWord(%line, 1); + echo("PGD: EXP Multiplier is now: "@getWord(%line, 1)@""); + } +} diff --git a/scripts/TWM2/PGDConnect/UniversalLoading.cs b/scripts/TWM2/PGDConnect/UniversalLoading.cs new file mode 100644 index 0000000..0adc650 --- /dev/null +++ b/scripts/TWM2/PGDConnect/UniversalLoading.cs @@ -0,0 +1,51 @@ +// ---- PGD Loader ------------------------------------------------------------- +function LoadUniversalBuilding(%client, %file) { + %server = ""@$PGDServer@":"@$PGDPort@""; + %filename = "/public/Univ/Data/"@%client.guid@"/Buildings/"@%file@".cs"; + if (!isObject(Univ_Loader)) { + %Downloader = new HTTPObject(Univ_Loader){}; + } + else { + %Downloader = Univ_Loader; + } + //If the server crashes here, let everyone know why + MessageAll('MsgAdminForce', "\c3"@%client.namebase@" is loading a universally saved building."); + echo("Client:" SPC %client.namebase SPC "requests universal load."); + %Downloader.client = %client; + %Downloader.load = %file; + %Downloader.valid = 1; + $PGDBuffer[%client, %file] = ""; + %Downloader.get(%server, %filename); +} + +function Univ_Loader::onLine(%this, %line) { + %validity = ScanForValidLine(%line); + if(!%validity) { + messageClient(%this.client, 'MsgClient', "\c5PGD: ERROR, you are requesting a corrupted file."); + messageClient(%this.client, 'MsgClient', "\c5Corrupted files contain custom content not signed by the server."); + messageClient(%this.client, 'MsgClient', "\c5ABORTING CONNECTION."); + %this.valid = 0; + %this.disconnect(); + return; + } + $PGDBuffer[%this.client, %this.load] = $PGDBuffer[%this.client, %this.load] @ "\n" @ %line; +} + +function Univ_Loader::onConnectFailed(%this) { + error("-- Could not connect to PGD."); + messageClient(%this.client, 'MsgClient', "\c5PGD: Your Building could not be loaded, the server may be offline or going through maintenance."); + error("Universal Load: fail (connection)"); +} + +function Univ_Loader::onDisconnect(%this) { + if(!%this.valid) { + echo("Universal Load: Corrupt File"); + $PGDBuffer[%this.client, %this.load] = ""; //clear the buffer. + %this.delete(); + return; + } + eval($PGDBuffer[%this.client, %this.load]); //evaluate the buffer here, which will make things much faster. + $PGDBuffer[%this.client, %this.load] = ""; //clear the buffer. + echo("Universal Load: OK"); + %this.delete(); +} diff --git a/scripts/TWM2/PGDConnect/UniversalRanks.cs b/scripts/TWM2/PGDConnect/UniversalRanks.cs new file mode 100644 index 0000000..4c04850 --- /dev/null +++ b/scripts/TWM2/PGDConnect/UniversalRanks.cs @@ -0,0 +1,251 @@ +//UniversalRanks.cs +//Coded: 1-2-10 +//By: Phantom139, And alot of improvements by Signal360 + +//This script handles all TCP Object related code for the Universal Rank System +//It will access the server to check for a universal rank file, if it exists, it +//deletes the local file and downloads the unioversal one for use, if it does not +//exist it scans the server to see if it is a "Main" Server. If the server is "Main", +//The rank is saved to the universal server for usage in other servers. + +//------------------------------------------------------------------------ +//This first part of the script is the IsServerMain Handler. +//It Downloads the server key from PGD and verifies it to the key +//The Server Host Specifies. +//------------------------------------------------------------------------ +$ServerType = "Satellite Server"; +$PGDDebugMode = 0; +function currentEpochTime() { + rubyEval("tsEval '$temp=' + Time.now.to_i.to_s + ';'"); + return $temp; +} + +function CreateHash(%user, %password, %name) { + //%salt = base64_encode(formatTimeString("dd.mm.yy-nn")); //prevent a replay attack? + %epoch = currentEpochTime(); //now using epoch time for a better salt + %salt = base64_encode(getSubStr(%epoch, 0, strLen(%epoch)-3)); // removing last second to prevent problems + %nonce = sha1sum(%user @ %name); // if there is a small delay, it also means + %str = %user @ ":" @ %password; // the hash will be different every 10 secs. + %hash = sha1sum(%nonce @ sha1sum(%str) @ %salt); + if($PGDDebugMode == 1) { + MessageDevs("\c3Epoch: "@getSubStr(%epoch, 0, strLen(%epoch)-2)@""); + MessageDevs("\c3Salt: "@%salt@""); + MessageDevs("\c3Nonce: "@%nonce@""); + MessageDevs("\c3Hash: "@%hash@""); + } + return %hash; +} + +function IsServerMain() { + if($ServerType $= "Core Server") + return 1; + else + return 0; +} +//function GetKey(){CheckCore();} + +function CheckCore() { + echo("*PGD: Performing Server Core Status Check"); + $TCP::ConnectionContainer.addTaskToList($PGDServer, + $PGDKeyHandler, + "generatePGDCoreCheck", + ""); +} + +function TCPConnectionList::generatePGDCoreCheck(%this) { + echo("*Generating Request"); + %user = getField($TWM2::PGDCredentials, 0); + %password = getField($TWM2::PGDCredentials, 1); + %name = sha1Sum($Host::GameName); + %hash = CreateHash(%user, %password, %name); + + %this.getRandomSeperator(16); + %header = %this.assembleHTTP1_1Header("POST", "Tribes 2", "Content-Type: multipart/form-data; boundary="@%this.currentSeparator@"\r\n"); + %dispo = %this.makeDisposition(user, %user); + %dispo = %dispo @ %this.makeDisposition(hash, %hash); + %dispo = %dispo @ %this.makeDisposition(gname, %name, 1); + + %header = %header @ "Content-Length: " @ strLen(%dispo) @ "\r\n\r\n"; + + $TCP::ConnectionObject.serverIndex = %counter; + $TCP::ConnectionObject.lineEval = "validatePGDCore"; + return %header @ %dispo; +} + +function PGDConnection::validatePGDCore(%this, %line) { + if(strStr(%line, "pgd_debug") != -1) { + if($PGDDebugMode == 1) { + MessageDevs("\c5PGD DEBUG:" SPC %line); + } + } + if (trim(%line) $= "yes") + $ServerType = "Core Server"; + else if (trim(%line) $= "no") + $ServerType = "Satellite Server"; +} + +//------------------------------------------------------------------------ +//This second part of the script handles the downloading of existing files +//It uses the PGDISFile from UniversalSupport.cs as well as scans for a current +//file. +//------------------------------------------------------------------------ + +function LoadUniversalRank(%client) { + //A Little PGD Connect Ad. + %client.donotupdate = 1; + if(!%client.IsPGDConnected()) { + %client.donotupdate = 0; + messageClient(%client, 'msgPGDRequired', "\c5PGD: PGD Connect account required to load universal ranks."); + messageClient(%client, 'msgPGDRequired', "\c5PGD: Sign up for PGD Connect today, It's Fast, Easy, and FREE!"); + messageClient(%client, 'msgPGDRequired', "\c5See: www.public.phantomdev.net/SMF/ in the PGD Section"); + messageClient(%client, 'msgPGDRequired', "\c5For more details."); + schedule(500, 0, "LoadClientRankfile", %client); + return 1; + } + //IS FILE + if(!PGD_IsFile("Data/"@%client.guid@"/Ranks/TWM2/Saved.TWMSave")) { + %client.donotupdate = 0; + messageClient(%client, 'msgPGDRequired', "\c5PGD: PGD Connect confirms you do not have a universal rank."); + messageClient(%client, 'msgPGDRequired', "\c5PGD: Play on a main server to start progressing one today!"); + messageClient(%client, 'msgPGDRequired', "\c5PGD: Loading your local rank file for the time being..."); + schedule(500, 0, "LoadClientRankfile", %client); + return 1; + } + //Passed, we have a universal rank, time to loady :) + MessageClient(%client, 'msgAccess', "\c5PGD: Universal Rank Load Requested, adding to connection queue, please standby."); + echo("Client:" SPC %client.namebase SPC "needs universal rank load. It will be stored locally."); + //Cache Create + %file = "/public/Univ/Data/"@%client.guid@"/Ranks/TWM2/Saved.TWMSave"; + $HTTP::ConnectionObject.client = %client; + $HTTP::ConnectionObject.finishFunction = "onCompleteRankDownload"; + $TCP::ConnectionContainer.addTaskToList($PGDServer, + %file, + "http", + ""); +} + +function PGDConnection_HTTP::onCompleteRankDownload(%this) { + echo("download complete... evaluating and applying rank"); + %client = %this.client; + + %fileO = new FileObject(); + %fileO.openForWrite($TWM::RanksDirectory@"/"@%this.client.guid@"/Saved.TWMSave"); + for (%i = 0; %i < $Buffer[%this]; %i++) { + %fileO.writeLine($Buffer[%this, %i]); + $Buffer[%this, %i] = ""; + } + $Buffer[%this] = 0; + %fileO.close(); + %fileO.delete(); + + schedule(100, 0, LoadClientRankFile, %client); + + messageClient(%client, 'msgComplete', "\c3PGD: Your rank has been successfully downloaded."); +} + +//------------------------------------------------------------------------ +//This third part of the script handles the uploading of rank files +//It uses the IsServerMain above to check if the server is "Allowed" to upload +//rank files. If it can, it handles the uploading. +//------------------------------------------------------------------------ + +function PrepareUpload(%client) { + if (!isServerMain()) { + return; + } + if(!%client.IsPGDConnected()) { + messageClient(%client, 'msgPGDRequired', "\c5PGD: PGD Connect account required to perform this action."); + } + else { + messageClient(%client, 'msgPGDRequired', "\c5PGD: Adding your upload request to the connection queue list."); + $TCP::ConnectionContainer.client = %client; + $TCP::ConnectionContainer.addTaskToList($PGDServer, + $PGDPHPRankUploadHandler, + "GeneratePGDUploadRequest", + ""); + } +} + +function TCPConnectionList::GeneratePGDUploadRequest(%this) { + //pre-generation stuff + + %client = %this.client; + %file = $TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave"; + %fileBase = FileBase(%file) @ ".TWMSave"; + %fileCont = getFileContents(%file); + + %user = getField($TWM2::PGDCredentials, 0); + %password = getField($TWM2::PGDCredentials, 1); + %name = sha1Sum($Host::GameName); + %hash = CreateHash(%user, %password, %name); + + %this.getRandomSeperator(16); + %header = %this.assembleHTTP1_1Header("POST", "Tribes 2", "Content-Type: multipart/form-data; boundary="@%this.currentSeparator@"\r\n"); + %dispo = %this.makeDisposition(guid, %client.guid); + %dispo = %dispo @ %this.makeDisposition(user, %user); + %dispo = %dispo @ %this.makeDisposition(hash, %hash); + %dispo = %dispo @ %this.makeDisposition(gname, %name); + %dispo = %dispo @ %this.makeDisposition(version, $TWM2::Version); + %dispo = %dispo @ %this.makeDisposition(mod, "TWM2"); + %dispo = %dispo @ %this.makeUploadDisposition(uploadedfile, %fileBase, %fileCont, 1); + + %header = %header @ "Content-Length: " @ strLen(%dispo) @ "\r\n\r\n"; + + $TCP::ConnectionObject.client = %client; + $TCP::ConnectionObject.lineEval = "evalRankUpload"; + return %header @ %dispo; +} + +//Handle Errors +function PGDConnection::evalRankUpload(%this, %line) { + if($PGDDebugMode) + echo(%line); + %ok = false; + if(strStr(%line, "pgd_ban") != -1) { + messageClient(%this.client, 'msgPGDRequired', "\c2PGD: You are banned. \c3"@%line@"."); + } + if(strStr(%line, "pgd_debug") != -1) { + if($PGDDebugMode == 1) { + MessageDevs("\c5PGD DEBUG:" SPC %line); + } + } + switch$ (%line) { + case "file_upload_ok": + %ok = true; + messageClient(%this.client, 'msgdone', "\c5PGD: Your Rank was saved successfully."); + case "not_registered": + messageClient(%this.client, 'msgPGDRequired', "\c5PGD: PGD Connect account required to perform this action."); + case "incompatible_version": + error("PGD: This version is no longer supported by PGD Ranks"); + messageClient(%this.client, 'msgPGDRequired', "\c5PGD: This version of TWM2 is no longer supported."); + case "invalid_hash": + messageClient(%this.client, 'msgPGDRequired', "\c5PGD: The authentication hash sent to the server"NL + "was not valid. (invalid characters, or no input!)"); + $ServerType = "Satellite Server"; + case "incorrect_hash": + messageClient(%this.client, 'msgPGDRequired', "\c5PGD: The authentication hash sent to the server"NL + "was not correct."); + $ServerType = "Satellite Server"; + case "invalid_guid": + messageClient(%this.client, 'msgPGDRequired', "\c5PGD: Your GUID had invalid characters in it,"NL + "try again, when it hasn't been tampered with >_>"); + case "no_guid_input": + messageClient(%this.client, 'msgPGDRequired', "\c5PGD: No GUID was sent to the server. Try again!"); + case "bad_user": + messageClient(%this.client, 'msgPGDRequired', "\c5PGD: The username for this server was not filled"NL + "in, or it had invalid characters in it."); + $ServerType = "Satellite Server"; + case "bad_version_input": + messageClient(%this.client, 'msgPGDRequired', "\c5PGD: The version field was not filled in."); + case "save_denied": + messageClient(%this.client, 'msgPGDRequired', "\c5PGD: The server has denied your file save request."); + case "sql_error": + messageClient(%this.client, 'msgPGDRequired', "\c5PGD: There is a problem with the SQL database on the server!"); + default: + return; + } + if ( %ok ) + echo( "Universal Rank Save: OK" ); + else + error( "Universal Rank Save: fail (" @ %line @ ")" ); +} diff --git a/scripts/TWM2/PGDConnect/UniversalSaving_Client.cs b/scripts/TWM2/PGDConnect/UniversalSaving_Client.cs new file mode 100644 index 0000000..64111cd --- /dev/null +++ b/scripts/TWM2/PGDConnect/UniversalSaving_Client.cs @@ -0,0 +1,151 @@ +//Universal Saving System +//By Phantom139 + +//Client Script +//1. Creates and Manages the connection to the PGD Server. +//2. Handles Clients Trying To Save. +//3. Handles the file to be saved. +//4. Sends the File to the server. +//5. Deletes Saved Files on the Server + +function GameConnection::IsPGDConnected(%client) { + %guid = %client.guid; + if(!%client) { + return 0; + } + if($PGD::IsPGDConnected[%guid] $= "") { + %client.CheckPGDConnect(); + return %client.schedule(2000, "IsPGDConnected"); + } + else { + return $PGD::IsPGDConnected[%guid]; + } +} +//---------- PGD Saving -------------------------------------------------------- + +function GameConnection::CheckPGDConnect(%client) { + %guid = %client.guid; + %server = ""@$PGDServer@":"@$PGDPort@""; + if (!isObject(GUIDGrabber)) + %Downloader = new HTTPObject(GUIDGrabber){}; + else %Downloader = GUIDGrabber; + %filename = "/Univ/IsConnected.php?guid="@%guid@""; //File Location + %Downloader.guid = %guid; + %Downloader.get(%server, %filename); +} + +function GUIDGrabber::onLine(%this, %line) { + %txt = deTag(%line); + if (strstr(%txt, "yes")) { + $PGD::IsPGDConnected[%this.guid] = 1; + %this.disconnect(); + %this.schedule(1000, delete); + } + else { + $PGD::IsPGDConnected[%this.guid] = 0; + %this.disconnect(); + %this.schedule(1000, delete); + } +} + +function Univ_ServerConnect(%client, %file, %svDl) { + %connection = Univ_SaveClient; + if(!%client || %client $= "") { + error("Error: No Client Specified"); + return; + } + if(!isFile(%file)) { + error("Error: File specified does not exist, or is a non permitted file type"); + return; + } + //We already have an existing connection, Lets Delete it + if (isObject(%connection)) { + %connection.disconnect(); + %connection.delete(); + } + new TCPObject(%connection); + %connection.client = %client; + %connection.guid = %client.guid; + if(%svDl $= "Save") { + %connection.save = 1; + if(!%client.IsPGDConnected()) { + messageClient(%client, 'msgPGDRequired', "\c5PGD: PGD Connect account required to perform this action."); + return; + } + else { + %len = GetFileLength(%file); + %connection.orgfile = %file; + %connection.file = %file; //what are we sending? + %connection.filebase = FileBase(%file) @ ".cs"; + } + %connection.connect(""@$PGDServer@":"@$PGDPort@""); + } + else { + %connection.fileTag = FileBase(%file); //what are we sending? + %connection.delete = 1; + %connection.connect(""@$PGDServer@":"@$PGDPort@""); + } +} + +function Univ_SaveClient::onConnected(%this) { + %this.schedule(15000, "disconnect"); + if(%this.save == 1) { + %sep = getRandomSeparator(16); + %filecont = getFileContents(%this.orgfile); + %loc = $PGDPHPUploadHandler; + %header1 = "POST" SPC %loc SPC "HTTP/1.1\r\n"; + %host = "Host: "@$PGDServer@"\r\n"; + %header2 = "Connection: close\r\nUser-Agent: Tribes 2\r\n"; + %contType = "Content-Type: multipart/form-data; boundary="@%sep@"\r\n"; + %guidReq = "--"@%sep@"\r\nContent-Disposition: form-data; name=\"guid\"\r\n\r\n"@%this.guid@""; + %fileReq = "--"@%sep@"\r\nContent-Disposition: form-data; name=\"uploadedfile\"; filename=\""@%this.filebase@"\"\r\nContent-Type: application/octet-stream"; + %payload = %guidReq@"\r\n"@%filereq@"\r\n"@%filecont@"--"@%sep@"--"; + %qlen = strLen(%payload); + %contentLeng = "Content-Length: "@%qlen@"\r\n\r\n"; + %query = %header1@%host@%header2@%contType@%contentLeng@%payload; + echo("Connected to Phantom Games Server, Sending File Data..."); + %this.send(%query); + } + else { + %loc = $PGDPHPDelHandler@"?guid="@%this.guid@"&filetokill="@%this.file@""; + %query = "GET" SPC %loc SPC "HTTP/1.1\x0aHost: "@$PGDServer@"\r\n\r\n"; + echo("Sending:"SPC%query); + echo("Connected to Phantom Games Server, Deleting File"); + %this.send(%query); + } +} + +function Univ_SaveClient::get(%connection, %server, %query) { + %connection.server = %server; + %connection.query = %query; + %connection.connect(%server); +} + +//Handle Errors +function Univ_SaveClient::onLine(%this, %line) { + //echo("PGD Server Response: "@%line@"."); + if(strstr(%line, "file_upload_ok") != -1) { + messageClient(%this.client, 'msgdone', "\c5PGD: Your File was Saved Successfully."); + echo("Universal Save: OK"); + } + else if(strstr(%line, "not_registered") != -1) + { + messageClient(%client, 'msgPGDRequired', "\c5PGD: PGD Connect account required to perform this action."); + } + else + { + error("PGD Error: "@%line); + } +} + +function Univ_SaveClient::onDisconnect(%this) { + %this.delete(); +} + +function Univ_SaveClient::onConnectFailed(%this) { + error("-- Could not connect to PGD."); + messageClient(%this.client, 'MsgClient', "\c5PGD: Your Building could not be saved, the server may be offline or going through maintenance."); + error("Universal Save: fail (connection)"); + %this.delete(); + return; +} diff --git a/scripts/TWM2/PGDConnect/UniversalSupport.cs b/scripts/TWM2/PGDConnect/UniversalSupport.cs new file mode 100644 index 0000000..9c3f5ec --- /dev/null +++ b/scripts/TWM2/PGDConnect/UniversalSupport.cs @@ -0,0 +1,120 @@ +//Support Script, Allows this to work +//Updated 2.1, Signal360's Changes implemented +//Universal Ranks Implemented + +//We keep these files hidden so no outsiders can fuck with our stuff +$PGDPHPUploadHandler = "/public/Univ/Buildings/upload.php"; //no touchy +$PGDPHPDelHandler = "/public/Univ/Buildings/delete.php?Filetokill="; +$PGDKeyHandler = "/public/Univ/Ranks/key.php"; +$PGDEMailHandler = "/public/Univ/Ranks/antiTamperDispatch.php"; + +$PGDPHPRankUploadHandler = "/public/Univ/Ranks/upload.php"; + +$PGDPort = 80; //TCP +$PGDServer = "www.phantomdev.net"; + +//PGD IS FILE +function PGD_IsFile(%file) { + if($PGD::IsFile[%file] $= "" || $PGD::IsFile[%file] == -1) { + PGD_IsFileDL(%file); + return schedule(5000, 0, "PGD_IsFile", %file); + } + else { + return $PGD::IsFile[%file]; + } +} + +function PGD_IsFileDL(%file) { + %server = ""@$PGDServer@":"@$PGDPort@""; + %filename = "/public/Univ/IsFile.php?File="@%file@""; + if (!isObject(PGDISFile)) { + %Downloader = new HTTPObject(PGDISFile){}; + } + else { + %Downloader = PGDISFile; + } + %Downloader.File = %file; + echo("Getting"); + %Downloader.get(%server, %filename); +} + +function PGDISFile::onLine(%this, %line) { + echo(%line); + if(strStr(%line, "Not") != -1) { + $PGD::IsFile[%this.File] = 0; + %this.schedule(1000, disconnect); + %this.schedule(1500, delete); + } + else { + $PGD::IsFile[%this.File] = 1; + %this.schedule(1000, disconnect); + %this.schedule(1500, delete); + } +} + +function PGDISFile::onConnectFailed(%this) { + error("-- Could not connect to PGD Is File, re-attempt, 30 sec."); + $PGD::IsFile[%this.File] = -1; + // + schedule(30000, 0, "PGD_IsFile", %this.File); + %this.disconnect(); + %this.delete(); +} + +function PGDISFile::onDisconnect(%this) { + +} + +//END PGD IS FILE + +function GetFileLength(%file) { + new fileobject(LengthReader); + LengthReader.openforread(%file); + %bool = 0; + while(!%bool) { + %bool = LengthReader.isEOF(); + %Msg = LengthReader.readLine(); + $message = ""@$message@"\n"@%Msg@""; + } + %count = strLen($message); + $message = ""; + return %count; +} + +function getFileContents(%file) { + new fileobject(filereader); + filereader.openforread(%file); + %bool = 0; + while(!%bool) { + %bool = filereader.isEOF(); + %Msgget = filereader.readLine(); + %msg = ""@%msg@""NL""@%Msgget@""; + } + return %msg; +} + +//added 2.4 +//Prevent custom (unwanted) content in universal loads +function ScanForValidLine(%line) { + if (getsubstr(%line, 0, 2) $= "//") { + //commented lines like this cannot possibly deliver custom content. + //thus they must be alloted. + return 1; + } + else if(getsubstr(trim(%line), 0, 1) $= "") { + //Blank lines are completely harmless + return 1; + } + else if(getsubstr(%line, 0, 29) $= "%building = new (StaticShape)" || + getsubstr(%line, 0, 32) $= "%building = new (ForceFieldBare)" || + getsubstr(%line, 0, 24) $= "%building = new (Turret)" || + getsubstr(%line, 0, 30) $= "%building = new (BeaconObject)") { + //this is our official line check, if it's a building DB line + //it is safe, and valid. + return 1; + } + else { + //this line has been tampered with, and is invalid. + return 0; + } +} diff --git a/scripts/TWM2/PGDConnect/Warning.txt b/scripts/TWM2/PGDConnect/Warning.txt new file mode 100644 index 0000000..de8fcbe --- /dev/null +++ b/scripts/TWM2/PGDConnect/Warning.txt @@ -0,0 +1,3 @@ +All files in this folder are the basic functioning for PGD services. + +Do not delete these files. \ No newline at end of file diff --git a/scripts/TWM2/Soldier/LoadSoldierScripts.cs b/scripts/TWM2/Soldier/LoadSoldierScripts.cs new file mode 100644 index 0000000..258b3f6 --- /dev/null +++ b/scripts/TWM2/Soldier/LoadSoldierScripts.cs @@ -0,0 +1,3 @@ +//Soldier Scripts Loading + +exec("scripts/TWM2/Soldier/SoldierCreation.cs"); diff --git a/scripts/TWM2/Soldier/SoldierCreation.cs b/scripts/TWM2/Soldier/SoldierCreation.cs new file mode 100644 index 0000000..e4a4d06 --- /dev/null +++ b/scripts/TWM2/Soldier/SoldierCreation.cs @@ -0,0 +1,81 @@ +function SPSpawnSoldier(%obj) { + %Cpos = vectorAdd(%obj.getposition() , "0 0 4"); + %type = %obj.spawnType; + switch(%type) { + case 1: + //basic rifleman + %armor = new player() { + Datablock = LightMaleHumanArmor; + }; + %armor.setInventory(G41Rifle, 1, true); + %armor.setInventory(G41RifleAmmo, 9999, true); + %armor.ClipCount["G41RifleClip"] = 999; + %armor.use(G41Rifle); + + %name = "Rifleman"; + case 2: + //basic SMG + %armor = new player() { + Datablock = LightMaleHumanArmor; + }; + %armor.setInventory(Pg700, 1, true); + %armor.setInventory(Pg700Ammo, 9999, true); + %armor.ClipCount["Pg700Clip"] = 999; + %armor.use(Pg700); + + %name = "Sub Machine Gunner"; + case 3: + //sniper + %armor = new player() { + Datablock = LightMaleHumanArmor; + }; + %armor.setInventory(G17SniperRifle, 1, true); + %armor.setInventory(G17SniperRifleAmmo, 9999, true); + %armor.ClipCount["G17Clip"] = 999; + %armor.use(G17SniperRifle); + + %name = "Sniper"; + case 4: + //commando/shotgunner + %armor = new player() { + Datablock = MediumMaleHumanArmor; + }; + %armor.setInventory(SCD343, 1, true); + %armor.setInventory(SCD343Ammo, 9999, true); + %armor.ClipCount["SCD343Clip"] = 999; + %armor.use(SCD343); + + %name = "Commando Shotgunner"; + case 5: + //heavy gunner + %armor = new player() { + Datablock = HeavyMaleHumanArmor; + }; + %armor.setInventory(MG42, 1, true); + %armor.setInventory(MG42Ammo, 9999, true); + %armor.ClipCount["MG42Clip"] = 999; + %armor.use(MG42); + + %name = "Heavy Gunner"; + } + + if(%obj.isInTheMission) { + %armor.isInTheMission = 1; + } + //setup + %armor.type = %type; + %armor.setTransform(%Cpos); + %armor.canjump = 1; + %armor.isSoldier = 1; + + %armor.team = 20; + + SoldierGroup.add(%armor); + + %armor.target = createTarget(%armor, %name, "", "Male1", '', %armor.team, PlayerSensor); + setTargetSensorData(%armor.target, PlayerSensor); + setTargetSensorGroup(%armor.target, 20); + setTargetName(%armor.target, addtaggedstring(%name)); + // + %armor.moveLoop = schedule(1000, %armor, beginSoldierAI, %armor); +} diff --git a/scripts/TWM2/Systems/AdvancedRankSystem.cs b/scripts/TWM2/Systems/AdvancedRankSystem.cs new file mode 100644 index 0000000..f98ea76 --- /dev/null +++ b/scripts/TWM2/Systems/AdvancedRankSystem.cs @@ -0,0 +1,456 @@ +$TWM::RanksDirectory = "Server/TWM/Saved"; +// This is where all of the ranks will be saved +// I highly recommend leaving this alone + +function LoadRanksBase() { + echo("Loading The Ranking System Base"); + findTopRanks(); + //Modified 2.6, top ranks handled by PGD now +} + +function CreateClientRankFile(%client) { + if(!isSet(%client)) { + return; + } + if(%client.donotupdate) { + echo("Stopped rank file make on "@%client@", server denies access (probably loading univ rank)"); + return; + } + $ModFile.openforWrite(""@$TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave"); + $ModFile.WriteLine("//Ranks & Settings File For GUID "@%client.guid@" / Name: "@%client.namebase@""); + $ModFile.WriteLine("//Created On "@formattimestring("yy-mm-dd")@", Total Warfare Mod 2 "@$TWM2::Version@""); + $ModFile.close(); + ClientContainer(%client); + %scriptController = %client.TWM2Core; + if(!isObject(%scriptController)) { + //yikes, no script object controller yet, time to create it + %soNAME = "TWM2Client_"@%client.guid@""; + %client.TWM2Core = new ScriptObject(%soNAME) {}; + %scriptController = %client.TWM2Core; + } + //now apply the base settings for this new file. + %scriptController.name = %client.namebase; + %scriptController.xp = 0; + %scriptController.money = 0; + %scriptController.rank = "Private"; + %scriptController.phrase = "None Set"; + %scriptController.gameTime = 0; + %scriptController.millionxp = 0; + //and save the new file + %client.container.add(%scriptController); + // + echo("Ranks File For "@%client.namebase@" created"); + exec(""@$TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave"); + MessageAll('WelcomeTheNoob',"\c4"@$ChatBot::Name@": Welcome To Total Warfare Mod For The First Time "@%client.namebase@"."); +} + +//Phantom139: This function is no longer necessary :) +//function UpdateRankFile(%client) { +// if(%client.donotupdate) { +// echo("Stopped rank update on "@%client@", server denies access (probably loading univ rank)"); +// return; +// } +// echo("Updating "@%client.namebase@"'s Rank File"); +// %file = ""@$TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave"; +// +// %scriptController = %client.TWM2Core; +// %scriptController.save(%file); +// +// echo("Update complete"); +// exec(%file); +// +// checkForXPAwards(%client); +//} + +function LoadClientRankfile(%client) { + %client.donotupdate = 0; + echo("Attempting To Load "@%client.namebase@"'s Ranks File"); + %file = ""@$TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave"; + if(!isFile(%file)) { + echo(""@%client.namebase@" does not have a save file, creating one."); + CreateClientRankFile(%client); + //schedule(5000,0,"UpdateRankFile", %client); + } + else { + // + LoadClientFile(%client); + } + //define a new script object for the client, if it does not yet exist + %soNAME = "Container_"@%client.guid@"/TWM2Client_"@%client.guid@""; + %object = nameToId(%soNAME); + if(!isObject(%object)) { + echo("TWM2 Rank/Setting Client Controller Object is non-existant, creating"); + %client.TWM2Core = new ScriptObject("TWM2Client_"@%client.guid) {}; + %client.container.add(%client.TWM2Core); + } + else { + echo("Found TWM2 Rank/Setting Client Controller for "@%client@" -> "@%object@""); + %client.TWM2Core = %object; + %client.TWM2Core.noMoreEXP[sha1sum(formattimestring("yymmdd"))] = 0; //reset on join + } + // + PlayerTimeLoop(%client); //post load functions +} + +function UpdateClientRank(%client) { + if(!isSet(%client) || %client.guid $= "") { + return; + } + if(%client.donotupdate) { + echo("Stopped rank up check on "@%client@", server denies access (probably loading univ rank)"); + return; + } + %scriptController = %client.TWM2Core; + if($XPArray[%client] <= 0) { + return; //kill it here, no need to go into the loop + } + if(%scriptController.officer $= "") { + %scriptController.officer = 0; + } + //anti-Hack system. + %maxPossibleGain = getMaxGainedEXP(%client); + %todaysDate = sha1sum(formattimestring("yymmdd")); + %file = ""@$TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave"; + //If I ever do so implement an EXP cap, here is where it is placed + %multi = $EXPMulti[$TWM2Core_Code, formattimestring("yymmdd"), sha1sum($TWM2Core_Code TAB FormatTWM2Time(formattimestring("yymmdd")))]; + if(!isSet(%multi) || %multi < 1) { + %multi = 1; + } + // + if(!%client.isdev && (%scriptController.xpGain[%todaysDate] >= $EXPCap[$TWM2Core_Code, %todaysDate]) && isSet($EXPCap[$TWM2Core_Code, %todaysDate])) { + //sorry pal, you're over today's rank cap. + $XPArray[%client] = 0; + //%scriptController.save(%file); + return; + } + // convert it to second form + if(!isSet(%scriptController.millionxp)) { + %scriptController.millionxp = 0; + } + if((%scriptController.xp + $XPArray[%client]) >= 1000000) { + %scriptController.xp = 0; + %scriptController.millionxp++; + } + %scriptController.xp += $XPArray[%client]; + %scriptController.xpGain[%todaysDate] += $XPArray[%client]; + //%scriptController.save(%file); + checkForXPAwards(%client); + $XPArray[%client] = 0; + %j = $Rank::RankCount; + runRankUpdateLoop(%client, %j, 1); +} + +function runRankUpdateLoop(%client, %j, %continue) { + if(!%continue) { + return; + //break the function run through here + } + if(%j <= 0) { + return; + } + %name = %client.namebase; + %scriptController = %client.TWM2Core; + if(getCurrentEXP(%client) >= $Ranks::MinPoints[%j]){ + if(%scriptController.rank !$= $Ranks::NewRank[%j] && !GetRankCap(((%scriptController.officer)*$Rank::RankCount)+%j)) { + %scriptController.rankNumber = %j; + if($TWM2::UseRankTags) { + DoNameChangeChecks(%client); + } + %scriptController.rank = $Ranks::NewRank[%j]; + if($Prestige::Name[%scriptController.officer] >= 1) { + $Prestige::Name[%scriptController.officer] = ""; + } + messageAll('msgclient',"\c2"@%name@" has become a "@$Prestige::Name[%scriptController.officer]@""@$Ranks::NewRank[%j]@" with a XP of "@getCurrentEXP(%client)@"!"); + messageclient(%client, 'Msgclient', "~wfx/Bonuses/Nouns/General.wav"); + bottomPrint(%client, "Excelent work "@%name@", you have been promoted to the rank of: "@$Prestige::Name[%scriptController.officer]@""@$Ranks::NewRank[%j]@"!", 5, 2 ); + echo("Promotion: "@%name@" to Rank "@$Ranks::NewRank[%j]@", XP: "@getCurrentEXP(%client)@"."); + //UpdateRankFile(%client); + SaveClientFile(%client); + // + PrepareUpload(%client); + %j = 1; + runRankUpdateLoop(%client, %j, 0); + } + } + else { + %j--; + runRankUpdateLoop(%client, %j, 1); + } +} + +function GetRankCap(%j) { + if(!isSet($RankCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))]) || $RankCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))] <= 0) { + return false; + } + // + else { + if(%j >= $RankCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))]) { + return true; + } + else { + return false; + } + } +} + +function GetOfficerCap(%j) { + if(!isSet($OfficerCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))]) || $OfficerCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))] <= 0) { + return false; + } + // + else { + if(%j >= $OfficerCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))]) { + return true; + } + else { + return false; + } + } +} + +function checkForXPAwards(%client) { + %scriptController = %client.TWM2Core; + %xp = getCurrentEXP(%client); + if(%xp >= 3000000 && !$Medals::AboutDamnTime[%client.guid]) { + AwardClient(%client, "5"); + } + else if(%xp >= 250000 && !$Medals::HonorsC[%client.guid]) { + AwardClient(%client, "4"); + } + else if(%xp >= 25000 && !$Medals::HonorsB[%client.guid]) { + AwardClient(%client, "3"); + } + else if(%xp >= 2500 && !$Medals::HonorsA[%client.guid]) { + AwardClient(%client, "2"); + } +} + +function getCurrentEXP(%client) { + %scriptController = %client.TWM2Core; + %xp = %scriptController.xp + (1000000*%scriptController.millionxp); + return %xp; +} + +//PRESTIGE RANKS +function PromoteToPrestige(%client) { + %scriptController = %client.TWM2Core; + %savedGameTime = %scriptController.gameTime; + %savedPhrs = %scriptController.phrase; + %savedMoney = %scriptController.money; + if(%scriptController.officer $= "" || %scriptController.officer == 0) { + %next = 1; + } + else { + %next = %scriptController.officer++; + } + + if(GetOfficerCap(%next)) { + error("Client "@%client@"["@%client.getAddress()@"]("@%client.namebase@":"@%client.guid@") attempting to hack past cap."); + error("It is recommended you report these details to Phantom139 (phantom139@phantomdev.net) ASAP."); + error("Client has been informed of this, if it is reported to be a mistake, inform Phantom139 of possible code error"); + messageClient(%client, 'msgAlert', "\c3Alert! You have performed an Illegal action(trying to promote to an officer rank beyond cap level)\nIf you believe this is a mistake, you should inform the server host ASAP."); + return; + } + + DumpStats(%client); + + %file = ""@$TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave"; + + %name = "ClientSettings"@%client.guid@""; + %check = nameToID(%name); + if(isObject(%check)) { + %check.delete(); //kill current settings, as they are no longer valid. + } + %script = new ScriptObject(%name) {}; + %client.container.add(%script); + + //now apply the base settings for this new file. + %client.TWM2Core.name = %client.namebase; + %client.TWM2Core.xp = 0; + %client.TWM2Core.millionxp = 0; + %client.TWM2Core.money = %savedMoney; + %client.TWM2Core.rank = "Private"; + %client.TWM2Core.phrase = %savedPhrs; + %client.TWM2Core.gameTime = %savedGameTime; + %client.TWM2Core.officer = %next; + //and save the new file + //%scriptController.save(%file); + SaveClientFile(%client); + + MessageAll('msgSpecial', "\c5"@%client.namebase@" has promoted to Officer level "@%next@"."); + recordAction(%client, "", ""); //record blank action for the challenges to pick off any officer challenges + + switch(%next) { + case 1: + schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1"); + case 2: + schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1"); + schedule(1500, 0, "CompleteNWChallenge", %client, "Prestige2"); + case 3: + schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1"); + schedule(1500, 0, "CompleteNWChallenge", %client, "Prestige2"); + schedule(2000, 0, "CompleteNWChallenge", %client, "Prestige3"); + case 4: + schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1"); + schedule(1500, 0, "CompleteNWChallenge", %client, "Prestige2"); + schedule(2000, 0, "CompleteNWChallenge", %client, "Prestige3"); + schedule(2500, 0, "CompleteNWChallenge", %client, "Prestige4"); + case 5 or 6 or 7 or 8: + schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1"); + schedule(1500, 0, "CompleteNWChallenge", %client, "Prestige2"); + schedule(2000, 0, "CompleteNWChallenge", %client, "Prestige3"); + schedule(2500, 0, "CompleteNWChallenge", %client, "Prestige4"); + schedule(3000, 0, "CompleteNWChallenge", %client, "Prestige5"); + case 9: + schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1"); + schedule(1500, 0, "CompleteNWChallenge", %client, "Prestige2"); + schedule(2000, 0, "CompleteNWChallenge", %client, "Prestige3"); + schedule(2500, 0, "CompleteNWChallenge", %client, "Prestige4"); + schedule(3000, 0, "CompleteNWChallenge", %client, "Prestige5"); + schedule(3500, 0, "CompleteNWChallenge", %client, "Prestige9"); + } +} + +//STAT Cleaner: +//Phantom139: Changed in 3.4 to support the newer system +function DumpStats(%c) { + echo("Resetting" SPC %c.guid@"'s stats."); + %sO = %c.TWM2Core; + %sO.delete(); + %soNAME = "TWM2Client_"@%c.guid@""; + %c.TWM2Core = new ScriptObject(%soNAME) {}; + %c.container.add(%c.TWM2Core); + // this is now our cleaned object file, it will be populated shortly +} + +function GeneratePrestigeChallengeMenu(%client, %tag, %index) { + if(%client.CheckNWChallengeCompletion("Prestge1")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Instructive Private - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Instructive Private - Reach Officer Level 1."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Prestge2")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Excelling Private - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Excelling Private - Reach Officer Level 2."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Prestge3")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Champion Private - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Champion Private - Reach Officer Level 3."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Prestge4")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Prestigious Private - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Prestigious Private - Reach Officer Level 4."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Prestge5")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Supreme Private - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Supreme Private - Reach Officer Level 5."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Prestge9")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Phantom's Vengeance - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Phantom's Vengeance - Reach Officer Level 9."); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("GameEnder")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Game Ender - Done."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Game Ender - Call in a Fission Bomb."); + %index++; + } + // + return %index; +} + +function EXPWillBreakRankCap(%client) { + %script = %client.TWM2Core; + %rN = %script.rankNumber; + %officer = %script.officer; + //Phantom139: updated here, now handles officer ranks so we can apply numbers above 61 to restrict up to a officer level + %currentRankNumber = (%officer*$Rank::RankCount) + %rN; + //apply the new check here |LEAVE THIS, apply ONLY on base rank| + if(GetRankCap(%currentRankNumber + 1) && (getCurrentEXP(%client) >= $Ranks::MinPoints[%rN+1])) { + return true; + } + else { + return false; + } +} + +//Direct calls to needed function, replaces +//old system. +function GainExperience(%client, %variable, %tagToGain) { + %todaysDate = sha1sum(formattimestring("yymmdd")); + %script = %client.TWM2Core; + // + %multi = $EXPMulti[$TWM2Core_Code, formattimestring("yymmdd"), sha1sum($TWM2Core_Code TAB FormatTWM2Time(formattimestring("yymmdd")))]; + if(!isSet(%multi) || %multi < 1) { + %multi = 1; + } + %variable *= %multi; + %variable = mFloor(%variable); + %script.money += %variable; //money is kept no matter what + // + if(!%client.isDev && %script.noMoreEXP[%todaysDate]) { + //sorry pal, you can't get any more today... + AwardClient(%client, "29"); // ;) but you do get a medal for this :D + updateClientRank(%client); + //I will update your file though :) + return; + } + // + if(EXPWillBreakRankCap(%client)) { + messageClient(%client, 'msgClient', "\c5TWM2: "@%tagToGain@"\c3 Further Progression Locked [RANK CAP]"); + return; + } + %willNowHave = (%script.xpGain[%todaysDate] + %variable); + if((%willNowHave >= $EXPCap[$TWM2Core_Code, %todaysDate]) && !%client.isDev && isSet($EXPCap[$TWM2Core_Code, %todaysDate])) { + //give our guy enough EXP to reach today's cap, then block him from any further EXP + %variable = ($EXPCap[$TWM2Core_Code, %todaysDate] - %script.xpGain[%todaysDate]); //this will do it :) + messageClient(%client, 'msgClient', "\c5TWM2: "@%tagToGain@"\c3 Limited/No EXP Gain [EXP CAP]"); + $XPArray[%client] += %variable; + updateClientRank(%client); + // + %file = ""@$TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave"; + %script.noMoreEXP[%todaysDate] = true; + //%script.save(%file); + } + else { + if(%multi > 1) { + messageClient(%client, 'msgClient', "\c5TWM2: "@%tagToGain@"\c3+"@%variable@" EXP (X"@%multi@")"); + } + else { + messageClient(%client, 'msgClient', "\c5TWM2: "@%tagToGain@"\c3+"@%variable@" EXP"); + } + $XPArray[%client] += %variable; + updateClientRank(%client); + } +} diff --git a/scripts/TWM2/Systems/ArmorEnergyShields.cs b/scripts/TWM2/Systems/ArmorEnergyShields.cs new file mode 100644 index 0000000..1ae052f --- /dev/null +++ b/scripts/TWM2/Systems/ArmorEnergyShields.cs @@ -0,0 +1,77 @@ +//ArmorEnergyShields.cs +//Phantom139 + +//Handles the energy shields on certain armors (bosses/zombies/maybe players :) ) + +function Player::damageShields(%player, %amount) { + //cancel current recharge if they are doing so + if(!isSet(%player.getDatablock().shieldHealthCharge)) { + %player.getDatablock().shieldHealthCharge = 0.05; //default + } + cancel(%player.shieldRechargeLoop); + %player.shieldRechargeLoop = %player.schedule(15000, "rechargeShields", %player.getDatablock().shieldHealthCharge); //set next one. + //cut shield health first, then check to see if they are down... + if((%amount - %player.shieldHealth) < 0) { + %final = 0; + } + else { + %final = %amount - %player.shieldHealth; + } + %player.shieldHealth -= %amount; + if(%player.shieldHealth <= 0) { + %player.shieldHealth = 0; + } + return %final; +} + +function Player::rechargeShields(%player, %amount) { + if(!isPlayer(%player)) { + return; + } + if(!%player.isAlive()) { + return; + } + if(!isSet(%player.getDatablock().shieldHealthCharge)) { + %player.getDatablock().shieldHealthCharge = 0.05; //default + } + if(%player.getShieldPercent() < 100) { + //flash them to show recharge + %player.playShieldEffect("1 1 1"); + // + %player.shieldHealth += %amount; + %player.shieldRechargeLoop = %player.schedule(75, "rechargeShields", %player.getDatablock().shieldHealthCharge); + } + // + if(%player.shieldHealth > %player.getMaxShieldHealth()) { + %player.shieldHealth = %player.getMaxShieldHealth(); + } +} + +function Player::getShieldPercent(%player) { + return ((%player.getShieldHealth() / %player.getMaxShieldHealth()) * 100); +} + +//returns a numeric indication of a player's sheild level +function Player::getShieldHealth(%player) { + return %player.shieldHealth; +} + +function Player::getMaxShieldHealth(%player) { + return %player.getDatablock().maxShieldLevel; +} + +function Player::activeShieldEffect(%player) { + if(!isPlayer(%player)) { + return; + } + if(!%player.isAlive()) { + return; + } + if(%player.getMaxShieldHealth() > 0) { + // + if(%player.shieldHealth > 0) { + %player.zapObject(); + } + %player.schedule(1750, "activeShieldEffect"); + } +} diff --git a/scripts/TWM2/Systems/BossSystem.cs b/scripts/TWM2/Systems/BossSystem.cs new file mode 100644 index 0000000..55b5c9a --- /dev/null +++ b/scripts/TWM2/Systems/BossSystem.cs @@ -0,0 +1,448 @@ +function InitiateBoss(%Boss, %name) { + if($TWM::PlayingHorde || $TWM::PlayingHelljump) { + error("SERVER: Cannot initiate boss, in horde/helljump"); + return; + } + + $TWM2::BossGoing = 1; + switch$(%name) { + case "Yvex": + %print = "BOSS BATTLE \n LORD YVEX"; + case "CnlWindshear": + %print = "BOSS BATTLE \n COLONEL WINDSHEAR"; + case "GhostOfLightning": + %print = "BOSS BATTLE \n GHOST OF LIGHTNING"; + case "Vengenor": + %print = "BOSS BATTLE \n GENERAL VENGENOR"; + case "LordRog": + %print = "BOSS BATTLE \n LORD ROG"; + case "Insignia": + %print = "BOSS BATTLE \n MAJOR INSIGNIA"; + case "Vardison1": + %print = "BOSS BATTLE \n LORD VARDISON"; + case "Vardison2": + %print = "!DANGER! \n VARDISON HAS TRANSFORMED \n AIR FORM"; + case "Vardison3": + %print = "!DANGER! \n VARDISON HAS TRANSFORMED AGAIN \n DEMON FORM"; + case "Trebor": + %print = "BOSS BATTLE \n LORDRANIUS TREVOR"; + case "Stormrider": + %print = "BOSS BATTLE \n COMMANDER STORMRIDER"; + case "GhostOfFire": + %print = "BOSS BATTLE \n GHOST OF FIRE"; + case "ShadeLord": + %print = "BOSS BATTLE \n THE SHADE LORD"; + } + //INITIATE TO CLIENTS + %count = ClientGroup.getCount(); + for(%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject(%i); + BottomPrint(%cl, ""@%print@"", 5, 3); + %cl.damageToBoss = 0; + } + %boss.isBoss = 1; // the isBoss Flag helps us out with things + BossCheckUp(%boss, %name); + + if($BossMaxHealth[%name] $= "") { + $BossMaxHealth[%name] = %boss.getMaxDamage(); + } +} + +function BossCheckUp(%boss, %name) { + + MessageAll('MsgSPCurrentObjective1', "", "Boss Battle: "@$TWM2::BossName[%name]@""); + MessageAll('MsgSPCurrentObjective2', "", "Boss HP: "@mFloor(%boss.getDamageLeft()*100)@"/"@mFloor(%boss.getMaxDamage()*100)@""); + + if(%name !$= "CnlWindshear" && %name !$= "Vardison2" && %name !$= "Trebor" && %name !$= "Stormrider") { + if(!isObject(%boss) || %boss.getState() $= "dead") { + if(%name $= "Vardison1") { + %count = ClientGroup.getCount(); + for(%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject(%i); + recordAction(%cl, "BOSS", "Vardison1"); + } + StartVardison2(%boss.getPosition()); + return; + } + //the boss has been defeated, horrah!!! + %count = ClientGroup.getCount(); + for(%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject(%i); + if(%cl.damageToBoss > 0) { + %cl.GiveBossAward(%name); + } + } + $TWM2::BossGoing = 0; + MessageAll('MsgSPCurrentObjective1', "", "Welcome to TWM2!"); + MessageAll('MsgSPCurrentObjective2', "", "Phantom139, DoL, Signal360"); + return; + } + schedule(1000, 0, "BossCheckUp", %boss, %name); + } + else { + if(!isObject(%boss)) { + //the boss has been defeated, horrah!!! + if(%name $= "Vardison2") { + //but not quite so xD + %count = ClientGroup.getCount(); + for(%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject(%i); + recordAction(%cl, "BOSS", "Vardison2"); + } + StartVardison3("0 0 200"); + return; + } + %count = ClientGroup.getCount(); + for(%i = 0; %i < %count; %i++) { + %cl = ClientGroup.getObject(%i); + if(%cl.damageToBoss) { + %cl.GiveBossAward(%name); + } + } + MessageAll('MsgSPCurrentObjective1', "", "Welcome to TWM2!"); + MessageAll('MsgSPCurrentObjective2', "", "Phantom139, DoL, Signal360"); + $TWM2::BossGoing = 0; + return; + } + schedule(1000, 0, "BossCheckUp", %boss, %name); + } +} + +function GameConnection::GiveBossAward(%client, %bossName) { + %scriptController = %client.TWM2Core; + %file = ""@$TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave"; + //you earn less EXP every time you defeat a specific boss, so tread lightly on those defeat counts :) + + recordAction(%client, "BOSS", %bossName); + + if(!isSet(%scriptController.bossDefeatCount[%bossName])) { + %scriptController.bossDefeatCount[%bossName] = 0; + } + if(%bossName $= "Yvex") { + AwardClient(%client, "1"); + } + else if(%bossName $= "CnlWindshear") { + AwardClient(%client, "8"); + } + else if(%bossName $= "GhostOfLightning") { + AwardClient(%client, "9"); + } + else if(%bossName $= "Vengenor") { + AwardClient(%client, "10"); + } + else if(%bossName $= "LordRog") { + AwardClient(%client, "11"); + } + else if(%bossName $= "Insignia") { + AwardClient(%client, "12"); + } + else if(%bossName $= "GhostOfFire") { + AwardClient(%client, "27"); + } + else if(%bossName $= "Stormrider") { + AwardClient(%client, "28"); + } + else if(%bossName $= "ShadeLord") { + AwardClient(%client, "30"); + } + //VARDISON + else if(%bossName $= "Vardison3") { + AwardClient(%client, 13); + } + else if(%bossName $= "Trebor") { + AwardClient(%client, 15); + } + //rank writing + %scriptController.bossDefeatCount[%bossName]++; + %scriptController.save(%file); + + %damageCount = %client.damageToBoss; + %maxHP = $BossMaxHealth[%bossName]; + + %ratio = %damageCount / %maxHP; + + //%award = mFloor(($TWM2::BossXPAward[%bossName] * %ratio) / %scriptController.bossDefeatCount[%bossName]); + %award = $TWM2::BossXPAward[%bossName] / %scriptController.bossDefeatCount[%bossName]; + GainExperience(%client, %award, ""@%bossName@" defeated, congratulations! "); + CheckBossChallenge(%client, %bossName); +} + +function FindValidTarget(%boss, %counter) { //This is usefull + %client = ClientGroup.getObject(GetRandom()*ClientGroup.getCount()); + if(!isObject(%client.player) || %client.player.getState() $= "dead" || %boss == %client.player) { + return schedule(500,0,"FindValidTarget", %boss, %counter++); //Keep Looking; + } + return %client; //target is good +} + +function CheckBossChallenge(%client, %boss) { + %scriptController = %client.TWM2Core; + %dc = %scriptController.bossDefeatCount[%boss]; + switch$(%boss) { + case "Yvex": + if(%dc >= 3) { + CompleteNWChallenge(%client, "Yvex1"); + } + if(%dc >= 5) { + CompleteNWChallenge(%client, "Yvex2"); + } + if(%dc >= 10) { + CompleteNWChallenge(%client, "Yvex3"); + } + case "CnlWindshear": + if(%dc >= 3) { + CompleteNWChallenge(%client, "CWS1"); + } + if(%dc >= 5) { + CompleteNWChallenge(%client, "CWS2"); + } + if(%dc >= 10) { + CompleteNWChallenge(%client, "CWS3"); + } + case "GhostOfLightning": + if(%dc >= 3) { + CompleteNWChallenge(%client, "GOL1"); + } + if(%dc >= 5) { + CompleteNWChallenge(%client, "GOL2"); + } + if(%dc >= 10) { + CompleteNWChallenge(%client, "GOL3"); + } + case "Vegenor": + if(%dc >= 3) { + CompleteNWChallenge(%client, "Veg1"); + } + if(%dc >= 5) { + CompleteNWChallenge(%client, "Veg2"); + } + if(%dc >= 10) { + CompleteNWChallenge(%client, "Veg3"); + } + case "LordRog": + if(%dc >= 2) { + CompleteNWChallenge(%client, "LRog1"); + } + if(%dc >= 4) { + CompleteNWChallenge(%client, "LRog2"); + } + if(%dc >= 7) { + CompleteNWChallenge(%client, "LRog3"); + } + case "Insignia": + if(%dc >= 2) { + CompleteNWChallenge(%client, "Ins1"); + } + if(%dc >= 4) { + CompleteNWChallenge(%client, "Ins2"); + } + if(%dc >= 7) { + CompleteNWChallenge(%client, "Ins3"); + } + case "Vardison3": + if(%dc >= 1) { + CompleteNWChallenge(%client, "Vard1"); + } + if(%dc >= 3) { + CompleteNWChallenge(%client, "Vard2"); + } + if(%dc >= 5) { + CompleteNWChallenge(%client, "Vard3"); + } + case "Trebor": + if(%dc >= 2) { + CompleteNWChallenge(%client, "Treb1"); + } + if(%dc >= 4) { + CompleteNWChallenge(%client, "Treb2"); + } + if(%dc >= 7) { + CompleteNWChallenge(%client, "Treb3"); + } + } +} + +function GenerateBossChallengeMenu(%client, %tag, %index) { + if(%client.CheckNWChallengeCompletion("Yvex1")) { + if(%client.CheckNWChallengeCompletion("Yvex2")) { + if(%client.CheckNWChallengeCompletion("Yvex3")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Shadowy Desecration - Done"); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Shadowy Desecration - Defeat Lord Yvex 10 Times"); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Darkness Rising - Defeat Lord Yvex 5 Times"); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Nightmarish Enterprise - Defeat Lord Yvex 3 Times"); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("CWS1")) { + if(%client.CheckNWChallengeCompletion("CWS2")) { + if(%client.CheckNWChallengeCompletion("CWS3")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Harbinger's Bane - Done"); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Harbinger's Bane - Defeat Colonel Windshear 10 Times"); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Aerieal Nightmare - Defeat Colonel Windshear 5 Times"); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Fortress In The Sky - Defeat Colonel Windshear 3 Times"); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("GOL1")) { + if(%client.CheckNWChallengeCompletion("GOL2")) { + if(%client.CheckNWChallengeCompletion("GOL3")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Severe Thunderstorm - Done"); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Severe Thunderstorm - Defeat The Ghost Of Lightning 10 Times"); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "The Shocking Truth - Defeat The Ghost Of Lightning 5 Times"); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Envious Lightning - Defeat The Ghost Of Lightning 3 Times"); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Veg1")) { + if(%client.CheckNWChallengeCompletion("Veg2")) { + if(%client.CheckNWChallengeCompletion("Veg3")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Firestorm Ender - Done"); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Firestorm Ender - Defeat General Vegenor 10 Times"); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Burning Frenzy - Defeat General Vegenor 5 Times"); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Flaming Revolt - Defeat General Vegenor 3 Times"); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("LRog1")) { + if(%client.CheckNWChallengeCompletion("LRog2")) { + if(%client.CheckNWChallengeCompletion("LRog3")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Payback's A Bitch - Done"); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Payback's A Bitch - Defeat Lord Rog 7 Times"); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Return to Returner - Defeat Lord Rog 4 Times"); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Revenge Halter - Defeat Lord Rog 2 Times"); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Ins1")) { + if(%client.CheckNWChallengeCompletion("Ins2")) { + if(%client.CheckNWChallengeCompletion("Ins3")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Gravitational Influx - Done"); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Gravitational Influx - Defeat Major Insignia 7 Times"); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "No Gravity, No Problem - Defeat Major Insignia 4 Times"); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "El Shipitor - Defeat Major Insignia 2 Times"); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Treb1")) { + if(%client.CheckNWChallengeCompletion("Treb2")) { + if(%client.CheckNWChallengeCompletion("Treb3")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Tank Halter - Done"); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Tank Halter - Defeat Lordranius Trebor 7 Times"); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Harbinger Denied - Defeat Lordranius Trebor 4 Times"); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Precious Cargo - Defeat Lordranius Trebor 2 Times"); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Vard1")) { + if(%client.CheckNWChallengeCompletion("Vard2")) { + if(%client.CheckNWChallengeCompletion("Vard3")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Outevil The Wicked - Done"); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Outevil The Wicked - Defeat Lord Vardison 5 Times"); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Glare The Dark - Defeat Lord Vardison 3 Times"); + %index++; + } + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Shining Star - Defeat Lord Vardison"); + %index++; + } + // + return %index; +} + +//Load The Boss Files +exec("scripts/TWM2/Bosses/BossDatablocks.cs"); +exec("scripts/TWM2/Bosses/LordYvex.cs"); +exec("scripts/TWM2/Bosses/ColonelWindshear.cs"); +exec("scripts/TWM2/Bosses/GhostOfLightning.cs"); +exec("scripts/TWM2/Bosses/GeneralVegenor.cs"); +exec("scripts/TWM2/Bosses/LordRog.cs"); +exec("scripts/TWM2/Bosses/MajorInsignia.cs"); +exec("scripts/TWM2/Bosses/LordraniusTrebor.cs"); +exec("scripts/TWM2/Bosses/Stormrider.cs"); +exec("scripts/TWM2/Bosses/GhostOfFire.cs"); +exec("scripts/TWM2/Bosses/ShadeLord.cs"); diff --git a/scripts/TWM2/Systems/ChatBot.cs b/scripts/TWM2/Systems/ChatBot.cs new file mode 100644 index 0000000..d42ec1f --- /dev/null +++ b/scripts/TWM2/Systems/ChatBot.cs @@ -0,0 +1,392 @@ +//****************************************************************************** +//** CHAT BOT ** +//** Handles in game commands through global chat ** +//** By: Phantom139 ** +//****************************************************************************** + +//Interaction messages +//Parsed by interactions.txt + +//Itterations +//DEFINE word +//GET WEATHER zip +//GET TIME + +//Admin Cmds +//MAKE ADMIN name +//KICK name +//KILL name +//BAN name (sa) +//MAKE SA name (sa) + +//The Core Function +function ScanMessage(%sender, %message) { + %name = $ChatBot::Name; + %inter = $ChatBot::Interactions; + %itter = $ChatBot::Itterations; + %admin = $ChatBot::AdminCmds; + %ACurse = $ChatBot::AntiCurse; + // + %isA = (%sender.isAdmin || %sender.isSuperAdmin); + %isSA = %sender.isSuperAdmin; + // + //Step 1, handle curse messages (provide immunity to SA) + if(%ACurse && !%isSA) { + %halt = HandleCurses(%sender, %message); + if(%halt) { + return; + } + } + //ok, now onto more functioning + %containsName = strStr(getWord(%message, 0), %name); + //Step 2: Is the name mentioned? + if(%containsName != -1) { + //Step 3: Parse Admin Commands + if(%admin) { + if(%isA) { + ParseAdminCommands(%sender, %message, %isA, %isSA); + } + else { + //Step 3 Else Case, not admin, proceed + } + } + //Step 4: Parse Itterations + if(%itter) { + ParseItterations(%sender, %message); + } + //Step 5: Parse Interactions + //if(%inter) { + // ParseInteractions(%sender, %message); + //} + } + else { + //Step 2 else case, name not mentioned, halt here. + } +} + + +//Itterations Module +function ParseItterations(%sender, %message) { + %message = strLwr(%message); + switch$(getWord(%message, 1)) { + case "get": + switch$(getWord(%message, 2)) { + case "weather": + %zipCode = getWord(%message, 3); + GetWeather(%zipCode, 1); + schedule(250, 0, "MessageAll", 'msgTime', "\c4"@$ChatBot::Name@": Getting weather for "@%zipCode@", standby..."); + case "time": + schedule(250, 0, "MessageAll", 'msgTime', "\c4"@$ChatBot::Name@": The time is: "@formatTimeString("hh:nn a")@""); + } + case "define": + GetDefinitionOf(getWord(%message, 2)); + } +} + +// +function GetDefinitionOf(%word) { + if (!isObject(WordDefiner)) { + %Downloader = new TCPObject(WordDefiner); + } + else { + %Downloader = WordDefiner; + } + %Downloader.word = %word; + %Downloader.connect("www.merriam-webster.com:80"); + %Downloader.func = 1; +} + +function WordDefiner::onConnected(%this) { + %loc = "/dictionary/"@%this.word@""; + %header1 = "GET" SPC %loc SPC "HTTP/1.1\r\n"; + %host = "Host: www.merriam-webster.com\r\n\r\n"; + + %query = %header1@ + %host; + %this.send(%query); + %this.schedule(2000, "onDisconnect"); +} + +function WordDefiner::onLine(%this, %line) { + //get Location of the Zip + if(strStr(%line, "

Function: ") != -1) { + %lStart = strStr(%line, "
Function: ") + 20; + %lEnd = strStr(%line, ""); //it's the first one + %this.wordfunc = getSubStr(%line, %lStart, (%lEnd - %lStart)); + } + //get The current temp + if(strStr(%line, ": ") != -1) { + %lStart = strStr(%line, ": ") + 19; + %lEnd = strStr(%line, "