here's the whole source
/**
* Faction System [Lilith]
* factionmonster("<map name>",<x>,<y>,"<name to show>",<mob ID>,<amount>,<faction ID>{,"<event label>"});
**/
BUILDIN_FUNC(factionmonster)
{
const char* mapn = script_getstr(st,2);
int x = script_getnum(st,3);
int y = script_getnum(st,4);
const char* str = script_getstr(st,5);
int class_ = script_getnum(st,6);
int amount = script_getnum(st,7);
int faction = script_getnum(st,8);
const char* event = "";
struct map_session_data* sd;
struct mob_data *md;
int m;
if( script_hasdata(st,9) )
{
event = script_getstr(st,9);
check_event(st, event);
}
if( class_ >= 0 && !mobdb_checkid(class_) )
{
ShowWarning("buildin_factionmonster: Attempted to spawn non-existing monster class %d\n", class_);
return 1;
}
sd = map_id2sd(st->rid);
if( sd && strcmp(mapn,"this") == 0 )
m = sd->bl.m;
else
{
m = map_mapname2mapid(mapn);
if( map[m].flag.src4instance && st->instance_id )
{
if( (m = instance_mapid2imapid(m, st->instance_id)) < 0 )
{
ShowError("buildin_factionmonster: Trying to spawn monster (%d) on instance map (%s) without instance attached.\n", class_, mapn);
return 1;
}
}
}
md = mob_once_spawn_sub(&sd->bl, m, x, y, str, class_, event);
if (md)
{
pc_readglobalreg( sd, "pvpteam" ) = faction;
md->special_state.ai = 1;
mob_spawn(md);
clif_specialeffect(&md->bl,344,AREA);
sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000);
}
script_pushint(st,md->bl.id);
return 0;
}
cuz the source have the int faction