Thread: Proper NPC examines

Results 1 to 2 of 2
  1. #1 Proper NPC examines 
    Cindra 718 Founder
    Four Nations's Avatar
    Join Date
    Sep 2012
    Posts
    1,043
    Thanks given
    77
    Thanks received
    186
    Rep Power
    56
    Okay so basically what this does instead of examining an NPC and it says "its an NPC" or some other useless text it will pop up with the actual examines (same as runescape)

    1. add this in your utils folder:

    Code:
    package com.cindra.utilities;
    
    import java.io.BufferedReader;
    import java.io.FileReader;
    import java.util.HashMap;
    import java.util.Map;
    
    /**
     *
     * @author Daenerys
     *
     */
    
    public class NPCExamines {
    
    	private static Map<Integer, String> npcExamines = new HashMap<Integer, String>();
    
    	public static void init() {
    		try (BufferedReader file = new BufferedReader(new FileReader(
    				"./data/npcs/unpackedExamines.txt"))) {
    			while (true) {
    				final String line = file.readLine();
    				if (line == null) {
    					break;
    				}
    				if (line.startsWith("//")) {
    					continue;
    				}
    				final String[] valuesArray = line.split(" - ");
    				npcExamines.put(Integer.valueOf(valuesArray[0]), valuesArray[1]);
    			}
    			Logger.log("NPCExamines", "Successfully loaded "+npcExamines.size()+" NPC Examines.");
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    	}
    	
    	public static String getExamine(int npcId) {
    		return npcExamines.get(npcId);
    	}
    
    }
    2. Next in launcher, or if your using my server its initializer, add this

    Code:
    NPCExamines.init();
    3. In your NPCManager (NPCHandler), in the examine method, add this.

    Code:
    player.getPackets().sendNPCMessage(0, 15263739, npc, NPCExamines.getExamine(npc.getId()));
    4. Finally, in data/npcs/ you need to add this

    https://mega.co.nz/#!dpoAkaKI!69jVFR...jX2jDlT_-aGtEo



    Note - If one of the examines say "COULDN'T DUMP NPC, DO MANUALLY" it means the dump failed and you need to manually add the examine into the text file.
    I've already added all the failed ones up to about 1000.


    If i missed anything post below.
    Reply With Quote  
     

  2. #2  
    Donator


    Join Date
    Jul 2013
    Posts
    1,233
    Thanks given
    1
    Thanks received
    493
    Rep Power
    0
    oo nice job : P
    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. [508] Proper NPC Following - Converted
    By wizzyt21 in forum Tutorials
    Replies: 81
    Last Post: 01-09-2011, 08:44 PM
  2. [525] start on NPC EXAMINE (may be wrong section idk
    By Glabay in forum Configuration
    Replies: 11
    Last Post: 02-27-2009, 03:53 PM
  3. Replies: 13
    Last Post: 12-25-2008, 09:54 PM
  4. Replies: 11
    Last Post: 12-18-2008, 07:27 AM
  5. Need Proper NPC tutorial---please help!
    By Enjoi in forum Requests
    Replies: 1
    Last Post: 10-25-2008, 08:50 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
  •