################################################## #########
### TUTORIAL ###
### SENDING A MESSAGE TO ALL PLAYERS WHEN NPC IS KILLED ###
### Example: "Slash Bash has been slain in battle by Dustin(Lvl 122)." ###
### MADE BY TELENUBBY ###
################################################## #########
What this does: Makes it so when you kill a certain npc, it says for example: "Slash Bash has been slain by TeleNubby(Lvl 126)."
Difficulty: 6/10
Requiremtns: Common sense, and a will to learn.
Anti-Leech: None... Yet.
Open server.java and search for:
Under that add:Code:playerHandler = new PlayerHandler();
Still in server.java, search for:Code:npcKill = new NPCKillHandler();
Now under that add:Code:public static PlayerHandler playerHandler = null;
Save, and exit out of server.java. Now download [Only registered and activated users can see links. Click Here To Register...], and add that to where all of your java files for your server are held.Code:public static NPCKillHandler npcKill = null;
Open up client.java and under
Add:Code:public class client extends Player implements Runnable {
Still in client.java, search for either your login welcome message (not screen!), or your "player has logged in" message and under it add:Code:public String npckName = "";
Save, and close out of client.java.Code:server.npcKill.playerIdd = playerId;
Open NPCHandler.java and search for the first:
It should be under public void MonsterDropItem(int NPCID) or something similiar, and above the line we just searched, add:Code:if(npcs[NPCID].npcType ==
Now save, and close out of NPCHandler.javaCode:server.npcKill.npcKilledd(NPCID);
Compile, run your server, and ENJOY!
Note: This only comes with one npc, therefore only npc 2060 works with this. You can add more NPC Names in the handler by using the layout I used when I did the example for NPC 2060.
'~.-TeleNubby-.~'
