summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/script.c22
-rw-r--r--src/map/status.h1
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