Thread: Converting to pi

Results 1 to 3 of 3
  1. #1 Converting to pi 
    Registered Member
    Join Date
    Nov 2011
    Posts
    102
    Thanks given
    2
    Thanks received
    3
    Rep Power
    11
    So I am using an insidiax source ( i know.. it is shit.)
    and it doesn't come with poison in combat vs npc or players
    I couldn't figure out how to add it to a [pi] base but i was grave digging to see if anyone released it when rsps where starting out and i found this

    http://www.rune-server.org/runescape...n-players.html

    Spoiler for The post:
    Tutorial: Adding poison for pvp.
    Description: WIll add poison obviously....PvP only.
    Base: Devolution/Delta ( may need to convert to your server )
    Release history: Since 317 Reborn died, I decided to release it.

    Note!: This is only for melee, although making it for both magic and ranging is very simple.
    Code:
    Step 1:
    Open up your player class and add these Integers and Booleans:
    Code:
    	public int
    		poisonDelay = -1,//This calculates the time to show the poison damage
    		minusPoison = 0,//When this reaches 0, the damage will decrease by 1
    		poisonDamage = 0;//How strong the poison is.
    	public boolean
    		poisonHit = false,
    		poisonHit2 = false;//Identifies the poison hit for appendHitUpdates
    .
    Now still in your player class, search for appendHitUpdate,
    below you should see this:
    Code:
    Code:
    			if ((hitDiff > 0) && (newhptype == false)) {
    				str.writeByteA(1); // 0: red hitting - 1: blue hitting
    			} else if ((hitDiff > 0) && (newhptype == true)) {
    				str.writeByteA(hptype); // 0: red hitting - 1: blue hitting
    			} else {
    				str.writeByteA(0); // 0: red hitting - 1: blue hitting
    			}
    Change that to this:
    Code:
    Code:
    if (!poisonHit) {
    				if ((hitDiff > 0) && (newhptype == false)) {
    					str.writeByteA(1); // 0: red hitting - 1: blue hitting
    				} else if ((hitDiff > 0) && (newhptype == true)) {
    					str.writeByteA(hptype); // 0: red hitting - 1: blue hitting
    				} else {
    					str.writeByteA(0); // 0: red hitting - 1: blue hitting
    				}
    			} else {
    				str.writeByteA(2);//poison hitting
    			}
    And below that you should see:
    Code:
    Code:
    if(currentHealth < 0) {
    Add these under it:
    Code:
    				poisonDelay = -1;
    				poisonDamage = 0;
    Now search for the second appendHitUpdate and do the same thing.

    Step2:
    Close and save that class and open your client.java.

    Search for loadGame and add these:
    Code:
    Code:
    else if (token.equals("poisonDelay")) {
    						poisonDelay = Integer.parseInt(token2);
    						if (poisonDelay > 300) {
    							poisonDelay = -1;
    						}
    					} else if (token.equals("poisonDamage")) {
    						poisonDamage = Integer.parseInt(token2);
    					}
    Now search for playerMeleeDamage and add:
    Code:
    Code:
    			if(AttackingOn2.poisonDamage == 0 && AttackingOn2.poisonDelay == -1) {
    				poisonDamage(playerEquipment[playerWeapon], AttackingOn2);
    			}
    Declare this:
    Code:
    Code:
    	public void poisonDamage(int weapon, client plr) {
    		if(plr == null) {//if your enemy is a null, it will not poison
    			return;
    		}
    		if(misc.random(100) <= 30) {
    			if(plr.poisonDelay != -1) {//if your enemy's poisondelay is above -1, it will not poison
    				return;
    			}
    			switch(weapon) {
    				case 5698:// dds p++
    					plr.sendMessage("You have been poisoned!");
    					plr.poisonDamage = 6;
    					plr.poisonDelay = 240;
    					plr.minusPoison = 3;
    					/*This make the weapon poisonous*/
    					break;
    			}
    		}
    	}
    Now in your process or for devolution 2.7 users, playerProcess, paste this in:
    Code:
    Code:
    		if (poisonDelay > -1) {//This is what brings down the hit delay of the poison
    			poisonDelay--;
    			if (poisonDelay == 0 && poisonDamage > 0) {
    				poisonDelay = 30 + misc.random(20);//delay of hit is 30 plus an adding of a random number between 0 and 20
    				if (hitUpdateRequired) {//hit updates
    					poisonHit2 =
    					hitUpdateRequired2 =
    					updateRequired = true;
    					hitDiff2 = poisonDamage;
    					currentHealth -= hitDiff2;
    					minusPoison--;
    				} else {
    					hitUpdateRequired =
    					updateRequired =
    					poisonHit = true;
    					hitDiff = poisonDamage;
    					currentHealth -= hitDiff;
    					minusPoison--;
    				}
    				if(minusPoison == 0) {//Once minusPoison is 0, damage drops by 1
    					poisonDamage--;
    					minusPoison = 3;
    				}
    				if (poisonDamage < 1) {//once the damage is below 1, your poison will disappear
    					sendMessage("Your poison wears off..");
    					poisonDelay = -1;
    				}
    			}
    		}
    While in your process, search for deathStage == 3 and add this:
    Code:
    Code:
    				poisonDelay = -1;
    				poisonDamage = 0;
    				minusPoison = 0;//Resets poisoning when you die
    Last but not least, find saveGame and add this:
    Code:
    Code:
    			characterfile.newLine();
    			characterfile.write("poisonDelay = ", 0, 14);
    			characterfile.write(Integer.toString(poisonDelay), 0, Integer.toString(poisonDelay).length());
    			characterfile.newLine();
    			characterfile.write("poisonDamage = ", 0, 15);
    			characterfile.write(Integer.toString(poisonDamage), 0, Integer.toString(poisonDamage).length());
    This may not be a great tutorial, although atleast it helps the majority of the people.

    Credits:
    -Palidino - base for poison (BS 317)
    -Me - adjusting and editing
    -Pimpscape - appendHitUpdates
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    May 2012
    Posts
    1,084
    Thanks given
    328
    Thanks received
    82
    Rep Power
    135
    It's in the regular PI, rip from it.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Nov 2011
    Posts
    102
    Thanks given
    2
    Thanks received
    3
    Rep Power
    11
    Quote Originally Posted by Dedicati0n View Post
    It's in the regular PI, rip from it.
    the blank [pi] sources i messed around with none had it & the newer ones have really shitty codes involved that can be shortened and cleaner but I guess i can ripp..
    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. Converting new to old?
    By Sir Lethal in forum Help
    Replies: 1
    Last Post: 03-18-2012, 01:14 AM
  2. [PI] Converting [PI]
    By Kickyamom in forum Help
    Replies: 1
    Last Post: 01-13-2011, 03:37 AM
  3. Converting
    By Rukin1 in forum Application Development
    Replies: 2
    Last Post: 09-27-2010, 10:24 PM
  4. Need Help Converting
    By Delifed in forum Help
    Replies: 7
    Last Post: 01-19-2010, 06:19 AM
  5. Need help converting
    By Zeh Pickle in forum Help
    Replies: 13
    Last Post: 06-11-2009, 02:53 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
  •