Good day all,
I just got back into the RSPS community and would like to contribute many releases going forward.
After watching the movie the Purge, I asked myself why not code it into an RSPS and see how it goes. This is a very vague version as an open source for anyone to add on to it so long I am given credit.
Create in minigames ThePurge class.
Code:
Code:
package server.model.minigames;
import server.Config;
import server.model.players.Client;
import server.model.players.PlayerHandler;
import server.model.players.Player;
public class ThePurge {
private static Client c;
private static int purgeCount = 3;
public static boolean purgeOn = false;
@SuppressWarnings("static-access")
public ThePurge (Client c) {
this.c = c;
}
public static void commencePurge(Client c){
for (int j = 0; j < PlayerHandler.players.length; j++){
if (PlayerHandler.players[j] != null) {
Client c1 = (Client) PlayerHandler.players[j];
c1.updateRequired = true;
commencePurgeWorldMessage(c1);
c1.sendMessage("<col=255>[PURGE ALERT] The annual Purge has been commenced.");
c1.sendMessage("<col=255>[PURGE ALERT] Blessed be our New Founding Fathers for letting us Purge -");
c1.sendMessage("<col=255>and cleanse our souls. Blessed be PurgeScape, a nation reborn.");
}
}
}
public static void commencePurgeWorldMessage(Client c1){
c1.forcedChat("The Purge will commence in: " + purgeCount-- + " seconds.");
}
}
go to commands.java and add:
Code:
if (playerCommand.startsWith("purge")) {
ThePurge.purgeOn = true;
ThePurge.commencePurge(c);
}
if (playerCommand.startsWith("poff")) {
Player.purgeTele = 0;
ThePurge.purgeOn = false;
for (int j = 0; j < PlayerHandler.players.length; j++){
if (PlayerHandler.players[j] != null) {
Client c1 = (Client) PlayerHandler.players[j];
c1.updateRequired = true;
c1.sendMessage("<col=255>[PURGE ALERT] The Purge has now ceased to persist. Thank you our Founding - ");
c1.sendMessage("<col=255>Fathers and God Bless PurgeScape.");
}
}
}
Client.java
add the following variable:
Code:
public int purgeCounter = 0;
Also
Code:
if (ThePurge.purgeOn == true){
sendMessage("Attention: The annual Purge has been commenced.");
sendMessage("Attention: Blessed be our New Founding Fathers for letting us Purge -");
sendMessage("and cleanse our souls. Blessed be PurgeScape, a nation reborn");
}else{
sendMessage("Welcome to PurgeScape.");
}
in Client.java look for :
Code:
int modY = absY > 6400 ? absY - 6400 : absY;
under it add:
Code:
if (ThePurge.purgeOn == true){
wildLevel = 999;
getPA().showOption(3, 0, "Attack", 1);
}else{
wildLevel = (((modY - 3520) / 8) + 1);
}
Now go to PlayerAssistant.java and look for
Code:
} else if(c.inWild() && c.wildLevel > Config.NO_TELEPORT_WILD_LEVEL){
Under it add :
Code:
if (ThePurge.purgeOn == true){
c.sendMessage("You can't teleport until the purge is over.");
}
look for :
Code:
} else if(c.duelStatus <= 4) { // if we are not in a duel repawn to wildy
under it add :
Code:
//purge
if (ThePurge.purgeOn == true){
movePlayer(2676, 3008, 0);
c.isSkulled = false;
c.skullTimer = 0;
c.attackedPlayers.clear();
}else{
movePlayer(Config.RESPAWN_X, Config.RESPAWN_Y, 0);
c.isSkulled = false;
c.skullTimer = 0;
c.attackedPlayers.clear();
}
in Player.java add
Code:
public static int purgeTele = 0;
now search for the inArea method that returns a boolean and add in it the following:
Code:
//The Purge (commences the purge if the boolean is true)
public boolean inWild() {
if (ThePurge.purgeOn == true){
return true;
}else{
if(absX > 2941 && absX < 3392 && absY > 3518 && absY < 3968 ||
absX > 2941 && absX < 3392 && absY > 9918 && absY < 10367){
return true;
}
}
return false;
}
This is obviously for those who can actually code otherwise you will be like wtf? Cheers!
-Bassil