summaryrefslogtreecommitdiff
path: root/npc/commands
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-01-14 10:55:31 -0300
committerJesusaves <cpntb1@ymail.com>2022-01-14 10:55:31 -0300
commit88907fba36dc6559ede5bd1c1d4977eefc0a5819 (patch)
tree99b7da5971471d0c1acf24a4a20cc34c1c0b2576 /npc/commands
parent0c89664363cd75d758b1b590329265408de167ea (diff)
downloadserverdata-88907fba36dc6559ede5bd1c1d4977eefc0a5819.tar.gz
serverdata-88907fba36dc6559ede5bd1c1d4977eefc0a5819.tar.bz2
serverdata-88907fba36dc6559ede5bd1c1d4977eefc0a5819.tar.xz
serverdata-88907fba36dc6559ede5bd1c1d4977eefc0a5819.zip
Magic Olympics Tuition workaround
Diffstat (limited to 'npc/commands')
-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;
+}
+
+