summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-12-14 16:22:08 -0300
committerJesusaves <cpntb1@ymail.com>2020-12-14 16:22:08 -0300
commit5f992cdd7fe37d06b65cc4f56d4763836c916805 (patch)
tree6dc5af3953950d0e25d9712a1565c7aa712673a3
parent00d012fab3fcb141e426d47c78824024004eefd0 (diff)
downloadserverdata-5f992cdd7fe37d06b65cc4f56d4763836c916805.tar.gz
serverdata-5f992cdd7fe37d06b65cc4f56d4763836c916805.tar.bz2
serverdata-5f992cdd7fe37d06b65cc4f56d4763836c916805.tar.xz
serverdata-5f992cdd7fe37d06b65cc4f56d4763836c916805.zip
Option to strip someone of their academic titles and optionally, ban them
from the magic academy (prohibting the gain of further titles)
-rw-r--r--db/constants.conf17
-rw-r--r--npc/commands/titulate.txt44
-rw-r--r--npc/functions/util.txt2
3 files changed, 53 insertions, 10 deletions
diff --git a/db/constants.conf b/db/constants.conf
index efef56ef9..7c9a57a7b 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -2339,14 +2339,15 @@ constants_db: {
CLASS_SCHOLARSHIP: 5
CLASS_THIEVES: 6
- ACADEMIC_LAYMAN: 0
- ACADEMIC_STUDENT: 1
- ACADEMIC_TECHNIC: 2
- ACADEMIC_BACHELOR: 3
- ACADEMIC_MASTER: 4
- ACADEMIC_DOCTOR: 5
- ACADEMIC_PHD: 6
- ACADEMIC_SAGE: 7
+ ACADEMIC_LAYMAN: 0
+ ACADEMIC_STUDENT: 1
+ ACADEMIC_TECHNIC: 2
+ ACADEMIC_BACHELOR: 3
+ ACADEMIC_MASTER: 4
+ ACADEMIC_DOCTOR: 5
+ ACADEMIC_PHD: 6
+ ACADEMIC_SAGE: 7
+ ACADEMIC_GM: 8
@include "conf/import/constants.conf"
}
diff --git a/npc/commands/titulate.txt b/npc/commands/titulate.txt
index 35e50328f..c286297f1 100644
--- a/npc/commands/titulate.txt
+++ b/npc/commands/titulate.txt
@@ -28,7 +28,7 @@ OnCall:
.@them=getvariableofpc(ACADEMIC_RANK, .@id, 99);
mes ".:: " + l("Titulation") + " ::.";
- if (.@mine <= .@them) {
+ if (.@mine <= .@them || .@them < 0) {
mesc l("You can only concede or vouch a title for people of academic rank smaller or equal to your own.");
close;
}
@@ -98,13 +98,55 @@ OnCall:
Exception("Player not found.", RB_ISFATAL|RB_SPEECH);
}
+ attachrid(.@ori);
// Inform everyone
kamibroadcast(sprintf("%s has vouched %s for the title of %s.",
strcharinfo(0), .@request$, academicrank(.@them+1)));
+ // Log in a special log file as well
+ logmes(sprintf("%s has vouched %s for the title of %s.",
+ strcharinfo(0), .@request$, academicrank(.@them+1)));
+
+ close;
+
+OnCassate:
+ if (ACADEMIC_RANK < ACADEMIC_GM) {
+ mesc l("Only Academy Grand Masters may cassate someone.");
+ close;
+ }
+ mes ("To revoke someone's title and optionally apply a ban on them.");
+ mes ("Please insert the nickname of person to cassate (they must be online)");
+ input .@request$;
+ mes ("Ban them from the Magic Academy as well?");
+ .@ban=(askyesno() == ASK_YES);
+ next;
+ .@ori = getcharid(3);
+ .@id = getcharid(3, .@request$);
+ if (.@id < 1 || .@ori < 1) {
+ Exception("Player not found.", RB_ISFATAL|RB_DISPBOTTOM);
+ }
+
+ // Execute the banishment
+ if (attachrid(.@id)) {
+ ACADEMIC_RANK=(.@ban ? -1 : ACADEMIC_LAYMAN);
+ skill TMW2_STUDY, 0, 0;
+ dispbottom l("Your academy titles have been rescinded%s",
+ (.@ban ? l(", and you have been banned from the Academy.") : "."));
+ } else {
+ Exception("Player not found.", RB_ISFATAL|RB_DISPBOTTOM);
+ }
+
+ attachrid(.@ori);
+ // Inform everyone
+ kamibroadcast(sprintf("%s (A.GM) has stripped %s from their academic titles.",
+ strcharinfo(0), .@request$);
+ // Log in a special log file as well
+ logmes(sprintf("%s (Grandmaster) has stripped %s from their academic titles.",
+ strcharinfo(0), .@request$);
close;
OnInit:
bindatcmd "titulate", "@titulate::OnCall", 0, 100, 1;
+ bindatcmd "cassate", "@titulate::OnCassate", 60, 100, 1;
}
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index ce7bf3c71..042a9adb6 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -897,7 +897,7 @@ function script academicrank {
case 2: return l("Technician");
case 1: return l("Student");
case 0: return l("Layman");
- default: return l("Error");
+ default: return l("Banned from Academy");
}
}