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.
This commit is contained in:
Robert Fritzen 2017-11-03 14:31:24 -05:00
parent a1b4bcecfe
commit 74fbfa9d3b
2 changed files with 9 additions and 44 deletions

View file

@ -91,6 +91,9 @@ PLEASE NOTE: I've moved all old changelogs into the version_history folder. This
* Living World Mode * 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 * 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... * 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: * Boss Balancing / Updates:
* All Bosses * All Bosses
* Testing a new difficulty system * Testing a new difficulty system

View file

@ -113,7 +113,7 @@ function UpdateClientRank(%client) {
%newMillions = %scriptController.millionxp + %millions; %newMillions = %scriptController.millionxp + %millions;
%scriptController.millionxp = %newMillions; %scriptController.millionxp = %newMillions;
%scriptController.xp += newNonMillions; %scriptController.xp += %newNonMillions;
//End //End
checkForXPAwards(%client); checkForXPAwards(%client);
%j = $Rank::RankCount; %j = $Rank::RankCount;
@ -230,8 +230,6 @@ function printCurrentEXP(%client) {
//PRESTIGE RANKS //PRESTIGE RANKS
function PromoteToPrestige(%client) { function PromoteToPrestige(%client) {
%scriptController = %client.TWM2Core; %scriptController = %client.TWM2Core;
%savedGameTime = %scriptController.gameTime;
%savedPhrs = %scriptController.phrase;
if(%scriptController.officer $= "" || %scriptController.officer == 0) { if(%scriptController.officer $= "" || %scriptController.officer == 0) {
%next = 1; %next = 1;
} }
@ -247,10 +245,12 @@ function PromoteToPrestige(%client) {
return; 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"; %file = ""@$TWM::RanksDirectory@"/"@%client.guid@"/Saved.TWMSave";
//Reset player settings as perks and streaks tied to levels will reset.
%name = "ClientSettings"@%client.guid@""; %name = "ClientSettings"@%client.guid@"";
%check = nameToID(%name); %check = nameToID(%name);
if(isObject(%check)) { if(isObject(%check)) {
@ -260,12 +260,9 @@ function PromoteToPrestige(%client) {
%client.container.add(%script); %client.container.add(%script);
//now apply the base settings for this new file. //now apply the base settings for this new file.
%client.TWM2Core.name = %client.namebase;
%client.TWM2Core.xp = 0; %client.TWM2Core.xp = 0;
%client.TWM2Core.millionxp = 0; %client.TWM2Core.millionxp = 0;
%client.TWM2Core.rank = "Private"; %client.TWM2Core.rank = "Private";
%client.TWM2Core.phrase = %savedPhrs;
%client.TWM2Core.gameTime = %savedGameTime;
%client.TWM2Core.officer = %next; %client.TWM2Core.officer = %next;
//and save the new file //and save the new file
//%scriptController.save(%file); //%scriptController.save(%file);
@ -282,6 +279,8 @@ function PromoteToPrestige(%client) {
//STAT Cleaner: //STAT Cleaner:
//Phantom139: Changed in 3.4 to support the newer system //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) { function DumpStats(%c) {
echo("Resetting" SPC %c.guid@"'s stats."); echo("Resetting" SPC %c.guid@"'s stats.");
%sO = %c.TWM2Core; %sO = %c.TWM2Core;
@ -313,41 +312,4 @@ function GainExperience(%client, %variable, %tagToGain) {
} }
$XPArray[%client] += %variable; $XPArray[%client] += %variable;
updateClientRank(%client); 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
} }