#include "tune.h" #define QUEST "room/quest_room" #define MASTER "Valentine" #define MSAY(X) write(MASTER +" says: "+ X) #define ME this_player() #define NAME (string)ME->query_name() #define REAL (string)ME->query_real_name() #define GUILD (string)ME->query_guild_string() #define TITLE (string)ME->query_title() #define GENDER (int)ME->query_gender() #define LEVEL (int)ME->query_level() #define NEW_WIZ "NEW_WIZ" #define ASCEND_LEVEL 30 #define EXP (int)ME->query_exp() #define CON (int)ME->query_con() #define DEX (int)ME->query_dex() #define INT (int)ME->query_int() #define STR (int)ME->query_str() #define WIS (int)ME->query_wis() #define OWN(X) present(X,ME) #define WATER_BROTHER (GUILD == "water brother") #define MC(X, Y) move_object(clone_object(X),Y) #define CAP(X) capitalize(X) #define LOW(X) lower_case(X) #define MAX_STAT 25 #define WIZ 50 #define ELD 500 inherit "room/room"; static int next_level, next_exp, exp_list; static int mon_wc, mon_ac, mon_hp; static string male_title_str, fem_title_str, neut_title_str; string banished_by, title; object board; reset (arg) { if (arg) return; set_light(1); short_desc = "The Water Brother's Guild"; long_desc = "-=[ Water Brother's Guild ]=-\n\n"+ "Here is where the Water Brothers advance their levels and stats.\n"+ "You see a sign on the wall.\n"; add_sign (" Guild Commands:\n\n"+ "train/advance [str,dex,con,wis,level]\n"+ " Advances levels and stats with experience or gold.\n\n"+ "cost\n"+ " List cost in experience to train stats and levels\n\n"+ "list [quest_number]\n"+ " Shows unfinished quests, or if a quest number is given,\n"+ " it will show you the Council's records on the quest.\n\n"); dest_dir = ({ "players/jubal/water/entrance", "south", }); } init () { ::init(); add_action ("advance", "advance"); add_action ("advance", "train"); add_action ("cost_for_level", "cost"); add_action ("list_quests", "list"); add_action ("ascend_to_wiz", "ascend"); } get_level (lvl) { next_exp = get_next_exp (lvl); next_level = lvl + 1; title = get_new_title (lvl); } get_new_title (lvl) { if (!male_title_str) set_male_titles(); if (!fem_title_str) set_fem_titles(); if (!neut_title_str) set_neut_titles(); if (lvl > 19) lvl = 19; if (GENDER == 0) return neut_title_str[lvl]; if (GENDER == 1) return male_title_str[lvl]; return fem_title_str[lvl]; } get_next_exp (lvl) { if (!exp_list) exp_list = ({ 676, 1014, 1522, 2283, 3425, 5138, 7707, 11561, 17341, 26012, 39018, 58527, 87791, 131687, 197530, 296296, 444444, 666666, 1000000, 1500000, 2000000, 2500000, 3000000, 3500000, 4000000, 4500000, }); if (lvl > 25) return exp_list[25] + 500000 * (lvl - 25); return exp_list[lvl]; } query_cost (l) { if (l > 20) return get_next_exp (20); return get_next_exp (l); } cost_for_level () { write(" Costs to train:\n\n"); write(get_stat_cost ("Constitution ... ", raise_cost(CON))); write(get_stat_cost ("Dexterity ...... ", raise_cost(DEX))); write(get_stat_cost ("Strength ....... ", raise_cost(STR))); write(get_stat_cost ("Wisdom ......... ", raise_cost(WIS))); write("\n"); if (LEVEL >= WIZ) { MSAY("You will have to seek other ways to advance your level.\n"); return 1; } if (LEVEL == WIZ - 1) { MSAY("You have reached the pinnacle of mortal achievement.\n"); MSAY("To advance any higher would mean to ascend to wizardhood.\n"); return 1; } get_level (LEVEL); /* if (!QUEST->can_advance_to (next_level)) { MSAY("The Council will not let me train you this level\n"+ " until you have completed the proclamations.\n"); return 1; } */ if (next_exp <= EXP) { MSAY("It will cost you nothing to train this level.\n"); return 1; } if ((next_exp - EXP) > (next_exp/10)) { MSAY("You must be closer to the next level before I can help you.\n"); return 1; } MSAY("It will cost you "+ ((next_exp - EXP) * 1000 / EXP_COST) + " gold coins to advance to level "+ next_level +".\n"); return 1; } get_stat_cost (str, cost) { int i; str = " "+ str; if (cost) { for (i=0; i<(5 - strlen (cost +"")); i++) cost = " "+ cost; return str + cost +" experience.\n"; } else return str +"Not possible.\n"; } advance (str) { int cost; if (OWN("no_advance")) { MSAY("You cannot train whilst under the influence of magic.\n"); return 1; } if (!WATER_BROTHER) { MSAY("You cannot advance here as you belong to another guild.\n"); MSAY("You must train in your own guild.\n"); return 1; } if (ME->query_level_drained() > 0) { MSAY("You have been level drained by dread beasts.\n"); MSAY("This has made you too weak to train here.\n"); MSAY("Seek aid of restoration from a priest and return later.\n"); return 1; } if (str == "con" || str == "constitution") return raise_stat ("con", "constitution", CON); if (str == "dex" || str == "dexterity") return raise_stat ("dex", "dexterity", DEX); if (str == "int" || str == "intelligence") { MSAY("Intelligence is not important, it is wisdom\n"+ " and grokking that matters.\n"+ " If you really must learn those false magicks,\n"+ " search out those of knowledge in the library.\n"); return 1; } if (str == "str" || str == "strength") return raise_stat ("str", "strength", STR); if (str == "wis" || str == "wisdom") return raise_stat ("wis", "wisdom", WIS); if (str && LOW(str) != "level") return 0; if (LEVEL >= WIZ) { MSAY("You are still "+ CAP(REAL) + TITLE +"\n"); return 1; } if (LEVEL == WIZ - 1) { MSAY("You have reached the pinnacle of mortal achievement!\n"); MSAY("To advance further you can only ascend to wizardhood.\n"); return 1; } if (LEVEL == 19) { /* * This is temporary, when updated player is added, over 19th level * players will get the extra abilities from there. */ MC("/players/zilanthius/spells/player_above_20", ME); MSAY("You have been granted greater powers for your new status!\n"); MSAY("Use these powers wisely brave adventurer.\n"); MSAY("Type for further information.\n\n"); } if (LEVEL >= 30) { MSAY("You are now entering a brave new world...\n"); MSAY("At this point in your life you can continue to play through\n"+ " the realms of Gumbi; or, if you have completed\n"+ " the required proclamations as set by the Council\n"+ " Wizards, you can ascend into wizardhood.\n"); MSAY("You must seek out an Elder of the Council and petition\n"+ " their aid in your ascention if that is the path you\n"+ " choose to take.\n"); } if (LEVEL == -1) get_level (1); else get_level (LEVEL); if (LEVEL == 0) next_exp = EXP; else if ((next_exp - EXP) > (next_exp/10)) { MSAY("You must be closer to the next level.\n"); return 1; } cost = (next_exp - EXP) * 1000 / EXP_COST; if (next_exp > EXP) { if (ME->query_money() < cost) { MSAY("You don't have enough gold to advance.\n"); return 1; } else ME->add_money (-cost); } say (NAME +" is now level "+ next_level +".\n"); ME->set_level (next_level); ME->set_title (title, 1); if (EXP < next_exp) ME->add_exp (next_exp - EXP); ME->save_character(); if (next_level < 7) { MSAY("You are now "+ NAME +" "+ title +" (level "+ next_level +").\n"); return 1; } if (next_level < 14) { MSAY("Well done, "+ NAME +" "+ title +" (level "+ next_level +").\n"); return 1; } if (next_level < 20) { MSAY("Welcome to your new class, mighty one!\n"); MSAY("You are now "+ NAME +" "+ title +" (level "+ next_level +").\n"); } if (next_level >= 20) { MSAY("Congratulations being of power!\n"); MSAY("You are now "+ NAME +" "+ title +" (level "+ next_level +").\n"); } return 1; } raise_stat (stat, name, lvl) { int new_lvl; if (too_high_average()) return 0; if (lvl >= MAX_STAT) { notify_fail (MASTER+" says: You couldn't possibly get any better.\n"); return 0; } if (raise_cost(lvl, 1)) { new_lvl = lvl + 1; call_other (ME, "set_"+ stat, new_lvl); write ("You train your "+ name +" up to "+ new_lvl +".\n"); } else { MSAY("You're not experienced enough to advance your "+ name +".\n"); MSAY("Return to me when you have proven yourself worthy.\n"); } return 1; } /* * Check that the player does not have too high average of the stats. */ too_high_average () { if ((CON + DEX + INT + STR + WIS) / 5 >= LEVEL + 3) { notify_fail (MASTER+" says: I am truly sorry "+ NAME + ", but you are not of high enough level.\n"); return 1; } return 0; } /* * Compute cost for raising a stat one level. 'base' is the level that * you have now, but never less than 1. */ raise_cost (base, action) { int cost, spend; if (base >= MAX_STAT) return 0; cost = (get_next_exp (base) - get_next_exp (base - 1)) / STAT_COST; spend = EXP - get_next_exp (LEVEL - 1); if (spend < cost) return 0; if (action == 0) return cost; ME->add_exp (-cost); return cost; } list_quests (num) { int qnum; if (num && (sscanf(num, "%d", qnum) == 1)) QUEST->list (qnum); else QUEST->count(); return 1; } ascend_to_wiz () { if (LEVEL < ASCEND_LEVEL) return 0; if (LEVEL >= WIZ) return 0; if (QUEST->count()) return 0; MSAY("To ascend to the ranks of the immortal wizards you must have\n"+ " compeleted the required proclomations as set down by\n"+ " the Council of Wizards.\n"); MSAY("Also, you need the approval of at least an Elder member of the\n"+ " Council, and that Council member must be present for\n"+ " the ascention.\n"); MSAY("So...who is this Elder? "); input_to ("advancing_to_wiz"); return 1; } advancing_to_wiz (arg) { object ob; if (!arg) { MSAY("You must give me the name of your sponsor when u ascend.\n"); return 1; } ob = present (arg, environment(ME)); if (!ob) { MSAY("I can see no '"+ CAP(arg) +"' here!\n"); return 1; } if (ob->query_level() < ELD) { MSAY(ob->query_name() +" is not an Elder!!\n"); MSAY("Only an Elder can approve your ascention to Wizardhood.\n"); return 1; } if (!query_ip_number(ob)) { MSAY(ob->query_name() +" is not available now for that.\n"); return 1; } shout (MASTER +" shouts: A new wizard has been born!\n"); shout (MASTER +" shouts: "+ NAME +" has ascending from mortallity!\n"); MSAY("Congratulations! You're now a wizard!\n\n"); write ("Before you can advance to 51st level as a wizard, and code\n"+ "for players, you must read the guidelines that show you what\n"+ "you're allowed to code.\n"+ "These can be found in the directory /doc/GUIDELINES \n"+ "Please use them well.\n\n"); log_file(NEW_WIZ,"Wiz: "+ME->query_real_name()+" L: "+ME->query_level()+ " S: "+ME->query_str()+" D: "+ME->query_dex()+ " I: "+ME->query_int()+" W: "+ME->query_wis()+ " C: "+ME->query_con()+" E: "+ME->query_exp()+ " G: "+ME->query_guild_string()+"\n"); ME->set_level (WIZ); ME->set_title ("the Apprentice Wizard", 1); ME->save_character(); return 1; } get_mon_wc (l) { if (!mon_wc) mon_wc = ({ 1, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28, 30 }); if (l > 20) return 30; if (l < 1) return 0; return mon_wc[l]; } get_mon_ac (l) { if (!mon_ac) mon_ac = ({ 1, 3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 12, 13, 14, 15, 16, 17 }); if (l < 1) return 0; if (l > 20) return 17; return mon_ac[l]; } get_mon_hp (l) { if (!mon_hp) mon_hp = ({ 10, 50, 55, 60, 70, 80, 95, 110, 130, 150, 175, 200, 230, 260, 300, 350, 450, 600, 800, 1100, 1500 }); if (l < 1) return 10; if (l > 20) return 1700; return mon_hp[l]; } set_male_titles () { male_title_str = ({ "the Utter Newbie", "the Amateur Traveller", "the Lesser Nomad", "the Prominent Nomad", "the Renowned Nomad", "the Lesser Vagrant", "the Greater Vagrant", "the Wanderer", "the Renowned Wanderer", "the Lesser Rover", "the Prominent Rover", "the Adventurer", "the Renowned Adventurer", "the Lesser Mercenary", "the Greater Mercenary", "the Mercenary Lord", "the Landless Noble", "the Lesser Noble", "the Greater Noble", "the Honourble Lord", }); } set_fem_titles () { fem_title_str = ({ "the Utter Newbie", "the Ameteur Traveller", "the Lesser Nomad", "the Prominent Nomad", "the Renowned Nomad", "the Lesser Vagrant", "the Greater Vagrant", "the Amateur Drifter", "the Great Drifter", "the Wanderess", "the Renowned Wanderess", "the Lesser Gypsy", "the Prominent Gypsy", "the Renowned Gypsy", "the Adventuress", "the Renowned Adventuress", "the Lady Mercenary", "the Landless Lady", "the Lesser Lady", "the Greater Lady" }); } set_neut_titles () { neut_title_str = ({ "the Kobold", "the Goblin", "the Orc", "the Hobgoblin", "the Bugbear", "the Ghoul", "the Ghast", "the Wraith", "the Shadow", "the Spectre", "the Centaur", "the Viscious Ogre", "the Mighty Cyclops", "the Hill Giant", "the Fire Giant", "the Bone Devil", "the Hellish Balrog", "the Powerful Pit Fiend", "the Demon Lord", "the High Beastlord" }); }