HydroPK
Welcome To HydroPK's Forum!
Thank you for visiting the site, and We hope you enjoy your stay!
please, go to http://www.vhpk.tk/ and Vote for us! Smile
HydroPK
Would you like to react to this message? Create an account in a few clicks or log in to continue.


one of the top RSPS around!
 
HomeHome  PortalPortal  Chat Box  Latest imagesLatest images  RegisterRegister  Log in  

 

 Herblore by Zack_flowers (:

Go down 
+2
chef sk1llz
zack_flowers
6 posters
AuthorMessage
zack_flowers




Posts : 9
Reputation : 0
Join date : 2010-07-09

Herblore by Zack_flowers (: Empty
PostSubject: Herblore by Zack_flowers (:   Herblore by Zack_flowers (: EmptyFri Jul 09, 2010 10:53 pm

Server is new and has limited skills, I want this server to reach the full potential, so here it is, an alright herblore base.

make a new folder named herblore under palidino76.rs2.skills; and add this class Herblore.java

Code:
package palidino76.rs2.player.skills.herblore;

import palidino76.rs2.player.items.PlayerItems;
import palidino76.rs2.player.Player;
import palidino76.rs2.Engine;

public class Herblore {

        private Player p;
        private PlayerItems Items = new PlayerItems();
        private final int ExperianceRate = 1;

        public Herblore(Player p) {
            this.p = p;
        }

   private final int[] Herbs = {249,251,253,255,257,2998,10978,259,261,263,3000,265,2481,267,269};

   private final int[] SecondaryItems = {221,235,225,1939,223,1550,1581,1581,1975,239,1939,12630,2152,9736,231,2970,10111,225,241,223,10937,239,6049,241,245,3138,247,6051,6693};

   private final int[][] GrabUnfinished = {{249, 91},{251, 93},{253, 95},{255, 97},{257, 99},{2998, 111},{10978, 12181},{259, 101},{261, 103},{263, 105},{3000, 3004},{265, 107},{2481, 2483},{267, 109},{269, 111}};

   private final int[][] GrabFinished = {{221,91,1,225,121},{235,93,5,342,175},{225,95,12,450,115},{1939,91,19,450,10142},{223,97,22,600,225},{1550,127,22,600,7662},{1581,97,25,720,1582},{1975,97,26,884,3010},{239,99,30,1050,133},
                         {1939,93,31,750,10143},{12630,91,31,720,12633},{2152,95,34,960,3034},{9736,97,38,1026,9741},{231,99,38,1080,139},{1939,95,39,750,10144},{12109,12181,40,1195,12142},{1939,97,44,870,10145},
                         {221,101,45,1200,145},{235,101,48,1272,181},{231,103,50,1356,151},{2970,103,52,1425,3018},{10111,103,53,1470,10000},{225,105,55,1545,157},{241,105,60,1608,187},{223,3002,63,1590,3026},
                         {10937,3024,65,1920,10927},{239,107,66,1800,163},{6049,111,68,1860,2446},{241,2483,69,1866,2454},{245,169,72,1956,2454},{3138,2483,76,2100,3042},{247,1111,78,2400,189},{6051,101,79,2460,181},
                         {6693,111,81,5000,6687}};

   private int AloudPot(int SecondaryItem) {
      for (int i = 0; GrabFinished.length > i; i++) {
         if(GrabFinished[i][0] == SecondaryItem) {
            return GrabFinished[i][1];
         }
      }
      return -1;
   }

   private int LevelReq(int SecondaryItem) {
      for (int i = 0; GrabFinished.length > i; i++) {
         if(GrabFinished[i][0] == SecondaryItem) {
            return GrabFinished[i][2];
         }
      }
      return -1;
   }

   private int Experiance(int SecondaryItem) {
      for (int i = 0; GrabFinished.length > i; i++) {
         if(GrabFinished[i][0] == SecondaryItem) {
            return (GrabFinished[i][3]) * ExperianceRate;
         }
      }
      return -1;
   }

   private int GetFinished(int SecondaryItem) {
      for (int i = 0; GrabFinished.length > i; i++) {
         if(GrabFinished[i][0] == SecondaryItem) {
            return (GrabFinished[i][4]) * ExperianceRate;
         }
      }
      return -1;
   }

   private int GetUnfinished(int Herb) {
      for (int i = 0; GrabUnfinished.length > i; i++) {
         if(GrabUnfinished[i][0] == Herb) {
            return GrabUnfinished[i][1];
         }
      }
      return -1;
   }

   private boolean IsHerb(int item) {
      for (int i = 0; Herbs.length > i; i++) {
         if(Herbs[i] == item) {
            return true;
         }
      }
      return false;
   }
   private boolean IsSecondaryItem(int item) {
      for (int i = 0; SecondaryItems.length > i; i++) {
         if(SecondaryItems[i] == item) {
            return true;
         }
      }
      return false;
   }

   private boolean IsWater(int item) {
      return item == 227;
   }

   private int HerbloreLvl() {
      return p.skillLvl[15];
   }

   private void DeleteItem(int item) {
      Engine.playerItems.deleteItem(p, item, Engine.playerItems.getItemSlot(p, item), 1);
   }

   private void AddItem(int item) {
      Engine.playerItems.addItem(p, item, 1);
   }

   private void Message(String Message) {
      p.frames.sendMessage(p, Message);
   }

   private void AppendXp(int Xp) {
      p.appendExperience(Xp, 15);
   }

   private void HerbAnim() {
      p.requestAnim(363, 0);
   }

   public void HandleUnfinished(int ItemUsed, int UsedWith) {
      if(p == null || !IsHerb(ItemUsed) && !IsHerb(UsedWith) || !IsWater(ItemUsed) && !IsWater(UsedWith)) {
         return;
      }
      DeleteItem(ItemUsed);
      DeleteItem(UsedWith);
      HerbAnim();

      if(IsWater(ItemUsed)) {
         AddItem(GetUnfinished(UsedWith));
         Message("You make a " +  Engine.items.getItemName(GetUnfinished(UsedWith)) + ".");
      }
      if(IsWater(UsedWith)) {
         AddItem(GetUnfinished(ItemUsed));
         Message("You make a " +  Engine.items.getItemName(GetUnfinished(ItemUsed)) + ".");
      }
   }

   public void HandleFinished(int ItemUsed, int UsedWith) {
      if(p == null || !IsSecondaryItem(ItemUsed) && !IsSecondaryItem(UsedWith)) {
         return;
      }

      if(IsSecondaryItem(ItemUsed) &&  AloudPot(ItemUsed) == UsedWith) {
         if(HerbloreLvl() >= LevelReq(ItemUsed)) {
            AddItem(GetFinished(ItemUsed));
            AppendXp(Experiance(ItemUsed));
            Message("You make a " +  Engine.items.getItemName(GetFinished(ItemUsed)) + ".");
            DeleteItem(ItemUsed);
            DeleteItem(UsedWith);
            HerbAnim();
         } else {
            Message("You Need Atleast " + LevelReq(ItemUsed) + " In Herblore To Make This Potion");
         }
      }
      if(IsSecondaryItem(UsedWith) &&  AloudPot(UsedWith) == ItemUsed) {
         if(HerbloreLvl() >= LevelReq(UsedWith)) {
            AddItem(GetFinished(UsedWith));
            AppendXp(Experiance(UsedWith));
            Message("You make a " +  Engine.items.getItemName(GetFinished(UsedWith)) + ".");
            DeleteItem(ItemUsed);
            DeleteItem(UsedWith);
            HerbAnim();
         } else {
            Message("You Need Atleast " + LevelReq(UsedWith) + " In Herblore To Make This Potion.");
         }
      }

   }

}
Now Save!

Now open up itemonitem.java under packets folder and add this under
Code:
int itemUsed = player.stream.readSignedWordA();

Code:
player.Herb.HandleUnfinished(itemUsed, usedWith);
                player.Herb.HandleFinished(itemUsed, usedWith);
Now Save!

Now open up player.java and add this import

Code:
import palidino76.rs2.player.skills.herblore.*;

and under public class player { add this
Code:
public Herblore Herb = new Herblore(this);

Now to make the shop! Add this to your shophandler.java or shops.java idk what java file u have it in.
Code:
    public int[] herb1 = {227, 249,251,253,255,257,2998,10978,259,261,263,3000,265,2481,267,269, 221,235,1939,1550,1581,1581,1975,239,1939,12630,2152,9736,231,2970,225,223,239,6049,241,245,3138,247,6051,6693};
    public int[] herb1n = {100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 10000, 100000,100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 10000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 10000, 100000,100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 10000, 100000};
    public int[] herbp = {100, 200, 400, 800, 1000, 4500, 3000, 700, 2000, 2000, 2500, 12000, 3000, 3500, 1500, 1875, 10, 85, 250, 125, 375, 475, 750, 375, 1000, 550, 800, 575, 933, 700,475, 720, 500,785,900,275,450,1200, 1500};


Now Save and Compile!


Last edited by zack_flowers on Fri Jul 09, 2010 10:57 pm; edited 1 time in total (Reason for editing : forgot shops)
Back to top Go down
chef sk1llz

chef sk1llz


Posts : 153
Reputation : 4
Join date : 2010-07-12
Age : 29
Location : New York

Herblore by Zack_flowers (: Empty
PostSubject: Re: Herblore by Zack_flowers (:   Herblore by Zack_flowers (: EmptyMon Jul 12, 2010 8:02 am

That just gave me a headache, but I will figure this out thanks
Back to top Go down
hydro
IN-game Owner
hydro


Posts : 179
Reputation : 5
Join date : 2010-07-09
Age : 29
Location : Texas

Herblore by Zack_flowers (: Empty
PostSubject: Re: Herblore by Zack_flowers (:   Herblore by Zack_flowers (: EmptyMon Jul 12, 2010 12:36 pm

lmao no you won't! =D
Back to top Go down
http://gaminginfinity.forumotion.com/forum.htm
chef sk1llz

chef sk1llz


Posts : 153
Reputation : 4
Join date : 2010-07-12
Age : 29
Location : New York

Herblore by Zack_flowers (: Empty
PostSubject: Re: Herblore by Zack_flowers (:   Herblore by Zack_flowers (: EmptyMon Jul 12, 2010 12:49 pm

Thanks for support
Back to top Go down
world pker
IN-game Admin



Posts : 89
Reputation : -2
Join date : 2010-07-09
Age : 29

Herblore by Zack_flowers (: Empty
PostSubject: Re: Herblore by Zack_flowers (:   Herblore by Zack_flowers (: EmptyMon Jul 12, 2010 1:27 pm

interesting...
Back to top Go down
world pker
IN-game Admin



Posts : 89
Reputation : -2
Join date : 2010-07-09
Age : 29

Herblore by Zack_flowers (: Empty
PostSubject: Re: Herblore by Zack_flowers (:   Herblore by Zack_flowers (: EmptyMon Jul 12, 2010 1:27 pm

keep up good work
Back to top Go down
hydro
IN-game Owner
hydro


Posts : 179
Reputation : 5
Join date : 2010-07-09
Age : 29
Location : Texas

Herblore by Zack_flowers (: Empty
PostSubject: Re: Herblore by Zack_flowers (:   Herblore by Zack_flowers (: EmptyMon Jul 12, 2010 1:29 pm

hey please don't double post, just edit the first post Smile
Back to top Go down
http://gaminginfinity.forumotion.com/forum.htm
Emo Skill




Posts : 3
Reputation : 0
Join date : 2010-07-21

Herblore by Zack_flowers (: Empty
PostSubject: Re: Herblore by Zack_flowers (:   Herblore by Zack_flowers (: EmptyThu Jul 22, 2010 2:13 pm

L0l 508 coding makes no sense to me.
Back to top Go down
hydro
IN-game Owner
hydro


Posts : 179
Reputation : 5
Join date : 2010-07-09
Age : 29
Location : Texas

Herblore by Zack_flowers (: Empty
PostSubject: Re: Herblore by Zack_flowers (:   Herblore by Zack_flowers (: EmptyThu Jul 22, 2010 3:26 pm

lol I like it.. too bad I couldn't use this.. there is a lot different on my source than in that code.
Back to top Go down
http://gaminginfinity.forumotion.com/forum.htm
gwann




Posts : 67
Reputation : -4
Join date : 2010-07-20
Age : 28

Herblore by Zack_flowers (: Empty
PostSubject: Re: Herblore by Zack_flowers (:   Herblore by Zack_flowers (: EmptySat Jul 24, 2010 2:43 am

ohh thx u all
guys=]
Back to top Go down
Sponsored content





Herblore by Zack_flowers (: Empty
PostSubject: Re: Herblore by Zack_flowers (:   Herblore by Zack_flowers (: Empty

Back to top Go down
 
Herblore by Zack_flowers (:
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
HydroPK :: HydroPK Server :: Tutorials/Guides-
Jump to: