Thread: [PI] Bolts/Arrows don't show when shot

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 [PI] Bolts/Arrows don't show when shot 
    Registered Member Joseph69's Avatar
    Join Date
    Sep 2012
    Posts
    293
    Thanks given
    45
    Thanks received
    20
    Rep Power
    56
    In my current source range is unusual. I use a magic bow, and rune crossbow and what ever I shoot does not show? I would love it if someone could assist me.

    Combatass

    Code:
    package server.model.players.content.combat;
    
    import server.Config;
    import server.model.npcs.NPCHandler;
    import server.model.players.Client;
    import server.model.players.Player;
    import server.model.players.PlayerHandler;
    
    public class RangeData {
    
    	public static void fireProjectileNpc(Client c) {
    		if (c.oldNpcIndex > 0) {
    			if (NPCHandler.npcs[c.oldNpcIndex] != null) {
    				c.projectileStage = 2;
    				int pX = c.getX();
    				int pY = c.getY();
    				int nX = NPCHandler.npcs[c.oldNpcIndex].getX();
    				int nY = NPCHandler.npcs[c.oldNpcIndex].getY();
    				int offX = (pY - nY) * -1;
    				int offY = (pX - nX) * -1;
    				if (!c.msbSpec)
    					c.getPA().createPlayersProjectile(pX, pY, offX, offY, 50,
    							c.getCombat().getProjectileSpeed(),
    							c.getCombat().getRangeProjectileGFX(), 43, 31,
    							c.oldNpcIndex + 1, c.getCombat().getStartDelay());
    				else if (c.msbSpec) {
    					c.getPA().createPlayersProjectile2(pX, pY, offX, offY, 50,
    							c.getCombat().getProjectileSpeed(),
    							c.getCombat().getRangeProjectileGFX(), 43, 31,
    							c.oldNpcIndex + 1, c.getCombat().getStartDelay(),
    							10);
    					c.msbSpec = false;
    				}
    				if (c.getCombat().usingDbow())
    					c.getPA().createPlayersProjectile2(pX, pY, offX, offY, 50,
    							c.getCombat().getProjectileSpeed(),
    							c.getCombat().getRangeProjectileGFX(), 60, 31,
    							c.oldNpcIndex + 1, c.getCombat().getStartDelay(),
    							35);
    			}
    		}
    	}
    
    	public static void fireProjectilePlayer(Client c) {
    		if (c.oldPlayerIndex > 0) {
    			if (PlayerHandler.players[c.oldPlayerIndex] != null) {
    				c.projectileStage = 2;
    				int pX = c.getX();
    				int pY = c.getY();
    				int oX = PlayerHandler.players[c.oldPlayerIndex].getX();
    				int oY = PlayerHandler.players[c.oldPlayerIndex].getY();
    				int offX = (pY - oY) * -1;
    				int offY = (pX - oX) * -1;
    				if (c.playerEquipment[Player.playerWeapon] == 15241) {
    					if (!c.specGfx) {
    						c.gfx0(2138);
    					}
    					c.getPA().createPlayersProjectile2(pX, pY, offX, offY, 50,
    							55, getRangeProjectileGFX(c), 22, 22,
    							c.oldPlayerIndex - 1, c.getCombat().getStartDelay(), -1);
    					c.specGfx = false;
    				} else if (!c.msbSpec)
    					c.getPA().createPlayersProjectile(pX, pY, offX, offY, 50,
    							c.getCombat().getProjectileSpeed(),
    							c.getCombat().getRangeProjectileGFX(), 43, 31,
    							-c.oldPlayerIndex - 1,
    							c.getCombat().getStartDelay());
    				else if (c.msbSpec) {
    					c.getPA().createPlayersProjectile2(pX, pY, offX, offY, 50,
    							c.getCombat().getProjectileSpeed(),
    							c.getCombat().getRangeProjectileGFX(), 43, 31,
    							-c.oldPlayerIndex - 1,
    							c.getCombat().getStartDelay(), 10);
    					c.msbSpec = false;
    				}
    				if (c.getCombat().usingDbow())
    					c.getPA().createPlayersProjectile2(pX, pY, offX, offY, 50,
    							c.getCombat().getProjectileSpeed(),
    							c.getCombat().getRangeProjectileGFX(), 60, 31,
    							-c.oldPlayerIndex - 1,
    							c.getCombat().getStartDelay(), 35);
    			}
    		}
    	}
    
    	public static int getRangeStr(int i) {
    		int str = 0;
    		int[][] data = { { 877, 10 }, { 9140, 46 }, { 9145, 36 }, { 9141, 64 },
    				{ 9142, 82 }, { 9143, 100 }, { 9144, 115 }, { 9236, 14 },
    				{ 9237, 30 }, { 9238, 48 }, { 9239, 66 }, { 9240, 83 },
    				{ 9241, 85 }, { 9242, 103 }, { 9243, 105 }, { 9244, 147 },
    				{ 9245, 185 }, { 882, 7 }, { 884, 10 }, { 886, 16 },
    				{ 888, 22 }, { 890, 31 }, { 892, 49 }, { 4740, 55 },
    				{ 11212, 60 }, { 806, 1 }, { 807, 3 }, { 808, 4 }, { 809, 7 },
    				{ 810, 10 }, { 811, 14 }, { 11230, 20 }, { 864, 3 },
    				{ 863, 4 }, { 865, 7 }, { 866, 10 }, { 867, 14 }, { 868, 24 },
    				{ 825, 6 }, { 826, 10 }, { 827, 12 }, { 828, 18 }, { 829, 28 },
    				{ 830, 42 }, { 800, 5 }, { 801, 7 }, { 802, 11 }, { 803, 16 },
    				{ 804, 23 }, { 805, 36 }, { 9976, 0 }, { 9977, 15 },
    				{ 4212, 70 }, { 4214, 70 }, { 4215, 70 }, { 4216, 70 },
    				{ 4217, 70 }, { 4218, 70 }, { 4219, 70 }, { 4220, 70 },
    				{ 4221, 70 }, { 4222, 70 }, { 4223, 70 }, { 6522, 49 },
    				{ 10034, 15 }, { 13883, 195 }, { 13879, 210 }, { 15243, 195 }, };
    		for (int l = 0; l < data.length; l++) {
    			if (i == data[l][0]) {
    				str = data[l][1];
    			}
    		}
    		return str;
    	}
    
    	public static int getRangeStartGFX(Client c) {
    		int str = -1;
    		int[][] data = {
    				// KNIFES
    				{ 863, 220 }, { 864, 219 },
    				{ 865, 221 },
    				{ 866, 223 },
    				{ 867, 224 },
    				{ 868, 225 },
    				{ 869, 222 },
    				{ 15241, 2138 },
    				// DARTS
    				{ 806, 1234 }, { 807, 1235 },
    				{ 808, 1236 },
    				{ 809, 1238 },
    				{ 810, 1239 },
    				{ 811, 1240 },
    				{ 11230, 1242 },
    
    				// JAVELIN
    				{ 825, 206 }, { 826, 207 },
    				{ 827, 208 },
    				{ 828, 209 },
    				{ 829, 210 },
    				{ 830, 211 },
    
    				// AXES
    				{ 800, 42 }, { 801, 43 }, { 802, 44 },
    				{ 803, 45 },
    				{ 804, 46 },
    				{ 805, 48 },
    
    				// ARROWS
    				{ 882, 19 }, { 884, 18 }, { 886, 20 }, { 888, 21 },
    				{ 890, 22 },
    				{ 892, 24 },
    
    				// CRYSTAL_BOW
    				{ 4212, 250 }, { 4214, 250 }, { 4215, 250 }, { 4216, 250 },
    				{ 4217, 250 }, { 4218, 250 }, { 4219, 250 }, { 4220, 250 },
    				{ 4221, 250 }, { 4222, 250 }, { 4223, 250 }, };
    		for (int l = 0; l < data.length; l++) {
    			if (c.rangeItemUsed == data[l][0]) {
    				str = data[l][1];
    			}
    		}
    		if (c.playerEquipment[3] == 11235) {
    			int[][] moreD = { { 882, 1104 }, { 884, 1105 }, { 886, 1106 },
    					{ 888, 1107 }, { 890, 1108 }, { 892, 1109 },
    					{ 11212, 1111 }, };
    			for (int l = 0; l < moreD.length; l++) {
    				if (c.playerEquipment[Player.playerArrows] == moreD[l][0]) {
    					str = moreD[l][1];
    				}
    			}
    		}
    		return str;
    	}
    
    	public static int getRangeProjectileGFX(Client c) {
    		if (c.dbowSpec) {
    			return c.playerEquipment[Player.playerArrows] == 11212 ? 1099: 1101;
    		}
    		if (c.bowSpecShot > 0) {
    			switch (c.rangeItemUsed) {
    			default:
    				return 249;
    			}
    		}
    		boolean castingMagic = (c.usingMagic || c.mageFollow || c.autocasting || c.spellId > 0);
    		if (castingMagic) {
    			return -1;
    		}
    		if (c.playerEquipment[Player.playerWeapon] == 9185
    				|| c.playerEquipment[Player.playerWeapon] == 18357)
    			return 27;
    		int str = -1;
    		int[][] data = {
    				// KNIFES
    				{ 863, 213 },
    				{ 864, 212 },
    				{ 865, 214 },
    				{ 866, 216 },
    				{ 867, 217 },
    				{ 868, 218 },
    				{ 869, 215 },
    
    				// DARTS
    				{ 806, 226 },
    				{ 807, 227 },
    				{ 808, 228 },
    				{ 809, 229 },
    				{ 810, 230 },
    				{ 811, 231 },
    
    				// JAVELINS
    				{ 825, 200 },
    				{ 826, 201 },
    				{ 827, 202 },
    				{ 828, 203 },
    				{ 829, 204 },
    				{ 830, 205 },
    
    				// AXES
    				{ 800, 36 }, { 801, 35 }, { 802, 37 },
    				{ 803, 38 },
    				{ 804, 39 },
    				{ 805, 40 },
    				{ 15241, 2143 },
    				// ARROWS
    				{ 882, 10 }, { 884, 9 }, { 886, 11 },
    				{ 888, 12 },
    				{ 890, 13 },
    				{ 892, 15 },
    				{ 11212, 1120 },
    
    				// CHINCHOMPA
    				{ 10033, 908 },
    				{ 10034, 909 },
    
    				// OTHERS
    				{ 6522, 442 }, { 4740, 27 }, { 4212, 249 }, { 4214, 249 },
    				{ 4215, 249 }, { 4216, 249 }, { 4217, 249 }, { 4218, 249 },
    				{ 4219, 249 }, { 4220, 249 }, { 4221, 249 }, { 4222, 249 },
    				{ 4223, 249 }, };
    		for (int l = 0; l < data.length; l++) {
    			if (c.rangeItemUsed == data[l][0]) {
    				str = data[l][1];
    			}
    		}
    		return str;
    	}
    
    	public static int getRangeEndGFX(Client c) {
    		int str = -1;
    		int gfx = 0;
    		int[][] data = { { 10033, 157, 100 }, { 10034, 157, 100 }, };
    		for (int l = 0; l < data.length; l++) {
    			if (c.playerEquipment[Player.playerWeapon] == data[l][0]) {
    				str = data[l][1];
    				gfx = data[l][2];
    			}
    		}
    		if (gfx == 100) {
    			c.rangeEndGFXHeight = true;
    		}
    		return str;
    	}
    
    	private static boolean usingBolts() {
    		return Config.Bolts != null;
    	}
    
    	public static int correctBowAndArrows(Client c) {
    		if (!usingBolts())
    			return -1;
    		switch (c.playerEquipment[Player.playerWeapon]) {
    
    		case 839:
    		case 841:
    			return 882;
    		case 15241:
    			return 15243;
    		case 843:
    		case 845:
    			return 884;
    
    		case 847:
    		case 849:
    			return 886;
    		case 851:
    		case 853:
    			return 888;
    
    		case 855:
    		case 857:
    			return 890;
    
    		case 859:
    		case 861:
    			return 892;
    
    		case 4734:
    		case 4935:
    		case 4936:
    		case 4937:
    			return 4740;
    
    		case 11235:
    			return 11212;
    		}
    		return -1;
    	}
    
    	public static int getProjectileSpeed(Client c) {
    		if (c.dbowSpec)
    			return 100;
    		switch (c.playerEquipment[3]) {
    		case 15243:
    			return 30;
    		case 10033:
    		case 10034:
    			return 60;
    		}
    		return 70;
    	}
    
    	public static int getProjectileShowDelay(Client c) {
    		int[] data = { 806, 806, 808, 809, 810, 811, 10033, 10034, 11230, };
    		int str = 53;
    		for (int i = 0; i < data.length; i++) {
    			if (c.playerEquipment[Player.playerWeapon] == data[i]) {
    				str = 32;
    			}
    		}
    		return str;
    	}
    }
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Aug 2013
    Age
    27
    Posts
    1,128
    Thanks given
    373
    Thanks received
    754
    Rep Power
    0
    Can you explain better please? You mean the hit dont show, the projectile dont show, or when you wear it dont show?
    Reply With Quote  
     

  3. #3  
    Registered Member Jumper's Avatar
    Join Date
    Aug 2013
    Posts
    721
    Thanks given
    19
    Thanks received
    103
    Rep Power
    63
    ^ he means the projectiles im sure

    sendprojectile method to fix
    Reply With Quote  
     

  4. #4  
    Registered Member Joseph69's Avatar
    Join Date
    Sep 2012
    Posts
    293
    Thanks given
    45
    Thanks received
    20
    Rep Power
    56
    Quote Originally Posted by Ardi Rizal View Post
    Can you explain better please? You mean the hit dont show, the projectile dont show, or when you wear it dont show?
    What I mean is it works, but I don't see the bolt/arrow flying and hitting the NPC.
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Aug 2013
    Age
    27
    Posts
    1,128
    Thanks given
    373
    Thanks received
    754
    Rep Power
    0
    Quote Originally Posted by Joseph69 View Post
    What I mean is it works, but I don't see the bolt/arrow flying and hitting the NPC.
    It's the projectile then.
    Search a projectile fix when attack npc, or if you dont have it, search how to add.
    Rune-server is full of tuts of this sir.
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Jan 2011
    Posts
    124
    Thanks given
    29
    Thanks received
    5
    Rep Power
    0
    Reply With Quote  
     

  7. #7  
    Registered Member Joseph69's Avatar
    Join Date
    Sep 2012
    Posts
    293
    Thanks given
    45
    Thanks received
    20
    Rep Power
    56
    Quote Originally Posted by mr drago4 View Post
    I did that man, and it did not work man I don't see a bolt/arrow flying and hitting the NPC.
    Reply With Quote  
     

  8. #8  
    Banned
    Join Date
    Jan 2011
    Posts
    124
    Thanks given
    29
    Thanks received
    5
    Rep Power
    0
    Quote Originally Posted by Joseph69 View Post
    I did that man, and it did not work man I don't see a bolt/arrow flying and hitting the NPC.
    What source are you using?
    Reply With Quote  
     

  9. #9  
    Registered Member Joseph69's Avatar
    Join Date
    Sep 2012
    Posts
    293
    Thanks given
    45
    Thanks received
    20
    Rep Power
    56
    Quote Originally Posted by mr drago4 View Post
    What source are you using?
    Im using ImperionX.
    Reply With Quote  
     

  10. #10  
    Banned
    Join Date
    Jan 2011
    Posts
    124
    Thanks given
    29
    Thanks received
    5
    Rep Power
    0
    Quote Originally Posted by Joseph69 View Post
    Im using ImperionX.
    I wouldn't use it, it's full of bugs.
    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)


User Tag List

Similar Threads

  1. Replies: 15
    Last Post: 08-29-2012, 05:54 PM
  2. Replies: 4
    Last Post: 08-27-2011, 07:26 PM
  3. Replies: 8
    Last Post: 08-25-2011, 05:29 PM
  4. [PI] Certain non-tradeables don't show on ground
    By timtimmay123 in forum Snippets
    Replies: 12
    Last Post: 08-24-2011, 05:20 AM
  5. Replies: 2
    Last Post: 07-07-2011, 09:36 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
  •