Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COV-0104: Restore inn rental system #64

Merged
merged 3 commits into from Feb 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Makefile
Expand Up @@ -28,8 +28,8 @@ D_FLAGS = -g2 -O $(PROF) $(SOLARIS_LINK)
C_FILES = act_comm.c act_info.c act_move.c act_obj.c act_wiz.c ban.c bank.c boards.c \
build.c calendar.c chess.c clans.c color.c comm.c comments.c const.c db.c deity.c \
dns.c fight.c handler.c hashstr.c hint.c hotboot.c house.c imm_host.c interp.c \
liquids.c magic.c makeobjs.c map.c mccp.c \
misc.c mpxset.c mssp.c mud_comm.c mud_prog.c news.c planes.c player.c polymorph.c \
liquids.c magic.c makeobjs.c map.c mccp.c misc.c \
mpxset.c mssp.c mud_comm.c mud_prog.c news.c planes.c player.c polymorph.c rent.c \
renumber.c reset.c save.c services.c sha256.c shops.c skills.c special.c tables.c \
track.c update.c variables.c weather.c

Expand Down
111 changes: 0 additions & 111 deletions src/act_comm.c
Expand Up @@ -2042,117 +2042,6 @@ void do_typo(CHAR_DATA* ch, const char* argument)
return;
}

void do_rent(CHAR_DATA* ch, const char* argument)
{
set_char_color(AT_WHITE, ch);
send_to_char("There is no rent here. Just save and quit.\r\n", ch);
return;
}

void do_qui(CHAR_DATA* ch, const char* argument)
{
set_char_color(AT_RED, ch);
send_to_char("If you want to QUIT, you have to spell it out.\r\n", ch);
return;
}

void do_quit(CHAR_DATA* ch, const char* argument)
{
char log_buf[MAX_STRING_LENGTH];
int x, y;
int level;

if (IS_NPC(ch))
return;

if (ch->position == POS_FIGHTING
|| ch->position == POS_EVASIVE
|| ch->position == POS_DEFENSIVE || ch->position == POS_AGGRESSIVE || ch->position == POS_BERSERK)
{
set_char_color(AT_RED, ch);
send_to_char("No way! You are fighting.\r\n", ch);
return;
}

if (ch->position < POS_STUNNED)
{
set_char_color(AT_BLOOD, ch);
send_to_char("You're not DEAD yet.\r\n", ch);
return;
}

if (get_timer(ch, TIMER_RECENTFIGHT) > 0 && !IS_IMMORTAL(ch))
{
set_char_color(AT_RED, ch);
send_to_char("Your adrenaline is pumping too hard to quit now!\r\n", ch);
return;
}

if (auction->item != NULL && ((ch == auction->buyer) || (ch == auction->seller)))
{
send_to_char("Wait until you have bought/sold the item on auction.\r\n", ch);
return;

}

if (!IS_IMMORTAL(ch) && xIS_SET(ch->in_room->room_flags, ROOM_NOQUIT))
{
send_to_char("You cannot QUIT here.\r\n", ch);
return;
}

if (IS_PKILL(ch) && ch->wimpy > (int)ch->max_hit / 2.25)
{
send_to_char("Your wimpy has been adjusted to the maximum level for deadlies.\r\n", ch);
do_wimpy(ch, "max");
}

/*
* Get 'em dismounted until we finish mount saving -- Blodkai, 4/97
*/
if (ch->position == POS_MOUNTED)
do_dismount(ch, "");
set_char_color(AT_WHITE, ch);
send_to_char
("Your surroundings begin to fade as a mystical swirling vortex of colors\r\nenvelops your body... When you come to, things are not as they were.\r\n\r\n",
ch);
act(AT_SAY, "A strange voice says, 'We await your return, $n...'", ch, NULL, NULL, TO_CHAR);
act(AT_BYE, "$n has left the game.", ch, NULL, NULL, TO_CANSEE);
set_char_color(AT_GREY, ch);

snprintf(log_buf, MAX_STRING_LENGTH, "%s has quit (Room %d).", ch->name, (ch->in_room ? ch->in_room->vnum : -1));
quitting_char = ch;
if (ch->level >= LEVEL_HERO && !ch->pcdata->pet) /* Pet crash fix */
xREMOVE_BIT(ch->act, PLR_BOUGHT_PET);
save_char_obj(ch);

if (sysdata.save_pets && ch->pcdata->pet)
{
act(AT_BYE, "$N follows $S master into the Void.", ch, NULL, ch->pcdata->pet, TO_ROOM);
extract_char(ch->pcdata->pet, TRUE);
}

/*
* Synch clandata up only when clan member quits now. --Shaddai
*/
if (ch->pcdata->clan)
save_clan(ch->pcdata->clan);

saving_char = NULL;

level = get_trust(ch);
/*
* After extract_char the ch is no longer valid!
*/
extract_char(ch, TRUE);
for (x = 0; x < MAX_WEAR; x++)
for (y = 0; y < MAX_LAYERS; y++)
save_equipment[x][y] = NULL;

log_string_plus(log_buf, LOG_COMM, level);
return;
}

