diff options
author | amber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-31 03:12:39 +0000 |
---|---|---|
committer | amber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-31 03:12:39 +0000 |
commit | a57b4436fc533db924d580d44aff071e38481540 (patch) | |
tree | 608ef5cfa7a7b8eb3c2bed1fe7182aa6d0bcd5ce | |
parent | 43b6d6cc6f19e6570b61b585b7afc3df8d69f523 (diff) | |
download | hercules-a57b4436fc533db924d580d44aff071e38481540.tar.gz hercules-a57b4436fc533db924d580d44aff071e38481540.tar.bz2 hercules-a57b4436fc533db924d580d44aff071e38481540.tar.xz hercules-a57b4436fc533db924d580d44aff071e38481540.zip |
Add new script commands
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@880 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog.txt | 2 | ||||
-rw-r--r-- | src/map/script.c | 56 |
2 files changed, 58 insertions, 0 deletions
diff --git a/Changelog.txt b/Changelog.txt index bcc991754..8196afdce 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -4,6 +4,8 @@ SVN: $Rev$ Date Added 12/30 + * Added ispartneron, getpartnerid, and warppartner script + commands to properly support jawaii NPC's (SVN 880) [MouseJstr] * Moved supernovice guardian angel messages to msg_athena.conf [celest] 12/29 diff --git a/src/map/script.c b/src/map/script.c index 7730c2ed9..dca1fbe12 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -250,6 +250,9 @@ int buildin_failedremovecards(struct script_state *st); int buildin_marriage(struct script_state *st); int buildin_wedding_effect(struct script_state *st); int buildin_divorce(struct script_state *st); +int buildin_ispartneron(struct script_state *st); +int buildin_getpartnerid(struct script_state *st); +int buildin_warppartner(struct script_state *st); int buildin_getitemname(struct script_state *st); int buildin_makepet(struct script_state *st); int buildin_getexp(struct script_state *st); @@ -467,6 +470,9 @@ struct { {buildin_marriage,"marriage","s"}, {buildin_wedding_effect,"wedding",""}, {buildin_divorce,"divorce",""}, + {buildin_ispartneron,"ispartneron",""}, + {buildin_getpartnerid,"getpartnerid",""}, + {buildin_warppartner,"warppartner","sii"}, {buildin_getitemname,"getitemname","i"}, {buildin_makepet,"makepet","i"}, {buildin_getexp,"getexp","ii"}, @@ -5450,6 +5456,56 @@ int buildin_divorce(struct script_state *st) return 0; } +int buildin_ispartneron(struct script_state *st) +{ + struct map_session_data *sd=script_rid2sd(st); + struct map_session_data *p_sd=NULL; + + if(sd==NULL || !pc_ismarried(sd) || + ((p_sd=map_nick2sd(map_charid2nick(sd->status.partner_id))) == NULL)) { + push_val(st->stack,C_INT,0); + return 0; + } + + push_val(st->stack,C_INT,1); + return 0; +} + +int buildin_getpartnerid(struct script_state *st) +{ + struct map_session_data *sd=script_rid2sd(st); + if (sd == NULL) { + push_val(st->stack,C_INT,0); + return 0; + } + + push_val(st->stack,C_INT,sd->status.partner_id); + return 0; +} + +int buildin_warppartner(struct script_state *st) +{ + int x,y; + char *str; + struct map_session_data *sd=script_rid2sd(st); + struct map_session_data *p_sd=NULL; + + if(sd==NULL || !pc_ismarried(sd) || + ((p_sd=map_nick2sd(map_charid2nick(sd->status.partner_id))) == NULL)) { + push_val(st->stack,C_INT,0); + return 0; + } + + str=conv_str(st,& (st->stack->stack_data[st->start+2])); + x=conv_num(st,& (st->stack->stack_data[st->start+3])); + y=conv_num(st,& (st->stack->stack_data[st->start+4])); + + pc_setpos(p_sd,str,x,y,0); + + push_val(st->stack,C_INT,1); + return 0; +} + /*================================================ * Script for Displaying MOB Information [Valaris] *------------------------------------------------ |