summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-07-28 21:41:16 -0300
committerJesusaves <cpntb1@ymail.com>2020-07-28 21:41:16 -0300
commit8d53b8a7641a500d03363c7f104c9d705a761cee (patch)
treeb28f5a21b2bbc4929f5e4125ea415290370a5902 /npc/functions
parent9631772d97faea6017a2e50143c7158a0a140db9 (diff)
downloadserverdata-8d53b8a7641a500d03363c7f104c9d705a761cee.tar.gz
serverdata-8d53b8a7641a500d03363c7f104c9d705a761cee.tar.bz2
serverdata-8d53b8a7641a500d03363c7f104c9d705a761cee.tar.xz
serverdata-8d53b8a7641a500d03363c7f104c9d705a761cee.zip
Initial version of the most powerful power the Town Admin have.
The power to exile a player. Exiles are not logged anywhere. When exiled, player will not be saved to town. This affects respawn and Soul Menhir. It can be circumvent by a few bugs/tricks.
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/politics.txt49
-rw-r--r--npc/functions/soul_menhir.txt13
-rw-r--r--npc/functions/util.txt5
3 files changed, 61 insertions, 6 deletions
diff --git a/npc/functions/politics.txt b/npc/functions/politics.txt
index 95469e8bc..3e6cdc31a 100644
--- a/npc/functions/politics.txt
+++ b/npc/functions/politics.txt
@@ -375,6 +375,8 @@ function script POL_Manage {
l("Lower city taxes"), 35,
rif(.@CR && .@RP, l("Tax crafters")), 40,
rif(!.@CR, l("Don't tax crafters")), 41,
+ rif(is_staff(), l("Exile a player")), 70,
+ rif(is_staff(), l("Revert a player exile")), 71,
l("Resign"), 99;
mes "";
switch (@menuret) {
@@ -464,6 +466,53 @@ function script POL_Manage {
setd(.@town$+"_REPUTATION", .@RP+1);
mesc l("Crafters no longer pays taxes. (Tax exempt)"), 1;
break;
+ // Mark 70: Exile
+ case 70:
+ mesc l("Exiled players will not be able to save to menhir."), 1;
+ mesc l("A global announcement will be made."), 1;
+ mesc l("Player must be online for the operation to finish."), 1;
+ next;
+ mesc l("Please insert player name to exile."), 1;
+ input .@ex$;
+ if (.@ex$ == "")
+ break;
+ .@id=getcharid(3, .@ex$);
+ if (.@id < 1) {
+ mesc l("The player is offline or does not exist.");
+ break;
+ }
+ .@town=POL_LocToTP(getarg(0));
+ .@you=getcharid(3);
+ attachrid(.@id);
+ dispbottom l("You have been EXILED from %s by %s.", getarg(0), .@MAYOR$);
+ #EXILED=#EXILED|.@town;
+ detachrid();
+ attachrid(.@you);
+ kamibroadcast(sprintf("%s has EXILED %s from %s.",
+ .@MAYOR$, .@ex$, getarg(0)));
+ break;
+ case 71:
+ mesc l("Please insert player name to cancel exile."), 1;
+ input .@ex$;
+ if (.@ex$ == "")
+ break;
+ .@id=getcharid(3, .@ex$);
+ if (.@id < 1) {
+ mesc l("The player is offline or does not exist.");
+ break;
+ }
+ .@town=POL_LocToTP(getarg(0));
+ .@you=getcharid(3);
+ attachrid(.@id);
+ if (#EXILED & .@town) {
+ dispbottom l("You are NO LONGER EXILED from %s by %s.", getarg(0), .@MAYOR$);
+ #EXILED=#EXILED^.@town;
+ }
+ detachrid();
+ attachrid(.@you);
+ kamibroadcast(sprintf("%s has ANNULED THE EXILE %s from %s.",
+ .@MAYOR$, .@ex$, getarg(0)));
+ break;
// Mark 90: Office
case 99:
mesc l("Really resign?"), 1;
diff --git a/npc/functions/soul_menhir.txt b/npc/functions/soul_menhir.txt
index 0ec080261..c498be6ea 100644
--- a/npc/functions/soul_menhir.txt
+++ b/npc/functions/soul_menhir.txt
@@ -97,14 +97,17 @@ L_DontPanic:
L_Save:
if (GSET_SOULMENHIR_MANUAL) {
- savepoint @map$, @x, @y;
- specialeffect(4, SELF, getcharid(3));
+ .@v$=MapToLoc(@map$);
+ .@tp=POL_LocToTP(strtoupper(.@v$));
+ if (!(#EXILED & .@tp)) {
+ savepoint @map$, @x, @y;
+ specialeffect(4, SELF, getcharid(3));
+ } else {
+ mesc l("You are exiled from this town and therefore, unable to use the Menhir."), 1;
+ }
} else {
EnterTown(MapToLoc(@map$));
dispbottom col(l("Your position is auto-saved when entering a town - use @ucp to change this behavior."), 1);
}
-
- // As we have a dialog box open, this function produces an undesirable player talk.
- //savepointparticle @map$, @x, @y, NO_INN;
return;
}
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index c3c1f390a..e0c1b93d8 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -931,7 +931,10 @@ function script EnterTown {
if (array_find($@LOCMASTER_LOC$, .@v$) < 0)
return Exception("Invalid location passed to EnterTown: "+.@v$);
- LOCATION$=.@v$;
+ // Do not save if you're exiled
+ .@tpcode=POL_LocToTP(strtoupper(.@v$));
+ if (!(#EXILED & .@tpcode))
+ LOCATION$=.@v$;
return;
}