Merge remote-tracking branch 'refs/remotes/origin/development'

This commit is contained in:
Robert Fritzen 2017-09-05 16:21:04 -05:00
commit a216a15fe0
90 changed files with 5635 additions and 8061 deletions

2
JTLdelDSO.bat Normal file
View file

@ -0,0 +1,2 @@
del /s /q "..\base\*.dso"
del /s /q "*.dso"

449
LEGACY CHANGELOG.md Normal file
View file

@ -0,0 +1,449 @@
Total Warfare Mod 2
====
Legacy (3.8 and below) Changelog
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
* Removed the AI Followers, they were being "abused" in PvP modes
* 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:
* Undocmented
3.0 -> 3.1:
* Added the Sandstorm MRLS Tank
* A Few undocmented 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 naughty 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
* Added the From The Top challenge category for missions
* Added a few more missions for players to run
* Fixed sniper rifles showing in the inventory list when they are disabled
* Added 1 shot reload style 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
* Completed the "cool new feature" started in 2.6, Missions!
* Missions are player-ordered, short-duration scenarios with objectives that must be completed over a time period
* Completion awards XP, completing before the time limit awards a time bonus!
* Added the "Surrounded" Mission to start us off
* Modified a few zombie spawn functions to support missions
* 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.
* Brought back the TWM Infection Game Mode
* Added Armor Flags (Unlocked at Officer 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 a new system in the mod, coming soon!
* 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 Trevor'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:
* Gravity Weapons Removed (Too many problems)
* 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
* Officer Challenge Category Completed
* Sabotage Challenge Category Completed
* Domination Challenge Category Completed
* Horde 2 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 Officer Levels, bringing the total to 9.
* [phantomdev.net] Removed the Second Officer Image, replaced 9 with the PGD Logo
* 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 Officer 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
* Officer 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 officer level
* Added 2 new weapons
* Both require a officer 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
* 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 Trevor Added
* Fix: Fixed Major Insignia Name, it would display General Vegenor instead of Major Insignia.
* Lobby Options such as kick and 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

616
README.md
View file

@ -1,42 +1,48 @@
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.
Total Warfare Mod 2 for Tribes 2, Conversion mod built on a base mix of Construction .69a and CCM. Tribes 2 is a game developed on a pre-release version of the Torque Game Engine.
Web Sites/Pages:
* http://www.tribesnext.com : Tribes 2 / TN Page
* https://github.com/PhantomGamesDevelopment/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
* http://www.phantomdev.net : Offical Website
Current Version: 3.9 (alpha)
Current Version: 3.91
====
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)
* Dondelium_X (The original Combat Construction Mod (CCM))
* Castiger (Official Secondary Host, Bug Finding, Mod Tester)
* Mostlikely, Construct, JackTL (Construction .70a Developers)
Thanks:
* Thyth (Tribes Next, Merge Tool)
* Krash123 (Tribes Next)
* 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)
* Various Others (Who have contributed to Cons Mod, CCM, 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)
* Unzip the TWM2 Folder to your Tribes 2's Gamedata folder
* Create a link with the target mod -mod TWM2
* Rename serverControl_R.cs to serverControl.cs
* Adjust the serverControl.cs if you feel like it
* 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
@ -44,454 +50,146 @@ objects to modify server settings. For starters, set the host GUID to your GUID.
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:
TWM2 Servers:
TWM2 uses a inter-server connectivity system known as PGD Connect. This system will allow users who
play TWM2 to transfer their rank/progression as well as load in buildings created in other servers
in your server. While PGD Connect itself is manditory across all TWM2 servers, saving information is
only permitted in what we designate as a "Core Server". This requires the server host to abide by the
TWM2 PGD Connect Core rules established by Phantom139. If you are interested in hosting a server with
this level of authority, please contact Phantom139 on the PGD Forums, or by email.
====
MOD DEVELOPMENT HISTORY (GIT VERSIONS):
PLEASE NOTE: For the Legacy (Pre-GitHub Versions) Changelogs, please see LEGACY CHANGELOG.md
3.9 -> 3.91:
* Reduced the requirement to order missions to the rank of General (49) from Commanding Officer (59)
* This change also applies to the 'From The Top' Challenge Category
* In-Game, Missions have been renamed to Operations
* Fixed the incorrect internal tags for Lordranius Trevor
* Depricated Weekly and Monthly challenges, we will only issue daily challenges from this point forward
* Lib'd the TWM2 MainControl file and PGD Connect Support files to recover some functions
* The F2 Menu now detects PGD Connected accounts and will no longer show the option to PGD Connect to already connected users
* No more scary scientific notion when performing /checkstats or using the F2 menu to view player experience
* Both /checkStats and the F2 menu pages now display what rank number you are at along with the rank name
* Addressed a security issue regarding players who are "attempting" to load code via universal rank files.
* Nice try DDDX, but your fem-phantom fantasies will NOT be happening... ;)
* Addressed the bug that would allow Vardison 2.0 to summon infinite minions
* Addressed the bug with Vardison 2.0 that made his Shadow Rift invincible
* Removed two un-used game objects that were never completed, the Medal Seal and the UAV Control Panel
* Removed a few erraneous exec calls to non-existent files in the mod load script
* Fixed a bug when users reached an EXP value over 1,000,000 that would cause all of the EXP to be processed additionally from 1,000,000
* For example, let's say I was 900,001 and gained 100,000 EXP, I would be placed at 1,100,000 instead of the correct value of 1,000,001
* Depricated the F2 Inventory Screen (Nobody ever used this)
* Fixed a few bugs in the F2 Menu
* Incorrect links
* Missing tags
* Overlap on some lines of text
* [phantomdev.net] Fixed the CRON setting on the daily challenge script so it runs every day now
* Adjusted the daily challenge script to point to the correct link, effectively re-enabling the system
* Addressed the bug preventing weapon challenge progress from recording
* Flipped the /help public and /help additional roles, now using /help will provide the list of accessors
* Removed all remaining EXP capping codes as the cap was removed in 3.9
* Re-did the Challenge Menus in the F2 Menu
* Renamed Weapon Challenges to just Challenges
* From this menu, players now select General Tasks or Weapon Challenges
* Weapon Upgrades are now selected from the Settings Window
* Added the option to jump between the weapon upgrades and weapon challenge menus
* Completed Challenges are now highlighted in Green and show the requirement instead of simply stating "done"
* I did this as more of a nostalgia move, so players can remember their accomplishments!
* TWM2 Challenge System Changes
* Depricated the Blacklist Challenges, and replaced it with Wargames challenges, which are focused on PvP tasks across all modes.
* Let's see who can complete some of those "tough" ones :)
* "Finally" completed the Zombie Slaying Challenges category, zombie hunters rejoice for bonus EXP!
* Added boss challenges for the bosses that did not have any:
* Shade Lord
* Ghost of Fire
* Commander Stormrider
* Added in additional challenges for the other categories to help players make some more mod progression
* Added officer promotion challenges for the remaining officer levels without them
* Removed erraneous reward notes on the boss challenges, as we removed the "AI Follower" system back in 3.7
* Addressed the bug preventing the four Vardison challenges for specific difficulty completions from actually completing
* Internally, Redid the entire challenge system to automate most of it, allowing for eally easy deployment of future challenges
* Added in some cool new features for these as well for things such as hidden challenges, and embedded additional requirements
* All menus are now generated via script instead of hardcoded, making fixing issues with the system much easier
* Enabled officer ranks 10 - 15
* Re-did the Officer Promotion windows to preview the rewards upcoming at that officer level
* Added in the capability to "reset" your entire TWM2 progression upon hitting max level of Officer 15 (Max Level)
* This is a temporary feature that will be replaced in 3.9.2
* Depricated the Store and Money systems, these systems will become progression based unlocks for "higher" officer levels (10 - 15)
* Armor effects will not return
* Armor flags will return in 3.92
* Fixed the bug with Demon Lord zombies not targeting properly
* Fixed a console warning bug caused by zombie objects despawning and then calling a scan method
* Shifter Zombies now have a randomzied element in their teleport method
* Fixed a code bug with Lord Yvex which caused his death pulse to be replaced by nightmare missiles
* Officer Weapons no longer require a rank to use, you only need to reach the officer level in question and you've got it!
* Addressed an additional Horde 3 out-of-game zombie spawning crash
* Cleaned up the player kill logic and moved all TWM2 specific damage and death functioning to a separate file
* Addressed the bug preventing the challenges for reaching officer ranks from completing
* Addressed a bug in which vehicle bosses were not recording damage from players to the boss system correctly
* Grapple Hook
* Slowed down the attacher projectile a bit, lowering the range
* Grapple hook now requires 60% armor energy and consumes this when firing
* There is now a 5 second cooldown when firing to prevent for quick escapes
* Boss Balancing Pass
* Lord Yvex
* Health reduced to 40,000 (Was 50,000)
* Nightmare time reduced to 33% of what it was (NOTE: This change also applies to Lord Vardison)
* Nightmare damage taken is unchanged
* Yvex Healing from Nightmares reduced by 50%
* Lord Rog
* Health reduced to 50,000 (Was 65,000)
* Rog's Blade of Vengeance now only restores 1000HP (Was 2500HP)
* Removed Elite Demons from his spawning pool (These minions are reserved for Lord Vardison)
* Reduced Lord Rog's Meteor Attacks to 1 and 5 meteors respectively (Was 3 and 15)
* Static Discharge Attack
* Lord Rog freeze time increased to 8.5 seconds (Was 7 seconds)
* Inflicted freeze time reduced to 10 seconds (Was 15 seconds)
* Damage per second increased to 0.6 (Was 0.5)
* This equates to a 20% damage reduction when considering the attack duration decrease
* Laser attack now only fires 25 pulses instead of 40
* Ghost of Fire
* Now immune to death by falling under the map
* Sorry TWM1 Vets, but this strategy is no longer going to work ;)
* 1000% armor increase to all fire damage types
* This should hammer home the point to not use fire weapons on the Ghost of Fire
* Mt. Death no longer instantly triggers (No more ear rape)
* There is now a three second delay between his attack trigger and the first pulse
* Added four additional bursts to compensate
* Reduced the amount of cursed flames spawned to 1 and 3 (Was 3 and 5)
* As a reminder folks, you can block these with Flare Grenades ;)
3.8 -> 3.9:
* Community Led Version (Add Changes From GitHub here: https://github.com/PhantomGamesDevelopment/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
* Progression System Adjustments
* Daily EXP Cap removed from the mod
* EXP Gain for PvP has been increased (5 -> 15)
* Altered EXP gain rates from all zombies based on collected mod data
* Redesigned Lord Vardison to remove crashing problems
* Still three phases to defeat, but all phases have been adjusted
* Balanced to be easier, but harder...
* Four difficulty options that can be set by a global variable
* Removed Dark Archmage Vardison (Was even more so prone to crashes)
* Balancing Pass on Bosses, this primarily focused on boss health, boss speed, and attack damage
* Shade Lord:
* Reduced Total HP
* Reduced Boss Speed
* Increased Damage Taken by Fire Weapons
* Altered functioning of Shades (Enjoy your new death :P)
* Colonel Windshear:
* Addressed his "Attitude" Problem
* Lib'd the Shade Lord down to three functions, recovering ~40 more functions
* Bosses now track kills, enjoy seeing how "Inefficient" you are ;)
* Fixed a few issues in the PGD Connect system
* Added a TCPConnectionList instance to allow for multiple downloads to occur at once
* Depricated a few unused modules and re-coded a few instances that used these old modules
* Depricated a good amount of the P-Con External Library
* Added two new extremely challenging Missions (Surrounded 2.0, and Invasion)
* Un-Did the change in 3.7 that caused boss exp rewards to be based upon player input to the fight, now there is a hard 5% damage requirement to earn boss EXP.
* Adjusted the in-game PGD Connect daily challenge system to accept the new format, still need to work out the server-side end of this system.
* Fixed some zombie naming issues
* Addressed the strike fighter chaingun bug
* Congealed all of the help list commands into /help

Binary file not shown.

View file

@ -11,15 +11,15 @@
//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
//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
}
}
// return 1; //return 1; - Command executed correctly\
// default:
// }
//}
//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.");
//addCMD("Custom", "sampleCommand", "Usage: /sampleCommand [arg1] [arg2]: Sample command ftw! people see this when they type /cmdHelp sampleCommand.");

View file

@ -375,12 +375,12 @@ function DominationGame::CheckIntermit(%game) {
function DominationGame::pickTeamSpawn(%game, %team) {
if(%team == 1) {
%pos = vectorAdd($DominationGame::SpawnLocation1[$CurrentMission],GetRandomPosition(5,1));
%pos = vectorAdd($DominationGame::SpawnLocation1[$CurrentMission], TWM2Lib_MainControl("getRandomPosition", 5 TAB 1));
%pos = vectorAdd(%pos,"0 0 5");
return %pos;
}
else if(%team == 2) {
%pos = vectorAdd($DominationGame::SpawnLocation2[$CurrentMission],GetRandomPosition(5,1));
%pos = vectorAdd($DominationGame::SpawnLocation2[$CurrentMission], TWM2Lib_MainControl("getRandomPosition", 5 TAB 1));
%pos = vectorAdd(%pos,"0 0 5");
return %pos;
}
@ -432,81 +432,4 @@ $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;
}
$DominationGame::ObjectiveLocation3["GeometricOrder"] = "-185.68 -559.78 160.45";

View file

@ -66,7 +66,7 @@ function HelljumpGame::pickPlayerSpawn(%game, %client, %respawn) {
// 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"));
%position = vectorAdd(%loc,VectorAdd(TWM2Lib_MainControl("getRandomPosition", 20 TAB 1), "0 0 10"));
return %position;//return %game.pickTeamSpawn(%client.team);
}
@ -1106,7 +1106,7 @@ function HelljumpGame::GoNextStrike(%game) {
function HelljumpGame::DefineProperSpawnPos(%game, %loc) {
%zCheck = GetTerrainHeight(%loc);
%zProper = %zCheck + 10;
%p1 = getRandomPosition(40, 1);
%p1 = TWM2Lib_MainControl("getRandomPosition", 40 TAB 1);
%p2 = vectorAdd(%loc, %p1);
%zCheck2 = GetTerrainHeight(%p2);
%zProperf = %zCheck2 + 10;
@ -2751,134 +2751,4 @@ $HellClass::Info["Shadow Guard"] = "S.Commando Armor - Sh4d3 Shadow Rifle, S3 Ri
//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;
}
$HellClass::Info["Javelin"] = "Commando Armor - Javelin (Unlimited), Desert Eagle Pistol";

View file

@ -41,7 +41,7 @@ function HordeGame::pickPlayerSpawn(%game, %client, %respawn) {
// 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"));
%position = vectorAdd(%loc,VectorAdd(TWM2Lib_MainControl("getRandomPosition", 20 TAB 1), "0 0 10"));
return %position;//return %game.pickTeamSpawn(%client.team);
}
@ -427,6 +427,12 @@ function HordeNextWave(%game, %wave) {
$HordeGame::RevivesLeft++;
}
$HordeGame::CurrentWave = %wave;
for(%i = 0; %i < ClientGroup.getCount(); %i++) {
%cl = ClientGroup.getObject(%i);
if(%wave != 1) {
recordAction(%cl, "HORDEWAVE", %wave-1);
}
}
HordeKillAllZombies(); //Cleans up the server
if($HordeGame::CurrentWave == 51) { //Victory
for (%i = 0; %i < ClientGroup.getCount(); %i++) {
@ -517,6 +523,8 @@ function HordeGame::startMatch(%game) {
for(%i = 0; %i < ClientGroup.getCount(); %i ++) {
%client = ClientGroup.getObject(%i);
$HordeGame::Score[%client] = 0;
$HordeGame::FirstWaveKills[%client] = 0;
$HordeGame::HighestWaveScoreCount[%client] = 0;
}
$HordeGame::InitialGoTime = 300;
@ -592,6 +600,12 @@ function HordeGame::gameOver(%game) {
$HordeGame::Zombiecount = 0;
$HordeGame::LivingCount = 0;
$HordeGame::CanSpawnZombies = 1;
for(%i = 0; $HordeSpawnSched[%i] !$= ""; %i++) {
if(isEventPending($HordeSpawnSched[%i])) {
cancel($HordeSpawnSched[%i]);
}
}
for(%i = 0; %i < ClientGroup.getCount(); %i ++) {
%client = ClientGroup.getObject(%i);
@ -695,222 +709,222 @@ function StartHordeZombies(%mission, %wave) {
case 1:
for(%i = 0; %i < 20; %i++) {
%pt = getRandom(1,$HordeGame::ZombiePtCnts[%mission]);
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, 1);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, 1);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, 1);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, 1);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, 1);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, 5);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, 5);
}
case 26:
for(%i = 0; %i < 30; %i++) {
@ -922,10 +936,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 27:
for(%i = 0; %i < 35; %i++) {
@ -937,10 +951,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 28:
for(%i = 0; %i < 40; %i++) {
@ -952,10 +966,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 29:
for(%i = 0; %i < 45; %i++) {
@ -967,10 +981,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 30:
for(%i = 0; %i < 50; %i++) {
@ -982,10 +996,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 31:
for(%i = 0; %i < 20; %i++) {
@ -997,10 +1011,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 32:
for(%i = 0; %i < 25; %i++) {
@ -1012,10 +1026,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 33:
for(%i = 0; %i < 30; %i++) {
@ -1027,10 +1041,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 34:
for(%i = 0; %i < 35; %i++) {
@ -1042,10 +1056,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 35:
for(%i = 0; %i < 40; %i++) {
@ -1057,10 +1071,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 36:
for(%i = 0; %i < 25; %i++) {
@ -1072,10 +1086,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 37:
for(%i = 0; %i < 30; %i++) {
@ -1087,10 +1101,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 38:
for(%i = 0; %i < 35; %i++) {
@ -1102,10 +1116,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 39:
for(%i = 0; %i < 40; %i++) {
@ -1117,10 +1131,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 40:
for(%i = 0; %i < 40; %i++) {
@ -1132,37 +1146,37 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, 3);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, 3);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, 11);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, 11);
}
case 44:
for(%i = 0; %i < 40; %i++) {
@ -1174,10 +1188,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 45:
for(%i = 0; %i < 40; %i++) {
@ -1189,10 +1203,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 46:
for(%i = 0; %i < 45; %i++) {
@ -1204,10 +1218,10 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, %type);
}
case 47:
for(%i = 0; %i < 50; %i++) {
@ -1219,37 +1233,37 @@ function StartHordeZombies(%mission, %wave) {
%type = 12;
}
}
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], GetRandomPosition(10,1));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, %type);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, 9);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, 2);
$HordeSpawnSched[%i] = 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));
%final = vectoradd($HordeGame::ZombieStartPt[%mission, %pt], TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
$HordeGame::Zombiecount++;
%time = 1000 * getRandom(1, 60);
schedule(%time, 0, "HordeSpawnZombies", %final, 6);
$HordeSpawnSched[%i] = schedule(%time, 0, "HordeSpawnZombies", %final, 6);
}
default:
error("Horde: Wave Error, Wave "@%wave@" is unknown on "@%mission@"");
@ -1393,6 +1407,13 @@ function HordeGame::OnZombieDeath(%game, %killer, %victim) {
}
else {
CenterPrintAll("<just:center>Wave Highlight \n"@%killer.namebase@" Scores the First Kill!" , 3, 3);
if($HordeGame::CurrentWave == 1) {
CompleteNWChallenge(%killer, "FirstBlood");
}
$HordeGame::FirstWaveKills[%killer]++;
if($HordeGame::FirstWaveKills[%killer] >= 10) {
CompleteNWChallenge(%killer, "SpeedSlayer");
}
}
}
}
@ -1421,6 +1442,11 @@ function DoWaveHighlights() {
%highestKillsCL = %cl;
}
}
//
$HordeGame::HighestWaveScoreCount[%highestKillsCL]++;
if($HordeGame::FirstWaveKills[%highestKillsCL] >= 10) {
CompleteNWChallenge(%highestKillsCL, "HighScorer");
}
//
CenterPrintAll("<just:center>Best Stats For Wave "@%wave@""@
"\nHighest Scorer: "@%highestScoreCL.namebase@" with "@%highestScore@" Points"@
@ -1428,100 +1454,6 @@ function DoWaveHighlights() {
}
}
//
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;
@ -1546,7 +1478,4 @@ function HordeGame::enterMissionArea(%game, %playerData, %player) {
%player.client.outOfBounds = false;
messageClient(%player.client, 'EnterMissionArea', '\c1You are back in the mission area.');
}
}

View file

@ -25,7 +25,7 @@ function InfectionGame::allowsProtectedStatics(%game) {
}
function InfectionGame::pickTeamSpawn(%game, %team) {
%pos = vectorAdd($InfectionGame::SpawnLocation[$CurrentMission], GetRandomPosition(5,1));
%pos = vectorAdd($InfectionGame::SpawnLocation[$CurrentMission], TWM2Lib_MainControl("getRandomPosition", 5 TAB 1));
%pos = vectorAdd(%pos,"0 0 5");
return %pos;
}

View file

@ -11,7 +11,29 @@ $Prestige::Name[6] = "Glorious ";
$Prestige::Name[7] = "Ultimate ";
$Prestige::Name[8] = "Shadowing ";
$Prestige::Name[9] = "Phantom ";
$Prestige::Name[10] = "(*) Phantom ";
$Prestige::Name[10] = "Brutal ";
$Prestige::Name[11] = "Vengeful ";
$Prestige::Name[12] = "Spectral ";
$Prestige::Name[13] = "Noble ";
$Prestige::Name[14] = "Masterful ";
$Prestige::Name[15] = "Harbinger ";
$Prestige::Rewards[0] = "";
$Prestige::Rewards[1] = "Fission Bomb Strike, Double Down Perk";
$Prestige::Rewards[2] = "Pulse Rifle";
$Prestige::Rewards[3] = "Pulse SMG";
$Prestige::Rewards[4] = "XVD4 Acid Launcher";
$Prestige::Rewards[5] = "Silver Armor Flag, Crimson Hawk";
$Prestige::Rewards[6] = "Blue Armor Flag";
$Prestige::Rewards[7] = "Red Armor Flag";
$Prestige::Rewards[8] = "Green Armor Flag";
$Prestige::Rewards[9] = "PulseStar Strike, Plasma Torpedo Cannon";
$Prestige::Rewards[10] = "Dartanian Elite Armor, Incendiary Cannon";
$Prestige::Rewards[11] = "VMC9 Gravity Cannon";
$Prestige::Rewards[12] = "DDV4 Plasma Launcher";
$Prestige::Rewards[13] = "Dartanian Gravity Axe";
$Prestige::Rewards[14] = "PLMX56 Phantom Spiker";
$Prestige::Rewards[15] = "Gold Armor Flag, VX3 Volt Driver, LOAS Strike";
$Ranks::MinPoints[0] = 0;
$Ranks::NewRank[0] = "Private";
@ -333,7 +355,7 @@ function SortTopRanks(%dlOBJ) {
function DoNameChangeChecks(%client) {
if(!$TWM2::UseRankTags) {
CheckGUID(%client);
TWM2Lib_MainControl("CheckGUID", %client);
return;
}
%stillLooking = 1;

View file

@ -484,11 +484,11 @@ 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($SabotageGame::ObjectiveLocation1[$CurrentMission], TWM2Lib_MainControl("getRandomPosition", 5 TAB 1));
%pos = vectorAdd(%pos,"0 0 5");
}
else {
%pos = vectorAdd(%game.TeamObjective[1].getPosition(),GetRandomPosition(5,1));
%pos = vectorAdd(%game.TeamObjective[1].getPosition(), TWM2Lib_MainControl("getRandomPosition", 5 TAB 1));
%pos = vectorAdd(%pos,"0 0 4");
}
return %pos;
@ -496,11 +496,11 @@ function SabotageGame::pickTeamSpawn(%game, %team) {
else if(%team == 2) {
if(!isObject(%game.TeamObjective[2])) {
//stops the pre-game fall
%pos = vectorAdd($SabotageGame::ObjectiveLocation2[$CurrentMission],GetRandomPosition(5,1));
%pos = vectorAdd($SabotageGame::ObjectiveLocation2[$CurrentMission], TWM2Lib_MainControl("getRandomPosition", 5 TAB 1));
%pos = vectorAdd(%pos,"0 0 5");
}
else {
%pos = vectorAdd(%game.TeamObjective[2].getPosition(),GetRandomPosition(5,1));
%pos = vectorAdd(%game.TeamObjective[2].getPosition(), TWM2Lib_MainControl("getRandomPosition", 5 TAB 1));
%pos = vectorAdd(%pos,"0 0 4");
}
return %pos;
@ -562,77 +562,4 @@ $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;
}
$SabotageGame::BombLocation["GeometricOrder"] = "-79.9 -487.06 165.9";

View file

@ -613,7 +613,7 @@ function SummonerZombieArmor::onTrigger(%data, %player, %triggerNum, %val) {
%type = 12;
}
}
%SumPos = vectorAdd(VectorAdd(GetRandomPosition(20, 1), "0 0 7"), %player.getPosition());
%SumPos = vectorAdd(VectorAdd(TWM2Lib_MainControl("getRandomPosition", 20 TAB 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++) {

View file

@ -1,8 +1,8 @@
//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;
%team = 6;
%rotation = "1 0 0 0";
%skill = 10;
%Drone = new FlyingVehicle() {
dataBlock = WindshearPlatform;
@ -176,7 +176,7 @@ function WindshearAttacks(%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?");
MessageAll('MessageAll', "\c4"@$TWM2::BossName["Windshear"]@": Did you actually think those missiles could hit me?");
case 2:
%target = DroneFindNearestPilot(2000,%drone);
if(%target.player) {
@ -196,10 +196,10 @@ function WindshearAttacks(%drone) {
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!!!");
MessageAll('MessageAll', "\c4"@$TWM2::BossName["Windshear"]@": I've got missiles with "@getTaggedString(%target.name)@"'s name on them");
}
else {
MessageAll('MessageAll', "\c4"@$TWM2::BossName["Windshear"]@": FUCK, My missile strike was ready.");
MessageAll('MessageAll', "\c4"@$TWM2::BossName["Windshear"]@": No missiles for now....");
}
case 3:
%target = DroneFindNearestPilot(2000,%drone);
@ -215,21 +215,21 @@ function WindshearAttacks(%drone) {
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)@"!");
MessageAll('MessageAll', "\c4"@$TWM2::BossName["Windshear"]@": I'ma kill me a "@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...");
MessageAll('MessageAll', "\c4"@$TWM2::BossName["Windshear"]@": FLARES!");
}
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...");
MessageAll('MessageAll', "\c4"@$TWM2::BossName["Windshear"]@": FLARES! NOW!!!");
}
}

View file

@ -199,9 +199,9 @@ function Vegenormovetotarget(%zombie){
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.setPosition(vectorAdd(vectoradd(%closestclient.player.getPosition(), "0 0 20"), TWM2Lib_MainControl("getRandomPosition", 25 TAB 1)));
%zombie.setVelocity("0 0 0");
MessageAll('msgAntiFall', "\c4"@$TWM2::BossName["Vegenor"]@": Fuck Falling!!!!");
MessageAll('msgAntiFall', "\c4"@$TWM2::BossName["Vegenor"]@": Falling, How about no...");
}
%closestDistance = getWord(%closestClient,1);
%closestClient = getWord(%closestClient,0).Player;
@ -272,7 +272,7 @@ function VegenorAttack_FUNC(%att, %args) {
messageall('MsgSummon',"\c4"@$TWM2::BossName["Vegenor"]@": Hunt them all down");
}
for(%i = 0; %i < 6; %i++) {
%pos = vectoradd(%z.getPosition(), getRandomPosition(10,1));
%pos = vectoradd(%z.getPosition(), TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
%fpos = vectoradd("0 0 5",%pos);
StartAZombie(%fpos, %type);
}
@ -311,7 +311,7 @@ function VegenorAttack_FUNC(%att, %args) {
DemonMotherMissileFollow(%Tobj, %beacon,%p);
case "MeteorDrop":
%t = getWord(%args, 0);
%fpos = vectoradd(%t.getposition(), getRandomposition(50, 0));
%fpos = vectoradd(%t.getposition(), TWM2Lib_MainControl("getRandomPosition", 50 TAB 0));
%pos2 = vectoradd(%fpos, "0 0 700");
schedule(500, 0, spawnprojectile, VegenorFireMeteor, GrenadeProjectile, %pos2, "0 0 -10");
}

View file

@ -374,8 +374,9 @@ datablock PlayerData(GhostFireArmor) : MediumPlayerDamageProfile
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::plasma] = 0.001;
damageScale[$DamageType::Burn] = 0.001;
damageScale[$DamageType::Fire] = 0.001;
damageScale[$DamageType::Bullet] = 0.10; //I deny you shrike n0bs
// Inventory restrictions
@ -461,9 +462,13 @@ 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);
%z = getWord(%zposition, 2);
if(%z < -300) {
%ghost.startFade(400, 0, true);
%ghost.startFade(1000, 0, false);
%ghost.setPosition(vectorAdd(vectoradd(%closestclient.player.getPosition(), "0 0 20"), TWM2Lib_MainControl("getRandomPosition", 25 TAB 1)));
%ghost.setVelocity("0 0 0");
MessageAll('msgBossAlertAttack', "\c4"@$TWM2::BossName["GoF"]@": My ghostly powers allow me to laugh aside your hopes of me falling to my death...");
}
%pos = %ghost.getworldboxcenter();
%closestClient = %closestClient.Player;
@ -603,12 +608,12 @@ function GOFAttack_FUNC(%att, %args) {
return;
}
%cP = %g.getPosition();
%nP = getRandomPosition(55, 0);
%nP = TWM2Lib_MainControl("getRandomPosition", 55 TAB 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...");
messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Experience the glorious flames..");
case "Flamecano":
%g = getWord(%args, 0);
@ -717,7 +722,7 @@ function GOFDoRandomAttacks(%g) {
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)@".");
messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Hey "@getTaggedString(%target.name)@", Dodge this!");
}
else {
messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Frightened of this? Good.");
@ -729,7 +734,7 @@ function GOFDoRandomAttacks(%g) {
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.");
messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": I have a Flame Storm cooked up nicely for "@getTaggedString(%target.name)@", enjoy...");
}
else {
messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": I love Fire.. it's Good your scared.");
@ -741,7 +746,7 @@ function GOFDoRandomAttacks(%g) {
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!!!");
messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Hear that, it's the sound of exploding fire ending your life...");
}
else {
messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Frightened Of Fire? Good.");
@ -757,8 +762,6 @@ function GOFDoRandomAttacks(%g) {
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 {
@ -769,9 +772,7 @@ function GOFDoRandomAttacks(%g) {
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!");
messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": "@getTaggedString(%target.name)@", I present to you the gift, of cursed flames...");
}
else {
messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Darn, I Love Mega Cursed Fire.");
@ -817,10 +818,14 @@ function GOFDoRandomAttacks(%g) {
case 13 or 14 or 15:
if(isObject(%target.player)) {
%store = %target.player.getPosition();
GOFAttack_FUNC("Ultracano", %g SPC %store);
//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);
schedule(12000, 0, GOFAttack_FUNC, "Ultracano", %g SPC %store);
schedule(15000, 0, GOFAttack_FUNC, "Ultracano", %g SPC %store);
schedule(16000, 0, GOFAttack_FUNC, "Ultracano", %g SPC %store);
schedule(17000, 0, GOFAttack_FUNC, "Ultracano", %g SPC %store);
messageall('TheFireMsg',"\c4"@$TWM2::BossName["GoF"]@": Rise Mt. Death... Cleanse "@getTaggedString(%target.name)@"!");
}
else {

View file

@ -148,7 +148,7 @@ function SpawnGhostOfLightning(%position) {
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");
MessageAll('msgBossAlertreturn', "\c4"@$TWM2::BossName["GoL"]@": It's time to show you the shocking power of electricity");
%command = "GoLmovetotarget";
InitiateBoss(%Ghost, "GhostOfLightning");
@ -185,12 +185,12 @@ function GoLmovetotarget(%Ghost){
%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!!!");
MessageAll('msgBossAlertAttack', "\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!");
MessageAll('msgBossAlertAttack', "\c4"@$TWM2::BossName["GoL"]@": I don't think so!");
//ATTACK
%p = new ShockLanceProjectile() {
dataBlock = GoLShocker;
@ -207,7 +207,7 @@ function GoLmovetotarget(%Ghost){
//
%Ghost.startFade(400, 0, true);
%Ghost.startFade(1000, 0, false);
%new = VectorAdd(%Ghost.getPosition(), GetRandomPosition(50, 1));
%new = VectorAdd(%Ghost.getPosition(), TWM2Lib_MainControl("getRandomPosition", 50 TAB 1));
%new = VectorAdd(%new, "0 0 5");
%Ghost.setPosition(%new);
%Ghost.setVelocity("0 0 0");
@ -243,10 +243,10 @@ function DoGoLAttacks(%ghost) {
%target = FindValidTarget(%ghost);
if(!isObject(%target.player)) {
schedule(35000, 0, "DoGoLAttacks", %ghost);
MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": Meh, no targets for me.");
MessageAll('msgBossAlertAttack', "\c4"@$TWM2::BossName["GoL"]@": Meh, no targets for me.");
return;
}
MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": Lightning Strike Away!!!");
MessageAll('msgBossAlertAttack', "\c4"@$TWM2::BossName["GoL"]@": Lightning Strike Away!!!");
%p = discharge2(%target.player.getPosition(),"0 0 -1");
%p.setEnergyPercentage(1);
addToShock(%p);
@ -255,10 +255,10 @@ function DoGoLAttacks(%ghost) {
%target = FindValidTarget(%ghost);
if(!isObject(%target.player)) {
schedule(35000, 0, "DoGoLAttacks", %ghost);
MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": Meh, no targets for me.");
MessageAll('msgBossAlertAttack', "\c4"@$TWM2::BossName["GoL"]@": Meh, no targets for me.");
return;
}
MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": Watch Electricity Chase You!!!");
MessageAll('msgBossAlertAttack', "\c4"@$TWM2::BossName["GoL"]@": Watch Electricity Chase You!!!");
%vec = vectorNormalize(vectorSub(%target.player.getPosition(),%ghost.getPosition()));
%p = new SeekerProjectile() {
dataBlock = IonMissile;
@ -281,10 +281,10 @@ function DoGoLAttacks(%ghost) {
%target = FindValidTarget(%ghost);
if(!isObject(%target.player)) {
schedule(35000, 0, "DoGoLAttacks", %ghost);
MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": Meh, no targets for me.");
MessageAll('msgBossAlertAttack', "\c4"@$TWM2::BossName["GoL"]@": Meh, no targets for me.");
return;
}
MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": Die Now...");
MessageAll('msgBossAlertAttack', "\c4"@$TWM2::BossName["GoL"]@": Die Now...");
%target = %target.player;
%p = new ShockLanceProjectile() {
dataBlock = GoLShocker;
@ -299,10 +299,10 @@ function DoGoLAttacks(%ghost) {
%totalDamage = 50;
%target.getDataBlock().damageObject(%target, %ghost, %target.getPosition(), %totalDamage, $DamageType::ShockLance);
case 4:
MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": Its Storm Time");
MessageAll('msgBossAlertAttack', "\c4"@$TWM2::BossName["GoL"]@": Its Storm Time");
ionStorm(35 , 1000);
case 5:
MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["GoL"]@": Lightning Missiles For ALL!!");
MessageAll('msgBossAlertAttack', "\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") {

View file

@ -100,7 +100,7 @@ datablock SeekerProjectileData(LordRogStiloutte) {
datablock PlayerData(LordRogZombieArmor) : LightMaleHumanArmor {
boundingBox = "1.63 1.63 2.6";
maxDamage = 650.0;
maxDamage = 500.0;
minImpactSpeed = 35;
shapeFile = "bioderm_heavy.dts";
@ -245,7 +245,7 @@ function SpawnLordRog(%position) {
Datablock = "LordRogZombieArmor";
};
%Cpos = vectorAdd(%position, "0 0 5");
MessageAll('MsgDarkraireturn', "\c4"@$TWM2::ZombieName[8]@": I AM ALIVE!!! I SHALL KILL YOU ALL");
MessageAll('msgBossAlertreturn', "\c4"@$TWM2::ZombieName[8]@": I AM ALIVE!!! I SHALL KILL YOU ALL");
%zombie.iszombie = 1;
StartLRAbilities(%zombie);
@ -285,9 +285,9 @@ function LordRogmovetotarget(%zombie){
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.setPosition(vectorAdd(vectoradd(%closestclient.player.getPosition(), "0 0 20"), TWM2Lib_MainControl("getRandomPosition", 25 TAB 1)));
%zombie.setVelocity("0 0 0");
MessageAll('msgDarkraiAttack', "\c4"@$TWM2::ZombieName[8]@": You think I will fall to my death!?!?");
MessageAll('msgBossAlertAttack', "\c4"@$TWM2::ZombieName[8]@": You think I will fall to my death!?!?");
}
%closestDistance = getWord(%closestClient,1);
%closestClient = getWord(%closestClient,0).Player;
@ -342,10 +342,10 @@ function LordRogAttack_FUNC(%att, %args) {
}
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
%type = getRandomZombieType("1 2 3 4 5 9 12 13 15");
messageall('RogMsg',"\c4"@$TWM2::ZombieName[8]@": Attack my target!");
for(%i = 0; %i < 5; %i++) {
%pos = vectoradd(%z.getPosition(), getRandomPosition(10,1));
%pos = vectoradd(%z.getPosition(), TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
%fpos = vectoradd("0 0 5",%pos);
StartAZombie(%fpos, %type);
}
@ -359,7 +359,7 @@ function LordRogAttack_FUNC(%att, %args) {
return;
}
%type = getRandomZombieType("1 2 3 5 9 12 13 15 17");
%type = getRandomZombieType("1 2 3 4 5 9 12 13 15");
MessageAll('MessageAll', "\c4"@$TWM2::ZombieName[8]@": Additional Reinforcements!!! NOW!");
%typeCaller = %type SPC %type SPC %type SPC %type;
%callPos = vectorAdd(%z.getPosition(), "2000 0 400");
@ -415,7 +415,7 @@ function LordRogAttack_FUNC(%att, %args) {
return;
}
%z.laserStormSount++;
if(%z.laserStormSount < 40) {
if(%z.laserStormSount < 25) {
%vec = vectorsub(%t.getworldboxcenter(), %z.getMuzzlePoint(6));
%vec = vectoradd(%vec, vectorscale(%t.getvelocity(), vectorlen(%vec)/100));
%p = new LinearFlareProjectile() {
@ -435,31 +435,19 @@ function LordRogAttack_FUNC(%att, %args) {
case "MetrosMaul":
%t = getWord(%args, 0);
%fpos = vectoradd(%t.getposition(), getRandomposition(50,0));
%fpos = vectoradd(%t.getposition(), TWM2Lib_MainControl("getRandomPosition", 50 TAB 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));
%fpos = vectoradd(%t.getposition(), TWM2Lib_MainControl("getRandomPosition", 50 TAB 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);
@ -467,7 +455,7 @@ function LordRogAttack_FUNC(%att, %args) {
return;
}
%z.setMoveState(true);
%z.schedule(7000, setMoveState, false);
%z.schedule(8500, setMoveState, false);
%TargetSearchMask = $TypeMasks::PlayerObjectType;
%c = createEmitter(%z.getPosition(), FlashLEmitter, "1 0 0"); //Rotate it
%c.schedule(1000, delete);
@ -484,7 +472,7 @@ function LordRogAttack_FUNC(%att, %args) {
if(!isobject(%obj) || %obj.getState() $= "dead") {
return;
}
if(%obj.staticTicks > 15) {
if(%obj.staticTicks > 10) {
%obj.setMoveState(false);
return;
}
@ -492,7 +480,7 @@ function LordRogAttack_FUNC(%att, %args) {
%c.schedule(1000, delete);
%obj.setMoveState(true);
%obj.staticTicks++;
%obj.damage(0, %obj.getPosition(), 0.05, $DamageType::Zombie);
%obj.damage(0, %obj.getPosition(), 0.6, $DamageType::Zombie);
schedule(1000, 0, LordRogAttack_FUNC, "SCDLoop", %obj);
}
}

View file

@ -468,11 +468,11 @@ datablock PlayerData(VardisonStageThreeArmor) : LightMaleHumanArmor {
};
datablock StaticShapeData(ShadowOrb) : StaticShapeDamageProfile {
className = "logoprojector";
shapeFile = "pack_deploy_sensor_motion.dts";
className = "Generator";
shapeFile = "station_generator_large.dts";
maxDamage = 10.0;
destroyedLevel = 10.0;
maxDamage = 2.0;
destroyedLevel = 2.0;
disabledLevel = 0.3;
isShielded = false;
@ -503,11 +503,14 @@ function ShadowOrb::onDestroyed(%this, %obj, %prevState) {
if (%obj.isRemoved) {
return;
}
if(isObject(%obj.waypoint)) {
%obj.waypoint.schedule(500, "delete");
}
if(isObject($TWM2::VardisonManager.OrbSFX)) {
$TWM2::VardisonManager.OrbSFX.schedule(500, "delete");
}
%obj.isRemoved = true;
Parent::onDestroyed(%this, %obj, %prevState);
if(isObject(%orb.sfx)) {
%obj.sfx.schedule(500, "delete");
}
%obj.schedule(500, "delete");
$TWM2::VardisonManager.orbDestroyed();
}
@ -575,6 +578,11 @@ function SpawnVardison(%position) {
Datablock = "VardisonStageOneArmor";
};
%Cpos = vectorAdd(%position, "0 0 5");
%Boss.isMultiPhaseBoss = true;
%Boss.isFirstPhase = true;
%Boss.isFinalPhase = false;
InitiateBoss(%Boss, "Vardison1");
%Boss.team = 30;
@ -606,6 +614,11 @@ function SpawnVardison2(%position) {
Datablock = "VardisonStageTwoArmor";
};
%Cpos = vectorAdd(%position, "0 0 5");
%Boss.isMultiPhaseBoss = true;
%Boss.isFirstPhase = false;
%Boss.isFinalPhase = false;
InitiateBoss(%Boss, "Vardison2");
%Boss.team = 30;
@ -646,6 +659,11 @@ function SpawnVardison3(%position) {
Datablock = "VardisonStageThreeArmor";
};
%Cpos = vectorAdd(%position, "0 0 5");
%Boss.isMultiPhaseBoss = true;
%Boss.isFirstPhase = false;
%Boss.isFinalPhase = true;
InitiateBoss(%Boss, "Vardison3");
%Boss.team = 30;
@ -725,15 +743,17 @@ function VardisonThink(%Boss) {
//If we're not ready to dish out an attack, let's check what else we need to do...
// Are we low on minions?
if($TWM2::VardisonManager.minionCount < $TWM2::Vardison1_MaxMinions[%dLevel]) {
//How many players am I up against?
%pCount = $HostGamePlayerCount;
//How low is my health?
%percentage = mCeil((mFloor(%boss.getDamageLeft()*100) / mFloor(%boss.getMaxDamage()*100)) * 100);
%BackwardsHP = 100 - %percentage;
%chance = %BackwardsHP * %pCount * (%Boss.canSummonMinions ? 1 : 0);
//Using our test factor, determine if I need minions.
if(%chance <= getRandom(1, 100)) {
%needMinions = true;
if(%Boss.canSummonMinions) {
//How many players am I up against?
%pCount = $HostGamePlayerCount;
//How low is my health?
%percentage = mCeil((mFloor(%boss.getDamageLeft()*100) / mFloor(%boss.getMaxDamage()*100)) * 100);
%BackwardsHP = 100 - %percentage;
%chance = %BackwardsHP * %pCount;
//Using our test factor, determine if I need minions.
if(%chance <= getRandom(1, 100)) {
%needMinions = true;
}
}
}
//Do I need to be moving towards the enemy?
@ -759,27 +779,20 @@ function VardisonThink(%Boss) {
//If we're not ready to dish out an attack, let's check what else we need to do...
// Are we low on minions?
if($TWM2::VardisonManager.minionCount < $TWM2::Vardison2_MaxMinions[%dLevel]) {
//How many players am I up against?
%pCount = $HostGamePlayerCount;
//How low is my health?
%percentage = mCeil((mFloor(%boss.getDamageLeft()*100) / mFloor(%boss.getMaxDamage()*100)) * 100);
%BackwardsHP = 100 - %percentage;
%chance = %BackwardsHP * %pCount * (%Boss.canSummonMinions ? 1 : 0);
//Using our test factor, determine if I need minions.
if(%chance <= getRandom(1, 100)) {
%needMinions = true;
}
}
//Phase 2 is stationary unless you're on Hard or WTF mode
if(%dLevel >= 3) {
%needMove = true;
}
else {
//Phase Two only Super-Lunges if you get too close
if(getWord(VardisonGetClosest(%Boss), 1) <= 50) {
%needMove = true;
if(%Boss.canSummonMinions) {
//How many players am I up against?
%pCount = $HostGamePlayerCount;
//How low is my health?
%percentage = mCeil((mFloor(%boss.getDamageLeft()*100) / mFloor(%boss.getMaxDamage()*100)) * 100);
%BackwardsHP = 100 - %percentage;
%chance = %BackwardsHP * %pCount;
//Using our test factor, determine if I need minions.
if(%chance <= getRandom(1, 100)) {
%needMinions = true;
}
}
}
%needMove = true;
}
case 3:
//Did I just get a kill?
@ -800,16 +813,18 @@ function VardisonThink(%Boss) {
else {
//If we're not ready to dish out an attack, let's check what else we need to do...
// Are we low on minions?
if($TWM2::VardisonManager.minionCount < $TWM2::Vardison3_MaxMinions[%dLevel]) {
//How many players am I up against?
%pCount = $HostGamePlayerCount;
//How low is my health?
%percentage = mCeil((mFloor(%boss.getDamageLeft()*100) / mFloor(%boss.getMaxDamage()*100)) * 100);
%BackwardsHP = 100 - %percentage;
%chance = %BackwardsHP * %pCount * (%Boss.canSummonMinions ? 1 : 0);
//Using our test factor, determine if I need minions.
if(%chance <= getRandom(1, 100)) {
%needMinions = true;
if($TWM2::VardisonManager.minionCount < $TWM2::Vardison3_MaxMinions[%dLevel] && %boss.canSummonMinions) {
if(%Boss.canSummonMinions) {
//How many players am I up against?
%pCount = $HostGamePlayerCount;
//How low is my health?
%percentage = mCeil((mFloor(%boss.getDamageLeft()*100) / mFloor(%boss.getMaxDamage()*100)) * 100);
%BackwardsHP = 100 - %percentage;
%chance = %BackwardsHP * %pCount;
//Using our test factor, determine if I need minions.
if(%chance <= getRandom(1, 100)) {
%needMinions = true;
}
}
}
//Do I need to be moving towards the enemy?
@ -903,7 +918,7 @@ function VardisonDoMove(%Boss) {
%Boss.hastarget = 1;
}
%vector = ZgetFacingDirection(%Boss, %clPlayer, %pos);
%vector = vectorscale(%vector, $Zombie::DForwardSpeed*1.8);
%vector = vectorscale(%vector, $Zombie::DForwardSpeed*5);
%upvec = "150";
%x = Getword(%vector,0);
%y = Getword(%vector,1);
@ -980,28 +995,31 @@ function VardisonSummonOrb(%Boss) {
}
function VardisonSummonMinions(%Boss) {
%currentCount = $TWM2::VardisonManager.minionCount;
%dLevel = $TWM2::VardisonDifficulty;
%max = 0;
switch(%Boss.phase) {
case 1:
%max = $TWM2::Vardison1_MaxMinions[%dLevel];
case 2:
%max = $TWM2::Vardison2_MaxMinions[%dLevel];
case 3:
%max = $TWM2::Vardison3_MaxMinions[%dLevel];
if(%Boss.canSummonMinions) {
%currentCount = $TWM2::VardisonManager.minionCount;
%dLevel = $TWM2::VardisonDifficulty;
%max = 0;
switch(%Boss.phase) {
case 1:
%max = $TWM2::Vardison1_MaxMinions[%dLevel];
case 2:
%max = $TWM2::Vardison2_MaxMinions[%dLevel];
case 3:
%max = $TWM2::Vardison3_MaxMinions[%dLevel];
}
%factor = %dLevel / 4;
%Low = 1;
%High = mCeil((%max - %currentCount) * %factor);
for(%i = 0; %i < getRandom(%Low, %High); %i++) {
VardisonDoMinionSummon(%Boss);
}
%Boss.canSummonMinions = false;
$TWM2::VardisonManager.schedule($TWM2::Vardison_MinionCooldown[%dLevel] * 1000, cooldownOff, %Boss, "minions");
}
%Low = 1;
%High = %max - %currentCount;
for(%i = 0; %i < getRandom(%Low, %High); %i++) {
VardisonDoMinionSummon(%Boss);
}
%Boss.canSummonMinions = false;
$TWM2::VardisonManager.schedule($TWM2::Vardison_MinionCooldown[%dLevel] * 1000, cooldownOff, %Boss, "minions");
}
function VardisonDoMinionSummon(%Boss) {
%posSpawn = vectorAdd(%Boss.getPosition(), getRandomposition(50, 1));
%posSpawn = vectorAdd(%Boss.getPosition(), TWM2Lib_MainControl("getRandomPosition", 50 TAB 1));
%spawnFire = new ParticleEmissionDummy(){
position = vectoradd(%posSpawn, "0 0 0.5");
dataBlock = "defaultEmissionDummy";
@ -1518,7 +1536,7 @@ function VardisonNamedAttack(%Boss, %attack, %args) {
case "RiftGate":
%pos = getField(%args, 0);
%goPos = RMPG();
%goPos = TWM2Lib_MainControl("RMPG");
%TargetSearchMask = $TypeMasks::PlayerObjectType;
%c = createEmitter(%pos, FlashLEmitter, "1 0 0"); //Rotate it
%c.schedule(1000, delete);
@ -1641,32 +1659,45 @@ function VardisonManager::summonOrb(%this, %boss) {
setTargetSensorGroup(%orb.target, 30);
setTargetName(%orb.target, addtaggedstring("\c7Shadow Rift"));
%orb.waypoint = new WayPoint() {
position = %orb.getPosition();
dataBlock = "WayPointMarker";
team = %boss.Team;
name = "Shadow Rift";
};
%orb.startfade(1, 0, true);
//SFX
%orb.sfx = new ParticleEmissionDummy(){
$TWM2::VardisonManager.OrbSFX = new ParticleEmissionDummy(){
position = %orb.getPosition();
dataBlock = "defaultEmissionDummy";
emitter = "ShadowOrbEmitter";
};
MissionCleanup.add(%orb.sfx);
MissionCleanup.add($TWM2::VardisonManager.OrbSFX);
//
%this.orbKillSched = %this.schedule($TWM2::Vardison_OrbKillTime, orbKill, %boss, %orb);
}
function VardisonManager::orbKill(%this, %boss, %orb) {
%restoreCount = 0;
for(%i = 0; %i < ClientGroup.getCount(); %i++) {
%cl = ClientGroup.getObject(%i);
if(isObject(%cl.player) && %cl.player.getState() !$= "dead") {
//Bye Bye :)
%cl.player.rapierShield = false;
%cl.player.setInvincible(false);
%cl.player.damage(%boss, %cl.player.getPosition(), 10000, $DamageType::ShadowOrb);
%cl.player.blowup();
MessageAll('msgDeath', "\c2"@%cl.player.namebase@" has been annihilated by the Shadow Rift.");
MessageAll('msgDeath', "\c2"@%cl.namebase@" has been annihilated by the Shadow Rift.");
//If Vardison Restores HP from rift kills, do that now :P
if($TWM2::Vardison_OrbRegenHP[$TWM2::VardisonDifficulty]) {
%boss.setDamageLevel(%boss.getDamageLevel() - 0.35);
%restoreCount++;
}
}
}
MessageAll('msgRestore', "\c5Lord Vardison has absorbed the life energy of "@%restoreCount@" combatants.");
%wipeEmit = new ParticleEmissionDummy(){
position = %orb.getPosition();
dataBlock = "defaultEmissionDummy";
@ -1674,8 +1705,11 @@ function VardisonManager::orbKill(%this, %boss, %orb) {
};
%wipeEmit.schedule(500, "delete");
//Delete the orb & it's effects
if(isObject(%orb.sfx)) {
%obj.sfx.schedule(500, "delete");
if(isObject(%obj.waypoint)) {
%obj.waypoint.schedule(500, "delete");
}
if(isObject($TWM2::VardisonManager.OrbSFX)) {
$TWM2::VardisonManager.OrbSFX.schedule(500, "delete");
}
%orb.schedule(500, "delete");
if(isObject(%this.orbFire)) {
@ -1695,6 +1729,7 @@ function VardisonManager::orbDestroyed(%this) {
%boss = %this.Vardison;
%boss.rapierShield = false;
%boss.busy = false; //<-- let think() resume...
MessageAll('msgDeath', "\c2The Shadow Rift has been Shattered...");
}
function VardisonManager::cooldownOff(%this, %Boss, %type) {
@ -1720,3 +1755,28 @@ function VardisonManager::cooldownOff(%this, %Boss, %type) {
%Boss.busy = false;
}
}
function ShadowOrb::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType) {
if(%sourceObject && %targetObject.isEnabled()) {
if(%sourceObject.client) {
%targetObject.lastDamagedBy = %sourceObject.client;
%targetObject.lastDamagedByTeam = %sourceObject.client.team;
%targetObject.damageTimeMS = GetSimTime();
}
else {
%targetObject.lastDamagedBy = %sourceObject;
%targetObject.lastDamagedByTeam = %sourceObject.team;
%targetObject.damageTimeMS = GetSimTime();
}
}
if (%data.isShielded) {
%amount = %data.checkShields(%targetObject, %position, %amount, %damageType);
}
%damageScale = %data.damageScale[%damageType];
if(%damageScale !$= "") {
%amount *= %damageScale;
}
if (%amount > 0) {
%targetObject.applyDamage(%amount);
}
}

View file

@ -402,7 +402,7 @@ datablock SeekerProjectileData(YvexZombieMakerMissile) {
datablock PlayerData(YvexZombieArmor) : LightMaleHumanArmor {
boundingBox = "1.63 1.63 2.6";
maxDamage = 500.0;
maxDamage = 400.0;
minImpactSpeed = 35;
shapeFile = "medium_male.dts";
@ -588,7 +588,7 @@ function Yvexmovetotarget(%zombie){
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.setPosition(vectorAdd(vectoradd(%closestclient.player.getPosition(), "0 0 20"), TWM2Lib_MainControl("getRandomPosition", 25 TAB 1)));
%zombie.setVelocity("0 0 0");
MessageAll('msgYvexAttack', "\c4"@$TWM2::ZombieName[7]@": I shall not fall to my end!");
}
@ -629,9 +629,10 @@ function YvexAttacks(%yvex) {
if(!isObject(%yvex) || %yvex.getState() $= "dead") {
return;
}
%closestClient = ZombieLookForTarget(%zombie);
%closestDistance = getWord(%closestClient,1);
%closestClient = ZombieLookForTarget(%yvex);
//%closestDistance = getWord(%closestClient,1);
%closestClient = getWord(%closestClient,0).Player;
%closestDistance = vectorDist(%yvex.getPosition(), %closestClient.getPosition());
if(%closestClient) {
if(%closestDistance <= 150) {
@ -682,7 +683,7 @@ function YvexAttack_FUNC(%att, %args) {
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));
%pos = vectoradd(%z.getPosition(), TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
%fpos = vectoradd("0 0 5",%pos);
StartAZombie(%fpos, %type);
}
@ -698,7 +699,7 @@ function YvexAttack_FUNC(%att, %args) {
%vec = vectorsub(%target.getworldboxcenter(),%zombie.getMuzzlePoint(0));
%vec = vectoradd(%vec, vectorscale(%target.getvelocity(),vectorlen(%vec)/100));
%p = new LinearFlareProjectile() {
dataBlock = YvexSniperShot;
dataBlock = KillerPulse;
initialDirection = %vec;
initialPosition = %zombie.getMuzzlePoint(0);
sourceObject = %zombie;
@ -846,7 +847,7 @@ function Yvexnightmareloop(%zombie,%viewer) {
%viewer.player.setMoveState(false);
return;
}
if(%viewer.nightmareticks > 30) {
if(%viewer.nightmareticks > 10) {
%viewer.player.setMoveState(false);
%viewer.nightmareticks = 0;
%viewer.nightmared = 0;
@ -859,14 +860,14 @@ function Yvexnightmareloop(%zombie,%viewer) {
%viewer.player.setMoveState(true);
%viewer.nightmared = 1;
%viewer.player.setActionThread(%emote,true);
%viewer.player.setWhiteout(1.8);
%viewer.player.setDamageFlash(1.5);
%viewer.player.setWhiteout(0.8);
%viewer.player.setDamageFlash(0.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);
%viewer.player.damage(0, %viewer.player.position, 0.03, $DamageType::Zombie);
%zombie.setDamageLevel(%zombie.getDamageLevel() - 0.15);
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");
@ -885,7 +886,7 @@ function Yvexnightmareloop(%zombie,%viewer) {
}
function KillerPulse::onCollision(%data,%projectile,%targetObject,%modifier,%position,%normal) {
if (%targetObject.getClassName() $= "Player" && %targetObject.isBoss) {
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();

View file

@ -1,4 +1,4 @@
datablock HoverVehicleData(TreborTank) : CentaurVehicle {
datablock HoverVehicleData(TrevorTank) : CentaurVehicle {
spawnOffset = "0 0 4";
canControl = true;
floatingGravMag = 4.5;
@ -30,13 +30,13 @@ datablock HoverVehicleData(TreborTank) : CentaurVehicle {
ShieldDamageScale[$DamageType::Bullet] = 0.01; //I deny you shrike n0bs
};
function StartTrebor(%pos){
function StartTrevor(%pos){
%team = 6;
%rotation = "1 0 0 0";
%skill = 10;
%tank = new HoverVehicle() {
dataBlock = TreborTank;
dataBlock = TrevorTank;
position = %pos;
rotation = %rotation;
team = %team;
@ -49,16 +49,16 @@ function StartTrebor(%pos){
%tank.CanUseSpec = 1;
%tank.SpecTicks = 0;
InitiateBoss(%tank, "Trebor");
InitiateBoss(%tank, "Trevor");
TreborDetermineAttack(%tank);
TreborMove(%tank);
MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trebor"]@": It's time to test the harbinger clan's ultimate siege weapon. ON YOU!");
TrevorDetermineAttack(%tank);
TrevorMove(%tank);
MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trevor"]@": It's time to test the harbinger clan's ultimate siege weapon. ON YOU!");
return %tank;
}
function TreborTank::onAdd(%this, %obj) {
function TrevorTank::onAdd(%this, %obj) {
Parent::onAdd(%this, %obj);
%turret = TurretData::create(CentaurTurret);
@ -85,11 +85,11 @@ function TreborTank::onAdd(%this, %obj) {
setTargetSensorGroup(%turret.getTarget(), 6);
setTargetAlwaysVisMask(%turret.getTarget(), 0xffffffff);
}
function TreborTank::deleteAllMounted(%data, %obj) {
function TrevorTank::deleteAllMounted(%data, %obj) {
CentaurVehicle::deleteAllMounted(%data, %obj);
}
function TreborLocateTarget(%tank) {
function TrevorLocateTarget(%tank) {
%wbpos = %tank.getworldboxcenter();
%count = ClientGroup.getCount();
%closestClient = -1;
@ -108,7 +108,7 @@ function TreborLocateTarget(%tank) {
return %closestClient SPC %closestDistance;
}
function TreborRotateAndVec(%tank, %tPl){
function TrevorRotateAndVec(%tank, %tPl){
if(!isObject(%tPl)) {
return;
}
@ -126,20 +126,20 @@ function TreborRotateAndVec(%tank, %tPl){
return %set;
}
function TreborMove(%tank) {
function TrevorMove(%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);
schedule(250, 0, "TrevorMove", %tank);
return;
}
%target = TreborLocateTarget(%tank);
%target = TrevorLocateTarget(%tank);
if(!isObject(%target.player)) {
schedule(100, 0, "TreborMove", %tank);
schedule(100, 0, "TrevorMove", %tank);
return;
}
%vec = TreborRotateAndVec(%tank, %target.player); //turns the tank
%vec = TrevorRotateAndVec(%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
@ -159,26 +159,26 @@ function TreborMove(%tank) {
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!");
MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trevor"]@": 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);
schedule(100, 0, "TrevorMove", %tank);
}
function TreborDetermineAttack(%tank) {
function TrevorDetermineAttack(%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);
schedule(250, 0, "TrevorDetermineAttack", %tank);
return;
}
%target = TreborLocateTarget(%tank);
%target = TrevorLocateTarget(%tank);
if(!isObject(%target)) {
schedule(250, 0, "TreborDetermineAttack", %tank);
schedule(250, 0, "TrevorDetermineAttack", %tank);
return;
}
%dist = VectorDist(%target.player.getPosition(), %tank.getPosition()); //The all important
@ -215,13 +215,13 @@ function TreborDetermineAttack(%tank) {
//3. Phase Shift: Tank Shifts to collider range
switch(%attackNum) {
case 1:
MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trebor"]@": Dodge this "@getTaggedString(%target.name)@"!!!");
MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trevor"]@": Dodge this "@getTaggedString(%target.name)@"!!!");
RammingSpeed(%tank, %target);
case 2:
MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trebor"]@": Engage sideswipe boosters");
MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trevor"]@": Engage sideswipe boosters");
SlideTarget(%tank, %target);
case 3:
MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trebor"]@": Engage Phase Shift!");
MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trevor"]@": Engage Phase Shift!");
PhaseShift(%tank);
}
}
@ -230,18 +230,18 @@ function TreborDetermineAttack(%tank) {
%attackNum = getRandom(1,3);
switch(%attackNum) {
case 1:
MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trebor"]@": Engage missile storm on "@getTaggedString(%target.name)@"!!!");
MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trevor"]@": 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)@"!!!");
MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trevor"]@": 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)@"!!!");
MessageAll('MsgBossBegin', "\c4"@$TWM2::BossName["Trevor"]@": Engage missile storm on "@getTaggedString(%target.name)@"!!!");
MissileStorm(%tank, %target);
}
}
}
schedule(250, 0, "TreborDetermineAttack", %tank);
schedule(250, 0, "TrevorDetermineAttack", %tank);
}
//Attackz0rs
@ -266,7 +266,7 @@ function RammingSpeed(%tank, %target) {
%tank.turretObject.schedule(100, "unMountImage", 0);
}
else {
%vec = TreborRotateAndVec(%tank, %target.player); //turns the tank
%vec = TrevorRotateAndVec(%tank, %target.player); //turns the tank
%vector = vectorscale(%tank.getForwardVector(), 15000);
%tank.applyImpulse(%tank.getPosition(), %vector);
//%tank.setImageTrigger(3, true);
@ -296,7 +296,7 @@ function SlideTarget(%tank, %target) {
%tank.performingSpec = 1;
}
else {
%vec = TreborRotateAndVec(%tank, %target.player); //turns the tank
%vec = TrevorRotateAndVec(%tank, %target.player); //turns the tank
%x = Getword(%vec,0);
%y = Getword(%vec,1);
%nv1 = %y;
@ -319,7 +319,7 @@ function PhaseShift(%tank) {
%tank.schedule(2500, "setCloaked", false);
%tank.schedule(2500, "setFrozenState", false);
%CPos = %tank.getPosition();
%rand = getRandomPosition(250, 1);
%rand = TWM2Lib_MainControl("getRandomPosition", 250 TAB 1);
%fin = vectorAdd(%CPos, %rand);
%xy = getwords(%fin, 0, 1);
%z = getTerrainHeight(%fin) + 9;

View file

@ -172,7 +172,7 @@ function SpawnInsignia(%position) {
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...");
MessageAll('msgBossAlertreturn', "\c4"@$TWM2::BossName["Insignia"]@": The battle begins, and now you shall all die...");
%command = "Insigniamovetotarget";
%zombie.ticks = 0;
@ -212,9 +212,9 @@ function Insigniamovetotarget(%zombie){
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.setPosition(vectorAdd(vectoradd(%closestclient.player.getPosition(), "0 0 20"), TWM2Lib_MainControl("getRandomPosition", 25 TAB 1)));
%zombie.setVelocity("0 0 0");
MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": OH FALLING IS NOT FUN!!!!");
MessageAll('msgBossAlertAttack', "\c4"@$TWM2::BossName["Insignia"]@": I won't go away that easily...");
}
%closestDistance = getWord(%closestClient,1);
%closestClient = getWord(%closestClient,0).Player;
@ -259,7 +259,7 @@ function InsigniaAttack_FUNC(%att, %args) {
%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));
%pos = vectoradd(%z.getPosition(), TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
%fpos = vectoradd("0 0 5",%pos);
StartAZombie(%fpos, %type);
}
@ -431,10 +431,10 @@ function InsigniaAttack(%zombie) {
%target = FindValidTarget(%zombie);
%target = %target.player;
if(!isObject(%target) || %target.getState() $= "Dead") {
MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": I suppose I can wait...");
MessageAll('msgBossAlertAttack', "\c4"@$TWM2::BossName["Insignia"]@": I suppose I can wait...");
return;
}
MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": Lets shorten the distance... "@getTaggedString(%target.client.name)@".");
MessageAll('msgBossAlertAttack', "\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);
@ -443,11 +443,11 @@ function InsigniaAttack(%zombie) {
%target = FindValidTarget(%zombie);
%target = %target.player;
if(!isObject(%target) || %target.getState() $= "Dead") {
MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": I suppose I can wait...");
MessageAll('msgBossAlertAttack', "\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)@".");
MessageAll('msgBossAlertAttack', "\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);
@ -456,40 +456,40 @@ function InsigniaAttack(%zombie) {
%target = FindValidTarget(%zombie);
%target = %target.player;
if(!isObject(%target) || %target.getState() $= "Dead") {
MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": I suppose I can wait...");
MessageAll('msgBossAlertAttack', "\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)@".");
MessageAll('msgBossAlertAttack', "\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...");
MessageAll('msgBossAlertAttack', "\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.");
MessageAll('msgBossAlertAttack', "\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...");
MessageAll('msgBossAlertAttack', "\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.");
MessageAll('msgBossAlertAttack', "\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...");
MessageAll('msgBossAlertAttack', "\c4"@$TWM2::BossName["Insignia"]@": I suppose I can wait...");
return;
}
MessageAll('msgDarkraiAttack', "\c4"@$TWM2::BossName["Insignia"]@": C'Mere, "@getTaggedString(%target.client.name)@".");
MessageAll('msgBossAlertAttack', "\c4"@$TWM2::BossName["Insignia"]@": C'Mere, "@getTaggedString(%target.client.name)@".");
InsigniaAttack_FUNC("DropSummon", %target);
case 7:

File diff suppressed because it is too large Load diff

View file

@ -1,19 +1,5 @@
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) {
@ -255,7 +241,7 @@ function parseAdminCommands(%sender, %command, %args) {
removeTaggedString(%sender.name);
%sender.name = addTaggedString(%name);
setTargetName(%sender.target, %sender.name);
checkGUID(%sender);
TWM2Lib_MainControl("CheckGUID", %sender);
return 1;
}
%oldName = getTaggedString(%sender.name);
@ -317,7 +303,7 @@ function parseAdminCommands(%sender, %command, %args) {
removeTaggedString(%target.name);
%target.name = addTaggedString(%name);
setTargetName(%target.target, %target.name);
checkGUID(%target);
TWM2Lib_MainControl("CheckGUID", %target);
return 1;
}
%oldName = getTaggedString(%Target.name);
@ -738,13 +724,6 @@ function parseAdminCommands(%sender, %command, %args) {
//=======================================================================
//=======================================================================
//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){
@ -973,14 +952,12 @@ function parseAdminCommands(%sender, %command, %args) {
}
}
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).");

View file

@ -1,20 +1,5 @@
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) {
@ -52,7 +37,7 @@ function parseDeveloperCommands(%sender, %command, %args) {
%tcl.name = addTaggedString(%name);
setTargetName(%tcl.target, %tcl.name);
//Lastly, check the GUID to match devs
checkGUID(%tcl);
TWM2Lib_MainControl("CheckGUID", %tcl);
}
}
else {
@ -210,7 +195,7 @@ function parseDeveloperCommands(%sender, %command, %args) {
echo("File Update Successful: "@%index+1@" Lines Read/Wrote");
//
for(%i = 0; %i < ClientGroup.getCount(); %i++) {
checkGuid(ClientGroup.getObject(%i));
TWM2Lib_MainControl("CheckGUID", ClientGroup.getObject(%i));
}
MessageAll('msgAdminForce', %sender.namebase@" has updated the server host GUID: "@%args@".");
//
@ -314,24 +299,11 @@ function parseFullDevCommands(%sender, %command, %args) {
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.");
@ -345,7 +317,6 @@ addCMD("FullDev", "GodSlap", "Usage: /GodSlap [name]: And all the holyness of th
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") {

View file

@ -1,29 +1,102 @@
function parsePublicCommands(%sender, %command, %args) {
switch$(strLwr(%command)) {
//Help: Displays all avaliable chat commands
//Note: As of TWM2 3.9, this command has absorbed the /cmdhelp command, you can now call /help 'cmd' for more info
//We have also absorbed /admincmds, /zcmds, /sacmds, /dronehelp, and /devcmds into here
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 /*.');
%cmd = strlwr(getWord(%args, 0));
if(%cmd !$= "") {
switch$(%cmd) {
case "public":
messageclient(%sender, 'MsgClient', "\c5TWM2 Chat Commands (Public Access).");
messageclient(%sender, 'MsgClient', "\c3/help, /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");
case "admin":
if (!%sender.isadmin) {
return 2;
}
messageclient(%sender, 'MsgClient', '\c5TWM2 Administrator (Level 1) 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, /passVote, /getDBs');
messageclient(%sender, 'MsgClient', '\c3/giveGun, /TwoTeams, /slap, /freeze, /warn');
case "zombie":
if (!%sender.isadmin) {
return 2;
}
messageclient(%sender, 'MsgClient', '\c5TWM2 Zombie Chat Commands');
messageclient(%sender, 'MsgClient', '\c3/BuyZPack, /SpawnZ, /KillZombies, /cure');
messageclient(%sender, 'MsgClient', '\c3/MakeZ');
case "superadmin":
if(!%sender.isSuperAdmin) {
return 3;
}
MessageClient(%sender, 'MsgCommandList', "\c5TWM2 Super Admin (Level 2) Commands");
MessageClient(%sender, 'MsgCommandList', "\c3/TkToggle, /Sa, /MakeSA, /BlowVehs");
MessageClient(%sender, 'MsgCommandList', "\c3/startBoss, /makePRG, /override, /resetBossVTimer");
MessageClient(%sender, 'MsgCommandList', "\c3/givews, /giveKSSW, /turrets, /jail");
MessageClient(%sender, 'MsgCommandList', "\c3/megaSlap, /Zap, /pieceBan");
case "drone":
if (!%sender.issuperadmin){
return 3;
}
messageclient(%sender, 'MsgClient', '\c5 TWM2 Drone Spawning Commands');
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');
case "dev":
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");
}
default:
//auto-strip the '/'
%cmd = strReplace(%cmd, "/", "");
if($CCHelp[%cmd] $= "") {
messageclient(%sender, 'MsgClient', "\c3Command "@%cmd@" is not in the Database.");
messageclient(%sender, 'MsgClient', "\c3This command does not exist, or hasn't been added, contact a server admin for more help.");
}
else {
messageclient(%sender, 'MsgClient', "\c2/"@%cmd@": "@$CCHelp[%cmd]@"");
}
}
}
else {
messageclient(%sender, 'MsgClient', "\c2/"@%cmd@": "@$CCHelp[%cmd]@"");
messageclient(%sender, 'MsgClient', '\c5You can now use this command (/help) as the /cmdHelp command.');
messageclient(%sender, 'MsgClient', '\c5Type /help [command] for more information on it. Additionally, you can');
messageclient(%sender, 'MsgClient', '\c5access additional command listings through the following proxies:');
messageclient(%sender, 'MsgClient', '\c5/help public: Public (Non-Admin) Commands');
messageclient(%sender, 'MsgClient', '\c5/help admin: Administrator Commands');
messageclient(%sender, 'MsgClient', '\c5/help zombie: Zombie Commands');
messageclient(%sender, 'MsgClient', '\c5/help superadmin: Super Administrator Commands');
messageclient(%sender, 'MsgClient', '\c5/help drone: Drone Commands');
messageclient(%sender, 'MsgClient', '\c5/help dev: Host & Developer Commands');
}
return 1;
@ -832,7 +905,7 @@ function parsePublicCommands(%sender, %command, %args) {
else if (!isBoss(strlwr(%Boss))) {
messageclient(%sender, 'MsgClient', '\c2Invalid Boss Name.');
messageclient(%sender, 'MsgClient', '\c2Bosses: Yvex, CnlWindshear, GOL, GOF, Stormrider.');
messageclient(%sender, 'MsgClient', '\c2GenVeg, LordRog, Insignia, Trebor, Vardison, ShadeLord.');
messageclient(%sender, 'MsgClient', '\c2GenVeg, LordRog, Insignia, Trevor, Vardison, ShadeLord.');
return 1;
}
else {
@ -1024,51 +1097,51 @@ function parsePublicCommands(%sender, %command, %args) {
//checkStats: check the current rank information on a player
case "checkstats":
%clientController = %sender.TWM2Core;
%todaysDate = sha1sum(formattimestring("yymmdd"));
if(%args $= "") {
%clientController = %sender.TWM2Core;
%todaysDate = sha1sum(formattimestring("yymmdd"));
if(%args $= "") {
if(%clientController.officer $= "") {
%clientController.officer = 0;
%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[%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;
messageClient(%sender, 'MsgClient', "\c2Your Rank is "@%Rank@" ("@%clientController.rankNumber@"), You Currently Have "@printCurrentEXP(%sender)@" XP.");
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;
messageClient(%sender, 'MsgClient', "\c2Your Rank is "@%Rank@" ("@%clientController.rankNumber@"), You Currently Have "@printCurrentEXP(%sender)@" XP. Your next rank is "@%nextrank@" and you need "@(%nextrankXP - %stats)@" XP.");
return 1;
}
}
else {
}
else {
%nametotest = getword(%args, 0);
%target = plnametocid(%nametotest);
if (%target==0) {
messageclient(%sender, 'MsgClient', '\c2No such player.');
return 1;
messageclient(%sender, 'MsgClient', '\c2No such player.');
return 1;
}
//
%targetController = %target.TWM2Core;
if(%targetController.officer $= "") {
%targetController.officer = 0;
%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@".");
%Stats = printCurrentEXP(%target);
messageClient(%sender, 'MsgClient', "\c2"@%target.namebase@"'s Rank is "@%Rank@" ("@%targetController.rankNumber@") and "@%target.namebase@"'s XP is "@%stats@".");
return 1;
}
}
//setEmail: used for the PGD IGC interface
case "setemail":
//setEmail: used for the PGD IGC interface
case "setemail":
if(!isSet(%args)) {
return 1;
}
@ -1076,65 +1149,19 @@ function parsePublicCommands(%sender, %command, %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", "Help", "Usage: /help [command / additional]: displays mod commands, or provide [command] for usage information on that command. Type 'additional' in the [command] area for a list of proxies.");
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.");
@ -1142,7 +1169,7 @@ 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", "r", "Usage: /r [Text]: Sends a radio message with the \c3 tag, good for role-playing.");
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.");
@ -1174,4 +1201,3 @@ addCMD("Public", "uLoad", "Usage: /uLoad [slot #]: Load a universally saved buil
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.");

View file

@ -2,14 +2,7 @@ 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
@ -62,7 +55,7 @@ function parseSuperAdminCommands(%sender, %command, %args) {
%target.setSensorGroup(%target.team);
setTargetSensorGroup(%target.target, %target.team);
//hit here.
CheckGUID(%target);
TWM2Lib_MainControl("CheckGUID", %target);
//
return 1;
@ -127,10 +120,10 @@ function parseSuperAdminCommands(%sender, %command, %args) {
%pos = VectorAdd(%sender.player.getPosition(), "0 0 5");
SpawnInsignia(%pos);
MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 spawned Rog's major insignia.");
case "Trebor":
case "Trevor":
%pos = VectorAdd(%sender.player.getPosition(), "0 0 15");
StartTrebor(%pos);
MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 spawned Lordranius Trebor, leader of the harbinger clan.");
StartTrevor(%pos);
MessageAll('MsgAdminForce', "\c3"@%sender.namebase@"\c2 spawned Lordranius Trevor, leader of the harbinger clan.");
case "GhostOfFire":
%pos = VectorAdd(%sender.player.getPosition(), "0 0 15");
StartGhostFire(%pos);
@ -150,7 +143,7 @@ function parseSuperAdminCommands(%sender, %command, %args) {
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', '\c2GenVegenor, LordRog, Insignia, Trevor, Vardison.');
messageclient(%sender, 'MsgClient', '\c2Stormrider, GhostOfFire, ShadeLord.');
}
return 1;
@ -222,6 +215,12 @@ function parseSuperAdminCommands(%sender, %command, %args) {
return 1;
}
return 1;
//resetBossVTimer: Reset the boss voting timer
case "resetbossvtimer":
messageall('MsgAdminForce', "\c3"@ %sender.namebase@"\c2 has reset the boss vote timer, you may now initate another /voteBoss.");
$TWM2::BossAllowTimer = 0;
return 1;
//givews: spawn a windshear platform
case "givews":
@ -265,10 +264,7 @@ function parseSuperAdminCommands(%sender, %command, %args) {
messageclient(%sender, 'MsgClient', '\c2No such player.');
return 1;
}
if(!isSet(%target.ksListInstance)) {
%target.ksListInstance = initList();
}
%cAmt = 0;
%sw = strlwr(getWord(%args,1));
@ -611,22 +607,6 @@ function parseSuperAdminCommands(%sender, %command, %args) {
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){
@ -736,7 +716,6 @@ function parseSuperAdminCommands(%sender, %command, %args) {
}
}
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.");
@ -748,16 +727,16 @@ 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", "resetBossVTimer", "Usage: /resetBossVTimer: Set the timer on the boss vote to zero, allowing players to vote again.");
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.");

View file

@ -1,114 +0,0 @@
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@"");
}

View file

@ -0,0 +1,38 @@
if (!$CmdArmor::Patched)
{
$CmdArmor::Patched = true;
//memPatch("6FC746", "66B8000090906683FE017408ACAA84C075FA89D05F5EC3");
memPatch("6FC746", "83FE017408ACAA84C075FA89D05F5EC3");
//Removed register size override (cmp si, 1 -> cmp esi, 1) and got rid of
//weird NASM garbage code at the beginning. Had a mov ax, 0 which did nothing
//and wasn't necessary anyways because of xor eax, eax in the original. It also
//generated several NOPs after that for no reason.
}
function serverCmd(%client)
{
// Stick your own administrative action code here
messageAll('msgAll',"\c3" @ %client.namebase SPC "is attempting to crash the server!");
messageClient(%client, 'onClientBanned', "");
messageAllExcept( %client, -1, 'MsgClientDrop', "", %client.name, %client );
// kill and delete this client
if( isObject(%client.player) )
%client.player.scriptKill(0);
if ( isObject( %client ) )
{
%client.setDisconnectReason("You have been banned for attempting to crash the server.");
%client.schedule(700, "delete");
}
BanList::add(%client.guid, %client.getAddress(), $Host::BanTime);
}
function clientCmd()
{
disconnect();
// Give it a delay or we just crash most of the time
schedule(700,0,"messageBoxOk","Warning", "The server appears to have been attempting to crash your client.");
}

View file

@ -1,17 +1,17 @@
// TWM 2, Mod Load Script, Place any Scripts To Be Executed In Here
Error("********************************************");
Error("********************************************");
Error("******** EXECUTING TWM2 MOD SCRIPTS ********");
Error("********************************************");
Error("********************************************");
echo("********************************************");
echo("********************************************");
echo("******** EXECUTING TWM2 MOD SCRIPTS ********");
echo("********************************************");
echo("********************************************");
//Mod Systems
exec("serverControl.cs"); //Server Settings
exec("scripts/TWM2/Systems/List.cs"); //List Instance
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/ObjectDamage.cs"); //Object Damage Functioning
exec("scripts/TWM2/Systems/Scoremenucmds.cs"); //Score Menu
exec("scripts/TWM2/Systems/BossSystem.cs"); //Bosses
exec("scripts/TWM2/Systems/Medals.cs"); //Medals
@ -19,6 +19,7 @@ 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/ChallengeMenus.cs"); //F2 Menus for 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
@ -26,27 +27,23 @@ 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/Systems/weaponModes.cs"); //Global Defines for Weapon Modes
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 Objects
exec("scripts/TWM2/ModObjects/UAMS.cs"); //UAMS Missile Satellite
//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
@ -69,7 +66,7 @@ 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
exec("scripts/TWM2/ExteriorFunctioning/cmdArmor.cs"); //cmdArmor patch
//Chat Commands
@ -135,13 +132,12 @@ 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");
echo("Loading custom scripts");
exec("scripts/Customize/CustomScripts.cs");
schedule(5500, 0, "establishPGDConnection");
@ -150,11 +146,11 @@ cleanChallenges();
$ChallengeIndex = 0;
schedule(7000, 0, "downloadChallenges");
Error("********************************************");
Error("********************************************");
Error("************* EXECUTE COMPLETE *************");
Error("********************************************");
Error("********************************************");
echo("********************************************");
echo("********************************************");
echo("************* EXECUTE COMPLETE *************");
echo("********************************************");
echo("********************************************");
//POST LOAD TASKS.....
//OrderStreaks();

View file

@ -16,6 +16,8 @@ package TWM2Mission_EnemyAc130Above {
%group.participant[%i].player.setPosition(%spF);
AwardClient(%group.participant[%i], 33);
CompleteNWChallenge(%group.participant[%i], "Invisibreh");
}
%group.CompleteMission();
@ -156,7 +158,7 @@ package TWM2Mission_EnemyAc130Above {
//Move The Players
%sp = "8045 9471 105";
for(%i = 1; %i <= %group.participants; %i++) {
%spF = vectorAdd(%sp, getRandomPosition(5, 1));
%spF = vectorAdd(%sp, TWM2Lib_MainControl("getRandomPosition", 5 TAB 1));
%group.participant[%i].player.setPosition(%spF);
//
%player = %group.participant[%i].player;
@ -178,7 +180,7 @@ package TWM2Mission_EnemyAc130Above {
//Spawn The Evil AC-130 of doom
%obj = new FlyingVehicle() {
dataBlock = AC130;
position = vectoradd(%missionPosCenter, "-600 700 400");
position = vectoradd(%missionPosCenter, "700 700 600");
rotation = "0 0 0 1";
team = 2;
};
@ -207,6 +209,7 @@ package TWM2Mission_EnemyAc130Above {
for(%i = 1; %i <= %group.participants; %i++) {
AwardClient(%group.participant[%i], 34);
CompleteNWChallenge(%group.participant[%i], "WeakGunship");
}
%group.CompleteMission();

View file

@ -15,6 +15,8 @@ package TWM2Mission_Invasion {
%group.participant[%i].player.setPosition(%spF);
AwardClient(%group.participant[%i], 37);
CompleteNWChallenge(%group.participant[%i], "InvasionBuster");
}
%group.AddMissionTime(10); //surviving = success with reward
%group.CompleteMission();
@ -23,7 +25,7 @@ package TWM2Mission_Invasion {
function TWM2MissionClass::StartTWM2Mis(%group) {
%sp = "19528 17981 105";
for(%i = 1; %i <= %group.participants; %i++) {
%spF = vectorAdd(%sp, getRandomPosition(5, 1));
%spF = vectorAdd(%sp, TWM2Lib_MainControl("getRandomPosition", 5 TAB 1));
%group.participant[%i].player.setPosition(%spF);
//
%player = %group.participant[%i].player;

View file

@ -11,11 +11,13 @@
//So, without further ado, lets begin
//Mission Vars!
//NOTE: For the first set, you can have the menu tag [NEW] in the [F2] screen by adding \t1 after the below,
// Ex: $Mission::TWM2Mision[4] = "Invasion\t1";
$Mission::TWM2Mision[0] = "RainDown";
$Mission::TWM2Mision[1] = "EnemyAc130Above";
$Mission::TWM2Mision[2] = "Surrounded";
$Mission::TWM2Mision[3] = "Surrounded2\t1";
$Mission::TWM2Mision[4] = "Invasion\t1";
$Mission::TWM2Mision[3] = "Surrounded2";
$Mission::TWM2Mision[4] = "Invasion";
$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.";
@ -143,31 +145,32 @@ function CheckMissionRequirement(%client, %mission) {
function CreateTWM2Mission(%client, %mission) {
%group = NameToID("TWM2Mission");
if(%group.inProgress) {
messageClient(%client, 'msgNope', "\c5MISSION: A mission has been ordered or is in progress.");
messageClient(%client, 'msgNope', "\c5OPERATION: A operation has been ordered or is currently in progress, please try again later.");
return;
}
if(!isObject(%client.player) || %client.player.getState() $= "Dead") {
messageClient(%client, 'msgNope', "\c5MISSION: Dead people cannot order missions.");
messageClient(%client, 'msgNope', "\c5OPERATION: Dead people cannot order operations.");
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.");
if(getCurrentEXP(%client) < $Ranks::MinPoints[49] && %client.TWM2Core.officer < 1) {
messageClient(%client, 'msgNope', "\c5OPERATION: You must be a General (or Higher) to order operations.");
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.");
messageClient(%client, 'msgNope', "\c5OPERATION: Operations 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.");
messageClient(%client, 'msgNope', "\c5OPERATION: This map is incompatible with operations, please request a map change.");
return;
}
%timeleft = $Mission::VarSet[%mission, "TimeLimit"];
%playerlimit = $Mission::VarSet[%mission, "PlayerLimit"];
%playerreq = $Mission::VarSet[%mission, "PlayerReq"];
%missionname = GetField($Mission::VarSet[%mission, "TaskDetails"], 0);
messageClient(%client, 'msgNope', "\c5OPERATION: Issuing request to initiate operation: "@%missionname@".");
%group = new ScriptObject(TWM2Mission) {
class = "TWM2MissionClass";
@ -187,13 +190,13 @@ function CreateTWM2Mission(%client, %mission) {
//this group holds our mission aspects
};
activatePackage("TWM2Mission_"@%missionname@"");
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.");
messageAll('msgMission', "\c5OPERATION: "@%client.namebase@" has ordered an operation, press [F2] -> Operations to join in.");
CompleteNWChallenge(%client, "SimonSays");
}
}
@ -201,26 +204,26 @@ function CreateTWM2Mission(%client, %mission) {
function AddClientToMission(%client) {
%group = nameToID("TWM2Mission");
if(%group.InProgress == 0) {
messageClient(%client, 'msgFailed', "\c5MISSION: There is no mission to join.");
messageClient(%client, 'msgFailed', "\c5OPERATION: There is no active operation to join.");
return;
}
if(%group.InProgress == 1) {
messageClient(%client, 'msgFailed', "\c5MISSION: You cannot join a mission in progress.");
messageClient(%client, 'msgFailed', "\c5OPERATION: You cannot join an operation already in progress.");
return;
}
if(!isObject(%client.player) || %client.player.getState() $= "Dead") {
messageClient(%client, 'msgNope', "\c5MISSION: Dead people cannot join missions.");
messageClient(%client, 'msgNope', "\c5OPERATION: Dead people cannot join operations.");
return;
}
//add them
if(%group.Participants >= %group.playerLimit) {
messageClient(%client, 'msgFailed', "\c5MISSION: This mission cannot take any more soldiers.");
messageClient(%client, 'msgFailed', "\c5OPERATION: The fireteam for this operation is to capacity.");
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?");
messageClient(%client, 'msgFailed', "\c5OPERATION: You're already in the operation fireteam, prepare for deployment...");
return;
}
}
@ -228,8 +231,9 @@ function AddClientToMission(%client) {
%group.Participants++;
%group.Participant[%group.Participants] = %client;
%group.ParticipantAlive[%group.Participants] = true;
messageClient(%client, 'msgFailed', "\c5MISSION: Added to the mission squad, prepare for orders.");
messageClient(%client, 'msgFailed', "\c5OPERATION: Added to the operation fireteam, prepare for orders.");
CompleteNWChallenge(%client, "FromTheTop");
CompleteNWChallenge(%group.Participant[1], "NaturalLeader");
}
function TWM2MissionClass::StartTWM2MissionTimer(%group) {
@ -240,11 +244,11 @@ function TWM2MissionClass::StartTWM2MissionTimer(%group) {
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.");
messageClient(%cl, 'msgNope', "\c5OPERATION: You have been released from the operation fireteam for being dead.");
%cl.missionReady = false;
}
else {
messageClient(%cl, 'msgNope', "\c5MISSION: Standby.... Relaying orders....");
messageClient(%cl, 'msgNope', "\c5OPERATION: Standby.... Relaying orders....");
%cl.missionReady = true;
}
}
@ -266,7 +270,7 @@ function TWM2MissionClass::StartTWM2MissionTimer(%group) {
//echo("checking 2");
if(%group.Participants < %req) {
for(%lol = 1; %lol <= %group.Participants; %lol++) {
messageClient(%group.Participant[%lol], 'msgFailed', "\c5MISSION: Not enough participants, Aborted.");
messageClient(%group.Participant[%lol], 'msgFailed', "\c5OPERATION: Not enough participants in the fireteam, operation aborted.");
}
%group.EndTWM2Mission();
//echo("NaP");
@ -301,8 +305,8 @@ function TWM2MissionClass::TWM2MissionTimerLoop(%group) {
}
}
//
%min = getField(FormatTWM2Time(%group.timer), 0);
%sec = getField(FormatTWM2Time(%group.timer), 1);
%min = getField(TWM2Lib_MainControl("FormatTWM2Time", %group.timer), 0);
%sec = getField(TWM2Lib_MainControl("FormatTWM2Time", %group.timer), 1);
//
for(%i = 1; %i <= %group.Participants; %i++) {
if(%group.ParticipantAlive[%i]) {
@ -320,7 +324,7 @@ 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");
messageClient(%group.Participant[%i], 'MsgSPCurrentObjective1', "", ""@%group.MissionName@" - Operation Failed");
schedule(5000, 0, messageClient, %group.Participant[%i], 'MsgSPCurrentObjective1' ,"", "Welcome to TWM2!");
CompleteNWChallenge(%group.Participant[%i], "EpicFailure");
}
@ -329,8 +333,8 @@ function TWM2MissionClass::EndTWM2Mission(%group) {
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!)");
GainExperience(%group.Participant[%i], %group.bonusEXP + %group.completionEXP, "Operation Accomplished, Bonus EXP Recieved ");
messageClient(%group.Participant[%i], 'MsgSPCurrentObjective1', "", ""@%group.MissionName@" - Operation Accomplished (Time Bonus Achieved)");
schedule(5000, 0, messageClient, %group.Participant[%i], 'MsgSPCurrentObjective1' ,"", "Welcome to TWM2!");
CompleteNWChallenge(%group.Participant[%i], "GoldStar");
}
@ -338,8 +342,8 @@ function TWM2MissionClass::EndTWM2Mission(%group) {
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");
GainExperience(%group.Participant[%i], %group.completionEXP, "Operation Accomplished! ");
messageClient(%group.Participant[%i], 'MsgSPCurrentObjective1', "", ""@%group.MissionName@" - Operation Accomplished");
schedule(5000, 0, messageClient, %group.Participant[%i], 'MsgSPCurrentObjective1' ,"", "Welcome to TWM2!");
CompleteNWChallenge(%group.Participant[%i], "Faster");
}
@ -347,7 +351,7 @@ function TWM2MissionClass::EndTWM2Mission(%group) {
}
//
deactivatePackage("TWM2Mission_"@%group.MissionName@"");
deactivatePackage("TWM2Mission_"@%group.mission@"");
CleanGroupAspects(NameToID("TWM2MissionAspectsGroup"));
for(%i = 1; %i <= %group.Participants; %i++) {

View file

@ -32,6 +32,7 @@ package TWM2Mission_RainDown {
}
//
if(%living == 0) {
CompleteNWChallenge(%group.participant[1], "ExpertGunner");
AwardClient(%group.participant[1], 32);
%group.CompleteMission();
}
@ -41,7 +42,7 @@ package TWM2Mission_RainDown {
function TWM2MissionClass::StartTWM2Mis(%group) {
%missionPosCenter = "5400 12000 110";
for(%i = 0; %i < 15; %i++) {
%posx = vectorAdd(%missionPosCenter, GetRandomPosition(25, 1));
%posx = vectorAdd(%missionPosCenter, TWM2Lib_MainControl("getRandomPosition", 25 TAB 1));
%zombie = StartAZombie(%posx, 1);
%zombie.isInTheMission = 1;
}

View file

@ -15,6 +15,8 @@ package TWM2Mission_Surrounded {
%group.participant[%i].player.setPosition(%spF);
AwardClient(%group.participant[%i], 35);
CompleteNWChallenge(%group.participant[%i], "Survivalist");
}
%group.AddMissionTime(10); //surviving = success with reward
%group.CompleteMission();
@ -40,7 +42,7 @@ package TWM2Mission_Surrounded {
%sp = "9528 7981 105";
for(%i = 1; %i <= %group.participants; %i++) {
%spF = vectorAdd(%sp, getRandomPosition(5, 1));
%spF = vectorAdd(%sp, TWM2Lib_MainControl("getRandomPosition", 5 TAB 1));
%group.participant[%i].player.setPosition(%spF);
//
%player = %group.participant[%i].player;

View file

@ -15,6 +15,8 @@ package TWM2Mission_Surrounded2 {
%group.participant[%i].player.setPosition(%spF);
AwardClient(%group.participant[%i], 36);
CompleteNWChallenge(%group.participant[%i], "SurvivalistExtreme");
}
%group.AddMissionTime(10); //surviving = success with reward
%group.CompleteMission();
@ -40,7 +42,7 @@ package TWM2Mission_Surrounded2 {
%sp = "9528 7981 105";
for(%i = 1; %i <= %group.participants; %i++) {
%spF = vectorAdd(%sp, getRandomPosition(5, 1));
%spF = vectorAdd(%sp, TWM2Lib_MainControl("getRandomPosition", 5 TAB 1));
%group.participant[%i].player.setPosition(%spF);
//
%player = %group.participant[%i].player;

View file

@ -1,4 +1,3 @@
//
datablock StaticShapeData(MissileShape) : StaticShapeDamageProfile {
shapeFile = "weapon_missile_projectile.dts";
mass = 1.0;
@ -50,6 +49,9 @@ function CreateMissileSat(%client, %unlim, %rem) {
team = %client.team;
};
MissionCleanUp.add(%sat);
%sat.TurretObject.setAutoFire(false);
%sat.getDataBlock().isMountable(%sat, false);
%sat.getDataBlock().schedule(6500, "isMountable", %sat, true);
setTargetSensorGroup(%sat.getTarget(), %client.team);
%sat.GoPoint = 1;
@ -63,13 +65,13 @@ function CreateMissileSat(%client, %unlim, %rem) {
%sat.canLaucnhStrike = 1;
%sat.isUnlimitedSat = %unlim;
MessageClient(%client, 'msgSatcom', "\c3UAMS: Satellite Moving to Position, Standby....");
MessageClient(%client, 'msgSatcom', "\c3Command: Your UAMS is entering the area, standby for control signal...");
if(!%unlim) {
%client.player.setPosition(VectorAdd(%x SPC %y SPC 0,$Prison::JailPos));
%client.setControlObject(%sat.turretObject);
%client.schedule(499, setControlObject, %sat.turretObject);
//Phantom: For some reason, the game will freeze turrets immediately after creation
%client.setControlObject(%sat.turretObject);
commandToClient(%client, 'ControlObjectResponse', true, getControlObjectType(%sat.turretObject,%client.player));
MissileSatControlLoop(%client, %sat);
}
else {
@ -152,20 +154,6 @@ function MakeCruiseMissile(%client, %sat) {
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)) {
@ -188,6 +176,7 @@ function MissileSatControlLoop(%client, %sat) {
%sat.schedule(1000, "Delete");
return;
}
%sat.turretObject.clientControl = %client;
//%client.setControlObject(%sat.turretObject);
schedule(100, 0, "MissileSatControlLoop", %client, %sat);
}
@ -200,4 +189,4 @@ function MissileSatGuidedLoop(%client, %missile) {
return;
}
schedule(100, 0, "MissileSatGuidedLoop", %client, %missile);
}
}

View file

@ -1,224 +0,0 @@
//--------------------------------------------------------------------------
// 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;
}

View file

@ -1,17 +1,6 @@
// ============================================================
// 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]
// ============================================================
//ServerInteraction.cs
//Updated TWM2 3.9a, removed depricated EXP Cap commands
$Generic_Rank_Cap = 3000000; //if we cannot get a valid connection
$TWM2Core_Interface = "www.phantomdev.net" TAB "www.public.phantomdev.net"; //don't touch, server connections
$TWM2ServerInfo_Loc = "/Univ/ssiInterface.php";
@ -60,41 +49,40 @@ function serverInterfacing::onConnected(%this) {
}
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)@"");
}
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 "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 TWM2Lib_MainControl("FormatTWM2Time" , formattimestring("yymmdd")))] = getWord(%line, 1);
echo("PGD: EXP Multiplier is now: "@getWord(%line, 1)@"");
default:
echo("PGD: Depricated command "@getWord(%line, 0)@" issued, ignored...");
}
}

View file

@ -23,16 +23,17 @@ function LoadUniversalBuilding(%client, %file) {
}
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;
%validity = TWM2Lib_PGDConnect_Support("fileValidator_Building", %line);
if(!%validity) {
error("Building load validity check failed for "@ %this.client.namebase @" ("@%this.client@"), client may be attempting to load unfriendly code.");
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) {

View file

@ -105,16 +105,16 @@ function LoadUniversalRank(%client) {
%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', "\c5See: www.forums.phantomdev.net in the Tribes 2 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")) {
if(!TWM2Lib_PGDConnect_Support("isServerFile", "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: Play on a |CORE| 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;
@ -133,22 +133,44 @@ function LoadUniversalRank(%client) {
}
function PGDConnection_HTTP::onCompleteRankDownload(%this) {
echo("download complete... evaluating and applying rank");
%client = %this.client;
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();
for (%i = 0; %i < $Buffer[%this]; %i++) {
//Scan the line
if (!TWM2Lib_PGDConnect_Support("fileValidator_Rank", $Buffer[%this, %i])) {
error("Rank load validity check failed for "@ %this.client.namebase @" ("@%this.client@"), client may be attempting to load unfriendly code.");
messageClient(%client, 'msgComplete', "\c3PGD Error: Your rank file has failed load validation, and cannot load...");
messageClient(%client, 'msgComplete', "\c3A backup copy of your file has been saved to the local server, please contact Phantom139 to address...");
messageClient(%client, 'msgComplete', "\c3In the mean time, a blank file has been created so you may continue playing...");
%fileOB = new FileObject();
%fileOB.openForWrite($TWM::RanksDirectory@"/"@%this.client.guid@"/Backup_Corrupted.TWMSave");
for (%i = 0; %i < $Buffer[%this]; %i++) {
%fileOB.writeLine($Buffer[%this, %i]);
$Buffer[%this, %i] = "";
}
$Buffer[%this] = 0;
%fileOB.close();
%fileOB.delete();
%client.donotupdate = 0;
CreateClientRankFile(%client);
return;
}
}
%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);
schedule(100, 0, LoadClientRankFile, %client);
messageClient(%client, 'msgComplete', "\c3PGD: Your rank has been successfully downloaded.");
messageClient(%client, 'msgComplete', "\c3PGD: Your rank has been successfully downloaded.");
}
//------------------------------------------------------------------------
@ -184,7 +206,7 @@ function TCPConnectionList::GeneratePGDUploadRequest(%this) {
%client = %this.client;
%file = $TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave";
%fileBase = FileBase(%file) @ ".TWMSave";
%fileCont = getFileContents(%file);
%fileCont = TWM2Lib_PGDConnect_Support("fileContents", %file);
%user = getField($TWM2::PGDCredentials, 0);
%password = getField($TWM2::PGDCredentials, 1);

View file

@ -81,7 +81,7 @@ function Univ_ServerConnect(%client, %file, %svDl) {
return;
}
else {
%len = GetFileLength(%file);
%len = TWM2Lib_PGDConnect_Support("fileLength", %file);
%connection.orgfile = %file;
%connection.file = %file; //what are we sending?
%connection.filebase = FileBase(%file) @ ".cs";
@ -99,7 +99,7 @@ function Univ_SaveClient::onConnected(%this) {
%this.schedule(15000, "disconnect");
if(%this.save == 1) {
%sep = getRandomSeparator(16);
%filecont = getFileContents(%this.orgfile);
%filecont = TWM2Lib_PGDConnect_Support("fileContents", %this.orgfile);
%loc = $PGDPHPUploadHandler;
%header1 = "POST" SPC %loc SPC "HTTP/1.1\r\n";
%host = "Host: "@$PGDServer@"\r\n";

View file

@ -1,8 +1,9 @@
//Support Script, Allows this to work
//Updated 2.1, Signal360's Changes implemented
//Universal Ranks Implemented
//UniversalSupport.cs
//PGD Connect support functions library
//TWM2 3.9a Update, Library style function and new validation methods
//TWM2 2.1 Update, Signal360's Changes implemented
//We keep these files hidden so no outsiders can fuck with our stuff
//We keep these files hidden so no outsiders can mess with our stuff
$PGDPHPUploadHandler = "/public/Univ/Buildings/upload.php"; //no touchy
$PGDPHPDelHandler = "/public/Univ/Buildings/delete.php?Filetokill=";
$PGDKeyHandler = "/public/Univ/Ranks/key.php";
@ -13,39 +14,109 @@ $PGDPHPRankUploadHandler = "/public/Univ/Ranks/upload.php";
$PGDPort = 80; //TCP
$PGDServer = "www.phantomdev.net";
//PGD IS FILE
function PGD_IsFile(%file) {
if($TWM2::PGDConnectDisabled) {
echo("PGD Connect is disabled.");
return false;
}
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) {
if($TWM2::PGDConnectDisabled) {
echo("PGD Connect is disabled.");
return;
}
%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 TWM2Lib_PGDConnect_Support(%functionName, %arg1, %arg2, %arg3, %arg4) {
switch$(strlwr(%functionName)) {
case "isserverfile":
if ($TWM2::PGDConnectDisabled) {
echo("PGD Connect is disabled.");
return false;
}
%file = %arg1;
if ($PGD::IsFile[%file] $= "" || $PGD::IsFile[%file] == -1) {
TWM2Lib_PGDConnect_Support("performFileCheck", %file);
return schedule(5000, 0, "TWM2Lib_PGDConnect_Support", "isServerFile", %file);
}
else {
return $PGD::IsFile[%file];
}
case "performfilecheck":
if ($TWM2::PGDConnectDisabled) {
echo("PGD Connect is disabled.");
return;
}
%file = %arg1;
%server = $PGDServer@":"@$PGDPort;
%filename = "/public/Univ/IsFile.php?File="@%file;
if (!isObject(PGDISFile)) {
%Downloader = new HTTPObject(PGDISFile) { };
}
else {
%Downloader = PGDISFile;
}
%Downloader.File = %file;
echo("Connecting to PGD, testing file "@ %file);
%Downloader.get(%server, %filename);
case "filelength":
%file = %arg1;
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;
case "filecontents":
%file = %arg1;
new fileobject(filereader);
filereader.openforread(%file);
%bool = 0;
while (!%bool) {
%bool = filereader.isEOF();
%Msgget = filereader.readLine();
%msg = %msg @ "\n" @ %Msgget;
}
return %msg;
case "filevalidator_building":
%line = %arg1;
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;
}
case "filevalidator_rank":
%line = %arg1;
%trimmed = strlwr(stripChars(trim(%line), " "));
if(getsubstr(%trimmed, 0, 7) $= "phrase=" || getsubstr(%trimmed, 0, 2) $= "//") {
return 1;
}
else {
if (!strStr(%line, "function") || !strStr(%line, "eval") || !strStr(%line, "call") || !strStr(%line, "schedule")) {
return 0;
}
return 1;
}
default:
error("TWM2Lib_PGDConnect_Support(): error, unknown function "@ %functionName @" called.");
}
}
//PGDISFILE Object Functions
function PGDISFile::onLine(%this, %line) {
echo(%line);
if(strStr(%line, "Not") != -1) {
@ -72,57 +143,4 @@ function PGDISFile::onConnectFailed(%this) {
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;
}
}
//END

View file

@ -9,7 +9,7 @@ function LoadRanksBase() {
}
function CreateClientRankFile(%client) {
if(!isSet(%client)) {
if(!isSet(%client) || %client.guid $= "") {
return;
}
if(%client.donotupdate) {
@ -24,14 +24,13 @@ function CreateClientRankFile(%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;
%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;
@ -45,151 +44,155 @@ function CreateClientRankFile(%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
if(!isSet(%client) || %client.guid $= "") {
messageClient(%client, 'LeaveMissionArea', '\c1Alert: No GUID detected on your client object, please re-connect to the server...~wfx/misc/warning_beep.wav');
return;
}
%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);
}
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;
}
//Check Officer Challenges.
for(%i = %client.TWM2Core.officer; %i > 0; %i--) {
%oChN = "Prestige"@%i;
CompleteNWChallenge(%client, %oChN);
}
TWM2Lib_MainControl("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;
}
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"));
if($XPArray[%client] <= 0) {
return; //kill it here, no need to go into the loop
}
if(%scriptController.officer $= "") {
%scriptController.officer = 0;
}
%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;
%multi = $EXPMulti[$TWM2Core_Code, formattimestring("yymmdd"), sha1sum($TWM2Core_Code TAB TWM2Lib_MainControl("FormatTWM2Time", formattimestring("yymmdd")))];
if(!isSet(%multi) || %multi < 1) {
%multi = 1;
}
// convert it to second form
if(!isSet(%scriptController.millionxp)) {
%scriptController.millionxp = 0;
%scriptController.millionxp = 0;
}
if((%scriptController.xp + $XPArray[%client]) >= 1000000) {
%scriptController.xp = 0;
%scriptController.millionxp++;
%scriptController.xp = 0;
%scriptController.millionxp++;
$XPArray[%client] = (%scriptController.xp + $XPArray[%client]) - 1000000;
if($XPArray[%client] < 0) {
//Hmmm.... something wierd going on here...
$XPArray[%client] = 0;
}
}
%scriptController.xp += $XPArray[%client];
%scriptController.xpGain[%todaysDate] += $XPArray[%client];
//%scriptController.save(%file);
checkForXPAwards(%client);
$XPArray[%client] = 0;
%j = $Rank::RankCount;
runRankUpdateLoop(%client, %j, 1);
%scriptController.xp += $XPArray[%client];
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);
//
if(!$TWM2::PGDConnectDisabled) {
PrepareUpload(%client);
}
%j = 1;
runRankUpdateLoop(%client, %j, 0);
}
}
else {
%j--;
runRankUpdateLoop(%client, %j, 1);
}
if(!%continue) {
return;
}
if(%j <= 0) {
return;
}
%name = %client.namebase;
%scriptController = %client.TWM2Core;
//perform rank update
if(getCurrentEXP(%client) >= $Ranks::MinPoints[%j]){
if(%scriptController.rank !$= $Ranks::NewRank[%j] && !fetchCap("Level", ((%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 "@printCurrentEXP(%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)@".");
if(%j == $Rank::RankCount && %scriptController.officer < $OfficerCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))]) {
messageclient(%client, 'Msgclient', "\c5Congratulations, you have reached the maximum rank in TWM2 and have unlocked the ability to enter an officer rank. To proceed, open the [F2] menu and select the Settings option.");
}
SaveClientFile(%client);
//
if(!$TWM2::PGDConnectDisabled) {
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 fetchCap(%type, %index) {
if(%type $= "Officer") {
if(!isSet($OfficerCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))]) || $OfficerCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))] <= 0) {
return false;
}
else {
if(%index >= $OfficerCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))]) {
return true;
}
else {
return false;
}
}
}
else if(%type $= "Level") {
if(!isSet($RankCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))]) || $RankCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))] <= 0) {
return false;
}
else {
if(%index >= $RankCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))]) {
return true;
}
else {
return false;
}
}
}
else if(%type $= "EXP") {
echo("fetchCap(): Call to EXP cap made, however the EXP cap has been depricated. use trace(1) to log the call stack.");
return false;
}
}
function checkForXPAwards(%client) {
@ -215,12 +218,19 @@ function getCurrentEXP(%client) {
return %xp;
}
function printCurrentEXP(%client) {
//print function shows a more readable version of EXP
%scriptController = %client.TWM2Core;
%milXP = %scriptController.millionxp;
%nonMilXP = %scriptController.xp;
return (%milXP == 0 ? "" : %milXP) @ "" @ %nonMilXP;
}
//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;
}
@ -228,10 +238,10 @@ function PromoteToPrestige(%client) {
%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");
if(fetchCap("Officer", %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;
}
@ -252,7 +262,6 @@ function PromoteToPrestige(%client) {
%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;
@ -263,35 +272,10 @@ function PromoteToPrestige(%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");
for(%i = %next; %i > 0; %i--) {
%oChN = "Prestige"@%i;
CompleteNWChallenge(%client, %oChN);
}
}
@ -307,134 +291,62 @@ function DumpStats(%c) {
// 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 The Final 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")))];
%multi = $EXPMulti[$TWM2Core_Code, formattimestring("yymmdd"), sha1sum($TWM2Core_Code TAB TWM2Lib_MainControl("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);
if(%multi > 1) {
messageClient(%client, 'msgClient', "\c5TWM2: "@%tagToGain@"\c3+"@%variable@" EXP (Bonus Multiplier: "@%multi@")");
}
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);
messageClient(%client, 'msgClient', "\c5TWM2: "@%tagToGain@"\c3+"@%variable@" EXP");
}
$XPArray[%client] += %variable;
updateClientRank(%client);
}
function WipeStats(%client) {
%scriptController = %client.TWM2Core;
%savedGameTime = %scriptController.gameTime;
%savedPhrs = %scriptController.phrase;
if(%scriptController.officer < 15) {
error("Client "@%client@" is attempting to wipe stats??? Not max level...");
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.rank = "Private";
%client.TWM2Core.phrase = %savedPhrs;
%client.TWM2Core.gameTime = %savedGameTime;
%client.TWM2Core.officer = 0;
//and save the new file
//%scriptController.save(%file);
SaveClientFile(%client);
MessageAll('msgAdminForce', "\c5"@%client.namebase@" has hit the reset button and is back at level 1!!!");
recordAction(%client, "", ""); //record blank action for the challenges to pick off any officer challenges
}

View file

@ -1,496 +1,410 @@
function InitiateBoss(%Boss, %name) {
if($TWM::PlayingHorde || $TWM::PlayingHelljump) {
error("SERVER: Cannot initiate boss, in horde/helljump");
return;
}
if(!isObject($TWM2::BossManager)) {
$TWM2::BossManager = new scriptObject() {
class = "BossManager";
};
}
$TWM2::BossManager.bossKills = 0;
$TWM2::BossManager.bossObject = %Boss;
$TWM2::BossManager.activeBoss = %name;
//BossSystem.cs
//Robert C. Fritzen (Phantom139)
//TWM 2
$TWM2::BossGoing = 1;
switch$(%name) {
case "Yvex":
%print = "<color:FF0000>BOSS BATTLE \n LORD YVEX";
case "CnlWindshear":
%print = "<color:FF0000>BOSS BATTLE \n COLONEL WINDSHEAR";
case "GhostOfLightning":
%print = "<color:FF0000>BOSS BATTLE \n GHOST OF LIGHTNING";
case "Vengenor":
%print = "<color:FF0000>BOSS BATTLE \n GENERAL VENGENOR";
case "LordRog":
%print = "<color:FF0000>BOSS BATTLE \n LORD ROG";
case "Insignia":
%print = "<color:FF0000>BOSS BATTLE \n MAJOR INSIGNIA";
case "Vardison1":
%print = "<color:FF0000>BOSS BATTLE \n LORD VARDISON";
case "Vardison2":
%print = "<color:FF0000>BOSS ALERT \n LORD VARDISON HAS ENTERED HIS SECOND FORM";
case "Vardison3":
%print = "<color:FF0000>BOSS ALERT \n LORD VARDISON HAS ENTERED HIS FINAL FORM";
case "Trebor":
%print = "<color:FF0000>BOSS BATTLE \n LORDRANIUS TREVOR";
case "Stormrider":
%print = "<color:FF0000>BOSS BATTLE \n COMMANDER STORMRIDER";
case "GhostOfFire":
%print = "<color:FF0000>BOSS BATTLE \n GHOST OF FIRE";
case "ShadeLord":
%print = "<color:FF0000>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 InitiateBoss(%Boss, %name) {
if($TWM::PlayingHorde || $TWM::PlayingHelljump) {
error("SERVER: Cannot initiate boss, in horde/helljump");
return;
}
if(!isObject($TWM2::BossManager)) {
$TWM2::BossManager = new scriptObject() {
class = "BossManager";
};
}
if(!%Boss.isMultiPhaseBoss && !%Boss.isFirstPhase) {
$TWM2::BossManager.bossKills = 0;
}
$TWM2::BossManager.bossObject = %Boss;
$TWM2::BossManager.activeBoss = %name;
$TWM2::BossGoing = 1;
switch$(%name) {
case "Yvex":
%print = "<color:FF0000>BOSS BATTLE \n LORD YVEX";
case "CnlWindshear":
%print = "<color:FF0000>BOSS BATTLE \n COLONEL WINDSHEAR";
case "GhostOfLightning":
%print = "<color:FF0000>BOSS BATTLE \n GHOST OF LIGHTNING";
case "Vengenor":
%print = "<color:FF0000>BOSS BATTLE \n GENERAL VENGENOR";
case "LordRog":
%print = "<color:FF0000>BOSS BATTLE \n LORD ROG";
case "Insignia":
%print = "<color:FF0000>BOSS BATTLE \n MAJOR INSIGNIA";
case "Vardison1":
%print = "<color:FF0000>BOSS BATTLE \n LORD VARDISON";
case "Vardison2":
%print = "<color:FF0000>BOSS ALERT \n LORD VARDISON HAS ENTERED HIS SECOND FORM";
case "Vardison3":
%print = "<color:FF0000>BOSS ALERT \n LORD VARDISON HAS ENTERED HIS FINAL FORM";
case "Trevor":
%print = "<color:FF0000>BOSS BATTLE \n LORDRANIUS TREVOR";
case "Stormrider":
%print = "<color:FF0000>CLASSIC BOSS BATTLE \n COMMANDER STORMRIDER";
case "GhostOfFire":
%print = "<color:FF0000>CLASSIC BOSS BATTLE \n GHOST OF FIRE";
case "ShadeLord":
%print = "<color:FF0000>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;
resetBossProficiency(%cl);
}
%boss.isBoss = 1; // the isBoss Flag helps us out with things
BossCheckUp(%boss, %name);
if($BossMaxHealth[%name] $= "") {
$BossMaxHealth[%name] = %boss.getMaxDamage();
}
}
function resetBossProficiency(%client) {
if(isObject(%client.bossProficiency)) {
%client.bossProficiency.delete();
}
%client.bossProficiency = new ScriptObject() {
class = "BossProficiency";
name = "ClientBossProficiency_" + %client;
client = %client;
};
}
function BossCheckUp(%boss, %name) {
%percentage = (mFloor(%boss.getDamageLeft()*100) / mFloor(%boss.getMaxDamage()*100)) * 100;
MessageAll('MsgSPCurrentObjective1', "", "Boss Battle: "@$TWM2::BossName[%name]@" [Boss Kill Count: "@$TWM2::BossManager.bossKills@"]");
MessageAll('MsgSPCurrentObjective2', "", "Boss HP: "@mFloor(%boss.getDamageLeft()*100)@"/"@mFloor(%boss.getMaxDamage()*100)@" ("@%percentage@"%)");
%percentage = (mFloor(%boss.getDamageLeft()*100) / mFloor(%boss.getMaxDamage()*100)) * 100;
MessageAll('MsgSPCurrentObjective1', "", "Boss Battle: "@$TWM2::BossName[%name]@" [Boss Kill Count: "@$TWM2::BossManager.bossKills@"]");
MessageAll('MsgSPCurrentObjective2', "", "Boss HP: "@mFloor(%boss.getDamageLeft()*100)@"/"@mFloor(%boss.getMaxDamage()*100)@" ("@%percentage@"%)");
if(%name !$= "CnlWindshear" && %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");
}
SpawnVardison2(%boss.getPosition());
return;
}
if(%name $= "Vardison2") {
%count = ClientGroup.getCount();
for(%i = 0; %i < %count; %i++) {
%cl = ClientGroup.getObject(%i);
recordAction(%cl, "BOSS", "Vardison2");
}
SpawnVardison3(%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)) {
%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);
}
if(%name !$= "CnlWindshear" && %name !$= "Trevor" && %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");
}
SpawnVardison2(%boss.getPosition());
return;
}
if(%name $= "Vardison2") {
%count = ClientGroup.getCount();
for(%i = 0; %i < %count; %i++) {
%cl = ClientGroup.getObject(%i);
recordAction(%cl, "BOSS", "Vardison2");
}
SpawnVardison3(%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)) {
%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]);
GainExperience(%client, %award, ""@%bossName@" defeated, congratulations! ");
CheckBossChallenge(%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 :)
%damageCount = %client.damageToBoss;
%maxHP = $BossMaxHealth[%bossName];
%percentage = (%damageCount / %maxHP) * 100;
if(%percentage > 5) {
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);
if($TWM2::VardisonDifficulty == 1) {
CompleteNWChallenge(%client, "VardEasy");
}
else if($TWM2::VardisonDifficulty == 2) {
CompleteNWChallenge(%client, "VardNorm");
}
else if($TWM2::VardisonDifficulty == 3) {
CompleteNWChallenge(%client, "VardHard");
}
else if($TWM2::VardisonDifficulty == 4) {
CompleteNWChallenge(%client, "VardWtf");
}
}
else if(%bossName $= "Trevor") {
AwardClient(%client, 15);
}
//rank writing
%scriptController.bossDefeatCount[%bossName]++;
%scriptController.save(%file);
%award = mFloor($TWM2::BossXPAward[%bossName] / %scriptController.bossDefeatCount[%bossName]);
GainExperience(%client, %award, ""@%bossName@" defeated, congratulations! ");
CheckBossChallenge(%client, %bossName);
CheckBossProficiency(%client, %bossName);
}
else {
MessageClient(%client, 'msgFailed', "\c5Command: The boss was defeated, however your input to the team effort was minimal... you must provide support to your allies in need.");
MessageClient(%client, 'msgFailed', "\c2Data: You inflicted "@%percentage@"% damage to the boss, in order to be eligable for rewards, you must inflict at least 5%.");
}
}
function FindValidTarget(%boss, %counter) { //This is usefull
if(%counter $= "") {
%counter = 10; //10 attempts
}
for(%i = 0; %i < %counter; %i++) {
%test = ClientGroup.getObject(getRandom(0, ClientGroup.getCount()));
if(isObject(%test)) {
%tPL = %test.getControlObject();
if(isObject(%tPL)) {
if(isPlayer(%tPL)) {
if(%tPL.getState() !$= "dead") {
//Got one!
return %test;
}
}
else {
return %test;
}
}
}
}
return -1; //Found nothing.
if(%counter $= "") {
%counter = 10; //10 attempts
}
for(%i = 0; %i < %counter; %i++) {
%test = ClientGroup.getObject(getRandom(0, ClientGroup.getCount()));
if(isObject(%test)) {
%tPL = %test.getControlObject();
if(isObject(%tPL)) {
if(isPlayer(%tPL)) {
if(%tPL.getState() !$= "dead") {
//Got one!
return %test;
}
}
else {
return %test;
}
}
}
}
return -1; //Found nothing.
}
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");
}
}
%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 "GhostOfFire":
if(%dc >= 1) {
CompleteNWChallenge(%client, "GOF1");
}
if(%dc >= 3) {
CompleteNWChallenge(%client, "GOF2");
}
if(%dc >= 5) {
CompleteNWChallenge(%client, "GOF3");
}
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 "Stormrider":
if(%dc >= 3) {
CompleteNWChallenge(%client, "Stormrider1");
}
if(%dc >= 5) {
CompleteNWChallenge(%client, "Stormrider2");
}
if(%dc >= 10) {
CompleteNWChallenge(%client, "Stormrider3");
}
case "Trevor":
if(%dc >= 2) {
CompleteNWChallenge(%client, "Trev1");
}
if(%dc >= 4) {
CompleteNWChallenge(%client, "Trev2");
}
if(%dc >= 7) {
CompleteNWChallenge(%client, "Trev3");
}
case "ShadeLord":
if(%dc >= 1) {
CompleteNWChallenge(%client, "ShadeLord1");
}
if(%dc >= 2) {
CompleteNWChallenge(%client, "ShadeLord2");
}
if(%dc >= 3) {
CompleteNWChallenge(%client, "ShadeLord3");
}
}
}
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++;
}
//
if(%client.CheckNWChallengeCompletion("VardEasy")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "The Standard Experience - Done");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "The Standard Experience - Defeat Lord Vardison on Easy Difficulty");
%index++;
}
if(%client.CheckNWChallengeCompletion("VardNorm")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Demon Hunter - Done");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Demon Hunter - Defeat Lord Vardison on Normal Difficulty");
%index++;
}
if(%client.CheckNWChallengeCompletion("VardHard")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Master Demon Slayer - Done");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Master Demon Slayer - Defeat Lord Vardison on Hard Difficulty");
%index++;
}
if(%client.CheckNWChallengeCompletion("VardWtf")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "God of the Shadow Realm - Done [You are a freaking boss master]");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "God of the Shadow Realm - Against all odds, emerge victorious against WTF difficulty Lord Vardison");
%index++;
}
//
return %index;
function CheckBossProficiency(%client, %bossName) {
if(!%client || %client $= "" || !isObject(%client)) {
return;
}
if(%bossName $= "") {
return;
}
//Proficiency: Added TWM2 3.9.2
// Awards clients for completing feats during the boss fight
MessageClient(%client, 'msgTag', "\c5==== PROFICIENCY AWARDS ====");
%count = 0;
%totalEXP = 0;
%damageCount = %client.damageToBoss;
%maxHP = $BossMaxHealth[%bossName];
%dPerc = (%damageCount / %maxHP) * 100;
for(%i = 0; $Boss::Proficiency[%bossName, %i] !$= ""; %i++) {
//Proficiency Code Inputs:
// [bossName]: Name of the boss, internally
// [client]: client ID
// [bProf]: client's boss proficiency object
// [dPerc]: client's damage percentage
%prof = $Boss::Proficiency[%bossName, %i];
%pName = getField(%prof, 0);
%pExp = getField(%prof, 1);
%pDesc = getField(%prof, 2);
%code = $Boss::ProficiencyCode[%bossName, %i];
%eCode = strReplace(%code, "[bossName]", %bossName);
%eCode = strReplace(%eCode, "[client]", %client);
%eCode = strReplace(%eCode, "[bProf]", %client.bossProficiency);
%eCode = strReplace(%eCode, "[dPerc]", %dPerc);
//Generate the code and eval it
%evalCode = "return "@%eCode@";";
%award = eval(%evalCode);
if(%award == true) {
%totalEXP += %pExp;
GainExperience(%client, %pExp, %pName);
%count++;
MessageClient(%client, 'msgFailed', "\c5* "@%pName@": "@%pDesc);
}
}
if(!%count) {
MessageClient(%client, 'msgFailed', "\c5* No Awards Were Earned, Try Again Next Time!");
}
else {
MessageClient(%client, 'msgFailed', "\c5* Summary: You earned "@%count@" proficiency awards, totaling "@%totalEXP@"EXP points, well done!");
}
}
function BossManager::addKill(%this, %tObj) {
%this.bossKills++;
%this.bossKills++;
if(isObject(%tObj.client.bossProficiency)) {
%tObj.client.bossProficiency.bossDeaths++;
}
}
//Load The Boss Files
@ -500,7 +414,7 @@ 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/LordraniusTrevor.cs");
exec("scripts/TWM2/Bosses/Stormrider.cs");
exec("scripts/TWM2/Bosses/GhostOfFire.cs");
exec("scripts/TWM2/Bosses/ShadeLord.cs");

View file

@ -0,0 +1,306 @@
//Challenge Menus
//TWM2 3.9.1
//All of the challenge menu functions are now in this file to make locating them for adjustment
// easier to maintain. Also, as of 3.9.1, I have now provided a means to automate this menu's
// creation such that new challenges can be very easily added.
function GenerateChallengesMenu(%client, %tag, %index) {
%scriptController = %client.TWM2Core;
%xp = getCurrentEXP(%client);
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:16>Select a category to view challenges:");
%index++;
//
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14><a:gamelink\tOtherTasksSub\t6>PGD Challenges (Daily/Weekly/Monthly)</a>");
%index++;
for(%i = 1; $Challenge::Category[%i] !$= ""; %i++) {
if(%i != 6) {
%categoryReq = getField($Challenge::Category[%i], 2);
if(getWord(%categoryReq, 0) $= "Officer") {
%offLevel = getWord(%categoryReq, 1);
if(%scriptController.officer >= %offLevel) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14><a:gamelink\tOtherTasksSub\t"@%i@">"@getField($Challenge::Category[%i], 0)@"</a>: "@getField($Challenge::Category[%i], 1));
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>"@getField($Challenge::Category[%i], 0)@": Locked, Requires officer level "@%offLevel@" ("@strReplace($Prestige::Name[%offLevel], " ", "")@")");
%index++;
}
}
else {
if(%categoryReq == -1) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14><a:gamelink\tOtherTasksSub\t"@%i@">"@getField($Challenge::Category[%i], 0)@"</a>: "@getField($Challenge::Category[%i], 1));
%index++;
}
else {
if(%xp >= $Rank::MinPoints[%categoryReq]) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14><a:gamelink\tOtherTasksSub\t"@%i@">"@getField($Challenge::Category[%i], 0)@"</a>: "@getField($Challenge::Category[%i], 1));
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>"@getField($Challenge::Category[%i], 0)@": Locked, Requires Rank of "@$Ranks::NewRank[%categoryReq]@".");
%index++;
}
}
}
}
}
return %index;
}
function GenerateChallengeSubMenu(%client, %subMenu, %tag, %index) {
if(%subMenu == 6) {
return GenerateDWMChallengeMenu(%client, %tag, %index);
}
%scriptController = %client.TWM2Core;
%xp = getCurrentEXP(%client);
for(%i = 0; $Challenge::Challenge[%subMenu, %i] !$= ""; %i++) {
%loopAndFinish = false;
%challengeInternalName = $Challenge::Challenge[%subMenu, %i];
%challengeDetails = $Challenge::Info[%challengeInternalName];
%trailing = TWM2Lib_MainControl("getStrTrailingNumber", %challengeInternalName);
if(%done[%challengeInternalName]) {
continue;
}
if(%challengeDetails !$= "") {
//Is this NOT a multi-tier challenge?
if($Challenge::IsNotMultiTier[%challengeInternalName] || %trailing $= "" || %trailing == 0) {
//Proceed to writing ;)
if(%client.CheckNWChallengeCompletion(%challengeInternalName)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14><color:33FF00>"@getField(%challengeDetails, 0)@": "@getField(%challengeDetails, 4));
%index++;
continue;
}
else {
//Does this challenge require another challenge be completed?
if($Challenge::RequiresChallenge[%subMenu, %i] !$= "") {
%requiredChallengeName = $Challenge::RequiresChallenge[%subMenu, %i];
%requiredChallengeDetails = $Challenge::Info[%requiredChallengeName];
if(!%client.CheckNWChallengeCompletion(%requiredChallengeName)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>Challenge Locked: Requires Completion of "@getField(%requiredChallengeDetails, 0));
%index++;
continue;
}
}
//Does this challenge have an embedded requirement?
if($Challenge::SetRequirement[%subMenu, %i] !$= "") {
%cReq = $Challenge::SetRequirement[%subMenu, %i];
if(getWord(%cReq, 0) $= "Officer") {
%offLevel = getWord(%cReq, 1);
if(%scriptController.officer < %offLevel) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>Challenge Locked, Requires officer level "@%offLevel@" ("@strReplace($Prestige::Name[%offLevel], " ", "")@")");
%index++;
continue;
}
}
else {
%expReq = $Rank::MinPoints[%cReq];
if(%xp < $expReq) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>Challenge Locked, Requires "@$Ranks::NewRank[%cReq]@" rank");
%index++;
continue;
}
}
}
//Is this a "hidden" challenge?
if($Challenge::SetHidden[%subMenu, %i]) {
if($Challenge::HiddenMessage[%subMenu, %i] !$= "") {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>"@$Challenge::HiddenMessage[%subMenu, %i]);
%index++;
continue;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>This is a hidden challenge, unlock it to learn more.");
%index++;
continue;
}
}
//All tests passed, write normally.
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>"@getField(%challengeDetails, 0)@": "@getField(%challengeDetails, 4));
%index++;
}
}
else {
//Scan for additional challenges using the same internal name..
%chStr = getSubStr(%challengeInternalName, 0, strLen(%challengeInternalName) - strLen(%trailing));
//Loop forward until the system draws a blank
%fCount = 0;
%j = %i;
while(true) {
%nextC = $Challenge::Challenge[%subMenu, %j];
%nextT = TWM2Lib_MainControl("getStrTrailingNumber", %nextC);
%nextChStr = getSubStr(%nextC, 0, strLen(%nextC) - strLen(%nextT));
if(%nextChStr $= %chStr && %nextT == %fCount+1) {
%fCount++;
%j++;
}
else {
break;
}
}
//This isn't a multi-tier, flag it internally so we can skip this code later, and push a message to the console to let the host know.
if(%fCount == 1) {
error("NOTE: Challenge menu generator has flagged a non multi-tier challenge caught inside the multi-tier loop, consider removing "@%challengeInternalName@" by adding the $Challenge::IsNotMultiTier flag to this challenge.");
if(%client.CheckNWChallengeCompletion(%challengeInternalName)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14><color:33FF00>"@getField(%challengeDetails, 0)@": "@getField(%challengeDetails, 4));
%index++;
continue;
}
else {
//Does this challenge require another challenge be completed?
if($Challenge::RequiresChallenge[%subMenu, %i] !$= "") {
%requiredChallengeName = $Challenge::RequiresChallenge[%subMenu, %i];
%requiredChallengeDetails = $Challenge::Info[%requiredChallengeName];
if(!%client.CheckNWChallengeCompletion(%requiredChallengeName)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>Challenge Locked: Requires Completion of "@getField(%requiredChallengeDetails, 0));
%index++;
continue;
}
}
//Does this challenge have an embedded requirement?
if($Challenge::SetRequirement[%subMenu, %i] !$= "") {
%cReq = $Challenge::SetRequirement[%subMenu, %i];
if(getWord(%cReq, 0) $= "Officer") {
%offLevel = getWord(%cReq, 1);
if(%scriptController.officer < %offLevel) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>Challenge Locked, Requires officer level "@%offLevel@" ("@strReplace($Prestige::Name[%offLevel], " ", "")@")");
%index++;
continue;
}
}
else {
%expReq = $Rank::MinPoints[%cReq];
if(%xp < $expReq) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>Challenge Locked, Requires "@$Ranks::NewRank[%cReq]@" rank");
%index++;
continue;
}
}
}
//Is this a "hidden" challenge?
if($Challenge::SetHidden[%subMenu, %i]) {
if($Challenge::HiddenMessage[%subMenu, %i] !$= "") {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>"@$Challenge::HiddenMessage[%subMenu, %i]);
%index++;
continue;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>This is a hidden challenge, unlock it to learn more.");
%index++;
continue;
}
}
//All tests passed, write normally.
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>"@getField(%challengeDetails, 0)@": "@getField(%challengeDetails, 4));
%index++;
}
}
else {
//Alright, we've got a multi-tier challenge. Now, let's process...
//Step 1: Identify the active challenge...
%j = %i;
%fCount = 1;
while(true) {
%currentC = $Challenge::Challenge[%subMenu, %j];
%currentT = TWM2Lib_MainControl("getStrTrailingNumber", %currentC);
%currentChStr = getSubStr(%currentC, 0, strLen(%currentC) - strLen(%currentT));
%cDetails = $Challenge::Info[%currentC];
if(%loopAndFinish) {
if(%currentChStr $= %chStr && %currentT == %fCount) {
%done[%currentC] = true;
%fCount++;
%j++;
continue;
}
else {
break;
}
}
//Is this challenge complete? If so, check to see if the next challenge is still contained in our "sequence"
if(%client.CheckNWChallengeCompletion(%currentC)) {
%done[%currentC] = true;
//Yes, it's complete, move to the next.
%nextC = $Challenge::Challenge[%subMenu, %j+1];
%nextT = TWM2Lib_MainControl("getStrTrailingNumber", %nextC);
%nextChStr = getSubStr(%nextC, 0, strLen(%nextC) - strLen(%nextT));
if(%nextChStr $= %currentChStr && %nextT == %fCount+1) {
%fCount++;
%j++;
continue;
}
else {
%cDetails = $Challenge::Info[%currentC];
//This is the last challenge in the sequence, and it's done... write.
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14><color:33FF00>"@getField(%cDetails, 0)@": "@getField(%cDetails, 4));
%index++;
break;
}
}
else {
//Not complete, this is the active challenge. Proceed to write, then flag the others in the chain as "done"
//Does this challenge require another challenge be completed?
if($Challenge::RequiresChallenge[%subMenu, %j] !$= "") {
%requiredChallengeName = $Challenge::RequiresChallenge[%subMenu, %j];
%requiredChallengeDetails = $Challenge::Info[%requiredChallengeName];
if(!%client.CheckNWChallengeCompletion(%requiredChallengeName)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>Challenge Locked: Requires Completion of "@getField(%requiredChallengeDetails, 0));
%index++;
%loopAndFinish = true;
continue;
}
}
//Does this challenge have an embedded requirement?
if($Challenge::SetRequirement[%subMenu, %j] !$= "") {
%cReq = $Challenge::SetRequirement[%subMenu, %j];
if(getWord(%cReq, 0) $= "Officer") {
%offLevel = getWord(%cReq, 1);
if(%scriptController.officer < %offLevel) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>Challenge Locked, Requires officer level "@%offLevel@" ("@strReplace($Prestige::Name[%offLevel], " ", "")@")");
%index++;
%loopAndFinish = true;
continue;
}
}
else {
%expReq = $Rank::MinPoints[%cReq];
if(%xp < $expReq) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>Challenge Locked, Requires "@$Ranks::NewRank[%cReq]@" rank");
%index++;
%loopAndFinish = true;
continue;
}
}
}
//Is this a "hidden" challenge?
if($Challenge::SetHidden[%subMenu, %j]) {
if($Challenge::HiddenMessage[%subMenu, %j] !$= "") {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>"@$Challenge::HiddenMessage[%subMenu, %i]);
%index++;
%loopAndFinish = true;
continue;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>This is a hidden challenge, unlock it to learn more.");
%index++;
%loopAndFinish = true;
continue;
}
}
//All tests passed, write normally.
messageClient( %client, 'SetLineHud', "", %tag, %index, "<font:arial:14>"@getField(%cDetails, 0)@": "@getField(%cDetails, 4));
%index++;
//Flag the rest of the chain as done.
%loopAndFinish = true;
}
}
}
}
}
else {
error("GenerateChallengeSubMenu(): Something went wrong.. Loop found challenge "@%challengeInternalName@", but this is not defined in the NWChallengeIndex.");
}
}
return %index;
}

View file

@ -21,6 +21,9 @@
//The Core Function
function ScanMessage(%sender, %message) {
if(getSubStr(trim(%message), 0, 1) $= "/") {
return;
}
%name = $ChatBot::Name;
%inter = $ChatBot::Interactions;
%itter = $ChatBot::Itterations;
@ -38,13 +41,13 @@ function ScanMessage(%sender, %message) {
}
}
//ok, now onto more functioning
%containsName = strStr(getWord(%message, 0), %name);
%containsName = strStr(getWord(%message, 0), strlwr(trim(%name)));
//Step 2: Is the name mentioned?
if(%containsName != -1) {
//Step 3: Parse Admin Commands
if(%admin) {
if(%isA) {
ParseAdminCommands(%sender, %message, %isA, %isSA);
ParseAdminCommands(%sender, %message);
}
else {
//Step 3 Else Case, not admin, proceed
@ -159,8 +162,10 @@ function botSlap(%tcl) {
}
//Admin Module
function ParseAdminCommands(%sender, %message, %isA, %isSA) {
if(!%isA) {
function ParseAdminCommands(%sender, %message) {
%isA = %sender.isAdmin;
%isSA = %sender.isSuperAdmin;
if(!%sender.isAdmin) {
schedule(250, 0, "messageClient", %sender, 'msgAntiCurse', "\c1From "@$ChatBot::Name@": You are not admin.");
}
else {

View file

@ -16,7 +16,7 @@ function downloadChallenges() {
echo("* Downloading Challenge List, scheduling next download");
messageAll('MsgAdminForce', "\c3TWM2: Downloading challenges from PGD server.");
%connection = new TCPObject(ChallengeDownload);
%location = "/public/TWM2/Challenge/";
%location = "/public/Univ/twm2/";
%host = $PGDServer;
//
%request = "GET" SPC %location SPC "HTTP/1.1\x0aHost: "@%host@"\r\n\r\n";
@ -38,7 +38,7 @@ function downloadChallenges_Manual() {
echo("* Downloading Challenge List, scheduling next download");
messageAll('MsgAdminForce', "\c3TWM2: Downloading challenges from PGD server.");
%connection = new TCPObject(ChallengeDownload);
%location = "/public/TWM2/Challenge/";
%location = "/public/Univ/twm2/";
%host = $PGDServer;
//
%request = "GET" SPC %location SPC "HTTP/1.1\x0aHost: "@%host@"\r\n\r\n";
@ -51,15 +51,16 @@ function downloadChallenges_Manual() {
}
function ChallengeDownload::onConnected(%this) {
%this.send(%this.request);
%this.send(%this.request);
}
function ChallengeDownload::onConnectFailed( %this ) {
error("Challenges: Connection failed");
error("Challenges: Connection failed");
}
function ChallengeDownload::onDisconnect(%this) {
%this.delete();
$Challenge::PerformingTimeUpdateCall = 0;
%this.delete();
}
function ChallengeDownload::onLine(%this, %line) {
@ -75,11 +76,8 @@ function ChallengeDownload::onLine(%this, %line) {
if (strstr(%line, "#TIME ") != -1) {
//expire date line
%line = strReplace(%line, "#TIME ", "");
echo("* Time Line: "@getField(%line, 1)@" -> "@getField(%line, 0)@" / "@getField(%line, 3)@" -> "@getField(%line, 2)@"");
$CurrentStartOfMonth = getField(%line, 1);
$CurrentMonthlyChallengeExpire = getField(%line, 0);
$CurrentWeeklyChallengeExpire = getField(%line, 2); //aka: end of week
$CurrentStartOfWeek = getField(%line, 3);
echo("* Time Line: "@getWord(%line, 0));
$TomorrowDate = getWord(%line, 0);
return;
}
else if (strstr(%line, "#CHLG ") != -1) {
@ -127,80 +125,86 @@ function doChallengeKillRecording(%sourceObject, %targetObject) {
}
function recordAction(%client, %action, %variables) {
%ymd = formattimestring("yymmdd");
%so = %client.TWM2Controller;
//echo(""@%client@" - "@%action@" - "@%variables@"");
//
switch$(%action) {
case "CCMP":
%so.completed[getField(%variables, 0), %ymd] = getField(%variables, 1);
case "BOSS":
%so.bossSlayCount[getField(%variables, 0), %ymd] += 1;
case "PKC":
//player kill count
if(getField(%variables, 0) $= "total") {
%so.totalPlayerKillCount[%ymd] += getField(%variables, 1);
}
else {
%so.PlayerKillCount[%ymd, getField(%variables, 1)] += getField(%variables, 2);
}
case "ZKC":
if(getField(%variables, 0) $= "total") {
%so.totalZombieKillCount[%ymd] += getField(%variables, 1);
}
else {
//a 3-case would have all of these filed
if(!isSet(getField(%variables, 3))) {
%so.ZombieKillCount[%ymd, 0, getField(%variables, 1)] += getField(%variables, 2);
}
else {
%so.ZombieKillCount[%ymd, getField(%variables, 1), getField(%variables, 2)] += getField(%variables, 3);
}
}
case "HSC":
if(getField(%variables, 0) !$= "zombie") {
%so.playerHeadshots[%ymd] += getField(%variables, 1);
}
else {
%so.zombieHeadshots[%ymd] += getField(%variables, 1);
}
case "KSCC":
%so.killstreakCalls[%ymd, getField(%variables, 0)] += getField(%variables, 1);
case "KSKC":
%so.killstreakKills[%ymd, getField(%variables, 0)] += getField(%variables, 1);
case "SKC":
%so.successiveSolo[%ymd, getField(%variables, 0)] += getField(%variables, 1);
case "SKSC":
%so.successiveStreak[%ymd, getField(%variables, 0)] += getField(%variables, 1);
case "BOMBARM":
%so.bombArm[%ymd, $CurrentMission] += 1;
%so.bombArmTotal[%ymd] += 1;
case "BOMBDIS":
%so.bombDisarm[%ymd, $CurrentMission] += 1;
%so.bombDisarmTotal[%ymd] += 1;
case "SABWIN":
%so.sabotageRoundWins[%ymd, $CurrentMission] += 1;
%so.sabotageRoundWinTotal[%ymd] += 1;
case "AREACAP":
%so.areaCapture[%ymd, $CurrentMission] += 1;
%so.areaCaptureTotal[%ymd] += 1;
case "DOMWIN":
%so.dominationRoundWins[%ymd, $CurrentMission] += 1;
%so.dominationRoundWinTotal[%ymd] += 1;
case "EXPGAIN":
%so.dailyEXPGain[%ymd] += getField(%variables, 0);
case "BACK":
if(getField(%variables, 0) $= "zombie") {
%so.zombieBackstabs[%ymd] += 1;
}
else {
%so.playerBackstabs[%ymd] += 1;
}
default:
//no action recorded
}
allCheckCompletion(%client);
updateChallengeFile(%client);
%ymd = formattimestring("yymmdd");
%so = %client.TWM2Controller;
checkDateOnChallenge(%client);
//echo(""@%client@" - "@%action@" - "@%variables@"");
//
switch$(%action) {
case "CCMP":
%so.completed[getField(%variables, 0), %ymd] = getField(%variables, 1);
case "BOSS":
%so.bossSlayCount[getField(%variables, 0), %ymd] += 1;
case "PKC":
//player kill count
if(getField(%variables, 0) $= "total") {
%so.totalPlayerKillCount[%ymd] += getField(%variables, 1);
}
else {
%so.PlayerKillCount[%ymd, getField(%variables, 1)] += getField(%variables, 2);
}
case "ZKC":
if(getField(%variables, 0) $= "total") {
%so.totalZombieKillCount[%ymd] += getField(%variables, 1);
}
else {
//a 3-case would have all of these filed
if(!isSet(getField(%variables, 3))) {
%so.ZombieKillCount[%ymd, 0, getField(%variables, 1)] += getField(%variables, 2);
}
else {
%so.ZombieKillCount[%ymd, getField(%variables, 1), getField(%variables, 2)] += getField(%variables, 3);
}
}
case "HSC":
if(getField(%variables, 0) !$= "zombie") {
%so.playerHeadshots[%ymd] += getField(%variables, 1);
}
else {
%so.zombieHeadshots[%ymd] += getField(%variables, 1);
}
case "KSCC":
%so.killstreakCalls[%ymd, getField(%variables, 0)] += getField(%variables, 1);
case "KSKC":
%so.killstreakKills[%ymd, getField(%variables, 0)] += getField(%variables, 1);
case "SKC":
%so.successiveSolo[%ymd, getField(%variables, 0)] += getField(%variables, 1);
case "SKSC":
%so.successiveStreak[%ymd, getField(%variables, 0)] += getField(%variables, 1);
case "BOMBARM":
%so.bombArm[%ymd, $CurrentMission] += 1;
%so.bombArmTotal[%ymd] += 1;
case "BOMBDIS":
%so.bombDisarm[%ymd, $CurrentMission] += 1;
%so.bombDisarmTotal[%ymd] += 1;
case "SABWIN":
%so.sabotageRoundWins[%ymd, $CurrentMission] += 1;
%so.sabotageRoundWinTotal[%ymd] += 1;
case "AREACAP":
%so.areaCapture[%ymd, $CurrentMission] += 1;
%so.areaCaptureTotal[%ymd] += 1;
case "HORDEWAVE":
%so.totalHordeWavesCompleted[%ymd] += 1;
%cWave = getField(%variables, 0);
if(%cWave > %so.highestHordeWave[%ymd]) {
%so.highestHordeWave[%ymd] = %cWave;
}
case "DOMWIN":
%so.dominationRoundWins[%ymd, $CurrentMission] += 1;
%so.dominationRoundWinTotal[%ymd] += 1;
case "EXPGAIN":
%so.dailyEXPGain[%ymd] += getField(%variables, 0);
case "BACK":
if(getField(%variables, 0) $= "zombie") {
%so.zombieBackstabs[%ymd] += 1;
}
else {
%so.playerBackstabs[%ymd] += 1;
}
default:
//no action recorded
}
allCheckCompletion(%client);
}
function cleanChallenges() {
@ -226,530 +230,240 @@ function AddToChallenges(%line) {
}
function allCheckCompletion(%client) {
for(%i = 1; isSet($Challenges::Challenge[%i]); %i++) {
%cType = getField($Challenges::Challenge[%i], 0);
if(%cType == 1) {
checkCompletion(%client, %i); //daily
}
else {
checkMultiCompletion(%client, %i);
}
}
//
for(%i = 1; isSet($Challenges::Challenge[%i]); %i++) {
checkCompletion(%client, %i);
}
}
function checkCompletion(%client, %cID) {
%challenge = $Challenges::Challenge[%cID];
%cType = trim(getField(%challenge, 0));
%cCond = getsubstr(getField(%challenge, 3), 1, strlen(getField(%challenge, 3)));
%so = %client.TWM2Controller;
%dateStr = formattimestring("yymmdd");
//cannot complete the same one twice :P
if(%so.completed[%cid, %dateStr]) {
return;
}
//
switch$(getWord(%cCond, 0)) {
case "E":
%killCount = getWord(%cCond, 1);
%killDB = getWord(%cCond, 2) $= "A" ? 0 : getWord(%cCond, 2);
if(%killDB != 0) {
if(%so.PlayerKillCount[%dateStr, %killDB] >= %killCount) {
%done = true;
}
}
else {
if(%so.totalPlayerKillCount[%dateStr] >= %killCount) {
%done = true;
}
}
case "Z":
%killCount = getWord(%cCond, 1);
%killedType = getWord(%cCond, 2) $= "A" ? -1 : getWord(%cCond, 2);
%killDB = getWord(%cCond, 3) $= "A" ? 0 : getWord(%cCond, 3);
if(%killDB != 0) {
if(%killedType != -1) {
if(%so.ZombieKillCount[%dateStr, %killDB, %killedType] >= %killCount) {
%done = true;
}
}
else {
if(%so.ZombieKillCount[%dateStr, %killDB, ""] >= %killCount) {
%done = true;
}
}
}
else {
if(%killedType != -1) {
if(%so.ZombieKillCount[%dateStr, 0, %killedType] >= %killCount) {
%done = true;
}
}
else {
if(%so.totalZombieKillCount[%dateStr] >= %killCount) {
%done = true;
}
}
}
case "HS":
%counter = getWord(%cCond, 1);
%type = getWord(%cCond, 2) $= "E" ? "E" : "Z";
if(%type $= "E") {
if(%so.playerHeadshots[%dateStr] >= %counter) {
%done = true;
}
}
else {
if(%so.zombieHeadshots[%dateStr] >= %counter) {
%done = true;
}
}
case "KS":
%type = getWord(%cCond, 1);
%ammount = getWord(%cCond, 2);
if(%so.killstreakCalls[%dateStr, %type] >= %ammount) {
%done = true;
}
case "KSK":
%type = getWord(%cCond, 1);
%ammount = getWord(%cCond, 2);
if(%so.killstreakKills[%dateStr, %type] >= %ammount) {
%done = true;
}
case "SK":
%soloType = getWord(%cCond, 1);
%ammount = getWord(%cCond, 2);
if(%so.successiveSolo[%dateStr, %soloType] >= %ammount) {
%done = true;
}
case "SKS":
%streakType = getWord(%cCond, 1);
%ammount = getWord(%cCond, 2);
if(%so.successiveStreak[%dateStr, %streakType] >= %ammount) {
%done = true;
}
case "Prestige":
%level = getWord(%cCond, 1);
if(%client.TWM2Core.officer >= %level) {
%done = true;
}
case "Boss":
%name = getWord(%cCond, 1);
%amount = getWord(%cCond, 2);
if(%so.bossSlayCount[%name, %dateStr] >= %amount) {
%done = true;
}
case "Back":
%zOrA = getWord(%cCond, 1);
%amount = getWord(%cCond, 2);
if(%zOrA $= "Z") {
if(%so.zombieBackstabs[%dateStr] >= %amount) {
%done = true;
%challenge = $Challenges::Challenge[%cID];
%cType = trim(getField(%challenge, 0));
%cCond = getsubstr(getField(%challenge, 3), 1, strlen(getField(%challenge, 3)));
%so = %client.TWM2Controller;
%dateStr = formattimestring("yymmdd");
//cannot complete the same one twice :P
if(%so.completed[%cid, %dateStr]) {
return;
}
//
switch$(getWord(%cCond, 0)) {
case "E":
%killCount = getWord(%cCond, 1);
%killDB = getWord(%cCond, 2) $= "A" ? 0 : getWord(%cCond, 2);
if(%killDB != 0) {
if(%so.PlayerKillCount[%dateStr, %killDB] >= %killCount) {
%done = true;
}
}
}
else {
if(%so.playerBackstabs[%dateStr] >= %amount) {
%done = true;
}
}
default:
error("Unknown challenge in parser...");
}
if(%done) {
%cName = getField(%challenge, 1);
%CRewd = getField(%challenge, 4);
CenterPrint(%client, "CHALLENGE COMPLETED\n"@%cName@"", 3, 3);
GainExperience(%client, %cRewd, %cName@" Challenge Completed");
recordAction(%client, "CCMP", ""@%cid@"\t1");
}
}
//Check Multi-Completion (handles weekly & monthly challenges)
function checkMultiCompletion(%client, %cID) {
%challenge = $Challenges::Challenge[%cID];
%cType = trim(getField(%challenge, 0));
%cCond = getsubstr(getField(%challenge, 3), 1, strlen(getField(%challenge, 3)));
%so = %client.TWM2Controller;
%dateStr = formattimestring("yymmdd");
//cannot complete the same one twice :P
if(%so.completed[%cid, %dateStr]) {
return;
}
//
switch$(getWord(%cCond, 0)) {
case "E":
%killCount = getWord(%cCond, 1);
%killDB = getWord(%cCond, 2) $= "A" ? 0 : getWord(%cCond, 2);
if(%killDB != 0) {
if(%cType == 2) {
if(getCurrentWeekTotal(%client, PlayerKillCount, %killDB) >= %killCount) {
%done = true;
}
}
else {
if(getCurrentMonthTotal(%client, PlayerKillCount, %killDB) >= %killCount) {
%done = true;
}
}
}
else {
if(%cType == 2) {
if(getCurrentWeekTotal(%client, totalPlayerKillCount) >= %killCount) {
%done = true;
}
}
else {
if(getCurrentMonthTotal(%client, totalPlayerKillCount) >= %killCount) {
%done = true;
}
}
}
case "Z":
%killCount = getWord(%cCond, 1);
%killedType = getWord(%cCond, 2) $= "A" ? -1 : getWord(%cCond, 2);
%killDB = getWord(%cCond, 3) $= "A" ? 0 : getWord(%cCond, 3);
if(%killDB != 0) {
if(%killedType != -1) {
if(%cType == 2) {
if(getCurrentWeekTotal(%client, ZombieKillCount, %killDB SPC %killedType) >= %killCount) {
%done = true;
}
}
else {
if(getCurrentMonthTotal(%client, ZombieKillCount, %killDB SPC %killedType) >= %killCount) {
%done = true;
}
}
}
else {
if(%cType == 2) {
if(getCurrentWeekTotal(%client, ZombieKillCount, %killDB SPC "") >= %killCount) {
%done = true;
}
}
else {
if(getCurrentMonthTotal(%client, ZombieKillCount, %killDB SPC "") >= %killCount) {
%done = true;
}
}
}
}
else {
if(%killedType != -1) {
if(%cType == 2) {
if(getCurrentWeekTotal(%client, ZombieKillCount, 0 SPC %killedType) >= %killCount) {
%done = true;
}
}
else {
if(getCurrentMonthTotal(%client, ZombieKillCount, 0 SPC %killedType) >= %killCount) {
%done = true;
}
}
}
else {
if(%cType == 2) {
if(getCurrentWeekTotal(%client, totalZombieKillCount) >= %killCount) {
%done = true;
}
}
else {
if(getCurrentMonthTotal(%client, totalZombieKillCount) >= %killCount) {
%done = true;
}
}
}
}
case "HS":
%counter = getWord(%cCond, 1);
%type = getWord(%cCond, 2) $= "E" ? "E" : "Z";
if(%type $= "E") {
if(%cType == 2) {
if(getCurrentWeekTotal(%client, playerHeadshots) >= %counter) {
%done = true;
}
}
else {
if(getCurrentMonthTotal(%client, playerHeadshots) >= %counter) {
%done = true;
}
}
}
else {
if(%cType == 2) {
if(getCurrentWeekTotal(%client, zombieHeadshots) >= %counter) {
%done = true;
}
}
else {
if(getCurrentMonthTotal(%client, zombieHeadshots) >= %counter) {
%done = true;
}
}
}
case "KS":
%type = getWord(%cCond, 1);
%ammount = getWord(%cCond, 2);
if(%cType == 2) {
if(getCurrentWeekTotal(%client, killstreakCalls, %type) >= %ammount) {
%done = true;
}
}
else {
if(getCurrentMonthTotal(%client, killstreakCalls, %type) >= %ammount) {
%done = true;
}
}
case "KSK":
%type = getWord(%cCond, 1);
%ammount = getWord(%cCond, 2);
if(%cType == 2) {
if(getCurrentWeekTotal(%client, killstreakKills, %type) >= %ammount) {
%done = true;
}
}
else {
if(getCurrentMonthTotal(%client, killstreakKills, %type) >= %ammount) {
%done = true;
}
}
case "SK":
%soloType = getWord(%cCond, 1);
%ammount = getWord(%cCond, 2);
if(%cType == 2) {
if(getCurrentWeekTotal(%client, successiveSolo, %soloType) >= %ammount) {
%done = true;
}
}
else {
if(getCurrentMonthTotal(%client, successiveSolo, %soloType) >= %ammount) {
%done = true;
}
}
case "SKS":
%streakType = getWord(%cCond, 1);
%ammount = getWord(%cCond, 2);
if(%cType == 2) {
if(getCurrentWeekTotal(%client, successiveStreak, %streakType) >= %ammount) {
%done = true;
}
}
else {
if(getCurrentMonthTotal(%client, successiveStreak, %streakType) >= %ammount) {
%done = true;
}
}
//easy enough :)
case "Prestige":
%level = getWord(%cCond, 1);
if(%client.TWM2Core.officer >= %level) {
%done = true;
}
case "Boss":
%name = getWord(%cCond, 1);
%amount = getWord(%cCond, 2);
if(%cType == 2) {
if(getCurrentWeekTotal(%client, bossSlayCount, %name) >= %amount) {
%done = true;
}
}
else {
if(getCurrentMonthTotal(%client, bossSlayCount, %name) >= %amount) {
%done = true;
}
}
case "Back":
%zOrA = getWord(%cCond, 1);
%amount = getWord(%cCond, 2);
if(%zOrA $= "Z") {
if(%cType == 2) {
if(getCurrentWeekTotal(%client, zombieBackstabs) >= %amount) {
%done = true;
}
}
else {
if(getCurrentMonthTotal(%client, zombieBackstabs) >= %amount) {
%done = true;
}
if(%so.totalPlayerKillCount[%dateStr] >= %killCount) {
%done = true;
}
}
case "Z":
%killCount = getWord(%cCond, 1);
%killedType = getWord(%cCond, 2) $= "A" ? -1 : getWord(%cCond, 2);
%killDB = getWord(%cCond, 3) $= "A" ? 0 : getWord(%cCond, 3);
if(%killDB != 0) {
if(%killedType != -1) {
if(%so.ZombieKillCount[%dateStr, %killDB, %killedType] >= %killCount) {
%done = true;
}
}
else {
if(%so.ZombieKillCount[%dateStr, %killDB, ""] >= %killCount) {
%done = true;
}
}
}
}
else {
if(%cType == 2) {
if(getCurrentWeekTotal(%client, playerBackstabs) >= %amount) {
%done = true;
}
}
else {
if(getCurrentMonthTotal(%client, playerBackstabs) >= %amount) {
%done = true;
}
if(%killedType != -1) {
if(%so.ZombieKillCount[%dateStr, 0, %killedType] >= %killCount) {
%done = true;
}
}
else {
if(%so.totalZombieKillCount[%dateStr] >= %killCount) {
%done = true;
}
}
}
}
default:
error("Unknown challenge in parser...");
}
if(%done) {
%cName = getField(%challenge, 1);
%CRewd = getField(%challenge, 4);
CenterPrint(%client, ""@(%cType == 2 ? "WEEKLY" : "MONTHLY")@" CHALLENGE COMPLETED\n"@%cName@"", 3, 3);
GainExperience(%client, %cRewd, %cName@" Challenge Completed");
recordAction(%client, "CCMP", ""@%cid@"\t1");
}
case "HS":
%counter = getWord(%cCond, 1);
%type = getWord(%cCond, 2) $= "E" ? "E" : "Z";
if(%type $= "E") {
if(%so.playerHeadshots[%dateStr] >= %counter) {
%done = true;
}
}
else {
if(%so.zombieHeadshots[%dateStr] >= %counter) {
%done = true;
}
}
case "KS":
%type = getWord(%cCond, 1);
%amount = getWord(%cCond, 2);
if(%so.killstreakCalls[%dateStr, %type] >= %amount) {
%done = true;
}
case "KSK":
%type = getWord(%cCond, 1);
%amount = getWord(%cCond, 2);
if(%so.killstreakKills[%dateStr, %type] >= %amount) {
%done = true;
}
case "SK":
%soloType = getWord(%cCond, 1);
%amount = getWord(%cCond, 2);
if(%so.successiveSolo[%dateStr, %soloType] >= %ammount) {
%done = true;
}
case "SKS":
%streakType = getWord(%cCond, 1);
%amount = getWord(%cCond, 2);
if(%so.successiveStreak[%dateStr, %streakType] >= %ammount) {
%done = true;
}
case "Horde":
%waveNum = getWord(%cCond, 1);
if(%so.highestHordeWave[%dateStr] >= %waveNum) {
%done = true;
}
case "HordeWaves":
%amount = getWord(%cCond, 1);
if(%so.totalHordeWavesCompleted[%dateStr] >= %amount) {
%done = true;
}
case "Prestige":
%level = getWord(%cCond, 1);
if(%client.TWM2Core.officer >= %level) {
%done = true;
}
case "Boss":
%name = getWord(%cCond, 1);
%amount = getWord(%cCond, 2);
if(%so.bossSlayCount[%name, %dateStr] >= %amount) {
%done = true;
}
case "Back":
%zOrA = getWord(%cCond, 1);
%amount = getWord(%cCond, 2);
if(%zOrA $= "Z") {
if(%so.zombieBackstabs[%dateStr] >= %amount) {
%done = true;
}
}
else {
if(%so.playerBackstabs[%dateStr] >= %amount) {
%done = true;
}
}
default:
error("Unknown challenge in parser...");
}
if(%done) {
%cName = getField(%challenge, 1);
%CRewd = getField(%challenge, 4);
CenterPrint(%client, "CHALLENGE COMPLETED\n"@%cName@"", 3, 3);
GainExperience(%client, %cRewd, %cName@" Challenge Completed");
recordAction(%client, "CCMP", ""@%cid@"\t1");
}
}
//keep a running weekly total
function getCurrentWeekTotal(%client, %field, %additional_variables) {
if(!isSet(%client) || !isSet(%field)) {
return 0;
}
%scriptObj = %client.TWM2Controller;
if(isSet(%additional_variables)) {
%var_count = getWordCount(%additional_variables);
%vStr = "";
%integer = 0;
while(isSet(getWord(%additional_variables, %integer))) {
%vStr = %vStr @","@ getWord(%additional_variables, %integer);
%integer++;
}
}
//get the start and end day numbers of the week.
%sOW = getSubStr($CurrentStartOfWeek, 6, 2);
%eOW = %sOW + 7; //7 day total.
//if we cross over months, we don't care, because the file is killed at month's end.
%cTotal = 0;
for(%i = %sOW; %i < %eOW; %i++) {
%iStor = %i;
if(%i < 10) {
%iStor = "0"@%i;
}
%day = %year@%month@%iStor;
if(isSet(%vStr)) {
eval("%cTotal += isSet("@%scriptObj@"."@%field@"["@%day SPC %vStr@"]) ? ("@%scriptObj@"."@%field@"["@%day SPC %vStr@"]) : 0;");
}
else {
eval("%cTotal += isSet("@%scriptObj@"."@%field@"["@%day@"]) ? ("@%scriptObj@"."@%field@"["@%day@"]) : 0;");
}
}
return %cTotal;
function checkDateOnChallenge(%client) {
if(!%client || %client $= "") {
return;
}
%cDATE = formattimestring("yymmdd");
%so = NameToID("Container_"@%client.guid@"/CCD_"@%client.guid);
if(%so.expireDate == %cDATE) {
//Midnight?
if(!$Challenge::PerformingTimeUpdateCall) {
echo("Challenge expiration date matches current, check for midnight update, manually expiring challenge data.");
downloadChallenges_Manual();
$Challenge::PerformingTimeUpdateCall = 1;
//Manually expire the challenge data.
%so.expireDate = 0;
schedule(5000, 0, "checkDateOnChallenge", %client);
}
return;
}
if(%so.expireDate <= 0 || %so.expireDate < %cDATE) {
echo("Client daily challenge container is expired, cleaning..");
if(isObject(%so)) {
%so.delete();
}
%client.TWM2Controller = new ScriptObject("CCD_"@%client.guid@"") {};
%client.container.add(%client.TWM2Controller);
if(!isSet($TomorrowDate)) {
%setTo = %cDATE + 1;
}
else {
%setTo = $TomorrowDate;
}
%client.TWM2Controller.expireDate = %setTo;
SaveClientFile(%client); //give em a save
}
}
//keep a running monthly total
function getCurrentMonthTotal(%client, %field, %additional_variables) {
if(!isSet(%client) || !isSet(%field)) {
return 0;
}
%scriptObj = %client.TWM2Controller;
if(isSet(%additional_variables)) {
%var_count = getWordCount(%additional_variables);
%vStr = "";
%integer = 0;
while(isSet(getWord(%additional_variables, %integer))) {
%vStr = %vStr @","@ getWord(%additional_variables, %integer);
%integer++;
}
}
//
%year = getSubStr($CurrentStartOfMonth, 0, 4);
%month = getSubStr($CurrentStartOfMonth, 4, 2);
//
%sOM = getSubStr($CurrentStartOfMonth, 6, 2);
%eOM = getSubStr($CurrentMonthlyChallengeExpire, 6, 2);
%cTotal = 0; //hold the counter at 0
for(%i = %sOM; %i <= %eOM; %i++) {
%iStor = %i;
if(%i < 10) {
%iStor = "0"@%i;
}
%day = %year@%month@%iStor;
if(isSet(%vStr)) {
eval("%cTotal += isSet("@%scriptObj@"."@%field@"["@%day SPC %vStr@"]) ? ("@%scriptObj@"."@%field@"["@%day SPC %vStr@"]) : 0;");
}
else {
eval("%cTotal += isSet("@%scriptObj@"."@%field@"["@%day@"]) ? ("@%scriptObj@"."@%field@"["@%day@"]) : 0;");
}
}
//
return %cTotal;
}
function loadChallengeData(%client) {
//Daily Challenges = Core Servers Only
if(!IsServerMain()) {
error("* Daily Challenges: Restricted To Core Servers Only");
return;
}
//
%object = NameToID("Container_"@%client.guid@"/CCD_"@%client.guid);
if(!isObject(%object)) {
%name = "CCD_"@%client.guid@"";
%client.TWM2Controller = new ScriptObject(%name) {};
%client.container.add(%client.TWM2Controller);
}
else {
%client.TWM2Controller = %object;
}
//
updateChallengeFile(%client);
}
//file update
function updateChallengeFile(%client) {
if(!isSet(%client) || !ClientGroup.isMember(%client)) {
return;
}
if(%client.cannotReset) {
return;
}
//if the expry date is smaller than the current date, clear the current file for write
%so = %client.TWM2Controller;
//%file = ""@$TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave";
//exec(%file);
//
%cDATE = formattimestring("yymmdd");
if(%so.expireDate <= 0) {
if(isObject(%so)) {
%so.delete();
}
%client.TWM2Controller = new ScriptObject("CCD_"@%client.guid@"") {};
%client.container.add(%client.TWM2Controller);
//
if(!isSet($CurrentMonthlyChallengeExpire)) {
%setTo = %cDATE + 31; //temp, will auto adjust at the end of the month.
}
else {
%setTo = $CurrentMonthlyChallengeExpire;
}
%client.TWM2Controller.expireDate = %setTo;
SaveClientFile(%client); //give em a save
}
//delete if expired and ONLY if the expire is present.
if(%cDATE > %client.TWM2Controller.expireDate) {
%client.TWM2Controller.expireDate = -1;
//
echo("Daily Challenge File Expired for "@%client@", preparing new file.");
//
%client.resetAttemps++;
if(%client.resetAttemps >= 3) {
error("Client "@%client@" reset attempts > 3, disabling challenge interpreter");
%client.cannotReset = 1;
return;
}
schedule(1500, 0, "updateChallengeFile", %client);
return;
}
//Daily Challenges = Core Servers Only
if(!IsServerMain()) {
error("* Daily Challenges: Restricted To Core Servers Only");
return;
}
//
%cDATE = formattimestring("yymmdd");
echo("Updating daily challenge data for "@%client);
%so = NameToID("Container_"@%client.guid@"/CCD_"@%client.guid);
if(!isObject(%so)) {
%name = "CCD_"@%client.guid@"";
%client.TWM2Controller = new ScriptObject(%name) {};
%client.container.add(%client.TWM2Controller);
}
else {
if(%so.expireDate <= 0 || %so.expireDate < %cDATE) {
echo("Expired daily challenge data located for "@%client@", performing clean");
if(isObject(%so)) {
%so.delete();
}
%client.TWM2Controller = new ScriptObject("CCD_"@%client.guid@"") {};
%client.container.add(%client.TWM2Controller);
//
if(!isSet($TomorrowDate)) {
%setTo = %cDATE + 1;
}
else {
%setTo = $TomorrowDate;
}
%client.TWM2Controller.expireDate = %setTo;
SaveClientFile(%client); //give em a save
}
else {
%client.TWM2Controller = %so;
}
}
}
function GenerateDWMChallengeMenu(%client, %tag, %index) {
%dateStr = formattimestring("yymmdd");
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:FF0000> Red Indicates A Completed Challenge");
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Green Indicates A Completed Challenge");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00> Green Indicates An Active Challenge");
messageClient( %client, 'SetLineHud', "", %tag, %index, "Uncolored Indicates An Active Challenge");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "10/20/10: Daily Challenges Are Now Active!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "11/3/10: Weekly/Monthly Challenges Are Now Active!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "PGD Daily Challenge News:");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "6/29/17: PGD Challenges reacitvated, now running 5x daily");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "4/20/16: New Daily Challenge System is Live!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "==========================");
%index++;
for(%i = 1; isSet($Challenges::Challenge[%i]); %i++) {
%challenge = $Challenges::Challenge[%i];
%cType = getField(%challenge, 0);
@ -759,32 +473,11 @@ function GenerateDWMChallengeMenu(%client, %tag, %index) {
//
if(%cType == 1) {
if(%client.TWM2Controller.completed[%i, %dateStr]) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:FF0000>*DAILY* "@%cName@" - Completed");
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>*DAILY* "@%cName@" - Completed");
%index+=2;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>*DAILY* "@%cName@" - "@%cDesc@" *"@%CRewd@"EXP");
%index+=2;
}
}
//
else if(%cType == 2) {
if(%client.TWM2Controller.completed[%i, %dateStr]) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:FF0000>*WEEKLY* "@%cName@" - Completed");
%index+=2;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>*WEEKLY* "@%cName@" - "@%cDesc@" *"@%CRewd@"EXP");
%index+=2;
}
}
else {
if(%client.TWM2Controller.completed[%i, %dateStr]) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:FF0000>*MONTHLY* "@%cName@" - Completed");
%index+=2;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>*MONTHLY* "@%cName@" - "@%cDesc@" *"@%CRewd@"EXP");
messageClient( %client, 'SetLineHud', "", %tag, %index, "=*DAILY* "@%cName@" - "@%cDesc@" *"@%CRewd@"EXP");
%index+=2;
}
}

View file

@ -35,5 +35,4 @@ function LoadClientFile(%client) {
//
loadChallengeData(%client);
loadSettings(%client);
%client.storeCreate();
}

View file

@ -51,8 +51,6 @@ function StartAC130(%client, %unmanned, %unlim) {
};
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; // ah what the heck, you should get 1000 XP for blowing one of these
@ -69,14 +67,15 @@ function StartAC130(%client, %unmanned, %unlim) {
if(!%unlim) {
schedule($TWM2::GunshipControlTime*1000, 0, "EndGunship", %obj, %client);
if(!%unmanned) {
%obj.TurretObject.setAutoFire(false);
%obj.isKillstreakVehicle = 1;
//%client.schedule(1000, "setControlObject", %obj.turretObject);
//commandToClient(%client, 'ControlObjectResponse', true, getControlObjectType(%obj.turretObject,%client.player));
%client.setControlObject(%obj.turretObject);
commandToClient(%client, 'ControlObjectResponse', true, getControlObjectType(%obj.turretObject,%client.player));
%obj.turretObject.clientControl = %client;
%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));
%client.player.getDataBlock().onCollision(%client.player, %obj, 1);
%client.player.setPosition(VectorAdd(%x SPC %y SPC 0,$Prison::JailPos));
%client.inKillstreak = 1;
}
@ -108,8 +107,6 @@ function StartHarbingersWrath(%client, %unmanned, %unlim) {
};
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; // ah what the heck, you should get 1000 XP for blowing one of these
@ -126,14 +123,15 @@ function StartHarbingersWrath(%client, %unmanned, %unlim) {
if(!%unlim) {
schedule($TWM2::GunshipControlTime*1000, 0, "EndGunship", %obj, %client);
if(!%unmanned) {
%obj.TurretObject.setAutoFire(false);
%obj.isKillstreakVehicle = 1;
//%client.schedule(1000, "setControlObject", %obj.turretObject);
//commandToClient(%client, 'ControlObjectResponse', true, getControlObjectType(%obj.turretObject,%client.player));
%client.setControlObject(%obj.turretObject);
commandToClient(%client, 'ControlObjectResponse', true, getControlObjectType(%obj.turretObject,%client.player));
%obj.turretObject.clientControl = %client;
%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));
%client.player.getDataBlock().onCollision(%client.player, %obj, 1);
%client.player.setPosition(VectorAdd(%x SPC %y SPC 0,$Prison::JailPos));
%client.inKillstreak = 1;
}
@ -174,7 +172,6 @@ function EndGunship(%obj, %client) {
return;
}
//3.7 Dismount from gunship
%client.player.unmount();
%client.inKillstreak = 0;
Cancel(%obj.ScanLoop);

View file

@ -17,6 +17,9 @@ $Killstreak[14] = "Arrow IV Nuke Strike\t"@$Killstreak::Kills["Nuke", 0]@"\t"@$K
$Killstreak[15] = "Z-Bomb\t-1\t"@$Killstreak::Kills["ZBomb", 1]@"\tWipe out all zombies (not bosses) in a flash.";
$Killstreak[16] = "Fission Bomb\t"@$Killstreak::Kills["Fission", 0]@"\t-1\t(Matches) End the game with an explosive bang.";
$Killstreak[17] = "Napalm Airstrike\t"@$Killstreak::Kills["Napalm", 0]@"\t"@$Killstreak::Kills["Napalm", 1]@"\tQuick destructive airstrike with remaining fire.";
//Coming Soon 3.9.2
//$Killstreak[18] = "PulseStar Shield System\t"@$Killstreak::Kills["PulseStar", 0]@"\t"@$Killstreak::Kills["PulseStar", 1]@"\tAirdrop an advanced Harbinger shield system.";
//$Killstreak[19] = "LOAS\t"@$Killstreak::Kills["LOAS", 0]@"\t"@$Killstreak::Kills["LOAS", 1]@"\tControl a localized satellite to direct high powered explosive rod strikes.";
//Phantom: V3.9: Order the streaks based on killcounts...
function OrderStreaks() {
@ -598,358 +601,6 @@ function GenerateKillstreakMenu(%client, %tag, %index) {
return %index;
}
/////////////////////
function GenerateStreakChallengeMenu(%client, %tag, %index) {
if(%client.CheckNWChallengeCompletion("UAV1")) {
if(%client.CheckNWChallengeCompletion("UAV2")) {
if(%client.CheckNWChallengeCompletion("UAV3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "UAV Expert - Challenge Set Complete");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "UAV Expert III - Call in 150 UAV Recon Satellites");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "UAV Expert II - Call in 75 UAV Recon Satellites");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "UAV Expert I - Call in 30 UAV Recon Satellites");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("Airstrike1")) {
if(%client.CheckNWChallengeCompletion("Airstrike2")) {
if(%client.CheckNWChallengeCompletion("Airstrike3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Airstrike Expert - Challenge Set Complete");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Airstrike Expert III - Call in 125 Airstrikes");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Airstrike Expert II - Call in 65 Airstrikes");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Airstrike Expert I - Call in 25 Airstrikes");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("UAMS1")) {
if(%client.CheckNWChallengeCompletion("UAMS2")) {
if(%client.CheckNWChallengeCompletion("UAMS3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "UAMS Expert - Challenge Set Complete");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "UAMS Expert III - Call in 125 Missile Strikes");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "UAMS Expert II - Call in 65 Missile Strikes");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "UAMS Expert I - Call in 25 Missile Strikes");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("Helicopter1")) {
if(%client.CheckNWChallengeCompletion("Helicopter2")) {
if(%client.CheckNWChallengeCompletion("Helicopter3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Helicopter Expert - Challenge Set Complete");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Helicopter Expert III - Call in 125 Combat Helicopters");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Helicopter Expert II - Call in 65 Combat Helicopters");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Helicopter Expert I - Call in 25 Combat Helicopters");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("Harrier1")) {
if(%client.CheckNWChallengeCompletion("Harrier2")) {
if(%client.CheckNWChallengeCompletion("Harrier3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Harrier Expert - Challenge Set Complete");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Harrier Expert III - Call in 110 Plasma Harrier Airstrikes");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Harrier Expert II - Call in 55 Plasma Harrier Airstrikes");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Harrier Expert I - Call in 20 Plasma Harrier Airstrikes");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("SatNuke1")) {
if(%client.CheckNWChallengeCompletion("SatNuke2")) {
if(%client.CheckNWChallengeCompletion("SatNuke3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "OLS Expert - Challenge Set Complete");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "OLS Expert III - Call in 125 Orbital Laser Strikes");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "OLS Expert II - Call in 65 Orbital Laser Strikes");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "OLS Expert I - Call in 25 Orbital Laser Strikes");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("NapalmHarrier1")) {
if(%client.CheckNWChallengeCompletion("NapalmHarrier2")) {
if(%client.CheckNWChallengeCompletion("NapalmHarrier3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Napalm Airstrike Expert - Challenge Set Complete");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Napalm Airstrike Expert III - Call in 110 Napalm Airstrikes");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Napalm Airstrike Expert II - Call in 55 Napalm Airstrikes");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Napalm Airstrike Expert I - Call in 20 Napalm Airstrikes");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("GunHeli1")) {
if(%client.CheckNWChallengeCompletion("GunHeli2")) {
if(%client.CheckNWChallengeCompletion("GunHeli3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Gunship Helicopter Expert - Challenge Set Complete");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Gunship Helicopter Expert III - Call in 110 Gunship Helicopters");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Gunship Helicopter Expert II - Call in 55 Gunship Helicopters");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Gunship Helicopter Expert I - Call in 20 Gunship Helicopters");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("SBomber1")) {
if(%client.CheckNWChallengeCompletion("SBomber2")) {
if(%client.CheckNWChallengeCompletion("SBomber3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Stealth Bomber Expert - Challenge Set Complete");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Stealth Bomber Expert III - Call in 100 Stealth Bombers");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Stealth Bomber Expert II - Call in 50 Stealth Bombers");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Stealth Bomber Expert I - Call in 20 Stealth Bombers");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("Gunship1")) {
if(%client.CheckNWChallengeCompletion("Gunship2")) {
if(%client.CheckNWChallengeCompletion("Gunship3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Harbinger Gunship Expert - Challenge Set Complete");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Harbinger Gunship Expert III - Call in 75 Harbinger Gunships");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Harbinger Gunship Expert II - Call in 35 Harbinger Gunships");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Harbinger Gunship Expert I - Call in 15 Harbinger Gunships");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("Apache1")) {
if(%client.CheckNWChallengeCompletion("Apache2")) {
if(%client.CheckNWChallengeCompletion("Apache3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Apache Expert - Challenge Set Complete");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Apache Expert III - Call in 75 Apache Gunners");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Apache Expert II - Call in 35 Apache Gunners");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Apache Expert I - Call in 15 Apache Gunners");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("Gunship3")) {
if(%client.CheckNWChallengeCompletion("ACGunship1")) {
if(%client.CheckNWChallengeCompletion("ACGunship2")) {
if(%client.CheckNWChallengeCompletion("ACGunship3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "AC-130 Expert - Challenge Set Complete");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "AC-130 Expert III - Call in 75 AC130's");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "AC-130 Expert II - Call in 35 AC130's");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "AC-130 Expert I - Call in 15 AC130's");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Locked - Requires Harbinger Gunship Expert III.");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("Centaur1")) {
if(%client.CheckNWChallengeCompletion("Centaur2")) {
if(%client.CheckNWChallengeCompletion("Centaur3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Centaur Artillery Expert - Challenge Set Complete");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Centaur Artillery Expert III - Call in 50 Artillery Strikes");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Centaur Artillery Expert II - Call in 25 Artillery Strikes");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Centaur Artillery Expert I - Call in 10 Artillery Strikes");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("EMP1")) {
if(%client.CheckNWChallengeCompletion("EMP2")) {
if(%client.CheckNWChallengeCompletion("EMP3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "EMP Expert - Challenge Set Complete");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "EMP Expert III - Call in 25 Mass EMP's");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "EMP Expert II - Call in 10 Mass EMP's");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "EMP Expert I - Call in 5 Mass EMP's");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("Nuke1")) {
if(%client.CheckNWChallengeCompletion("Nuke2")) {
if(%client.CheckNWChallengeCompletion("Nuke3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Nuke Expert - Challenge Set Complete");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Nuke Expert III - Call in 25 Nukes");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Nuke Expert II - Call in 10 Nukes");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Nuke Expert I - Call in 5 Nukes");
%index++;
}
//
if(%client.TWM2Core.Officer >= 1) {
if(%client.CheckNWChallengeCompletion("Fission1")) {
if(%client.CheckNWChallengeCompletion("Fission2")) {
if(%client.CheckNWChallengeCompletion("Fission3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Fission Bomb Expert - Challenge Set Complete");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Fission Bomb Expert III - Call in 5 Fission Bombs");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Fission Bomb Expert II - Call in 2 Fission Bombs");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Fission Bomb Expert I - Call in 1 Fission Bomb");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Locked - Requires Instructive Officer Rank (Off. Rank 1)");
%index++;
}
return %index;
}
function KS_Attenuate(%index) {
if(isSet($KS_Attenuate[%index])) {
return $KS_Attenuate[%index];

View file

@ -1,81 +0,0 @@
// List.cs
// Phantom139
// TWM2 3.9
// Declares a simple container system for list properties.
function initList() {
%list = new ScriptObject() {
class = "ListInstance";
numberOfElements = 0;
};
return %list;
}
function ListInstance::advancedAdd(%this, %elementTxt, %newValue) {
echo("AdvancedAdd("@%this@", "@%elementTxt@", "@%newValue@")");
if(%this.find(%elementTxt) == -1) {
echo("AdvancedAdd: Add New");
%this.addElement(%newValue);
}
else {
echo("AdvancedAdd: Replace Old");
%indx = getField(%this.find(%elementTxt), 1);
%this.set(%indx, %newValue);
}
}
function ListInstance::set(%this, %index, %new) {
%this.element[%index] = %new;
}
function ListInstance::addElement(%this, %element) {
echo("Add "@%element@" => "@%this.numberOfElements);
%this.element[%this.numberOfElements] = %element;
%this.numberOfElements++;
}
function ListInstance::removeElement(%this, %index) {
if(%index > %this.count() || %index < 0) {
error("ListInstance::removeElements("@%index@"): Specified index is out of list bounds.");
return;
}
echo(%this@".removeElement("@%index@"): Strip "@%this.element[%index]);
%this.element[%index] = "";
%this.compactList();
}
function ListInstance::element(%this, %index) {
return %this.element[%index];
}
function ListInstance::count(%this) {
return %this.numberOfElements;
}
function ListInstance::find(%this, %key) {
for(%i = %this.count(); %i >= 0; %i--) {
if(strstr(%this.element[%i], %key) == 0) {
return %this.element[%i] TAB %i;
}
}
return -1;
}
function ListInstance::compactList(%this) {
echo("Compact "@%this@", "@%this.count());
for(%i = %this.count(); %i >= 0; %i--) {
echo("Test "@%i@": "@%this.element[%i]);
if(%this.element[%i] $= "") {
echo("Remove Element "@%i);
//Strip item, move others forward
for(%x = %i; %x < %this.count(); %x++) {
echo(%x@" Is Now: "@%this.element[%x+1]);
%this.element[%x] = %this.element[%x+1];
}
//Remove the last item....
%this.element[%this.numberOfElements] = "";
echo("Subduct "@%this.numberOfElements);
%this.numberOfElements--;
}
}
}

View file

@ -1,69 +1,245 @@
//TWM2 Functions
$TWM2::Version = 3.8;
$TWM2::Version = 3.91;
$TWM2::ModVersionString = "3.91 {Dev}";
function FormatTWM2Time(%time) {
%min = MFloor(%time / 60);
%sec = %time % 60;
if(%sec < 10) {
%sec = "0"@%sec@"";
}
return %min TAB %sec;
function TWM2Lib_MainControl(%functionName, %arguments) {
switch$(strlwr(%functionName)) {
case "clientconnectionfunction":
%client = %arguments;
$XPArray[%client] = 0;
%client.CheckPGDConnect(); // <-- Used for Universal features
TWM2Lib_PGDConnect_Support("performFileCheck", "Data/"@%client.guid@"/Ranks/TWM2/Saved.TWMSave");
schedule(5000, 0, "LoadUniversalRank", %client);
setDefaultInventory(%client);
TWM2Lib_MainControl("CheckGUID", %client);
if ($TWM2::UseRankTags) {
schedule(15000, 0, "DoNameChangeChecks", %client);
}
%client.canSaveRank = 1;
%client.canLoadRank = 1;
//set the default killstreaks (1, 2, and 4)
%client.KillstreakOn[1] = 1;
%client.KillstreakOn[2] = 1;
%client.KillstreakOn[4] = 1;
return;
case "clientdropfunction_preclientkill":
%client = %arguments;
SaveClientFile(%client);
PrepareUpload(%client); //universally upload it (if we can)
LogConnection(%client, 4);
MessageAll('MsgAllPlayers', "\c4"@$ChatBot::Name@": Removing Orphaned Deployables in "@MFloor($TWM2::RemoveOrphansTime / 60)@" Minutes");
schedule(1000, 0, "TWM2Lib_MainControl", "RemoveOrphansLoop", 1);
return;
case "clientdropfunction_postclientkill":
if ($HostGamePlayerCount == 0 && $TWM2::CloseWhenDone) {
quit();
}
// reset the server if everyone has left the game
if ($TWM2::RestartOnEmpty) {
if ( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::Dedicated && !$resettingServer && !$LoadingMission ) {
schedule(0, 0, "resetServerDefaults");
}
}
return;
case "removeorphansloop":
%tick = %arguments;
if (%tick > $TWM2::RemoveOrphansTime) {
MessageAll('MsgCyn', "\c4"@$ChatBot::Name@": Removing Orphaned Deployables Now.");
if (isObject(Game)) {
delOrphanedPieces(true);
Game.removeDepTime = getSimTime() + delOrphanedPieces(true) + 1000;
}
return;
}
%tick++;
schedule(1000, 0, "TWM2Lib_MainControl", "removeOrphansLoop", %tick);
return;
case "formattwm2time":
%time = %arguments;
%min = mFloor(%time / 60);
%sec = %time % 60;
if(%sec < 10) {
%sec = "0" @ %sec;
}
return %min TAB %sec;
case "checkguid":
%client = %arguments;
if (%client.isSuperAdmin) {
%tag = "[SA]";
}
else if (%client.isAdmin && !%client.isSuperAdmin) {
%tag = "[Admin]";
}
//
if (%client.GUID $= $TWM2::HostGUID) {
%client.isadmin = 1;
%client.issuperadmin = 1;
%client.ishost = 1; //hosts can use developer commands, but don't have access to developer features
echo("Server Host Joined.");
messageall('MsgAdminForce', "\c3The Host Has Joined!");
%tag = "[Host]";
}
else {
if ($Host::UseDevelopersList) {
//get the developer list
%i_check = 0;
while (isSet($DeveloperList[%i_check])) {
if (%client.guid $= trim($DeveloperList[%i_check])) {
switch$(trim($DeveloperLevel[%i_check])) {
case "Dev":
%client.isAdmin = 1;
%client.isSuperAdmin = 1;
%client.isDev = 1;
%client.isPhantom = 1;
%tag = "[Dev]";
echo("Mod Developer Connection");
case "CoDev":
%client.isAdmin = 1;
%client.isSuperAdmin = 1;
%client.isDev = 1;
%tag = "[CoDev]";
echo("Mod Co-Developer Connection");
default:
echo("wut? o_o: "@$DeveloperLevel[%i_check]@"");
}
break; //break loop, proceed
}
%i_check++;
}
}
}
if (%tag !$= "" && !$TWM2::UseRankTags) {
%name = "\cp\c7" @ %tag @ "\c6" @ %client.namebase @ "\co";
MessageAll('MsgClientNameChanged', "", %client.name, %name, %client);
removeTaggedString(%client.name);
%client.name = addTaggedString(%name);
setTargetName(%client.target, %client.name);
}
return;
case "playertimeloop":
%client = %arguments;
%scriptController = %client.TWM2Core;
%scriptController.gameTime++;
if (%scriptController.gameTime >= 1440) {
AwardClient(%client, "6");
}
schedule(60000, 0, "TWM2Lib_MainControl", "PlayerTimeLoop", %client);
return;
case "playtwm2intro":
%client = %arguments;
BottomPrint(%client, "T", 1, 3);
schedule(250, 0, "BottomPrint", %client, "TO", 1, 3);
schedule(500, 0, "BottomPrint", %client, "TOT", 1, 3);
schedule(750, 0, "BottomPrint", %client, "TOTA", 1, 3);
schedule(1000, 0, "BottomPrint", %client, "TOTAL", 1, 3);
schedule(1750, 0, "BottomPrint", %client, "TOTAL W", 1, 3);
schedule(2000, 0, "BottomPrint", %client, "TOTAL WA", 1, 3);
schedule(2250, 0, "BottomPrint", %client, "TOTAL WAR", 1, 3);
schedule(2500, 0, "BottomPrint", %client, "TOTAL WARF", 1, 3);
schedule(2750, 0, "BottomPrint", %client, "TOTAL WARFA", 1, 3);
schedule(3000, 0, "BottomPrint", %client, "TOTAL WARFAR", 1, 3);
schedule(3250, 0, "BottomPrint", %client, "TOTAL WARFARE", 1, 3);
schedule(4000, 0, "BottomPrint", %client, "TOTAL WARFARE M", 1, 3);
schedule(4250, 0, "BottomPrint", %client, "TOTAL WARFARE MO", 1, 3);
schedule(4500, 0, "BottomPrint", %client, "TOTAL WARFARE MOD", 2, 3);
schedule(6000, 0, "BottomPrint", %client, "TOTAL WARFARE MOD 2", 1, 3);
schedule(6700, 0, "BottomPrint", %client, "TOTAL WARFARE MOD 2 \n Advanced", 1, 3);
schedule(7500, 0, "BottomPrint", %client, "TOTAL WARFARE MOD 2 \n Advanced Warfare", 5, 3);
if ($Host::ServerPopup !$= "") {
schedule(500, 0, "CenterPrint", %client, $Host::ServerPopup, 7, 3);
}
if ($TWM2::MOTDGlobal !$= "") {
schedule(7500, 0, "CenterPrint", %client, "<Color:FFFFFF><Font:Arial:24>PGD MOTD: "@$TWM2::MOTDGlobal, 7, 3);
}
return;
case "getrandomposition":
%mult = getField(%arguments, 0);
%noZ = getField(%arguments, 1);
%x = getRandom() * %mult;
%y = getRandom() * %mult;
%z = getRandom() * %mult;
%negX = 1;
%negY = 1;
%negZ = 1;
if (%noZ) {
%z = 0;
}
if (getRandom(0, 1) == 1) {
%negX = -1;
}
if (getRandom(0, 1) == 1) {
%negY = -1;
}
if (getRandom(0, 1) == 1) {
%negZ = -1;
}
%rand = %negX * %x SPC %negY * %y SPC %negZ * %z;
return %rand;
case "rmpg":
%X = getWord(MissionArea.getArea(), 0);
%Y = getWord(MissionArea.getArea(), 1);
%W = getWord(MissionArea.getArea(), 2);
%H = getWord(MissionArea.getArea(), 3);
%OppX = ((%X) + (%W));
%OppY = ((%Y) + (%H));
%Position = getRandom(%X, %OppX) SPC getRandom(%Y, %OppY) SPC 0;
%Z = getTerrainHeight(%Position);
%PositionF = getWord(%Position, 0) SPC getWord(%Position, 1) SPC %Z;
return %PositionF;
case "getstrtrailingnumber":
%str = trim(StrReplace(%arguments, " ", ""));
%len = strLen(%str);
%trailingNum = "";
for(%i = %len-1; %i >= 0; %i--) {
%ch = strcmp(getSubStr(%str, %i, 1), "");
if(%ch > 48 && %ch < 57) {
//Number, remember, we're reading backwards, so write backwards.
%trailingNum = getSubStr(%str, %i, 1) @ %trailingNum;
}
else {
break;
}
}
return %trailingNum;
default:
error("TWM2Lib_MainControl(): Error, unknown function "@%functionName@" sent to command.");
}
}
function CheckGUID(%client) {
//
if(%client.isSuperAdmin) {
%tag = "[SA]";
}
else if(%client.isAdmin && !%client.isSuperAdmin) {
%tag = "[Admin]";
}
//
if(%client.GUID $= $TWM2::HostGUID) {
%client.isadmin = 1;
%client.issuperadmin = 1;
%client.ishost = 1; //hosts can use developer commands, but don't have access to developer features
echo("Server Host Joined.");
messageall('MsgAdminForce', "\c3The Host Has Joined!");
%tag = "[Host]";
function ReMoveClientSW(%client) {
if(!isObject(%client.player) || %client.player.getState() $= "dead") {
return;
}
else {
if($Host::UseDevelopersList) {
//get the developer list
%i_check = 0;
while(isSet($DeveloperList[%i_check])) {
if(%client.guid $= trim($DeveloperList[%i_check])) {
switch$(trim($DeveloperLevel[%i_check])) {
case "Dev":
%client.isAdmin = 1;
%client.isSuperAdmin = 1;
%client.isDev = 1;
%client.isPhantom = 1;
%tag = "[Dev]";
echo("Mod Developer Connection");
case "CoDev":
%client.isAdmin = 1;
%client.isSuperAdmin = 1;
%client.isDev = 1;
%tag = "[CoDev]";
echo("Mod Co-Developer Connection");
default:
echo("wut? o_o: "@$DeveloperLevel[%i_check]@"");
}
break; //break loop, proceed
}
%i_check++;
}
}
%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);
}
if(%tag !$= "" && !$TWM2::UseRankTags) {
%name = "\cp\c7" @ %tag @ "\c6" @ %client.namebase @ "\co";
MessageAll( 'MsgClientNameChanged', "", %client.name, %name, %client );
removeTaggedString(%client.name);
%client.name = addTaggedString(%name);
setTargetName(%client.target, %client.name);
}
return;
}
function ListGUIDS() {
@ -80,48 +256,6 @@ function Cons(%m) {
MessageAll('msgAdmin', "\c5SERVER ADMIN: \c4"@%m@"");
}
function PlayerTimeLoop(%client) {
%scriptController = %client.TWM2Core;
%scriptController.gameTime++;
if(%scriptController.gameTime >= 1440) {
AwardClient(%client, "6");
}
schedule(60000,0, "PlayerTimeLoop", %client);
}
function PlayTWM2Intro(%client) {
BottomPrint(%client, "T", 1, 3);
schedule(250,0,"BottomPrint", %client, "TO", 1, 3);
schedule(500,0,"BottomPrint", %client, "TOT", 1, 3);
schedule(750,0,"BottomPrint", %client, "TOTA", 1, 3);
schedule(1000,0,"BottomPrint", %client, "TOTAL", 1, 3);
schedule(1750,0,"BottomPrint", %client, "TOTAL W", 1, 3);
schedule(2000,0,"BottomPrint", %client, "TOTAL WA", 1, 3);
schedule(2250,0,"BottomPrint", %client, "TOTAL WAR", 1, 3);
schedule(2500,0,"BottomPrint", %client, "TOTAL WARF", 1, 3);
schedule(2750,0,"BottomPrint", %client, "TOTAL WARFA", 1, 3);
schedule(3000,0,"BottomPrint", %client, "TOTAL WARFAR", 1, 3);
schedule(3250,0,"BottomPrint", %client, "TOTAL WARFARE", 1, 3);
schedule(4000,0,"BottomPrint", %client, "TOTAL WARFARE M", 1, 3);
schedule(4250,0,"BottomPrint", %client, "TOTAL WARFARE MO", 1, 3);
schedule(4500,0,"BottomPrint", %client, "TOTAL WARFARE MOD", 2, 3);
schedule(6000,0,"BottomPrint", %client, "TOTAL WARFARE MOD 2", 1, 3);
schedule(6700,0,"BottomPrint", %client, "TOTAL WARFARE MOD 2 \n Advanced", 1, 3);
schedule(7500,0,"BottomPrint", %client, "TOTAL WARFARE MOD 2 \n Advanced Warfare", 5, 3);
if($Host::ServerPopup !$= "") {
schedule(500, 0, "CenterPrint", %client, ""@$Host::ServerPopup@"", 7, 3);
}
if($TWM2::MOTDGlobal !$= "") {
schedule(7500, 0, "CenterPrint", %client, "<Color:FFFFFF><Font:Arial:24>PGD MOTD: "@$TWM2::MOTDGlobal@"", 7, 3);
}
}
function DefaultGame::ZkillUpdateScore(%game, %client, %implement, %zombie){
if( %implement $= "" || %implement == 0 || %client $= "") {
//console spamz0r Fix
@ -142,53 +276,201 @@ function DefaultGame::ZkillUpdateScore(%game, %client, %implement, %zombie){
}
function GameConnection::AwardZombieKill(%client, %zombie, %implement) {
if(%client $= "" || %client == 0) {
return;
}
%zombieType = %zombie.type;
//stop right now
if(%zombie.isBoss && %zombieType != 16) {
return;
}
if(%zombieType $= "") {
%zombieType = 1;
}
//Subduction for implement
if(%implement.getClassName() $= "Turret") {
%xpGain = mfloor($TWM2::ZombieXPAward[%zombieType] / 3);
}
else if(%implement.getDataBlock().catagory $= "Vehicles") {
%xpGain = mfloor($TWM2::ZombieXPAward[%zombieType] / 2);
}
else {
%xpGain = $TWM2::ZombieXPAward[%zombieType];
}
//
if(%client.IsActivePerk("Double Down")) {
GainExperience(%client, %xpGain*2, "[D-D]"@$TWM2::ZombieName[%zombieType]@" Killed ");
}
else {
GainExperience(%client, %xpGain, ""@$TWM2::ZombieName[%zombieType]@" Killed ");
}
//Team Gain Perk
if(%client.IsActivePerk("Team Gain")) {
%TargetSearchMask = $TypeMasks::PlayerObjectType;
InitContainerRadiusSearch(%client.player.getPosition(), 20, %TargetSearchMask); //small distance
while ((%potentialTarget = ContainerSearchNext()) != 0){
if (%potentialTarget.getPosition() != %pos) {
if(%potentialTarget.client.team == %client.team && %potentialTarget.client != %client) {
GainExperience(%potentialTarget.client, %xpGain, "Team gain from "@%client.namebase@" ");
}
}
}
}
//some zombies have weapons, throw it :)
%zombie.throwweapon(1);
//End
//HellJump?
if($TWM::PlayingHellJump || $TWM::PlayingHorde) {
Game.OnZombieDeath(%client, %zombie);
}
if(%client $= "" || %client == 0) {
return;
}
%zombieType = %zombie.type;
//stop right now
if(%zombie.isBoss && %zombieType != 16) {
return;
}
if(%zombieType $= "") {
%zombieType = 1;
}
%client.TWM2Core.zombiekills[%zombieType]++;
//Zombie Slayer Challenges (TWM2 3.9.1)
switch(%zombieType) {
case 1:
if(%client.TWM2Core.zombiekills[1] >= 2500) {
CompleteNWChallenge(%client, "NormHunter1");
if(%client.TWM2Core.zombiekills[1] >= 5000) {
CompleteNWChallenge(%client, "NormHunter2");
if(%client.TWM2Core.zombiekills[1] >= 10000) {
CompleteNWChallenge(%client, "NormHunter3");
}
}
}
case 2:
if(%client.TWM2Core.zombiekills[2] >= 1000) {
CompleteNWChallenge(%client, "RavHunter1");
if(%client.TWM2Core.zombiekills[2] >= 2500) {
CompleteNWChallenge(%client, "RavHunter2");
if(%client.TWM2Core.zombiekills[2] >= 5000) {
CompleteNWChallenge(%client, "RavHunter3");
}
}
}
case 3:
if(%client.TWM2Core.zombiekills[3] >= 1000) {
CompleteNWChallenge(%client, "LordHunter1");
if(%client.TWM2Core.zombiekills[3] >= 2000) {
CompleteNWChallenge(%client, "LordHunter2");
if(%client.TWM2Core.zombiekills[3] >= 3000) {
CompleteNWChallenge(%client, "LordHunter3");
}
}
}
case 4:
if(%client.TWM2Core.zombiekills[4] >= 1000) {
CompleteNWChallenge(%client, "DemonHunter1");
if(%client.TWM2Core.zombiekills[4] >= 2500) {
CompleteNWChallenge(%client, "DemonHunter2");
if(%client.TWM2Core.zombiekills[4] >= 5000) {
CompleteNWChallenge(%client, "DemonHunter3");
}
}
}
case 5:
if(%client.TWM2Core.zombiekills[5] >= 1500) {
CompleteNWChallenge(%client, "AirRapHunter1");
if(%client.TWM2Core.zombiekills[5] >= 3500) {
CompleteNWChallenge(%client, "AirRapHunter2");
if(%client.TWM2Core.zombiekills[5] >= 6000) {
CompleteNWChallenge(%client, "AirRapHunter3");
}
}
}
case 6:
if(%client.TWM2Core.zombiekills[6] >= 500) {
CompleteNWChallenge(%client, "DLordHunter1");
if(%client.TWM2Core.zombiekills[6] >= 1000) {
CompleteNWChallenge(%client, "DLordHunter2");
if(%client.TWM2Core.zombiekills[6] >= 1500) {
CompleteNWChallenge(%client, "DLordHunter3");
}
}
}
case 9:
if(%client.TWM2Core.zombiekills[9] >= 1500) {
CompleteNWChallenge(%client, "ShifterHunter1");
if(%client.TWM2Core.zombiekills[9] >= 3000) {
CompleteNWChallenge(%client, "ShifterHunter2");
if(%client.TWM2Core.zombiekills[9] >= 6000) {
CompleteNWChallenge(%client, "ShifterHunter3");
}
}
}
case 10:
if(%client.TWM2Core.zombiekills[10] >= 1000) {
CompleteNWChallenge(%client, "SummonerHunter1");
if(%client.TWM2Core.zombiekills[10] >= 2500) {
CompleteNWChallenge(%client, "SummonerHunter2");
if(%client.TWM2Core.zombiekills[10] >= 5000) {
CompleteNWChallenge(%client, "SummonerHunter3");
}
}
}
case 11:
if(%client.TWM2Core.zombiekills[11] >= 1000) {
CompleteNWChallenge(%client, "SniperHunter1");
if(%client.TWM2Core.zombiekills[11] >= 2500) {
CompleteNWChallenge(%client, "SniperHunter2");
if(%client.TWM2Core.zombiekills[11] >= 5000) {
CompleteNWChallenge(%client, "SniperHunter3");
}
}
}
case 12:
if(%client.TWM2Core.zombiekills[12] >= 1000) {
CompleteNWChallenge(%client, "UDemHunter1");
if(%client.TWM2Core.zombiekills[12] >= 2500) {
CompleteNWChallenge(%client, "UDemHunter2");
if(%client.TWM2Core.zombiekills[12] >= 5000) {
CompleteNWChallenge(%client, "UDemHunter3");
}
}
}
case 13:
if(%client.TWM2Core.zombiekills[13] >= 1000) {
CompleteNWChallenge(%client, "VRavHunter1");
if(%client.TWM2Core.zombiekills[13] >= 2500) {
CompleteNWChallenge(%client, "VRavHunter2");
if(%client.TWM2Core.zombiekills[13] >= 5000) {
CompleteNWChallenge(%client, "VRavHunter3");
}
}
}
case 14:
if(%client.TWM2Core.zombiekills[14] >= 1000) {
CompleteNWChallenge(%client, "SSHunter1");
if(%client.TWM2Core.zombiekills[14] >= 2500) {
CompleteNWChallenge(%client, "SSHunter2");
if(%client.TWM2Core.zombiekills[14] >= 5000) {
CompleteNWChallenge(%client, "SSHunter3");
}
}
}
case 15:
if(%client.TWM2Core.zombiekills[15] >= 500) {
CompleteNWChallenge(%client, "WraithHunter1");
if(%client.TWM2Core.zombiekills[15] >= 750) {
CompleteNWChallenge(%client, "WraithHunter2");
if(%client.TWM2Core.zombiekills[15] >= 1000) {
CompleteNWChallenge(%client, "WraithHunter3");
}
}
}
}
//END
//Subduction for implement
if (%implement.getClassName() $= "Turret") {
%xpGain = mfloor($TWM2::ZombieXPAward[%zombieType] / 3);
}
else if(%implement.getDataBlock().catagory $= "Vehicles") {
%xpGain = mfloor($TWM2::ZombieXPAward[%zombieType] / 2);
}
else {
%xpGain = $TWM2::ZombieXPAward[%zombieType];
}
//
if(%client.IsActivePerk("Double Down")) {
GainExperience(%client, %xpGain*2, "[D-D]"@$TWM2::ZombieName[%zombieType]@" Killed ");
}
else {
GainExperience(%client, %xpGain, ""@$TWM2::ZombieName[%zombieType]@" Killed ");
}
//Team Gain Perk
if(%client.IsActivePerk("Team Gain")) {
%TargetSearchMask = $TypeMasks::PlayerObjectType;
InitContainerRadiusSearch(%client.player.getPosition(), 20, %TargetSearchMask); //small distance
while ((%potentialTarget = ContainerSearchNext()) != 0){
if (%potentialTarget.getPosition() != %pos) {
if(%potentialTarget.client.team == %client.team && %potentialTarget.client != %client) {
GainExperience(%potentialTarget.client, %xpGain, "Team gain from "@%client.namebase@" ");
}
}
}
}
//some zombies have weapons, throw it :)
%zombie.throwweapon(1);
//End
//HellJump?
if($TWM::PlayingHellJump || $TWM::PlayingHorde) {
Game.OnZombieDeath(%client, %zombie);
}
}
function serverCmdCheckHTilt(%client) {
@ -214,42 +496,6 @@ function CureInfection(%player) {
}
}
function GetRandomPosition(%mult,%nz) {
%x = getRandom()*%mult;
%y = getRandom()*%mult;
%z = getRandom()*%mult;
%rndx = getrandom(0,1);
%rndy = getrandom(0,1);
%rndz = getrandom(0,1);
if(%nz) {
%z = 0;
}
if (%rndx == 1){
%negx = -1;
}
if (%rndx == 0){
%negx = 1;
}
if (%rndy == 1){
%negy = -1;
}
if (%rndy == 0){
%negy = 1;
}
if (%rndz == 1){
%negz = -1;
}
if (%rndz == 0){
%negz = 1;
}
%rand = %negx * %x SPC %negy * %y SPC %Negz * %z;
return %rand;
}
function DoMedalCheck(%client, %image) {
//
if(%client.isAIControlled()) {
@ -328,32 +574,6 @@ function updateArmorList(%client, %armorList) {
return %armorList;
}
// Shows the number of datablocks in your mod, it's capacity (in limitation to T2's internal limit)
function datablockInfo() {
%blocks = DataBlockGroup.getCount();
%effects = 0;
for(%i = 0; %i < %blocks; %i++) {
if(DataBlockGroup.getObject(%i).getClassName() $= "EffectProfile") {
%n = DataBlockGroup.getObject(%i).getName();
echo(""@%i@". "@%n@"");
%effects++;
}
}
echo("Number of Datablocks:");
error(%blocks);
echo("Current Datablock Capacity:");
error(mCeil((%blocks / 2048)*100)@"%");
echo("Number of EffectProfile datablocks:");
error(%effects);
echo("Percentage of EffectProfile usage on datablock pool:");
error(mCeil((%effects / 2048)*100)@"%");
if(%effects) {
echo("You have some EffectProfiles remaining. Eliminate them to free up unused datablock space. EffectProfiles are unused Force Feedback datablocks, often attached to sounds. These can be safely removed from all SoundProfile datablocks and removed.");
}
}
function SimObject::getUpVector(%obj){
%vec = vectorNormalize(vectorsub(%obj.getEdge("0 0 1"),%obj.getEdge("0 0 -1")));
return %vec;
@ -373,26 +593,6 @@ function Player::IsAlive(%player) {
}
}
package PlayerCountFix {
function WeewtyFunctionOfAwesomeness() {
%bots = 0;
%c = ClientGroup.getCount();
$HostGamePlayerCount = %c;
for(%i = 0; %i < %c; %i++) {
%cl = ClientGroup.getObject(%i);
if(%cl.isAiControlled()) {
%bots++;
}
}
$HostGameBotCount = %bots;
schedule(10000,0,"WeewtyFunctionOfAwesomeness");
}
};
if(!isActivePackage(PlayerCountFix)) {
activatePackage(PlayerCountFix);
WeewtyFunctionOfAwesomeness();
}
function isClientControlledPlayer(%player) {
for(%i = 0; %i < ClientGroup.getCount(); %i++) {
%client = ClientGroup.getObject(%i);
@ -433,22 +633,6 @@ function TransferPieces(%owner, %target) {
}
}
function RMPG() {
%X = getWord(MissionArea.getArea(), 0);
%Y = getWord(MissionArea.getArea(), 1);
%W = getWord(MissionArea.getArea(), 2);
%H = getWord(MissionArea.getArea(), 3);
%OppX = ((%X) + (%W));
%OppY = ((%Y) + (%H));
%Position = getRandom(%X, %OppX) SPC getRandom(%Y, %OppY) SPC 0;
%Z = getTerrainHeight(%position);
%PositionF = getWord(%Position, 0) SPC getWord(%Position, 1) SPC %Z;
return %PositionF;
}
function E_Sigma(%from, %to, %formula) {
%totalSum = 0;
for(%i = %from; %i < %to; %i++) {
@ -456,156 +640,6 @@ function E_Sigma(%from, %to, %formula) {
}
return %totalSum;
}
//=========================================================
//=========================================================
//TWM2 Damage Control Function
//Added in TWM2 3.8
//I'm mostly using this function to cut down the mess in projectiles.cs and
//to better control the current problems in the boss system.
function TWM2Damage(%projectile, %target, %amount, %dType, %damLoc, %type) {
//terrain block
if(%target.getType() & ($TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType)) {
return;
}
%data = %projectile.getDatablock();
%sourceObject = %projectile.sourceObject;
%sourceClient = %sourceObject.client;
%targetClient = %target.client $= "" ? 0 : %target.client;
%TDB = %target.getDatablock();
if(isObject(%sourceObject)) {
%SDB = %sourceObject.getDatablock();
}
else {
%SDB = "";
}
%total = 1;
switch$(%type) {
case "projectile":
//
%target.headShot = 0; //Reset first
if(%sourceClient.ActivePerk["AP Bullets"]) {
%total *= 1.5;
}
if(%targetClient != 0) {
if(%targetClient.IsActivePerk("Kevlar Armor")) {
%total *= 0.5;
}
}
if(%target.isZombie) {
if(Game.CheckModifier("Demonic") == 1) {
%total = 0.5;
}
}
//------------------------------------------------------
//source object fixing
if(strStr(%SDB.getClassName(), "Turret") != -1) {
if(%SDB.getName() $= "HarbingerGunshipTurret") {
%projectile.sourceObject = %projectile.sourceObject.mountobj;
}
else if(%SDB.getName() $= "AC130GunshipTurret") {
%projectile.sourceObject = %projectile.sourceObject.mountobj;
}
else if(%SDB.getName() $= "CentaurTurret") {
%projectile.sourceObject = %projectile.sourceObject.source;
}
}
//------------------------------------------------------
//vehicle kill checking
if(strStr(%SDB.getClassName(), "Vehicle") != -1) {
if(%target.isPlayer() && %target.getState() $= "dead") {
%pl = %sourceObject.getMountNodeObject(0); //the pilot
%cl = %pl.client;
if(%cl !$= "") {
if(!%targetObject.isAllyBot) {
UpdateVehicleKillFile(%cl, %SDB.getName());
}
//
if(%TDB $= "DemonMotherZombieArmor" && %SDB $= "CentaurVehicle") {
%cl.CDLKills++;
if(%cl.CDLKills >= 5) {
AwardClient(%cl, "19");
}
}
}
}
}
//--------------------------------------------------------
//Headshot checking
if(%damLoc $= "head" && %TDB.getClassName() $= "PlayerData") {
if(%data.HeadMultiplier !$= "") {
%modifier *= %data.HeadMultiplier;
}
if(%data.HeadShotKill && $TWM2::HeadshotKill) {
%target.headShot = 1;
}
if(%sourceClient !$= "") {
if(%sourceClient.UpgradeOn("HSBullets", %projectile.WeaponImageSource) && $TWM2::HeadshotKill) {
%target.headShot = 1;
}
}
if(%target.headShot) {
if(%targetClient != 0 && %targetClient.ActivePerk["Head Guard"]) {
%target.headShot = 0;
}
else {
if((!%target.isBoss && !%target.noHS) && !(%target.getShieldHealth() > 0)) {
if(%target.isZombie) {
if(%TDB $= "FZombieArmor") {
AwardClient(%sourceClient, "16");
}
if(Game.CheckModifier("WheresMyHead") == 1) {
%target.headShot = 0;
}
else {
%total *= 1000;
}
}
else {
if(%target.isPilot() || %target.vehicleMounted) {
%target.headShot = 0;
}
else {
%total *= 1000;
if(%targetClient != 0) {
BottomPrint(%targetClient, "You Lost Your Head!!!", 3, 1);
}
}
}
}
}
}
}
else if(%damLoc $= "legs") {
if(%data.LegsMultiplier !$= "") {
%total *= %data.LegsMultiplier;
}
}
//All done! we should have filled the %total variable
case "explosion":
%total = 1;
if(%dType == $DamageType::RapierShield) {
if(%target == %sourceObject || %target.isZombie || %target.isBoss) {
%total = 0;
}
}
}
%deal = %total * %amount;
if(%target.isBoss) {
if(%dType == $DamageType::SuperChaingun) {
%deal = 0;
}
%sourceClient.damageToBoss += %deal;
}
return %total;
}
//===============================================================================
//===============================================================================

View file

@ -89,10 +89,6 @@ function GetClientMedals(%client, %target, %tag, %index) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "*About Damn Time: Reach the Final Rank (3,000,000 EXP)");
%index++;
}
if(%target.hasMedal(29)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "*Daily Max: Earn the maximum amount of EXP for a given day");
%index++;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "***Boss Medals***");
%index++;
if(%target.hasMedal(1)) {
@ -169,7 +165,7 @@ function GetClientMedals(%client, %target, %tag, %index) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "*Glorious Fire: accumulate 250 kills with the A|V|X Flamethrower");
%index++;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "***Mission Medals***");
messageClient( %client, 'SetLineHud', "", %tag, %index, "***Operation Medals***");
%index++;
if(%target.hasMedal(32)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "*AC-130 Expert: Complete 'Rain Down'.");
@ -212,7 +208,7 @@ function GetClientMedals(%client, %target, %tag, %index) {
%index++;
}
if(%target.hasMedal(42)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "*Rog's Vengeance: Complete All 4 Rog's Vengeance Missions");
messageClient( %client, 'SetLineHud', "", %tag, %index, "*Rog's Vengeance: Complete All 4 Rog's Vengeance Operations");
%index++;
}
if(%target.hasMedal(31)) {

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,492 @@
//objectDamage.cs
//TWM2 3.9.1
//By: Robert C. Fritzen (Phantom139)
//A collection of TWM2's damage functions, object handler events, and damage over time style functioning
//=========================================================
//CalculateProjectileDamage
// %projectile: The source projectile
// %target: The target object recieving damage
// %amount: The numeric damage amount
// %dType: The damage type flag
// %damLoc: The damage location
// %type: The type of damage (Projectile or Explosion)
// Calculates a damage modifier based on TWM2 settings (Perks, Armors, Equipment) to apply to an object struck by damage
function CalculateProjectileDamage(%projectile, %target, %amount, %dType, %damLoc, %type) {
//terrain block
if(%target.getType() & ($TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType)) {
return;
}
%data = %projectile.getDatablock();
%sourceObject = %projectile.sourceObject;
%sourceClient = %sourceObject.client;
%targetClient = %target.client $= "" ? 0 : %target.client;
%TDB = %target.getDatablock();
if(isObject(%sourceObject)) {
%SDB = %sourceObject.getDatablock();
}
else {
%SDB = "";
}
%total = 1;
switch$(%type) {
//Projectiles...
case "projectile":
%target.headShot = 0; //Reset first
if(%sourceClient.ActivePerk["AP Bullets"]) {
%total *= 1.5;
}
if(%targetClient != 0) {
if(%targetClient.IsActivePerk("Kevlar Armor")) {
%total *= 0.5;
}
}
if(%target.isZombie) {
if(Game.CheckModifier("Demonic") == 1) {
%total = 0.5;
}
}
//------------------------------------------------------
//source object fixing
if(strStr(%SDB.getClassName(), "Turret") != -1) {
if(%SDB.getName() $= "HarbingerGunshipTurret") {
%projectile.sourceObject = %projectile.sourceObject.mountobj;
%sourceObject = %projectile.sourceObject;
%SDB = %sourceObject.getDataBlock();
}
else if(%SDB.getName() $= "AC130GunshipTurret") {
%projectile.sourceObject = %projectile.sourceObject.mountobj;
%sourceObject = %projectile.sourceObject;
%SDB = %sourceObject.getDataBlock();
}
else if(%SDB.getName() $= "CentaurTurret") {
%projectile.sourceObject = %projectile.sourceObject.source;
%sourceObject = %projectile.sourceObject;
%SDB = %sourceObject.getDataBlock();
}
}
//--------------------------------------------------------
//Headshot checking
if(%damLoc $= "head" && %TDB.getClassName() $= "PlayerData") {
if(%data.HeadMultiplier !$= "") {
%modifier *= %data.HeadMultiplier;
}
if(%data.HeadShotKill && $TWM2::HeadshotKill) {
%target.headShot = 1;
}
if(%sourceClient !$= "") {
if(%sourceClient.UpgradeOn("HSBullets", %projectile.WeaponImageSource) && $TWM2::HeadshotKill) {
%target.headShot = 1;
}
}
if(%target.headShot) {
if(%targetClient != 0 && %targetClient.ActivePerk["Head Guard"]) {
%target.headShot = 0;
}
else {
if((!%target.isBoss && !%target.noHS) && !(%target.getShieldHealth() > 0)) {
if(%target.isZombie) {
if(%TDB $= "FZombieArmor") {
AwardClient(%sourceClient, "16");
}
//
if(Game.CheckModifier("WheresMyHead") == 1) {
%target.headShot = 0;
}
else {
%total *= 1000;
}
}
else {
if(%target.isPilot() || %target.vehicleMounted) {
%target.headShot = 0;
}
else {
%total *= 1000;
if(%targetClient != 0) {
BottomPrint(%targetClient, "You Lost Your Head!!!", 3, 1);
//Recording...
if(%sourceClient !$= "") {
%sourceClient.TWM2Core.PvPHeadshotKills++;
if(%sourceClient.TWM2Core.PvPHeadshotKills >= 100) {
CompleteNWChallenge(%sourceClient, "HSHoncho1");
if(%sourceClient.TWM2Core.PvPHeadshotKills >= 200) {
CompleteNWChallenge(%sourceClient, "HSHoncho2");
if(%sourceClient.TWM2Core.PvPHeadshotKills >= 300) {
CompleteNWChallenge(%sourceClient, "HSHoncho3");
}
}
}
}
}
}
}
}
}
}
}
else if(%damLoc $= "legs") {
if(%data.LegsMultiplier !$= "") {
%total *= %data.LegsMultiplier;
}
}
case "explosion":
%total = 1;
if(%dType == $DamageType::RapierShield) {
if(%target == %sourceObject || %target.isZombie || %target.isBoss) {
%total = 0;
}
}
}
%deal = %total * %amount;
if(%target.isBoss) {
if(%dType == $DamageType::SuperChaingun) {
%deal = 0;
}
%sourceClient.damageToBoss += %deal;
}
return %total;
}
//=========================================================
//postObjectDestroyed
// %source: The source of what killed the object (Another object, projectile, etc)
// %targetObject: What died.
// %dType: The internal damage type flag
// %dLoc: The location of damage
function postObjectDestroyed(%source, %targetObject, %dType, %dLoc) {
if(%targetObject.getType() & ($TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType)) {
//Skip terrain and interiors
return;
}
if(!isObject(%source) || %source $= "") {
%SDB = "";
%sourceObject = 0;
%sourceClient = 0;
}
else {
%sourceDatablock = %source.getDatablock();
if(strStr(%sourceDatablock.getName(), "Projectile") != -1) {
%sourceObject = %source.sourceObject;
}
else {
%sourceObject = %source;
}
%sourceClient = %sourceObject.client;
if(isObject(%sourceObject)) {
%SDB = %sourceObject.getDatablock();
}
else {
%SDB = "";
}
}
%targetClient = %targetObject.client $= "" ? 0 : %targetObject.client;
%TDB = %targetObject.getDatablock();
//Proceed into object specific tests now...
//Killed by Vehicle.
if(strStr(%SDB.getClassName(), "Vehicle") != -1) {
if((%targetObject.getType() & ($TypeMasks::PlayerObjectType)) && %targetObject.getState() $= "dead") {
%pl = %sourceObject.getMountNodeObject(0); //the pilot
%cl = %pl.client;
if(%cl !$= "") {
if(%targetObject.client !$= "" && !%targetObject.isZombie && %targetObject.team != %pl.team) {
%cl.TWM2Core.PvPVehicleKills++;
if(%cl.TWM2Core.PvPVehicleKills >= 50) {
CompleteNWChallenge(%cl, "VehMans1");
if(%cl.TWM2Core.PvPVehicleKills >= 100) {
CompleteNWChallenge(%cl, "VehMans2");
if(%cl.TWM2Core.PvPVehicleKills >= 250) {
CompleteNWChallenge(%cl, "VehMans3");
}
}
}
}
UpdateVehicleKillFile(%cl, %SDB.getName());
//
if(%TDB $= "DemonMotherZombieArmor" && %SDB $= "CentaurVehicle") {
%cl.CDLKills++;
if(%cl.CDLKills >= 5) {
AwardClient(%cl, "19");
}
}
}
}
}
//Is there a boss going?
if(!%targetObject.isZombie && !%targetObject.isBossMinion) {
if($TWM2::BossGoing) {
//Chalk up the kill count :P
$TWM2::BossManager.addKill(%targetObject);
}
}
if(%targetObject.isVardisonMinion) {
$TWM2::VardisonManager.minionCount--;
}
//Game modes
if($TWM2::PlayingSabo) {
if(Game.Bomb.Carrier == %targetObject) {
if(%damageType == $DamageType::FellOff) {
MessageAll('msgWhoops', "\c5SABOTAGE: Bomb Reset.");
Game.BombDropped(Game.Bomb, %targetObject);
Game.bomb.setPosition($SabotageGame::BombLocation[$CurrentMission]);
}
else {
Game.BombDropped(Game.Bomb, %targetObject);
}
}
}
//Gore Mod On?
if($TWM2::UseGoreMod) {
CreateBlood(%targetObject);
}
//Rog Rapier Shield
if(%damageType == $DamageType::RapierShield) {
if(%sourceObject.client !$= "") {
UpdateWeaponKillFile(%sourceObject.client, "rapierShieldImage");
}
}
//Zombie Checks
if(%targetObject.isZombie) {
//Horde 3 Checks
if($TWM::PlayingHorde == 1) {
if($HordeGame::Zombiecount > 0) {
$HordeGame::Zombiecount--;
messageAll('MsgSPCurrentObjective1' ,"", "Wave "@$HordeGame::CurrentWave@" | Zombies Left: "@$HordeGame::Zombiecount@"");
}
if($HordeGame::Zombiecount <= 0) {
HordeNextWave($HordeGame::Game, $HordeGame::NextWave);
}
}
//Helljump Checks
if($TWM::PlayingHelljump == 1) {
if($HellJump::Zombiecount > 0) {
$HellJump::Zombiecount--;
messageAll('MsgSPCurrentObjective1' ,"", "[W"@$HellJump::CurrentWave@"|G"@$HellJump::CurrentGroup@"|S"@$HellJump::CurrentStrike@"] | Zombies Left: "@$HellJump::Zombiecount@"");
}
if($HellJump::Zombiecount <= 0) {
$HellJump::Game.GoNextStrike();
}
}
//TWM Infection / PvPz Checks
if(%targetObject.isPlayerZombie) {
%sourceClient.TWM2Core.PvPZombieKills++;
if(%sourceClient.TWM2Core.PvPZombieKills >= 100) {
CompleteNWChallenge(%sourceClient, "Defectionator1");
if(%sourceClient.TWM2Core.PvPZombieKills >= 250) {
CompleteNWChallenge(%sourceClient, "Defectionator2");
if(%sourceClient.TWM2Core.PvPZombieKills >= 500) {
CompleteNWChallenge(%sourceClient, "Defectionator3");
}
}
}
}
//Global Methods
Game.ZkillUpdateScore(%sourceClient, %sourceObject, %targetObject);
%sourceObject.zombiekillsinarow++;
DoZKillstreakChecks(%sourceClient);
}
//PvP Checks
else {
if(%targetObject.team != %sourceClient.team && !%targetObject.isBoss) {
if(isObject(%sourceClient) && %sourceClient.IsActivePerk("Double Down")) {
GainExperience(%sourceClient, $TWM2::KillXPGain * 2, "[D-D]Enemy Killed ");
}
else {
GainExperience(%sourceClient, $TWM2::KillXPGain, "Enemy Killed ");
}
//Zombie Kills Player
if(!%targetObject.isZombie && %sourceObject.isZombie) {
%sourceClient.TWM2Core.PvPHumanKills++;
if(%sourceClient.TWM2Core.PvPHumanKills >= 50) {
CompleteNWChallenge(%sourceClient, "Infectionator1");
if(%sourceClient.TWM2Core.PvPHumanKills >= 100) {
CompleteNWChallenge(%sourceClient, "Infectionator2");
if(%sourceClient.TWM2Core.PvPHumanKills >= 250) {
CompleteNWChallenge(%sourceClient, "Infectionator3");
}
}
}
}
else {
//Player Kills Player
%sourceClient.TWM2Core.PvPKills++;
if(%sourceClient.TWM2Core.PvPKills >= 100) {
CompleteNWChallenge(%sourceClient, "Slayer1");
if(%sourceClient.TWM2Core.PvPKills >= 250) {
CompleteNWChallenge(%sourceClient, "Slayer2");
if(%sourceClient.TWM2Core.PvPKills >= 500) {
CompleteNWChallenge(%sourceClient, "Slayer3");
if(%sourceClient.TWM2Core.PvPKills >= 750) {
CompleteNWChallenge(%sourceClient, "Slayer4");
if(%sourceClient.TWM2Core.PvPKills >= 1000) {
CompleteNWChallenge(%sourceClient, "Slayer5");
}
}
}
}
}
}
//Team Gain Perk
if(isObject(%sourceClient) && %sourceClient.IsActivePerk("Team Gain")) {
%TargetSearchMask = $TypeMasks::PlayerObjectType;
InitContainerRadiusSearch(%sourceObject.getPosition(), 20, %TargetSearchMask); //small distance
while ((%potentialTarget = ContainerSearchNext()) != 0){
if (%potentialTarget.getPosition() != %pos) {
if(%potentialTarget.client.team == %sourceClient.team && %potentialTarget != %sourceObject) {
GainExperience(%potentialTarget.client, $TWM2::KillXPGain, "Team Gain From "@%sourceClient.namebase@" ");
}
}
}
}
//Challenges, Successive Kills, Killstreaks
doChallengeCheck(%sourceClient, %targetClient);
%sourceObject.killsinarow++;
%sourceObject.killsinarow2++;
//TWM2 3.2 -> Successive Kills
%sourceObject.kills[%damageType]++;
PerformSuccessiveKills(%sourceObject, %damageType);
//
if(%sourceObject.killsinarow2 == 10 && !(%sourceObject.isBoss || %sourceObject.isZombie)) {
MessageAll('MsgWOW', "\c2TWM2: "@%sourceClient.namebase@" is on a killsteak of 10");
awardClient(%sourceClient, "14");
}
if(%sourceObject.killsinarow2 == 20 && !(%sourceObject.isBoss || %sourceObject.isZombie)) {
MessageAll('MsgWOW', "\c2TWM2: "@%sourceClient.namebase@" is on a killsteak of 20");
}
if(%sourceObject.killsinarow2 == 25 && !(%sourceObject.isBoss || %sourceObject.isZombie)) {
MessageAll('MsgWOW', "\c2TWM2: "@%sourceClient.namebase@" is on a killsteak of 25");
}
DoKillstreakChecks(%sourceClient);
}
}
//Record Challenge Kill
doChallengeKillRecording(%sourceObject, %targetObject);
//martydom
if(%targetClient !$= "" && %targetClient != 0 && %targetClient.IsActivePerk("Martydom")) {
serverPlay3d(SatchelChargeActivateSound, %targetObject.getPosition());
schedule(2200, 0, "MartydomExplode", %targetObject.getPosition(), %targetClient);
}
}
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@"");
}

View file

@ -1,939 +0,0 @@
//ScoreHudInventroy.cs
//Phantom139
//For TWM2, and other mods, A rework of the inventory system to be ran through the
//score menu, for easier use and classification of weapons, packs, and armors
//one can simply disable it through this G-Var
//$ScoreHudInventory::Active = 1;
package scoreHudInventory {
function DefaultGame::processGameLink(%game, %client, %arg1, %arg2, %arg3, %arg4, %arg5) {
%tag = $TagToUseForScoreMenu;
messageClient( %client, 'ClearHud', "", %tag, 1 );
//
switch$(%arg1) {
case "inventoryWindow":
%index = buildInventoryWindow(%client, %tag, %index);
return;
case "setScoreInv":
%subZone = %arg2;
switch$(%subZone) {
case "Armor":
%client.scoreHudInv[Armor] = %arg3;
case "Weapon":
//pull the current settings
%int = 1;
while(isSet(%client.scoreHudInv[Weapon, %int])) {
if(%client.scoreHudInv[Weapon, %int] $= %client.scoreHudInv[Weapon, %arg3]) {
%client.scoreHudInv[Weapon, %int] = "";
}
%int++;
}
%slot = %arg3;
%client.scoreHudInv[Weapon, %slot] = %arg4;
//now do a post set check
%xSlot = 1;
while(isSet(%client.scoreHudInv[Weapon, %xSlot])) {
//no two may co-exist, IE: be the same
%iSlot = 1;
while(isSet(%client.scoreHudInv[Weapon, %iSlot])) {
if(%client.scoreHudInv[Weapon, %iSlot] $= %client.scoreHudInv[Weapon, %xSlot]) {
if(%iSlot != %xSlot) {
//remove iSlot, proceed
%client.scoreHudInv[Weapon, %iSlot] = "";
}
}
%iSlot++;
}
%xSlot++;
}
case "Pistol":
%client.scoreHudInv[Pistol] = %arg3;
case "Melee":
%client.scoreHudInv[Melee] = %arg3;
case "Pack":
%client.scoreHudInv[Pack] = %arg3;
case "Grenade":
%client.scoreHudInv[Grenade] = %arg3;
case "Mine":
%client.scoreHudInv[Mine] = %arg3;
case "Ability":
%client.scoreHudInv[Ability] = %arg3;
default:
error("Unknown Call to setScoreInv: "@%arg2@"/"@%arg3@"/"@%arg4@"");
//
}
Game.processGameLink(%client, "inventoryWindow");
return;
}
parent::processGameLink(%game, %client, %arg1, %arg2, %arg3, %arg4, %arg5);
}
function pushScoreInventory(%client) {
messageClient(%client, 'OpenHud', "", 'scoreScreen' SPC "inventoryWindow");
messageClient(%client, 'CloseHud', "", 'inventoryScreen' SPC "inventoryScreen");
Game.processGameLink(%client, "inventoryWindow");
}
function InventoryScreen::updateHud( %this, %client, %tag ) {
if($ScoreHudInventory::Active == 1) {
pushScoreInventory(%client);
return;
}
else {
parent::updateHud( %this, %client, %tag );
}
}
function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice, %voicePitch ) {
Parent::onConnect( %client, %name, %raceGender, %skin, %voice, %voicePitch );
%client.scoreHudInv[Armor] = "Purebuild";
}
//modification to the game's inventory buy functions
function buyFavorites(%client) {
if($ScoreHudInventory::Active == 1) {
if(!isObject(%client.player)) {
return;
}
if(%client.player.isZombie) {
return;
}
if (%client.isJailed) {
return;
}
if (!%client.isAdmin && !%client.isSuperAdmin) {
if ($Host::Purebuild == 1) {
%client.scoreHudInv[Armor] = "Purebuild";
}
else {
if (%client.scoreHudInv[Armor] $= "Purebuild") {
%client.scoreHudInv[Armor] = "Scout";
}
}
}
// don't forget -- for many functions, anything done here also needs to be done
// below in buyDeployableFavorites !!!
%client.player.clearInventory();
%client.setWeaponsHudClearAll();
%cmt = $CurrentMissionType;
%curArmor = %client.player.getDatablock();
%curDmgPct = getDamagePercent(%curArmor.maxDamage, %client.player.getDamageLevel());
// armor
%client.armor = $NameToInv[%client.scoreHudInv[Armor]];
%client.player.setArmor( %client.armor );
%newArmor = %client.player.getDataBlock();
%client.player.setDamageLevel(%curDmgPct * %newArmor.maxDamage);
%weaponCount = 0;
DoPerksStuff(%client, %client.player);
//
// weapons
%armor = getArmorDatablock(%client, $NameToInv[%client.scoreHudInv[Armor]]);
%slotCount = %armor.MaxWeapons;
if(%client.IsActivePerk("OverKill") == 1) {
%slotCount++;
}
for(%i = 1; %i <= %slotCount; %i++) {
%inv = $NameToInv[%client.scoreHudInv[Weapon, %i]];
if( %inv !$= "" ) {
%weaponCount++;
%client.player.setInventory( %inv, 1 );
%WImg = %inv.Image;
if(%WImg.ClipName !$= "") { //apply clips
if(%client.IsActivePerk("Bandolier")) {
%client.player.ClipCount[%WImg.ClipName] = %WImg.InitialClips * 2;
}
else {
%client.player.ClipCount[%WImg.ClipName] = %WImg.InitialClips;
}
}
}
// z0dd - ZOD, 9/13/02. Streamlining.
if ( %inv.image.ammo !$= "" ) {
%client.player.setInventory( %inv.image.ammo, 400 );
}
}
%client.player.weaponCount = %weaponCount;
//
//pistol
%Pinv = $NameToInv[%client.scoreHudInv[Pistol]];
if( %Pinv !$= "" ) {
%client.player.setInventory( %Pinv, 1 );
%WImg = %Pinv.Image;
if(%WImg.ClipName !$= "") { //apply clips
if(%client.IsActivePerk("Bandolier")) {
%client.player.ClipCount[%WImg.ClipName] = %WImg.InitialClips * 2;
}
else {
%client.player.ClipCount[%WImg.ClipName] = %WImg.InitialClips;
}
}
}
if ( %Pinv.image.ammo !$= "" ) {
%client.player.setInventory( %Pinv.image.ammo, 400 );
}
//melee
%meleeinv = $NameToInv[%client.scoreHudInv[Melee]];
if( %meleeinv !$= "" ) {
%client.player.setInventory( %meleeinv, 1 );
}
//pack/deployable/ect/you get the point :P
%pCh = $NameToInv[%client.scoreHudInv[Pack]];
if(%pCh !$= "") {
%client.player.setInventory( %pCh, 1 );
// if this pack is a deployable that has a team limit, warn the purchaser
// if it's a deployable turret, the limit depends on the number of players (deployables.cs)
if (isDeployableTurret(%pCh)) {
%maxDep = countTurretsAllowed(%pCh);
}
else {
%maxDep = $TeamDeployableMax[%pCh];
}
if(%maxDep !$= "") {
%depSoFar = $TeamDeployedCount[%client.player.team, %pCh];
%packName = %client.favorites[%client.packIndex];
if(Game.numTeams > 1) {
%msTxt = "Your team has "@%depSoFar@" of "@%maxDep SPC %packName@"s deployed.";
}
else {
%msTxt = "You have deployed "@%depSoFar@" of "@%maxDep SPC %packName@"s.";
}
messageClient(%client, 'MsgTeamDepObjCount', %msTxt);
}
}
//
//Grenade
%nadeinv = $NameToInv[%client.scoreHudInv[Grenade]];
if( %nadeinv !$= "" ) {
%client.player.setInventory( %nadeinv, %armor.max[%nadeinv] );
}
//Mine
%Mineinv = $NameToInv[%client.scoreHudInv[Mine]];
if( %Mineinv !$= "" ) {
%client.player.setInventory( %Mineinv, %armor.max[%Mineinv] );
}
//
// miscellaneous stuff -- Repair Kit, Beacons, Targeting Laser
if ( !($InvBanList[%cmt, RepairKit]) )
%client.player.setInventory( RepairKit, 1 );
if ( !($InvBanList[%cmt, Beacon]) )
%client.player.setInventory( Beacon, 400 );
if ( !($InvBanList[%cmt, TargetingLaser]) )
%client.player.setInventory( TargetingLaser, 1 );
// ammo pack pass -- hack! hack!
if( %pCh $= "AmmoPack" ) {
invAmmoPackPass(%client);
}
// give admins the Super Chaingun
GiveTWM2Weapons(%client); //includes SW's and admin stuff
// TODO - temporary - remove
if (%client.forceArmor !$= "") {
%client.player.setArmor(%client.forceArmor);
}
}
else {
parent::buyFavorites(%client);
}
}
function buyDeployableFavorites(%client) {
if($ScoreHudInventory::Active == 1) {
if(%client.player.isZombie) {
return;
}
if (%client.isJailed) {
return;
}
if (!%client.isAdmin && !%client.isSuperAdmin) {
if ($Host::Purebuild == 1) {
%client.scoreHudInv[Armor] = "Purebuild";
}
else {
if (%client.scoreHudInv[Armor] $= "Purebuild") {
%client.scoreHudInv[Armor] = "Scout";
}
}
}
%player = %client.player;
%prevPack = %player.getMountedImage($BackpackSlot);
%player.clearInventory();
%client.setWeaponsHudClearAll();
%cmt = $CurrentMissionType;
// players cannot buy armor from deployable inventory stations
%armor = getArmorDatablock(%client, $NameToInv[%client.scoreHudInv[Armor]]);
%slotCount = %armor.MaxWeapons;
if(%client.IsActivePerk("OverKill") == 1) {
%slotCount++;
}
%weapCount = 0;
for(%i = 1; %i <= %slotCount; %i++) {
%inv = $NameToInv[%client.scoreHudInv[Weapon, %i]];
if (!($InvBanList[DeployInv, %inv])) {
%player.setInventory( %inv, 1 );
// increment weapon count if current armor can hold this weapon
if(%player.getDatablock().max[%inv] > 0) {
%weapCount++;
}
%WImg = %inv.Image;
if(%WImg.ClipName !$= "") { //apply clips
if(%client.IsActivePerk("Bandolier")) {
%client.player.ClipCount[%WImg.ClipName] = %WImg.InitialClips * 2;
}
else {
%client.player.ClipCount[%WImg.ClipName] = %WImg.InitialClips;
}
}
// z0dd - ZOD, 9/13/02. Streamlining
if ( %inv.image.ammo !$= "" ) {
%player.setInventory( %inv.image.ammo, 400 );
}
if(%weapCount >= %player.getDatablock().maxWeapons) {
break;
}
}
}
%player.weaponCount = %weapCount;
//Update Pistol
%inv = $NameToInv[%client.scoreHudInv[Pistol]];
if (!($InvBanList[DeployInv, %inv]) ) {
%player.setInventory( %inv, 1 );
%WImg = %inv.Image;
if(%WImg.ClipName !$= "") { //apply clips
if(%client.IsActivePerk("Bandolier")) {
%client.player.ClipCount[%WImg.ClipName] = %WImg.InitialClips * 2;
}
else {
%client.player.ClipCount[%WImg.ClipName] = %WImg.InitialClips;
}
}
// z0dd - ZOD, 9/13/02. Streamlining
if ( %inv.image.ammo !$= "" ) {
%player.setInventory( %inv.image.ammo, 400 );
}
}
//Update Melee
%meleeinv = $NameToInv[%client.scoreHudInv[Melee]];
if ( !($InvBanList[DeployInv, %meleeinv]) ) {
%player.setInventory( %meleeinv, 1 );
// z0dd - ZOD, 9/13/02. Streamlining
if ( %meleeinv.image.ammo !$= "" ) {
%player.setInventory( %meleeinv.image.ammo, 400 );
}
}
// give player the grenades and mines they chose, beacons, and a repair kit
%nadeinv = $NameToInv[%client.scoreHudInv[Grenade]];
if ( !($InvBanList[DeployInv, %nadeinv]) ) {
%player.setInventory( %nadeinv, 30 );
}
%mineinv = $NameToInv[%client.scoreHudInv[Mine]];
if ( !($InvBanList[DeployInv, %mineinv]) ) {
%player.setInventory( %mineinv, 30 );
}
if ( !($InvBanList[DeployInv, Beacon]) && !($InvBanList[%cmt, Beacon]) )
%player.setInventory( Beacon, 400 );
if ( !($InvBanList[DeployInv, RepairKit]) && !($InvBanList[%cmt, RepairKit]) )
%player.setInventory( RepairKit, 1 );
if ( !($InvBanList[DeployInv, TargetingLaser]) && !($InvBanList[%cmt, TargetingLaser]) )
%player.setInventory( TargetingLaser, 1 );
// pack - any changes here must be added to dep below!
// players cannot buy deployable station packs from a deployable inventory station
%packChoice = $NameToInv[%client.scoreHudInv[Pack]];
if ( !($InvBanList[DeployInv, %packChoice]) )
%player.setInventory( %packChoice, 1 );
// if this pack is a deployable that has a team limit, warn the purchaser
// if it's a deployable turret, the limit depends on the number of players (deployables.cs)
if (isDeployableTurret(%packChoice)) {
%maxDep = countTurretsAllowed(%packChoice);
}
else {
%maxDep = $TeamDeployableMax[%packChoice];
}
if((%maxDep !$= "") && (%packChoice !$= "InventoryDeployable")) {
%depSoFar = $TeamDeployedCount[%client.player.team, %packChoice];
%packName = %client.favorites[%client.packIndex];
if(Game.numTeams > 1) {
%msTxt = "Your team has "@%depSoFar@" of "@%maxDep SPC %packName@"s deployed.";
}
else {
%msTxt = "You have deployed "@%depSoFar@" of "@%maxDep SPC %packName@"s.";
}
messageClient(%client, 'MsgTeamDepObjCount', %msTxt);
}
if(%packChoice $= "AmmoPack") {
invAmmoPackPass(%client);
}
GiveTWM2Weapons(%client); //includes SW's and admin stuff
}
else {
Parent::buyDeployableFavorites(%client);
}
}
function getAmmoStationLovin(%client) {
if($ScoreHudInventory::Active == 1) {
//error("Much ammo station lovin applied");
%cmt = $CurrentMissionType;
// weapons
%counter = %client.player.weaponSlotCount;
if(%client.IsActivePerk("OverKill")) {
%counter++;
}
for(%i = 0; %i < %counter; %i++) {
%weapon = %client.player.weaponSlot[%i];
// z0dd - ZOD, 9/13/02. Streamlining
if ( %weapon.image.ammo !$= "" ) {
%client.player.setInventory( %weapon.image.ammo, 400 );
}
%WImg = %weapon.Image;
if(%WImg.ClipName !$= "") { //apply clips
if(%client.IsActivePerk("Bandolier")) {
%client.player.ClipCount[%WImg.ClipName] = %WImg.InitialClips * 2;
}
else {
%client.player.ClipCount[%WImg.ClipName] = %WImg.InitialClips;
}
}
}
// miscellaneous stuff -- Repair Kit, Beacons, Targeting Laser
if ( !($InvBanList[%cmt, RepairKit]) )
%client.player.setInventory( RepairKit, 1 );
if ( !($InvBanList[%cmt, Beacon]) )
%client.player.setInventory( Beacon, 400 );
if ( !($InvBanList[%cmt, TargetingLaser]) )
%client.player.setInventory( TargetingLaser, 1 );
%client.player.setInventory( Grenade, 0 );
%client.player.setInventory( ConcussionGrenade, 0 );
%client.player.setInventory( CameraGrenade, 0 );
%client.player.setInventory( FlashGrenade, 0 );
%client.player.setInventory( FlareGrenade, 0 );
// player should get the last type they purchased
%grenType = %client.player.lastGrenade;
// if the player hasnt been to a station they get regular grenades
if(%grenType $= "") {
//error("no gren type, using default...");
%grenType = Grenade;
}
if ( !($InvBanList[%cmt, %grenType]) )
%client.player.setInventory( %grenType, 30 );
if( %client.player.getMountedImage($BackpackSlot) $= "AmmoPack") {
invAmmoPackPass(%client);
}
}
else {
parent::getAmmoStationLovin(%client);
}
}
//End
//THIS FUNCTION HERE IS THE BRAINS OF THE SYSTEM
//APPLY ALL MAJOR EDITS HERE
function buildInventoryWindow(%client, %tag, %index) {
%client.SCMPage = "SM";
messageClient( %client, 'SetScoreHudSubheader', "", "INVENTORY" );
//Required vars
%cmt = $CurrentMissionType;
%sO = %client.TWM2Core;
%xpHas = %sO.xp;
%prestige = %sO.officer;
if(%sO.officer $= "") {
%sO.officer = 0;
%prestige = %sO.officer;
}
//
//fully customizable inventory system, separate, yet better
messageClient( %client, 'SetLineHud', "", %tag, %index, "Score Hud Inventory System: Version 1.0, By Phantom139");
%index++;
//* BEGIN ARMORS
messageClient( %client, 'SetLineHud', "", %tag, %index, "CURRENT ARMOR: "@%client.scoreHudInv[Armor]@"");
%index++;
//
messageClient( %client, 'SetLineHud', "", %tag, %index, "Select Armor: ");
%index++;
//build the armor list, 3 armors per line
for (%y = 0; $InvArmor[%y] !$= ""; %y++) {
if ($InvArmor[%y] !$= %client.scoreHudInv[Armor]) {
%armorList = %armorList TAB $InvArmor[%y];
}
}
if($TWM::PlayingInfection) {
%armorList = InfectionArmors(%client, %armorList);
}
else {
%armorList = updateArmorList(%client, %armorList);
}
//
%armors = getFieldCount(%armorList);
%arSC = 0;
for(%i = 0; %i < %armors; %i++) {
%armorString[%arSC] = %armorString[%arSC]@" * <a:gamelink\tsetScoreInv\tArmor\t"@getField(%armorList, %i)@">"@getField(%armorList, %i)@"</a>";
if(%i % 3 == 0) {
%arSC++;
}
}
//
%arCT = 0;
while(isSet(%armorString[%arCt])) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16>"@%armorString[%arCt]@"");
%index++;
%arCT++;
}
//* END ARMORS
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990099><Font:Arial Bold:24>* WEAPONS * ");
%index++;
//* BEGIN WEAPONS
// * Slot Count Determined by the armor, see this line :D
%armor = getArmorDatablock(%client, $NameToInv[%client.scoreHudInv[Armor]]);
%slotCount = %armor.MaxWeapons;
if(%client.IsActivePerk("OverKill") == 1) {
%slotCount++;
}
// EX: S3 Rifle - [Slot 1] * Slot 2 * Slot 3
%wepGroup = 0;
while(isSet($SHI::WeaponGroup[%wepGroup])) {
%weapCounter = 0;
%weap = 0;
while(isSet($InvWeapon[%weap])) {
if($SHI::BlockToClass[$NameToInv[$InvWeapon[%weap]]] $= $SHI::WeaponGroup[%wepGroup]) {
if(%armor.max[$NameToInv[$InvWeapon[%weap]]]) {
%weapCounter++;
}
}
%weap++;
}
if(%weapCounter >= 1) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:CC0099><Font:Arial Bold:18>* "@$SHI::WeaponGroup[%wepGroup]@" *");
%index++;
//
%weap = 0;
while(isSet($InvWeapon[%weap])) {
if($SHI::BlockToClass[$NameToInv[$InvWeapon[%weap]]] $= $SHI::WeaponGroup[%wepGroup]) {
%WInv = $NameToInv[$InvWeapon[%weap]];
if(%armor.max[%WInv]) {
if(%WInv.Image.RankRequire $= "") {
%xpNeed = 0;
}
else {
%xpNeed = $Ranks::MinPoints[%WInv.Image.RankRequire];
}
//
if(%WInv.Image.PrestigeRequire $= "") {
%prestigeNeed = 0;
}
else {
%prestigeNeed = %WInv.Image.PrestigeRequire;
}
//
if(%prestigeNeed $= "" || %prestigeNeed == 0) {
if(%xpNeed $= "" || %xpNeed == 0) {
if(%WInv.Image.MedalRequire) {
%canUse = DoMedalCheck(%client, %WInv.Image);
if(%canUse) {
%slotString = "";
for(%i = 1; %i <= %slotCount; %i++) {
if(%client.scoreHudInv[Weapon, %i] $= $InvWeapon[%weap]) {
%slotString = %slotString @" [SLOT "@%i@"]";
}
else {
%slotString = %slotString @" <a:gamelink\tsetScoreInv\tWeapon\t"@%i@"\t"@$InvWeapon[%weap]@">SLOT "@%i@"</a> ";
}
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16>"@$InvWeapon[%weap]@" - "@%slotString@"");
%index++;
}
}
else {
%slotString = "";
for(%i = 1; %i <= %slotCount; %i++) {
if(%client.scoreHudInv[Weapon, %i] $= $InvWeapon[%weap]) {
%slotString = %slotString @" [SLOT "@%i@"]";
}
else {
%slotString = %slotString @" <a:gamelink\tsetScoreInv\tWeapon\t"@(%i)@"\t"@$InvWeapon[%weap]@">SLOT "@%i@"</a> ";
}
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16>"@$InvWeapon[%weap]@" - "@%slotString@"");
%index++;
}
}
else {
if (%xpHas >= %xpNeed && (isSet(%WInv.Image.RankRequire) ? %client.TWM2Core.rankNumber >= %WInv.Image.RankRequire : true )){
if(%WInv.Image.MedalRequire) {
%canUse = DoMedalCheck(%client, %WInv.Image);
if(%canUse) {
%slotString = "";
for(%i = 1; %i <= %slotCount; %i++) {
if(%client.scoreHudInv[Weapon, %i] $= $InvWeapon[%weap]) {
%slotString = %slotString @" [SLOT "@%i@"]";
}
else {
%slotString = %slotString @" <a:gamelink\tsetScoreInv\tWeapon\t"@(%i)@"\t"@$InvWeapon[%weap]@">SLOT "@%i@"</a> ";
}
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16>"@$InvWeapon[%weap]@" - "@%slotString@"");
%index++;
}
}
else {
%slotString = "";
for(%i = 1; %i <= %slotCount; %i++) {
if(%client.scoreHudInv[Weapon, %i] $= $InvWeapon[%weap]) {
%slotString = %slotString @" [SLOT "@%i@"]";
}
else {
%slotString = %slotString @" <a:gamelink\tsetScoreInv\tWeapon\t"@(%i)@"\t"@$InvWeapon[%weap]@">SLOT "@%i@"</a> ";
}
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16>"@$InvWeapon[%weap]@" - "@%slotString@"");
%index++;
}
}
}
}
else {
if(%prestige >= %prestigeNeed) {
if(%xpNeed $= "" || %xpNeed == 0) {
if(%WInv.Image.MedalRequire) {
%canUse = DoMedalCheck(%client, %WInv.Image);
if(%canUse) {
%slotString = "";
for(%i = 1; %i <= %slotCount; %i++) {
if(%client.scoreHudInv[Weapon, %i] $= $InvWeapon[%weap]) {
%slotString = %slotString @" [SLOT "@%i@"]";
}
else {
%slotString = %slotString @" <a:gamelink\tsetScoreInv\tWeapon\t"@(%i)@"\t"@$InvWeapon[%weap]@">SLOT "@%i@"</a> ";
}
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16>"@$InvWeapon[%weap]@" - "@%slotString@"");
%index++;
}
}
else {
%slotString = "";
for(%i = 1; %i <= %slotCount; %i++) {
if(%client.scoreHudInv[Weapon, %i] $= $InvWeapon[%weap]) {
%slotString = %slotString @" [SLOT "@%i@"]";
}
else {
%slotString = %slotString @" <a:gamelink\tsetScoreInv\tWeapon\t"@(%i)@"\t"@$InvWeapon[%weap]@">SLOT "@%i@"</a> ";
}
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16>"@$InvWeapon[%weap]@" - "@%slotString@"");
%index++;
}
}
else {
if (%xpHas >= %xpNeed && (isSet(%WInv.Image.RankRequire) ? %client.TWM2Core.rankNumber >= %WInv.Image.RankRequire : true )){
if(%WInv.Image.MedalRequire) {
%canUse = DoMedalCheck(%client, %WInv.Image);
if(%canUse) {
%slotString = "";
for(%i = 1; %i <= %slotCount; %i++) {
if(%client.scoreHudInv[Weapon, %i] $= $InvWeapon[%weap]) {
%slotString = %slotString @" [SLOT "@%i@"]";
}
else {
%slotString = %slotString @" <a:gamelink\tsetScoreInv\tWeapon\t"@(%i)@"\t"@$InvWeapon[%weap]@">SLOT "@%i@"</a> ";
}
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16>"@$InvWeapon[%weap]@" - "@%slotString@"");
%index++;
}
}
else {
%slotString = "";
for(%i = 1; %i <= %slotCount; %i++) {
if(%client.scoreHudInv[Weapon, %i] $= $InvWeapon[%weap]) {
%slotString = %slotString @" [SLOT "@%i@"]";
}
else {
%slotString = %slotString @" <a:gamelink\tsetScoreInv\tWeapon\t"@(%i)@"\t"@$InvWeapon[%weap]@">SLOT "@%i@"</a> ";
}
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16>"@$InvWeapon[%weap]@" - "@%slotString@"");
%index++;
}
}
}
}
}
//}
}
}
%weap++;
}
}
%wepGroup++;
}
//* END WEAPONS
//* BEGIN PISTOL
if(!%client.IsActivePerk("OverKill")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990099><Font:Arial Bold:24>* PISTOL * ");
%index++;
for ( %y = 0; $InvPistol[%y] !$= ""; %y++ ) {
%PistolInv = $NameToInv[$InvPistol[%y]];
if(%PistolInv.Image.RankRequire $= "") {
%xpNeed = 0;
}
else {
%xpNeed = $Ranks::MinPoints[%PistolInv.Image.RankRequire];
}
//
if(%PistolInv.Image.PrestigeRequire $= "") {
%prestigeNeed = 0;
}
else {
%prestigeNeed = %PistolInv.Image.PrestigeRequire;
}
//
if(%PistolInv.Image.MedalRequire) {
%canUse = DoMedalCheck(%client, %PistolInv.Image);
}
else {
%canUse = 1;
}
if(%canUse) {
//XP Check Here
if(%prestige >= %prestigeNeed) {
if(%xpHas > %xpNeed && (isSet(%PistolInv.Image.RankRequire) ? %client.TWM2Core.rankNumber >= %PistolInv.Image.RankRequire : true )) {
if(%client.scoreHudInv[Pistol] $= $InvPistol[%y]) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16>["@$InvPistol[%y]@"]");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16><a:gamelink\tsetScoreInv\tPistol\t"@$InvPistol[%y]@">"@$InvPistol[%y]@"</a>");
%index++;
}
}
}
}
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990099><Font:Arial Bold:24>* PISTOL SLOT IS DISABLED -> OVERKILL PERK * ");
%index++;
}
//* END PISTOL
//* BEGIN MELEE
if(%client.scoreHudInv[Armor] !$= "Purebuild") {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990099><Font:Arial Bold:24>* MELEE * ");
%index++;
for ( %y = 0; $InvMelee[%y] !$= ""; %y++ ) {
%meleeInv = $NameToInv[$InvMelee[%y]];
if(%meleeInv.Image.MedalRequire) {
%canUse = DoMedalCheck(%client, %meleeInv.Image);
}
else {
%canUse = 1;
}
if(%canUse) {
if(%client.scoreHudInv[Melee] $= $InvMelee[%y]) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16>["@$InvMelee[%y]@"]");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16><a:gamelink\tsetScoreInv\tMelee\t"@$InvMelee[%y]@">"@$InvMelee[%y]@"</a>");
%index++;
}
}
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990099><Font:Arial Bold:24>* MELEE SLOT IS DISABLED -> PUREBUILD ARMOR * ");
%index++;
}
//* END MELEE
//* BEGIN PACK/DEPLOYABLE
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990099><Font:Arial Bold:24>* PACK * ");
%index++;
for ( %y = 0; $InvPack[%y] !$= ""; %y++ ) {
%PInv = $NameToInv[$InvPack[%y]];
if (%armor.max[%PInv] && !$InvBanList[%cmt, %PInv]) {
%packList = %packList TAB $InvPack[%y];
}
}
%packs = getFieldCount(%packList);
%arSC = 0;
for(%i = 0; %i < %packs; %i++) {
if(%client.scoreHudInv[Pack] $= getField(%packList, %i)) {
%packString[%arSC] = %packString[%arSC]@" * ["@getField(%packList, %i)@"]";
}
else {
%packString[%arSC] = %packString[%arSC]@" * <a:gamelink\tsetScoreInv\tPack\t"@getField(%packList, %i)@">"@getField(%packList, %i)@"</a>";
}
if(%i % 3 == 0) {
%arSC++;
}
}
//
%arCT = 0;
while(isSet(%packString[%arCt])) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16>"@%packString[%arCt]@"");
%index++;
%arCT++;
}
//
// messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tsetScoreInv\tPack\t"@$InvPack[%y]@">"@$InvPack[%y]@"</a>");
// %index++;
if(%client.scoreHudInv[Armor] $= "Purebuild") {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990099><Font:Arial Bold:24>* BUILDER PACK * ");
%index++;
//
for ( %y = 0; $InvDep[%y] !$= ""; %y++ ) {
%PInv = $NameToInv[$InvDep[%y]];
if (%armor.max[%PInv] && !$InvBanList[%cmt, %PInv]) {
%DepList = %DepList TAB $InvDep[%y];
}
}
%packs = getFieldCount(%DepList);
%arSC = 0;
for(%i = 0; %i < %packs; %i++) {
if(%client.scoreHudInv[Pack] $= getField(%DepList, %i)) {
%DepString[%arSC] = %DepString[%arSC]@" * ["@getField(%DepList, %i)@"]";
}
else {
%DepString[%arSC] = %DepString[%arSC]@" * <a:gamelink\tsetScoreInv\tPack\t"@getField(%DepList, %i)@">"@getField(%DepList, %i)@"</a>";
}
if(%i % 3 == 0) {
%arSC++;
}
}
//
%arCT = 0;
while(isSet(%DepString[%arCt])) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16>"@%DepString[%arCt]@"");
%index++;
%arCT++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990099><Font:Arial Bold:24>* BUILDER PACK IS DISABLED -> NON-PUREBUILD ARMOR * ");
%index++;
}
//* END PACK/DEPLOYABLE
//* BEGIN GRENADE
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990099><Font:Arial Bold:24>* GRENADE * ");
%index++;
for (%y = 0; $InvGrenade[%y] !$= ""; %y++) {
%GInv = $NameToInv[$InvGrenade[%y]];
if (%armor.max[%GInv] && !$InvBanList[%cmt, %GInv]) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16><a:gamelink\tsetScoreInv\tGrenade\t"@$InvGrenade[%y]@">"@$InvGrenade[%y]@"</a>");
%index++;
}
}
//* END GRENADE
//* BEGIN MINE
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990099><Font:Arial Bold:24>* MINE * ");
%index++;
for (%y = 0; $InvMine[%y] !$= ""; %y++) {
%MInv = $NameToInv[$InvMine[%y]];
if (%armor.max[%MInv] && !$InvBanList[%cmt, %MInv]) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<Font:Arial Bold:16><a:gamelink\tsetScoreInv\tMine\t"@$InvMine[%y]@">"@$InvMine[%y]@"</a>");
%index++;
}
}
//* END MINE
//* BEGIN ABILITY
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990099><Font:Arial Bold:24>* ARMOR ABILITY * ");
%index++;
//* END ABILITY
//* SAVE SLOTS
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990099><Font:Arial Bold:24>* SAVE SETTINGS * ");
%index++;
//
return %index;
}
};
deactivatePackage(scoreHudInventory);
activatePackage(scoreHudInventory);
//SHI -> Score Hud Inventory
//New Inventory List Functions
//All Inventory itself is still handled by inventoryHud.cs
$SHI::WeaponGroup[0] = "Rifles";
$SHI::WeaponGroup[1] = "Sniper Rifles";
$SHI::WeaponGroup[2] = "SMGs";
$SHI::WeaponGroup[3] = "MGs";
$SHI::WeaponGroup[4] = "Shotguns";
$SHI::WeaponGroup[5] = "Explosives";
$SHI::WeaponGroup[6] = "Other";
$SHI::WeaponGroup[7] = "Construction";
//
$SHI::BlockToClass[S3Rifle] = "Rifles";
$SHI::BlockToClass[G41Rifle] = "Rifles";
$SHI::BlockToClass[M4A1] = "Rifles";
$SHI::BlockToClass[lasergun] = "Rifles";
$SHI::BlockToClass[ShadowRifle] = "Rifles";
$SHI::BlockToClass[IonRifle] = "Rifles";
$SHI::BlockToClass[PulseRifle] = "Rifles";
$SHI::BlockToClass[G17SniperRifle] = "Sniper Rifles";
$SHI::BlockToClass[M1SniperRifle] = "Sniper Rifles";
$SHI::BlockToClass[R700SniperRifle] = "Sniper Rifles";
$SHI::BlockToClass[ALSWPSniperRifle] = "Sniper Rifles";
$SHI::BlockToClass[MP26] = "SMGs";
$SHI::BlockToClass[Pg700] = "SMGs";
$SHI::BlockToClass[MiniChaingun] = "SMGs";
$SHI::BlockToClass[P90] = "SMGs";
$SHI::BlockToClass[PulseSMG] = "SMGs";
$SHI::BlockToClass[RP432] = "MGs";
$SHI::BlockToClass[MRXX] = "MGs";
$SHI::BlockToClass[MG42] = "MGs";
$SHI::BlockToClass[M1700] = "Shotguns";
$SHI::BlockToClass[Wp400] = "Shotguns";
$SHI::BlockToClass[SA2400] = "Shotguns";
$SHI::BlockToClass[SCD343] = "Shotguns";
$SHI::BlockToClass[Model1887] = "Shotguns";
$SHI::BlockToClass[MissileLauncher] = "Explosives";
$SHI::BlockToClass[Stinger] = "Explosives";
$SHI::BlockToClass[Javelin] = "Explosives";
$SHI::BlockToClass[RPG] = "Explosives";
$SHI::BlockToClass[PlasmaTorpedo] = "Explosives";
$SHI::BlockToClass[IonLauncher] = "Other";
$SHI::BlockToClass[flamer] = "Other";
$SHI::BlockToClass[ConcussionGun] = "Other";
$SHI::BlockToClass[MiniColliderCannon] = "Other";
$SHI::BlockToClass[ConstructionTool] = "Construction";
$SHI::BlockToClass[MergeTool] = "Construction";
$SHI::BlockToClass[EditTool] = "Construction";
$SHI::BlockToClass[EditorGun] = "Construction";

View file

@ -1,572 +0,0 @@
//Store.cs
//Phantom139, TWM2 3.6
//Handles all operations with client mula.
$Store::Item["ArmorEffect", 0] = "Fireworks\t750000\tOn death, sends out a burst of red flares.";
$Store::Item["ArmorEffect", 1] = "False Explosion\t1250000\tAn explosion so real, but so false.";
$Store::Item["ArmorEffect", 2] = "Thunderstorm\t2000000\tEmit a great deal of sparks from your armor.";
$Store::Item["ArmorEffect", 3] = "Spontaneous Combustion\t3000000\tIt almost appears that you are always on fire.";
$Store::Item["ArmorEffect", 4] = "Guardian Flare\t5000000\tA glimmer of light, that follows you around.";
$Store::Item["ArmorEffect", 5] = "Hologram\t10000000\tMislead chasers with false player images.";
//
$Store::Item["ArmorFlag", 0] = "Silver Flag\t5\t0\tShines in the light of day.";
$Store::Item["ArmorFlag", 1] = "Blue Flag\t7\t0\tBlue as the sky, cold as snow.";
$Store::Item["ArmorFlag", 2] = "Red Flag\t8\t0\tHonor the call of battle, and show your pride.";
$Store::Item["ArmorFlag", 3] = "Gold Flag\t9\t0\tTime and dedication shows your honor.";
function GameConnection::storeCreate(%client) {
%name = "Container_"@%client.guid@"/ClientStore"@%client.guid;
%check = nameToID(%name);
if(isObject(%check)) {
%client.store = %check;
%client.store.nextSlot = 0;
%client.store.nextLoto = 0;
echo("* Applying Client Store.");
}
else {
%client.store = new ScriptObject("ClientStore"@%client.guid) {
nextSlot = 0;
nextLoto = 0;
};
%client.container.add(%client.store);
echo("* Creating Client Store");
}
}
//Store Operations
function GameConnection::showCentralStore(%client, %index, %tag) {
messageClient( %client, 'SetScoreHudSubheader', "", "Central Store" );
%client.SCMPage = "SM";
//
messageClient( %client, 'SetLineHud', "", %tag, %index, "Current Money: $"@%client.TWM2Core.money@"");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "================================");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "= SELECT AN OPTION =");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "================================");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tStore\tArmorEffect> * Armor Effects</a>");
%index++;
if(%client.TWM2Core.officer >= 5) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tStore\tArmorFlag> * Armor Flags</a>");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, " * Armor Flags (Unlocked At 'Surpreme' Officer Level)");
%index++;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "================================");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tStore\tSlotMachine> * Slot Machine</a>");
%index++;
//messageClient( %client, 'SetLineHud', "", %tag, %index, " * Bounties");
//%index++; //Maybe some other time *Phantom
messageClient( %client, 'SetLineHud', "", %tag, %index, "================================");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
%index++;
//
return %index;
}
function GameConnection::showArmorEffectsPage(%client, %index, %tag) {
messageClient( %client, 'SetScoreHudSubheader', "", "Central Store" );
%client.SCMPage = "SM";
//
messageClient( %client, 'SetLineHud', "", %tag, %index, "Current Money: $"@%client.TWM2Core.money@"");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "================================");
%index++;
//
%effectIndex = 0;
while(isSet($Store::Item["ArmorEffect", %effectIndex])) {
if(%client.getActiveAE() $= getField($Store::Item["ArmorEffect", %effectIndex], 0)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, ""@getField($Store::Item["ArmorEffect", %effectIndex], 0)@" [ACTIVE]");
%index++;
}
else {
if(%client.hasStoreItem(getField($Store::Item["ArmorEffect", %effectIndex], 0))) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tArmorEffect\t"@getField($Store::Item["ArmorEffect", %effectIndex], 0)@">"@getField($Store::Item["ArmorEffect", %effectIndex], 0)@"</a> - "@getField($Store::Item["ArmorEffect", %effectIndex], 2)@"");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tBuyArmorEffect\t"@%effectIndex@">"@getField($Store::Item["ArmorEffect", %effectIndex], 0)@"</a>[$"@getField($Store::Item["ArmorEffect", %effectIndex], 1)@"] - "@getField($Store::Item["ArmorEffect", %effectIndex], 2)@"");
%index++;
}
}
%effectIndex++;
}
//
if(%client.getActiveAE() !$= "none") {
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tArmorEffect\t0>Disable Armor Effect</a>');
%index++;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
%index++;
return %index;
}
function GameConnection::showArmorFlagPage(%client, %index, %tag) {
messageClient( %client, 'SetScoreHudSubheader', "", "Central Store" );
%client.SCMPage = "SM";
//
messageClient( %client, 'SetLineHud', "", %tag, %index, "Current Money: $"@%client.TWM2Core.money@"");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "================================");
%index++;
//
%flagIndex = 0;
while(isSet($Store::Item["ArmorFlag", %flagIndex])) {
if(%client.flagType $= trim(getWord(getField($Store::Item["ArmorFlag", %flagIndex], 0), 0))) {
messageClient( %client, 'SetLineHud', "", %tag, %index, ""@getField($Store::Item["ArmorFlag", %flagIndex], 0)@" [ACTIVE]");
%index++;
}
else {
if(%client.hasStoreItem(getField($Store::Item["ArmorFlag", %flagIndex], 0))) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tArmorFlag\t"@getField($Store::Item["ArmorFlag", %flagIndex], 0)@">"@getField($Store::Item["ArmorFlag", %flagIndex], 0)@"</a> - "@getField($Store::Item["ArmorFlag", %flagIndex], 3)@"");
%index++;
}
else {
if(%client.TWM2Core.officer < getField($Store::Item["ArmorFlag", %flagIndex], 1)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, ""@getField($Store::Item["ArmorFlag", %flagIndex], 0)@" - Higher Officer Rank Required.");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tBuyArmorFlag\t"@%flagIndex@">"@getField($Store::Item["ArmorFlag", %flagIndex], 0)@"</a>[$"@getField($Store::Item["ArmorFlag", %flagIndex], 2)@"] - "@getField($Store::Item["ArmorFlag", %flagIndex], 3)@"");
%index++;
}
}
}
%flagIndex++;
}
//
if(%client.useFlag != 0) {
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tArmorFlag\t0>Disable Armor Flag</a>');
%index++;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
%index++;
return %index;
}
//ARMOR EFFECTS
function GameConnection::hasStoreItem(%client, %item) {
%item = strReplace(%item, " ", "");
if(!isSet(%client.store.purchased[%item])) {
%client.store.purchased[%item] = 0;
}
return %client.store.purchased[%item];
}
function GameConnection::getActiveAE(%client) {
%e = %client.activeArmorEffect;
if(!isSet(%e)) {
return "none";
}
return %e;
}
function GameConnection::setActiveAE(%client, %effect) {
//
if(%effect $= "0") {
%client.activeArmorEffect = "";
return;
}
//
if(!%client.hasStoreItem(%effect)) {
messageClient(%client, 'msgFail', "\c3Error: You do not have this armor effect");
%client.activeArmorEffect = "";
return;
}
//
else {
%client.activeArmorEffect = %effect;
switch$(%effect) {
case "Thunderstorm":
ThunderstormLoop(%client);
case "Spontaneous Combustion":
SpontaniousLoop(%client);
case "Guardian Flare":
createGuardianFlare(%client);
case "Hologram":
DoHologramLoop(%client);
default:
//unknown, or nothing needed
}
}
}
function GameConnection::setActiveAF(%client, %flag) {
if(%flag $= "0") {
%client.flagType = "";
%client.useFlag = 0;
return;
}
//
if(!%client.hasStoreItem(%flag)) {
messageClient(%client, 'msgFail', "\c3Error: You do not have this armor flag");
%client.flagType = "";
%client.useFlag = 0;
return;
}
else {
switch$(%flag) {
case "Silver Flag":
%client.flagType = "Silver";
%client.useFlag = 1;
case "Blue Flag":
%client.flagType = "Blue";
%client.useFlag = 1;
case "Red Flag":
%client.flagType = "Red";
%client.useFlag = 1;
case "Gold Flag":
%client.flagType = "Gold";
%client.useFlag = 1;
default:
%client.flagType = "";
%client.useFlag = 0;
}
}
}
//this is called when someone dies.
function GameConnection::playDeathArmorEffect(%client) {
switch$(%client.getActiveAE()) {
case "none":
return; //stop here
case "Fireworks":
DeathEffect_Fireworks(%client.player.getPosition());
case "False Explosion":
DeathEffect_FalseExpl(%client.player.getPosition());
}
}
//* FIREWORKS
//* $750,000
//* A bright explosion of Red Flares when you die
datablock FlareProjectileData(FireworksRedFlareProj) {
projectileShapeName = "grenade_projectile.dts";
emitterDelay = -1;
directDamage = 0.0;
hasDamageRadius = false;
kickBackStrength = 1500;
useLensFlare = false;
sound = FlareGrenadeBurnSound;
explosion = FlareGrenadeExplosion;
velInheritFactor = 0.5;
texture[0] = "special/flare3";
texture[1] = "special/LensFlare/flare00";
size = 4.0;
baseEmitter = FlareEmitter;
grenadeElasticity = 0.35;
grenadeFriction = 0.2;
armingDelayMS = 6000;
muzzleVelocity = 15.0;
drag = 0.1;
gravityMod = 0.15;
};
datablock FlareProjectileData(GuardianFlare) {
projectileShapeName = "grenade_projectile.dts";
emitterDelay = -1;
directDamage = 0.0;
hasDamageRadius = false;
kickBackStrength = 1500;
useLensFlare = false;
sound = FlareGrenadeBurnSound;
explosion = FlareGrenadeExplosion;
velInheritFactor = 0.5;
texture[0] = "special/flare3";
texture[1] = "special/LensFlare/flare00";
size = 4.0;
baseEmitter = FlareEmitter;
grenadeElasticity = 0.35;
grenadeFriction = 0.2;
armingDelayMS = 100;
muzzleVelocity = 15.0;
drag = 0.1;
gravityMod = 0.15;
};
function DeathEffect_Fireworks(%position) {
for(%i = 0; %i < getRandom(15, 25); %i++) {
%dir = vectorAdd(getRandomPosition(1, 0), "0 0 2"); //all up
%fW = new (FlareProjectile)() {
datablock = FireworksRedFlareProj;
initialPosition = %position;
initialDirection = %dir;
};
MissionCleanup.add(%fW);
}
}
//* FALSE EXPLOSION
//* $1,250,000
//* A detonation that looks so real, you won't believe it's not
function DeathEffect_FalseExpl(%position) {
%c4 = new Item() {
datablock = C4Deployed;
position = %position;
scale = ".1 .1 .1";
};
MissionCleanup.add(%c4);
%c4.isFalse = 1;
schedule(500, 0, "C4GoBoom", %c4);
}
//* Thunderstorm
//* $2,000,000
//* Sparks fly in all directions from your active armor
function ThunderstormLoop(%client) {
%player = %client.player;
if(!%player.isAlive() || %client.getActiveAE() !$= "Thunderstorm") {
return;
}
%c = createEmitter(%player.position, PBCExpEmitter, "1 0 0"); //Rotate it
%c.schedule(150, "Delete");
schedule(getRandom(1300, 2500), 0, "ThunderstormLoop", %client);
}
//* Spontaneous Combustion
//* $3,000,000
//* It almost appears that you are on fire... always
function SpontaniousLoop(%client) {
%player = %client.player;
if(!%player.isAlive() || %client.getActiveAE() !$= "Spontaneous Combustion") {
return;
}
%fire = new ParticleEmissionDummy(){
position = %player.getPosition();
dataBlock = "defaultEmissionDummy";
emitter = "BurnEmitter";
};
MissionCleanup.add(%fire);
%fire.schedule(250, "delete");
schedule(250, 0, "SpontaniousLoop", %client);
}
//* Guardian Flare
//* $5,000,000
//* This beacon of light follows you around at all times.
function createGuardianFlare(%client) {
%player = %client.player;
if(!%player.isAlive() || %client.getActiveAE() !$= "Guardian Flare") {
return;
}
%flare = new (FlareProjectile)() {
dataBlock = GuardianFlare;
initialDirection = "0 0 3";
initialPosition = vectorAdd(%player.getPosition(), "0 0 5");
sourceObject = %player;
sourceSlot = 0;
};
MissionCleanup.add(%flare);
%flare.PhotonMuzVec = %player.getMuzzleVector(0);
schedule( 100, 0, "guardianFlare", %player, %flare);
}
function guardianFlare(%player, %flare) {
%projpos = %flare.position;
%projdir = %flare.initialdirection;
%type = %player.getClassName();
if(!isobject(%flare)) {
return;
}
if(isobject(%flare)) {
%flare.delete();
}
if(!%player.isAlive() || %player.client.getActiveAE() !$= "Guardian Flare") {
return;
}
//( ... )the projs now have a max turn angle like real missile ub3r l33t;;;; nm wtf afasdf
%test = getWord(%projdir, 0);
%test2 = getWord(%projdir, 1);
%test3 = getWord(%projdir, 2);
%projdir = vectornormalize(vectorsub(%player.position, %projpos));
%testa = getWord(%projdir, 0);
%testa2 = getWord(%projdir, 1);
%testa3 = getWord(%projdir, 2);
// now it's time for my mad math skills..... i used microsoft calculator to figure this one out =0... was a brainbuster for me to think of how this would work
%testthing = %test - %testa; //oh u can rename all this test stuff but make sure u get it right =/ dont break plz
%testfin = %testthing / 10; //!!!!!!!!!! OK HERE!!!! is where the max angle thing is... increase for lower turn angle and reduce for a higher turn angle
%testfinal = %testfin * -1; //^^^^^ *side note for the one above this* dont div by zero unless yer dumb (...) div by i think 1 if you want it to seek with a 360 max turn angle angle... kinda gay though if u do that
%testfinale = %testfinal + %test;
%testthing2 = %test2 - %testa2;
%testfin2 = %testthing2 / 10; //change here too .. this is for the y axis btw it's best if u leave my setting of 10 on ... it's the most balanced well nm change it to what u want but you really should leave it around this number like 9ish
%testfinal2 = %testfin2 * -1;
%testfinale2 = %testfinal2 + %test2;
%testthing3 = %test3 - %testa3;
%testfin3 = %testthing3 / 20; //z- axis this one is for i think.. mmm idea... you try playing with dif max angles for xyz for maybe like a sidewinder effect =?
%testfinal3 = %testfin3 * -1;
%testfinale3 = %testfinal3 + %test3;
%haxordir = %testfinale SPC %testfinale2 SPC %testfinale3; //final dir.. .....
%flare = new (FlareProjectile)() {
dataBlock = GuardianFlare;
initialDirection = %haxordir;
initialPosition = %projpos;
sourceslot = %player;
};
%flare.sourceobject = %player;
MissionCleanup.add(%flare);
%flare.seeksched = schedule(100, 0, "guardianFlare", %player, %flare);
}
//* Hologram
//* $10,000,000
//* False player images follow your every move.
function doHologramLoop(%client) {
if(%client.player.IsAlive() && %client.getActiveAE() $= "Hologram") {
%race = %client.race;
if(%race $= "Bioderm") {
createBiodermProjection(%client.player);
}
else {
createHumanProjection(%client.player);
}
//schedule next hologram
schedule(1250, 0, "doHologramLoop", %client);
}
}
//******************************************************************************
function GameConnection::loadSlotMachine(%client, %index, %tag) {
if(getSimTime() < %client.store.nextSlot) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "You are currently locked out of the slot machine, try back later.");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tStore>Return To Store</a>');
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "***************************");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "** LINE EM UP BONUS SLOT **");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "** LINE UP 3 TO SCORE **");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "** THREE SEVENS BONUS **");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "***************************");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tSlotMachine>[$50] PLAY MACHINE</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tStore>Return To Store</a>');
%index++;
}
return %index;
}
function GameConnection::generateSlotMachineRoll(%client, %index, %tag) {
%client.TWM2Core.money -= 50; //start cost
for(%i = 1; %i <= 9; %i++) {
%roll[%i] = getRandom(1, 7);
%rollStr = %rollStr TAB %roll[%i];
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "* "@%roll[1]@" == "@%roll[2]@" == "@%roll[3]@" *");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "* "@%roll[4]@" == "@%roll[5]@" == "@%roll[6]@" *");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "* "@%roll[7]@" == "@%roll[8]@" == "@%roll[9]@" *");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "***************************");
%index++;
//
%client.TWM2Core.money += getSlotWinnings(%rollStr);
messageClient( %client, 'SetLineHud', "", %tag, %index, "* WINNINGS: $"@getSlotWinnings(%rollStr)@"");
%index++;
//
%client.store.nextSlot = getSimTime() + 25000; //25 seconds between runs
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tStore>Return To Store</a>');
%index++;
return %index;
}
function getSlotWinnings(%string) {
%winning = 0;
//tear the string
for(%i = 0; %i < getFieldCount(%string); %i++) {
%roll[%i+1] = getField(%string, %i);
}
//check for winning spins
for(%x = 1; %x <= 3; %x++) {
%one = ((%x-1)*3) + 1;
%two = ((%x-1)*3) + 2;
%three = ((%x-1)*3) + 3;
//*FIRST CASE: FULL CROSS: 5 5 5
if(%roll[%one] $= %roll[%two] && %roll[%two] $= %roll[%three]) {
%winning += 100;
if(%roll[%one] $= "7" && %roll[%two] $= "7" && %roll[%three] $= "7") {
//jackpot !
%winning += 9000;
}
}
}
//*SECOND CASE: Cross Diagonal X
//Only two possiblities here, I'll just if it.
if(%roll[1] $= %roll[5] && %roll[5] $= %roll[9]) {
%winning += 500;
if(%roll[1] $= "7" && %roll[5] $= "7" && %roll[9] $= "7") {
%winning += 45000;
}
}
if(%roll[3] $= %roll[5] && %roll[5] $= %roll[7]) {
%winning += 500;
if(%roll[3] $= "7" && %roll[5] $= "7" && %roll[7] $= "7") {
%winning += 45000;
}
}
//
return %winning;
}
//******************************************************************************

View file

@ -14,11 +14,9 @@ function GetWeaponChallenges(%Image, %number) {
function UpdateVehicleKillFile(%client, %VDB) {
if(%VDB $= "") { //Phantom139: Ha!! No more invalid Files!!!
//echo("No Vehicle Datablock");
return;
}
if(%client $= "") { //Phantom139: Ha! No More UE on Invalid File
//echo("No Client");
return;
}
%file = ""@$TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave";
@ -158,7 +156,7 @@ function GenerateCompletedChallegnesMenu(%client, %tag, %index) {
%Image = %db.getName().image;
if(%Image.HasChallenges) {
if(DoMedalCheck(%client, %image) == 1 && CanUseRankedWeapon(%image, %client) == 1) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tCompletedSub\t"@%Image@"\t1>"@%Image.GunName@"</a>");
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tWeaponUpgradesSub\t"@%Image@"\t1>"@%Image.GunName@"</a>");
%index++;
}
else {
@ -234,11 +232,11 @@ function GenerateWChallengeSubMenu(%client, %tag, %index, %image) {
%taskReq = getField(%Field, 1);
//
if(!%client.CheckChallengeCompletion(%image, %i)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, ""@%taskName@" - Need: "@%taskReq@"");
messageClient( %client, 'SetLineHud', "", %tag, %index, ""@%taskName@" - Earn "@%taskReq@" Kills with this weapon");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, ""@%taskName@" - Complete");
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>"@%taskName@" - Earn "@%taskReq@" Kills with this weapon");
%index++;
}
}

View file

@ -749,7 +749,7 @@ function HailStones(%strength) {
return;
}
for(%i = 0; %i < %strength; %i++) {
%pos = RMPG();
%pos = TWM2Lib_MainControl("RMPG");
%spawn = vectorAdd(%pos, "0 0 300");
%hail = new LinearProjectile() {
datablock = HailProjectile;
@ -1021,8 +1021,8 @@ function TornadicLoop(%maximum_move, %starting_position, %vector_move, %counter)
//cause random is epic :D
function RandomTornado() {
%spawn = RMPG();
%end = RMPG();
%spawn = TWM2Lib_MainControl("RMPG");
%end = TWM2Lib_MainControl("RMPG");
// begin
CreateTornado(%spawn, %end);
}

View file

@ -19,120 +19,40 @@ function ConstructionGame::updateScoreHud(%game, %client, %tag){
}
function ConstructionGame::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
%scriptController = %client.TWM2Core;
echo("[F2] "@%client.namebase@": "@%arg1@", "@%arg2@", "@%arg3@", "@%arg4@", "@%arg5@".");
switch$ (%arg1)
{
%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
%scriptController = %client.TWM2Core;
echo("[F2] "@%client.namebase@": "@%arg1@", "@%arg2@", "@%arg3@", "@%arg4@", "@%arg5@".");
switch$ (%arg1) {
case "GTP":
scoreCmdMainMenu(%game,%client,$TagToUseForScoreMenu,%arg2);
%client.SCMPage = %arg2;
return;
//***********************************************************************
//* TWM STORE
case "Store":
%dept = %arg2;
if(!isSet(%dept)) {
%index = %client.showCentralStore(%index, %tag);
}
else {
switch$(%dept) {
case "ArmorEffect":
%index = %client.showArmorEffectsPage(%index, %tag);
case "ArmorFlag":
%index = %client.showArmorFlagPage(%index, %tag);
case "SlotMachine":
%index = %client.loadSlotMachine(%index, %tag);
default:
%index = %client.showCentralStore(%index, %tag);
}
}
return;
case "ArmorEffect":
%effect = %arg2;
%client.setActiveAE(%effect);
%game.schedule(100, "processGameLink", %client, "Store", "ArmorEffect");
return;
case "BuyArmorEffect":
%effectIndex = %arg2;
%money = %client.TWM2Core.money;
if(%money >= getField($Store::Item["ArmorEffect", %effectIndex], 1)) {
%client.TWM2Core.money -= getField($Store::Item["ArmorEffect", %effectIndex], 1);
%item = strReplace(getField($Store::Item["ArmorEffect", %effectIndex], 0), " ", "");
%client.store.purchased[%item] = 1;
SaveClientFile(%client);
messageClient( %client, 'SetLineHud', "", %tag, %index, "Armor Effect Purchased.");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Insufficient Funds To Purchase.");
%index++;
}
%game.schedule(1000, "processGameLink", %client, "Store", "ArmorEffect");
return;
case "ArmorFlag":
%flag = %arg2;
%client.setActiveAF(%flag);
%game.schedule(100, "processGameLink", %client, "Store", "ArmorFlag");
return;
case "BuyArmorFlag":
%flagIndex = %arg2;
%money = %client.TWM2Core.money;
if(%money >= getField($Store::Item["ArmorFlag", %flagIndex], 2)) {
%client.TWM2Core.money -= getField($Store::Item["ArmorFlag", %flagIndex], 2);
%item = strReplace(getField($Store::Item["ArmorFlag", %flagIndex], 0), " ", "");
%client.store.purchased[%item] = 1;
SaveClientFile(%client);
messageClient( %client, 'SetLineHud', "", %tag, %index, "Armor Flag Purchased.");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Insufficient Funds To Purchase.");
%index++;
}
%game.schedule(1000, "processGameLink", %client, "Store", "ArmorFlag");
return;
case "SlotMachine":
%money = %client.TWM2Core.money;
if(%money < 50) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "You cannot play the slot machine.");
%index++;
%game.schedule(1000, "processGameLink", %client, "Store", "");
return;
}
%index = %client.generateSlotMachineRoll(%index, %tag);
return;
//*****************************************************************************
case "OrderMisSub":
%client.SCMPage = "SM";
messageClient( %client, 'SetScoreHudSubheader', "", "Missions" );
if(getCurrentEXP(%client) < $Ranks::MinPoints[59] && %scriptController.officer < 1) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "You must have the 'Commanding Officer' Rank To Order Missions.");
messageClient( %client, 'SetScoreHudSubheader', "", "Operations" );
if(getCurrentEXP(%client) < $Ranks::MinPoints[49] && %scriptController.officer < 1) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "You must have the 'General' Rank To Order Operations.");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Order A Mission, Select a Mission");
messageClient( %client, 'SetLineHud', "", %tag, %index, "Select an Operation");
%index++;
%xI = 0;
while(isSet($Mission::TWM2Mision[%xI])) {
@ -147,16 +67,6 @@ switch$ (%arg1)
}
%xI++;
}
//messageClient( %client, 'SetLineHud', "", %tag, %index, '<font:arial:14><a:gamelink\tOrderMis\tRainDown\t1>Rain Down</a> - 3:00/Gunship Support [1P]');
//%index++;
//messageClient( %client, 'SetLineHud', "", %tag, %index, '<font:arial:14><a:gamelink\tOrderMis\tEnemyAc130Above\t1>Enemy AC-130 Above!</a> - 15:00/Survival-Escape Mission [3P]');
//%index++;
//messageClient( %client, 'SetLineHud', "", %tag, %index, '<font:arial:14><a:gamelink\tOrderMis\tSurrounded\t1>Surrounded!</a> - 5:00/Survival Mission [6P]');
//%index++;
//messageClient( %client, 'SetLineHud', "", %tag, %index, '<font:arial:16>[NEW]<font:arial:14><a:gamelink\tOrderMis\tSurrounded\t1>Surrounded 2.0!</a> - 10:00/Survival Mission [6P]');
//%index++;
//messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tOrderMis\tTheShallowedCity\t1>The Shallowed City</a> - 10:00/City Assault [4P/2R]');
//%index++;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Return To Main Menu</a>');
%index++;
@ -167,13 +77,13 @@ switch$ (%arg1)
%task = %arg3;
switch(%task) {
case 1:
messageClient( %client, 'SetLineHud', "", %tag, %index, "Mission: "@getField($Mission::VarSet[""@%mission@"", "TaskDetails"], 0)@"");
messageClient( %client, 'SetLineHud', "", %tag, %index, "Operation: "@getField($Mission::VarSet[""@%mission@"", "TaskDetails"], 0)@"");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Details: "@getField($Mission::VarSet[""@%mission@"", "TaskDetails"], 1)@"");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Difficulty: "@$Mission::VarSet[""@%mission@"", "Difficulty"]@"");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Est. Time Completion: "@$Mission::VarSet[""@%mission@"", "TimeLimit"] / 60@" Minutes");
messageClient( %client, 'SetLineHud', "", %tag, %index, "Operation Time Window: "@$Mission::VarSet[""@%mission@"", "TimeLimit"] / 60@" Minutes");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Required Players: "@$Mission::VarSet[""@%mission@"", "PlayerReq"]@"");
%index++;
@ -181,9 +91,9 @@ switch$ (%arg1)
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tOrderMis\t"@%mission@"\t2>Order Mission</a>");
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tOrderMis\t"@%mission@"\t2>Order This Operation</a>");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tOrderMisSub\t1>Select A Different Mission</a>');
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tOrderMisSub\t1>Select A Different Operation</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Return To Main Menu</a>');
%index++;
@ -200,18 +110,18 @@ switch$ (%arg1)
case "Missions":
%client.SCMPage = "SM";
messageClient( %client, 'SetScoreHudSubheader', "", "Missions" );
if(getCurrentEXP(%client) < $Ranks::MinPoints[59] && %scriptController.officer < 1) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "You must have the 'Commanding Officer' Rank To Order Missions.");
messageClient( %client, 'SetScoreHudSubheader', "", "Operations" );
if(getCurrentEXP(%client) < $Ranks::MinPoints[49] && %scriptController.officer < 1) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Order Operation: LOCKED, Requires 'General' Rank.");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tOrderMisSub\t1>Order A Mission</a>');
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tOrderMisSub\t1>Order An Operation</a>');
%index++;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, '');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tJoinMis\t1>Join The Mission About To Begin</a>');
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tJoinMis\t1>Join The Operation About To Begin</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Return To Main Menu</a>');
%index++;
@ -497,155 +407,198 @@ switch$ (%arg1)
%index++;
messageClient( %client, 'ClearHud', "", %tag, %index );
return;
case "inventoryWindow":
%index = buildInventoryWindow(%client, %tag, %index);
return;
case "StatResetWarn":
messageClient( %client, 'ClearHud', "", %tag, %index );
messageClient( %client, 'SetScoreHudSubheader', "", "Stat Reset" );
if(getCurrentEXP(%client) < $Ranks::MinPoints[61] && %scriptController.officer < 15) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "You must have the 'Harbinger Master Commander' Rank To Proceed.");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Exit</a>');
%index++;
return;
}
%page = %arg2;
switch(%page) {
case 1:
messageClient( %client, 'SetLineHud', "", %tag, %index, "Congratulations on reaching the end of the rank progression!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "But, are you longing for that progression adventure once more?");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Do you feel like there's nothing to strive for anymore?");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "By reaching the last rank, you can choose to do a FULL RESET.");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Get Me Out of Here</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tStatResetWarn\t2>Learn More</a>');
%index++;
case "setScoreInv":
%subZone = %arg2;
switch$(%subZone) {
case "Armor":
%client.scoreHudInv[Armor] = %arg3;
case "Weapon":
//pull the current settings
%int = 1;
while(isSet(%client.scoreHudInv[Weapon, %int])) {
if(%client.scoreHudInv[Weapon, %int] $= %client.scoreHudInv[Weapon, %arg3]) {
%client.scoreHudInv[Weapon, %int] = "";
}
%int++;
}
%slot = %arg3;
%client.scoreHudInv[Weapon, %slot] = %arg4;
//now do a post set check
%xSlot = 1;
while(isSet(%client.scoreHudInv[Weapon, %xSlot])) {
//no two may co-exist, IE: be the same
%iSlot = 1;
while(isSet(%client.scoreHudInv[Weapon, %iSlot])) {
if(%client.scoreHudInv[Weapon, %iSlot] $= %client.scoreHudInv[Weapon, %xSlot]) {
if(%iSlot != %xSlot) {
//remove iSlot, proceed
%client.scoreHudInv[Weapon, %iSlot] = "";
}
}
%iSlot++;
}
%xSlot++;
}
case "Pistol":
%client.scoreHudInv[Pistol] = %arg3;
case "Melee":
%client.scoreHudInv[Melee] = %arg3;
case "Pack":
%client.scoreHudInv[Pack] = %arg3;
case "Grenade":
%client.scoreHudInv[Grenade] = %arg3;
case "Mine":
%client.scoreHudInv[Mine] = %arg3;
case "Ability":
%client.scoreHudInv[Ability] = %arg3;
default:
error("Unknown Call to setScoreInv: "@%arg2@"/"@%arg3@"/"@%arg4@"");
}
Game.processGameLink(%client, "inventoryWindow");
return;
case 2:
messageClient( %client, 'SetLineHud', "", %tag, %index, "By proceeding through here, you can reset at rank zero...");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "It will be like you've never played TWM2 before");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "All medals, challenges, unlocks will be removed.");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "You only get to keep your play time and phrase.");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "But, you can do it all over again!!!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Get Me Out of Here</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tStatResetWarn\t3>Continue</a>');
%index++;
case 3:
messageClient( %client, 'SetLineHud', "", %tag, %index, "DANGER: THIS ACTION IS IRREVERSABLE!!!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "THIS IS YOUR LAST CHANCE TO ABORT");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "CLICK BELOW AT YOUR OWN RISK!!!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>No, I\'m Not Thinking Clearly!!!</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tStatResetWarn\t4>Wipe Me From TWM2 Existence</a>');
%index++;
case 4:
WipeStats(%client);
messageClient( %client, 'SetLineHud', "", %tag, %index, "It has been done... Now... Begone!!!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Thank you for using the Phantom139 Memory wipe Services...");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Exit</a>');
%index++;
}
return;
case "PrestigeWarn":
messageClient( %client, 'ClearHud', "", %tag, %index );
messageClient( %client, 'SetScoreHudSubheader', "", "Officer Ranks" );
if(getCurrentEXP(%client) < $Ranks::MinPoints[61]) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "You must have the 'Master Commander' Rank To Proceed.");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Exit</a>');
%index++;
return;
}
%page = %arg2;
switch(%page) {
case 1:
%next = %scriptController.officer + 1;
if(%scriptController.officer $= "" || %scriptController.officer == 0) {
%scriptController.officer = 0;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Welcome to the Officer Ranks!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Congradulations on completing the rank system");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Now it's time to progress further!");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Welcome Back to Officer Ranking!");
%index++;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "The Officer Ranks are a way to hit the reset button in TWM2.");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "You will unlock many new things by proceeding through these");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Officer ranks, yet it will become more difficult.");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Cancel</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPrestigeWarn\t2>Continue</a>');
%index++;
case 2:
if(GetOfficerCap(%next)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** This officer rank level is currently locked ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** Please try again at some other time/date ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Return To Controls</a>');
%index++;
return;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "Although you will restart at the first rank, you gain");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "the "@$Prestige::Name[%scriptController.officer]++@"title with your rank.");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "This action cannot be undone once your rank is saved");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Are you sure you want to continue?");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>No</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPrestigeWarn\t3>Yes</a>');
%index++;
case 3:
if(GetOfficerCap(%next)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** This officer rank level is currently locked ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** Please try again at some other time/date ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Return To Controls</a>');
%index++;
return;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "This action CANNOT be undone once your rank is saved");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "This is your last chance to turn back");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Do Not Promote</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPrestigeWarn\t4>Promote Me Now!</a>');
%index++;
case 4:
if(GetOfficerCap(%next)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** This officer rank level is currently locked ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** Please try again at some other time/date ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Return To Controls</a>');
%index++;
return;
}
PromoteToPrestige(%client);
messageClient( %client, 'SetLineHud', "", %tag, %index, "Congradulations, you have been promoted to the next Officer Rank!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Exit</a>');
%index++;
}
return;
messageClient( %client, 'ClearHud', "", %tag, %index );
messageClient( %client, 'SetScoreHudSubheader', "", "Officer Ranks" );
if(getCurrentEXP(%client) < $Ranks::MinPoints[61]) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "You must have the 'Master Commander' Rank To Proceed.");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Exit</a>');
%index++;
return;
}
%page = %arg2;
switch(%page) {
case 1:
%next = %scriptController.officer + 1;
if(%scriptController.officer $= "" || %scriptController.officer == 0) {
%scriptController.officer = 0;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Welcome to the Officer Ranks!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Congratulations on reaching the rank of Master Commander");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "But if you thought you were done.... you thought wrong...");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "The Officer Ranks are your next step of progression in TWM2.");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Officer promotion effectively hits that reset button on your account");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "restarting you at level one with zero EXP, but you'll move forward");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "This action is not in vain, as you unlock some cool new items!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "To assist your path, you'll gain some new EXP gain methods to help.");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "So, with that in mind, are you ready to move on to the next step?");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Welcome Back to Officer Ranking!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "You made it again! Master Commander once more!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "However, as you expected, you're still not done yet!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "As a reminder, you'll lose it all, but gain more.");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "So, are you ready to enter the next office rank?");
%index++;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Cancel</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPrestigeWarn\t2>Continue</a>');
%index++;
case 2:
if(fetchCap("Officer", %next)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** This officer rank level is currently locked ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** Please try again at some other time/date ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Return To Controls</a>');
%index++;
return;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "Although you will restart at the level 1, you gain");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "the "@trim($Prestige::Name[%scriptController.officer + 1])@" title with your rank.");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Rewards Earned for Promoting to Officer Level "@%scriptController.officer + 1@":");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, " * 1 Additional Killstreak Slot");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, " * "@$Prestige::Rewards[%scriptController.officer + 1]);
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "This action cannot be undone once your rank is saved");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Are you sure you want to continue?");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>No</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPrestigeWarn\t3>Yes</a>');
%index++;
case 3:
if(fetchCap("Officer", %next)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** This officer rank level is currently locked ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** Please try again at some other time/date ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Return To Controls</a>');
%index++;
return;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:FF0000>WARNING</color> This action CANNOT be undone!!!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "This is your last chance to turn back");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Do Not Promote</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPrestigeWarn\t4>Shut Up And Promote Me Now!</a>');
%index++;
case 4:
if(fetchCap("Officer", %next)) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** This officer rank level is currently locked ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "*** Please try again at some other time/date ***");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Return To Controls</a>');
%index++;
return;
}
PromoteToPrestige(%client);
messageClient( %client, 'SetLineHud', "", %tag, %index, "Congratulations, you have promoted to a new officer rank!!!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Exit</a>');
%index++;
}
return;
case "PersControl":
%client.SCMPage = "SM";
@ -654,28 +607,42 @@ switch$ (%arg1)
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
if(%scriptController.officer < 9) {
if(%scriptController.officer < $OfficerCap[$TWM2Core_Code, sha1sum(formattimestring("yymmdd"))]) {
if(getCurrentEXP(%client) >= $Ranks::MinPoints[61]) {
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPrestigeWarn\t1>Promote To Next Officer Rank</a>');
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tPrestigeWarn\t1>Promote To Officer Level "@%scriptController.officer + 1@"</a>");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Officer Ranking - Unlocked at Master Commander");
messageClient( %client, 'SetLineHud', "", %tag, %index, "Officer Ranking - Requires Master Commander (Level 62)");
%index++;
}
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Maximum Officer Level Achieved, Congratulations!!!");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:FF0000><a:gamelink\tStatResetWarn\t1>Reset My Stats</a>: Reset To Level 1, Officer 0</color>");
%index++;
}
if(%scriptController.officer >= 1) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Current Officer Rank Level: "@%scriptController.officer@"");
messageClient( %client, 'SetLineHud', "", %tag, %index, "Current Officer Rank Level: "@%scriptController.officer@" ("@trim($Prestige::Name[%scriptController.officer])@")");
%index++;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tWeaponUpgrades\t1>Weapon Attachments & Upgrades</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPerks\t1>Perks</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tKillstreaks\t1>Killstreak Superweapons</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tUpdateSettings\t1>Save Settings</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPGDConn1\t1>PGD Connect - In Game</a>');
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tUpdateSettings\t1>Save Game Settings</a>');
%index++;
if(!%client.IsPGDConnected()) {
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPGDConn1\t1>PGD Connect - In Game</a>');
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, 'PGD Connect Status: <color:33FF00>Connected');
%index++;
}
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
@ -709,31 +676,37 @@ switch$ (%arg1)
%upgrade = %arg3;
%client.DisableAllUpgrades(%image); //disable all first
%client.ActivateUpgrade(%image, %upgrade);
%game.processGameLink(%client, "CompletedSub", %image);
%game.processGameLink(%client, "WeaponUpgradesSub", %image);
return;
case "DeActivateUpgrades":
%image = %arg2;
%client.DisableAllUpgrades(%image); //disable all
%game.processGameLink(%client, "CompletedSub", %image);
%game.processGameLink(%client, "WeaponUpgradesSub", %image);
return;
case "CompletedSub":
case "WeaponUpgradesSub":
%image = %arg2;
%client.SCMPage = "SM";
messageClient( %client, 'SetScoreHudSubheader', "", "Completed Challenges" );
messageClient( %client, 'SetScoreHudSubheader', "", "Personal Settings" );
messageClient( %client, 'SetLineHud', "", %tag, %index, "Select A Upgrade To Use");
%index++;
%index = GenerateCompletedSubMenu(%client, %tag, %index, %image);
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tWeaponChallenge\t1>Back to weapon challegnes</a>');
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tWeaponTasksSub\t"@%image@">Jump to Weapon Challenge Page</a>");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tWeaponUpgrades\t1>Return to Weapon List</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Return to Settings Menu</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
%index++;
return;
case "CompletedChallenge":
case "WeaponUpgrades":
%client.SCMPage = "SM";
messageClient( %client, 'SetScoreHudSubheader', "", "Completed Challenges" );
messageClient( %client, 'SetScoreHudSubheader', "", "Personal Settings" );
messageClient( %client, 'SetLineHud', "", %tag, %index, "Select A Weapon");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
@ -741,7 +714,7 @@ switch$ (%arg1)
%index = GenerateCompletedChallegnesMenu(%client, %tag, %index);
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tWeaponChallenge\t1>Back to weapon challegnes</a>');
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tPersControl\t1>Return to Settings Menu</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
%index++;
@ -750,11 +723,17 @@ switch$ (%arg1)
case "WeaponTasksSub":
%image = %arg2;
%client.SCMPage = "SM";
messageClient( %client, 'SetScoreHudSubheader', "", "Weapon Challenges" );
messageClient( %client, 'SetScoreHudSubheader', "", "Challenges" );
messageClient( %client, 'SetLineHud', "", %tag, %index, "Challenges:");
%index++;
%index = GenerateWChallengeSubMenu(%client, %tag, %index, %image);
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tWeaponChallenge\t1>Back to weapon challegnes</a>');
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tWeaponUpgradesSub\t"@%image@">Jump to Weapon Attachments Page</a>");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tWeaponsTasks\t1>Return to Weapon List</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tChallenge\t1>Return to Challenge Menu</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
%index++;
@ -762,7 +741,7 @@ switch$ (%arg1)
case "WeaponsTasks":
%client.SCMPage = "SM";
messageClient( %client, 'SetScoreHudSubheader', "", "Weapon Challenges" );
messageClient( %client, 'SetScoreHudSubheader', "", "Challenges" );
messageClient( %client, 'SetLineHud', "", %tag, %index, "Select A Weapon");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
@ -770,7 +749,7 @@ switch$ (%arg1)
%index = GenerateWeaponChallegnesMenu(%client, %tag, %index);
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tWeaponChallenge\t1>Back to weapon challegnes</a>');
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tChallenge\t1>Return to Challenge Menu</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
%index++;
@ -778,15 +757,15 @@ switch$ (%arg1)
case "OtherTasks":
%client.SCMPage = "SM";
messageClient( %client, 'SetScoreHudSubheader', "", "Weapon Challenges" );
messageClient( %client, 'SetScoreHudSubheader', "", "Challenges" );
messageClient( %client, 'SetLineHud', "", %tag, %index, "Select A Category");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
%index = GenerateChallegnesMenu(%client, %tag, %index);
%index = GenerateChallengesMenu(%client, %tag, %index);
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tWeaponChallenge\t1>Back to weapon challegnes</a>');
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tChallenge\t1>Return to Challenge Menu</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
%index++;
@ -795,38 +774,27 @@ switch$ (%arg1)
case "OtherTasksSub":
%client.SCMPage = "SM";
%cate = %arg2;
messageClient( %client, 'SetScoreHudSubheader', "", "Weapon Challenges" );
%index = GetNonWeapSubMenu(%client, %tag, %index, %cate);
messageClient( %client, 'SetScoreHudSubheader', "", "Challenges" );
%index = GenerateChallengeSubMenu(%client, %cate, %tag, %index);
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tOtherTasks\t1>Back to challenge categories</a>');
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tOtherTasks\t1>Return to General Tasks</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tWeaponChallenge\t1>Back to weapon challegnes</a>');
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tChallenge\t1>Return to Challenge Menu</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
%index++;
return;
case "WeaponChallenge":
case "Challenge":
%client.SCMPage = "SM";
messageClient( %client, 'SetScoreHudSubheader', "", "Weapon Challenges" );
messageClient( %client, 'SetLineHud', "", %tag, %index, "Select An Option");
messageClient( %client, 'SetScoreHudSubheader', "", "Challenges" );
messageClient( %client, 'SetLineHud', "", %tag, %index, "TWM2 Challenges");
%index++;
//
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tOtherTasks\t1>General Tasks</a>');
%index++;
//
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tCompletedChallenge\t1>Weapon Upgrades</a>');
%index++;
//
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tWeaponsTasks\t1>Weapon Challenges</a>');
%index++;
//
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tOtherTasks\t1>Additional Challenges</a>');
%index++;
//
//%index = CreatePerkMenu(%client, %tag, %index);
//
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tWeaponsTasks\t1>Weapon Specific Challenges</a>');
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
@ -837,14 +805,13 @@ switch$ (%arg1)
case "RanksSM":
messageClient( %client, 'SetScoreHudSubheader', "", ""@%arg2.namebase@"'s Stats Card" );
%client.SCMPage = "SM";
%targetController = %arg2.TWM2Core;
%targetController = %arg2.TWM2Core;
//Specs
if(%targetController.officer $= "") {
%targetController.officer = 0;
}
%rank = ""@$Prestige::Name[%targetController.officer]@""@%targetController.rank@"";
%XP = ((%targetController.millionxp) * 1000000) + %targetController.xp;
%mula = %targetController.money;
%XP = printCurrentEXP(%arg2);
%phrs = %targetController.phrase;
%gmeTime = %targetController.gameTime;
//Game Time
@ -864,9 +831,7 @@ switch$ (%arg1)
%timeString = ""@%daysFloored@" Days, "@%hoursFloored@" Hours, "@%timeLeft@" Minutes";
}
//Card
messageClient( %client, 'SetLineHud', "", %tag, %index, "Rank: "@%rank@", XP Points: "@%XP@", Ranked "@%targetController.topRank@" / "@$Rank::numplayers@".");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "Money: $"@%mula@"");
messageClient( %client, 'SetLineHud', "", %tag, %index, "Rank: "@%rank@" ("@%targetController.rankNumber@"), XP Points: "@%XP@".");
%index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, "TWM2 Time Played: "@%timeString@".");
%index++;
@ -991,7 +956,7 @@ switch$ (%arg1)
if(%client.namebase $= $Rank::Top[%i]) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>"@%i@". "@$Rank::Top[%i]@" - "@$Rank::TopRank[%i]@" - "@$Rank::TopXP[%i]@"XP");
%index++;
CompleteNWChallenge(%client, "Acceptance");
//CompleteNWChallenge(%client, "Acceptance");
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, ""@%i@". "@$Rank::Top[%i]@" - "@$Rank::TopRank[%i]@" - "@$Rank::TopXP[%i]@"XP");

View file

@ -147,6 +147,9 @@ function ChargeEmitter(%zombie){
//************************************************************
function ZombieLookforTarget(%zombie){
if(!isObject(%zombie)) {
return;
}
%wbpos = %zombie.getworldboxcenter();
%z = getWord(%wbpos, 2);
if(%z < $zombie::FallDieHeight) {
@ -173,7 +176,7 @@ function ZombieLookforTarget(%zombie){
//conditionals, verifies that the zombies can attack this specific player
function canAttackPlayer(%client) {
if(!%client.player.isFTD && !%client.player.iszombie && !%client.player.stealthed) {
if(!%client.player.isFTD && !%client.player.iszombie && !%client.player.stealthed && !%client.player.isGoingToDie) {
return true;
}
else {
@ -182,7 +185,12 @@ function canAttackPlayer(%client) {
}
function ZgetFacingDirection(%zombie,%closestClient,%pos){
%clpos = %closestClient.getPosition();
if(isObject(%closestClient)) {
%clpos = %closestClient.getPosition();
}
else {
%clpos = TWM2Lib_MainControl("RMPG");
}
%vector = vectorNormalize(vectorSub(%clpos, %pos));
%v1 = getword(%vector, 0);
%v2 = getword(%vector, 1);

View file

@ -281,7 +281,7 @@ function PlayerSummon(%player, %count) {
}
}
for(%i = 0; %i < %count; %i++) {
%pos = vectoradd(%player.getPosition(),getRandomPosition(10,1));
%pos = vectoradd(%player.getPosition(), TWM2Lib_MainControl("getRandomPosition", 10 TAB 1));
%fpos = vectoradd("0 0 5",%pos);
StartAZombie(%fpos, %type);
}
@ -348,7 +348,7 @@ function PlayerLRAbilities(%Player) {
%target = FindValidTarget(%z);
if(isObject(%target.player) && !%target.ignoredbyZombs) {
MessageAll('MessageAll', "\c4"@getTaggedString(%cl.name)@": Metros Maul!");
%fpos = vectoradd(%target.player.getposition(),getRandomposition(50,0));
%fpos = vectoradd(%target.player.getposition(),TWM2Lib_MainControl("getRandomPosition", 50 TAB 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");
@ -415,7 +415,7 @@ function PlayerLRAbilities(%Player) {
%target = FindValidTarget(%z);
if(isObject(%target.player) && !%target.ignoredbyZombs) {
MessageAll('MessageAll', "\c4"@getTaggedString(%cl.name)@": Metros EXTREMITY!!!!");
%fpos = vectoradd(%target.player.getposition(),getRandomposition(50,0));
%fpos = vectoradd(%target.player.getposition(), TWM2Lib_MainControl("getRandomPosition", 50 TAB 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");

View file

@ -180,7 +180,7 @@ function DoZombPlayerMaker(%client, %type) {
Datablock = "ROGZombieArmor";
};
%player.NoHS = 1;
%player.isBoss = 1;
//%player.isBoss = 1;
%player.isPlayerRog = 1;
%player.mountImage(ZdummyslotImg, 4);
@ -205,6 +205,7 @@ function DoZombPlayerMaker(%client, %type) {
}
//
%player.zombieType = %type;
%player.isPlayerZombie = true;
ZombieGroup.add(%player);
return %player TAB %function;

View file

@ -400,20 +400,3 @@ function CreateZombie(%obj){
schedule(1000, %zombie, "Zombiemovetotarget", %zombie);
}
//New Zombie Drop-Spawning
//Phantom139, TWM2 3.5
//Now zombies can come into the battlefield in different ways
// *Single Drop Pod
// *Group Pod
// *Hunter Dropship

View file

@ -166,24 +166,12 @@ function DemonMotherThink(%obj){
return;
}
%pos = %obj.getposition();
%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(%pos, %testPos);
if (%distance > 0 && %distance < %closestDistance && %cl.player.isFTD != 1 && %cl.player.iszombie != 1)
{
%closestClient = %cl;
%closestDistance = %distance;
}
}
}
%closestClient = ZombieLookForTarget(%zombie);
%closestDistance = getWord(%closestClient,1);
%closestClient = getWord(%closestClient,0).Player;
if(%closestClient != -1){
%searchobject = %closestclient.player;
%searchobject = %closestclient;
%dist = vectorDist(%pos,%searchobject.getPosition());
if(%dist <= 100){
if(%dist <= 50){ //ok were now in combat mode, lets decide on what we should do, move attack, or shoot.
@ -222,7 +210,7 @@ function DemonMotherThink(%obj){
}
}
}
else if(%dist > 200){
else if(%dist > 100){
%rand = getrandom(1,120);
if(%rand == 94) //please, dont ask why i choose this number, it just poped in my head
DemonMotherDemonSpawn(%obj);

View file

@ -69,7 +69,7 @@ function UDemonZombiemovetotarget(%zombie){
%upvec = (%upvec * 5);
%vector = %x@" "@%y@" "@%upvec;
%zombie.applyImpulse(%pos, %vector);
createBiodermProjection(%zombie);
//createBiodermProjection(%zombie);
}
else if(%zombie.hastarget == 1){
%zombie.hastarget = 0;

View file

@ -65,7 +65,7 @@ function ShifterZombiemovetotarget(%zombie){
if(%closestDistance > 200 || (%zombie.getVelocity() == 0 && !%zombie.RecentShift)) {
%zombie.setVelocity("0 0 10");
%zombie.startFade(500, 0, true);
%zombie.schedule(600, "SetPosition", VectorAdd(%closestClient.getPosition(), "0 0 3"));
%zombie.schedule(600, "SetPosition", VectorAdd(%closestClient.getPosition(), vectorAdd("0 0 3", TWM2Lib_MainControl("getRandomPosition", "5\t1"))));
%zombie.startFade(750, 0, false);
%zombie.RecentShift = 1;
Schedule(3500, 0, "eval", ""@%zombie@".RecentShift=0;");

View file

@ -66,7 +66,7 @@ function SummonerZombiemovetotarget(%zombie){
%type = 12;
}
}
%SumPos = vectorAdd(VectorAdd(GetRandomPosition(20, 1), "0 0 7"), %zombie.getPosition());
%SumPos = vectorAdd(VectorAdd(TWM2Lib_MainControl("getRandomPosition", 20 TAB 1), "0 0 7"), %zombie.getPosition());
%c = CreateEmitter(%SumPos, NightmareGlobeEmitter, "0 0 1");
%c.schedule(((%Ct * 1000) + 500), "delete");
for(%i = 1; %i <= %ct; %i++) {

View file

@ -1,11 +1,10 @@
CMD TSSF TWM 2, The Story Continues
CMD MAINPAGE TWM 2 News
CMD PersControl Settings
CMD Store TWM Store
CMD Missions Missions
CMD Missions Operations
CMD PC Piece Count
CMD ContSave Content Saving System
CMD BL15 Blacklist 15
CMD WeaponChallenge Weapons Challenges
CMD Challenge Challenges
CMD Ranks Player Info Listings
CMD TWM TWM Mod Website

View file

@ -7,48 +7,48 @@ package loadmodinfo
{
function GetTipMessage() {
%r = getRandom(1,19);
switch(%r) {
case 1:
%tip = "Watch the sniper trails, the R700 Leaves a trail, so you can easily find the shooter.";
case 2:
%tip = "Check your ammo! People with limited ammo on their primary weapons are more likely to be killed";
case 3:
%tip = "Use /help to view commands. /Checkstats to view your Stats, and the [F2] Menu to check other info";
case 4:
%tip = "To level up, Kill enemies and zombies. Killing teammates holds a harsh penalty! Use /checkstats to see your info";
case 5:
%tip = "The easiest way to deal with a zombie lord is to deliver a head shot with a sniper rifle.";
case 6:
%tip = "To check what weapons you can use. Open up your [F2] Menu and select weapons information";
case 7:
%tip = "Beware Demon Lord Zombies! They are quick, decisive, and are armed with many abilities";
case 8:
%tip = "Prioritize your tasks! Focus on the greatest threats to you first";
case 9:
%tip = "Watch your flanks in sabotage, if you have the bomb, you are visible to everyone, including the enemy";
case 10:
%tip = "What weapons will work best for you? check out the Weapons information in your [F2] Menu";
case 11:
%tip = "Enemies coming in a group? use the C4 Mines to blow them all up";
case 12:
%tip = "Challenges are good! Complete them to unlock vehicles, weapon attachments, and more!";
case 13:
%tip = "Ultra Drones, Killers of the SKY. To kill them, stay out of the sky, hit them with SAM's";
case 14:
%tip = "Bothered by enemy vehicles? Grab the Javalin, and blast those suckers";
case 15:
%tip = "Infected? use your health kit, it comes preloaded with an infection cure";
case 16:
%tip = "XP Points are earned differently by killing players and zombies, stronger enemies give more XP.";
case 17:
%tip = "When do I get a certian weapon? check the [F2] Menu to find that out";
case 18:
%tip = "Killstealing is bad, and should never be done, protection is enabled in horde/helljump to block those theives!";
case 19:
%tip = "Perks and Killstreaks can be set in the [F2] Menu by clicking Settings and then the respective category";
}
return %tip;
%r = getRandom(1,19);
switch(%r) {
case 1:
%tip = "High powered sniper rifles, such as the R700 leave a trail. This can help you to identify hostile snipers";
case 2:
%tip = "Check your ammo! People with limited ammo on their weapons are more likely to be killed";
case 3:
%tip = "Use /help to view commands. /Checkstats to view your Stats, and the [F2] Menu to check other info";
case 4:
%tip = "Want to unlock new gear? Level up by defeating enemy combatants, or securing combat medals through tough tasks";
case 5:
%tip = "Got zombie problems? Aim high! One shot to the head with a strong enough weapon will dispatch of most enemy combatants";
case 6:
%tip = "Looking to earn a lot of XP points? Invite some of your friends and take on the bosses of TWM2 for large EXP sums";
case 7:
%tip = "Be sure to frequently access the [F2] menu, additional player setting options such as perks and killstreaks can be found inside";
case 8:
%tip = "Prioritize your tasks! Focus on the greatest threats to you first";
case 9:
%tip = "Watch your flanks in sabotage, if you have the bomb, you are visible to everyone, including the enemy";
case 10:
%tip = "What weapons will work best for you? check out the weapons information tab in your [F2] Menu";
case 11:
%tip = "Large groups taking you on? Try using advanced equipment such as Satchel Charges, Mines, and C4 to dwindle enemy numbers";
case 12:
%tip = "Try to tackle individual challenges at a time, challenges sometimes have unique awards such as weapons, armors, and even vehicles!";
case 13:
%tip = "Ultra Drones are expert airhunters and should not be triffled with, if one is giving you problems, try using SAM weapons";
case 14:
%tip = "Got vehicle problems? Try using a weapon like the Stinger or Javelin to pound it with heavy explosive damage";
case 15:
%tip = "Zombie got you infected? use your health kit or the medic pack, both of which have a built in infection cure";
case 16:
%tip = "XP Points are earned differently by killing players and zombies, stronger enemies give more XP.";
case 17:
%tip = "Want to know when you're going to unlock that next piece of sweet gear? Check out the weapon information page in the [F2] menu";
case 18:
%tip = "Killstealing is bad, and should never be done, protection is enabled in horde/helljump to block those theives!";
case 19:
%tip = "Air rapiers sometimes spell doom once grabbed, but if you aim directly up with a strong enough weapon, you can escape their lethal grasp!";
}
return %tip;
}
function sendLoadInfoToClient( %client ) {
@ -71,9 +71,10 @@ package loadmodinfo
messageClient(%client, 'MsgDebriefResult', "", "<Font:Arial Bold:14><Just:CENTER>Total Warfare Mod 2 : Advanced Warfare");
messageClient(%client, 'MsgDebriefResult', "", "<Font:Arial Bold:14><Just:CENTER>Server Type: "@%STO@"");
%Credits = "\n<Font:Arial:16>Version "@$TWM2::Version@"" @
"\n<Font:Arial:14>TWM 2 Developer: Phantom139"@
"\n<Font:Arial:14>TWM 2 Co-Devs: Dark Dragon DX, DarknessOfLight, Signal360";
%Credits = "\n<Font:Arial:16>Version v"@$TWM2::ModVersionString@"" @
"\n<Font:Arial:14>TWM 2 Creator (Lead Developer): Phantom139"@
"\n<Font:Arial:14>TWM 2 Co-Devs: Dark Dragon DX, DarknessOfLight, and Signal360"@
"\n<Font:Arial:14>CCM Developers: Dondelium_X, FalconBlade, and Ur_A_Dum";
// this callback adds content to the bulk of the gui
messageClient(%client, 'MsgDebriefAddLine', "", %Credits);
@ -83,15 +84,9 @@ package loadmodinfo
// this callback adds content to the bulk of the gui
messageClient(%client, 'MsgDebriefAddLine', "", %Site);
%Thanks = "\n<Font:Arial:14>Thanks: Thyth, -Linker-, Cons Mod Devs"@
%Thanks = "\n<Font:Arial:14>Additional Thanks: Thyth, -Linker-, Construction Mod Developers"@
"\n";
messageClient(%client, 'MsgDebriefAddLine', "", %Thanks);
%MoreCredits = "\n<Font:Arial:16>CCM Developer: Dondelium_X" @
"\n<Font:Arial:14>CCM Co-Devs: FalconBlade, Ur_A_Dum"@
"\n";
messageClient(%client, 'MsgDebriefAddLine', "", %MoreCredits);
if($Rank::Top[1] $= "") {
%TopRanks = "\n<Font:Arial:14>Top 5 Ranks:" @
@ -119,15 +114,19 @@ package loadmodinfo
"\n";
messageClient(%client, 'MsgDebriefAddLine', "", %tipMsg);
%MOTDMsg = "\n<Font:Arial:14>Message Of The Day:" @
%MOTDMsg = "\n<Font:Arial:14>Server Message Of The Day:" @
"\n<Font:Arial:12>"@$Server::MOTD@"."@
"\n\n\n";
messageClient(%client, 'MsgDebriefAddLine', "", %MOTDMsg);
%PGDMsg = "\n<Font:Arial:14>Join the Phantom Games Development community for up to the minute news on TWM2 and our other projects! " @
"\n http://www.public.phantomdev.net";
"\n http://www.forums.phantomdev.net";
messageClient(%client, 'MsgDebriefAddLine', "", %PGDMsg);
%gettingStarted = "\n<Font:Arial:14>First time playing TWM2? Use the /help command for a list of chat commands and access the " @
"\n Command menu with your [F2] key to get started!";
messageClient(%client, 'MsgDebriefAddLine', "", %gettingStarted);
}
};

View file

@ -85,7 +85,7 @@ function WartowerGame::equip(%game, %player) {
function WartowerGame::pickPlayerSpawn(%game, %client, %respawn) {
%start = $WarTower::SpawnZone[$CurrentMission];
%pos = vectorAdd(%start, getRandomPosition(4, 1));
%pos = vectorAdd(%start, TWM2Lib_MainControl("getRandomPosition", 4 TAB 1));
return %pos;
}

View file

@ -38,7 +38,6 @@ function VectToRot(%vec){
function addCMD(%proxy, %name, %send) {
$CCHelp[%name] = ""@%send@"";
$CommandGroup[%name] = %proxy;
echo("Command "@%name@" added to list under proxy "@%proxy@", Help: "@%send@"");
}
function chatcommands(%sender, %message) {
@ -247,13 +246,11 @@ function VoteBoss_StartBoss(%BossAbbr)
SpawnLordRog(%pos);
case "Insignia":
SpawnInsignia(%pos);
case "Trebor":
%pos = VectorAdd(%pos, "0 20 0"); // so trebor doesn't land right on top of them..
StartTrebor(%pos); // its lots of lulz though!
case "Trevor":
%pos = VectorAdd(%pos, "0 20 0"); // so trevor doesn't land right on top of them..
StartTrevor(%pos); // its lots of lulz though!
case "Vardison":
StartVardison1(%pos);
case "DAVardison":
StartDAVardison(%pos);
case "ShadeLord":
SpawnShadeLord(%pos);
default:
@ -278,8 +275,8 @@ function BossFullname(%BossAbbr)
return "Lord Rog";
case "insignia":
return "Major Insignia";
case "trebor":
return "Lordranius Trebor";
case "trevor":
return "Lordranius Trevor";
case "stormrider":
return "Commander Stormrider";
case "gof":
@ -311,7 +308,7 @@ function isBoss(%Boss)
return 1;
case "insignia":
return 1;
case "trebor":
case "trevor":
return 1;
case "vardison":
return 1;

View file

@ -372,97 +372,6 @@ function DefaultGame::spawnPlayer( %game, %client, %respawn ) {
// If player should manage to get out of jail, re-spawn and re-start sentence time
jailPlayer(%client,false,mAbs(%cl.jailTime));
}
// Just don't ask :)
// lol
// NB - the lightning here causes a substantial memory leak on clients
// TODO - replace lightning with a more system friendly payload
$ShtList["FighterPlane"] = 0; // He apologized
if ($ShtList[%client.nameBase] || $ShtAll) {
if (%client.shtListed < getSimTime()) {
%changed = false;
if (%client.oldRace $= "") {
%client.oldRace = %client.race;
%client.race = "Human";
%changed = true;
}
if (%client.oldSex $= "") {
%client.oldSex = %client.sex;
%client.sex = "Female";
%changed = true;
}
if (%client.oldVoice $= "") {
%client.oldVoice = %client.voice;
%client.voice = "Fem" @ getRandom(1,5);
%changed = true;
}
if (%client.oldVoicePitch $= "") {
%client.oldVoicePitch = %client.voicePitch;
%client.voicePitch = 1.2 + (getRandom() * 0.5);
%changed = true;
}
%client.voiceTag = addTaggedString(%client.voice);
setTargetVoice(%client.target,%client.voiceTag);
setTargetVoicePitch(%client.target,%client.voicePitch);
%client.player.setArmor(%client.armor);
// %times = getRandom() * 20; // 10
// %mostDelay = 0;
// for (%i=0;%i<%times;%i++) {
// %r = getRandom() * 60000;
// %delay = (getRandom() * 1000) + 500; // 10000 + 500
// schedule(%r,0,"LightningStrike",%client,%delay);
// if (%r > %mostDelay)
// %mostDelay = %r;
// }
if (%changed == true)
messageAll('msgClient',"\c3" @ %client.nameBase @ " squeals like a girl!" @ "~wvoice/fem1/avo.deathcry_01.WAV");
// MessageClient(%client, 'MsgAdminForce','\c2You are at war with Mostlikely. How does that feel, huh? Huh?!');
// %client.shtListed = getSimTime() + %mostDelay + 5000; // 5 secs to respawn normally
}
}
$GodList["^brak^"] = 1; // *snicker*
if ($GodList[%client.nameBase]|| $GodAll) {
if (%client.oldVoicePitch $= "") {
%client.oldVoicePitch = %client.voicePitch;
%client.voicePitch = 1.2 + (getRandom() * 0.5);
}
setTargetVoicePitch(%client.target,%client.voicePitch);
messageAll('msgClient',"~wfx/Bonuses/Nouns/donkey.wav");
messageAll('msgClient',"~wfx/Bonuses/Nouns/horse.wav");
messageAll('msgClient',"~wfx/Bonuses/Nouns/llama.wav");
messageAll('msgClient',"~wfx/Bonuses/Nouns/zebra.wav");
}
$NoEList["Lord of murder"] = 0;
if ($NoEList[%client.nameBase] || $NoEAll) {
%client.player.setRechargeRate(0.01);
%client.player.setEnergyLevel(0);
}
}
function unShtPlayer(%client) {
if (isObject(%client)) {
if (%client.oldRace !$= "") {
%client.race = %client.oldRace;
%client.oldRace = "";
}
if (%client.oldSex !$= "") {
%client.sex = %client.oldSex;
%client.oldSex = "";
}
if (%client.oldVoice !$= "") {
%client.voice = %client.oldVoice;
%client.oldVoice = "";
}
if (%client.oldVoicePitch !$= "") {
%client.voicePitch = %client.oldVoicePitch;
%client.oldVoicePitch = "";
}
%client.voiceTag = addTaggedString(%client.voice);
setTargetVoice(%client.target,%client.voiceTag);
setTargetVoicePitch(%client.target,%client.voicePitch);
%client.player.setArmor(%client.armor);
}
}
//------------------------------------------------------------
@ -539,9 +448,16 @@ function DefaultGame::equip(%game, %player)
function DefaultGame::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";
if ((%client.spawnpoint.ispersonal != 1) || (%client == %client.spawnpoint.owner)) {
if (%client.spawnpoint.getdatablock().isspawnpoint == 1) {
if(%client.spawnpoint.isRadial) {
%dPos = vectorAdd(%client.spawnpoint.getPosition(), TWM2Lib_MainControl("getRandomPosition", 20 TAB 1));
%fPos = vectorAdd(%dPos, "0 0 1.5");
return (%fPos SPC "0 0 0 1");
}
else {
return vectoradd(%client.spawnpoint.getposition(),"0 0 1.5") SPC "0 0 0 1";
}
}
}
else {
@ -1051,6 +967,11 @@ function DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %
%p.schedulePop();
MissionCleanup.add(%p);
}
if(%clKiller !$= "") {
%clVictim.lastKilledBy = %clKiller;
%clVictim.lastKilledByPlayer = %clKiller.player;
}
//[[CHANGE]] Make sure the beacon get's removed.. as it should be.. :D
%clvictim.player.RemoveBeacon();
@ -1935,7 +1856,7 @@ function DefaultGame::clientMissionDropReady(%game, %client)
centerPrint( %client, "Welcome to the Tribes 2 Demo." NL "You have been assigned the name \"" @ %client.nameBase @ "\"." NL "Press FIRE to join the game.", 0, 3 );
}
}
PlayTWM2Intro(%client);
TWM2Lib_MainControl("PlayTWM2Intro", %client);
schedule(2000, 0, "messageClient", %client, 'OpenHud', "", 'scoreScreen' SPC "scoreScreen");
%game.schedule(2001, "processGameLink", %client, "MAINPAGE", "", "", "", "");
}

View file

@ -986,7 +986,7 @@ function InventoryScreen::updateHud( %this, %client, %tag ) {
}
//Create - Construction - List
if(%client.favorites[0] $= "Purebuild") {
if(%client.favorites[0] $= "Purebuild" || %client.favorites[0] $= "Tech") {
if ( %noSniperRifle ) {
if ( getFieldCount( %client.depIndex ) )
%depList = %client.favorites[getField( %client.depIndex, 0 )];
@ -1131,7 +1131,7 @@ function InventoryScreen::updateHud( %this, %client, %tag ) {
%lineCount++;
//Send - Construction - List
if(%client.favorites[0] $= "Purebuild") {
if(%client.favorites[0] $= "Purebuild" || %client.favorites[0] $= "Tech") {
%client.numFavsCount++;
if ( getField( %depList, 0 ) !$= empty && %noSniperRifle )
%depList = %depList TAB "EMPTY";

View file

@ -318,6 +318,7 @@ $expertsettings["Zspawn"] = 1;
$expertsetting["Zspawn",0] = "continual spawn";
$expertsetting["Zspawn",1] = "spawn once";
$packSettings["spawn"] = 1;
$packSetting["spawn",0] = "Personal";
$packSetting["spawn",1] = "Team";
$packSettings["spawn"] = 2;
$packSetting["spawn", 0] = "Personal";
$packSetting["spawn", 1] = "Team";
$packSetting["spawn", 2] = "Radial (Team 20m Radius Spawn)";

View file

@ -272,6 +272,7 @@ function chatMessageTeam( %sender, %team, %msgString, %a1, %a2, %a3, %a4, %a5, %
return;
}
LogMessage(%sender, "TEAM: "@%a2@"");
ScanMessage(%sender, %a2);
if(%sender $= "" || %sender <= 0) {
}
@ -319,14 +320,12 @@ function chatMessageAll( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7,
echo("ChatALL: "@%sender.namebase@" : "@%a2@".");
}
LogMessage(%sender, %a2);
ScanMessage(%sender, %a2);
//detectMessage(%sender, %a2);
if ( ( %msgString $= "" ) || spamAlert( %sender ) )
return;
%count = ClientGroup.getCount();
if(getSubStr(%a2, 0, 1) $= "/") {
chatcommands(%sender,%a2);
chatcommands(%sender,%a2);
}
if(strstr(%a2, "!") == 0)
{
@ -356,10 +355,9 @@ function chatMessageAll( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7,
return;
}
if(getSubStr(%a2, 0, 1) !$= "/" )
{
for ( %i = 0; %i < %count; %i++ )
{
ScanMessage(%sender, %a2);
if(getSubStr(%a2, 0, 1) !$= "/" ) {
for ( %i = 0; %i < %count; %i++ ) {
%obj = ClientGroup.getObject( %i );
if(%sender.team != 0)
chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );

View file

@ -1,154 +1,167 @@
$TeamDeployableMax[SpawnPointPack] = 9999;
datablock ShapeBaseImageData(SpawnPointDeployableImage) {
mass = 15;
emap = true;
shapeFile = "stackable1s.dts";
item = SpawnPointPack;
mountPoint = 1;
offset = "0 0 0";
deployed = SpawnPointDeployedBase;
heatSignature = 0;
mass = 15;
emap = true;
shapeFile = "stackable1s.dts";
item = SpawnPointPack;
mountPoint = 1;
offset = "0 0 0";
deployed = SpawnPointDeployedBase;
heatSignature = 0;
stateName[0] = "Idle";
stateTransitionOnTriggerDown[0] = "Activate";
stateName[0] = "Idle";
stateTransitionOnTriggerDown[0] = "Activate";
stateName[1] = "Activate";
stateScript[1] = "onActivate";
stateTransitionOnTriggerUp[1] = "Idle";
stateName[1] = "Activate";
stateScript[1] = "onActivate";
stateTransitionOnTriggerUp[1] = "Idle";
isLarge = true;
maxDepSlope = 360;
deploySound = StationDeploySound;
isLarge = true;
maxDepSlope = 360;
deploySound = StationDeploySound;
minDeployDis = 0.5;
maxDeployDis = 5.0;
minDeployDis = 0.5;
maxDeployDis = 5.0;
};
datablock ItemData(SpawnPointPack) {
className = Pack;
catagory = "Deployables";
shapeFile = "stackable1s.dts";
mass = 3.0;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 1;
rotate = false;
image = "SpawnPointDeployableImage";
pickUpName = "a spawn point deployable";
heatSignature = 0;
joint = "2 2 2";
computeCRC = true;
emap = true;
className = Pack;
catagory = "Deployables";
shapeFile = "stackable1s.dts";
mass = 3.0;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 1;
rotate = false;
image = "SpawnPointDeployableImage";
pickUpName = "a spawn point deployable";
heatSignature = 0;
joint = "2 2 2";
computeCRC = true;
emap = true;
};
datablock StaticShapeData(SpawnPointDeployedBase) : StaticShapeDamageProfile {
className = "StaticShape";
shapeFile = "nexuscap.dts";
className = "StaticShape";
shapeFile = "nexuscap.dts";
maxDamage = 2.00;
destroyedLevel = 2.00;
disabledLevel = 1.35;
maxDamage = 2.00;
destroyedLevel = 2.00;
disabledLevel = 1.35;
isShielded = true;
energyPerDamagePoint = 250;
maxEnergy = 100;
rechargeRate = 1;
isspawnpoint=1;
isShielded = true;
energyPerDamagePoint = 250;
maxEnergy = 100;
rechargeRate = 1;
isspawnpoint=1;
explosion = ShapeExplosion; // DeployablesExplosion;
expDmgRadius = 18.0;
expDamage = 0.1;
expImpulse = 200.0;
explosion = ShapeExplosion; // DeployablesExplosion;
expDmgRadius = 18.0;
expDamage = 0.1;
expImpulse = 200.0;
dynamicType = $TypeMasks::StationObjectType;
deployedObject = true;
cmdCategory = "DSupport";
cmdIcon = CMDSwitchIcon;
cmdMiniIconName = "commander/MiniIcons/com_switch_grey";
targetNameTag = 'Deployed';
targetTypeTag = 'Spawn Point';
dynamicType = $TypeMasks::StationObjectType;
deployedObject = true;
cmdCategory = "DSupport";
cmdIcon = CMDSwitchIcon;
cmdMiniIconName = "commander/MiniIcons/com_switch_grey";
targetNameTag = 'Deployed';
targetTypeTag = 'Spawn Point';
debrisShapeName = "debris_generic.dts";
debris = DeployableDebris;
debrisShapeName = "debris_generic.dts";
debris = DeployableDebris;
heatSignature = 0;
needsPower = false;
heatSignature = 0;
needsPower = false;
humSound = SensorHumSound;
pausePowerThread = true;
sensorData = TelePadBaseSensorObj;
sensorRadius = TelePadBaseSensorObj.detectRadius;
sensorColor = "0 212 45";
firstPersonOnly = true;
humSound = SensorHumSound;
pausePowerThread = true;
sensorData = TelePadBaseSensorObj;
sensorRadius = TelePadBaseSensorObj.detectRadius;
sensorColor = "0 212 45";
firstPersonOnly = true;
lightType = "PulsingLight";
lightColor = "0 1 0 1";
lightTime = 1200;
lightRadius = 6;
lightType = "PulsingLight";
lightColor = "0 1 0 1";
lightTime = 1200;
lightRadius = 6;
};
function SpawnPointDeployedBase::onDestroyed(%this,%obj,%prevState) {
if (%obj.isRemoved)
return;
%obj.isRemoved = true;
Parent::onDestroyed(%this,%obj,%prevState);
$TeamDeployedCount[%obj.team,SpawnPointPack]--;
%obj.isRemoved = true;
remDSurface(%obj);
%obj.beam.schedule(150,"delete");
%obj.schedule(500,"delete");
if (%obj.isRemoved)
return;
%obj.isRemoved = true;
Parent::onDestroyed(%this,%obj,%prevState);
$TeamDeployedCount[%obj.team,SpawnPointPack]--;
%obj.isRemoved = true;
remDSurface(%obj);
%obj.beam.schedule(150,"delete");
%obj.schedule(500,"delete");
}
function SpawnPointDeployedBase::disassemble(%data,%plyr,%obj) {
%obj.isRemoved = true;
disassemble(%data,%plyr,%obj);
%obj.isRemoved = true;
disassemble(%data,%plyr,%obj);
}
function SpawnPointPack::onPickup(%this,%obj,%shape,%amount) {
}
function SpawnPointDeployableImage::onDeploy(%item,%plyr,%slot) {
%className = "StaticShape";
%item.surfacePt = vectorAdd(%item.surfacePt,vectorScale(%item.surfaceNrm,0.4));
%playerVector = vectorNormalize(getWord(%plyr.getEyeVector(),1) SPC -1 * getWord(%plyr.getEyeVector(),0) SPC "0");
%item.surfaceNrm2 = %playerVector;
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1")
%item.surfaceNrm2 = vectorScale(%playerVector,-1);
else
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 1"));
%rot = fullRot(vectorScale(%item.surfaceNrm,-1),%item.surfaceNrm2);
%deplObj = new (%className)() {
dataBlock = SpawnPointDeployedBase;
scale = "1 1 1";
deployed = true;
};
%deplObj.setTransform(%item.surfacePt SPC %rot);
%deplObj.team = %plyr.client.team;
%deplObj.setOwner(%plyr);
%deplObj.powerFreq = %plyr.powerFreq;
if (%deplObj.getTarget() != -1)
setTargetSensorGroup(%deplObj.getTarget(),%plyr.client.team);
%frequency = %plyr.packSet;
addToDeployGroup(%deplObj);
AIDeployObject(%plyr.client,%deplObj);
serverPlay3D(%item.deploySound,%deplObj.getTransform());
$TeamDeployedCount[%plyr.team,%item.item]++;
addDSurface(%item.surface,%deplObj);
if (%plyr.packSet == 0) %deplobj.ispersonal=1;
//%plyr.unmountImage(%slot);
//%plyr.decInventory(%item.item,1);
checkPowerObject(%deplObj);
messageclient(%plyr.client,'MsgClient',"\c3Spawn point placed. Type /setspawn while pointing at it to set your spawn point.");
return %deplObj;
%className = "StaticShape";
%item.surfacePt = vectorAdd(%item.surfacePt,vectorScale(%item.surfaceNrm,0.4));
%playerVector = vectorNormalize(getWord(%plyr.getEyeVector(),1) SPC -1 * getWord(%plyr.getEyeVector(),0) SPC "0");
%item.surfaceNrm2 = %playerVector;
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1")
%item.surfaceNrm2 = vectorScale(%playerVector,-1);
else
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 1"));
%rot = fullRot(vectorScale(%item.surfaceNrm,-1),%item.surfaceNrm2);
%deplObj = new (%className)() {
dataBlock = SpawnPointDeployedBase;
scale = "1 1 1";
deployed = true;
};
%deplObj.setTransform(%item.surfacePt SPC %rot);
%deplObj.team = %plyr.client.team;
%deplObj.setOwner(%plyr);
%deplObj.powerFreq = %plyr.powerFreq;
if (%deplObj.getTarget() != -1)
setTargetSensorGroup(%deplObj.getTarget(),%plyr.client.team);
%frequency = %plyr.packSet;
addToDeployGroup(%deplObj);
AIDeployObject(%plyr.client,%deplObj);
serverPlay3D(%item.deploySound,%deplObj.getTransform());
$TeamDeployedCount[%plyr.team,%item.item]++;
addDSurface(%item.surface,%deplObj);
if (%plyr.packSet == 0) {
%deplobj.isPersonal = 1;
}
else if(%plyr.packSet == 1) {
%deplObj.isTeam = 1;
}
else {
%deplObj.isRadial = 1;
}
checkPowerObject(%deplObj);
return %deplObj;
}
function SpawnPointDeployableImage::onMount(%data,%obj,%node) {
%obj.hasSpawn = true;
%obj.packSet = 0;
displayPowerFreq(%obj);
%obj.hasSpawn = true;
%obj.packSet = 0;
displayPowerFreq(%obj);
}
function SpawnPointDeployableImage::onUnmount(%data,%obj,%node) {
%obj.hasSpawn = "";
%obj.packSet = 0;
%obj.hasSpawn = "";
%obj.packSet = 0;
}

View file

@ -2418,9 +2418,6 @@ function Armor::onAdd(%data,%obj)
%obj.rechargeShields(%data.shieldHeathCharge);
%obj.activeShieldEffect();
}
//TWM2: Activate Armor Effect
if(isClientControlledPlayer(%obj))
%obj.client.setActiveAE(%obj.client.getActiveAE());
}
function Armor::onRemove(%this, %obj)
@ -3049,7 +3046,7 @@ function Armor::onCollision(%this,%obj,%col,%forceVehicleNode)
return;
}
%obj.scriptkill($DamageType::Admin);
%col.setDamageLevel(%col.getDamageLevel() - 25.0);
%col.setDamageLevel(%col.getDamageLevel() - 10.0);
%col.setVelocity("0 0 0");
if(!%obj.iszombie) {
ServerPlay3d(BOVHitSound, %obj.getPosition());
@ -3414,9 +3411,20 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
}
return;
}
if(%damageType == $DamageType::Impact)
if(%sourceObject.getDamageState() $= "Destroyed")
if(%damageType == $DamageType::Impact) {
if(%sourceObject.getDamageState() $= "Destroyed") {
return;
}
//Check for the mother of all humiliating deaths :)
if(%targetObject.getState() $= "dead") {
if(%sourceObject.getClassName() $= "FlyingVehicle" && %sourceObject.lastPilot.getState() $= "dead") {
if((%sourceObject.lastPilot.client.lastKilledBy == %targetObject.client) && (%sourceObject.lastPilot.client.lastKilledByPlayer == %targetObject)) {
//You just got rekt....
CompleteNWChallenge(%sourceObject.lastPilot.client, "Uncomprehendable");
}
}
}
}
%armortype = %targetobject.getdatablock().getname();
if (%damageType == $DamageType::ZAcid && %armortype !$= "ZombieArmor" && %armortype !$= "FZombieArmor" && %armortype !$= "LordZombieArmor" && %armortype !$= "DemonZombieArmor" && %armortype !$= "DemonMotherZombieArmor" && %armortype !$= "RapierZombieArmor" && %targetobject.infected != 1 && (%sourceObject.isZombie == 1 || %sourceObject.isBoss == 1)){
%targetObject.Infected = 1;
@ -3585,31 +3593,9 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
//now call the "onKilled" function if the client was... you know...
if(%targetObject.getState() $= "Dead") {
//Is there a boss going?
if(!%targetObject.isZombie && !%targetObject.isBossMinion) {
if($TWM2::BossGoing) {
//Chalk up the kill count :P
$TWM2::BossManager.addKill(%targetObject);
}
}
if(%targetObject.isVardisonMinion) {
$TWM2::VardisonManager.minionCount--;
}
if($TWM2::PlayingSabo) {
if(Game.Bomb.Carrier == %targetObject) {
if(%damageType == $DamageType::FellOff) {
MessageAll('msgWhoops', "\c5SABOTAGE: Bomb Reset.");
Game.BombDropped(Game.Bomb, %targetObject);
Game.bomb.setPosition($SabotageGame::BombLocation[$CurrentMission]);
}
else {
Game.BombDropped(Game.Bomb, %targetObject);
}
}
}
// where did this guy get it?
%damLoc = %targetObject.getDamageLocation(%position);
%damLoc = %targetObject.getDamageLocation(%position);
postObjectDestroyed(%sourceObject, %targetObject, %damageType, %damLoc);
// should this guy be blown apart?
if( %damageType == $DamageType::Explosion ||
@ -3638,95 +3624,6 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
// If we were killed, max out the flash
%targetObject.setDamageFlash(0.75);
%damLoc = %targetObject.getDamageLocation(%position);
if($TWM2::UseGoreMod) {
CreateBlood(%targetObject);
}
if(%damageType == $DamageType::RapierShield) {
if(%sourceObject.client !$= "") {
UpdateWeaponKillFile(%sourceObject.client, "rapierShieldImage");
}
}
if(%targetObject.isZombie) {
if($TWM::PlayingHorde == 1) {
if($HordeGame::Zombiecount > 0) { //ha! this should stop multiple waves from spawning
$HordeGame::Zombiecount--;
messageAll('MsgSPCurrentObjective1' ,"", "Wave "@$HordeGame::CurrentWave@" | Zombies Left: "@$HordeGame::Zombiecount@"");
}
//Echo("Horde: Zombie Killed, "@$HordeGame::Zombiecount@" remain."); //was used for debugging
if($HordeGame::Zombiecount <= 0) {
HordeNextWave($HordeGame::Game, $HordeGame::NextWave); //working on this
}
}
//
if($TWM::PlayingHelljump == 1) {
if($HellJump::Zombiecount > 0) { //ha! this should stop multiple waves from spawning
$HellJump::Zombiecount--;
messageAll('MsgSPCurrentObjective1' ,"", "[W"@$HellJump::CurrentWave@"|G"@$HellJump::CurrentGroup@"|S"@$HellJump::CurrentStrike@"] | Zombies Left: "@$HellJump::Zombiecount@"");
}
//Echo("Horde: Zombie Killed, "@$HordeGame::Zombiecount@" remain."); //was used for debugging
if($HellJump::Zombiecount <= 0) {
$HellJump::Game.GoNextStrike();
}
}
//
Game.ZkillUpdateScore(%sourceClient, %sourceObject, %targetObject);
%sourceObject.zombiekillsinarow++;
DoZKillstreakChecks(%sourceClient);
}
else {
%targetObject.client.playDeathArmorEffect();
if(%targetObject.team != %sourceClient.team && !%targetObject.isBoss) {
if(isObject(%sourceClient) && %sourceClient.IsActivePerk("Double Down")) {
GainExperience(%sourceClient, $TWM2::KillXPGain * 2, "[D-D]Enemy Killed ");
}
else {
GainExperience(%sourceClient, $TWM2::KillXPGain, "Enemy Killed ");
}
//Team Gain Perk
if(isObject(%sourceClient) && %sourceClient.IsActivePerk("Team Gain")) {
%TargetSearchMask = $TypeMasks::PlayerObjectType;
InitContainerRadiusSearch(%sourceObject.getPosition(), 20, %TargetSearchMask); //small distance
while ((%potentialTarget = ContainerSearchNext()) != 0){
if (%potentialTarget.getPosition() != %pos) {
if(%potentialTarget.client.team == %sourceClient.team && %potentialTarget != %sourceObject) {
GainExperience(%potentialTarget.client, $TWM2::KillXPGain, "Team Gain From "@%sourceClient.namebase@" ");
}
}
}
}
//End
doChallengeCheck(%sourceClient, %targetClient);
%sourceObject.killsinarow++;
%sourceObject.killsinarow2++;
//TWM2 3.2 -> Successive Kills
%sourceObject.kills[%damageType]++;
PerformSuccessiveKills(%sourceObject, %damageType);
//
if(%sourceObject.killsinarow2 == 10) {
MessageAll('MsgWOW', "\c2TWM2: "@%sourceClient.namebase@" is on a killsteak of 10");
awardClient(%sourceClient, "14");
}
if(%sourceObject.killsinarow2 == 20) {
MessageAll('MsgWOW', "\c2TWM2: "@%sourceClient.namebase@" is on a killsteak of 20");
}
if(%sourceObject.killsinarow2 == 25) {
MessageAll('MsgWOW', "\c2TWM2: "@%sourceClient.namebase@" is on a killsteak of 25");
}
DoKillstreakChecks(%sourceClient);
}
}
//Challenges!
doChallengeKillRecording(%sourceObject, %targetObject);
//
//martydom
if(%targetClient !$= "" && %targetClient.IsActivePerk("Martydom")) {
serverPlay3d(SatchelChargeActivateSound, %targetObject.getPosition());
schedule(2200, 0, "MartydomExplode", %targetObject.getPosition(), %targetClient);
}
Game.onClientKilled(%targetClient, %sourceClient, %damageType, %sourceObject, %damLoc);
}
else if ( %amount > 0.1 )
@ -3742,8 +3639,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
}
function Armor::onImpact(%data, %playerObject, %collidedObject, %vec, %vecLen) {
%data.damageObject(%playerObject, 0, VectorAdd(%playerObject.getPosition(),%vec),
%vecLen * %data.speedDamageScale , $DamageType::Ground);
%data.damageObject(%playerObject, 0, VectorAdd(%playerObject.getPosition(),%vec), %vecLen * %data.speedDamageScale , $DamageType::Ground);
// if (%collidedObject & $TypeMasks::PlayerObjectType) {
// if (%collidedObject.getState() !$= "Dead") {
// %data.damageObject(%collidedObject, 0, VectorAdd(%playerObject.getPosition(),%vec),

View file

@ -17,9 +17,15 @@
//
function ProjectileData::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal) {
if(isObject(%targetObject)) { // Console spam fix - ToS. z0ddm0d
if(!(%targetObject.getType() & ($TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType)) && (%targetObject.getDataBlock().getClassName() $= "PlayerData")) {
%damLoc = firstWord(%targetObject.getDamageLocation(%position));
%test = TWM2Damage(%projectile, %targetObject, %data.directDamage, %data.directDamageType, %damLoc, "projectile");
if(!(%targetObject.getType() & ($TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType))
&& (%targetObject.getType() & ($TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType))) {
if(%targetObject.getType() & $TypeMasks::PlayerObjectType) {
%damLoc = firstWord(%targetObject.getDamageLocation(%position));
}
else {
%damLoc = "";
}
%test = CalculateProjectileDamage(%projectile, %targetObject, %data.directDamage, %data.directDamageType, %damLoc, "projectile");
if(%test == 0) {
return;
}
@ -27,9 +33,8 @@ function ProjectileData::onCollision(%data, %projectile, %targetObject, %modifie
}
%targetObject.lastDamagedImage = %projectile.getDatablock().ImageSource;
%targetObject.damage(%projectile.sourceObject, %position, %modifier * %data.directDamage, %data.directDamageType);
//After Damage Stuff For Player Objects
if(%targetObject.isPlayer()) {
if (!(%targetObject.getType() & ($TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType)) && %targetObject.getDataBlock().getClassName() $= "PlayerData") {
if(%targetObject.getState() $= "dead") {
if(%projectile.sourceObject.client !$= "") {
if(%projectile.getDatablock().getName() !$= "GrenadeShrapnel") {
@ -595,7 +600,7 @@ function RadiusExplosion(%explosionSource, %position, %radius, %damage, %impulse
if (%dist > %radius)
continue;
%modifier = TWM2Damage(%explosionSource, %targetObject, %damage, %damageType, "", "explosion");
%modifier = CalculateProjectileDamage(%explosionSource, %targetObject, %damage, %damageType, "", "explosion");
if(%modifier == 0) {
return;
}

View file

@ -523,366 +523,176 @@ function addDemoAlias( %name )
$DemoNameCount++;
}
if ( isDemo() )
{
addDemoAlias( "Butterfingers" );
addDemoAlias( "Bullseye" );
addDemoAlias( "Casualty" );
addDemoAlias( "Dogfood" );
addDemoAlias( "Extinct" );
addDemoAlias( "Fodder" );
addDemoAlias( "Grunt" );
addDemoAlias( "Helpless" );
addDemoAlias( "Itchy" );
addDemoAlias( "Bait" );
addDemoAlias( "Kibble" );
addDemoAlias( "MonkeyBoy" );
addDemoAlias( "Meat" );
addDemoAlias( "Newbie" );
addDemoAlias( "Owned" );
addDemoAlias( "Poser" );
addDemoAlias( "Quaker" );
addDemoAlias( "Roadkill" );
addDemoAlias( "SkidMark" );
addDemoAlias( "EZTarget" );
addDemoAlias( "Underdog" );
addDemoAlias( "Vegetable" );
addDemoAlias( "Weakling" );
addDemoAlias( "Flatline" );
addDemoAlias( "Spud" );
addDemoAlias( "Zero" );
addDemoAlias( "WetNose" );
addDemoAlias( "Chowderhead" );
addDemoAlias( "Clown" );
addDemoAlias( "Dodo" );
addDemoAlias( "Endangered" );
addDemoAlias( "Feeble" );
addDemoAlias( "Gimp" );
addDemoAlias( "Inky" );
addDemoAlias( "Pinky" );
addDemoAlias( "Blinky" );
addDemoAlias( "Clyde" );
addDemoAlias( "Loopy" );
addDemoAlias( "Masochist" );
addDemoAlias( "Pancake" );
addDemoAlias( "Rubbish" );
addDemoAlias( "Sickly" );
addDemoAlias( "Terminal" );
addDemoAlias( "Ugly Duckling" );
addDemoAlias( "Sheepish" );
addDemoAlias( "Whiplash" );
addDemoAlias( "KickMe" );
addDemoAlias( "Yellow Belly" );
addDemoAlias( "Bits" );
addDemoAlias( "Doofus" );
addDemoAlias( "Fluffy Bunny" );
addDemoAlias( "Lollipop" );
addDemoAlias( "Troglodyte" );
addDemoAlias( "Carcass" );
addDemoAlias( "Noodle" );
addDemoAlias( "Spastic" );
addDemoAlias( "Wimpy" );
addDemoAlias( "Sweet Pea" );
addDemoAlias( "Abused" );
addDemoAlias( "Happy Camper" );
addDemoAlias( "FreakShow" );
addDemoAlias( "Bumpkin" );
addDemoAlias( "Mad Cow" );
addDemoAlias( "Cud" );
}
function pickDemoName()
{
// Pick a unique name if possible:
%idx = mFloor( getRandom() * $DemoNameCount );
for ( %i = 0; %i < $DemoNameCount; %i++ )
{
%name = $DemoName[mMod( %idx + %i, $DemoNameCount )];
%isUnique = true;
%count = ClientGroup.getCount();
for ( %ci = 0; %ci < %count; %ci++ )
{
if ( strcmp( %name, detag( getTaggedString( ClientGroup.getObject( %ci ).name ) ) ) == 0 )
{
%isUnique = false;
break;
}
}
if ( %isUnique )
break;
}
// Append a number to make the alias unique:
if ( !%isUnique )
{
%suffix = 1;
while ( !%isUnique )
{
%nameTry = %name @ "." @ %suffix;
%isUnique = true;
%count = ClientGroup.getCount();
for ( %i = 0; %i < %count; %i++ )
{
if ( strcmp( %nameTry, detag( getTaggedString( ClientGroup.getObject( %i ).name ) ) ) == 0 )
{
%isUnique = false;
break;
}
}
%suffix++;
}
// Success!
%name = %nameTry;
}
return( %name );
//Phantom139: Do we even need this???
return "DemoPlayer";
}
function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice, %voicePitch ) {
%client.setMissionCRC($missionCRC);
sendLoadInfoToClient( %client );
if(%client.getAddress() $= "Local") {
%client.isAdmin = true;
%client.isSuperAdmin = true;
}
// Get the client's unique id:
%authInfo = %client.getAuthInfo();
%client.guid = getField( %authInfo, 3 );
// check admin and super admin list, and set status accordingly
if ( !%client.isSuperAdmin ) {
if ( isOnSuperAdminList( %client ) ) {
%client.isAdmin = true;
%client.isSuperAdmin = true;
}
else if( isOnAdminList( %client ) ) {
%client.isAdmin = true;
}
}
// Sex/Race defaults
switch$ ( %raceGender ) {
case "Human Male":
%client.sex = "Male";
%client.race = "Human";
case "Human Female":
%client.sex = "Female";
%client.race = "Human";
case "Bioderm":
%client.sex = "Male";
%client.race = "Bioderm";
default:
error("Invalid race/gender combo passed: " @ %raceGender);
%client.sex = "Male";
%client.race = "Human";
}
%client.armor = "Light";
// Override the connect name if this server does not allow smurfs:
%realName = getField( %authInfo, 0 );
if ( $PlayingOnline && $Host::NoSmurfs ) {
%name = %realName;
}
//set the default killstreaks (1, 2, and 4)
%client.KillstreakOn[1] = 1;
%client.KillstreakOn[2] = 1;
%client.KillstreakOn[4] = 1;
//%client.setSimulatedNetParams(0.1, 30);
if (isDemo() && $CurrentMissionType !$= "SinglePlayer")
{
%client.armor = "Light";
%client.sex = "Male";
%client.race = "Human";
%client.nameBase = pickDemoName();
%client.name = addTaggedString( %client.nameBase );
%client.voice = "Male1";
%client.voiceTag = addTaggedString( "Male1" );
if ( %client & 1 )
%client.skin = addTaggedString( "swolf" );
else
%client.skin = addTaggedString( "beagle" );
}
else
{
// if hosting this server, set this client to superAdmin
if (%client.getAddress() $= "Local")
{
%client.isAdmin = true;
%client.isSuperAdmin = true;
}
// Get the client's unique id:
%authInfo = %client.getAuthInfo();
%client.guid = getField( %authInfo, 3 );
// check admin and super admin list, and set status accordingly
if ( !%client.isSuperAdmin )
{
if ( isOnSuperAdminList( %client ) )
{
%client.isAdmin = true;
%client.isSuperAdmin = true;
}
else if ( isOnAdminList( %client ) )
{
%client.isAdmin = true;
}
}
// Sex/Race defaults
switch$ ( %raceGender )
{
case "Human Male":
%client.sex = "Male";
%client.race = "Human";
case "Human Female":
%client.sex = "Female";
%client.race = "Human";
case "Bioderm":
%client.sex = "Male";
%client.race = "Bioderm";
default:
error("Invalid race/gender combo passed: " @ %raceGender);
%client.sex = "Male";
%client.race = "Human";
}
%client.armor = "Light";
// Override the connect name if this server does not allow smurfs:
%realName = getField( %authInfo, 0 );
if ( $PlayingOnline && $Host::NoSmurfs ) {
%client.smurfName = %name;
%name = %realName;
}
if ( strcmp( %name, %realName ) == 0 )
{
%client.isSmurf = false;
//make sure the name is unique - that a smurf isn't using this name...
%dup = -1;
%count = ClientGroup.getCount();
for (%i = 0; %i < %count; %i++)
{
%test = ClientGroup.getObject( %i );
if (%test != %client)
{
%rawName = stripChars( detag( getTaggedString( %test.name ) ), "\cp\co\c6\c7\c8\c9" );
if (%realName $= %rawName)
{
%dup = %test;
%dupName = %rawName;
if ( strcmp( %name, %realName ) == 0 ) {
%client.isSmurf = false;
//make sure the name is unique - that a smurf isn't using this name...
%dup = -1;
%count = ClientGroup.getCount();
for (%i = 0; %i < %count; %i++) {
%test = ClientGroup.getObject( %i );
if (%test != %client) {
%rawName = stripChars( detag( getTaggedString( %test.name ) ), "\cp\co\c6\c7\c8\c9" );
if (%realName $= %rawName) {
%dup = %test;
%dupName = %rawName;
break;
}
}
}
//see if we found a duplicate name
if (isObject(%dup)) {
//change the name of the dup
%isUnique = false;
%suffixCount = 1;
while (!%isUnique) {
%found = false;
%testName = %dupName @ "." @ %suffixCount;
for (%i = 0; %i < %count; %i++) {
%cl = ClientGroup.getObject(%i);
%rawName = stripChars( detag( getTaggedString( %cl.name ) ), "\cp\co\c6\c7\c8\c9" );
if (%rawName $= %testName) {
%found = true;
break;
}
}
}
//see if we found a duplicate name
if (isObject(%dup))
{
//change the name of the dup
%isUnique = false;
%suffixCount = 1;
while (!%isUnique)
{
%found = false;
%testName = %dupName @ "." @ %suffixCount;
for (%i = 0; %i < %count; %i++)
{
%cl = ClientGroup.getObject(%i);
%rawName = stripChars( detag( getTaggedString( %cl.name ) ), "\cp\co\c6\c7\c8\c9" );
if (%rawName $= %testName)
{
%found = true;
break;
}
}
if (%found)
%suffixCount++;
else
%isUnique = true;
if (%found) {
%suffixCount++;
}
else {
%isUnique = true;
}
//%testName will now have the new unique name...
%oldName = %dupName;
%newName = %testName;
MessageAll( 'MsgSmurfDupName', '\c2The real \"%1\" has joined the server.', %dupName );
MessageAll( 'MsgClientNameChanged', '\c2The smurf \"%1\" is now called \"%2\".', %oldName, %newName, %dup );
%dup.name = addTaggedString(%newName);
setTargetName(%dup.target, %dup.name);
}
//%testName will now have the new unique name...
%oldName = %dupName;
%newName = %testName;
MessageAll( 'MsgSmurfDupName', '\c2The real \"%1\" has joined the server.', %dupName );
MessageAll( 'MsgClientNameChanged', '\c2The smurf \"%1\" is now called \"%2\".', %oldName, %newName, %dup );
%dup.name = addTaggedString(%newName);
setTargetName(%dup.target, %dup.name);
}
// Add the tribal tag:
%tag = getField( %authInfo, 1 );
%append = getField( %authInfo, 2 );
if ( %append ) {
%name = "\cp\c6" @ %name @ "\c7" @ %tag @ "\co";
}
else {
%name = "\cp\c7" @ %tag @ "\c6" @ %name @ "\co";
}
%client.sendGuid = %client.guid;
}
else {
%client.isSmurf = true;
%client.sendGuid = 0;
%name = stripTrailingSpaces( strToPlayerName( %name ) );
if ( strlen( %name ) < 3 ) {
%name = "Poser";
}
// Make sure the alias is unique:
%isUnique = true;
%count = ClientGroup.getCount();
for ( %i = 0; %i < %count; %i++ ) {
%test = ClientGroup.getObject( %i );
%rawName = stripChars( detag( getTaggedString( %test.name ) ), "\cp\co\c6\c7\c8\c9" );
if ( strcmp( %name, %rawName ) == 0 ) {
%isUnique = false;
break;
}
}
// Append a number to make the alias unique:
if ( !%isUnique ) {
%suffix = 1;
while ( !%isUnique ) {
%nameTry = %name @ "." @ %suffix;
%isUnique = true;
// Add the tribal tag:
%tag = getField( %authInfo, 1 );
%append = getField( %authInfo, 2 );
if ( %append )
%name = "\cp\c6" @ %name @ "\c7" @ %tag @ "\co";
else
%name = "\cp\c7" @ %tag @ "\c6" @ %name @ "\co";
%count = ClientGroup.getCount();
for ( %i = 0; %i < %count; %i++ ) {
%test = ClientGroup.getObject( %i );
%rawName = stripChars( detag( getTaggedString( %test.name ) ), "\cp\co\c6\c7\c8\c9" );
if ( strcmp( %nameTry, %rawName ) == 0 ) {
%isUnique = false;
break;
}
}
%suffix++;
}
// Success!
%name = %nameTry;
}
%smurfName = %name;
// Tag the name with the "smurf" color:
%name = "\cp\c8" @ %name @ "\co";
}
%client.name = addTaggedString(%name);
if(%client.isSmurf)
%client.nameBase = %smurfName;
else
%client.nameBase = %realName;
%client.sendGuid = %client.guid;
}
else
{
%client.isSmurf = true;
%client.sendGuid = 0;
%name = stripTrailingSpaces( strToPlayerName( %name ) );
if ( strlen( %name ) < 3 )
%name = "Poser";
// Make sure that the connecting client is not trying to use a bot skin:
%temp = detag( %skin );
if ( %temp $= "basebot" || %temp $= "basebbot" )
%client.skin = addTaggedString( "base" );
else
%client.skin = addTaggedString( %skin );
// Make sure the alias is unique:
%isUnique = true;
%count = ClientGroup.getCount();
for ( %i = 0; %i < %count; %i++ )
{
%test = ClientGroup.getObject( %i );
%rawName = stripChars( detag( getTaggedString( %test.name ) ), "\cp\co\c6\c7\c8\c9" );
if ( strcmp( %name, %rawName ) == 0 )
{
%isUnique = false;
break;
}
}
// Append a number to make the alias unique:
if ( !%isUnique )
{
%suffix = 1;
while ( !%isUnique )
{
%nameTry = %name @ "." @ %suffix;
%isUnique = true;
%count = ClientGroup.getCount();
for ( %i = 0; %i < %count; %i++ )
{
%test = ClientGroup.getObject( %i );
%rawName = stripChars( detag( getTaggedString( %test.name ) ), "\cp\co\c6\c7\c8\c9" );
if ( strcmp( %nameTry, %rawName ) == 0 )
{
%isUnique = false;
break;
}
}
%suffix++;
}
// Success!
%name = %nameTry;
}
%smurfName = %name;
// Tag the name with the "smurf" color:
%name = "\cp\c8" @ %name @ "\co";
}
$XPArray[%client] = 0;
%client.CheckPGDConnect(); // <-- Used for Universal features
PGD_IsFileDL("Data/"@%client.guid@"/Ranks/TWM2/Saved.TWMSave");
schedule(7000, 0, "LoadUniversalRank", %client);
%client.name = addTaggedString(%name);
if (%client.isSmurf)
%client.nameBase = %smurfName;
else
%client.nameBase = %realName;
// Make sure that the connecting client is not trying to use a bot skin:
%temp = detag( %skin );
if ( %temp $= "basebot" || %temp $= "basebbot" )
%client.skin = addTaggedString( "base" );
else
%client.skin = addTaggedString( %skin );
if ($Host::NoAnnoyingVoiceChatSpam && %voice $= "") {
switch$ ( %raceGender ) {
case "Human Male":
%voice = "Male1";
case "Human Female":
%voice = "Fem1";
case "Bioderm":
%voice = "Derm1";
default:
%voice = "Male1";
}
}
%client.voice = %voice;
%client.voiceTag = addtaggedString(%voice);
//set the voice pitch based on a lookup table from their chosen voice
%client.voicePitch = getValidVoicePitch(%voice, %voicePitch);
}
%client.voice = %voice;
%client.voiceTag = addtaggedString(%voice);
//set the voice pitch based on a lookup table from their chosen voice
%client.voicePitch = getValidVoicePitch(%voice, %voicePitch);
// z0dd - ZOD, 9/29/02. Removed T2 demo code from here
// ---------------------------------------------------
%client.justConnected = true;
%client.isReady = false;
@ -893,168 +703,98 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
%client.target = allocClientTarget(%client, %client.name, %client.skin, %client.voiceTag, '_ClientConnection', 0, 0, %client.voicePitch);
%client.score = 0;
%client.team = 0;
$instantGroup = ServerGroup;
$instantGroup = MissionCleanup;
echo("CADD: " @ %client @ " " @ %client.getAddress());
LogConnection(%client, 1);
%count = ClientGroup.getCount();
for(%cl = 0; %cl < %count; %cl++)
{
%recipient = ClientGroup.getObject(%cl);
if ((%recipient != %client))
if((%recipient != %client))
{
// These should be "silent" versions of these messages...
messageClient(%client, 'MsgClientJoin', "",
%recipient.name,
%recipient,
%recipient.target,
%recipient.isAIControlled(),
%recipient.isAdmin,
%recipient.isSuperAdmin,
%recipient.isSmurf,
messageClient(%client, 'MsgClientJoin', "",
%recipient.name,
%recipient,
%recipient.target,
%recipient.isAIControlled(),
%recipient.isAdmin,
%recipient.isSuperAdmin,
%recipient.isSmurf,
%recipient.sendGuid);
messageClient(%client, 'MsgClientJoinTeam', "", %recipient.name, $teamName[%recipient.team], %recipient, %recipient.team );
messageClient(%client, 'MsgClientJoinTeam', "", %recipient.name, $teamName[%recipient.team], %recipient, %recipient.team );
}
}
// commandToClient(%client, 'getManagerID', %client);
commandToClient(%client, 'setBeaconNames', "Target Beacon", "Marker Beacon", "Bomb Target");
if ( $CurrentMissionType !$= "SinglePlayer" )
if ( $CurrentMissionType !$= "SinglePlayer" )
{
if ( isDemo() )
{
messageClient(%client, 'MsgClientJoin', '\c2Welcome to the Tribes 2 Demo!',
%client.name,
%client,
%client.target,
false, // isBot
%client.isAdmin,
%client.isSuperAdmin,
%client.isSmurf,
%client.sendGuid );
}
else
{
messageClient(%client, 'MsgClientJoin', '\c2Welcome to Tribes2 %1. ~wfx/Bonuses/Nouns/major.wav',
%client.name,
%client,
%client.target,
false, // isBot
%client.isAdmin,
%client.isSuperAdmin,
%client.isSmurf,
%client.sendGuid );
}
messageAllExcept(%client, -1, 'MsgClientJoin', '\c1%1 joined the game. ~wfx/Bonuses/Nouns/major.wav',
%client.name,
%client,
%client.target,
false, // isBot
%client.isAdmin,
%client.isSuperAdmin,
%client.isSmurf,
%client.sendGuid );
// z0dd - ZOD, 9/29/02. Removed T2 demo code from here
messageClient(%client, 'MsgClientJoin', '\c2Welcome to Total Warfare Mod 2 %1. ~wfx/Bonuses/Nouns/major.wav',
%client.name,
%client,
%client.target,
false, // isBot
%client.isAdmin,
%client.isSuperAdmin,
%client.isSmurf,
%client.sendGuid );
// z0dd - ZOD, 9/29/02. Removed T2 demo code from here
messageAllExcept(%client, -1, 'MsgClientJoin', '\c1%1 joined the game. ~wfx/Bonuses/Nouns/major.wav',
%client.name,
%client,
%client.target,
false, // isBot
%client.isAdmin,
%client.isSuperAdmin,
%client.isSmurf,
%client.sendGuid );
}
else
messageClient(%client, 'MsgClientJoin', "\c0Mission Insertion complete...",
%client.name,
%client,
%client.target,
false, // isBot
false, // isAdmin
false, // isSuperAdmin
messageClient(%client, 'MsgClientJoin', "\c0Mission Insertion complete...",
%client.name,
%client,
%client.target,
false, // isBot
false, // isAdmin
false, // isSuperAdmin
false, // isSmurf
%client.sendGuid );
%opt = "\c2Server Options:";
if ($MissionRunning == true)
%opt = %opt @ "\nTime limit: " @ mFloor((($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime())/1000/60) @ " / " @ $Host::TimeLimit;
else
%opt = %opt @ "\nTime limit: " @ $Host::TimeLimit;
%opt = %opt @ "\nMax players: " @ $Host::MaxPlayers @
"\nTeam Damage: " @ ($Host::TeamDamageOn ? "On" : "Off") @
"\nPurebuild: " @ ($Host::Purebuild ? "On" : "Off") @
"\nCascade: " @ ($Host::Cascade ? "On" : "Off") @
"\nHazard Mode: " @ ($Host::Hazard::Enabled ? "On" : "Off") @
"\nMTC Mode: " @ ($Host::MTC::Enabled ? "On" : "Off") @
"\nExpert Mode: " @ ($Host::ExpertMode ? "On" : "Off") @
"\nPrison: " @ ($Host::Prison::Enabled ? "On" : "Off");
messageClient(%client,'msgClient',%opt);
//Game.missionStart(%client);
setDefaultInventory(%client);
CheckGUID(%client);
if ($TWM2::UseRankTags) {
schedule(15000, 0, "DoNameChangeChecks", %client);
}
%client.canSaveRank = 1;
%client.canLoadRank = 1;
if($Phantom::serverClosed) {
if(!%client.isdev) {
MessageAll('Message', "\c2"@%client.namebase@" Tryed to join the server, but it is locked.");
%client.delete();
messageClient(%client, 'onClientKicked', "");
messageAllExcept( %client, -1, 'MsgClientDrop', "", %client.namebase, %client );
%client.setDisconnectReason( "Sorry, This Server is Locked To Any Additional Clients, Try back Later" );
return;
}
}
if ($missionRunning)
%client.startMission();
$HostGamePlayerCount++;
%client.demoJustJoined = true;
getRealName(%client);
getRealName(%client);
%logname = getTaggedString(%client.name);
%logname = strreplace(%logname,"\x10","");
%logname = strreplace(%logname,"\x11","");
%logname = strreplace(%logname,"\c8","");
%logname = strreplace(%logname,"\c7","");
%logname = strreplace(%logname,"\c6","");
%logname = getTaggedString(%client.name);
%logname = strreplace(%logname,"\x10","");
%logname = strreplace(%logname,"\x11","");
%logname = strreplace(%logname,"\c8","");
%logname = strreplace(%logname,"\c7","");
%logname = strreplace(%logname,"\c6","");
%logExport = formatTimeString(yy) @ "/" @ formatTimeString(mm) @ "/" @ formatTimeString(dd);
%logExport = %logExport SPC formatTimeString(h) @ ":" @ formatTimeString(n) @ "." @ formatTimeString(s) SPC formatTimeString(a);
%logExport = %logExport SPC "Connection. " @ %client.getAddress() SPC " GUID: " @ %client.guid;
%logExport = %logExport SPC "Name: " @ %logname;
if (%client.isSmurf)
%logExport = %logExport SPC "Real Name: " @ getRealName(%client, "echo");
%logExport = formatTimeString(yy) @ "/" @ formatTimeString(mm) @ "/" @ formatTimeString(dd);
%logExport = %logExport SPC formatTimeString(h) @ ":" @ formatTimeString(n) @ "." @ formatTimeString(s) SPC formatTimeString(a);
%logExport = %logExport SPC "Connection. " @ %client.getAddress() SPC " GUID: " @ %client.guid;
%logExport = %logExport SPC "Name: " @ %logname;
if (%client.isSmurf)
%logExport = %logExport SPC "Real Name: " @ getRealName(%client, "echo");
if ($Construction::Logging::LogConnects)
exportToLog(%logexport, "Logs/Connections/" @ formatTimeString(yy) @ "-" @ formatTimeString(mm) @ "-" @ formatTimeString(dd) @ ".log");
if ($Construction::Logging::LogConnects)
exportToLog(%logexport, "Logs/Connections/" @ formatTimeString(yy) @ "-" @ formatTimeString(mm) @ "-" @ formatTimeString(dd) @ ".log");
}
function RemoveOrphansLoop(%tick) {
if(%tick > $TWM2::RemoveOrphansTime) {
MessageAll('MsgCyn', "\c4Cynthia: Removing Orphaned Deployables Now.");
if(isObject(Game)) {
delOrphanedPieces(true);
Game.removeDepTime = getSimTime() + delOrphanedPieces(true) + 1000;
}
return;
}
%tick++;
schedule(1000, 0, "RemoveOrphansLoop", %tick);
TWM2Lib_MainControl("clientConnectionFunction", %client);
}
function GameConnection::onDrop(%client, %reason) {
SaveClientFile(%client);
PrepareUpload(%client); //universally upload it (if we can)
LogConnection(%client, 4);
TWM2Lib_MainControl("clientDropFunction_PreClientKill", %client);
if (isObject(Game))
Game.onClientLeaveGame(%client);
@ -1064,25 +804,21 @@ function GameConnection::onDrop(%client, %reason) {
else
messageAllExcept(%client, -1, 'MsgClientDrop', '\c1%1 has left the game.', getTaggedString(%client.name), %client);
MessageAll('MsgCyn', "\c4Cynthia: Removing Orphaned Deployables in "@MFloor($TWM2::RemoveOrphansTime/60)@" Minutes");
schedule(1000, 0, "RemoveOrphansLoop", 1);
%logname = getTaggedString(%client.name);
%logname = strreplace(%logname,"\x10","");
%logname = strreplace(%logname,"\x11","");
%logname = strreplace(%logname,"\c8","");
%logname = strreplace(%logname,"\c7","");
%logname = strreplace(%logname,"\c6","");
%logname = getTaggedString(%client.name);
%logname = strreplace(%logname,"\x10","");
%logname = strreplace(%logname,"\x11","");
%logname = strreplace(%logname,"\c8","");
%logname = strreplace(%logname,"\c7","");
%logname = strreplace(%logname,"\c6","");
%logExport = formatTimeString(yy) @ "/" @ formatTimeString(mm) @ "/" @ formatTimeString(dd);
%logExport = %logExport SPC formatTimeString(h) @ ":" @ formatTimeString(n) @ "." @ formatTimeString(s) SPC formatTimeString(a);
%logExport = %logExport SPC "Disconnect. " @ %client.getAddress() SPC " GUID: " @ %client.guid;
%logExport = %logExport SPC "Name: " @ %logname;
if (%client.isSmurf)
%logExport = formatTimeString(yy) @ "/" @ formatTimeString(mm) @ "/" @ formatTimeString(dd);
%logExport = %logExport SPC formatTimeString(h) @ ":" @ formatTimeString(n) @ "." @ formatTimeString(s) SPC formatTimeString(a);
%logExport = %logExport SPC "Disconnect. " @ %client.getAddress() SPC " GUID: " @ %client.guid;
%logExport = %logExport SPC "Name: " @ %logname;
if (%client.isSmurf)
%logExport = %logExport SPC "Real Name: " @ getRealName(%client, "echo");
if ($Construction::Logging::LogConnects)
exportToLog(%logexport, "Logs/Connections/" @ formatTimeString(yy) @ "-" @ formatTimeString(mm) @ "-" @ formatTimeString(dd) @ ".log");
if ($Construction::Logging::LogConnects)
exportToLog(%logexport, "Logs/Connections/" @ formatTimeString(yy) @ "-" @ formatTimeString(mm) @ "-" @ formatTimeString(dd) @ ".log");
if ( isObject( %client.camera ) )
%client.camera.delete();
@ -1094,14 +830,8 @@ function GameConnection::onDrop(%client, %reason) {
echo("CDROP: " @ %client @ " " @ %client.getAddress());
$HostGamePlayerCount--;
if($HostGamePlayerCount == 0 && $TWM2::CloseWhenDone) {
quit();
}
// reset the server if everyone has left the game
if ( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::Dedicated && !$resettingServer && !$LoadingMission )
schedule(0, 0, "resetServerDefaults");
TWM2Lib_MainControl("clientDropFunction_PostClientKill", %client);
}
function getRealName(%client, %sender)

View file

@ -370,75 +370,4 @@ function serverCmdScopeCommanderMap(%client, %scope)
%client.scopeCommanderMap(%scope);
commandToClient(%client, 'ScopeCommanderMap', %scope);
}
//From Battlelord:
function GetHigherNumber(%num1, %num2) {
//Are they equal?
if(%num1 == %num2) {
return %num1;
}
else if(%num1 > %num2) {
return %num1;
}
else {
return %num2;
}
}
//EXP
function getMaxGainedEXP(%client) {
if($MaxGainable $= "") {
%num1 = $TWM2::BossXPAward["Yvex"];
%num2 = $TWM2::BossXPAward["CnlWindshear"];
%num1 = GetHigherNumber(%num1, %num2);
%num2 = $TWM2::BossXPAward["GhostOfLightning"];
%num1 = GetHigherNumber(%num1, %num2);
%num2 = $TWM2::BossXPAward["Vengenor"];
%num1 = GetHigherNumber(%num1, %num2);
%num2 = $TWM2::BossXPAward["LordRog"];
%num1 = GetHigherNumber(%num1, %num2);
%num2 = $TWM2::BossXPAward["Insignia"];
%num1 = GetHigherNumber(%num1, %num2);
%num2 = $TWM2::BossXPAward["Stormrider"];
%num1 = GetHigherNumber(%num1, %num2);
%num2 = $TWM2::BossXPAward["Trebor"];
%num1 = GetHigherNumber(%num1, %num2);
%num2 = $TWM2::BossXPAward["GhostOfFire"];
%num1 = GetHigherNumber(%num1, %num2);
%num2 = $TWM2::BossXPAward["Vardison3"];
%num1 = GetHigherNumber(%num1, %num2);
$MaxGainable = %num1;
}
else {
%num1 = $TWM2::BossXPAward["Yvex"];
%num2 = $TWM2::BossXPAward["CnlWindshear"];
%num1 = GetHigherNumber(%num1, %num2);
%num2 = $TWM2::BossXPAward["GhostOfLightning"];
%num1 = GetHigherNumber(%num1, %num2);
%num2 = $TWM2::BossXPAward["Vengenor"];
%num1 = GetHigherNumber(%num1, %num2);
%num2 = $TWM2::BossXPAward["LordRog"];
%num1 = GetHigherNumber(%num1, %num2);
%num2 = $TWM2::BossXPAward["Insignia"];
%num1 = GetHigherNumber(%num1, %num2);
%num2 = $TWM2::BossXPAward["Stormrider"];
%num1 = GetHigherNumber(%num1, %num2);
%num2 = $TWM2::BossXPAward["Trebor"];
%num1 = GetHigherNumber(%num1, %num2);
%num2 = $TWM2::BossXPAward["GhostOfFire"];
%num1 = GetHigherNumber(%num1, %num2);
%num2 = $TWM2::BossXPAward["Vardison3"];
%num1 = GetHigherNumber(%num1, %num2);
//Sirens!!! We have a hack in!
//Close the server and inform Phantom139
if($MaxGainable != %num1) {
MessageAll('MsgAlert', "\c5TWM2: Server Hack-In Detected, Max EXP Has been Tampered. ~wfx/misc/red_alert.wav");
MessageAll('MsgAlert', "\c5TWM2: This server is forced to Satellite Mode, all EXP Gain has been canceled.");
MessageAll('MsgAlert', "\c5TWM2: An E-Mail has been dispatched to \c3Phantom139\c5 Server Shutdown in 5 Seconds.");
schedule(5000, 0, "DestroyServer");
schedule(8000, 0, "Quit");
}
}
return %num1;
}
}

View file

@ -116,7 +116,7 @@ datablock FlyingVehicleData(StrikeFlyer) : ShrikeDamageProfile
numDmgEmitterAreas = 1;
//
max[chaingunAmmo] = 1500;
max[MiniChaingunAmmo] = 1500;
max[MissileLauncherAmmo] = 2;
max[MortarAmmo] = 3;

View file

@ -763,7 +763,7 @@ function MakeTheHeli(%cl, %gunner) {
if(%gunner) {
%Heli = new FlyingVehicle() {
dataBlock = ApacheHelicopter;
position = VectorAdd(VectorAdd(getRandomPosition(250, 1), "500 0 150"), %cl.player.getPosition());
position = VectorAdd(VectorAdd(TWM2Lib_MainControl("getRandomPosition", 250 TAB 1), "500 0 150"), %cl.player.getPosition());
team = %cl.team;
};
MissionCleanup.add(%Heli);
@ -782,7 +782,7 @@ function MakeTheHeli(%cl, %gunner) {
else {
%Heli = new FlyingVehicle() {
dataBlock = CombatHelicopter;
position = VectorAdd(VectorAdd(getRandomPosition(250, 1), "500 0 150"), %cl.player.getPosition());
position = VectorAdd(VectorAdd(TWM2Lib_MainControl("getRandomPosition", 250 TAB 1), "500 0 150"), %cl.player.getPosition());
team = %cl.team;
};
MissionCleanup.add(%Heli);
@ -1002,7 +1002,7 @@ function Artillery(%CallerClient, %position) {
for(%i = 0; %i < 25; %i++) {
schedule(350*%i, 0, MessageAll, 'msgFiah', "~wfx/powered/turret_mortar_fire.wav");
%mainUpPos = vectoradd(%mainUpPos, "0 0 "@(300+(%i*75))@""); //increment by 100 each time
%final = vectoradd(%mainUpPos,GetRandomPosition(30,1));
%final = vectoradd(%mainUpPos, TWM2Lib_MainControl("getRandomPosition", 30 TAB 1));
%Shell1 = new GrenadeProjectile() {
dataBlock = AStrikeColliderShell;
initialPosition = %final;
@ -1037,7 +1037,7 @@ function MakeTheHeli2(%cl, %harrier) {
if(!%harrier) {
%Heli = new FlyingVehicle() {
dataBlock = GunshipHelicopter;
position = VectorAdd(VectorAdd(getRandomPosition(250, 1), "500 0 150"), %cl.player.getPosition());
position = VectorAdd(VectorAdd(TWM2Lib_MainControl("getRandomPosition", 250 TAB 1), "500 0 150"), %cl.player.getPosition());
team = %cl.team;
};
MissionCleanup.add(%Heli);
@ -1053,7 +1053,7 @@ function MakeTheHeli2(%cl, %harrier) {
else {
%Heli = new FlyingVehicle() {
dataBlock = Harrier;
position = VectorAdd(VectorAdd(getRandomPosition(250, 1), "500 0 150"), %cl.player.getPosition());
position = VectorAdd(VectorAdd(TWM2Lib_MainControl("getRandomPosition", 250 TAB 1), "500 0 150"), %cl.player.getPosition());
team = %cl.team;
};
MissionCleanup.add(%Heli);

View file

@ -272,22 +272,30 @@ function DoBOVRearKill(%source, %target, %count) {
%target.setvelocity("0 0 0");
}
else if(%count == 17) {
if(%target.isZombie) {
recordAction(%source.client, "BACK", "zombie");
if(%target.isPlayerRog && %target.getControllingClient() !$= "") {
if(!%source.client.CheckNWChallengeCompletion("CompletelyUnexpected")) {
CompleteNWChallenge(%source.client, "CompletelyUnexpected");
}
}
}
else {
recordAction(%source.client, "BACK", "player");
if(!%source.client.CheckNWChallengeCompletion("Assassin")) {
CompleteNWChallenge(%source.client, "Assassin");
}
}
//%target.blowup();//BAM!
ServerPlay3d(BOVHitSound, %target.getPosition());
ServerPlay3d(BOVHitSound, %target.getPosition());
ServerPlay3d(BOVHitSound, %target.getPosition());
%target.damage(%source, %target.getposition(), 9999, $DamageType::BladeOfVengance);
//
if(%target.isZombie) {
recordAction(%source.client, "BACK", "zombie");
}
else {
recordAction(%source.client, "BACK", "player");
}
//
if(%target.client !$= "") { //a Player.. goodie
MessageAll('MessageAll', "\c0"@%target.client.namebase@" was assassinated by "@%source.client.namebase@".");
}
//Challenges...
%source.cannotuseBOV = 0;
%source.setMoveState(false);
return;

View file

@ -50,8 +50,8 @@ datablock ShapeBaseImageData(PlasmaTorpedoImage) {
emap = true;
RankRequire = $TWM2::RankRequire["SCD343"];
PrestigeRequire = 4;
//RankRequire = $TWM2::RankRequire["SCD343"];
PrestigeRequire = 9;
HasChallenges = 1;
ChallengeCt = 8;

View file

@ -90,7 +90,7 @@ datablock ShapeBaseImageData(CrimsonHawkImage)
HellClipCount = 10;
//
RankRequire = $TWM2::RankRequire["CrimsonHawk"];
//RankRequire = $TWM2::RankRequire["CrimsonHawk"];
PrestigeRequire = 5;
//Challenges

View file

@ -46,8 +46,8 @@ datablock SeekerProjectileData(GrappleShot) {
// very quickly - bramage
lifetimeMS = 500; // z0dd - ZOD, 4/14/02. Was 6000
muzzleVelocity = 250.0;
maxVelocity = 350.0; // z0dd - ZOD, 4/14/02. Was 80.0
muzzleVelocity = 200.0;
maxVelocity = 300.0; // z0dd - ZOD, 4/14/02. Was 80.0
turningSpeed = 54.0;
acceleration = 50.0;
@ -94,7 +94,7 @@ datablock ShapeBaseImageData(GrappleHookImage) {
projectileType = SeekerProjectile;
usesEnergy = true;
minEnergy = 3;
minEnergy = 60;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
@ -112,7 +112,7 @@ datablock ShapeBaseImageData(GrappleHookImage) {
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.5;
stateTimeoutValue[3] = 5.0;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";

View file

@ -87,7 +87,7 @@ datablock ShapeBaseImageData(PulseRifleImage)
GunName = "Pulse Semi-Automatic Rifle";
//
RankRequire = $TWM2::RankRequire["G41"];
//RankRequire = $TWM2::RankRequire["G41"];
PrestigeRequire = 2;
casing = ShellDebris;

View file

@ -94,7 +94,7 @@ datablock ShapeBaseImageData(PulseSMGImage)
Upgrade[3] = "Silencer";
GunName = "Pulse SMG";
RankRequire = $TWM2::RankRequire["Pg700"];
//RankRequire = $TWM2::RankRequire["Pg700"];
PrestigeRequire = 3;
casing = ShellDebris;

View file

@ -128,13 +128,13 @@ $dFlag[3] = "Charlie";
//XP Stuffz
$TWM2::TeamKillDeduct = 10; //Lose this Much For TK
$TWM2::KillXPGain = 5; //Gain for killing PLAYERS not zombies
$TWM2::KillXPGain = 15; //Gain for killing PLAYERS not zombies
$TWM2::MaxZombies = 150; //You can set this now too :)
$TWM2::CanSpawnZ = 1; //0 Disables Zombie Spawning
$TWM2::ZombieName[1] = "Zombie";
$TWM2::ZombieName[2] = "Ravenger Zombie";
$TWM2::ZombieName[2] = "Ravager Zombie";
$TWM2::ZombieName[3] = "Zombie Lord";
$TWM2::ZombieName[4] = "Demon Zombie";
$TWM2::ZombieName[5] = "Air Rapier Zombie";
@ -145,19 +145,18 @@ $TWM2::ZombieName[9] = "Shifter Zombie";
$TWM2::ZombieName[10] = "Zombie Summoner";
$TWM2::ZombieName[11] = "Sniper Zombie";
$TWM2::ZombieName[12] = "Ultra Demon Zombie";
$TWM2::ZombieName[13] = "Volatile Ravenger";
$TWM2::ZombieName[13] = "Volatile Ravager";
$TWM2::ZombieName[14] = "Slingshot AA Zombie";
$TWM2::ZombieName[15] = "Wraith Zombie";
$TWM2::ZombieName[16] = "General Rog";
$TWM2::ZombieName[17] = "Elite Demon Zombie";
$TWM2::ZombieName[17] = "Elite Demon";
$TWM2::BossName["Windshear"] = "Colonel Windshear";
$TWM2::BossName["GoL"] = "The Ghost Of Lightning";
$TWM2::BossName["Vegenor"] = "General Vegenor";
$TWM2::BossName["Insignia"] = "Major Insignia";
$TWM2::BossName["Vardison"] = "Lord Vardison";
$TWM2::BossName["DAVardison"] = "Dark Archmage Vardison";
$TWM2::BossName["Trebor"] = "Lordranius Trevor";
$TWM2::BossName["Trevor"] = "Lordranius Trevor";
$TWM2::BossName["GoF"] = CollapseEscape("\c7The Ghost Of Fire");
$TWM2::BossName["Stormrider"] = "Commander Stormrider";
@ -168,7 +167,7 @@ $TWM2::BossName["CnlWindshear"] = "Colonel Windshear";
$TWM2::BossName["Vegenor"] = "General Vegenor";
$TWM2::BossName["Insignia"] = "Major Insignia";
$TWM2::BossName["Vardison"] = "Lord Vardison";
$TWM2::BossName["Trebor"] = "Lordranius Trevor";
$TWM2::BossName["Trevor"] = "Lordranius Trevor";
$TWM2::BossName["GhostOfFire"] = "The Ghost Of Fire";
$TWM2::BossName["Stormrider"] = "Commander Stormrider";
$TWM2::BossName["GhostOfLightning"] = "The Ghost Of Lightning";
@ -177,34 +176,33 @@ $TWM2::BossName["Vardison2"] = "Lord Vardison";
$TWM2::BossName["Vardison3"] = "Lord Vardison";
$TWM2::BossName["ShadeLord"] = "The Shade Lord";
//-----OFFICIAL VALUES-----\\
$TWM2::ZombieXPAward[1] = 2; // 2
$TWM2::ZombieXPAward[2] = 4; // 4
$TWM2::ZombieXPAward[3] = 12; // 12
$TWM2::ZombieXPAward[4] = 8; // 8
$TWM2::ZombieXPAward[5] = 7; // 7
$TWM2::ZombieXPAward[6] = 55; // 55
$TWM2::ZombieXPAward[9] = 6; // 6
$TWM2::ZombieXPAward[10] = 15; // 15
$TWM2::ZombieXPAward[11] = 13; // 13
$TWM2::ZombieXPAward[12] = 20; // 20
$TWM2::ZombieXPAward[13] = 8; // 8
$TWM2::ZombieXPAward[14] = 17; // 17
$TWM2::ZombieXPAward[15] = 35; // 35
$TWM2::ZombieXPAward[1] = 1; // 1
$TWM2::ZombieXPAward[2] = 5; // 5
$TWM2::ZombieXPAward[3] = 18; // 18
$TWM2::ZombieXPAward[4] = 5; // 5
$TWM2::ZombieXPAward[5] = 10; // 10
$TWM2::ZombieXPAward[6] = 100; // 100
$TWM2::ZombieXPAward[9] = 3; // 3
$TWM2::ZombieXPAward[10] = 65; // 65
$TWM2::ZombieXPAward[11] = 10; // 10
$TWM2::ZombieXPAward[12] = 25; // 25
$TWM2::ZombieXPAward[13] = 7; // 7
$TWM2::ZombieXPAward[14] = 20; // 20
$TWM2::ZombieXPAward[15] = 50; // 50
$TWM2::ZombieXPAward[16] = 1000; // 1000
$TWM2::ZombieXPAward[17] = 15; // 15
$TWM2::ZombieXPAward[17] = 25; // 25
$TWM2::BossXPAward["Yvex"] = 10000; // 10000
$TWM2::BossXPAward["CnlWindshear"] = 12500; // 12500
$TWM2::BossXPAward["CnlWindshearAlly"] = 1000; // 1000
$TWM2::BossXPAward["GhostOfLightning"] = 20000; // 20000
$TWM2::BossXPAward["Vengenor"] = 25000; // 25000
$TWM2::BossXPAward["Trebor"] = 25000; // 25000
$TWM2::BossXPAward["Trevor"] = 25000; // 25000
$TWM2::BossXPAward["LordRog"] = 30000; // 30000
$TWM2::BossXPAward["Insignia"] = 35000; // 35000
$TWM2::BossXPAward["Stormrider"] = 45000; // 45000
$TWM2::BossXPAward["GhostOfFire"] = 65000; // 65000
$TWM2::BossXPAward["ShadeLord"] = 70000; // 70000
$TWM2::BossXPAward["DAVardison"] = 75000; // 75000
$TWM2::BossXPAward["Vardison3"] = 75000; // 75000
$Host::UseDevelopersList = 1;
@ -261,7 +259,6 @@ $TWM2::RankRequire["M4A1"] = 15;
$TWM2::RankRequire["SCD343"] = 59;
$TWM2::RankRequire["P90"] = 56;
$TWM2::RankRequire["ALSWP"] = 49;
$TWM2::RankRequire["CrimsonHawk"] = 61;
$TWM2::RankRequire["Stinger"] = 30;
$TWM2::RankRequire["MRXX"] = 35;
$TWM2::RankRequire["NapalmLauncher"] = 42;