From 08c243d0445c3664ae3ba5b1cfd479063cd4dbd3 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 20 Jan 2022 00:59:18 -0300 Subject: Some minor changes to some script commands: blessing, getvar, setvar, is_senior() --- npc/commands/debug.txt | 13 +++++++++---- npc/commands/kami.txt | 2 +- npc/functions/permissions.txt | 16 +++++++++++----- 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))); -- cgit v1.2.3-60-g2f50