Thread: Slayer Tower Npc Drop PI

Results 1 to 5 of 5
  1. #1 Slayer Tower Npc Drop PI 
    Officially Retired


    Join Date
    Oct 2007
    Age
    30
    Posts
    5,454
    Thanks given
    558
    Thanks received
    122
    Rep Power
    1364
    Can anyone help me with this? I having problem with npc drop on slayer tower.

    When 1 player standing on slayer tower height 1 (Floor 2) and 2nd player standing on height 2 (Floor 3). The 1st player killing npc. like 30 sec player 2 height 2(Floor 3) receive a player 1 height 1 (Floor 2) drop.

    Here is my drop method on NpcHandler.java
    Code:
    	public void dropItems(int i) {
    		Player c = (Player)PlayerHandler.players[npcs[i].killedBy];
    		if(c != null) {
    			Godwars.giveKillcount(c, npcs[i].npcType);
    			if (npcs[i].npcType == 912 || npcs[i].npcType == 913 || npcs[i].npcType == 914)
    				c.getVariables().magePoints += 1;
    			if (NPCDrops.constantDrops.get(npcs[i].npcType) != null) {
    				for (final int item : NPCDrops.constantDrops
    						.get(npcs[i].npcType)) {
    					ItemHandler.createGroundItem(c, item, npcs[i].absX,
    							npcs[i].absY, npcs[i].heightLevel, 1, c.playerId);
    				}
    			}
    			if (NPCDrops.dropRarity.get(npcs[i].npcType) != null) {
    				try {
    					int random = Misc.random(NPCDrops.rareDrops.get(npcs[i].npcType).length-1);
    					int item = 0;
    					int amount = 0;
    					if (rareDrops(i)) {
    						item = NPCDrops.rareDrops.get(npcs[i].npcType)[random][0];
    						amount = NPCDrops.rareDrops.get(npcs[i].npcType)[random][1];
    						} else {
    						random = Misc.random(NPCDrops.normalDrops
    								.get(npcs[i].npcType).length-1);
    						item = NPCDrops.normalDrops.get(npcs[i].npcType)[random][0];
    						amount = NPCDrops.normalDrops.get(npcs[i].npcType)[random][1];
    					}
    					if (c.getVariables().clanId > -1
    							&& c.getShops().getItemShopValue(item) * amount > 5000) {
    						if (GameEngine.clanChat.clans[c.getVariables().clanId].lootshare == 1 || GameEngine.clanChat.clans[c.getVariables().clanId].lootshare == 2) {
    							GameEngine.clanChat.handleShare(c, item, amount,
    									npcs[i].absX, npcs[i].absY, npcs[i].heightLevel, GameEngine.clanChat.clans[c.getVariables().clanId].lootshare == 1 ? false : true);
    							return;
    						}
    					}
    					ItemHandler.createGroundItem(c, item, npcs[i].absX,
    							npcs[i].absY, npcs[i].heightLevel, amount, c.playerId);
    							}	catch (Exception e) {
    					e.printStackTrace();
    				}
    			}	
    	}
    }
    Code:
    	public static void createGroundItem(Player c, int itemId, int itemX, int itemY, int height, int itemAmount, int playerId) {
    		if(c == null)
    			return;
    		if(GameEngine.playerHandler.players[playerId] == null)
    			return;
    		if(itemId > 0) {
    			if (itemId >= 2412 && itemId <= 2414) {
    				c.sendMessage("The item vanishes as it touches the ground.");
    				return;
    			}
    			if (itemId == 10033 || itemId == 10034) {
                    return;
                }
    			if (itemId > 4705 && itemId < 4760) {
    				for (int[] brokenBarrow : brokenBarrows) {
    					if (brokenBarrow[0] == itemId) {
    						itemId = brokenBarrow[1];
    						break;
    					}
    				}
    			}
    			Region r = Region.getRegion(itemX, itemY);
    			if(r == null)
    				return;
    			GroundItem item = new GroundItem(itemId, itemX, itemY, height, itemAmount, c.playerId, (c.party != null && c.party.floor != null) ? 0 : HIDE_TICKS, GameEngine.playerHandler.players[playerId].playerName, (c.party != null && c.party.floor != null) ? true : false);
    			createGroundItem(c, item, r);
    			r.startItemProcess();
    		}
    	}
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    May 2013
    Posts
    1,169
    Thanks given
    28
    Thanks received
    133
    Rep Power
    53
    Make sure your height variables aren't static
    If only I hadn't given you up, my life could've been different.
    Reply With Quote  
     

  3. #3  
    Officially Retired


    Join Date
    Oct 2007
    Age
    30
    Posts
    5,454
    Thanks given
    558
    Thanks received
    122
    Rep Power
    1364
    Quote Originally Posted by True Faith View Post
    Make sure your height variables aren't static
    What you mean sir? im totally lost could help me?
    Reply With Quote  
     

  4. #4  
    Officially Retired


    Join Date
    Oct 2007
    Age
    30
    Posts
    5,454
    Thanks given
    558
    Thanks received
    122
    Rep Power
    1364
    Bump, anyone got this problem too?
    Reply With Quote  
     

  5. #5  
    Banned Slayer Tower Npc Drop PI Market Banned


    Join Date
    Jan 2011
    Age
    26
    Posts
    3,112
    Thanks given
    1,198
    Thanks received
    1,479
    Rep Power
    0
    Quote Originally Posted by Zotic View Post
    What you mean sir? im totally lost could help me?
    make sure the fields representing the height levels aren't static. if they're static that means that every single player will be using that one field (rather than an instance field where every player would have their own copy of the field)
    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. 317 [pi] Slayer tower npc
    By Mallouzi in forum Help
    Replies: 1
    Last Post: 06-26-2013, 06:16 PM
  2. Replies: 19
    Last Post: 03-02-2012, 08:44 AM
  3. Npc Drops PI
    By deltanewb in forum Help
    Replies: 5
    Last Post: 04-25-2011, 04:56 AM
  4. [PI] Slayer Tower/Barrows Fix [PI]
    By The Ricky in forum Tutorials
    Replies: 7
    Last Post: 09-21-2010, 01:12 AM
  5. [PI]Slayer Tower Stairs Problem[PI]
    By The Ricky in forum Help
    Replies: 9
    Last Post: 08-29-2010, 04:27 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
  •