Excellzone

Forum and disscussions since 2010


You are not connected. Please login or register

View previous topic View next topic Go down Message [Page 1 of 1]

#1
Excell

avatar
Head Administer
Head Administer
Have you ever gotten an error for an NPC but had no idea which NPC it was?

Put this variable in MapleCharacter:

Code:
private int lastnpc;

and

Code:
public void setLastNpc(int x) {
lastnpc = x;
}

public int getLastNpc() {
return lastnpc;
}

Note: You could just make the variable public and not put in these methods.

Put these in NPCScriptManager:

In the "start" method put this:
Code:
c.getPlayer().setLastNpc(npc);

Replace the exception print out for the "action" method with this:
Code:
System.out.println("Error executing NPC script. " + c.getPlayer().getLastNpc() + ".js");

There is probably a better way to do this.
This is a small release anyway so it doesn't really matter :\

View user profile http://excellzone.mrforum.net

View previous topic View next topic Back to top Message [Page 1 of 1]


Permissions in this forum:
You cannot reply to topics in this forum