Thread: [PI] How to make this possible

Results 1 to 2 of 2
  1. #1 [PI] How to make this possible 
    Registered Member I'mAGeek's Avatar
    Join Date
    Jan 2012
    Age
    28
    Posts
    504
    Thanks given
    146
    Thanks received
    44
    Rep Power
    16
    hello,
    What I'm trying is doing this:

    Code:
    c.playerEquipment[c.playerWeapon] == 5698
    I want to add all the poison weapons, but I think there's a cleaner way of doing this then just adding all the item id's


    I've tried this:

    declared these

    Code:
    	   static boolean poisonWep(int wep) {
    			c.getItems();
    			String wepName = ItemAssistant.getItemName(wep);
    	        for(int i = 0; i < poisionData.length; i++) {
    	            if(wepName.toLowerCase().contains(poisionData[i][0])) {
    	                return true;
    	            }
    	        }
    	        return false;
    	    }
    Code:
        private static String[][] poisionData = {
            {"(p)"},
            {"(p+)"},
            {"(p++)"}
        };
    combatassistant

    Code:
    		if (Poisonable.poisonWep(c.playerWeapon) && o.poisonDamage <= 0 && Misc.random(3) == 1)
    			o.getPA().appendPoison(13);
    but this doesnt work?
    Reply With Quote  
     

  2. #2  
    Extreme Donator


    Join Date
    Nov 2009
    Posts
    1,421
    Thanks given
    559
    Thanks received
    266
    Rep Power
    236
    I don't get why you're trying to loop through your poisonData though.

    Try something like this...

    Code:
    	public boolean poisonWep(String p) {
    		if (player.playerEquipment[player.playerWeapon] < 1) {
    			return false;
    		}
    		return ItemAssistant.getItemName(player.playerEquipment[Constants.WEAPON]).endsWith(p);
    	}

    Then the usage in your combat, something like:
    Code:
    						if (player.poisonWep("(p)")) {
    								ADD POISON METHOD
    							}
    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. Replies: 4
    Last Post: 09-07-2011, 03:55 AM
  2. Replies: 5
    Last Post: 06-29-2010, 10:49 PM
  3. Replies: 3
    Last Post: 05-10-2010, 05:55 AM
  4. Replies: 1
    Last Post: 08-21-2009, 03:02 AM
  5. Replies: 20
    Last Post: 05-11-2008, 01:54 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
  •