From 74fbfa9d3ba1ab7ce0de2b0ced0bcb9f6f4347ff Mon Sep 17 00:00:00 2001 From: Robert Fritzen Date: Fri, 3 Nov 2017 14:31:24 -0500 Subject: [PATCH] Added Challenge/Medal Persistence Officer promotion no longer resets player progression on weapons and challenges across the board. Additionally, fixed an error in the EXP gain script. --- README.md | 3 ++ scripts/TWM2/Systems/AdvancedRankSystem.cs | 50 +++------------------- 2 files changed, 9 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 2b9de9f..a2d08f5 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,9 @@ PLEASE NOTE: I've moved all old changelogs into the version_history folder. This * Living World Mode * Added a new option for admins to toggle (Living World) in the Construction Mode. Players will be able to vote toggle this option * This aspect of the update will be coming soon... +* Challenges / Medals + * All Challenges and Medals are now persistent, such that progress is not lost through officer promotion + * Go get those bronze, silver, gold, and titan commendations!!! * Boss Balancing / Updates: * All Bosses * Testing a new difficulty system diff --git a/scripts/TWM2/Systems/AdvancedRankSystem.cs b/scripts/TWM2/Systems/AdvancedRankSystem.cs index 1dcda22..33efbf3 100644 --- a/scripts/TWM2/Systems/AdvancedRankSystem.cs +++ b/scripts/TWM2/Systems/AdvancedRankSystem.cs @@ -113,7 +113,7 @@ function UpdateClientRank(%client) { %newMillions = %scriptController.millionxp + %millions; %scriptController.millionxp = %newMillions; - %scriptController.xp += newNonMillions; + %scriptController.xp += %newNonMillions; //End checkForXPAwards(%client); %j = $Rank::RankCount; @@ -230,8 +230,6 @@ function printCurrentEXP(%client) { //PRESTIGE RANKS function PromoteToPrestige(%client) { %scriptController = %client.TWM2Core; - %savedGameTime = %scriptController.gameTime; - %savedPhrs = %scriptController.phrase; if(%scriptController.officer $= "" || %scriptController.officer == 0) { %next = 1; } @@ -247,10 +245,12 @@ function PromoteToPrestige(%client) { return; } - DumpStats(%client); + //Phantom139 TWM2 3.9.2: Removed the "reset" of progression, we only reset EXP and the rank for office progression now. + //DumpStats(%client); %file = ""@$TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave"; + //Reset player settings as perks and streaks tied to levels will reset. %name = "ClientSettings"@%client.guid@""; %check = nameToID(%name); if(isObject(%check)) { @@ -260,12 +260,9 @@ function PromoteToPrestige(%client) { %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 = %next; //and save the new file //%scriptController.save(%file); @@ -282,6 +279,8 @@ function PromoteToPrestige(%client) { //STAT Cleaner: //Phantom139: Changed in 3.4 to support the newer system +// TWM2 3.9.2 Note: This function is no longer used but is kept for internal definition purposes, and to fix completely +// broken files. function DumpStats(%c) { echo("Resetting" SPC %c.guid@"'s stats."); %sO = %c.TWM2Core; @@ -313,41 +312,4 @@ function GainExperience(%client, %variable, %tagToGain) { } $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 } \ No newline at end of file