################################################## #########
### 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:
Code:
playerHandler = new PlayerHandler();
Under that add:
Code:
npcKill = new NPCKillHandler();
Still in server.java, search for:
Code:
public static PlayerHandler playerHandler = null;
Now under that add:
Code:
public static NPCKillHandler npcKill = null;
Save, and exit out of server.java. Now download THIS HANDLER, and add that to where all of your java files for your server are held.
Open up client.java and under
Code:
public class client extends Player implements Runnable {
Add:
Code:
public String npckName = "";
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:
server.npcKill.playerIdd = playerId;
Save, and close out of client.java.
Open NPCHandler.java and search for the first:
Code:
if(npcs[NPCID].npcType ==
It should be under public void MonsterDropItem(int NPCID) or something similiar, and above the line we just searched, add:
Code:
server.npcKill.npcKilledd(NPCID);
Now save, and close out of NPCHandler.java
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-.~'