Thread: [317 PI] The Purge minigame release

Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1 [317 PI] The Purge minigame release 
    Registered Member
    Join Date
    Apr 2013
    Posts
    6
    Thanks given
    0
    Thanks received
    9
    Rep Power
    0
    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
    Reply With Quote  
     

  2. #2  
    OS-Saradomin Founder & Developer

    Saradomin's Avatar
    Join Date
    Nov 2015
    Posts
    584
    Thanks given
    296
    Thanks received
    149
    Rep Power
    238
    Should add some media.

    OT: Nice job
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    New Project - Exiles
    Exiles's Avatar
    Join Date
    Mar 2014
    Posts
    347
    Thanks given
    12
    Thanks received
    28
    Rep Power
    34
    Agreed, media would be nice. Otherwise, nice release! Someone could add on to this.
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Nov 2013
    Posts
    1,017
    Thanks given
    240
    Thanks received
    265
    Rep Power
    0
    Agreed with above (media please) other than that good job.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Oct 2015
    Posts
    66
    Thanks given
    14
    Thanks received
    10
    Rep Power
    12
    Finally something unique. Nice release mate!
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Oct 2013
    Posts
    775
    Thanks given
    48
    Thanks received
    104
    Rep Power
    14
    can definitely be cleaned up and things should all be static, no point of instancing the class for players or whatever. all it really is is having a boolean to be set true or false for the purge.
    Reply With Quote  
     

  7. #7  
    Banned

    Join Date
    Nov 2015
    Posts
    377
    Thanks given
    97
    Thanks received
    75
    Rep Power
    0
    Add media! Not feeling testing it out.... No point of wasting time if its not good
    Reply With Quote  
     

  8. #8  
    Owner of Dawntained

    Mgt Madness's Avatar
    Join Date
    Oct 2011
    Age
    25
    Posts
    3,377
    Thanks given
    1,410
    Thanks received
    943
    Rep Power
    2027
    It's definitely a cool idea, a dmm server should add this, where suddenly it turns into purge mode and no one is safe, but you only lose what you are wearing/inventory instead of bank.
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Oct 2013
    Posts
    775
    Thanks given
    48
    Thanks received
    104
    Rep Power
    14
    i did something similar to this awhile back. [Only registered and activated users can see links. ]
    Reply With Quote  
     

  10. #10  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,472
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    nobody needs media lmao

    it sends all the players a message. the command toggles whether or not the whole server is wild. it's really not hard to read code guys c'mon..

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    Reply With Quote  
     

  11. Thankful users:


Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. PI - The-Genesis FULL RELEASE
    By Relentless in forum Downloads
    Replies: 29
    Last Post: 12-11-2016, 08:12 PM
  2. Yoshx - The underdogs [317] [PI]
    By 'Best in forum Advertise
    Replies: 14
    Last Post: 06-20-2011, 03:18 AM
  3. [PI] New Ice Minigame Release!
    By Treq in forum Tutorials
    Replies: 46
    Last Post: 05-26-2011, 01:10 AM
  4. [PI] The Hunt MInigame Scores
    By Robgob69 in forum Requests
    Replies: 3
    Last Post: 04-13-2011, 08:10 PM
  5. [PI] The New RuneScape [Release 1.0]
    By JavaKing in forum Downloads
    Replies: 18
    Last Post: 02-08-2011, 07:46 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •