Ok i added a slayer task systeem,
but now i got this strange bug which i cant seem to fix
, no matter what monster i kill, i get a slayer task kill and 1 slayer point
how do i fix it so it only gives a slayer kill + point when i kill a specific
unit with the spicific task for it
My kill code:
Code:
if (npcs[i].npcType == 101 || npcs[i].npcType == 102 && temp.taskID == 101 || temp.taskID == 102) {
temp.addSkillXP(150 * server.SERVER_EXPERIENCE, 18);
temp.taskAmount -= 1;
if (temp.playerEquipment[temp.playerFeet] == 7159) {
temp.slaypoints += 2;
} else {
temp.slaypoints += 1;
}
temp.CAM().sendMessage("You got "+temp.slaypoints+" slayer points");
//temp.CAM().sendMessage("You have "+temp.taskAmount+" kills left");
if (temp.taskAmount == 0 || temp.taskAmount == 1) {
temp.taskID = -1;
temp.taskAmount = -1;
temp.CAM().sendMessage("You have completed your task. Talk to Vannaka to get a new one.");
}
}
temp.taskID = Monster you need to kill
npcs[i].npcType = What monster dies
So basicly this says: If monster 101 or 102 dies and you got taskid 101 or 102
do etc...
but it dous this: if monster 101 or 102 dies do etc...
somehow it skipps the taskID part, and idk what wrong with it.
Source used: Devo 2.7
This code is in: NPChandler.java
Under: process()
Thanks for helping allrrdyy...
~Frozen