summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authoramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-31 03:12:39 +0000
committeramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-31 03:12:39 +0000
commita57b4436fc533db924d580d44aff071e38481540 (patch)
tree608ef5cfa7a7b8eb3c2bed1fe7182aa6d0bcd5ce /src/map/script.c
parent43b6d6cc6f19e6570b61b585b7afc3df8d69f523 (diff)
downloadhercules-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
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c56
1 files changed, 56 insertions, 0 deletions
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]
*------------------------------------------------