From 5f992cdd7fe37d06b65cc4f56d4763836c916805 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 14 Dec 2020 16:22:08 -0300 Subject: Option to strip someone of their academic titles and optionally, ban them from the magic academy (prohibting the gain of further titles) --- npc/commands/titulate.txt | 44 +++++++++++++++++++++++++++++++++++++++++++- npc/functions/util.txt | 2 +- 2 files changed, 44 insertions(+), 2 deletions(-) (limited to 'npc') 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"); } } -- cgit v1.2.3-60-g2f50