diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-12-14 16:22:08 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-12-14 16:22:08 -0300 |
commit | 5f992cdd7fe37d06b65cc4f56d4763836c916805 (patch) | |
tree | 6dc5af3953950d0e25d9712a1565c7aa712673a3 /npc | |
parent | 00d012fab3fcb141e426d47c78824024004eefd0 (diff) | |
download | serverdata-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)
Diffstat (limited to 'npc')
-rw-r--r-- | npc/commands/titulate.txt | 44 | ||||
-rw-r--r-- | npc/functions/util.txt | 2 |
2 files changed, 44 insertions, 2 deletions
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"); } } |