Thread: [pi] torva,pernix,virtus paying

Results 1 to 5 of 5
  1. #1 [pi] torva,pernix,virtus paying 
    Registered Member
    Join Date
    Mar 2011
    Posts
    523
    Thanks given
    36
    Thanks received
    27
    Rep Power
    70
    correct hp adding effect like piece for piece would love this paying up 2 $5
    please help
    ofc if you release in this thread will rep ++
    Quote Originally Posted by Jack Daniels View Post
    Why wouldn't it work for PI? Do PI programmers use a different kind of Java or something?
    Genius! ^
    Reply With Quote  
     

  2. #2  
    Registered Member
    Mr.Client's Avatar
    Join Date
    Jun 2010
    Posts
    2,094
    Thanks given
    100
    Thanks received
    317
    Rep Power
    251
    Its late i haven't checked this to see if it works but it should, i am really tired if anything ill just copy and paste the actual code i use tomorrow, note this is en example as to how you can do it, i wrote in like 3min so it looks ugly lol, i suggest you rewrite it or just wait till tomorrow.

    Code:
    	public int helm() {
    		return c.playerEquipment[c.playerHat];
    	}
    
    	public int chest() {
    		return c.playerEquipment[c.playerLegs];
    	}
    
    	public int legs() {
    		return c.playerEquipment[c.playerChest];
    	}
    
    	public int torvaStat(int skill, double amount) {
    		return (int)(c.getLevelForXP(c.playerXP[skill]) * amount);
    	}
    
    	public double getExtraHeal(int i) {
    		double heal = 0;
    		double[][] HealAmm = {{20135, ammount}, {20143, ammount}, {20139, ammount}};
    		for(int l = 0; l < HealAmm.length; l++) {
    			if(i == HealAmm[l][0]) {
    				heal = HealAmm[l][1];
    			}
    		}
    		return heal;
    	}
    	
    	public void eat(int id, int slot) {
    		if (c.duelRule[6]) {
    			c.sendMessage("You may not eat in this duel.");
    			return;
    		}
    		if (System.currentTimeMillis() - c.foodDelay >= 1500 && c.playerLevel[3] > 0) {
    			c.getCombat().resetPlayerAttack();
    			c.attackTimer += 2;
    			c.startAnimation(829);
    			c.getItems().deleteItem(id,slot,1);
    			FoodToEat f = FoodToEat.food.get(id);
    			double BonusHeal = getExtraHeal(helm()) + getExtraHeal(chest()) + getExtraHeal(legs());
    			if (c.playerLevel[3] < torvaStat(3, BonusHeal) && c.torva()) {
    				c.playerLevel[3] += f.getHeal();
    				if (c.playerLevel[3] > torvaStat(3, BonusHeal));
    					c.playerLevel[3] = torvaStat(3, BonusHeal);
    			}
    			else if (c.playerLevel[3] < c.getLevelForXP(c.playerXP[3]) && !c.torva()) {
    				c.playerLevel[3] += f.getHeal();
    				if (c.playerLevel[3] > c.getLevelForXP(c.playerXP[3]))
    					c.playerLevel[3] = c.getLevelForXP(c.playerXP[3]);
    			}
    			c.foodDelay = System.currentTimeMillis();
    			c.getPA().refreshSkill(3);
    			c.sendMessage("You eat the " + f.getName() + ".");
    		}		
    	}

    Code:
    	public boolean torva() {
    		if (playerEquipment[playerHat] == 20135 || playerEquipment[playerLegs] == 20143 || playerEquipment[playerChest] == 20139
    		|| playerEquipment[playerHat] == 20147 || playerEquipment[playerLegs] == 20151 || playerEquipment[playerChest] == 20155
    		|| playerEquipment[playerHat] == 20159 || playerEquipment[playerLegs] == 20163 || playerEquipment[playerChest] == 20167) {
    			return true;
    		}
    		return false;
    	}
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Mar 2011
    Posts
    523
    Thanks given
    36
    Thanks received
    27
    Rep Power
    70
    well it works but i had to change
    public int torvaStat(int skill, double amount) {
    return (int)(c.getLevelForXP(c.playerXP[skill]) * amount);
    }
    to
    public int torvaStat(int skill, double amount) {
    return (int)(c.getLevelForXP(c.playerXP[skill]) + amount);
    }
    but the thing is that once u have it on and you have lets say 20hp and you have full torva on and you eat it automatically goes to 139
    Quote Originally Posted by Jack Daniels View Post
    Why wouldn't it work for PI? Do PI programmers use a different kind of Java or something?
    Genius! ^
    Reply With Quote  
     

  4. #4  
    Registered Member
    Mr.Client's Avatar
    Join Date
    Jun 2010
    Posts
    2,094
    Thanks given
    100
    Thanks received
    317
    Rep Power
    251
    Quote Originally Posted by Miner View Post
    well it works but i had to change to but the thing is that once u have it on and you have lets say 20hp and you have full torva on and you eat it automatically goes to 139
    Code:
    public int torvaStat(int skill, double amount) {
    return (int)(c.getLevelForXP(c.playerXP[skill]) * amount);
    }
    should work is u make the amount 1.12 for example would be 12%, also can u explain what you mean automatically goes to 139?
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Mar 2011
    Posts
    523
    Thanks given
    36
    Thanks received
    27
    Rep Power
    70
    well when you change this
    public double getExtraHeal(int i) {
    double heal = 0;
    double[][] HealAmm = {{20135, ammount}, {20143, ammount}, {20139, ammount}};
    for(int l = 0; l < HealAmm.length; l++) {
    if(i == HealAmm[l][0]) {
    heal = HealAmm[l][1];
    }
    }
    return heal;
    }
    and you this

    public int torvaStat(int skill, double amount) {
    return (int)(c.getLevelForXP(c.playerXP[skill]) * amount);
    }
    but you change the first part to this

    public double getExtraHeal(int i) {
    double heal = 0;
    double[][] HealAmm = {{20135, 1.06}, {20143, 1.16}, {20139, 1.21}};
    for(int l = 0; l < HealAmm.length; l++) {
    if(i == HealAmm[l][0]) {
    heal = HealAmm[l][1];
    }
    }
    return heal;
    }
    then it takes all three of them adds them together and multiplies themselves by your HP so for example if u made all of the ammounts to 1 your max hp is 297

    but i think it has to do with this part of your code:
    double BonusHeal = getExtraHeal(helm()) + getExtraHeal(chest()) + getExtraHeal(legs());

    cause it adds them together and multiplies them by your hp level

    but to answer your other question when u eat it will automatically goes to 139 or what ever ur max is with torva
    Quote Originally Posted by Jack Daniels View Post
    Why wouldn't it work for PI? Do PI programmers use a different kind of Java or something?
    Genius! ^
    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. Hybrid Pvp Pk spawn - Torva, Virtus, Pernix! 24/7
    By LorenzoMKW in forum Advertise
    Replies: 26
    Last Post: 02-14-2016, 09:43 AM
  2. Torva,Pernix,Virtus (PI)
    By Mr.Client in forum Snippets
    Replies: 51
    Last Post: 12-23-2012, 02:41 AM
  3. Replies: 3
    Last Post: 05-29-2011, 04:29 PM
  4. Replies: 14
    Last Post: 03-03-2011, 05:22 PM
  5. Replies: 6
    Last Post: 02-28-2011, 04:35 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
  •