From 582336dff2bffba506891a54ecd9360e4fbdd65c Mon Sep 17 00:00:00 2001 From: Carlos Henrique Date: Thu, 20 Sep 2018 16:08:47 -0300 Subject: Added mapflags 'nostorage' and 'nogstorage' nostorage 1 -- blocks only @storage nostorage 2 -- blocks only openstorage(); nostorage 3 -- blocks @storage and openstorage() nogstorage 1 -- blocks only @gstorage nogstorage 2 -- blocks only guildopenstorage(); nogstorage 3 -- blocks @gstorage and guildopenstorage() --- src/map/script.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/map/script.c') diff --git a/src/map/script.c b/src/map/script.c index 41f21cd72..e92c4c227 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -10561,6 +10561,12 @@ static BUILDIN(openstorage) return false; } + // Mapflag preventing from openstorage here + if (!pc_has_permission(sd, PC_PERM_BYPASS_NOSTORAGE) && (map->list[sd->bl.m].flag.nostorage & 2)) { + script_pushint(st, 0); + return true; + } + storage->open(sd); script_pushint(st, 1); // success flag. @@ -10574,6 +10580,12 @@ static BUILDIN(guildopenstorage) if (sd == NULL) return true; + // Mapflag preventing from openstorage here + if (!pc_has_permission(sd, PC_PERM_BYPASS_NOSTORAGE) && (map->list[sd->bl.m].flag.nogstorage & 2)) { + script_pushint(st, 1); + return true; + } + ret = gstorage->open(sd); script_pushint(st,ret); return true; @@ -13064,6 +13076,8 @@ static BUILDIN(getmapflag) case MF_NOVIEWID: script_pushint(st, map->list[m].flag.noviewid); break; case MF_PAIRSHIP_STARTABLE: script_pushint(st, map->list[m].flag.pairship_startable); break; case MF_PAIRSHIP_ENDABLE: script_pushint(st, map->list[m].flag.pairship_endable); break; + case MF_NOSTORAGE: script_pushint(st, map->list[m].flag.nostorage); break; + case MF_NOGSTORAGE: script_pushint(st, map->list[m].flag.nogstorage); break; } } @@ -13194,6 +13208,8 @@ static BUILDIN(setmapflag) case MF_NOVIEWID: map->list[m].flag.noviewid = (val <= 0) ? EQP_NONE : val; break; case MF_PAIRSHIP_STARTABLE: map->list[m].flag.pairship_startable = 1; break; case MF_PAIRSHIP_ENDABLE: map->list[m].flag.pairship_endable = 1; break; + case MF_NOSTORAGE: map->list[m].flag.nostorage = cap_value(val, 0, 3); break; + case MF_NOGSTORAGE: map->list[m].flag.nogstorage = cap_value(val, 0, 3); break; } } @@ -13285,6 +13301,8 @@ static BUILDIN(removemapflag) case MF_NOCASHSHOP: map->list[m].flag.nocashshop = 0; break; case MF_NOAUTOLOOT: map->list[m].flag.noautoloot = 0; break; case MF_NOVIEWID: map->list[m].flag.noviewid = EQP_NONE; break; + case MF_NOSTORAGE: map->list[m].flag.nostorage = 0; break; + case MF_NOGSTORAGE: map->list[m].flag.nogstorage = 0; break; } } @@ -25755,6 +25773,7 @@ static void script_hardcoded_constants(void) script->set_constant("PERM_DISABLE_STORE", PC_PERM_DISABLE_STORE, false, false); script->set_constant("PERM_DISABLE_EXP", PC_PERM_DISABLE_EXP, false, false); script->set_constant("PERM_DISABLE_SKILL_USAGE", PC_PERM_DISABLE_SKILL_USAGE, false, false); + script->set_constant("PERM_BYPASS_NOSTORAGE", PC_PERM_BYPASS_NOSTORAGE, false, false); script->constdb_comment("Data types"); script->set_constant("DATATYPE_NIL", DATATYPE_NIL, false, false); -- cgit v1.2.3-60-g2f50