summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-01-20 00:59:18 -0300
committerJesusaves <cpntb1@ymail.com>2022-01-20 00:59:18 -0300
commit08c243d0445c3664ae3ba5b1cfd479063cd4dbd3 (patch)
tree1ed98e431cb29bf19590d2af7d0b66ed77f61ecf
parentf4e13e0981f6e2d20fb7ec5cbeb4353542ebeccc (diff)
downloadserverdata-08c243d0445c3664ae3ba5b1cfd479063cd4dbd3.tar.gz
serverdata-08c243d0445c3664ae3ba5b1cfd479063cd4dbd3.tar.bz2
serverdata-08c243d0445c3664ae3ba5b1cfd479063cd4dbd3.tar.xz
serverdata-08c243d0445c3664ae3ba5b1cfd479063cd4dbd3.zip
Some minor changes to some script commands: blessing, getvar, setvar, is_senior()
-rw-r--r--npc/commands/debug.txt13
-rw-r--r--npc/commands/kami.txt2
-rw-r--r--npc/functions/permissions.txt16
3 files changed, 21 insertions, 10 deletions
diff --git a/npc/commands/debug.txt b/npc/commands/debug.txt
index d5bbc79f..a22f8e28 100644
--- a/npc/commands/debug.txt
+++ b/npc/commands/debug.txt
@@ -578,6 +578,11 @@ OnSetVar:
.@cmd$=array_shift(.@atcmd_parameters$);
.@idx=atoi(array_shift(.@atcmd_parameters$));
+
+ // Trying to edit global variables
+ if (charat(.@atcmd_parameters$[0], 0) == "$") && !is_admin())
+ Exception("You are not allowed to change global variables.", RB_DISPBOTTOM|RB_ISFATAL);
+
if (charat(.@atcmd_parameters$[0],
getstrlen(.@atcmd_parameters$[0])-1) == "$")
.@str=true;
@@ -666,10 +671,10 @@ OnDoEvent:
OnInit:
registercmd "@debug", "Debug Spell::OnDebug";
- bindatcmd "getvar", "Debug Spell::OnGetVar", 99, 99, 1;
- bindatcmd "get-var", "Debug Spell::OnGetVar", 99, 99, 1;
- bindatcmd "setvar", "Debug Spell::OnSetVar", 99, 99, 1;
- bindatcmd "set-var", "Debug Spell::OnSetVar", 99, 99, 1;
+ bindatcmd "getvar", "Debug Spell::OnGetVar", 40, 40, 1;
+ bindatcmd "get-var", "Debug Spell::OnGetVar", 40, 40, 1;
+ bindatcmd "setvar", "Debug Spell::OnSetVar", 80, 80, 1;
+ bindatcmd "set-var", "Debug Spell::OnSetVar", 80, 80, 1;
bindatcmd "sclear", "Debug Spell::OnSClear", 99, 99, 1;
bindatcmd "allperms", "Debug Spell::OnAllPerms", 99, 100, 1;
bindatcmd "callfunc", "@wgm::OnCallFunc", 99, 99, 1;
diff --git a/npc/commands/kami.txt b/npc/commands/kami.txt
index 8a7622d2..77c1e22b 100644
--- a/npc/commands/kami.txt
+++ b/npc/commands/kami.txt
@@ -87,7 +87,7 @@ OnInit:
bindatcmd "k", "@k::OnCall", 60, 80, 1;
bindatcmd "servmsg", "@k::OnServMsg", 80, 99, 1;
- bindatcmd "blessing", "@k::OnBuff", 99, 100, 1;
+ bindatcmd "blessing", "@k::OnBuff", 50, 99, 1;
bindatcmd "instcheck", "@k::OnInstCheck", 99, 100, 1;
bindatcmd "instdestr", "@k::OnInstDestroy", 99, 100, 1;
bindatcmd "delcells", "@k::OnDelCells", 60, 100, 1;
diff --git a/npc/functions/permissions.txt b/npc/functions/permissions.txt
index 8af2cc29..a0cfea19 100644
--- a/npc/functions/permissions.txt
+++ b/npc/functions/permissions.txt
@@ -5,31 +5,37 @@
// checks player permissions
// ** admins are implicitly everything
-// administrator
+// administrator (GM 99)
function script is_admin {
return has_permission(PERM_USE_ALL_COMMANDS,
getarg(0, getcharid(CHAR_ID_ACCOUNT)));
}
-// any staff member
+// any staff member (GM 1+)
function script is_trusted {
return has_permission("show_client_version",
getarg(0, getcharid(CHAR_ID_ACCOUNT)));
}
-// developer
+// developer (GM 20+)
function script is_dev {
return has_permission(PERM_RECEIVE_REQUESTS,
getarg(0, getcharid(CHAR_ID_ACCOUNT)));
}
-// event coordinator
+// senior developer (GM 40, GM 80+)
+function script is_senior {
+ return can_use_command("@loadnpc",
+ getarg(0, getcharid(CHAR_ID_ACCOUNT)));
+}
+
+// event coordinator (GM 50+)
function script is_evtc {
return can_use_command("@monster",
getarg(0, getcharid(CHAR_ID_ACCOUNT)));
}
-// game master
+// game master (GM 60+)
function script is_gm {
return can_use_command("@jail",
getarg(0, getcharid(CHAR_ID_ACCOUNT)));