highlander.c
demise/src/highlander.c · 8.9 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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "merc.h"
void
do_katana (CHAR_DATA * ch, char *argument)
{
OBJ_INDEX_DATA *pObjIndex;
AFFECT_DATA *paf;
OBJ_DATA *obj;
char buf[MSL];
int vnum = 0;
bool mastery = FALSE;
if (IS_NPC (ch))
return;
if (!IS_CREATOR (ch))
{
if (!IS_HL (ch))
{
do_huh (ch, "");
return;
}
if (ch->level < 12 && ch->practice < 200)
{
send_to_char ("You require 200 primal for this.\n\r", ch);
return;
}
}
vnum = 29695;
if (vnum == 0 || (pObjIndex = get_obj_index (vnum)) == NULL)
{
send_to_char ("Missing object, please inform an immortal.\n\r", ch);
return;
}
if (IS_SET (ch->evenmore, EM_CREATED))
{
mastery = TRUE;
}
obj = create_object (pObjIndex, 50);
obj->value[0] = 18000;
obj->value[1] = 265;
obj->value[2] = 305;
obj->condition = 100;
obj->toughness = 100;
obj->resistance = 1;
REMOVE_BIT (obj->spectype, SITEM_DEMONIC);
SET_BIT (obj->quest, QUEST_RELIC);
SET_BIT (obj->spectype, SITEM_HIGHLANDER);
SET_BIT (obj->spectype, SITEM_SILVER);
SET_BIT (obj->extra_flags, ITEM_TWOHAND);
if (mastery)
{
add_affect (obj, APPLY_HIT, (ch->wpn[1] * 2));
add_affect (obj, APPLY_MANA, (ch->wpn[1] * 2));
add_affect (obj, APPLY_MOVE, (ch->wpn[1] * 2));
}
add_affect (obj, APPLY_HITROLL, ((ch->wpn[1] + 200) / 3));
add_affect (obj, APPLY_DAMROLL, ((ch->wpn[1] + 200) / 3));
add_affect (obj, APPLY_DAMCAP, (ch->wpn[1] / 4));
sprintf (buf, "%s ancient katana", ch->name);
free_string (obj->name);
obj->name = str_dup (buf);
if (mastery)
{
sprintf (buf, "#0a #cm#Cas#7ter#Cfu#cl #yg#ole#yam#oin#yg#0 katana#n");
free_string (obj->short_descr);
obj->short_descr = str_dup (buf);
sprintf (buf, "A masterfully crafted katana belonging to %s is here.",
ch->name);
free_string (obj->description);
obj->description = str_dup (buf);
}
else
{
sprintf (buf, "#0a #yg#ole#yam#oin#yg#0 katana#n");
free_string (obj->short_descr);
obj->short_descr = str_dup (buf);
sprintf (buf, "A katana belonging to %s is here.", ch->name);
free_string (obj->description);
obj->description = str_dup (buf);
}
obj_to_char (obj, ch);
if (ch->level < 12)
ch->practice -= 200;
free_string (obj->questmaker);
obj->questmaker = str_dup (ch->name);
free_string (obj->questowner);
obj->questowner = str_dup (ch->name);
free_string (obj->creator);
sprintf (buf, "%s (Katana)", ch->name);
obj->creator = str_dup (buf);
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_awareness (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
return;
if (!IS_HL (ch))
{
send_to_char ("Huh?\n\r", ch);
return;
}
if (ch->wpn[1] < 125)
{
send_to_char ("You need 125 on slice first.\n\r", ch);
return;
}
if (IS_SET (ch->mflags, MAGE_PERCEPTION))
{
REMOVE_BIT (ch->mflags, MAGE_PERCEPTION);
REMOVE_BIT (ch->affected_by, AFF_SHADOWSIGHT);
REMOVE_BIT (ch->vampaff, VAM_NIGHTSIGHT);
REMOVE_BIT (ch->act, PLR_HOLYLIGHT);
send_to_char ("You become less aware of your surroundings.\n\r", ch);
return;
}
SET_BIT (ch->mflags, MAGE_PERCEPTION);
SET_BIT (ch->affected_by, AFF_SHADOWSIGHT);
SET_BIT (ch->vampaff, VAM_NIGHTSIGHT);
SET_BIT (ch->act, PLR_HOLYLIGHT);
send_to_char ("You become more aware of your surroundings.\n\r", ch);
return;
}
void
do_feelaura (CHAR_DATA * ch, char *argument)
{
CHAR_DATA *victim;
OBJ_DATA *obj;
char arg[MIL];
char buf[MIL];
int con_hit, con_dam, con_ac, con_hp, con_mana, con_move;
int con_str, con_int, con_dex, con_wis, con_con;
int con_max_hp, con_max_mana, con_max_move;
argument = one_argument (argument, arg);
if (IS_NPC (ch))
return;
if (!IS_HL (ch) && !IS_ITEMAFF (ch, ITEMA_VISION))
{
send_to_char ("Huh?\n\r", ch);
return;
}
if (!IS_QUICK (ch, QUICKENING_SENSE))
{
send_to_char ("You have yet to gain that power.\n\r", ch);
return;
}
if (arg[0] == '\0')
{
send_to_char ("Sense the aura on what?\n\r", ch);
return;
}
if ((victim = get_char_room (ch, arg)) == NULL)
{
if ((obj = get_obj_carry (ch, arg)) == NULL)
{
send_to_char ("Sense the aura on what?\n\r", ch);
return;
}
spell_identify (skill_lookup ("identify"), ch->level, ch, obj);
return;
}
if (!IS_NPC (victim) && IS_IMMUNE (victim, IMM_SHIELDED)
&& !IS_ITEMAFF (ch, ITEMA_VISION))
{
send_to_char ("You are unable to read their aura.\n\r", ch);
if (!IS_NPC (victim) && ch != victim && IS_MORE (victim, MORE_GUARDIAN))
{
guardian_message (victim);
act ("$n just failed to use Sense Aura on you.", ch, NULL, victim,
TO_VICT);
}
return;
}
act ("$n examines $N intently.", ch, NULL, victim, TO_NOTVICT);
act ("$n examines you intently.", ch, NULL, victim, TO_VICT);
if (!IS_NPC (victim) && IS_EXTRA (victim, EXTRA_FAKE_CON))
{
con_hit = victim->pcdata->fake_hit;
con_dam = victim->pcdata->fake_dam;
con_ac = victim->pcdata->fake_ac;
con_str = victim->pcdata->fake_stats[STAT_STR];
con_int = victim->pcdata->fake_stats[STAT_INT];
con_wis = victim->pcdata->fake_stats[STAT_WIS];
con_dex = victim->pcdata->fake_stats[STAT_DEX];
con_con = victim->pcdata->fake_stats[STAT_CON];
con_hp = victim->pcdata->fake_hp;
con_mana = victim->pcdata->fake_mana;
con_move = victim->pcdata->fake_move;
con_max_hp = victim->pcdata->fake_max_hp;
con_max_mana = victim->pcdata->fake_max_mana;
con_max_move = victim->pcdata->fake_max_move;
}
else
{
con_hit = char_hitroll (victim);
con_dam = char_damroll (victim);
con_ac = char_ac (victim);
con_str = get_curr_str (victim);
con_int = get_curr_int (victim);
con_wis = get_curr_wis (victim);
con_dex = get_curr_dex (victim);
con_con = get_curr_con (victim);
con_hp = victim->hit;
con_mana = victim->mana;
con_move = victim->move;
con_max_hp = victim->max_hit;
con_max_mana = victim->max_mana;
con_max_move = victim->max_move;
}
if (IS_NPC (victim))
sprintf (buf, "%s is an NPC.\n\r", victim->short_descr);
else
{
if (victim->level == 12)
sprintf (buf, "%s is an Implementor.\n\r", victim->name);
else if (victim->level == 11)
sprintf (buf, "%s is a High Judge.\n\r", victim->name);
else if (victim->level == 10)
sprintf (buf, "%s is a Judge.\n\r", victim->name);
else if (victim->level == 9)
sprintf (buf, "%s is an Enforcer.\n\r", victim->name);
else if (victim->level == 8)
sprintf (buf, "%s is a Quest Maker.\n\r", victim->name);
else if (victim->level == 7)
sprintf (buf, "%s is a Builder.\n\r", victim->name);
else if (victim->level >= 3)
sprintf (buf, "%s is an Avatar.\n\r", victim->name);
else
sprintf (buf, "%s is a Mortal.\n\r", victim->name);
}
send_to_char (buf, ch);
sprintf (buf, "Str: %d. Int: %d. Wis: %d. Dex: %d. Con: %d.\n\r",
con_str, con_int, con_wis, con_dex, con_con);
send_to_char (buf, ch);
if (IS_MAGE (victim))
{
sprintf (buf, "Hp: %d/%d, Mana: %d/%d, Vitality: %d/%d.\n\r",
con_hp, con_max_hp, con_mana, con_max_mana, con_move,
con_max_move);
}
else
{
sprintf (buf, "Hp: %d/%d, Vitality: %d/%d.\n\r",
con_hp, con_max_hp, con_move, con_max_move);
}
send_to_char (buf, ch);
sprintf (buf, "Hitroll: %d, Damroll: %d, AC: %d.\n\r",
con_hit, con_dam, con_ac);
send_to_char (buf, ch);
if (!IS_NPC (victim))
{
sprintf (buf, "Status: %d, ", victim->race);
send_to_char (buf, ch);
}
sprintf (buf, "Alignment: %d.\n\r", victim->alignment);
send_to_char (buf, ch);
if (!IS_NPC (victim) && IS_EXTRA (victim, EXTRA_PREGNANT))
act ("$N is pregnant.", ch, NULL, victim, TO_CHAR);
if (!IS_NPC (victim) && IS_VAMPIRE (victim)
&& victim->pcdata->diableries[DIAB_EVER] >= 5)
act ("$N's soul is permanently stained with multiple diablerie.", ch,
NULL, victim, TO_CHAR);
else if (!IS_NPC (victim) && IS_VAMPIRE (victim)
&& victim->pcdata->diableries[DIAB_TIME] > 0)
act ("$N has recently committed diablerie.", ch, NULL, victim, TO_CHAR);
if (!IS_NPC (victim) && IS_MORE (victim, MORE_INFORM))
{
if (ch->pcdata->lie == LIE_TRUE)
act ("$N has recently lied.", ch, NULL, victim, TO_CHAR);
else
act ("$N has recently spoken truthfully.", ch, NULL, victim, TO_CHAR);
}
if (!IS_NPC (victim) && ch != victim && IS_MORE (victim, MORE_GUARDIAN))
{
guardian_message (victim);
act ("$n just used Sense Aura on you.", ch, NULL, victim, TO_VICT);
}
return;
}