diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-09 21:09:53 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-09 21:09:53 +0000 |
commit | ef6249a84ac41ff029ee37dde1e8c9427515198f (patch) | |
tree | 2953e78f0340be0f592eab832290972ee2463a0f /src | |
parent | f405f3e4f972e26cf09f25363d6499b2f265ef8c (diff) | |
download | hercules-ef6249a84ac41ff029ee37dde1e8c9427515198f.tar.gz hercules-ef6249a84ac41ff029ee37dde1e8c9427515198f.tar.bz2 hercules-ef6249a84ac41ff029ee37dde1e8c9427515198f.tar.xz hercules-ef6249a84ac41ff029ee37dde1e8c9427515198f.zip |
- Updated setoption script command to receive a second (optional) argument flag. If the flag is 1, the option is added to what the player currently has; likewise using flag 2 removes only that option. No flag (or any other value) is the older behaviour of removing all other options and setting specificly what is passed.
- Updated script_commands information for setoption due to this change.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6538 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/script.c | 22 | ||||
-rw-r--r-- | src/map/status.h | 1 |
2 files changed, 19 insertions, 4 deletions
diff --git a/src/map/script.c b/src/map/script.c index 40b6f10a2..4cc2ab5b8 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -537,7 +537,7 @@ struct { {buildin_end,"end",""},
// {buildin_end,"break",""}, this might confuse advanced scripting support [Eoe]
{buildin_checkoption,"checkoption","i"},
- {buildin_setoption,"setoption","i"},
+ {buildin_setoption,"setoption","i*"},
{buildin_setcart,"setcart",""},
{buildin_checkcart,"checkcart","*"}, //fixed by Lupus (added '*')
{buildin_setfalcon,"setfalcon",""},
@@ -5079,10 +5079,26 @@ int buildin_setoption(struct script_state *st) {
int type;
struct map_session_data *sd;
-
+ int flag=0;
+
type=conv_num(st,& (st->stack->stack_data[st->start+2]));
+ if(st->end>st->start+3 )
+ flag=conv_num(st,&(st->stack->stack_data[st->start+3]) );
+
sd=script_rid2sd(st);
- pc_setoption(sd,type);
+ if (!sd) return 0;
+
+ switch (flag) {
+ case 1: //Add option
+ pc_setoption(sd,sd->sc.option|type);
+ break;
+ case 2: //Remove option
+ pc_setoption(sd,sd->sc.option&~type);
+ break;
+ default: //Set option
+ pc_setoption(sd,type);
+ break;
+ }
return 0;
}
diff --git a/src/map/status.h b/src/map/status.h index 9d14cddf6..d4a7168ad 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -419,7 +419,6 @@ enum { #define OPT2_POISON 0x001
#define OPT2_CURSE 0x002
#define OPT2_SILENCE 0x004
-//0x008 Odd howl sound, Signum crucis?
#define OPT2_SIGNUMCRUCIS 0x008
#define OPT2_BLIND 0x010
//0x020 - nothing
|