diff options
author | Carlos Henrique <carloshlfzanon@gmail.com> | 2018-09-20 16:08:47 -0300 |
---|---|---|
committer | Carlos Henrique <carloshlfzanon@gmail.com> | 2018-12-04 16:32:11 -0200 |
commit | 582336dff2bffba506891a54ecd9360e4fbdd65c (patch) | |
tree | 298a860fa285a1bc1d430322373b8b776de5fa2a /src/map/script.c | |
parent | 41d370cd3308be48b4ce00a50ee46515742978b0 (diff) | |
download | hercules-582336dff2bffba506891a54ecd9360e4fbdd65c.tar.gz hercules-582336dff2bffba506891a54ecd9360e4fbdd65c.tar.bz2 hercules-582336dff2bffba506891a54ecd9360e4fbdd65c.tar.xz hercules-582336dff2bffba506891a54ecd9360e4fbdd65c.zip |
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()
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 19 |
1 files changed, 19 insertions, 0 deletions
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); |