Originally posted by [b]Saithis[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=3282
there are several script commands using the GID of mobs/npcs, but as far as i know the only script command which returned the GID got removed with the mob controller system...
This are the commands using GID:
CODE
*pcblockmove <GID/ID>,<option>;
*unitwalk <GID>,<x>,<y>;
*unitwalk <GID>,<mapid>;
*unitkill <GID>;
*unitwarp <GID>,<Mapname>,<x>,<y>;
*unitattack <GID>,<Target ID>;
*unitstop <GID>;
*unittalk <GID>,<Text>;
*unitemote <GID>,<Emote>;
*unitskilluseid <GID>,<skill id>,<skill lvl>{,<target id>};
*unitskilluseid <GID>,"<skill name>",<skill lvl>{,<target id>};
*unitskillusepos <GID>,<skill id>,<skill lvl>,<x>,<y>;
*unitskillusepos <GID>,"<skill name>",<skill lvl>,<x>,<y>;
so how about reimplementing the mobspawn command?
I modified the command a bit, so you can also define an event:
CODE
BUILDIN_FUNC(mobspawn)
{
int class_,x,y,id;
const char *str,*map;
const char* event = "";
// Who?
str =script_getstr(st,2);
// What?
class_ =script_getnum(st,3);
// Where?
map =script_getstr(st,4);
x =script_getnum(st,5);
y =script_getnum(st,6);
// Event?
if( script_hasdata(st,7) )
{
event = script_getstr(st,7);
check_event(st, event);
}
id = mob_once_spawn(map_id2sd(st->rid),map_mapname2mapid(map),x,y,str,class_,1,event);
script_pushint(st,id);
return 0;
}
Actually I don't understand really why this 4 commands got removed:
mobspawn, mobremove, getmobdata, setmobdata
as it is not really hard to maintain them...
for mobassist and mobattach i do understand it...
This post has been edited by Saithis: Jun 22 2009, 06:29 AM