Thread: Hunterkit for PI

Results 1 to 8 of 8
  1. #1 [PI] Lunar: Hunter Kit [PI] 
    Shake n Bake

    Organic's Avatar
    Join Date
    Apr 2010
    Posts
    2,499
    Thanks given
    204
    Thanks received
    324
    Rep Power
    588
    This is pretty useless but anyway

    Code:
    package server.model.players.content.lunarspells;
    
    import server.model.players.*;
    import server.Config;
    
    /**
     * 
     * @author 2012/Converted to PI by Organic
     * 
     */
    public class HunterKit {
    
    	private static final int REQUIRED_LEVEL = 71;
    	private static final int HUNTER_KIT = 11159;
    
    	public static final int ASTRAL = 9075;
    	public static final int NATURE = 561;
    	public static final int EARTH = 557;
    	public static final int MAGIC_XP = Config.MAGIC_EXP_RATE;
    	
    	public static void castHunterKit(Client c) {
    		if (c.getLastSpell() < 1800) {
    			return;
    		}
    		if(c.playerLevel[6] < REQUIRED_LEVEL) {
    			c.sendMessage("You don't have the required magic level to cast this spell!");
    			c.sendMessage("You need a magic level of " + REQUIRED_LEVEL + " to cast this spell.");
    			return;
    		}
    		if(c.getItems().freeSlots() > 0) {
    		if(c.getItems().playerHasItem(ASTRAL, 2) &&
    					c.getItems().playerHasItem(NATURE, 1) && 
    					c.getItems().playerHasItem(EARTH, 15)) {
    			
    			c.getItems().deleteItem(ASTRAL, c.getItems().getItemSlot(ASTRAL), 2);
    			c.getItems().deleteItem(NATURE, c.getItems().getItemSlot(NATURE), 1);
    			c.getItems().deleteItem(EARTH, c.getItems().getItemSlot(EARTH), 15);
    			
    			c.startAnimation(6303);
    			c.gfx0(1074);
    			c.getPA().addSkillXP(1 * MAGIC_XP, c.playerMagic);
    			c.getItems().addItem((HUNTER_KIT), 1);
    		} else
    			c.sendMessage("You don't have the required runes to cast this spell.");
    		} else {
    			c.sendMessage("You don't have enough inventory space to cast this spell.");
    		}
    		c.setSpellDelay();
    	}
    	
    	private static final int[] HUNTER_ITEMS = { 10150, 10010, 10006, 10031,
    			10029, 596, 10008 };
    
    	public static void openHunterKit(Client c) {
    		if (c.getItems().playerHasItem(HUNTER_KIT, 1)) {
    			if(c.getItems().freeSlots() > 6) {
    				for (int element : HUNTER_ITEMS) {
    					c.getItems().addItem(element, 1);
    					c.getItems().deleteItem(HUNTER_KIT, c.getItems().getItemSlot(HUNTER_KIT), 1);
    				}
    			} else {
    				c.sendMessage("You need at least seven inventory spaces to open this.");
    			}
    		}
    	}
    }
    ClickItem
    Code:
    		case 11159:
    			HunterKit.openHunterKit(c);
    			break;
    clickingbuttons
    Code:
    		case 117147:
    			HunterKit.castHunterKit(c);
    			break;

    Just live life at its fullest.

    LOL
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Oct 2011
    Posts
    2,689
    Thanks given
    1,235
    Thanks received
    673
    Rep Power
    0
    Thanks for this. its now very useful for my players when they are hunting.
    Reply With Quote  
     

  3. #3  
    DystopiaPS

    Bells's Avatar
    Join Date
    Dec 2008
    Age
    27
    Posts
    3,788
    Thanks given
    600
    Thanks received
    1,449
    Rep Power
    4098
    Thanks for this man.
    Reply With Quote  
     

  4. #4  
    Shake n Bake

    Organic's Avatar
    Join Date
    Apr 2010
    Posts
    2,499
    Thanks given
    204
    Thanks received
    324
    Rep Power
    588
    Np

    Just live life at its fullest.

    LOL
    Reply With Quote  
     

  5. #5  
    Extreme Donator


    Join Date
    Oct 2006
    Posts
    1,370
    Thanks given
    64
    Thanks received
    197
    Rep Power
    426
    Nice but
    Code:
    		if(c.playerLevel[6] < 71) {
    			c.sendMessage("You don't have the required magic level to cast this spell!");
    			c.sendMessage("You need a magic level of " + REQUIRED_LEVEL + " to cast this spell.");
    			return;
    		}
    makes no sense to me.


    ~flow@hacking . rs
    Reply With Quote  
     

  6. #6  
    Shake n Bake

    Organic's Avatar
    Join Date
    Apr 2010
    Posts
    2,499
    Thanks given
    204
    Thanks received
    324
    Rep Power
    588
    If magic is less than 71 it will show this message and then the REQUIRED_LEVEL is for private static final int REQUIRED_LEVEL = 71; showing that in the message it will say message 71 message
    idk lol.

    Just live life at its fullest.

    LOL
    Reply With Quote  
     

  7. #7  
    Extreme Donator


    Join Date
    Oct 2006
    Posts
    1,370
    Thanks given
    64
    Thanks received
    197
    Rep Power
    426
    Yeah, I know.

    But why are you using REQUIRED_LEVEL only in the message, and not already in the check? (if (c.playerLevel[c.playerMagic] > REQUIRED_LEVEL))


    ~flow@hacking . rs
    Reply With Quote  
     

  8. #8  
    Shake n Bake

    Organic's Avatar
    Join Date
    Apr 2010
    Posts
    2,499
    Thanks given
    204
    Thanks received
    324
    Rep Power
    588
    ^ Changed it.

    Just live life at its fullest.

    LOL
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •