|
@@ -10651,7 +10651,7 @@ int buildin_logmes(struct script_state *st)
|
|
|
|
|
|
int buildin_summon(struct script_state *st)
|
|
|
{
|
|
|
- int _class, id, timeout=0;
|
|
|
+ int _class, timeout=0;
|
|
|
char *str,*event="";
|
|
|
struct map_session_data *sd;
|
|
|
struct mob_data *md;
|
|
@@ -10670,14 +10670,16 @@ int buildin_summon(struct script_state *st)
|
|
|
}
|
|
|
|
|
|
clif_skill_poseffect(&sd->bl,AM_CALLHOMUN,1,sd->bl.x,sd->bl.y,tick);
|
|
|
- id=mob_once_spawn(sd, "this", 0, 0, str,_class,1,event);
|
|
|
- md=(struct mob_data *)map_id2bl(id);
|
|
|
- if (!md) return 0;
|
|
|
- md->master_id=sd->bl.id;
|
|
|
- md->special_state.ai=1;
|
|
|
- md->deletetimer=add_timer(tick+(timeout>0?timeout*1000:60000),mob_timer_delete,id,0);
|
|
|
- clif_misceffect2(&md->bl,344);
|
|
|
- sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000);
|
|
|
+
|
|
|
+ md = mob_once_spawn_sub(&sd->bl, sd->bl.m, sd->bl.x, sd->bl.y, str, _class, event);
|
|
|
+ if (md) {
|
|
|
+ md->master_id=sd->bl.id;
|
|
|
+ md->special_state.ai=1;
|
|
|
+ md->deletetimer = add_timer(tick+(timeout>0?timeout*1000:60000),mob_timer_delete,md->bl.id,0);
|
|
|
+ mob_spawn (md); //Now it is ready for spawning.
|
|
|
+ clif_misceffect2(&md->bl,344);
|
|
|
+ sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000);
|
|
|
+ }
|
|
|
return 0;
|
|
|
}
|
|
|
|