Issue information

Issue ID
#4183
Status
Duplicate
Severity
None
Started
Hercules Elf Bot
Apr 13, 2010 1:32
Last Post
Hercules Elf Bot
Apr 13, 2010 1:32
Confirmation
N/A

Hercules Elf Bot - Apr 13, 2010 1:32

Originally posted by [b]NoH[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=4183

It is possible to specify the size of the monster instead of using a OnMobDeath event. For instance:

CODE
monster "prontera",0,0,"--ja--",1002,1,"2";


will spawn a tiny poring (yeah it has to be passed as a string), and:

CODE
monster "prontera",0,0,"--ja--",1002,1,"4";


will spawn a cheeseburgered poring.

However, despite the fact it's a valid usage of the command, it prints an error message, and tells you you should use a "NPC name::OnEvent" instead.

Quick (and dirty) fix in script.c:

CODE
static void disp_error_message2(const char *mes,const char *pos,int report)
{
    error_msg = aStrdup(mes);
    error_pos = pos;
    error_report = report;
    longjmp( error_jump, 1 );
}
#define disp_error_message(mes,pos) disp_error_message2(mes,pos,1)

/// Checks event parameter validity
static void check_event(struct script_state *st, const char *evt)
{
    if( evt != NULL && *evt != '\0' && !stristr(evt,"::On") ){
        ShowError("NPC event parameter deprecated! Please use 'NPCNAME::OnEVENT' instead of '%s'.\n",evt);
        script_reportsrc(st);
    }
}


->

CODE
static void disp_error_message2(const char *mes,const char *pos,int report)
{
    error_msg = aStrdup(mes);
    error_pos = pos;
    error_report = report;
    longjmp( error_jump, 1 );
}
#define disp_error_message(mes,pos) disp_error_message2(mes,pos,1)

/// Checks event parameter validity
static void check_event(struct script_state *st, const char *evt)
{
    if( !strcmp(evt,"2") && !strcmp(evt,"4") && evt != NULL && *evt != '\0' && !stristr(evt,"::On") ){
        ShowError("NPC event parameter deprecated! Please use 'NPCNAME::OnEVENT' instead of '%s'.\n",evt);
        script_reportsrc(st);
    }
}


This post has been edited by NoH: Apr 12 2010, 06:35 PM