Adding custom npcs to Npc defence (easy way)
Description:This tut will show how to make a player have defense to a certain npc
Server Tested :deltascape
Difficulty: -1\10
Step 1
open up Npchandler.java
and search
Code:
if (npcs[NPCID].npcType != 117 && npcs[NPCID].npcType != 117 && npcs[NPCID].npcType != 112
You should see something like this
Code:
if (npcs[NPCID].npcType != 117 && npcs[NPCID].npcType != 117 && npcs[NPCID].npcType != 112 && npcs[NPCID].npcType != 1338 && npcs[NPCID].npcType != 1610 && npcs[NPCID].npcType != 1616 && npcs[NPCID].npcType != 1637 && npcs[NPCID].npcType != 1624 && npcs[NPCID].npcType != 1615 && npcs[NPCID].npcType != 2783 && npcs[NPCID].npcType != 941 && npcs[NPCID].npcType != 1625 && npcs[NPCID].npcType != 1613 && npcs[NPCID].npcType != 1264 && npcs[NPCID].npcType != 1459 && npcs[NPCID].npcType != 1030 && npcs[NPCID].npcType != 87 && npcs[NPCID].npcType != 19 && npcs[NPCID].npcType != 1 && npcs[NPCID].npcType != 2 && npcs[NPCID].npcType != 3 && npcs[NPCID].npcType != 4 && npcs[NPCID].npcType != 10 && npcs[NPCID].npcType != 181 && npcs[NPCID].npcType != 1267 && npcs[NPCID].npcType != 90 && npcs[NPCID].npcType != 2627 && npcs[NPCID].npcType != 2630 && npcs[NPCID].npcType != 2631 && npcs[NPCID].npcType != 2731 && npcs[NPCID].npcType != 2741 && npcs[NPCID].npcType != 2743 && npcs[NPCID].npcType != 2745 && npcs[NPCID].npcType != 2746 && npcs[NPCID].npcType != 1154 && npcs[NPCID].npcType != 1155 && npcs[NPCID].npcType != 2591 && npcs[NPCID].npcType != 2604 && npcs[NPCID].npcType != 2610) {
}
} else {
hitDiff = 0;
}
after this
Code:
&& npcs[NPCID].npcType != 2610
*make sure to delete the brackets at the end
add the the npc id in the same format
so for example if i want to add the barrows brothers to this i will add this after 2610
Code:
&& npcs[NPCID].npcType != 2025 && npcs[NPCID].npcType != 2026 && npcs[NPCID].npcType != 2027 && npcs[NPCID].npcType != 2028 && npcs[NPCID].npcType != 2028 && npcs[NPCID].npcType != 2029 && npcs[NPCID].npcType != 2030) {
and then place the brackets after ur done
There u go easy tut for ppl who don't know how to add npc to the npc defense database