Hey guys can anyone help me with this error
Here is the NPCHandler.java
Code:
public void dropItems(int i) {
int npc = 0;
Client c = (Client)Server.playerHandler.players[npcs[i].killedBy];
if(c != null) {
for(int o = 0; o < c.barrowsNpcs.length; o++){
if(npcs[i].npcType == c.barrowsNpcs[o][0]) {
c.barrowsNpcs[o][1] = 2; // 2 for dead
//c.barrowsKillCount++;
}
}
if (npcs[i].npcType == 912 || npcs[i].npcType == 913 || npcs[i].npcType == 914)
c.magePoints += 1;
for(npc = 0; npc < Config.NPC_DROPS.length; npc++){
if(npcs[i].npcType == Config.NPC_DROPS[npc][0]) {
if(Misc.random(Config.NPC_DROPS[npc][3]) == 0) {
if (c.clanId >= 0)
Server.clanChat.handleLootShare(c, Config.NPC_DROPS[npc][1], Config.NPC_DROPS[npc][2]);
Server.itemHandler.createGroundItem(c, Config.NPC_DROPS[npc][1], npcs[i].absX, npcs[i].absY, Config.NPC_DROPS[npc][2], c.playerId);
}
}
}
}
}
Process();
Code:
public void process() {
for (int i = 0; i < maxNPCs; i++) {
if (npcs[i] == null) continue;
npcs[i].clearUpdateFlags();
}
/* if (npcs[i].npcType == 812){
if (Misc.random(10) == 4)
npcs[i].forceChat(guardRandomTalk[Misc.random3(guardRandomTalk.length)]);
} */
for (int i = 0; i < maxNPCs; i++) {
if (npcs[i] != null) {
if (npcs[i].actionTimer > 0) {
npcs[i].actionTimer--;
}
if (npcs[i].freezeTimer > 0) {
npcs[i].freezeTimer--;
}
if (npcs[i].hitDelayTimer > 0) {
npcs[i].hitDelayTimer--;
}
if (npcs[i].hitDelayTimer == 1) {
npcs[i].hitDelayTimer = 0;
applyDamage(i);
}
if(npcs[i].attackTimer > 0) {
npcs[i].attackTimer--;
}
if(npcs[i].spawnedBy > 0) { // delete summons npc
if(Server.playerHandler.players[npcs[i].spawnedBy] == null
|| Server.playerHandler.players[npcs[i].spawnedBy].heightLevel != npcs[i].heightLevel
|| Server.playerHandler.players[npcs[i].spawnedBy].respawnTimer > 0
|| !Server.playerHandler.players[npcs[i].spawnedBy].goodDistance(npcs[i].getX(), npcs[i].getY(), Server.playerHandler.players[npcs[i].spawnedBy].getX(), Server.playerHandler.players[npcs[i].spawnedBy].getY(), 20)) {
if(Server.playerHandler.players[npcs[i].spawnedBy] != null) {
for(int o = 0; o < Server.playerHandler.players[npcs[i].spawnedBy].barrowsNpcs.length; o++){
if(npcs[i].npcType == Server.playerHandler.players[npcs[i].spawnedBy].barrowsNpcs[o][0]) {
if (Server.playerHandler.players[npcs[i].spawnedBy].barrowsNpcs[o][1] == 1)
Server.playerHandler.players[npcs[i].spawnedBy].barrowsNpcs[o][1] = 0;
}
}
}
npcs[i] = null;
}
}
if (npcs[i] == null) continue;
and i dont think its this--
Code:
public class NPCHandler {
public static int maxNPCs = 99999;
public static int maxListedNPCs = 99999;
public static int maxNPCDrops = 99999;
public static NPC npcs[] = new NPC[maxNPCs];
public static NPCList NpcList[] = new NPCList[maxListedNPCs];