legpwrs.c
demise/src/legpwrs.c · 19.1 KB
From the archive dodbackup-final.tar.gz
Download the archive « Back to the archive contents
#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#endif
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "merc.h"
void
do_ltravel (CHAR_DATA * ch, char *argument)
{
char buf[MSL];
char arg[MIL];
CHAR_DATA *location;
CHAR_DATA *mount;
one_argument (argument, arg);
if (ch->in_room == NULL || ch->in_room->area->plane != PLANE_PAND)
{
do_huh (ch, "");
return;
}
if (ch->lstatus < 2)
{
send_to_char ("You need 2 legend status to do that!\n\r", ch);
return;
}
if (has_fighttimer (ch))
return;
if (arg[0] == '\0')
{
send_to_char ("Travel where?\n\r", ch);
return;
}
if ((location = find_char_mud (ch, arg)) == NULL
|| IS_XXX (location, XXX_SE))
{
send_to_char ("They are not here.\n\r", ch);
return;
}
if (!IS_IMMORTAL (ch) && IS_NPC (location) && ch->pcdata->ticket < 1)
{
send_to_char ("You don't have any tickets.\n\r", ch);
return;
}
if (!IS_NPC (location))
{
if (location->in_room == NULL
|| location->in_room->area != ch->in_room->area)
{
stc ("They are not here.\n\r", ch);
return;
}
}
if (location->in_room == NULL
|| location->in_room->area->plane != ch->in_room->area->plane)
{
stc ("Somehow they are on the wrong plane.\n\r", ch);
return;
}
if (location->in_room == ch->in_room)
{
send_to_char ("Nothing happens.\n\r", ch);
return;
}
if (IS_NPC (location) && !IS_IMMORTAL (ch) && ch->pcdata->ticket > 0)
ch->pcdata->ticket--;
if (number_percent () >= 85)
{
stc ("You failed.\n\r", ch);
char_from_room (ch);
char_to_room (ch, get_room_index (number_range (45701, 45800)));
do_look (ch, "auto");
return;
}
if (is_inarena (location))
return;
if (is_inarena (ch))
return;
if (travelsafe (ch, location))
return;
if (ch == location)
{
send_to_char ("Yeah, that would make much sense!\n\r", ch);
return;
}
if (!IS_NPC (location) && IS_SET (location->evenmore, EM_JAILED))
{
send_to_char ("What??? You wish to go to jail too?\n\r", ch);
return;
}
if (IS_IMMORTAL (location))
{
stc ("Yes that's about to happen.\n\r", ch);
sprintf (buf, "%s just tried to step to you.\n\r", ch->name);
stc (buf, location);
return;
}
act ("$n chants some legend words, and vanishes.", ch, NULL, NULL, TO_ROOM);
act ("You chant some legendery words, and vanish.", ch, NULL, NULL,
TO_CHAR);
char_from_room (ch);
char_to_room (ch, get_room_index (location->in_room->vnum));
act ("You hear some legend words being chanted, and $n appears.", ch, NULL,
NULL, TO_ROOM);
do_look (ch, "auto");
if ((mount = ch->mount) == NULL)
return;
char_from_room (mount);
char_to_room (mount, ch->in_room);
do_look (mount, "auto");
return;
}
void
do_mastery (CHAR_DATA * ch, char *argument)
{
OBJ_DATA *obj;
char buf[MSL];
char cls[MSL];
if (IS_NPC (ch))
return;
if (!IS_IMMORTAL (ch) && IS_SET (ch->evenmore, EM_CREATED))
{
send_to_char ("But you already created your mastery!\n\r", ch);
return;
}
if (ch->class == 0)
{
send_to_char ("You need to be classed first!\n\r", ch);
return;
}
if (!IS_RNPC (ch))
{
if (ch->lstatus < 9)
{
stc ("You need full legend before you can attain mastery.\n\r", ch);
return;
}
if (!IS_HL (ch) && !IS_MONK (ch) && !IS_DRAC_WARRIOR (ch))
{
if (ch->wpn[0] < 200 || ch->wpn[1] < 200 || ch->wpn[2] < 200
|| ch->wpn[3] < 200 || ch->wpn[4] < 200 || ch->wpn[5] < 200
|| ch->wpn[6] < 200 || ch->wpn[7] < 200 || ch->wpn[8] < 200
|| ch->wpn[9] < 200 || ch->wpn[10] < 200 || ch->wpn[11] < 200
|| ch->wpn[12] < 200)
{
send_to_char
("Maybe you should grand master your weapons first.\n\r", ch);
return;
}
}
if (IS_MONK (ch))
{
if (ch->wpn[0] < 800 || ch->wpn[1] < 400 || ch->wpn[2] < 400
|| ch->wpn[3] < 400 || ch->wpn[4] < 400 || ch->wpn[5] < 400
|| ch->wpn[6] < 400 || ch->wpn[7] < 400 || ch->wpn[8] < 400
|| ch->wpn[9] < 400 || ch->wpn[10] < 400 || ch->wpn[11] < 400
|| ch->wpn[12] < 400)
{
send_to_char
("Maybe you should train all your weapons to max first.\n\r",
ch);
return;
}
}
if (IS_DRAC_WARRIOR (ch))
{
if (ch->wpn[0] < 300 || ch->wpn[1] < 300 || ch->wpn[2] < 300
|| ch->wpn[3] < 300 || ch->wpn[4] < 300 || ch->wpn[5] < 300
|| ch->wpn[6] < 300 || ch->wpn[7] < 300 || ch->wpn[8] < 300
|| ch->wpn[9] < 300 || ch->wpn[10] < 300 || ch->wpn[11] < 300
|| ch->wpn[12] < 300)
{
send_to_char
("Maybe you should be fantastically skilled first.\n\r", ch);
return;
}
}
if (IS_HL (ch) && !IS_WM (ch))
{
if (ch->wpn[0] < 500 || ch->wpn[1] < 1000 || ch->wpn[2] < 500
|| ch->wpn[3] < 500 || ch->wpn[4] < 500 || ch->wpn[5] < 500
|| ch->wpn[6] < 500 || ch->wpn[7] < 500 || ch->wpn[8] < 500
|| ch->wpn[9] < 500 || ch->wpn[10] < 500 || ch->wpn[11] < 500
|| ch->wpn[12] < 500)
{
send_to_char
("Maybe you should train all weapons to max first.\n\r", ch);
return;
}
}
if (IS_WM (ch))
{
if (ch->wpn[0] < 600 || ch->wpn[1] < 1200 || ch->wpn[2] < 600
|| ch->wpn[3] < 600 || ch->wpn[4] < 600 || ch->wpn[5] < 600
|| ch->wpn[6] < 600 || ch->wpn[7] < 600 || ch->wpn[8] < 600
|| ch->wpn[9] < 600 || ch->wpn[10] < 600 || ch->wpn[11] < 600
|| ch->wpn[12] < 600)
{
send_to_char
("Maybe you should train all weapons to max first.\n\r", ch);
return;
}
}
if (!IS_MAGE (ch) && !IS_DRAC_MAGE (ch))
{
if (ch->spl[0] < 200 || ch->spl[1] < 200 || ch->spl[2] < 200
|| ch->spl[3] < 200 || ch->spl[4] < 200)
{
send_to_char
("Maybe you should be a grand sorcerer in all spell colors first.\n\r",
ch);
return;
}
}
else if (IS_DRAC_MAGE (ch))
{
if (ch->spl[0] < 360 || ch->spl[1] < 360 || ch->spl[2] < 360
|| ch->spl[3] < 360 || ch->spl[4] < 360)
{
send_to_char
("Maybe you should max all your spell colors first.\n\r", ch);
return;
}
}
else
{
if (ch->spl[0] < 400 || ch->spl[1] < 400 || ch->spl[2] < 400
|| ch->spl[3] < 400 || ch->spl[4] < 400)
{
send_to_char
("Maybe you should be a supreme master in all spell colors first.\n\r",
ch);
return;
}
}
if (ch->stance[1] < 200 || ch->stance[2] < 200 || ch->stance[3] < 200
|| ch->stance[4] < 200 || ch->stance[5] < 200 || ch->stance[6] < 200
|| ch->stance[7] < 200 || ch->stance[8] < 200 || ch->stance[9] < 200
|| ch->stance[10] < 200 || ch->stance[11] < 200
|| ch->stance[12] < 200 || ch->stance[13] < 200
|| ch->stance[14] < 200 || ch->stance[15] < 200)
{
send_to_char
("Maybe you should grandmaster your stances first.\n\r", ch);
return;
}
}
if (ch->class == CLASS_ABOMINATION)
sprintf (cls, "#gAbo#Gm#ri#Rn#ra#Gt#gion#n");
else if (ch->class == CLASS_BLACK_SPIRAL_DANCER)
sprintf (cls, "#0Black #gSp#yir#gal#o Dancer#n");
else if (ch->class == CLASS_LICH)
sprintf (cls, "#cP#Cs#7ion#Ci#cc#n");
else if (ch->class == CLASS_GYPSY)
sprintf (cls, "#CG#0yps#Cy#n");
else if (ch->class == CLASS_NEPHANDI)
sprintf (cls, "#0Ne#op#yha#on#0di#n");
else if (ch->class == CLASS_SKINDANCER)
sprintf (cls, "#pS#ck#pi#cn#pd#ca#pn#cc#pe#cr#n");
else if (ch->class == CLASS_MAGE)
sprintf (cls, "#CMage#n");
else if (ch->class == CLASS_WEREWOLF)
sprintf (cls, "#GWerewolf#n");
else if (ch->class == CLASS_DEMON)
sprintf (cls, "#yDemon#n");
else if (ch->class == CLASS_NINJA)
sprintf (cls, "#gNinja#n");
else if (ch->class == CLASS_VAMPIRE)
sprintf (cls, "#RVampire#n");
else if (ch->class == CLASS_DRAGON)
sprintf (cls, "#0Dragon#n");
else if (ch->class == CLASS_DRACONIAN)
sprintf (cls, "%s#g Draconian#n%s",
dcolor[ch->pcdata->dpowers[DRAGON_COLOR]], get_dprof (ch));
else if (ch->class == CLASS_KAHN)
sprintf (cls, "#pKahn#n");
else if (ch->class == CLASS_HIGHLANDER)
sprintf (cls, "#CHighlander#n");
else if (ch->class == CLASS_WEAPONMASTER)
sprintf (cls, "#oKensai#n");
else if (ch->class == CLASS_DJINN)
sprintf (cls, "#PD#pj#Pi#pn#Pn#n");
else if (ch->class == CLASS_MONK)
sprintf (cls, "#oMonk#n");
else if (ch->class == CLASS_ANGELW)
sprintf (cls, "#yA#7nge#yl#n");
else if (IS_COR (ch, COR_HYBRID))
sprintf (cls, "%s", get_bridclan (ch));
else
sprintf (cls, "#7%s#n", get_class (ch));
obj = create_object (get_obj_index (OBJ_VNUM_PROTOPLASM), 50);
obj->value[0] = 750;
obj->value[1] = 1000;
obj->item_type = ITEM_MASTERY;
SET_BIT (obj->spectype, SITEM_MASTERY);
if (!IS_SET (ch->evenmore, EM_CREATED))
{
SET_BIT (ch->evenmore, EM_CREATED);
}
obj_to_char (obj, ch);
free_string (obj->questowner);
obj->questowner = str_dup (ch->name);
free_string (obj->creator);
sprintf (buf, "%s %s mastery", ch->name, get_class (ch));
obj->creator = str_dup (buf);
free_string (obj->name);
sprintf (buf, "%s mastery", get_class (ch));
obj->name = str_dup (buf);
free_string (obj->short_descr);
sprintf (buf, "%s #CMa#cste#Cry#n", cls);
obj->short_descr = str_dup (buf);
free_string (obj->description);
sprintf (buf, "A %s mastery piece lies on the floor.", cls);
obj->description = str_dup (buf);
sprintf (buf, "#C%s#c has achieved Mastery!", ch->name);
do_info (ch, buf);
return;
}
void
do_legendeq (CHAR_DATA * ch, char *argument)
{
OBJ_INDEX_DATA *pObjIndex;
OBJ_DATA *obj;
char demon[20];
char buf[MSL];
char arg1[MIL];
char arg2[MIL];
int vnum = 0;
int cost = 2000;
int crycost = 20;
argument = one_argument (argument, arg1);
argument = one_argument (argument, arg2);
if (IS_NPC (ch))
return;
if (ch->lstatus < 4)
{
send_to_char ("You require 4 legendary status to use this.\n\r", ch);
return;
}
if (arg1[0] == '\0')
{
send_to_char ("Syntax: legendeq <armour>\n\r", ch);
send_to_char
("Armour can be one of: Ring Collar Plate Helmet Leggings Boots Gauntlets\n\r Sleeves Cape Belt Bracer Visor.\n\r",
ch);
return;
}
if (!str_cmp (arg1, "ring"))
vnum = 29700;
else if (!str_cmp (arg1, "collar"))
vnum = 29701;
else if (!str_cmp (arg1, "plate"))
vnum = 29702;
else if (!str_cmp (arg1, "helmet"))
vnum = 29703;
else if (!str_cmp (arg1, "leggings"))
vnum = 29704;
else if (!str_cmp (arg1, "boots"))
vnum = 29705;
else if (!str_cmp (arg1, "gauntlets"))
vnum = 29706;
else if (!str_cmp (arg1, "sleeves"))
vnum = 29707;
else if (!str_cmp (arg1, "cape"))
vnum = 29708;
else if (!str_cmp (arg1, "belt"))
vnum = 29709;
else if (!str_cmp (arg1, "bracer"))
vnum = 29711;
else if (!str_cmp (arg1, "visor"))
vnum = 29710;
else
{
do_legendeq (ch, "");
return;
}
if (IS_DEMON (ch))
{
if (arg2[0] == '\0')
{
stc
("As you are a Demon you can blend your Demonic powers into the creation of your legend armour.\n\rYou can chose from these colors: Black Grey Purple Red Brass",
ch);
if (IS_BSD (ch) && get_tribe (ch, TRIBE_BLACK_FURIES) > 6)
stc (", Bone", ch);
stc (".\n\r", ch);
stc ("Syntax: legendeq <piece> <color>.\n\r", ch);
return;
}
if (str_cmp (arg2, "black") && str_cmp (arg2, "red")
&& str_cmp (arg2, "grey") && str_cmp (arg2, "purple")
&& str_cmp (arg2, "brass"))
{
if (IS_BSD (ch) && get_tribe (ch, TRIBE_BLACK_FURIES) > 6)
{
if (str_cmp (arg2, "bone"))
{
do_legendeq (ch, "visor");
return;
}
}
else
{
do_legendeq (ch, "visor");
return;
}
}
if (ch->pcdata->power[0] < 5000 || ch->pcdata->power[1] < 5000)
{
stc
("It costs 5000 demon points to create some demonic legend equipment.\n\r",
ch);
return;
}
if (!str_cmp (arg2, "black"))
{
sprintf (demon, "#0B#nl#0a#nc#0k#n");
}
else if (!str_cmp (arg2, "red"))
{
sprintf (demon, "#RR#re#Rd#n");
cost += 750;
}
else if (!str_cmp (arg2, "grey"))
{
sprintf (demon, "#7G#nr#7e#ny#n");
cost += 100;
}
else if (!str_cmp (arg2, "purple"))
{
sprintf (demon, "#pP#ru#pr#rp#pl#re#n");
cost += 250;
}
else if (!str_cmp (arg2, "brass"))
{
sprintf (demon, "#oB#rr#oa#rs#os#n");
cost += 1500;
}
else if (!str_cmp (arg2, "bone"))
{
sprintf (demon, "#0Sk#re#7le#rt#0al#n");
cost += 3000;
}
else
{
stc
("Major bug in the color code for demonic legend equipment tell Corim.\n\r",
ch);
return;
}
if (ch->pcdata->crystal < crycost && ch->pcdata->quest < cost)
{
sprintf (buf,
"It costs %d credits and %d power crystals to create a piece of demonic legend armour.\n\r",
cost, crycost);
stc (buf, ch);
return;
}
else if (ch->pcdata->crystal < crycost)
{
send_to_char
("It costs 20 power crystals to create a piece of demonic legend armour.\n\r",
ch);
return;
}
else if (ch->pcdata->quest < cost)
{
sprintf (buf,
"It costs %d credits to create a piece of legend armour.\n\r",
cost);
stc (buf, ch);
return;
}
// else
// {
// send_to_char ("Major bug, please tell Corim.\n\r", ch);
// return;
// }
}
// }
else
{
if (ch->pcdata->quest < cost || ch->pcdata->crystal < crycost)
{
if (ch->pcdata->crystal < crycost && ch->pcdata->quest < cost)
{
send_to_char
("It costs 2000 credits and 20 power crystals to create a piece of legend armour.\n\r",
ch);
return;
}
else if (ch->pcdata->crystal < crycost)
{
send_to_char
("It costs 20 power crystals to create a piece of legend armour.\n\r",
ch);
return;
}
else if (ch->pcdata->quest < cost)
{
send_to_char
("It costs 2000 credits to create a piece of legend armour.\n\r",
ch);
return;
}
else
{
send_to_char ("Major bug, please tell Corim.\n\r", ch);
return;
}
}
}
if (vnum == 0 || (pObjIndex = get_obj_index (vnum)) == NULL)
{
send_to_char ("Missing object, please inform Corim.\n\r", ch);
return;
}
obj = create_object (pObjIndex, 50);
obj_to_char (obj, ch);
if (!IS_RNPC (ch))
ch->pcdata->quest -= cost;
if (!IS_RNPC (ch))
ch->pcdata->crystal -= crycost;
if (IS_DEMON (ch))
{
ch->pcdata->power[0] -= 5000;
if (!str_cmp (arg2, "grey"))
{
obj->points += 100;
obj->specpower = ARM_GREY;
}
if (!str_cmp (arg2, "purple"))
{
obj->points += 250;
obj->specpower = ARM_PURPLE;
}
if (!str_cmp (arg2, "red"))
{
obj->points += 750;
obj->specpower = ARM_RED;
}
if (!str_cmp (arg2, "brass"))
{
obj->points += 1500;
obj->specpower = ARM_BRASS;
}
if (!str_cmp (arg2, "bone"))
{
obj->points += 3000;
obj->specpower = ARM_BONE;
if (get_tribe (ch, TRIBE_BLACK_FURIES) > 7)
{
add_affect (obj, APPLY_DAMCAP, 30);
add_affect (obj, APPLY_DAMROLL, 40);
add_affect (obj, APPLY_HITROLL, 40);
add_affect (obj, APPLY_HIT, 500);
}
}
SET_BIT (obj->spectype, SITEM_DEMONIC);
SET_BIT (obj->extra_flags, ITEM_ANTI_GOOD);
sprintf (buf, "demon %s %s", obj->name, arg2);
free_string (obj->name);
obj->name = str_dup (buf);
sprintf (buf,
"#ca %s #rDe#0m#Ro#0n#ric#o #op#0o#yw#oe#0r#yf#ou#0l #c%s#n",
demon, arg1);
free_string (obj->short_descr);
obj->short_descr = str_dup (buf);
sprintf (buf,
"#ca %s #rDe#0m#Ro#0n#ric#o #op#0o#yw#oe#0r#yf#ou#0l #c%s#n",
demon, arg1);
free_string (obj->description);
obj->description = str_dup (buf);
}
free_string (obj->questmaker);
obj->questmaker = str_dup (ch->name);
free_string (obj->creator);
sprintf (buf, "%s (LegendEq)", ch->name);
obj->questmaker = str_dup (buf);
free_string (obj->questowner);
obj->questowner = str_dup (ch->name);
SET_BIT (obj->spectype, SITEM_LEGEND);
SET_BIT (obj->quest, QUEST_RELIC);
obj->condition = 100;
obj->toughness = 100;
obj->resistance = 1;
obj->value[0] = 40;
act ("$p appears in your hands in a blast of light.", ch, obj, NULL,
TO_CHAR);
act ("$p appears in $n's hands in a blast of light.", ch, obj, NULL,
TO_ROOM);
return;
}
void
do_resweep (CHAR_DATA * ch, char *argument)
{
char arg1[MIL];
char arg2[MIL];
char buf[MSL];
OBJ_DATA *obj;
int color;
smash_tilde (argument);
argument = one_argument (argument, arg1);
argument = one_argument (argument, arg2);
if (IS_NPC (ch))
return;
if (!IS_MAGE (ch))
{
send_to_char ("Huh?\n\r", ch);
return;
}
if (arg1[0] == '\0' || arg2[0] == '\0')
{
send_to_char
("Syntax: Resweep <page> <red/yellow/green/blue/purple>.\n\r", ch);
return;
}
if (ch->pcdata->quest < 50 && ch->exp < 500000)
{
send_to_char ("You need 50 credits and 500k exp to resweep a page.\n\r",
ch);
return;
}
if ((obj = get_obj_carry (ch, arg1)) == NULL)
{
send_to_char ("You are not carrying that item.\n\r", ch);
return;
}
if (obj->item_type != ITEM_PAGE && obj->item_type != ITEM_BOOK)
{
send_to_char ("You cannot resweep that.\n\r", ch);
return;
}
if (!str_cmp (arg2, "red"))
color = RED_MAGIC;
else if (!str_cmp (arg2, "green"))
color = GREEN_MAGIC;
else if (!str_cmp (arg2, "yellow"))
color = YELLOW_MAGIC;
else if (!str_cmp (arg2, "blue"))
color = BLUE_MAGIC;
else if (!str_cmp (arg2, "purple"))
color = PURPLE_MAGIC;
else
{
send_to_char
("Choose between red, green, yellow, blue and purple dufus!\n\r", ch);
return;
}
obj->toughness = color;
ch->exp -= 500000;
ch->pcdata->quest -= 50;
act ("$n resweeps the on $p and it glows for a moment.", ch, obj, NULL,
TO_ROOM);
send_to_char ("Ok.\n\r", ch);
return;
}
void do_guildrecall (CHAR_DATA *ch, char *argument)
{
if (ch->lstatus < 7) {
do_huh (ch, "");
return;
}
ROOM_INDEX_DATA *location;
location = get_room_index (3002);
if (ch->in_room == location)
return;
if (has_fighttimer (ch))
return;
if (ch->in_room->area->plane != location->area->plane && !IS_IMMORTAL (ch))
location = get_room_index (plane_hub (ch->in_room->area->plane));
if (IS_SET (ch->in_room->room_flags, ROOM_NO_RECALL)
|| IS_AFFECTED (ch, AFF_CURSE))
{
send_to_char ("You are unable to recall to your haven.\n\r", ch);
return;
}
if (is_inarena (ch))
return;
act ("A look of concentration crosses $n's face.", ch, NULL, NULL, TO_ROOM);
act ("A group of assassin comes, blindfolds $n, then leads $m away.", ch, NULL, NULL, TO_ROOM);
act ("A group of assassin comes, blindfolds you, then leads you away.", ch, NULL, NULL, TO_CHAR);
char_from_room (ch);
char_to_room (ch, location);
act ("A group of assassins remove your blindfold, and you are in a totally different place.", ch, NULL, NULL, TO_CHAR);
act ("A group of assassins removes $n's blindfold, and $e are in a totally different place.", ch, NULL, NULL, TO_ROOM);
do_look (ch, "auto");
return;
}