Mhm, I find it weird though. You are registering the npc without the actual object you have created for it then later you try to set it's face with the object.
Perhaps this will fix your problem.
Code:
public static NPC spawnNpc(Player c, int npcType, int x, int y, int heightLevel, int walkingType, int HP,
int maxHit, int attack, int defence, boolean attackPlayer, boolean headIcon) {
NPC npc = new NPC(npcType);
npc.direction = 1;
npc.setAbsX(x);
npc.setAbsY(y);
npc.makeX = x;
npc.makeY = y;
npc.heightLevel = heightLevel;
npc.walkingType = walkingType;
npc.HP = HP;
npc.MaxHP = HP;
npc.maxHit = maxHit;
npc.attack = attack;
npc.defence = defence;
npc.spawnedBy = c.getIndex();
if (attackPlayer) {
npc.underAttack = true;
if (c != null) {
npc.killerId = c.getIndex();
}
}
NPCHandler.NPCS.add(npc);
if (npcType >= 4278 && npcType <= 4284) {
npc.forceChat("I'M ALIVE!");
npc.forceAnim(4410);
}
if (npcType >= 2042 && npcType <= 2044) {
npc.forceAnim(5073);
npc.facePlayer(c.getIndex());
}
if (npcType == ###) {
npc.facePlayer(c.getIndex());
}
if (Pet.isPet(npc.npcType)) {
npc.underAttack = true;
npc.killerId = c.getIndex();
c.getPet().setNpc(npc);
}
if (headIcon) {
c.getPA().drawHeadicon(1, npc.getIndex(), 0, 0);
}
return npc;
}
Change what's in red to Zulrah's npc id.