Thread: Prestige System

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 Prestige System 
    Banned
    Join Date
    Oct 2015
    Posts
    23
    Thanks given
    2
    Thanks received
    3
    Rep Power
    0
    R-S Admin Response  Reason for Releasing

    Hello, I am releasing this prestige system I have coded because I have not seen a working one on these forums. I also have not released anything to the community so I thought I would. This is my first release, so thanks for looking at it.


    R-S Admin Response  What is prestige system?

    Well, a prestige system is basically you train ur combat stats, You're Strength, Attack, Defense, Magic, Ranged, and Prayer all to 99. When they are all maxed, you go to the prestige master, and he will reset the stats and exchange you with prestige level. Right now, the max Prestige level is 100.
    I may add a method so when a person gets a prestige level up, he also gets a better drop rate like 0.2% from bosses/npcs.



    Spoiler for Step 1, Add this in ActionHandler.java:

    Code:
    		case 945:
    			c.getDH().sendDialogues(3000, c.npcType);
    			break;




    Spoiler for Step 2, Add this in Client.java:



    Code:
    /*
    	 * Prestige variables
    	 */
    	public void announce(String msg) {
    		for (int j = 0; j < PlayerHandler.players.length; j++) {
    			if (PlayerHandler.players[j] != null) {
    				Client c2 = (Client)PlayerHandler.players[j];
    				c2.sendMessage(msg);
    			}
    		}
    	}
    	public boolean isMaxed;
    	public void checkCBPrestigeReq() {
    		if(playerLevel[0] >= 98 && playerLevel[1] >= 98 && playerLevel[2] >= 98 && playerLevel[3] >= 98 && playerLevel[4] >= 98
    				&& playerLevel[5] >= 98 && playerLevel[6] >= 98) {
    			isMaxed = true;
    		}
    	}
    	public void resetStats() {
    		for(int i = 0; i < 7; i++) {
    			playerXP[i] = getPA().getXPForLevel(1)+5;
    			playerLevel[i] = getPA().getLevelForXP(playerXP[i]);
    			playerLevel[3] = 10;
    			playerXP[3] = getPA().getXPForLevel(10)+5;
    			getPA().refreshSkill(i);
    		}
    	}


    Spoiler for Step 3, Add this in DialogueHandler.java :

    Code:
    /*
    		 * prestige
    		 */
    		case 3000:
    			sendNpcChat2("Hi. I'm the master of prestige.", "What can I help you with?", c.npcType, "Prestige Master");
    			c.nextChat = 3001;
    			break;
    		case 3001:
    			sendOption4("What is 'prestige'?", "What are the rewards for prestige?", "I'd like to prestige.", "Open Prestige Shop");
    			c.dialogueAction = 3001;
    			break;
    		case 3002:
    			sendNpcChat4("Prestige is an optional choice you can", "make once you reach 99 in @whi@Prayer, @dbl@Magic, @dre@Range, @red@HP,", 
    					"@bla@and all @or2@Melee@bla@ stats, however, it will reset all of those stats", "in exchange for a level. You also cant be a rookie mode account.", c.npcType, "Prestige Master");
    			c.nextChat = 3001;
    			break;
    		case 3003:
    			sendNpcChat4("The rewards for prestige are a", "prestige title, the ability to access", "my prestige shop, and a 0.3%", 
    					"better drop rate from monsters.",
    					c.npcType, "Prestige Master");
    			c.nextChat = 3001;
    			break;
    		case 3004:
    			sendNpcChat2("So you want to prestige?", "Very well, let me check if you're eligible.", c.npcType, "Prestige Master");
    			c.nextChat = 3005;
    			break;
    		case 3005:
    			c.checkCBPrestigeReq();
    			if (!c.isMaxed) 
    				sendDialogues(3006, c.npcType);
    			else 
    				sendDialogues(3007, c.npcType);
    			if (c.prestigeLevel >= 100)
    				sendDialogues(3012, c.npcType);
    			break;
    		case 3006:
    			sendNpcChat2("Unfortunately, you're not eligible for prestige.", "Come back when you have the required 99s, and is not a rookie.", c.npcType, "Prestige Master");
    			c.nextChat = 3001;
    			break;
    		case 3007:
    			sendNpcChat3("It looks like you're eligible to prestige.", "Are you @red@sure@bla@ you want to prestige?", "Your account's combat stat's @red@will@bla@ get reseted.", c.npcType, "Prestige Master");
    			c.nextChat = 3008;
    			break;
    		case 3008:
    			c.dialogueAction = 3008;
    			sendOption2("Yes, I'd like to prestige.", "No, not at this time.");
    			break;
    		case 3009:
    			if (c.getItems().hasEquipment()) {
    				c.sendMessage("Please remove all equipment before prestiging!");
    				sendDialogues(3010, c.npcType);
    			}
    			if (!c.getItems().hasEquipment()) {
    				c.getPA().enterPrestige();
    			}
    			break;
    		case 3010:
    			sendNpcChat2("Please remove all equipment before prestiging.", "After you do, talk to me again.", c.npcType, "Prestige Master");
    			c.nextChat = 0;
    			break;
    		case 3011:
    			sendNpcChat2("You've prestiged.", "Your prestige level is now "+c.prestigeLevel+".", c.npcType, "Prestige Master");
    			c.nextChat = 0;
    			break;
    		case 3012:
    			sendNpcChat2("Unfortunately, you cannot prestige. You have achieved", "the maximum amount of prestige levels.", c.npcType, "Prestige Master");
    			c.nextChat = 0;


    Spoiler for Step 4, add this in Player.java:

    Code:
    public int prestigeLevel = 0


    Spoiler for Step 5, add this in PlayerAssistant.java:

    Code:
    	public void enterPrestige() {
    		c.isMaxed = false;
    		c.prestigeLevel++;
    		c.playerTitle = "Prestige " + c.prestigeLevel + "";
    		c.titleColor = 3;
    		c.getPA().requestUpdates();
    		if (c.prestigeLevel == 100)
    			c.announce("<img=5><col=13881>"+Misc.optimizeText(c.playerName) +" has achieved 100th prestige! Congratulations!");
    		PlayerSave.saveGame(c);
    		c.announce("<col=1381283>[@cr6@Server] "+Misc.optimizeText(c.playerName) + " has prestiged to prestige level "+c.prestigeLevel+"!");
    		c.resetStats();
    		c.getDH().sendDialogues(3011, c.npcType);
    	}
    FOR THOSE WITH NO TITLE SYSTEM, ADD THIS ONE INSTEAD OF THE ABOVE;
    Code:
    public void enterPrestige() {
    		c.isMaxed = false;
    		c.prestigeLevel++;
    		c.getPA().requestUpdates();
    		if (c.prestigeLevel == 100)
    			c.announce("<img=5><col=13881>"+Misc.optimizeText(c.playerName) +" has achieved 100th prestige! Congratulations!");
    		PlayerSave.saveGame(c);
    		c.announce("<col=1381283>[@cr6@Server] "+Misc.optimizeText(c.playerName) + " has prestiged to prestige level "+c.prestigeLevel+"!");
    		c.resetStats();
    		c.getDH().sendDialogues(3011, c.npcType);
    	}


    Spoiler for Step 6, Add this in PlayerSave.java:

    Code:
    } else if (token.equals("prestige")) {
    						p.prestigeLevel = Integer.parseInt(token2);
    Code:
    			characterfile.write("prestige = ", 0, 11);
    			characterfile.write(Integer.toString(p.prestigeLevel), 0, Integer.toString(p.prestigeLevel).length());
    			characterfile.newLine();


    Spoiler for LAST STEP, Add this in Shops.cfg so you can add the items you want in the prestige shop:


    Code:
    shop = 25	Prestige_Store	2	2



    R-S Admin Response  FOR PEOPLE WHO WANT A PRESTIGE SHOP, add this in ShopAssistant.java


    Code:
    if (c.myShopId == 25) {
    			c.sendMessage(c.getItems().getItemName(removeId)
    					+ ": currently costs " + prestigeValue(removeId)
    					+ " Prestige Level.");
    			return;
    		}
    Code:
    public int prestigeValue(int id) {
    		switch (id) {
                   case ITEMID:
                   return PRESTIGELEVELREQUIREDTOGETTHISITEMID;
    				
    		}
    		return 0;
    	}
    Code:
    Add this under } else if (c.myShopId ==
    
    
    } else if (c.myShopId == 25) {
    			if (c.prestigeLevel >= prestigeValue(itemID)) {
    				if (c.getItems().freeSlots() > 0) {
    					c.prestigeLevel -= prestigeValue(itemID);
    					c.getPA().loadQuests();
    					c.getItems().addItem(itemID, 1);
    					c.getItems().resetItems(3823);
    					c.getPA().sendFrame126(
    							"@whi@Prestige Level: @gre@" + c.prestigeLevel + " ", 29170);
    					c.eloRating = 1200;
    				}
    			} else {
    				c.sendMessage("You're Elo-Rating is not high enough to get this item.");
    			}


    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    Banned
    Join Date
    Mar 2014
    Age
    30
    Posts
    221
    Thanks given
    12
    Thanks received
    24
    Rep Power
    0
    Nice! Thank you.
    Reply With Quote  
     

  4. #3  
    Donator
    snurf's Avatar
    Join Date
    Oct 2015
    Posts
    582
    Thanks given
    70
    Thanks received
    92
    Rep Power
    0
    Looks good, thank you for the contribution.
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    Banned
    Join Date
    Oct 2015
    Posts
    23
    Thanks given
    2
    Thanks received
    3
    Rep Power
    0
    Thanks guys.
    Reply With Quote  
     

  7. #5  
    Registered Member
    Join Date
    Sep 2015
    Posts
    29
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Might be a nooby question, but I added everything and compiled! Everything worked fine but did you not spawn the npc that we talk to that gives us the prestige? Or am I overlooking something!
    Thanks for this though!
    Reply With Quote  
     

  8. #6  
    Registered Member
    Join Date
    Nov 2015
    Posts
    1
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    src\server\model\players\DialogueHandler.java:201: error: cannot find symbol
    if (c.getItems().hasEquipment()) {
    ^
    symbol: method hasEquipment()
    location: class ItemAssistant
    src\server\model\players\DialogueHandler.java:205: error: cannot find symbol
    if (!c.getItems().hasEquipment()) {
    ^
    symbol: method hasEquipment()
    location: class ItemAssistant
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Press any key to continue . . .

    src\server\model\players\DialogueHandler.java:201: error: cannot find symbol
    if (c.getItems().hasEquipment()) {
    ^
    symbol: method hasEquipment()
    location: class ItemAssistant
    src\server\model\players\DialogueHandler.java:205: error: cannot find symbol
    if (!c.getItems().hasEquipment()) {
    ^
    symbol: method hasEquipment()
    location: class ItemAssistant
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Press any key to continue . . .
    Reply With Quote  
     

  9. #7  
    Registered Member
    Join Date
    Oct 2013
    Posts
    775
    Thanks given
    48
    Thanks received
    104
    Rep Power
    14
    Quote Originally Posted by bigboss9535 View Post
    src\server\model\players\DialogueHandler.java:201: error: cannot find symbol
    if (c.getItems().hasEquipment()) {
    ^
    symbol: method hasEquipment()
    location: class ItemAssistant
    src\server\model\players\DialogueHandler.java:205: error: cannot find symbol
    if (!c.getItems().hasEquipment()) {
    ^
    symbol: method hasEquipment()
    location: class ItemAssistant
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Press any key to continue . . .

    src\server\model\players\DialogueHandler.java:201: error: cannot find symbol
    if (c.getItems().hasEquipment()) {
    ^
    symbol: method hasEquipment()
    location: class ItemAssistant
    src\server\model\players\DialogueHandler.java:205: error: cannot find symbol
    if (!c.getItems().hasEquipment()) {
    ^
    symbol: method hasEquipment()
    location: class ItemAssistant
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Press any key to continue . . .
    you dont have the hasEquipment() method.
    Reply With Quote  
     

  10. #8  
    Registered Member
    Join Date
    Nov 2015
    Posts
    1
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    src\server\model\players\DialogueHandler.java:75: error: cannot find symbol
    if (c.getItems().hasEquipment()) {
    ^
    symbol: method hasEquipment()
    location: class ItemAssistant
    src\server\model\players\DialogueHandler.java:79: error: cannot find symbol
    if (!c.getItems().hasEquipment()) {
    ^
    symbol: method hasEquipment()
    location: class ItemAssistant
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Server Finnished Compiling...
    Press any key to continue . . .

    I have no clue what the problem is here, for the life of me i cannot figure it out.
    I also have no clue on how to add or what to change for the hasEquipment Method (Our Promise) previously talked about.
    Reply With Quote  
     

  11. #9  
    Registered Member Plasmetic's Avatar
    Join Date
    Nov 2015
    Posts
    273
    Thanks given
    20
    Thanks received
    30
    Rep Power
    20
    Quote Originally Posted by whit3 View Post
    src\server\model\players\DialogueHandler.java:75: error: cannot find symbol
    if (c.getItems().hasEquipment()) {
    ^
    symbol: method hasEquipment()
    location: class ItemAssistant
    src\server\model\players\DialogueHandler.java:79: error: cannot find symbol
    if (!c.getItems().hasEquipment()) {
    ^
    symbol: method hasEquipment()
    location: class ItemAssistant
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Server Finnished Compiling...
    Press any key to continue . . .

    I have no clue what the problem is here, for the life of me i cannot figure it out.
    I also have no clue on how to add or what to change for the hasEquipment Method (Our Promise) previously talked about.
    You either misplaced or forgot a bracket.
    Reply With Quote  
     

  12. #10  
    Registered Member
    Join Date
    Dec 2015
    Posts
    2
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    hey i have to use a clicking buttons method to make this work i was wondering if u had to do the same?
    Reply With Quote  
     

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. Replies: 16
    Last Post: 08-24-2012, 12:32 PM
  2. [Need Help]Prestige system on (PI) server.
    By webster90 in forum Help
    Replies: 1
    Last Post: 07-06-2012, 11:39 PM
  3. [637/639] Simple Prestige System
    By #Trilla in forum Snippets
    Replies: 10
    Last Post: 01-24-2012, 11:29 PM
  4. Replies: 26
    Last Post: 09-01-2011, 07:35 AM
  5. Replies: 26
    Last Post: 07-15-2010, 12:38 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
  •