diff options
Diffstat (limited to 'src/map/script-fun.cpp')
-rw-r--r-- | src/map/script-fun.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 8c25266..bde1458 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -2175,6 +2175,36 @@ void builtin_pvpoff(ScriptState *st) } } +static +void builtin_pvp(ScriptState *st) +{ + dumb_ptr<map_session_data> sd = script_rid2sd(st); + int flag; + flag = conv_num(st, &AARG(0)); + if (flag > 1) + flag = 1; + + sd->state.pvpon = flag; +} + +static +void builtin_getpvpflag(ScriptState *st) +{ + dumb_ptr<map_session_data> sd = script_rid2sd(st); + int num = conv_num(st, &AARG(0)); + + switch (num){ + case 0: + num = sd->state.pvpon; + break; + case 1: + flag = bool(sd->status.option & Opt0::HIDE); + break; + } + + push_int<ScriptDataInt>(st->stack, num); +} + /*========================================== * NPCエモーション *------------------------------------------ @@ -3078,6 +3108,8 @@ BuiltinFunction builtin_functions[] = BUILTIN(getmapflag, "Mi"_s, 'i'), BUILTIN(pvpon, "M"_s, '\0'), BUILTIN(pvpoff, "M"_s, '\0'), + BUILTIN(pvp, "i"_s, '\0'), + BUILTIN(getpvpflag, "i"_s, 'i'), BUILTIN(emotion, "i"_s, '\0'), BUILTIN(mapwarp, "MMxy"_s, '\0'), BUILTIN(cmdothernpc, "ss"_s, '\0'), |