#include <sys/types.h> #include <ctype.h> #include <stdio.h> #include <string.h> #include <time.h> #include "emlen.h" /*TINKER GUILD ALLOWS MEND SKILL, +1 WIS */ /*WARRIOR GUILD gives +1 STR +10 max HPS and FLURRY COMMAND */ /*HEALER GUILD gives +1 WIS and +hps on heal spells */ /*WIZARD GUILD gives +damage on some offensive spells and +1 INT */ /*RANGER GUILD gives +1 CON and makes you track at 100% */ /*ASSASSIN GUILD gives you +1 DEX, increases BS damage */ /*THIEF GUILD gives you +1 DEX, increase dodge */ /* TINKER HATES ASSASSINS, WIZARDS WARRIOR HATES WIZARD and HEALER and THIEF HEALER HATES WIZARD and ASSASSIN and THIEF WIZARD HATES HEALER and ASSASSIN and THIEF and WARRIOR RANGER HATES ASSASSIN ASSASSIN HATES ALL BUT WARRIOR AND THIEF THIEF HATES WARRIOR, HEALER WIZARD */ bool is_member (CHAR_DATA * ch, int guildflag) { if (IS_MOB (ch)) return FALSE; if (IS_SET (ch->pcdata->guilds, guildflag)) return TRUE; else return FALSE; } void do_guild (CHAR_DATA * ch, char *argy) { CHAR_DATA *mob; char buf[STD_LENGTH]; DEFINE_COMMAND ("guild", do_guild, POSITION_STANDING, 0, LOG_NORMAL, "This command allows you to perform guild options at a guild house.") if (IS_MOB (ch)) return; for (mob = ch->in_room->more->people; mob != NULL; mob = mob->next_in_room) { if (IS_MOB (mob) && ( IS_SET (mob->pIndexData->act3, ACT3_TINKER) || IS_SET (mob->pIndexData->act3, ACT3_WARRIOR) || IS_SET (mob->pIndexData->act3, ACT3_HEALER) || IS_SET (mob->pIndexData->act3, ACT3_WIZARD) || IS_SET (mob->pIndexData->act3, ACT3_THIEFG) || IS_SET (mob->pIndexData->act3, ACT3_RANGER) || IS_SET (mob->pIndexData->act3, ACT3_ASSASSIN) ) ) break; } if (mob == NULL) { send_to_char ("There is no guildmaster present here!\n\r", ch); return; } if (argy[0] == '\0') { send_to_char ("\n\rOptions:\n\r---> Guild leave\n\r---> Guild info\n\r---> Guild join\n\r---> Guild status\n\r", ch); return; } if (!str_cmp (argy, "info")) { if (IS_SET (mob->pIndexData->act3, ACT3_TINKER)) { send_to_char ("The guildmaster tells you:\n\r", ch); do_help (ch, "TINKER"); sprintf (buf, "The Tinker's guild costs %d coins to join. You must be level %d.\n\r", COST_TINKER, LEVEL_TINKER); send_to_char (buf, ch); return; } if (IS_SET (mob->pIndexData->act3, ACT3_WARRIOR)) { send_to_char ("The guildmaster tells you:\n\r", ch); do_help (ch, "WARRIOR"); sprintf (buf, "The Warrior's guild costs %d coins to join. You must be level %d.\n\r", COST_WARRIOR, LEVEL_WARRIOR); send_to_char (buf, ch); return; } if (IS_SET (mob->pIndexData->act3, ACT3_HEALER)) { send_to_char ("The guildmaster tells you:\n\r", ch); do_help (ch, "HEALER"); sprintf (buf, "The Healer's guild costs %d coins to join. You must be level %d.\n\r", COST_HEALER, LEVEL_HEALER); send_to_char (buf, ch); return; } if (IS_SET (mob->pIndexData->act3, ACT3_WIZARD)) { send_to_char ("The guildmaster tells you:\n\r", ch); do_help (ch, "WIZARD"); sprintf (buf, "The Wizard's guild costs %d coins to join. You must be level %d.\n\r", COST_WIZARD, LEVEL_WIZARD); send_to_char (buf, ch); return; } if (IS_SET (mob->pIndexData->act3, ACT3_THIEFG)) { send_to_char ("The guildmaster tells you:\n\r", ch); do_help (ch, "THIEF"); sprintf (buf, "The Thief's guild costs %d coins to join. You must be level %d.\n\r", COST_THIEFG, LEVEL_THIEFG); send_to_char (buf, ch); return; } if (IS_SET (mob->pIndexData->act3, ACT3_RANGER)) { send_to_char ("The guildmaster tells you:\n\r", ch); do_help (ch, "RANGER"); sprintf (buf, "The Ranger's guild costs %d coins to join. You must be level %d.\n\r", COST_RANGER, LEVEL_RANGER); send_to_char (buf, ch); return; } if (IS_SET (mob->pIndexData->act3, ACT3_ASSASSIN)) { send_to_char ("The guildmaster tells you:\n\r", ch); do_help (ch, "ASSASSIN"); sprintf (buf, "The Assassin's guild costs %d coins to join. You must be level %d.\n\r", COST_ASSASSIN, LEVEL_ASSASSIN); send_to_char (buf, ch); return; } return; } /*end of GUILD INFO */ if (!str_cmp (argy, "status")) { if (!IS_SET (ch->pcdata->guilds, (mob->pIndexData->act3))) { send_to_char ("You are not a member of our guild!\n\r", ch); return; } send_to_char ("You are an highly respected member of the guild.\n\r", ch); return; } /*end of GUILD STATUS */ if (!str_cmp (argy, "leave")) { if (!is_member (ch, (mob->pIndexData->act3))) { send_to_char ("You aren't even a member!!\n\r", ch); return; } if (IS_SET (mob->pIndexData->act3, ACT3_TINKER)) { ch->pcdata->perm_wis -= 1; ch->pcdata->guilds -= ACT3_TINKER; } else if (IS_SET (mob->pIndexData->act3, ACT3_WARRIOR)) { ch->pcdata->perm_str -= 1; ch->pcdata->guilds -= ACT3_WARRIOR; } else if (IS_SET (mob->pIndexData->act3, ACT3_HEALER)) { ch->pcdata->perm_wis -= 1; ch->pcdata->guilds -= ACT3_HEALER; } else if (IS_SET (mob->pIndexData->act3, ACT3_WIZARD)) { ch->pcdata->perm_int -= 1; ch->pcdata->guilds -= ACT3_WIZARD; } else if (IS_SET (mob->pIndexData->act3, ACT3_RANGER)) { ch->pcdata->perm_con -= 1; ch->pcdata->guilds -= ACT3_RANGER; } else if (IS_SET (mob->pIndexData->act3, ACT3_ASSASSIN)) { ch->pcdata->perm_dex -= 1; ch->pcdata->guilds -= ACT3_ASSASSIN; } else if (IS_SET (mob->pIndexData->act3, ACT3_THIEFG)) { ch->pcdata->perm_dex -= 1; ch->pcdata->guilds -= ACT3_THIEFG; } send_to_char ("You are no longer a member of the guild!!\n\r", ch); } /*end of GUILD LEAVE */ if (!str_cmp (argy, "join")) { int cst; int lvl; lvl = 0; cst = 0; if (IS_SET (ch->pcdata->guilds, mob->pIndexData->act3)) { send_to_char ("You are already a member of our guild!\n\r", ch); return; } if (IS_SET (mob->pIndexData->act3, ACT3_TINKER)) { if (IS_SET (ch->pcdata->guilds, GUILD_ASSASSIN)) { send_to_char ("We don't get along with Assassin's Guild scum like you.\n\r", ch); return; } if (IS_SET (ch->pcdata->guilds, GUILD_WIZARD)) { send_to_char ("We will not allow members of the Wizard's Guild to join.\n\r", ch); return; } } if (IS_SET (mob->pIndexData->act3, ACT3_WARRIOR)) { if (IS_SET (ch->pcdata->guilds, GUILD_HEALER)) { send_to_char ("We don't get along with members of the Healer's Guild.\n\r", ch); return; } if (IS_SET (ch->pcdata->guilds, GUILD_WIZARD)) { send_to_char ("We will not allow members of the Wizard's Guild to join.\n\r", ch); return; } if (IS_SET (ch->pcdata->guilds, GUILD_THIEFG)) { send_to_char ("We don't like sneaky Thieves joining our establishment.\n\r", ch); return; } } if (IS_SET (mob->pIndexData->act3, ACT3_HEALER)) { if (IS_SET (ch->pcdata->guilds, GUILD_ASSASSIN)) { send_to_char ("We don't get along with members of the Assassin's Guild.\n\r", ch); return; } if (IS_SET (ch->pcdata->guilds, GUILD_WIZARD)) { send_to_char ("We will not allow members of the Wizard's Guild to join.\n\r", ch); return; } if (IS_SET (ch->pcdata->guilds, GUILD_THIEFG)) { send_to_char ("We don't like sneaky Thieves joining our establishment.\n\r", ch); return; } } if (IS_SET (mob->pIndexData->act3, ACT3_WIZARD)) { if (IS_SET (ch->pcdata->guilds, GUILD_ASSASSIN)) { send_to_char ("We don't get along with members of the Assassin's Guild.\n\r", ch); return; } if (IS_SET (ch->pcdata->guilds, GUILD_HEALER)) { send_to_char ("We will not allow members of the Healer's Guild to join.\n\r", ch); return; } if (IS_SET (ch->pcdata->guilds, GUILD_THIEFG)) { send_to_char ("We don't like sneaky Thieves joining our establishment.\n\r", ch); return; } if (IS_SET (ch->pcdata->guilds, GUILD_WARRIOR)) { send_to_char ("We don't like members of the Warrior's Guild joining our fine establishment.\n\r", ch); return; } } if (IS_SET (mob->pIndexData->act3, ACT3_RANGER)) { if (IS_SET (ch->pcdata->guilds, GUILD_ASSASSIN)) { send_to_char ("We don't get along with members of the Assassin's Guild.\n\r", ch); return; } } if (IS_SET (mob->pIndexData->act3, ACT3_ASSASSIN)) { if (IS_SET (ch->pcdata->guilds, GUILD_WIZARD)) { send_to_char ("We detest members of the Wizard's Guild.\n\r", ch); return; } if (IS_SET (ch->pcdata->guilds, GUILD_HEALER)) { send_to_char ("We will not allow members of the Healer's Guild to join.\n\r", ch); return; } if (IS_SET (ch->pcdata->guilds, GUILD_TINKER)) { send_to_char ("We don't like brainless tinkers joining our establishment.\n\r", ch); return; } if (IS_SET (ch->pcdata->guilds, GUILD_RANGER)) { send_to_char ("We don't like members of the Ranger's Guild joining our secret guild.\n\r", ch); return; } } if (IS_SET (mob->pIndexData->act3, ACT3_THIEFG)) { if (IS_SET (ch->pcdata->guilds, GUILD_WARRIOR)) { send_to_char ("We don't get along with members of the Warrior's Guild.\n\r", ch); return; } if (IS_SET (ch->pcdata->guilds, GUILD_WIZARD)) { send_to_char ("We will not allow members of the Wizard's Guild to join.\n\r", ch); return; } if (IS_SET (ch->pcdata->guilds, GUILD_HEALER)) { send_to_char ("We don't allow members of the Healer's Guild to join our establishment.\n\r", ch); return; } } if (IS_SET (mob->pIndexData->act3, ACT3_TINKER)) { cst = COST_TINKER; lvl = LEVEL_TINKER; } else if (IS_SET (mob->pIndexData->act3, ACT3_WARRIOR)) { cst = COST_WARRIOR; lvl = LEVEL_WARRIOR; } else if (IS_SET (mob->pIndexData->act3, ACT3_HEALER)) { cst = COST_HEALER; lvl = LEVEL_HEALER; } else if (IS_SET (mob->pIndexData->act3, ACT3_WIZARD)) { cst = COST_WIZARD; lvl = LEVEL_WIZARD; } else if (IS_SET (mob->pIndexData->act3, ACT3_RANGER)) { cst = COST_RANGER; lvl = LEVEL_RANGER; } else if (IS_SET (mob->pIndexData->act3, ACT3_ASSASSIN)) { cst = COST_ASSASSIN; lvl = LEVEL_ASSASSIN; } else if (IS_SET (mob->pIndexData->act3, ACT3_THIEFG)) { cst = COST_THIEFG; lvl = LEVEL_THIEFG; } if (LEVEL (ch) < lvl) { sprintf (buf, "You need to be level %d to join the guild!\n\r", lvl); send_to_char (buf, ch); return; } if (tally_coins (ch) < cst) { sprintf (buf, "We need a payment of %d coins before we can let you join.\n\r", cst); send_to_char (buf, ch); return; } sub_coins (cst, ch); if (IS_SET (mob->pIndexData->act3, ACT3_TINKER)) { ch->pcdata->perm_wis += 1; ch->pcdata->guilds += ACT3_TINKER; send_to_char ("Congratulations! You are now a member of the Tinker's Guild!\n\r", ch); } else if (IS_SET (mob->pIndexData->act3, ACT3_WARRIOR)) { ch->pcdata->perm_str += 1; ch->pcdata->guilds += (mob->pIndexData->act3); send_to_char ("Congratulations! You are now a member of the Warrior's Guild!\n\r", ch); } else if (IS_SET (mob->pIndexData->act3, ACT3_HEALER)) { ch->pcdata->perm_wis += 1; ch->pcdata->guilds += ACT3_HEALER; send_to_char ("Congratulations! You are now a member of the Healer's Guild!\n\r", ch); } else if (IS_SET (mob->pIndexData->act3, ACT3_WIZARD)) { ch->pcdata->perm_int += 1; ch->pcdata->guilds += ACT3_WIZARD; send_to_char ("Congratulations! You are now a member of the Wizard's Guild!\n\r", ch); } else if (IS_SET (mob->pIndexData->act3, ACT3_RANGER)) { ch->pcdata->perm_con += 1; ch->pcdata->guilds += ACT3_RANGER; send_to_char ("Congratulations! You are now a member of the Ranger's Guild!\n\r", ch); } else if (IS_SET (mob->pIndexData->act3, ACT3_ASSASSIN)) { ch->pcdata->perm_dex += 1; ch->pcdata->guilds += ACT3_ASSASSIN; send_to_char ("Congratulations! You are now a member of the Assassin's Guild!\n\r", ch); } else if (IS_SET (mob->pIndexData->act3, ACT3_THIEFG)) { ch->pcdata->perm_dex += 1; ch->pcdata->guilds += ACT3_THIEFG; send_to_char ("Congratulations! You are now a member of the Thief's Guild!\n\r", ch); } sprintf (buf, "Welcome to our guild, %s!", NAME (ch)); do_say (mob, buf); } /*end of GUILD JOIN */ return; }