void do_heal(CHAR_DATA *ch, char *argument) { CHAR_DATA *mob; char arg[MIL]={'\0'}; int cost = 0; int sn = 0; SPELL_FUN *spell; char *words; /* check for healer */ for ( mob = ch->in_room->people; mob; mob = mob->next_in_room ) { if ( IS_NPC(mob) && IS_SET(mob->act, ACT_IS_HEALER) ) break; } if ( mob == NULL ) { send_to_char( "You can't do that here.\n\r", ch ); return; } one_argument(argument,arg); if (IS_NULLSTR(arg)) { /* display price list */ act("$N says 'I offer the following spells:'",ch,NULL,mob,TO_CHAR); send_to_char(" light: cure light wounds 10 gold\n\r",ch); send_to_char(" serious: cure serious wounds 15 gold\n\r",ch); send_to_char(" critic: cure critical wounds 25 gold\n\r",ch); send_to_char(" heal: healing spell 50 gold\n\r",ch); send_to_char(" blind: cure blindness 20 gold\n\r",ch); send_to_char(" disease: cure disease 15 gold\n\r",ch); send_to_char(" poison: cure poison 25 gold\n\r",ch); send_to_char(" uncurse: remove curse 50 gold\n\r",ch); send_to_char(" refresh: restore movement 5 gold\n\r",ch); send_to_char(" mana: restore mana 10 gold\n\r",ch); send_to_char(" Type heal <type> to be healed.\n\r",ch); return; } if (!str_prefix(arg,"light")) { spell = spell_cure_light; sn = skill_lookup("cure light"); words = "judicandus dies"; cost = 1000; } else if (!str_prefix(arg,"serious")) { spell = spell_cure_serious; sn = skill_lookup("cure serious"); words = "judicandus gzfuajg"; cost = 1600; } else if (!str_prefix(arg,"critical")) { spell = spell_cure_critical; sn = skill_lookup("cure critical"); words = "judicandus qfuhuqar"; cost = 2500; } else if (!str_prefix(arg,"heal")) { spell = spell_heal; sn = skill_lookup("heal"); words = "pzar"; cost = 5000; } else if (!str_prefix(arg,"blindness")) { spell = spell_cure_blindness; sn = skill_lookup("cure blindness"); words = "judicandus noselacri"; cost = 2000; } else if (!str_prefix(arg,"disease")) { spell = spell_cure_disease; sn = skill_lookup("cure disease"); words = "judicandus eugzagz"; cost = 1500; } else if (!str_prefix(arg,"poison")) { spell = spell_cure_poison; sn = skill_lookup("cure poison"); words = "judicandus sausabru"; cost = 2500; } else if (!str_prefix(arg,"uncurse") || !str_prefix(arg,"curse")) { spell = spell_remove_curse; sn = skill_lookup("remove curse"); words = "candussido judifgz"; cost = 5000; } else if (!str_prefix(arg,"mana") || !str_prefix(arg,"energize")) { spell = NULL; sn = -1; words = "energizer"; cost = 1000; } else if (!str_prefix(arg,"refresh") || !str_prefix(arg,"moves")) { spell = spell_refresh; sn = skill_lookup("refresh"); words = "candusima"; cost = 500; } else { act("$N says 'Type 'heal' for a list of spells.'", ch,NULL,mob,TO_CHAR); return; } if (cost > (ch->gold * 100 + ch->silver)) { act("$N says 'You do not have enough gold for my services.'", ch,NULL,mob,TO_CHAR); return; } WAIT_STATE(ch,PULSE_VIOLENCE); deduct_cost(ch,cost); mob->gold += cost / 100; mob->silver += cost % 100; act("$n utters the words '$T'.",mob,NULL,words,TO_ROOM); if (spell == NULL) /* restore mana trap...kinda hackish */ { ch->mana += dice(2,8) + mob->level / 3; ch->mana = UMIN(ch->mana,ch->max_mana); send_to_char("A warm glow passes through you.\n\r",ch); return; } if (sn == -1) return; spell(sn,mob->level,mob,ch,TARGET_CHAR); }
void do_heal(CHAR_DATA *ch, char *argument) { CHAR_DATA *mob; char arg[MAX_INPUT_LENGTH]; int cost,sn; SPELL_FUN *spell; char *words; /* check for healer */ for ( mob = ch->in_room->people; mob; mob = mob->next_in_room ) { if ( IS_NPC(mob) && IS_SET(mob->act, ACT_IS_HEALER) ) break; } if ( mob == NULL ) { send_to_char( "You can't do that here.\n\r", ch ); return; } one_argument(argument,arg); if (arg[0] == '\0') { /* display price list */ act("\n\r{Y$N {Ysays 'I offer the following spells{Y'{x",ch,NULL,mob,TO_CHAR); send_to_char("\n\r{g****************************************{x\n\r",ch); send_to_char(" {CLIGHT{w: {cCure Light Wounds {W10 {Ygold{x\n\r",ch); send_to_char(" {CSERIOUS{w: {cCure Serious Wounds {W15 {Ygold{x\n\r",ch); send_to_char(" {CCRITIC{w: {cCure Critical Wounds {W25 {Ygold{x\n\r",ch); send_to_char(" {CHEAL{w: {cHealing Spell {W50 {Ygold{x\n\r",ch); send_to_char(" {CBLIND{w: {cCure Blindness {W20 {Ygold{x\n\r",ch); send_to_char(" {CDISE{w: {cCure Disease {W15 {Ygold{x\n\r",ch); send_to_char(" {CPOISON{w: {cCure Poison {W25 {Ygold{x\n\r",ch); send_to_char(" {CUNCURSE{w: {cRemove Curse {W50 {Ygold{x\n\r",ch); send_to_char(" {CREFRESH{w: {cRestore Movement {W5 {Ygold{x\n\r",ch); send_to_char(" {CMANA{w: {cRestore Mana {W10 {Ygold{x\n\r",ch); send_to_char("\n\r{g****************************************{x\n\r",ch); send_to_char(" {GType{w: {WHEAL {c<{WTYPE{c> for the service you want.{x\n\r\n\r",ch); return; } if (!str_prefix(arg,"light")) { spell = spell_cure_light; sn = skill_lookup("cure light"); words = "judicandus dies"; cost = 1000; } else if (!str_prefix(arg,"serious")) { spell = spell_cure_serious; sn = skill_lookup("cure serious"); words = "judicandus gzfuajg"; cost = 1600; } else if (!str_prefix(arg,"critical")) { spell = spell_cure_critical; sn = skill_lookup("cure critical"); words = "judicandus qfuhuqar"; cost = 2500; } else if (!str_prefix(arg,"heal")) { spell = spell_heal; sn = skill_lookup("heal"); words = "pzar"; cost = 5000; } else if (!str_prefix(arg,"blindness")) { spell = spell_cure_blindness; sn = skill_lookup("cure blindness"); words = "judicandus noselacri"; cost = 2000; } else if (!str_prefix(arg,"disease")) { spell = spell_cure_disease; sn = skill_lookup("cure disease"); words = "judicandus eugzagz"; cost = 1500; } else if (!str_prefix(arg,"poison")) { spell = spell_cure_poison; sn = skill_lookup("cure poison"); words = "judicandus sausabru"; cost = 2500; } else if (!str_prefix(arg,"uncurse") || !str_prefix(arg,"curse")) { spell = spell_remove_curse; sn = skill_lookup("remove curse"); words = "candussido judifgz"; cost = 5000; } else if (!str_prefix(arg,"mana") || !str_prefix(arg,"energize")) { spell = NULL; sn = -1; words = "energizer"; cost = 1000; } else if (!str_prefix(arg,"refresh") || !str_prefix(arg,"moves")) { spell = spell_refresh; sn = skill_lookup("refresh"); words = "candusima"; cost = 500; } else { act("$N says 'Type 'heal' for a list of spells.'", ch,NULL,mob,TO_CHAR); return; } if (cost > (ch->gold * 100 + ch->silver)) { act("$N says 'You do not have enough gold for my services.'", ch,NULL,mob,TO_CHAR); return; } WAIT_STATE(ch,PULSE_VIOLENCE); deduct_cost(ch,cost); mob->gold += cost / 100; mob->silver += cost % 100; act("$n utters the words '$T'.",mob,NULL,words,TO_ROOM); if (spell == NULL) /* restore mana trap...kinda hackish */ { ch->mana += dice(2,8) + mob->level / 3; ch->mana = UMIN(ch->mana,ch->max_mana); send_to_char("A warm glow passes through you.\n\r",ch); return; } if (sn == -1) return; spell(sn,mob->level,mob,ch,TARGET_CHAR); }
/* * Procedure which allows a player to purchase a portal from a mob. The mob must be * set as act portalmerchant. There is a base cost in the portal_shop_table and those * prices will be altered here based on the desination (e.g. it will cost more to create * a portal across continents than it will to travel inter-continent. This procedure * will be called from do_list and do_buy to make it function like a normal shop. */ void process_portal_merchant(CHAR_DATA * ch, char *argument) { int x = 0; char buf[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH]; bool found = FALSE; CHAR_DATA *mob; OBJ_DATA *portal; int cost = 0; int roll = 0; if ((mob = find_mob_by_act(ch, ACT_IS_PORTAL_MERCHANT)) == NULL) { send_to_char("You must find a portal merchant in order to purchase a portal.\r\n", ch); return; } // Not with people that can't be seen.. this will depend on the mob.. if the mob has detect hidden // or detect invis they will see most people unless they are in another for of non-detect, etc. if (!can_see(mob, ch)) { act("{x$N says '{gI don't trade with folks I can't see, please make yourself 'visible'.{x", ch, NULL, mob, TO_CHAR); return; } // No argument was sent, send them the list of destinations. if (IS_NULLSTR(argument)) { act("{x$N says '{gI offer the creation of portals to following destinations.{x'\r\n", ch, NULL, mob, TO_CHAR); // Loop through the destinations for display for (x = 0; portal_shop_table[x].name != NULL; x++) { int temp_cost = 0; if (same_continent(ch->in_room->vnum, portal_shop_table[x].to_vnum)) { // They're in the same continent, normal cost (converted to gold). temp_cost = portal_shop_table[x].cost / 100; } else { // They are in different continents, double the cost (converted to gold). temp_cost = (portal_shop_table[x].cost / 100) * 2; } // To get the : into the formatted string sprintf(buf2, "{_%s{x:", portal_shop_table[x].name); sprintf(buf, " %-17s{x {c%-40s{x %d gold\r\n", buf2, get_room_name(portal_shop_table[x].to_vnum), temp_cost); send_to_char(buf, ch); } send_to_char("\r\nType buy <location> to purchase a portal to that destination.\r\n", ch); return; } // Did the user select a valid input? for (x = 0; portal_shop_table[x].name != NULL; x++) { if (!str_prefix(argument, portal_shop_table[x].name)) { if (same_continent(ch->in_room->vnum, portal_shop_table[x].to_vnum)) { // They're in the same continent, normal cost (the raw cost). cost = portal_shop_table[x].cost; } else { // They are in different continents, double the cost (the raw cost) cost = (portal_shop_table[x].cost) * 2; } found = TRUE; break; } } // What the location found? if (!found) { act("{x$N says '{gThat is not a place that I know of.{x", ch, NULL, mob, TO_CHAR); return; } // Do they have enough money? if (cost > (ch->gold * 100 + ch->silver)) { act("{x$N says '{gYou do not have enough gold for my services.{x'", ch, NULL, mob, TO_CHAR); return; } // Can the player haggle, if successful, adjust the price down? roll = number_percent(); if (roll < get_skill(ch, gsn_haggle)) { cost -= cost / 2 * roll / 100; sprintf(buf, "You haggle the price down to %d coins.\r\n", cost); send_to_char(buf, ch); check_improve(ch, gsn_haggle, TRUE, 4); } else { check_improve(ch, gsn_haggle, FALSE, 2); } // Slight purchase lag, same as buy. WAIT_STATE(ch, PULSE_VIOLENCE); // Deduct the money. deduct_cost(ch, cost); portal = create_object(get_obj_index(OBJ_VNUM_PORTAL)); portal->timer = 2; // 2 ticks. portal->value[3] = portal_shop_table[x].to_vnum; // Alter the keywords for the portal to include the destination to make the portals easier to use // than the enter 3.portal syntax (if there are multiples in the room) sprintf(buf, "portal gate %s", portal_shop_table[x].name); free_string(portal->name); portal->name = str_dup(buf); // Alter the portal's description to the room, we'll presume we know where these are going. sprintf(buf, "A shimmering black gate rises from the ground, leading to %s.", get_area_name(portal_shop_table[x].to_vnum)); free_string(portal->description); portal->description = str_dup(buf); // Put said object in said room. obj_to_room(portal, ch->in_room); act("$N raises $s hand and begans chanting.", ch, NULL, mob, TO_CHAR); act("$p rises up from the ground.", ch, portal, NULL, TO_ALL); } // end do_portal
/* * Duplicates a piece of parchment for a cost at a scribe. */ void do_duplicate(CHAR_DATA *ch, char *argument) { CHAR_DATA *mob; OBJ_DATA *obj; OBJ_DATA *clone_obj; int cost = 1000; // 10 gold if ((mob = find_mob_by_act(ch, ACT_SCRIBE)) == NULL) { send_to_char("You must find a scribe in order to duplicate pieces of parchment.\r\n", ch); return; } // Not with people that can't be seen.. this will depend on the mob.. if the mob has detect hidden // or detect invis they will see most people unless they are in another for of non-detect, etc. if (!can_see(mob, ch)) { act("{x$N says '{gI don't trade with folks I can't see, please make yourself 'visible'.'{x", ch, NULL, mob, TO_CHAR); return; } // No argument was sent, tell them how much it costs if (IS_NULLSTR(argument)) { act("{x$N says '{gI will duplicate a parchment for 10 gold pieces.{x'", ch, NULL, mob, TO_CHAR); act("{x$N says '{gYou may ask me to 'duplicate' a specific parchment in your possession.{x'", ch, NULL, mob, TO_CHAR); return; } if (cost > (ch->gold * 100 + ch->silver)) { act("{x$N says '{gI apologize, but you do not appear to have enough wealth for my services.'{x", ch, NULL, mob, TO_CHAR); return; } if ((obj = get_obj_carry(ch, argument, ch)) == NULL) { act("{x$N says '{gI do not see that you have that item.'{x", ch, NULL, mob, TO_CHAR); return; } // Make sure the item is a piece of parchment. if (obj->item_type != ITEM_PARCHMENT) { act("{x$N says '{gThat is not a piece of parchment.'{x", ch, NULL, mob, TO_CHAR); return; } // Only copy the parchment if it has been written to. if (obj->value[1] == FALSE) { act("{x$N says '{gThat parchment has not been written to yet, please provide one that has.'{x", ch, NULL, mob, TO_CHAR); return; } // Deduct the cost and then clone the parchment. deduct_cost(ch, cost); mob->gold += cost / 100; mob->silver += cost % 100; clone_obj = create_object(obj->pIndexData); clone_object(obj, clone_obj); obj_to_char(clone_obj, ch); act("$N dips his quill in ink and begins writing on a piece of parchment.", ch, NULL, mob, TO_ROOM); act("$N hands you parchment with the identical text of your original.", ch, NULL, mob, TO_CHAR); // A little lag WAIT_STATE(ch, PULSE_VIOLENCE); }
void do_repent(CHAR_DATA *ch, char *argument) { CHAR_DATA *mob; char arg[MAX_INPUT_LENGTH]; int cost,sn; SPELL_FUN *spell; char *words; /* check for priest */ for ( mob = ch->in_room->people; mob; mob = mob->next_in_room ) { if ( IS_NPC(mob) && IS_SET(mob->act, ACT_IS_PRIEST) ) break; } if ( mob == NULL ) { send_to_char( "You can't do that here.\n\r", ch ); return; } one_argument(argument,arg); if (arg[0] == '\0') { /* display price list */ act("$N says '{aI offer the following services:{x'",ch,NULL,mob,TO_CHAR); send_to_char(" align: Wardrof's forgiveness 20 gold\n\r",ch); send_to_char(" bless: Wardrof's blessing 20 gold\n\r",ch); send_to_char(" sanctuary: Wardrof's protection 35 gold\n\r",ch); send_to_char(" voodoo: Remove voodoo curses 1 platinum\n\r",ch); send_to_char(" Type repent <type> to be forgiven.\n\r",ch); return; } if (!str_prefix(arg,"bless")) { spell = spell_bless; sn = skill_lookup("bless"); words = "judicandus amin"; cost = 2000; } else if (!str_prefix(arg,"sanctuary")) { spell = spell_sanctuary; sn = skill_lookup("sanctuary"); words = "judicandus unam"; cost = 3500; } else if (!str_prefix(arg,"align")) { spell = NULL; sn = -1; words = "judicandus wardrof"; cost = 2000; } else if (!str_prefix(arg,"voodoo")) { spell = NULL; sn = -1; words = "judicandus mojo"; cost = 10000; } else { act("$N says '{aType 'repent' for a list of spells.{x'", ch,NULL,mob,TO_CHAR); return; } if (cost > ((ch->platinum * 10000) + (ch->gold * 100) + ch->silver)) { act("$N says '{aYou do not have enough gold for my services.{x'", ch,NULL,mob,TO_CHAR); return; } if (spell != NULL && ch->alignment < 0) { act("$N says '{aWardrof does not protect the evil at heart!{x'", ch,NULL,mob,TO_CHAR); return; } WAIT_STATE(ch,PULSE_VIOLENCE); if (!str_prefix(arg,"voodoo")) { if (remove_voodoo(ch)) { deduct_cost(ch,cost,VALUE_SILVER); act("$n utters the words '{a$T{x'.",mob,NULL,words,TO_ROOM); act("$n tells you '{aThe voodoo curses on you will soon be destroyed.{x'",mob,NULL,ch,TO_VICT); return; } deduct_cost(ch,cost/5,VALUE_SILVER); act("$n utters the words '{a$T{x'.",mob,NULL,words,TO_ROOM); act("$n tells you '{aI couldn't find any voodoo dolls with your name.{x'",mob,NULL,ch,TO_VICT); return; } deduct_cost(ch,cost,VALUE_SILVER); act("$n utters the words '{a$T{x'.",mob,NULL,words,TO_ROOM); if (spell == NULL) /* Increase alignment toward good */ { ch->alignment += 200; ch->alignment = UMIN(ch->alignment, 1000); if ( ch->pet != NULL ) ch->pet->alignment = ch->alignment; send_to_char("You feel Firehed's anger toward your actions!\n\r",ch); return; } if (sn == -1) return; spell(sn,mob->level,mob,ch,TARGET_CHAR); }