Thread: Max hitpoints is 135?

Results 1 to 9 of 9
  1. #1 Max hitpoints is 135? 
    Registered Member pk3r john's Avatar
    Join Date
    Apr 2009
    Posts
    877
    Thanks given
    16
    Thanks received
    30
    Rep Power
    63
    Hey,

    the max hitpoints on my server is 135. how do i lower it down to 99? im using PI.

    EDIT: And by the way, it says 135/99. so you can heal up to 135 but you cant level it up to 135 :/
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Apr 2012
    Age
    31
    Posts
    131
    Thanks given
    38
    Thanks received
    21
    Rep Power
    168
    Code:
    public int getLevelForXPSkill(int skill) {
    	int maxLvl = skill == 3 ? 99 : 99;
    	int points = 0;
    	int output = 0;
    	for (int lvl = 1; lvl <= maxLvl; lvl++) {
    		points += Math.floor((double) lvl + 300.0 * Math.pow(2.0, (double) lvl / 7.0));
    		output = (int) Math.floor(points / 4);
    		if (output >= exp) {
    			return lvl;
    		}
    	}
    	return 0;
    }
    This should do the job.
    Reply With Quote  
     

  3. #3  
    Registered Member pk3r john's Avatar
    Join Date
    Apr 2009
    Posts
    877
    Thanks given
    16
    Thanks received
    30
    Rep Power
    63
    Quote Originally Posted by Scene View Post
    Code:
    public int getLevelForXPSkill(int skill) {
    	int maxLvl = skill == 3 ? 99 : 99;
    	int points = 0;
    	int output = 0;
    	for (int lvl = 1; lvl <= maxLvl; lvl++) {
    		points += Math.floor((double) lvl + 300.0 * Math.pow(2.0, (double) lvl / 7.0));
    		output = (int) Math.floor(points / 4);
    		if (output >= exp) {
    			return lvl;
    		}
    	}
    	return 0;
    }
    This should do the job.
    I put
    Code:
    	int maxLvl = skill == 3 ? 99 : 99;
    into it and it gives me
    Code:
    	src\server\model\players\PlayerAssistant.java:2673: cannot find symbol
    symbol  : variable skill
    location: class server.model.players.PlayerAssistant
                    int maxLvl = skill == 3 ? 99 : 99;
                                 ^
    bump

    EDIT: Just to verify, the int you posted is the exact same one I have except for the line I listed ^
    EDIT2: I left something out, it says 135/99 instead of 135/135. So you can heal up to 135 but not level up to it.
    EDIT3: I found this in clickitem.
    Code:
     		//c.playerLevel[3] += 10;
    		if (c.playerLevel[3] > (c.getLevelForXP(c.playerXP[3])*1.11 + 1)) {
    			c.playerLevel[3] = (int)(c.getLevelForXP(c.playerXP[3])*1.11);
    		}
    		c.getPA().refreshSkill(3);
    			return;
    		}
    i commented the whole thing out and it still didn't work..
    Reply With Quote  
     

  4. #4  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    This will do

    Code:
    	public int getLevelForXP(int exp) {
    		int points = 0;
    		int output = 0;
    		if (exp > 13034430)
    			return 99;
    		for (int lvl = 1; lvl <= 99; lvl++) {
    			points += Math.floor((double) lvl + 300.0
    					* Math.pow(2.0, (double) lvl / 7.0));
    			output = (int) Math.floor(points / 4);
    			if (output >= exp) {
    				return lvl;
    			}
    		}
    		return 0;
    	}
    Reply With Quote  
     

  5. #5  
    Registered Member pk3r john's Avatar
    Join Date
    Apr 2009
    Posts
    877
    Thanks given
    16
    Thanks received
    30
    Rep Power
    63
    Quote Originally Posted by Jason View Post
    This will do

    Code:
    	public int getLevelForXP(int exp) {
    		int points = 0;
    		int output = 0;
    		if (exp > 13034430)
    			return 99;
    		for (int lvl = 1; lvl <= 99; lvl++) {
    			points += Math.floor((double) lvl + 300.0
    					* Math.pow(2.0, (double) lvl / 7.0));
    			output = (int) Math.floor(points / 4);
    			if (output >= exp) {
    				return lvl;
    			}
    		}
    		return 0;
    	}
    thanks but thats what i have. again i cant level it up to 135, i can only heal up to 135. if that helps
    Reply With Quote  
     

  6. #6  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Haha sorry I just fully read the extent of your problem. How are you getting to 135 HP? Are you "Soaking"? What food are you eating?
    Reply With Quote  
     

  7. #7  
    Registered Member pk3r john's Avatar
    Join Date
    Apr 2009
    Posts
    877
    Thanks given
    16
    Thanks received
    30
    Rep Power
    63
    Quote Originally Posted by Jason View Post
    Haha sorry I just fully read the extent of your problem. How are you getting to 135 HP? Are you "Soaking"? What food are you eating?
    its fine. Im eating everything. Everything heals me up to 135 HP BUT rocktail.

    EDIT: When I set my HP to level 30, it heals up to 66. so its not a formula or anything
    Reply With Quote  
     

  8. #8  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Post your food class/how your food is handled.
    Reply With Quote  
     

  9. #9  
    Registered Member pk3r john's Avatar
    Join Date
    Apr 2009
    Posts
    877
    Thanks given
    16
    Thanks received
    30
    Rep Power
    63
    Quote Originally Posted by Jason View Post
    Post your food class/how your food is handled.
    Code:
    package server.model.players;
    
    import java.util.HashMap;
    
    /**
     * @author Sanity
     */
     
    public class Food {
    
    
      private Client c;
    
      public Food (Client c) {
        this.c = c;  
      }
      public static enum FoodToEat {    
        ROCKTAIL(15272,24,"Rocktail"),
        MANTA(391,22,"Manta Ray"),
        SHARK(385,20,"Shark"),
        LOBSTER(379,12,"Lobster"),
        TROUT(333,7,"Trout"),
        SALMON(329,9,"Salmon"),
        SWORDFISH(373,14,"Swordfish"),
        TUNA(361,10,"Tuna"),
        MONKFISH(7946,16,"Monkfish"),
        SEA_TURTLE(397,21,"Sea Turtle"),
        CAKE(1891,4,"Cake"),
        BASS(365,13,"Bass"),
        COD(339,7,"Cod"),
        POTATO(1942,1,"Potato"),
        BAKED_POTATO(6701,4,"Baked Potato"),
        POTATO_WITH_CHEESE(6705,16,"Potato with Cheese"),
        EGG_POTATO(7056,16,"Egg Potato"),
        CHILLI_POTATO(7054,14,"Chilli Potato"),
        MUSHROOM_POTATO(7058,20,"Mushroom Potato"),
        TUNA_POTATO(7060,22,"Tuna Potato"),
        SHRIMPS(315,3,"Shrimps"),
        HERRING(347,5,"Herring"),
        SARDINE(325,4,"Sardine"),
        CHOCOLATE_CAKE(1897,5,"Chocolate Cake"),
        ANCHOVIES(319,1,"Anchovies"),
        PLAIN_PIZZA(2289,7,"Plain Pizza"),
        MEAT_PIZZA(2293,8,"Meat Pizza"),
        ANCHOVY_PIZZA(2297,9,"Anchovy Pizza"),
        PINEAPPLE_PIZZA(2301,11,"Pineapple Pizza"),
        BREAD(2309,5,"Bread"),
        APPLE_PIE(2323,7,"Apple Pie"),
        REDBERRY_PIE(2325,5,"Redberry Pie"),
        MEAT_PIE(2327,6,"Meat Pie"),
        PIKE(351,8,"Pike"),
        POTATO_WITH_BUTTER(6703,14,"Potato with Butter"),
        BANANA(1963,2,"Banana"),
        PEACH(6883,8,"Peach"),
        ORANGE(2108,2,"Orange"),
        PINEAPPLE_RINGS(2118,2,"Pineapple Rings"),
        PINEAPPLE_CHUNKS(2116,2,"Pineapple Chunks"),
    	CHOCOLATE_SLICE(1901,5,"Chocolate Slice");
    
    
        private int id; private int heal; private String name;
    
        private FoodToEat(int id, int heal, String name) {
          this.id = id;
          this.heal = heal;
          this.name = name;    
        }
    
        public int getId() {
          return id;
        }
    
        public int getHeal() {
          return heal;
        }
    
        public String getName() {
          return name;
        }
        public static HashMap <Integer,FoodToEat> food = new HashMap<Integer,FoodToEat>();
    
        public static FoodToEat forId(int id) {
          return food.get(id);
        }
    
        static {
        for (FoodToEat f : FoodToEat.values())
          food.put(f.getId(), f);
        }
      }
    	
    	public int quickHp(int skill) {
    		return (int)(c.getLevelForXP(c.playerXP[skill]));
    	} 
    		
    	public boolean hasNexArmour() {
        	return 
    	c.playerEquipment[c.playerHat] == 13362 || c.playerEquipment[c.playerLegs] == 13360 || c.playerEquipment[c.playerChest] == 13358 ||
    	c.playerEquipment[c.playerHat] == 13355 || c.playerEquipment[c.playerLegs] == 13352 || c.playerEquipment[c.playerChest] == 13354 ||
    	c.playerEquipment[c.playerHat] == 13350 || c.playerEquipment[c.playerLegs] == 13346 || c.playerEquipment[c.playerChest] == 13348;
      }
    	
      
    
        public void eat(int id, int slot) {
    	
    	int helmHeal = 0;
    	int plateHeal = 0;
    	int legsHeal = 0;
    	
    	
    
    		switch (c.playerEquipment[c.playerHat]) {
    		case 13362://torva helm
    			helmHeal =+ 5;
    		break;
    		case 13355://pernix cowl
    			helmHeal =+ 5;
    		break;
    		case 13350:// virtus mask
    			helmHeal =+ 5;
    		break;
    		}
    		
    	switch (c.playerEquipment[c.playerChest]) {
    		case 13354://pernix body
    			plateHeal =+ 20;
    		break;
    		case 13348: // virtus robe top
    			plateHeal =+ 20;
    		break;
    		case 13358:// torva palte
    			plateHeal =+ 20;
    		break;
    		}
    
    	switch (c.playerEquipment[c.playerLegs]) {
    		case 13360: // torva Legs
    			legsHeal =+ 15;
    		break;
    		case 13352:// pernix chaps
    			legsHeal =+ 15;
    		break;
    		case 13346:// virtus robe bottom
    			legsHeal =+ 15;
    		break;
    		}
    	
            if (c.duelRule[6]) {
                c.sendMessage("You may not eat in this duel.");
                return;
            }
            if (System.currentTimeMillis() - c.foodDelay >= 1500) {
                c.getCombat().resetPlayerAttack();
                c.attackTimer += 2;
                c.startAnimation(829);
                c.getItems().deleteItem(id, slot, 1);
                FoodToEat f = FoodToEat.food.get(id);
    			int BonusHeal = helmHeal + plateHeal + legsHeal;
    			int maxHp = quickHp(3) + BonusHeal;
                if (c.playerLevel[3] < maxHp && hasNexArmour()) {
    				c.playerLevel[3] += f.getHeal();
    				if (c.playerLevel[3] > maxHp)
    					c.playerLevel[3] = maxHp;
    			}
    			else if (c.playerLevel[3] < c.calculateMaxLifePoints() && !hasNexArmour()) {
    				c.playerLevel[3] += f.getHeal();
    				if (c.playerLevel[3] > c.calculateMaxLifePoints() + maxHp)
    					c.playerLevel[3] = c.calculateMaxLifePoints();
    			}
    		if(!hasNexArmour() && c.playerLevel[3] > c.getPA().getLevelForXP(c.playerXP[3])) {
    			c.playerLevel[3] = c.calculateMaxLifePoints();
    		}
                c.foodDelay = System.currentTimeMillis();
                c.getPA().refreshSkill(3);
                c.sendMessage("You eat the " + f.getName() + ".");
            }
        }
    
    
      public boolean isFood(int id) {
        return FoodToEat.food.containsKey(id);
      }  
     }
    Reply With Quote  
     


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: 29
    Last Post: 08-07-2013, 05:56 AM
  2. Resurrection [Fun PVP] [Level 135 max]
    By shh_shh in forum Advertise
    Replies: 2
    Last Post: 06-20-2011, 12:05 PM
  3. Resurrection [Fun PVP] [Level 135 max]
    By Dashboard in forum Advertise
    Replies: 12
    Last Post: 06-19-2011, 09:25 PM
  4. Max Melee [RSGP] CB-135
    By Jerkin in forum Accounts
    Replies: 5
    Last Post: 04-28-2011, 05:28 AM
  5. How to change max level to 135 (not combat)
    By Unlucky4ever in forum Requests
    Replies: 1
    Last Post: 07-17-2009, 11:03 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
  •