summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog.txt10
-rw-r--r--src/map/script.c37
2 files changed, 44 insertions, 3 deletions
diff --git a/Changelog.txt b/Changelog.txt
index cbabbb7dc..5a264dd62 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,5 +1,15 @@
Date Added
01/07
+ * Added 'summon' script command. Syntax:
+
+ summon <monster name>,<monster id>[,<event>];
+
+ Example: 'summon "Poring", 1002, "OnPoringKilled"; 'will summon (note:
+ not *spawn*) 1 poring that'll help its master for 1 minute,
+ and activate the "OnPoringKilled" event when killed.
+ 'summon "--ja--",-1;' will summon a random monster.
+
+ * Added Wallex's fix for the wedding script functions [celest]
* Added the below-mentioned alive packet to SQL's char and login [celest]
* Enabled login server 'anti-freeze' by default as a temporary solution
to char-login disconnection [celest]
diff --git a/src/map/script.c b/src/map/script.c
index 22ae9f040..b5a3b185d 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -299,6 +299,7 @@ int buildin_guildgetexp(struct script_state *st); // [celest]
int buildin_skilluseid(struct script_state *st); // originally by Qamera [celest]
int buildin_skillusepos(struct script_state *st); // originally by Qamera [celest]
int buildin_logmes(struct script_state *st); // [Lupus]
+int buildin_summon(struct script_state *st); // [celest]
void push_val(struct script_stack *stack,int type,int val);
int run_func(struct script_state *st);
@@ -469,9 +470,9 @@ struct {
{buildin_failedremovecards,"failedremovecards","ii"},
{buildin_marriage,"marriage","s"},
{buildin_wedding_effect,"wedding",""},
- {buildin_divorce,"divorce",""},
- {buildin_ispartneron,"ispartneron",""},
- {buildin_getpartnerid,"getpartnerid",""},
+ {buildin_divorce,"divorce","*"},
+ {buildin_ispartneron,"ispartneron","*"},
+ {buildin_getpartnerid,"getpartnerid","*"},
{buildin_warppartner,"warppartner","sii"},
{buildin_getitemname,"getitemname","i"},
{buildin_makepet,"makepet","i"},
@@ -519,6 +520,7 @@ struct {
{buildin_skilluseid,"doskill","ii"}, // since a lot of scripts would already use 'doskill'...
{buildin_skillusepos,"skillusepos","iiii"}, // [Celest]
{buildin_logmes,"logmes","s"}, //this command actls as MES but prints info into LOG file either SQL/TXT [Lupus]
+ {buildin_summon,"summon","si*"}, // summons a slave monster [Celest]
{NULL,NULL,NULL},
};
int buildin_message(struct script_state *st); // [MouseJstr]
@@ -6426,6 +6428,35 @@ int buildin_logmes(struct script_state *st)
return 0;
}
+int buildin_summon(struct script_state *st)
+{
+ int class, id;
+ char *str,*event="";
+ struct map_session_data *sd;
+ struct mob_data *md;
+
+ sd=script_rid2sd(st);
+ if (sd) {
+ int tick = gettick();
+ str =conv_str(st,& (st->stack->stack_data[st->start+2]));
+ class=conv_num(st,& (st->stack->stack_data[st->start+3]));
+ if( st->end>st->start+4 )
+ event=conv_str(st,& (st->stack->stack_data[st->start+4]));
+
+ id=mob_once_spawn(sd, "this", 0, 0, str,class,1,event);
+ if((md=(struct mob_data *)map_id2bl(id))){
+ md->master_id=sd->bl.id;
+ md->state.special_mob_ai=1;
+ md->mode=mob_db[md->class_].mode|0x04;
+ md->deletetimer=add_timer(tick+60000,mob_timer_delete,id,0);
+ clif_misceffect2(&md->bl,344);
+ }
+ clif_skill_poseffect(&sd->bl,AM_CALLHOMUN,1,sd->bl.x,sd->bl.y,tick);
+ }
+
+ return 0;
+}
+
//
// ŽÀs•”main
//