MegaMediaLife
Welcome to MegaMediaLife. Register to post Have fun!!!!


MegaMediaLife
 
HomeHomeCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 How to make arrows drop

Go down 
AuthorMessage
clayd
Moderator


Posts : 8
Reputation : 0
Join date : 2009-11-15

PostSubject: How to make arrows drop   Sun Nov 15, 2009 10:45 pm

this will make the arrows that you shoot at npc's or people drop instead of disappearing
difficulty 2/10
client.java (server side)

ok first search this

Code:

public class client extends Player implements Runnable {
under that add this

Code:

  public void DropArrows() {
  int EnemyX = PlayerHandler.players[AttackingOn].absX;
  int EnemyY = PlayerHandler.players[AttackingOn].absY;
  if(playerEquipment[playerWeapon] != 4214 && playerEquipmentN[playerArrows] != 0)
   if (ItemHandler.itemAmount(playerEquipment[playerArrows], EnemyX, EnemyY) == 0) {
          ItemHandler.addItem(playerEquipment[playerArrows], EnemyX, EnemyY, 1, playerId, false);
   } else if (ItemHandler.itemAmount(playerEquipment[playerArrows], EnemyX, EnemyY) != 0) {
       int amount = ItemHandler.itemAmount(playerEquipment[playerArrows], EnemyX, EnemyY);
       ItemHandler.removeItem(playerEquipment[playerArrows], EnemyX, EnemyY, amount);
       ItemHandler.addItem(playerEquipment[playerArrows], EnemyX, EnemyY, amount + 1, playerId, false);
   }
}
public void DropArrowsNpc() {
  int EnemyX = server.npcHandler.npcs[attacknpc].absX;
  int EnemyY = server.npcHandler.npcs[attacknpc].absY;
  int arrowdrop = misc.random(3);
  if(playerEquipment[playerWeapon] != 4214 && playerEquipmentN[playerArrows] != 0 && arrowdrop == 0)
  if (ItemHandler.itemAmount(playerEquipment[playerArrows], EnemyX, EnemyY) == 0) {
        ItemHandler.addItem(playerEquipment[playerArrows], EnemyX, EnemyY, 1, playerId, false);
   } else if (ItemHandler.itemAmount(playerEquipment[playerArrows], EnemyX, EnemyY) != 0) {
       int amount = ItemHandler.itemAmount(playerEquipment[playerArrows], EnemyX, EnemyY);
       ItemHandler.removeItem(playerEquipment[playerArrows], EnemyX, EnemyY, amount);
       ItemHandler.addItem(playerEquipment[playerArrows], EnemyX, EnemyY, amount + 1, playerId, false);
   }
}

then search for
Code:

if (UseBow) {

you will see something like this
Code:

HasArrows = false;
            CheckArrows();
            //CalculateRange();
            hitDiff = misc.random(maxRangeHit());
            //drawback();
            
under the last thing you have like for me its //drawback();
add this
Code:

DropArrows();

so it should now look like this
Code:

HasArrows = false;
            CheckArrows();
            //CalculateRange();
            hitDiff = misc.random(maxRangeHit());
            //drawback();
            DropArrows();
ok then search for this
Code:

if (hasCrystalBow()
you will see something like this
Code:

//CalculateRange();
         drawback();
add this under drawback();
Code:
DropArrowsNpc();
now search for this
Code:

if (UseBow && playerEquipment[playerWeapon] != 4734 && !hasCrystalBow() && playerEquipment[playerWeapon] != 4827 && System.currentTimeMillis() - lastAction > actionInterval) {
add this under drawback();
Code:

DropArrowsNpc();
now search this
Code:

if (UseBow && playerEquipment[playerWeapon] == 4827 && System.currentTimeMillis() - lastAction > actionInterval) {
add this under drawback();
Code:

DropArrowsNpc();


OK! thats it! now your arrows should drop, not all em them its like 2 out of every 3.
Back to top Go down
View user profile
Owner
Admin
avatar

Posts : 41
Reputation : 2
Join date : 2009-11-15
Age : 24
Location : Everywhere.

PostSubject: Re: How to make arrows drop   Sun Nov 15, 2009 10:46 pm

Great guide, should alot of newbies.
Back to top Go down
View user profile http://Www.megamedialife.com
 
How to make arrows drop
Back to top 
Page 1 of 1
 Similar topics
-
» How to apply Drop Shadow to your Images: Photoshop (any version)
» How to make yourself look like a smurf.
» How do you make a mmv ?
» How do you make your fantage character, your avatar?
» Robinson's raft & Bits of plane drop rate

Permissions in this forum:You cannot reply to topics in this forum
MegaMediaLife :: Runescape Private Servers :: 317 Related Boards :: Tutorials-
Jump to: