Fixed specialeffect with npc names (#7502)

Fixes #7501

Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
Singe Horizontal 2022-12-20 17:27:59 +01:00 committed by GitHub
parent 448d8febfa
commit 9e476cce31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15359,20 +15359,25 @@ BUILDIN_FUNC(specialeffect)
if( script_hasdata(st,4) )
{
TBL_NPC *nd = npc_name2id(script_getstr(st,4));
const char* name = script_getstr( st, 4 );
npc_data* nd = npc_name2id( name );
if(nd)
clif_specialeffect(&nd->bl, type, target);
}
else
{
if (target == SELF) {
TBL_PC *sd;
if (script_rid2sd(sd))
clif_specialeffect_single(bl,type,sd->fd);
} else {
clif_specialeffect(bl, type, target);
bl = &nd->bl;
else{
ShowError( "buildin_specialeffect: Unknown NPC \"%s\"\n", name );
return SCRIPT_CMD_FAILURE;
}
}
if (target == SELF) {
map_session_data* sd;
if (!script_rid2sd(sd)){
return SCRIPT_CMD_FAILURE;
}
clif_specialeffect_single(bl,type,sd->fd);
} else {
clif_specialeffect(bl, type, target);
}
return SCRIPT_CMD_SUCCESS;
}