Thread: Earning Potential (PI)

Results 1 to 5 of 5
  1. #1 Earning Potential (PI) 
    Registered Member
    Join Date
    Nov 2010
    Posts
    56
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Eping in my server only works in the wilderness ill show you my ep code first then my player.java code.
    I want it to work IN Fala PKING im using DSPK Source
    Code:
    package server.model.players;
    
    import server.Server;
    import server.util.Misc;
    
    public class EarningPotential {
    
    		private static int[][] randomDrops = {{14876,1},{14877,1},{14878,1},{14878,1},{14879,1},{14880,1},{14881,1},{14882,1},{14883,1},{14884,1},{14885,1},{14886,1},{14887,1},{14888,1},{14889,1},{14890,1},{14891,1},{14892,1},{14892,1},{14887,1},{15015,12},{15015,12},{15016,12},{14891,1},{4675,1},{1340,1},{15015,12},{15016,12},{1725,1},{1729,1},{1351,1},{1319,1},{1333,1},{1359,1},{1731,1},{391,2},{1351,1},{1319,1},{1333,1},{1359,1},{4091,1},{4093,1},{4095,1},{4097,1},{4101,1},{4103,1},{1340,1},{1725,1},{1729,1},{1731,1},{4105,1},{14886,1},{4107,1},{4111,1},{4113,1},{4115,1},{4117,1},{4131,1},{1079,1},{1093,1},{1127,1},{1163,1},{1201,1},{4587,1},{1149,1},{15016,12},{1079,1},{15015,12},{15016,12},{1351,1},{1319,1},{15015,12},{15016,12},{1333,1},{1359,1},{1704,1},{157,3},{145,2},{175,4},{1379,1},{1381,1},{1393,1},{861,1},{6731,1},{6733,1},{4712,1},{1340,1},{1725,1},{1729,1},{1731,1},{4714,1},{4716,1},{4718,1},{4720,1},{4722,1},{4736,1},{4738,1},{4749,1},{4751,1},{1127,1},{391,2},{1093,1},{4087,1},{4585,1},{3140,1},{6737,1},{6731,1},{6733,1},{4712,1},{4714,1},{4716,1},{4718,1},{4720,1},{4722,1},{4736,1},{4738,1},{4749,1},{4751,1},{11732,1},
    		{11235,1},{11335,1},{14889,1},{391,2},{14882,1},{14881,1},{14878,1},{14883,1},{14890,1},{11212,40},{4151,1},{14892,1},{1351,1},{1319,1},{14885,1},{1333,1},{1359,1},{6585,1},{1187,1},{15009,1},{1379,1},{1381,1},{1393,1},{861,1},{4675,1}};
    		private static int[][] lowEP = {{14889,1},{14883,1},{14881,1},{14881,1},{14878,1},{14878,1},{14881,1},{14882,1},{14882,1},{14882,1},{14886,1},{15015,12},{14887,1},{15016,12},{14892,1},{4675,1},{14891,1},{1340,1},{15015,12},{15016,12},{1725,1},{1729,1},{1351,1},{1319,1},{1333,1},{1359,1},{1731,1},{391,2},{1351,1},{1319,1},{1333,1},{1359,1},{4091,1},{4093,1},{4095,1},{4097,1},{4101,1},{4103,1},{1340,1},{1725,1},{1729,1},{1731,1},{4105,1},{14886,1},{4107,1},{4111,1},{4113,1},{4115,1},{4117,1},{4131,1},{1079,1},{1093,1},{1127,1},{1163,1},{1201,1},{4587,1},{1149,1}};
    		private static int[][] medEP = {{14889,1},{14885,1},{14879,1},{14879,1},{15015,12},{14886,1},{14891,1},{14892,1},{14885,1},{15015,12},{14886,1},{15016,12},{4675,1},{14888,1},{1340,1},{15015,12},{15016,12},{1725,1},{1729,1},{1351,1},{1319,1},{1333,1},{1359,1},{1731,1},{391,2},{1351,1},{1319,1},{1333,1},{1359,1},{4091,1},{4093,1},{4095,1},{4097,1},{4101,1},{4103,1},{1340,1},{1725,1},{1729,1},{1731,1},{4105,1},{14886,1},{4107,1},{4111,1},{4113,1},{4115,1},{4117,1},{4131,1},{1079,1},{1093,1},{1127,1},{1163,1},{1201,1},{4587,1},{1149,1},{15016,12},{1187,1},{14881,1},{15015,12},{15016,12},{1704,1},{15015,12},{15016,12},{157,3},{145,2},{175,4},{15015,12},{15016,12},{1704,1},{157,3},{145,2},{175,4},{6731,1},{6733,1},{15015,12},{15016,12},{4712,1},{4714,1},{4716,1},{4718,1},{4720,1},{4722,1},{4736,1},{4738,1},{4749,1},{4751,1},{1305,1},{391,2},{1377,1},{1540,1},{1434,1},{1702,1},{5698,1},{3204,1},{6528,1},{10384,1},{10386,1},{10388,1},{10390,1}};
    		private static int[][] highEP = {{14889,1},{14880,1},{14877,1},{14877,1},{14880,1},{14884,1},{14880,1},{14887,1},{14879,1},{14889,1},{14884,1},{14889,1},{14883,1},{14885,1},{15015,12},{14887,1},{14891,1},{15016,12},{14890,1},{868,50},{14890,1},{15015,12},{15016,12},{1704,1},{14892,1},{157,3},{145,2},{175,4},{995,14700},{995,22500},{4151,1},{6585,1},{6731,1},{6733,1},{4712,1},{4714,1},{4716,1},{4718,1},{4720,1},{4722,1},{4736,1},{4738,1},{4749,1},{4751,1},{391,2},{4714,1},{4712,1},{15017,1},{4716,1},{4718,1},{4720,1},{4722,1},{4675,1},{4091,1},{4093,1},
    		{4095,1},{15015,12},{14891,1},{14888,1},{15016,12},{14881,1},{14876,1},{14881,1},{14883,1},{4097,1},{14881,1},{14885,1},{15015,12},{15016,12},{14884,1},{4675,1},{1340,1},{15015,12},{14890,1},{15016,12},{1725,1},{1729,1},{1351,1},{1319,1},{1333,1},{1359,1},{1731,1},{391,2},{1351,1},{1319,1},{1333,1},{1359,1},{4091,1},{4093,1},{4095,1},{4097,1},{4101,1},{4103,1},{1340,1},{1725,1},{1729,1},{1731,1},{4105,1},{14886,1},{4107,1},{4111,1},{4113,1},{4115,1},{4117,1},{4131,1},{1079,1},{1093,1},{1127,1},{1163,1},{1201,1},{4587,1},{1149,1},{15015,12},{14881,1},{14881,1},{15016,12},{4101,1},{15015,12},{15016,12},{4103,1},{868,50},{15015,12},{15016,12},{1351,1},{1319,1},{1333,1},{1359,1},{995,14700},{995,22500},{1351,1},{1319,1},{1333,1},{1359,1},{4105,1},{4107,1},{4111,1},{15015,12},{15016,12},{4113,1},{4115,1},{4117,1},{4131,1},{1079,1},{1340,1},{1725,1},{1729,1},{1731,1},{1093,1},{1127,1},{1163,1},{1201,1},
    		{4587,1},{1149,1},{4724,1},{14883,1},{15015,12},{14888,1},{14882,1},{15016,12},{14882,1},{14887,1},{4726,1},{4728,1},{14884,1},{4730,1},{15015,12},{15016,12},{4732,1},{4734,1},{15015,12},{15016,12},{391,2},{4736,1},{4738,1},{4745,1},{1351,1},{1340,1},{15015,12},{15016,12},{1725,1},{1729,1},{1731,1},{14886,1},{1319,1},{1333,1},{15015,12},{15016,12},{1359,1},{4712,1},{4714,1},{4740,1},{4741,1},{4743,1},{4745,1}};
    		private static int[][] mHighEP = {{15015,12},{14886,1},{14890,1},{14881,1},{14878,1},{14881,1},{14892,1},{14888,1},{14884,1},{15015,12},{15016,12},{4675,1},{1340,1},{15015,12},{15016,12},{1725,1},{1729,1},{1351,1},{1319,1},{1333,1},{1359,1},{1731,1},{391,2},{1351,1},{1319,1},{1333,1},{1359,1},{4091,1},{4093,1},{4095,1},{4097,1},{4101,1},{4103,1},{1340,1},{1725,1},{1729,1},{1731,1},{4105,1},{14886,1},{4107,1},{4111,1},{4113,1},{4115,1},{4117,1},{4131,1},{1079,1},{1093,1},{1127,1},{1163,1},{1201,1},{4587,1},{1149,1},{15016,12},{3140,1},{15015,12},{15016,12},{1704,1},{157,3},{145,2},{175,4},{391,2},{4585,1},{4087,1},{15020,1},{4151,1},{6585,1},{1187,1},{1305,1},{1377,1},{15015,12},{15016,12},{1540,1},{1434,1},{1702,1},{5698,1},{3204,1},{6528,1},{10384,1},{10386,1},{10388,1},{10390,1},
    		{4714,1},{14882,1},{14879,1},{14891,1},{14888,1},{15015,12},{14886,1},{14887,1},{14876,1},{14891,1},{15016,12},{14887,1},{4712,1},{14881,1},{15015,12},{14890,1},{15016,12},{4716,1},{4718,1},{4720,1},{15015,12},{15016,12},{1351,1},{1319,1},{1333,1},{1359,1},{1340,1},{1379,1},{1381,1},{1393,1},{15015,12},{15016,12},{861,1},{1725,1},{1729,1},{1731,1},{6731,1},{1351,1},{1319,1},{1333,1},{1359,1},{6733,1},{4712,1},{4714,1},{4716,1},{4718,1},{4720,1},{4722,1},{4736,1},{4738,1},{4749,1},{4751,1},{4722,1},{4724,1},{15006,1},{4726,1},{4728,1},{6731,1},{6733,1},{4712,1},{4714,1},{4716,1},{4718,1},{4720,1},{4722,1},{4736,1},{14879,1},{14879,1},{4738,1},{4749,1},{4751,1},{4730,1},{4732,1},{391,2},{4734,1},
    		{4736,1},{14878,1},{15015,12},{14879,1},{14882,1},{14885,1},{14879,1},{14883,1},{14885,1},{14885,1},{14883,1},{14888,1},{14887,1},{15016,12},{14886,1},{14887,1},{14889,1},{14888,1},{4738,1},{15015,12},{15016,12},{4745,1},{15015,12},{15016,12},{4712,1},{4714,1},{15015,12},{15016,12},{14886,1},{4740,1},{1351,1},{1319,1},{1333,1},{1359,1},{391,2},{4741,1},{995,5815},{995,300000},{1085,1},{1089,1},{1351,1},{4743,1},{4745,1}};
    		private static int[][] xEP = {{15015,12},{14883,1},{14880,1},{14880,1},{14878,1},{14878,1},{14880,1},{14882,1},{15016,12},{868,50},{14885,1},{14890,1},{14886,1},{14888,1},{15015,12},{15016,12},{1099,1},{1165,1},{1351,1},{1319,1},{1333,1},{1359,1},{1149,1},{1185,1},{1704,1},{157,3},{145,2},{175,4},{995,14700},{995,22500},{14886,1},{391,2},{6731,1},{6733,1},{4712,1},{4714,1},{4716,1},{4718,1},{4720,1},{4722,1},{4736,1},{4738,1},{4749,1},{4751,1},{391,2},{4675,1},{4091,1},{4093,1},{4095,1},{4097,1},{4101,1},{4103,1},{4105,1},{391,2},{15013,1},{15015,12},{15016,12},{4107,1},{4111,1},{4113,1},{4115,1},{4117,1},{4131,1},{1079,1},{1093,1},{1127,1},
    		{1163,1},{1201,1},{14889,1},{14880,1},{14886,1},{14885,1},{14891,1},{14877,1},{14882,1},{14892,1},{14876,1},{4587,1},{14891,1},{14884,1},{1340,1},{1725,1},{15015,12},{15016,12},{1729,1},{1731,1},{1149,1},{391,2},{1351,1},{1319,1},{1333,1},{1359,1},{15007,1},{391,2},{995,5815},{995,300000},{1085,1},{1089,1},{1351,1},{391,2},{1079,1},{15015,12},{15016,12},{391,2},{14886,1},{391,2},{15009,1},{391,2},{14877,1},{6731,1},{6733,1},{4712,1},{4714,1},{4716,1},{4718,1},{4720,1},{4722,1},{4736,1},{4738,1},{4749,1},{4751,1},{15015,12},{15016,12},{391,2},{14876,1},{391,2},{14881,1},{15012,1},{15015,12},{15016,12},{1127,1},{1093,1},{4087,1},{4585,1},{3140,1},{6737,1},{6731,1},{6733,1},{4712,1},{4714,1},{4716,1},{4718,1},
    		{4720,1},{14878,1},{14879,1},{14890,1},{14876,1},{4722,1},{4736,1},{14887,1},{14892,1},{14877,1},{15015,12},{14879,1},{15016,12},{15015,12},{15016,12},{391,2},{15015,12},{15016,12},{15015,12},{15016,12},{391,2},{15015,12},{15016,12},{4738,1},{15015,12},{15016,12},{1704,1},{157,3},{1379,1},{1381,1},{1393,1},{861,1},{145,2},{15015,12},{15016,12},{175,4},{15015,12},{15016,12},{4749,1},{4751,1},{15015,12},{15016,12},{11732,1},
    		{391,2},{1340,1},{1725,1},{14877,1},{1729,1},{14880,1},{14877,1},{14892,1},{15015,12},{15016,12},{14892,1},{14886,1},{15015,12},{14881,1},{15016,12},{14887,1},{14889,1},{1731,1},{15015,12},{15016,12},{11235,1},{1079,1},{1127,1},{1099,1},{1165,1},{1149,1},{1351,1},{1319,1},{1333,1},{1359,1},{1379,1},{1381,1},{15015,12},{15016,12},{15015,12},{15016,12},{1393,1},{861,1},{1185,1},{391,2},{1093,1},{4087,1},{4585,1},{3140,1},{995,5815},{995,300000},{1085,1},{1089,1},{1340,1},{1725,1},{1729,1},{1731,1},{1351,1},{15015,12},{15016,12},{4675,1},{1340,1},{15015,12},{15016,12},{1725,1},{1729,1},{1351,1},{1319,1},{1333,1},{1359,1},{1731,1},{391,2},{1351,1},{14879,1},{1319,1},{1333,1},{1359,1},{4091,1},{4093,1},{4095,1},{4097,1},{4101,1},{4103,1},{1340,1},{1725,1},{1729,1},{1731,1},{4105,1},{14886,1},{4107,1},{4111,1},{4113,1},{4115,1},{4117,1},{4131,1},{1079,1},{1093,1},{1127,1},{1163,1},{1201,1},{4587,1},{1149,1},{6737,1},{6731,1},{11335,1},{11212,40},{4151,1},{6585,1},{1187,1},{4675,1},{15015,12},{15016,12},{15015,12},{15016,12},{1351,1},{1319,1},{1333,1},{1359,1},
    		{15018,1},{391,2},{1099,1},{14890,1},{14882,1},{14881,1},{14880,1},{14881,1},{14888,1},{14876,1},{14878,1},{14878,1},{14879,1},{14890,1},{14889,1},{14890,1},{1165,1},{15015,12},{14883,1},{14885,1},{15016,12},{15015,12},{15016,12},{1149,1},{1185,1},{15017,1},{391,2},{14876,1},{391,2},{15020,1},{995,5815},{1351,1},{1319,1},{1333,1},{1359,1},{995,300000},{1085,1},{1089,1},{1351,1}};
    
    public static void checkPotential(Client c) {
    		if (c.inWild()) {
    			if (++c.epDelay == 50) {
    			if (!c.inFunPk()) {
    			if(c.getItems().getCarriedWealth() > 5000000 || c.getPA().getWearingAmount2() > 200000) {
    				c.earningPotential += 13 + Misc.random(12);
    				if (c.earningPotential > 100) 
    					c.earningPotential = 100;
    				c.sendMessage("Your EP increases to: " + c.earningPotential + ".");
    				} else {
    				c.sendMessage("You must risk more than 5 mil to increase your EP!");
    				}
    			}
    				c.epDelay = 0;
    		}
    	}
    }
    	
    	public static void checkTeleport(Client c) {
    		if (c.inWild())
    			if (c.underAttackBy > 0) {
    				c.earningPotential -= 10 + Misc.random(5);
    				c.sendMessage("You now have "+c.earningPotential+" EP since you teleported in combat!");
    				if (c.earningPotential < 0)
    					c.earningPotential = 0;
    		}
    	}
    	
    	public static void giveBonusDrops(Client c, Client c2) {
                    Client o = (Client) Server.playerHandler.players[c.killerId];
    		Client pl = (Client) Server.playerHandler.players[c.killerId];
    			if (c.inWild() && c2.inWild()) {
    			if(c2.getItems().getCarriedWealth() > 300000 || c2.getPA().getWearingAmount2() > 200000) {
    /*		if (c.earningPotential >= 0 && c.earningPotential <= 9) {
    				c.earningPotential -= 0 + Misc.random(7);
    				if (c.earningPotential < 0)
    					c.earningPotential = 0;
    				int random = (int)(Math.random() * (lowEP.length - 1));
    				Server.itemHandler.createGroundItem(c, lowEP[random][0], c2.absX, c2.absY, 
    											lowEP[random][1], c.playerId);
    				c.sendMessage("Your EP decreased to: "+c.earningPotential+".");
    }	
    		if (c.earningPotential >= 10 && c.earningPotential <= 24) {
    				c.earningPotential -= 10 + Misc.random(15);
    				if (c.earningPotential < 0)
    					c.earningPotential = 0;
    				int random = (int)(Math.random() * (medEP.length - 1));
    				Server.itemHandler.createGroundItem(c, medEP[random][0], c2.absX, c2.absY, 
    											medEP[random][1], c.playerId);
    				c.sendMessage("Your EP decreased to: "+c.earningPotential+".");
    }	
    		if (c.earningPotential >= 25 && c.earningPotential <= 49) {
    				c.earningPotential -= 20 + Misc.random(15);
    				if (c.earningPotential < 0)
    					c.earningPotential = 0;
    				int random = (int)(Math.random() * (highEP.length - 1));
    				Server.itemHandler.createGroundItem(c, highEP[random][0], c2.absX, c2.absY, 
    											highEP[random][1], c.playerId);
    				c.sendMessage("Your EP decreased to: "+c.earningPotential+".");
    }	
    		if (c.earningPotential >= 50 && c.earningPotential <= 89) {
    				c.earningPotential -= 30 + Misc.random(25);
    				if (c.earningPotential < 0)
    					c.earningPotential = 0;
    				int random = (int)(Math.random() * (mHighEP.length - 1));
    				Server.itemHandler.createGroundItem(c, mHighEP[random][0], c2.absX, c2.absY, 
    											mHighEP[random][1], c.playerId);
    				c.sendMessage("Your EP decreased to: "+c.earningPotential+".");
      }			*/
    		if (c.earningPotential >= 85) {
    				c.earningPotential -= 40 + Misc.random(50);
    				int random = (int)(Math.random() * (xEP.length - 1));
    				Server.itemHandler.createGroundItem(c, xEP[random][0], c2.absX, c2.absY, 
    											xEP[random][1], c.playerId);
    				c.sendMessage("Your EP decreased to: "+c.earningPotential+".");
    }
    }
    }
    }	
    }
    Last edited by Vastiko; 02-12-2011 at 11:21 AM.
     

  2. #2  
    Banned

    Join Date
    Dec 2008
    Posts
    3,004
    Thanks given
    10
    Thanks received
    198
    Rep Power
    0
    Wait what's wrong?

    EDIT: Look at the variable being declared. The area boolean inWild() makes the code only work if you are in that area.

    Make another boolean in your player.java outlining the Falador area and then replace all inWild() booleans with inWild() || inFalador()

    Code:
    	public boolean inFalador() {
    		return absX >= x && absX < x && absY >= y && absY < y;
    	}
    EDIT2: If I may ask, why are you rewarding players for teleporting out of combat? Don't you think it should be the other way around?
     

  3. #3  
    Registered Member
    Gator God's Avatar
    Join Date
    Aug 2010
    Posts
    260
    Thanks given
    15
    Thanks received
    26
    Rep Power
    99
    l2[code]
    Quote Originally Posted by H A W X;
    [IMG]C:\Users\R\Desktop\Rune-Server\Pictures[/IMG]
    :trollface:
     

  4. #4  
    Registered Member
    Join Date
    Nov 2010
    Posts
    56
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    ventrix its giving them -=10 NEgative 10 points for teleporting
    and also
    here is my player.java in wild boolean

    public boolean inWild() {
    if(isInFala() || isInArd() || inFunPk()) {
    return true;
     

  5. #5  
     


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. Earning Potential Spots
    By Scu11 in forum Chat
    Replies: 16
    Last Post: 08-10-2010, 06:21 AM
  2. Selling lvl 101 with potential.
    By Karilz in forum Accounts
    Replies: 0
    Last Post: 04-01-2010, 08:34 PM
  3. Which had the best combat/potential?
    By Mrthunder23 in forum RS2 Server
    Replies: 7
    Last Post: 03-06-2010, 10:40 PM
  4. [help] Buy Drop Potential [help]
    By xVirazx in forum Help
    Replies: 10
    Last Post: 11-23-2009, 06:30 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •