Skip to content

Commit

Permalink
Added the Knight of the Thorn class
Browse files Browse the repository at this point in the history
  areas command now shows zone number
  Added the ability for staff to set a custom 'clan title' in place of where mortals show their clan in the who list.
  Added 7 starting clans. If you wish to start a new clan, please speak to Gicker.
  Changed the who list to show only your clan (or 'Adventurer' if unclanned) and your title
  Fixed the title system, so you can put your name anywhere in the title.
  Fixed some issues trying to target players sometimes
  • Loading branch information
GickerLDS committed Apr 30, 2024
1 parent c08109f commit 4fd127e
Show file tree
Hide file tree
Showing 25 changed files with 748 additions and 36 deletions.
6 changes: 6 additions & 0 deletions act.h
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ ACMD_DECL(do_spells);
ACMD_DECL(do_split);
ACMD_DECL(do_steal);
ACMD_DECL(do_title);
ACMD_DECL(do_immtitle);
ACMD_DECL(do_train);
ACMD_DECL(do_visible);
ACMD_DECL(do_wildshape);
Expand Down Expand Up @@ -985,6 +986,11 @@ ACMD_DECL(do_award);
ACMD_DECL(do_show_blockers);
ACMD_DECL(do_save_objects_to_database);

ACMD_DECL(do_touch_spells);
ACMD_DECL(do_weapon_touch);
ACMD_DECL(do_foretell);
ACMD_DECL(do_prescience);

