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 | |
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
-rw-r--r-- | Changelog-Trunk.txt | 7 | ||||
-rw-r--r-- | doc/script_commands.txt | 16 | ||||
-rw-r--r-- | src/map/script.c | 22 | ||||
-rw-r--r-- | src/map/status.h | 1 |
4 files changed, 34 insertions, 12 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index a0c609b1f..846eb5650 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,13 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/05/09
+ * 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. [Skotlex]
+ * Updated script_commands information for setoption due to this change.
+ [Skotlex]
* Small fix in npc-created chat rooms to properly include the terminating 0
on the chat's event. [Skotlex]
* Fixed Fog of Wall's symmetry in respect to Misc attacks, they no longer
diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 7c0822bb8..9c87d2530 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -2654,7 +2654,7 @@ Note: Break won't work anymore, it has been commented out in src/map/script.c: *checkoption(<option number>)
*checkoption1(<option number>)
*checkoption2(<option number>)
-*setoption <option number>;
+*setoption <option number>{,type};
The 'setoption' series of functions check for a so-called option that is set on
the invoking character. 'Options' are used to store status conditions and a lot
@@ -2669,19 +2669,15 @@ Option numbers valid for the first version of this command are: 2 - Frozen.
3 - Stunned.
4 - Sleeping.
-32 - Riding a Peco.
-
-'setoption' will set options on the invoking character. There are no second and
-third versions of this command, so you can only change the
-petrified/frozen/stunned/sleeping/riding status in this manner.
+6 - Petrifying (the state where you can still walk)
Option numbers valid for the second version of this command are:
1 - Poisoned.
2 - Cursed.
4 - Silenced.
-8 - Blinded (Notice that unless you specfy variable night darkness in the
- configuration, all characters will be 'blinded' during the night)
+8 - Signum Crucis (plays a howl-like sound effect, but otherwise no visible effects are displayed)
+16 - Blinded.
Option numbers valid for the third version of this command are:
@@ -2697,10 +2693,14 @@ Option numbers valid for the third version of this command are: 2048 - Orc head present.
4096 - The character is wearing a wedding sprite.
8192 - Ruwach is in effect.
+16384 - Chasewalk in effect.
Option numbers are bitmasks - add up option numbers to check for all of them
being present at the same time in one go.
+'setoption' will set options on the invoking character. There are no second and
+third versions of this command, so you can only change the values in the last list (cloak, cart, ruwach, etc). if flag is 1, the option will be added to what the character currently has; if 2, the option is removed; otherwise (or if omitted) the option is set to what is passed (that is, all other set option values are removed).
+
This is definitely not a complete list of available option flag numbers. Ask a
core developer for the full list.
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
|