void send_rip_screen(CHAR_DATA * ch)
{
FILE *rpfile;
Expand Down
54 changes: 0 additions & 54 deletions src/act_wiz.c
Expand Up @@ -2087,13 +2087,6 @@ void do_mstat(CHAR_DATA* ch, const char* argument)
send_to_pager("Their godly glow prevents you from getting a good look.\r\n", ch);
return;
}
if (IS_NPC(victim) && get_trust(ch) < LEVEL_GREATER && xIS_SET(victim->act, ACT_STATSHIELD))
{
set_pager_color(AT_IMMORT, ch);
send_to_pager("Their godly glow prevents you from getting a good look.\r\n", ch);
return;
}

pager_printf_color(ch, "\r\n&c%s: &C%-20s", IS_NPC(victim) ? "Mobile name" : "Name", victim->name);
if (!IS_NPC(victim))
pager_printf_color(ch, "&cStatus : &w%-10s", CAN_PKILL(victim) ? "Deadly" :
Expand Down Expand Up @@ -3092,47 +3085,6 @@ void do_snoop(CHAR_DATA* ch, const char* argument)
return;
}

void do_statshield(CHAR_DATA* ch, const char* argument)
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;

set_char_color(AT_IMMORT, ch);

one_argument(argument, arg);
if (IS_NPC(ch) || get_trust(ch) < LEVEL_GREATER)
{
send_to_char("Huh?\r\n", ch);
return;
}
if (arg[0] == '\0')
{
send_to_char("Statshield which mobile?\r\n", ch);
return;
}
if ((victim = get_char_world(ch, arg)) == NULL)
{
send_to_char("No such mobile.\r\n", ch);
return;
}
if (!IS_NPC(victim))
{
send_to_char("You can only statshield mobiles.\r\n", ch);
return;
}
if (xIS_SET(victim->act, ACT_STATSHIELD))
{
xREMOVE_BIT(victim->act, ACT_STATSHIELD);
ch_printf(ch, "You have lifted the statshield on %s.\r\n", victim->short_descr);
}
else
{
xSET_BIT(victim->act, ACT_STATSHIELD);
ch_printf(ch, "You have applied a statshield to %s.\r\n", victim->short_descr);
}
return;
}

void do_switch(CHAR_DATA* ch, const char* argument)
{
char arg[MAX_INPUT_LENGTH];
Expand Down Expand Up @@ -3163,12 +3115,6 @@ void do_switch(CHAR_DATA* ch, const char* argument)
send_to_char("Ok.\r\n", ch);
return;
}
if (IS_NPC(victim) && xIS_SET(victim->act, ACT_STATSHIELD) && get_trust(ch) < LEVEL_GREATER)
{
set_pager_color(AT_IMMORT, ch);
send_to_pager("Their godly glow prevents you from getting close enough.\r\n", ch);
return;
}
if (victim->desc)
{
send_to_char("Character in use.\r\n", ch);
Expand Down
15 changes: 1 addition & 14 deletions src/build.c
Expand Up @@ -153,7 +153,7 @@ const char *const act_flags[] = {
"wimpy", "pet", "train", "practice", "immortal", "deadly", "polyself",
"meta_aggr", "guardian", "running", "nowander", "mountable", "mounted",
"scholar", "secretive", "banker", "mobinvis", "noassist", "autonomous",
"pacifist", "noattack", "annoying", "statshield", "prototype"
"pacifist", "noattack", "annoying", "innkeeper", "prototype"
};

const char *const pc_flags[] = {
Expand Down Expand Up @@ -1292,12 +1292,6 @@ void do_mset(CHAR_DATA* ch, const char* argument)
ch->dest_buf = NULL;
return;
}
if (get_trust(ch) < LEVEL_GREATER && IS_NPC(victim) && xIS_SET(victim->act, ACT_STATSHIELD))
{
send_to_char("You can't do that!\r\n", ch);
ch->dest_buf = NULL;
return;
}
if (lockvictim)
ch->dest_buf = victim;

Expand Down Expand Up @@ -8404,13 +8398,6 @@ void do_mpedit(CHAR_DATA* ch, const char* argument)
return;
}

