Thread: [PI/DSPK] - Torva Effect + Spoon Feeding

Results 1 to 10 of 10
  1. #1 [PI/DSPK] - Torva Effect + Spoon Feeding 
    Registered Member Dunhel's Avatar
    Join Date
    Apr 2011
    Posts
    209
    Thanks given
    16
    Thanks received
    5
    Rep Power
    10
    I know this has been released before and it's not mine, but I decided to spoon feed newcomers

    1) Replace your Food.java with this:
    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(15055,0,"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");
    
    
        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 boolean hasFullPrimal() {
        return c.playerEquipment[c.playerHat] == 13362 && c.playerEquipment[c.playerChest] == 13360 && c.playerEquipment[c.playerLegs] == 13361;
      }
    
        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) {
                int maxHp = hasFullPrimal() ? c.getLevelForXP(c.playerXP[3])
                        + c.primalBoost : c.getLevelForXP(c.playerXP[3]);
                c.getCombat().resetPlayerAttack();
                c.attackTimer += 2;
                c.startAnimation(829);
                c.getItems().deleteItem(id, slot, 1);
                FoodToEat f = FoodToEat.food.get(id);
                if (c.playerLevel[3] < maxHp) {
                    c.playerLevel[3] += f.getHeal();
                    if (c.playerLevel[3] > maxHp)
                        c.playerLevel[3] = maxHp;
                }
                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);
      }  
    
    
    }
    2) Change the 13360, 13361, 13362 to your Torva ID's.
    3) Go to Player.java and add this:
    Code:
    	public int primalBoost = 40;
    4) Compile and enjoy

    Credits:
    Warlock 999 - 99.99% For this
    Dunhel - 00.01% for making this
     

  2. #2  
    Extreme Donator

    OpTic Lion's Avatar
    Join Date
    Aug 2010
    Posts
    2,297
    Thanks given
    554
    Thanks received
    869
    Rep Power
    5000
    Nice Job will use



     

  3. #3  
    Registered Member Dunhel's Avatar
    Join Date
    Apr 2011
    Posts
    209
    Thanks given
    16
    Thanks received
    5
    Rep Power
    10
    Quote Originally Posted by Madara View Post
    Nice Job will use
    Thanks, I just saw loads of threads of people asking help with this so I thought I'll just make a little snippet ^.^
     

  4. #4  
    Banned
    Join Date
    Mar 2011
    Posts
    522
    Thanks given
    2
    Thanks received
    30
    Rep Power
    0
    100 errors? D:
    EDIT: NEVERMIND (:
    SORRY
     

  5. #5  
    q.q


    Join Date
    Dec 2010
    Posts
    6,535
    Thanks given
    1,072
    Thanks received
    3,534
    Rep Power
    4752
    Atleast re-name the int...
     

  6. #6  
    Registered Member
    Mr.Client's Avatar
    Join Date
    Jun 2010
    Posts
    2,094
    Thanks given
    100
    Thanks received
    317
    Rep Power
    251
    This is leeched, and its still wrong, sigh..... im gonna release the real effect since people cant seem to read and create simple formula.

    Edit* [Only registered and activated users can see links. ]
     

  7. #7  
    Registered Member Dunhel's Avatar
    Join Date
    Apr 2011
    Posts
    209
    Thanks given
    16
    Thanks received
    5
    Rep Power
    10
    How is this leeched mate? I showed that I got it from Warlock 999 and I just decided to show people how to add it. I even gave him 99.99% Credits so it's not leeched
     

  8. #8  
    Registered Member Despised Icon's Avatar
    Join Date
    Nov 2009
    Age
    28
    Posts
    605
    Thanks given
    5
    Thanks received
    6
    Rep Power
    1
    doesnt work for me

    [Only registered and activated users can see links. ]
     

  9. #9  
    Highly Regarded Member

    Lenin's Avatar
    Join Date
    Nov 2008
    Age
    26
    Posts
    1,885
    Thanks given
    526
    Thanks received
    218
    Rep Power
    2434
    there was nothing more to show apart from finding the file to paste the code in close this
    Extreme Donator

    "It ain't what you don't know that gets you into trouble. It's what you know for sure that just ain't so."
     

  10. #10  
    Respected Member


    Josh's Avatar
    Join Date
    Aug 2008
    Age
    27
    Posts
    2,863
    Thanks given
    6
    Thanks received
    1,342
    Rep Power
    5000
    Successfully doing a tutorial and then posting a new thread with the completed code is not necessary, you should've just posted it on the original thread. Closed.
     


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. [DSPK] - Torva Effect
    By DaincScapeOwner in forum Help
    Replies: 12
    Last Post: 07-08-2011, 12:59 AM
  2. [PI] Add Torva effect?
    By LorenzoMKW in forum Help
    Replies: 2
    Last Post: 05-07-2011, 12:22 PM
  3. Torva effect
    By OFF YOUR TITS in forum Show-off
    Replies: 20
    Last Post: 05-03-2011, 04:49 PM
  4. Replies: 22
    Last Post: 05-20-2010, 05:29 AM
  5. Spoon For The Lost City
    By +Anime in forum Showcase
    Replies: 16
    Last Post: 02-04-2010, 08:10 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
  •