Difficulty: 2/10
Files edited: NPC.CFG, AutoSpawn.CFG, NPCHandler.Java
Credits: The Unholy
This tutorial will explain how to add 'bosses' into your server, including their attacks, health and drops. You may also learn how to add attacks and strengths to different kinds of regular NPC's too!
Ok, firstly, we're going to need to choose an NPC, for this I suggest looking through NPC.Config, for the purpose of this tutorial I'm going to use The Draugen.
npc = 1279 The_Draugen 69 70 11279 - The ID of the NPC.
The_Draugen - The name of the NPC (You may replace the underscore with a space)
69 - The combat level of the NPC (Changing this will do nothing)
70 - The Health of the NPC.
1 - The respawn time of the NPC (in seconds)
Ok, so you may want to start by changing the monsters HP. For the purpose of this tutorial I'll change The Draugen's HP to 250, and a respawn time of 60 seconds. (Note that some monsters don't have a respawn time so you'll only see two numbers, the Combat level and the HP, to give the monster a respawn tab, simply tab after the second number and add any number, remember it's in seconds!)
npc = 1279 The_Draugen 69 250 60Save and compile to make sure you have no errors.
Second open up Autospawn.CFG, we now want to add the NPC into your server! To get the coordinates of where you may want to add your NPC, many Delta bases use the ::mypos command.
spawn = 1279 3224 3489 2 3227 3492 3221 3486 1SPAWN = NPCID XCORD YCORD HEIGHT WALKX+ WALKY+ WALKX- WALKY- 1
It's hard for me to explain what this is about, basically if you want to make your NPC to move, have your WALKX/Y+'s 1-3 greater than the original X & Y coords, and have the WALKX/Y-'s 1-3 less than your original X & Y coords, as shown in my example.
Save and compile to make sure you have no errors.
Now the fun stuff! We're going to make your monster pro!

Open up NPCHandler.java!
Search for:
case 2745: Directly under that add:
case 1279: The number (1279 in this case) is your NPC's ID!
If you want your NPC to be aggressive, search for
public boolean npcGetsAnnoyed(int Npc) {And add:
case YOURNPCID: Somewhere under an existing case, preferably case 2745: to avoid errors.
Now search for:
if (npcs[NPCID].npcType == 2745) { // jadYou should get something similar to:
if (npcs[NPCID].npcType == 2745) { // jad
rand_npc = misc.random(500);
}If I'm not mistaken, each time the monster is attacked this method randomly makes its defence level somewhere between 1-500 ( in this case).
Underneath that method add:
if (npcs[NPCID].npcType == 1279) { // YOURNPCNAME
rand_npc = misc.random(200); //NPCS RANDOM DEFENCE LIMIT
}Now search for:
} else if (npcs[NPCID].npcType == 82 && plr.ProtMelee == true) {Underneath the complete method for npcType == 2, add this:
} else if (npcs[NPCID].npcType == 1279 && plr.ProtMelee == false) {
npcs[NPCID].animNumber = 64;
hitDiff = 20 + misc.random(55);
} else if (npcs[NPCID].npcType == 1279 && plr.ProtMelee == true) {
npcs[NPCID].animNumber = 64;
hitDiff = 6 + misc.random(14);EXPLANATIONFor the first half of the code, if the npc type (ID) is 1279, and protect from melee is not active, the npc will always hit at least 20, plus a random number between 0-55. ( Resulting in a max hit of 75.)
For the second half of the code, if the npc type (ID) is 1279 and protect from melee is active, the npc will always hit at least 6 and a random number between 0-14. (Resulting in a max hit of 20).
If you would like to make the monster always hit zeros on Protection prayers, then change the hitDiff to 0 and remove '+misc.random(#);'.
The anim number is the monsters attack animation, change it to whatever you want :).
Save, compile, leave some feedback! :)