if (get_trust(ch) < LEVEL_GREATER && IS_NPC(victim) && xIS_SET(victim->act, ACT_STATSHIELD))
{
set_pager_color(AT_IMMORT, ch);
send_to_pager("Their godly glow prevents you from getting close enough.\r\n", ch);
return;
}

if (!can_mmodify(ch, victim))
return;

Expand Down
5 changes: 5 additions & 0 deletions src/handler.c
Expand Up @@ -2444,6 +2444,11 @@ OBJ_DATA *obj_to_room(OBJ_DATA * obj, ROOM_INDEX_DATA * pRoomIndex)
return obj;
}

OBJ_DATA *obj_to_hex(OBJ_DATA * obj, int xhex, int yhex)
{
return obj;
}

/*
* Who's carrying an item -- recursive for nested objects -Thoric
*/
Expand Down
11 changes: 7 additions & 4 deletions src/mud.h
Expand Up @@ -393,6 +393,7 @@ struct extended_bitvector
#include "calendar.h" /* AFKMud Calendar Replacement - Samson */
#include "weather.h" /* Weather System Replacement - Kayle */
#include "liquids.h" /* SMAUG Liquidtable Replacement - Nopey */
#include "rent.h"
#ifdef IMC
#include "imc.h"
#endif
Expand Down Expand Up @@ -1375,7 +1376,7 @@ struct smaug_affect
#define ACT_PACIFIST 26 /* Doesn't ever fight */
#define ACT_NOATTACK 27 /* No physical attacks */
#define ACT_ANNOYING 28 /* Other mobs will attack */
#define ACT_STATSHIELD 29 /* prevent statting */
#define ACT_INNKEEPER 29 /* Can rent here */
#define ACT_PROTOTYPE 30 /* A prototype mob */
/* 31 acts */

Expand Down Expand Up @@ -2510,8 +2511,8 @@ struct obj_index_data
int vnum;
int serial;
int cost;
int rent; /* Unused */
int magic_flags; /*Need more bitvectors for spells - Scryn */
int rent; /* Unused; may add to rent calculation -- Shamus */
int magic_flags; /* Need more bitvectors for spells -- Scryn */
int wear_flags;
short count;
short weight;
Expand Down Expand Up @@ -4018,6 +4019,7 @@ DECLARE_DO_FUN(do_nuisance);
DECLARE_DO_FUN(do_oclaim);
DECLARE_DO_FUN(do_ocreate);
DECLARE_DO_FUN(do_odelete);
DECLARE_DO_FUN(do_offer);
DECLARE_DO_FUN(do_ofind);
DECLARE_DO_FUN(do_oinvoke);
DECLARE_DO_FUN(do_oldscore);
Expand Down Expand Up @@ -4918,7 +4920,8 @@ void unequip_char args((CHAR_DATA * ch, OBJ_DATA * obj));
int count_obj_list(OBJ_INDEX_DATA * pObjIndex, OBJ_DATA * list);
void obj_from_room args((OBJ_DATA * obj));
OD *obj_to_room args((OBJ_DATA * obj, ROOM_INDEX_DATA * pRoomIndex));
OD *obj_to_obj args((OBJ_DATA * obj, OBJ_DATA * obj_to));
OD *obj_to_hex args((OBJ_DATA * obj, int xhex, int yhex));
OD *obj_to_obj args((OBJ_DATA * obj, OBJ_DATA * obj_to));
void obj_from_obj args((OBJ_DATA * obj));
void extract_obj args((OBJ_DATA * obj));
void extract_exit args((ROOM_INDEX_DATA * room, EXIT_DATA * pexit));
Expand Down
7 changes: 0 additions & 7 deletions src/mud_comm.c
Expand Up @@ -137,13 +137,6 @@ void do_mpstat(CHAR_DATA* ch, const char* argument)
return;
}

if (get_trust(ch) < LEVEL_GREATER && xIS_SET(victim->act, ACT_STATSHIELD))
{
set_pager_color(AT_IMMORT, ch);
send_to_pager("Their godly glow prevents you from getting a good look.\r\n", ch);
return;
}

if (xIS_EMPTY(victim->pIndexData->progtypes))
{
ch_printf(ch, "No programs on mobile: %s - #%d\r\n", victim->name, victim->pIndexData->vnum);
Expand Down