// encounters.c
ACMD_DECL(do_encounterinfo);
ACMD_DECL(do_encounter);
Expand Down
70 changes: 64 additions & 6 deletions act.informative.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,8 +932,10 @@ static void list_one_char(struct char_data *i, struct char_data *ch)
else
{
if (!GET_DISGUISE_RACE(i))
send_to_char(ch, "\tn[%s] %s%s%s", RACE_ABBR(i), i->player.name,
*GET_TITLE(i) ? " " : "", GET_TITLE(i));
send_to_char(ch, "\tn[%s] %s", RACE_ABBR(i),
// i->player.name, // This is before we switched to a title system containing the character's name
// *GET_TITLE(i) ? " " : "",
GET_TITLE(i));
else if (AFF_FLAGGED(i, AFF_WILD_SHAPE))
{
char *an_a, *race_name;
Expand Down Expand Up @@ -2063,6 +2065,8 @@ void perform_cooldowns(struct char_data *ch, struct char_data *k)
send_to_char(ch, "Mission Ready Cooldown - Duration: %d seconds\r\n", GET_MISSION_COOLDOWN(k) * 6);
if (GET_KAPAK_SALIVA_HEALING_COOLDOWN(k) > 0)
send_to_char(ch, "Kapak Saliva Healing - Duration: %d seconds\r\n", GET_KAPAK_SALIVA_HEALING_COOLDOWN(k) * 6);
if (ch->char_specials.terror_cooldown > 0)
send_to_char(ch, "Aura of Terror Immunity - Duration: %d seconds\r\n", ch->char_specials.terror_cooldown * 6);

send_to_char(ch, "\tC");
draw_line(ch, 80, '-', '-');
Expand Down Expand Up @@ -3812,7 +3816,10 @@ ACMD(do_who)
{
struct descriptor_data *d;
struct char_data *tch;
int i, num_can_see = 0, class_len = 0;
int i, num_can_see = 0;
#if !defined(CAMPAIGN_DL)
int class_len = 0;
#endif
char name_search[MAX_INPUT_LENGTH] = {'\0'}, buf[MAX_INPUT_LENGTH] = {'\0'}, classes_list[MAX_INPUT_LENGTH] = {'\0'};
char mode;
int low = 0, high = LVL_IMPL, localwho = 0, questwho = 0;
Expand All @@ -3822,6 +3829,9 @@ ACMD(do_who)
int mortals = 0, staff = 0;
clan_rnum c_n;
size_t len = 0;
char clan_name[50];
int length = 0;
int padding = 0;

char *account_names[CONFIG_MAX_PLAYING];
int num_accounts = 0, x = 0, y = 0;
Expand Down Expand Up @@ -4045,7 +4055,35 @@ ACMD(do_who)
continue;
if (showleader && (!GROUP(tch) || GROUP_LEADER(GROUP(tch)) != tch))
continue;

#if defined(CAMPAIGN_DL)
if (TRUE)
{
if (GET_LEVEL(tch) >= LVL_IMMORT)
snprintf(clan_name, sizeof(clan_name), "%s", GET_IMM_TITLE(tch));
else
snprintf(clan_name, sizeof(clan_name), "%s", ((c_n = real_clan(GET_CLAN(tch))) != NO_CLAN && GET_CLANRANK(tch) > 0) ? CLAN_NAME(c_n) : "Adventurer");
length = strlen(clan_name);
padding = 20 - length;

// Move characters to make room for padding at the front
for (x = length; x >= 0; x--)
{
clan_name[x + padding / 2] = clan_name[x];
}
// Append spaces at the front
for (x = 0; x < padding / 2; x++) {
clan_name[x] = ' ';
}
// Append spaces at the end
for (x = length + padding / 2; x < 20; x++) {
clan_name[x] = ' ';
}
if (padding % 2 != 0) {
// If padding is odd, add one more space at the end
clan_name[20] = ' ';
}
send_to_char(ch, "\tC[ %20.20s ]\tn %s", clan_name, GET_TITLE(tch));
#else
if (short_list)
{
/* changed this to force showing char real race */
Expand Down Expand Up @@ -4105,6 +4143,7 @@ ACMD(do_who)
send_to_char(ch, " %s[%s%s%s]%s", QBRED, QBYEL, clan_list[c_n].abrev ? CLAN_ABREV(c_n) : "Unknown", QBRED, QNRM);
}
}
#endif
if (GET_INVIS_LEV(tch))
send_to_char(ch, " (i%d)", GET_INVIS_LEV(tch));
else if (AFF_FLAGGED(tch, AFF_INVISIBLE))
Expand Down Expand Up @@ -5595,6 +5634,7 @@ ACMD(do_areas)
// float pop;
// clan_rnum ocr;
int num_areas = 0;
char zone_num[15];

char areas[300][LONG_STRING];

Expand Down Expand Up @@ -5722,9 +5762,10 @@ ACMD(do_areas)
tmp_len = snprintf(buf + len, sizeof(buf) - len, "\tn(%3d) %s%-*s\tn %s%s\tn\r\n", ++zcount, overlap ? QRED : QCYN,
count_color_chars(zone_table[i].name) + 40, zone_table[i].name,
lev_set ? "\tc" : "\tn", lev_set ? lev_str : "All Levels");
snprintf(areas[num_areas], sizeof(areas[num_areas]), "\tn %-*s\tn %s%s\tn\r\n",
snprintf(zone_num, sizeof(zone_num), " \tc[%3d]\tn ", zone_table[i].number);
snprintf(areas[num_areas], sizeof(areas[num_areas]), "\tn %-*s\tn %s%s%s\tn\r\n",
count_color_chars(zone_table[i].name) + 40, zone_table[i].name,
lev_set ? "\tc" : "\tn", lev_set ? lev_str : "All Levels");
zone_num, lev_set ? "\tc" : "\tn", lev_set ? lev_str : "All Levels");
num_areas++;
len += tmp_len;
}
Expand Down Expand Up @@ -5757,6 +5798,8 @@ ACMD(do_areas)
send_to_char(ch, "No areas found.\r\n");
else
{
send_to_char(ch, " %-40s %6s %s\r\n", "Area Name", "Number", "Level Range");
send_to_char(ch, " %-40s %5s %s\r\n", "---------", "------", "-----------");
int n, j;
char temp[LONG_STRING];
n = num_areas;
Expand Down Expand Up @@ -7067,6 +7110,21 @@ ACMD(do_flightlist)
#endif
}

ACMD(do_touch_spells)
{
int i;

send_to_char(ch, "List of touch spells:\r\n");

for (i = 0; i < NUM_SPELLS; i++)
{
if (spell_info[i].touch_spell)
{
send_to_char(ch, "-- %-25s (%s)\r\n", spell_info[i].name, spell_schools[spell_info[i].schoolOfMagic]);
}
}
}

#undef WPT_SIMPLE
#undef WPT_MARTIAL
#undef WPT_EXOTIC
Expand Down
92 changes: 92 additions & 0 deletions act.offensive.c
Original file line number Diff line number Diff line change
Expand Up @@ -10528,6 +10528,98 @@ ACMD(do_knighthoods_flower)
USE_SWIFT_ACTION(ch);
}

ACMD(do_foretell)
{

int uses_remaining = 0;

if (!HAS_REAL_FEAT(ch, FEAT_COSMIC_UNDERSTANDING))
{
send_to_char(ch, "You do not have the cosmic understanding feat, which bestows this ability.\r\n");
return;
}

if (affected_by_spell(ch, AFFECT_FORETELL))
{
send_to_char(ch, "You are already benefitting from foretell.\r\n");
return;
}

if ((uses_remaining = daily_uses_remaining(ch, FEAT_COSMIC_UNDERSTANDING)) == 0)
{
send_to_char(ch, "You need to recover your strength in order to use this ability again.\r\n");
return;
}

if (uses_remaining < 0)
{
send_to_char(ch, "You have no uses in this ability.\r\n");
return;
}

if (!is_action_available(ch, atSWIFT, TRUE))
{
send_to_char(ch, "Foretell requires a swift action available to use.\r\n");
return;
}

send_to_char(ch, "Tapping into the power of the Vision, you peek into the immediate future!\r\n"
"You will get a +5 bonus on your next 5 attack rolls, saving throws, or skill checks.\r\n");

call_magic(ch, ch, 0, AFFECT_FORETELL, 0, CASTER_LEVEL(ch), CAST_INNATE);

if (!IS_NPC(ch))
start_daily_use_cooldown(ch, FEAT_COSMIC_UNDERSTANDING);

USE_SWIFT_ACTION(ch);
}

ACMD(do_prescience)
{

int uses_remaining = 0;

if (!HAS_REAL_FEAT(ch, FEAT_COSMIC_UNDERSTANDING))
{
send_to_char(ch, "You do not have the cosmic understanding feat, which bestows this ability.\r\n");
return;
}

if (affected_by_spell(ch, AFFECT_PRESCIENCE))
{
send_to_char(ch, "You are already benefitting from foretell.\r\n");
return;
}

if ((uses_remaining = daily_uses_remaining(ch, FEAT_COSMIC_UNDERSTANDING)) == 0)
{
send_to_char(ch, "You need to recover your strength in order to use this ability again.\r\n");
return;
}

if (uses_remaining < 0)
{
send_to_char(ch, "You have no uses in this ability.\r\n");
return;
}

if (!is_action_available(ch, atSWIFT, TRUE))
{
send_to_char(ch, "Foretell requires a swift action available to use.\r\n");
return;
}

send_to_char(ch, "Tapping into the power of the Vision, you peek into the immediate future!\r\n"
"You and your allies gain a +2 luck bonus to attacks rolls saves, skill checks and caster level checks. Enemies gain -2 to the same.\r\n");

call_magic(ch, ch, 0, AFFECT_PRESCIENCE, 0, CASTER_LEVEL(ch), CAST_INNATE);

if (!IS_NPC(ch))
start_daily_use_cooldown(ch, FEAT_COSMIC_UNDERSTANDING);

USE_SWIFT_ACTION(ch);
}

/* cleanup! */
#undef RAGE_AFFECTS
#undef D_STANCE_AFFECTS
Expand Down
51 changes: 50 additions & 1 deletion act.other.c
Original file line number Diff line number Diff line change
Expand Up @@ -5698,10 +5698,33 @@ ACMDU(do_title)
send_to_char(ch, "Titles can't contain the ( or ) characters.\r\n");
else if (strlen(argument) > MAX_TITLE_LENGTH)
send_to_char(ch, "Sorry, titles can't be longer than %d characters.\r\n", MAX_TITLE_LENGTH);
else if (!strstr(argument, GET_NAME(ch)))
send_to_char(ch, "Your title must contain your name in it.\r\n");
else if (strlen(argument) < 10 && strcmp(argument, GET_NAME(ch)))
send_to_char(ch, "Your title must be at least 10 characters long.\r\n");
else
{
set_title(ch, argument);
send_to_char(ch, "Okay, you're now %s%s%s.\r\n", GET_NAME(ch), *GET_TITLE(ch) ? " " : "", GET_TITLE(ch));
send_to_char(ch, "Okay, you're now %s.\r\n", GET_TITLE(ch));
}
}

ACMDU(do_immtitle)
{
skip_spaces(&argument);
delete_doubledollar(argument);
parse_at(argument);

if (IS_NPC(ch))
send_to_char(ch, "Your title is fine... go away.\r\n");
else if (strstr(argument, "(") || strstr(argument, ")"))
send_to_char(ch, "Titles can't contain the ( or ) characters.\r\n");
else if (strlen(argument) > MAX_IMM_TITLE_LENGTH)
send_to_char(ch, "Sorry, staff titles can't be longer than %d characters.\r\n", MAX_TITLE_LENGTH);
else
{
set_imm_title(ch, argument);
send_to_char(ch, "Okay, your staff title is now %s.\r\n", GET_IMM_TITLE(ch));
}
}

Expand Down Expand Up @@ -9189,6 +9212,32 @@ ACMD(do_kapak_saliva)
USE_SWIFT_ACTION(ch);

}

ACMDU(do_weapon_touch)
{


if (!HAS_FEAT(ch, FEAT_WEAPON_TOUCH))
{
send_to_char(ch, "You do not have this ability.\r\n");
return;
}

if (GET_WEAPON_TOUCH_SPELL(ch) != 0)
{
send_to_char(ch, "You already have the '%s' spell queued for your next weapon attack.\r\n", spell_info[GET_WEAPON_TOUCH_SPELL(ch)].name);
return;
}

if (!GET_EQ(ch, WEAR_WIELD_1) && !GET_EQ(ch, WEAR_WIELD_2H))
{
send_to_char(ch, "You cannot queued a spell for weapon touch if you are not wielding a weapon in your primary hand.\r\n");
return;
}

do_gen_cast(ch, argument, cmd, SCMD_WEAPON_TOUCH);
}

/* undefines */
#undef DEBUG_MODE

Expand Down
12 changes: 7 additions & 5 deletions clan.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ const struct clan_cmds clan_commands[] = {
{"info", CP_ALL, LVL_IMMORT, do_claninfo,
"%sclan info [clan] %s- %sInfo about all clans, or a "
"single clan%s\r\n"},
{"list", CP_ALL, LVL_IMMORT, do_clanlist,
"%sclan list %s- %sList all members of your clan "
"(same as clan who)%s\r\n"},
{"list", CP_ALL, LVL_IMMORT, do_claninfo,
"%sclan list %s- %sList all clans or a single specified clan "
"(same as clan info)%s\r\n"},
{"owner", CP_OWNER, LVL_GRSTAFF, do_clanowner,
"%sclan owner <player> %s- %sChange ownership of the "
"clan%s\r\n"},
Expand Down Expand Up @@ -751,7 +751,9 @@ ACMD(do_clanapply)
set_clan(ch, clan_list[c_n].vnum);
GET_CLANRANK(ch) = NO_CLANRANK;

send_to_char(ch, "You've applied to clan '%s%s'\r\n",
send_to_char(ch, "You've applied to clan '%s%s'\r\n"
"In order to be admitted into the clan you will need your application to be approved with a clan member of a certain rank.\r\n"
"If there are no active clan leaders playing, please request a staff member to admit you into the clan.\r\n",
clan_list[c_n].clan_name, QNRM);
return;
}
Expand Down Expand Up @@ -3464,7 +3466,7 @@ ACMD(do_clantalk)

/* Again, removed the +1 from argument. */
snprintf(buf, sizeof(buf), "[Clantalk] %s$n \"%s\"%s",
CCMAG(i->character, C_NRM),
CBMAG(i->character, C_NRM),
(argument), CCNRM(i->character, C_NRM));

if (imm)
Expand Down
Loading

0 comments on commit 4fd127e

Please sign in to comment.