Thread: Zaryte Bow, Firing no arrows.

Results 1 to 8 of 8
  1. #1 Zaryte Bow, Firing no arrows. 
    Registered Member
    Join Date
    Mar 2013
    Posts
    192
    Thanks given
    7
    Thanks received
    11
    Rep Power
    38
    Hi all, my zaryte bow requires arrows to be fired but I want it to fire NO arrows,
    I cannot copy the crystal bow methods because there not added but the bow is there and fires, but comes up as an melee weapon on the hit plates.

    here is the zaryte bow RangedAmmo methods;

    Code:
    		ZARYTE_AMMO(new int[] {}, 250, 249, 3, 44, 200, 43, 31),
    the {} is where the ammo id is meant to go, -1, 0 don't work, any ideas? the base is ruse.
    Reply With Quote  
     

  2. #2  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Check your check for range ammounition and make a exception for this bow.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Mar 2013
    Posts
    192
    Thanks given
    7
    Thanks received
    11
    Rep Power
    38
    Equip packet listener:

    Code:
    case 20171:
    			boolean haveAmmo = player.getEquipment().get(Equipment.AMMUNITION_SLOT).getId() == 78;
    			boolean Arrow = player.getEquipment().get(Equipment.AMMUNITION_SLOT).getId() == 78;
    			player.getPacketSender().sendMessage("<img=10> The Zaryte bow WILL NOT work in PvP fights!");
    			break;
    		case 78:
    			boolean zaryte = player.getEquipment().get(Equipment.WEAPON_SLOT).getId() == 20171;
    			boolean hasArrow = player.getEquipment().get(Equipment.AMMUNITION_SLOT).getId() == 78;
    			boolean noWep = player.getEquipment().get(Equipment.WEAPON_SLOT).getId() == -1;
    			if (noWep) {
    				player.getInventory().delete(78, 1);
    				return;
    			}
    			break;
    I've tried changing the ID's to dragon arrows, but still didn't work '78' is the spirit / soul arrow, what's the ID for no arrow to be fired? 0, -1 don't work, and I can't copy the crystal bow code

    Quote Originally Posted by arch337 View Post
    Check your check for range ammounition and make a exception for this bow.
    78, ID fires the bow but whats the ID for no arrow? because -1. 0 just say that you need ammo
    Reply With Quote  
     

  4. #4  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by KryTears View Post
    Equip packet listener:

    Code:
    case 20171:
    			boolean haveAmmo = player.getEquipment().get(Equipment.AMMUNITION_SLOT).getId() == 78;
    			boolean Arrow = player.getEquipment().get(Equipment.AMMUNITION_SLOT).getId() == 78;
    			player.getPacketSender().sendMessage("<img=10> The Zaryte bow WILL NOT work in PvP fights!");
    			break;
    		case 78:
    			boolean zaryte = player.getEquipment().get(Equipment.WEAPON_SLOT).getId() == 20171;
    			boolean hasArrow = player.getEquipment().get(Equipment.AMMUNITION_SLOT).getId() == 78;
    			boolean noWep = player.getEquipment().get(Equipment.WEAPON_SLOT).getId() == -1;
    			if (noWep) {
    				player.getInventory().delete(78, 1);
    				return;
    			}
    			break;
    I've tried changing the ID's to dragon arrows, but still didn't work '78' is the spirit / soul arrow, what's the ID for no arrow to be fired? 0, -1 don't work, and I can't copy the crystal bow code



    78, ID fires the bow but whats the ID for no arrow? because -1. 0 just say that you need ammo
    So look at the boolean that checks for telling you that you need arrows.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Mar 2013
    Posts
    192
    Thanks given
    7
    Thanks received
    11
    Rep Power
    38
    I know but I tried changing those id's to dragon arrows, for an example and they didn't work

    whats the id for firing nothing? 0 or -1
    Reply With Quote  
     

  6. #6  
    Extreme Donator


    Join Date
    Aug 2016
    Posts
    597
    Thanks given
    109
    Thanks received
    96
    Rep Power
    254
    So on ruse when you add a ranged weapon you want to first off add it like you did in CombatRangedAmmo under the weapons side and then in weapon_interfaces.json you want to add the item id with the correct weapon interface like SHORTBOW or LONGBOW. You don't need to create a "custom" ammunition with 0 or -1 because it's not guaranteed to be set up to work like that.

    The best option for you to do is go to DefaultRangedCombatStrategy and you'll find all the methods you need there. You just have to add an exception in like 3 or 4 methods like if(itemId == ZARYTE_BOW_ID) then return (do not check for ammo) basically. A bit more effort than that because you have to add some checks to prevent decrementing ammo and stuff like that, but basically all you need is in DefaultRangedCombatStrategy. Thats actually where your crystal bow is handled where you said it wasn't. If you go to that file and search for the crystal bow id or just "crystal" in general you'll probably find what you're looking for
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Mar 2013
    Posts
    192
    Thanks given
    7
    Thanks received
    11
    Rep Power
    38
    Thanks for the communication, "Crystal" won't appear in any ide search anywhere, and crystal bow is an ranged weapon (fires and uses gfx) but when it hits the player or npc its showing melee hitplates
    Reply With Quote  
     

  8. #8  
    Extreme Donator


    Join Date
    Aug 2016
    Posts
    597
    Thanks given
    109
    Thanks received
    96
    Rep Power
    254
    So in DefaultRangedCombatStrategy you have a canAttack method and this comes default on every ruse server. I wouldn't think that yours would be different, but if it is, then here is the crystal bow code that you're missing.

    canAttack
    Code:
    if (CombatFactory.crystalBow(player)) {
       return true;
    }
    and then in the attack method
    Code:
    if (!CombatFactory.crystalBow(player)) {
       decrementAmmo(player, victim.getPosition());
              if(dBow || player.getRangedWeaponData() == RangedWeaponData.MAGIC_SHORTBOW && player.isSpecialActivated() 
    				&& player.getCombatSpecial() != null && player.getCombatSpecial() == CombatSpecial.MAGIC_SHORTBOW) {
                 decrementAmmo(player, victim.getPosition());
        }
    }
    Like I was saying before you want to return true in your canAttack method for the specific item id of the zaryte bow and then for your attack method you want to decrement ammo if it's not a certain id. Where mine says CombatFactory.crystalBow you would put the item id there instead. Also your crystal bow could be showing up as melee because you don't have the interface set in weapon_interfaces.json and it's defaulting to melee
    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. [PI] How to make zaryte bow not use arrows?
    By Kush Designs in forum Help
    Replies: 4
    Last Post: 07-14-2014, 03:28 AM
  2. Replies: 4
    Last Post: 01-23-2014, 04:20 PM
  3. pi zaryte bow use no arrows
    By is whoopie in forum Help
    Replies: 0
    Last Post: 08-26-2012, 01:13 PM
  4. [PI] Bow with No Arrows [PI]
    By EpIcKoLoL in forum Help
    Replies: 3
    Last Post: 07-25-2011, 03:23 AM
  5. [pi] how do i make zaryte bow use no arrows
    By turm0ilz in forum Requests
    Replies: 2
    Last Post: 04-26-2011, 10:45 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
  •