actually it seems, I can do?
These are the codes to edit:
./src/map/map.c
if (sd->npc_timer_id != -1) //Cancel the event timer.
npc_timerevent_quit(sd);
while(sd->npc_id) npc_event_dequeue(sd);
npc_script_event(sd, NPCE_LOGOUT);
./src/map/script.c
#define BUILDIN_DEF2(x,x2,args) { buildin_ ## x , x2 , args }
#define BUILDIN_FUNC(x) int buildin_ ## x (struct script_state* st)
// [ToastOfDoom]
// Returns the character at the specified position in a string.
// charat <str>,<index>;
BUILDIN_FUNC(charat)
{
const char *str = script_getstr(st,2);
int pos = script_getnum(st,3);
char *output;
output = (char*)aMallocA(2*sizeof(char));
output[0] = '\0';
if(str && pos >= 0 && (unsigned int)pos < strlen(str))
sprintf(output, "%c", str[pos]);
script_pushstr(st, output);
return 0;
}
./src/map/script.c
struct script_function buildin_func[] = {
BUILDIN_DEF(charat, "si"), // [ToastOfDoom]