summaryrefslogtreecommitdiff
path: root/npc/commands/titulate.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/commands/titulate.txt')
-rw-r--r--npc/commands/titulate.txt69
1 files changed, 69 insertions, 0 deletions
diff --git a/npc/commands/titulate.txt b/npc/commands/titulate.txt
index e3ecc2ebd..c36796484 100644
--- a/npc/commands/titulate.txt
+++ b/npc/commands/titulate.txt
@@ -155,3 +155,72 @@ OnInit:
bindatcmd "cassate", "@titulate::OnCassate", 60, 100, 1;
}
+function script AutoTitulate {
+ .@ori = gettimetick(2); // Will never duplicate
+ switch (ACADEMIC_RANK) {
+ case ACADEMIC_LAYMAN:
+ case ACADEMIC_STUDENT:
+ case ACADEMIC_TECHNIC:
+ // Instant promotion
+ ACADEMIC_RANK+=1;
+ .@upgrade=true;
+ break;
+ case ACADEMIC_BACHELOR:
+ case ACADEMIC_MASTER:
+ // Two-Man rule
+ if (array_find(ACADEMIC_VOUCH, .@ori)) {
+ end;
+ }
+ array_push(ACADEMIC_VOUCH, .@ori);
+ if (array_entries(ACADEMIC_VOUCH) >= 2) {
+ ACADEMIC_RANK+=1;
+ deletearray(ACADEMIC_VOUCH);
+ .@upgrade=true;
+ }
+ break;
+ case ACADEMIC_DOCTOR:
+ case ACADEMIC_PHD:
+ // Three-Man rule
+ if (array_find(ACADEMIC_VOUCH, .@ori)) {
+ end;
+ }
+ array_push(ACADEMIC_VOUCH, .@ori);
+ if (array_entries(ACADEMIC_VOUCH) >= 3) {
+ ACADEMIC_RANK+=1;
+ deletearray(ACADEMIC_VOUCH);
+ .@upgrade=true;
+ }
+ break;
+ // Invalid
+ case ACADEMIC_SAGE:
+ getexp 5000000, 150000;
+ mesc "+500,000 exp";
+ mesc "+150,000 job";
+ Exception("The Grand Master title can only be issued by the president of the Alliance High Council.", RB_ISFATAL|RB_SPEECH);
+ default:
+ Exception("Invalid titulation rank: "+ACADEMIC_RANK, RB_ISFATAL|RB_SPEECH|RB_PLEASEREPORT);
+ }
+
+ // Message
+ if (.@upgrade) {
+ dispbottom l("You received the %s title from %s.",
+ academicrank(), "Hocus Pocus the Fidibus");
+ } else {
+ dispbottom l("You were vouched to the %s title by %s. You still need %d more vouches to be promoted.",
+ academicrank(ACADEMIC_RANK+1), "Hocus Pocus the Fidibus",
+ (ACADEMIC_RANK >= ACADEMIC_DOCTOR ? 3 : 2) - array_entries(ACADEMIC_VOUCH));
+ }
+
+ // Inform everyone
+ .@r = ACADEMIC_RANK + 1;
+ kamibroadcast(sprintf("%s has vouched %s for the title of %s.",
+ "Hocus Pocus the Fidibus", strcharinfo(0), academicrank(.@r)));
+ // Log in a special log file as well
+ logmes(sprintf("%s has vouched %s for the title of %s.",
+ "Hocus Pocus the Fidibus", strcharinfo(0), academicrank(.@r)));
+
+ // Continue
+ return;
+}
+
+