summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-08 03:37:01 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-08 03:37:01 +0000
commitfbd1469bd30b81cddafb69e447db73954edf962f (patch)
tree6795c8ced472741eeba6c2e5f6bc1478b68bdcc0
parent1d3965a7c67156d705a16abb22aa999fd188808c (diff)
downloadhercules-fbd1469bd30b81cddafb69e447db73954edf962f.tar.gz
hercules-fbd1469bd30b81cddafb69e447db73954edf962f.tar.bz2
hercules-fbd1469bd30b81cddafb69e447db73954edf962f.tar.xz
hercules-fbd1469bd30b81cddafb69e447db73954edf962f.zip
* Added 'summon' script command
* Added Wallex's fix for script.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@935 54d463be-8e91-2dee-dedb-b68131a5f0ec
-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
//