Thread: Implings despawn

Results 1 to 4 of 4
  1. #1 Implings despawn 
    Kanketsu
    JacobiYounger's Avatar
    Join Date
    Aug 2009
    Posts
    723
    Thanks given
    49
    Thanks received
    31
    Rep Power
    31
    Code:
    package server.model.content.skills.impl;
    
    import java.util.HashMap;
    
    import server.Server;
    import server.model.entity.npcs.NPCHandler;
    import server.model.entity.players.Client;
    import server.world.utilities.Misc;
    
    public class Implings {
    	
    	private static enum Imps {
    		
    		BABY_IMPLING(1028, 1, 25, 11238),
    		YOUNG_IMPLING(1029, 22, 65, 11240),
    		GOURMET_IMPLING(1030, 28, 113, 11242),
    		EARTH_IMPLING(1031, 36, 177, 11244),
    		ESSENCE_IMPLING(1032, 42, 255, 11246),
    		ECLECTIC_IMPLING(1033, 50, 289, 11248),
    		NATURE_IMPLING(1034, 58, 353, 11250),
    		MAGPIE_IMPLING(1035, 65, 409, 11252),
    		NINJA_IMPLING(6063, 74, 481, 11254),
    		DRAGON_IMPLING(6064, 83, 553, 11256);
    		
    		private int impId;
    		private int level;
    		private int xp;
    		private int jar;
    		
    		private Imps(final int impId, final int level, final int xp, final int jar) {
    			this.impId = impId;
    			this.level = level;
    			this.xp = xp;
    			this.jar = jar;
    		}
    		
    		private int getImpID() {
    			return impId;
    		}
    		
    		private int getLevel() {
    			return level;
    		}
    		
    		private int getXP() {
    			return xp * 20;
    		}
    		
    		private int getJar() {
    			return jar;
    		}
    		
    		private String getName() {
    			return Misc.optimizeText(toString().toLowerCase().replaceAll("_", " "));
    		}
    		
    		public static HashMap<Integer, Imps> implings = new HashMap<Integer, Imps>();
    
    		static {
    			for (final Imps impling : Imps.values()) {
    				Imps.implings.put(impling.getImpID(), impling);
    			}
    		}
    		
    	}
    	
    	/**
    	 * Handles the actual catching
    	 * @param c Client
    	 * @param ID Npc being clicked
    	 */
    	
    	public static void catchImp(final Client c, final int ID, final int impId) {
    		Imps i = Imps.implings.get(impId);
    		if(i == null) {
    			return;
    		}
    		if(!canCatch(c, ID, impId)) { 
    			return;
    		}
    		if (Misc.random(25) >= ((c.playerLevel[Constants.HUNTER] - 10) / 10) + 4) {
    	            c.sendMessage("You fail catching the "+i.getName()+"!");
    	            return; 
    		}
    		c.getItems().deleteItem(Constants.JAR, Constants.hasMagicNet(c) ? 0 : 1);
    		c.getItems().addItem(i.getJar(), 1);
    		c.getPA().addSkillXP(Constants.hasMagicNet(c) ? i.getXP() * 2 : i.getXP(), Constants.HUNTER);
    		c.startAnimation(6999);
    		c.sendMessage("You catch the "+i.getName()+"!");
    		//Implings.death(c);
    	}
    	
    /*	private static void death(final Client c) {
    		c.sendMessage("test5");
    		for (int i = 0; i < NPCHandler.npcs.length; i++) {
    		if (NPCHandler.npcs[i].npcType == 1028) {
    		//if (NPCHandler.npcs[i] != null) {
    		NPCHandler.npcs[i].isDead = true;
    		NPCHandler.npcs[i].applyDead = true;
    		NPCHandler.npcs[i].updateRequired = true;
    		c.getPA().requestUpdates();
    		}	
    	//}
    		}
    	}*/
    }
    Basically I have tried making it so they despawn, but everything I do doesn't seem to work... If possible I also need help making a respawn method.

    Thanks!
    Reply With Quote  
     

  2. #2  
    Kanketsu
    JacobiYounger's Avatar
    Join Date
    Aug 2009
    Posts
    723
    Thanks given
    49
    Thanks received
    31
    Rep Power
    31
    Any help?
    Reply With Quote  
     

  3. #3  
    Registered Member Emre's Avatar
    Join Date
    Jan 2014
    Posts
    596
    Thanks given
    91
    Thanks received
    61
    Rep Power
    7
    Quote Originally Posted by JacobiYounger View Post
    Any help?
    nvm lol idk
    Reply With Quote  
     

  4. #4  
    Banned
    Join Date
    Mar 2014
    Posts
    628
    Thanks given
    109
    Thanks received
    181
    Rep Power
    0
    Where do you have them being spawned? You're going to have to create a event and after a certain amount of ticks they'll naturally despawn based on your death method.
    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. Replies: 9
    Last Post: 03-04-2009, 04:36 AM
  2. New impling (Npcs)
    By o0x vvv x0o in forum Configuration
    Replies: 3
    Last Post: 03-04-2008, 09:02 PM
  3. My last Implings (npcs)
    By o0x vvv x0o in forum Configuration
    Replies: 8
    Last Post: 02-09-2008, 05:43 AM
  4. Dragon Impling!
    By o0x vvv x0o in forum Configuration
    Replies: 4
    Last Post: 02-05-2008, 09:13 AM
  5. A $imple Problem
    By mast3r in forum Tutorials
    Replies: 3
    Last Post: 11-12-2007, 10:07 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
  •