Thread: Work For Both? [PI]

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 Work For Both? [PI] 
    Registered Member
    Join Date
    Mar 2012
    Posts
    710
    Thanks given
    19
    Thanks received
    5
    Rep Power
    37
    How can I make this work for both 9185 and 18357?

    Code:
    			if(c.attackTimer <= 0) {
    				boolean usingBow = false;
    				boolean usingArrows = false;
    				boolean usingOtherRangeWeapons = false;
    				boolean usingCross = c.playerEquipment[c.playerWeapon] == 9185;
    				c.bonusAttack = 0;
    				c.rangeItemUsed = 0;
    				c.projectileStage = 0;
    				if (c.autocasting) {
    					c.spellId = c.autocastId;
    					c.usingMagic = true;
    				}
    				if(c.spellId > 0) {
                        c.usingMagic = true;
                    }
    Reply With Quote  
     

  2. #2  
    Registered Member
    Levi X D's Avatar
    Join Date
    Feb 2012
    Posts
    549
    Thanks given
    92
    Thanks received
    69
    Rep Power
    111
    Code:
    			if(c.attackTimer <= 0) {
    			        boolean usingBow = false;
    			        boolean usingArrows = false;
    			        boolean usingOtherRangeWeapons = false;
    			boolean usingCross = c.playerEquipment[c.playerWeapon] == 9185 || c.playerEquipment[c.playerWeapon] == 18357;
    			        c.bonusAttack = 0;
    				c.rangeItemUsed = 0;
    				c.projectileStage = 0;
    				if (c.autocasting) {
    					c.spellId = c.autocastId;
    					c.usingMagic = true;
    				}
    				if(c.spellId > 0) {
                        c.usingMagic = true;
                    }
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Mar 2012
    Posts
    710
    Thanks given
    19
    Thanks received
    5
    Rep Power
    37
    Thank you, I did that right after I posted that, how about this one though?

    Code:
    	if(c.getCombat().correctBowAndArrows() < c.playerEquipment[c.playerArrows] && Config.CORRECT_ARROWS && usingBow && !c.getCombat().usingCrystalBow() && c.playerEquipment[c.playerWeapon] != 9185) {
    				c.sendMessage("You can't use "+c.getItems().getItemName(c.playerEquipment[c.playerArrows]).toLowerCase()+"s with a "+c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase()+".");
    				c.stopMovement();
    				c.getCombat().resetPlayerAttack();
    				return;
    			}
    Reply With Quote  
     

  4. #4  
    Registered Member
    Levi X D's Avatar
    Join Date
    Feb 2012
    Posts
    549
    Thanks given
    92
    Thanks received
    69
    Rep Power
    111
    Quote Originally Posted by i am here View Post
    Thank you, I did that right after I posted that, how about this one though?

    Code:
    	if(c.getCombat().correctBowAndArrows() < c.playerEquipment[c.playerArrows] && Config.CORRECT_ARROWS && usingBow && !c.getCombat().usingCrystalBow() && c.playerEquipment[c.playerWeapon] != 9185) {
    				c.sendMessage("You can't use "+c.getItems().getItemName(c.playerEquipment[c.playerArrows]).toLowerCase()+"s with a "+c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase()+".");
    				c.stopMovement();
    				c.getCombat().resetPlayerAttack();
    				return;
    			}

    Code:
    	if(c.getCombat().correctBowAndArrows() < c.playerEquipment[c.playerArrows] && Config.CORRECT_ARROWS && usingBow && !c.getCombat().usingCrystalBow() && c.playerEquipment[c.playerWeapon] != 9185 && c.playerEquipment[c.playerWeapon] != 18357) {
    				c.sendMessage("You can't use "+c.getItems().getItemName(c.playerEquipment[c.playerArrows]).toLowerCase()+"s with a "+c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase()+".");
    				c.stopMovement();
    				c.getCombat().resetPlayerAttack();
    				return;
    			}
    Last edited by Levi X D; 06-08-2013 at 05:49 AM. Reason: Figured out what you were asking for
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Mar 2012
    Posts
    710
    Thanks given
    19
    Thanks received
    5
    Rep Power
    37
    Thank you so much, I need it for these last 3.

    Code:
    	if(correctBowAndArrows() < c.playerEquipment[c.playerArrows] && Config.CORRECT_ARROWS && usingBow && !usingCrystalBow() && c.playerEquipment[c.playerWeapon] != 9185) {
    					c.sendMessage("You can't use "+c.getItems().getItemName(c.playerEquipment[c.playerArrows]).toLowerCase()+"s with a "+c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase()+".");
    					c.stopMovement();
    					c.npcIndex = 0;
    					return;
    				}
    Code:
    if(correctBowAndArrows() < c.playerEquipment[c.playerArrows] && Config.CORRECT_ARROWS && usingBow && !usingCrystalBow() && c.playerEquipment[c.playerWeapon] != 9185 && !c.usingMagic) {
    					c.sendMessage("You can't use "+c.getItems().getItemName(c.playerEquipment[c.playerArrows]).toLowerCase()+"s with a "+c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase()+".");
    					c.stopMovement();
    					resetPlayerAttack();
    					return;
    				}
    Code:
    	if (c.playerEquipment[c.playerWeapon] == 9185 && !properBolts() && !c.usingMagic) {
    					c.sendMessage("You must use bolts with a crossbow.");
    					c.stopMovement();
    					resetPlayerAttack();
    					return;				
    				}
    Reply With Quote  
     

  6. #6  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,290
    Thanks given
    151
    Thanks received
    609
    Rep Power
    108
    Quote Originally Posted by i am here View Post
    Thank you so much, I need it for these last 3.

    Code:
    	if(correctBowAndArrows() < c.playerEquipment[c.playerArrows] && Config.CORRECT_ARROWS && usingBow && !usingCrystalBow() && c.playerEquipment[c.playerWeapon] != 9185) {
    					c.sendMessage("You can't use "+c.getItems().getItemName(c.playerEquipment[c.playerArrows]).toLowerCase()+"s with a "+c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase()+".");
    					c.stopMovement();
    					c.npcIndex = 0;
    					return;
    				}
    Code:
    if(correctBowAndArrows() < c.playerEquipment[c.playerArrows] && Config.CORRECT_ARROWS && usingBow && !usingCrystalBow() && c.playerEquipment[c.playerWeapon] != 9185 && !c.usingMagic) {
    					c.sendMessage("You can't use "+c.getItems().getItemName(c.playerEquipment[c.playerArrows]).toLowerCase()+"s with a "+c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase()+".");
    					c.stopMovement();
    					resetPlayerAttack();
    					return;
    				}
    Code:
    	if (c.playerEquipment[c.playerWeapon] == 9185 && !properBolts() && !c.usingMagic) {
    					c.sendMessage("You must use bolts with a crossbow.");
    					c.stopMovement();
    					resetPlayerAttack();
    					return;				
    				}
    Don't you understand what he's shown you.. It's rather simple
    Reply With Quote  
     

  7. #7  
    Registered Member
    Levi X D's Avatar
    Join Date
    Feb 2012
    Posts
    549
    Thanks given
    92
    Thanks received
    69
    Rep Power
    111
    Quote Originally Posted by i am here View Post
    Thank you so much, I need it for these last 3.

    Code:
    	if(correctBowAndArrows() < c.playerEquipment[c.playerArrows] && Config.CORRECT_ARROWS && usingBow && !usingCrystalBow() && c.playerEquipment[c.playerWeapon] != 9185 && c.playerEquipment[c.playerWeapon] != 18357) {
    					c.sendMessage("You can't use "+c.getItems().getItemName(c.playerEquipment[c.playerArrows]).toLowerCase()+"s with a "+c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase()+".");
    					c.stopMovement();
    					c.npcIndex = 0;
    					return;
    				}
    Code:
    if(correctBowAndArrows() < c.playerEquipment[c.playerArrows] && Config.CORRECT_ARROWS && usingBow && !usingCrystalBow() && c.playerEquipment[c.playerWeapon] != 9185 && c.playerEquipment[c.playerWeapon] != 18357 && !c.usingMagic) {
    					c.sendMessage("You can't use "+c.getItems().getItemName(c.playerEquipment[c.playerArrows]).toLowerCase()+"s with a "+c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase()+".");
    					c.stopMovement();
    					resetPlayerAttack();
    					return;
    				}
    Code:
    	if (c.playerEquipment[c.playerWeapon] == 9185 && c.playerEquipment[c.playerWeapon] == 18357 && !properBolts() && !c.usingMagic) {
    					c.sendMessage("You must use bolts with a crossbow.");
    					c.stopMovement();
    					resetPlayerAttack();
    					return;				
    				}
    Code:
    	if(correctBowAndArrows() < c.playerEquipment[c.playerArrows] && Config.CORRECT_ARROWS && usingBow && !usingCrystalBow() && c.playerEquipment[c.playerWeapon] != 9185 && c.playerEquipment[c.playerWeapon] != 18357) {
    					c.sendMessage("You can't use "+c.getItems().getItemName(c.playerEquipment[c.playerArrows]).toLowerCase()+"s with a "+c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase()+".");
    					c.stopMovement();
    					c.npcIndex = 0;
    					return;
    				}
    Code:
    if(correctBowAndArrows() < c.playerEquipment[c.playerArrows] && Config.CORRECT_ARROWS && usingBow && !usingCrystalBow() && c.playerEquipment[c.playerWeapon] != 9185 && c.playerEquipment[c.playerWeapon] != 18357 && !c.usingMagic) {
    					c.sendMessage("You can't use "+c.getItems().getItemName(c.playerEquipment[c.playerArrows]).toLowerCase()+"s with a "+c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase()+".");
    					c.stopMovement();
    					resetPlayerAttack();
    					return;
    				}
    Code:
    	if (c.playerEquipment[c.playerWeapon] == 9185 && c.playerEquipment[c.playerWeapon] == 18357 && !properBolts() && !c.usingMagic) {
    					c.sendMessage("You must use bolts with a crossbow.");
    					c.stopMovement();
    					resetPlayerAttack();
    					return;				
    				}
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  8. Thankful user:


  9. #8  
    Registered Member
    Join Date
    Mar 2012
    Posts
    710
    Thanks given
    19
    Thanks received
    5
    Rep Power
    37
    Thanks soooooo much!
    Reply With Quote  
     

  10. #9  
    Registered Member
    Levi X D's Avatar
    Join Date
    Feb 2012
    Posts
    549
    Thanks given
    92
    Thanks received
    69
    Rep Power
    111
    Quote Originally Posted by i am here View Post
    Thanks soooooo much!
    Your welcome :]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  11. #10  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    976
    Thanks given
    47
    Thanks received
    160
    Rep Power
    366
    He made a little error at the third one though, should be an or instead of and and wrapped between parantheses:
    Code:
    if ((c.playerEquipment[c.playerWeapon] == 9185 || c.playerEquipment[c.playerWeapon] == 18357) && !properBolts() && !c.usingMagic) {
    	c.sendMessage("You must use bolts with a crossbow.");
    	c.stopMovement();
    	resetPlayerAttack();
    	return;				
    }
    That way you must have either weaponId 9185 or weaponId 18357 AND not using propper bolts AND not using magic.
    (Are these 2 lasts ones correct or does it have to be in combination with one of the weaponIds?)
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Commands dont work for owner [pi]
    By YooYoo in forum Help
    Replies: 25
    Last Post: 12-18-2012, 05:22 AM
  2. Replies: 101
    Last Post: 08-26-2011, 12:33 AM
  3. Replies: 13
    Last Post: 01-04-2011, 04:32 PM
  4. Replies: 0
    Last Post: 08-31-2010, 05:01 AM
  5. Replies: 3
    Last Post: 08-07-2010, 06:28 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •