mirror of
https://github.com/smaugmuds/SmaugFUSS
synced 2026-08-12 12:23:07 -04:00
Merge housing code from Smaug 1.8b
The housing code had never been merged.
This commit is contained in:
parent
0fb1d849fa
commit
fb149c3008
19 changed files with 2964 additions and 14 deletions
|
|
@ -389,7 +389,7 @@ ToRoom 9512
|
|||
Vnum 9514
|
||||
Name A Monestary~
|
||||
Sector inside~
|
||||
Flags dark lawful~
|
||||
Flags dark~
|
||||
Desc You are in a huge hall. Large tapestries line the walls and huge statues of
|
||||
various make and appearance are spread about. The ceiling above supports huge
|
||||
candelabras, which light the room. To the east, you see a bright light and
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
help.are
|
||||
limbo.are
|
||||
gods.are
|
||||
newacad.are
|
||||
newgate.are
|
||||
newdark.are
|
||||
gods.are
|
||||
plains.are
|
||||
haon.are
|
||||
midennir.are
|
||||
|
|
@ -22,4 +22,5 @@ srefuge.are
|
|||
manor.are
|
||||
unholy.are
|
||||
gallery.are
|
||||
housing.are
|
||||
$
|
||||
|
|
|
|||
107
area/housing.are
Normal file
107
area/housing.are
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
#FUSSAREA
|
||||
#AREADATA
|
||||
Version 1
|
||||
Name Housing~
|
||||
Author SmaugFuss~
|
||||
WeatherX 0
|
||||
WeatherY 0
|
||||
Ranges 0 60 0 60
|
||||
Economy 0 0
|
||||
ResetMsg A dim pulse of light filters through the swirling mists.~
|
||||
ResetFreq 60
|
||||
Flags hidden~
|
||||
#ENDAREADATA
|
||||
|
||||
#MOBILE
|
||||
Vnum 50000
|
||||
Keywords placeholder mob~
|
||||
Short a placeholder mob~
|
||||
Long A placeholder mob is here, holding the place.
|
||||
~
|
||||
Desc What? Never seen a placeholder before?
|
||||
~
|
||||
Race dwarf~
|
||||
Class warrior~
|
||||
Position standing~
|
||||
DefPos standing~
|
||||
Specfun spec_thief~
|
||||
Gender male~
|
||||
Actflags npc~
|
||||
Stats1 -5 3 17 6 300 400
|
||||
Stats2 1 4 30
|
||||
Stats3 1 3 6
|
||||
Stats4 0 0 0 0 0
|
||||
Attribs 13 13 13 13 13 13 13
|
||||
Saves 0 0 0 0 0
|
||||
Speaks common~
|
||||
Speaking common~
|
||||
Bodyparts head arms legs heart hands feet eye~
|
||||
#ENDMOBILE
|
||||
|
||||
#MOBILE
|
||||
Vnum 54999
|
||||
Keywords placeholder mob~
|
||||
Short a placeholder mob~
|
||||
Long A placeholder mob is here, holding the place.
|
||||
~
|
||||
Desc What? Never seen a placeholder before?
|
||||
~
|
||||
Race dwarf~
|
||||
Class warrior~
|
||||
Position standing~
|
||||
DefPos standing~
|
||||
Specfun spec_thief~
|
||||
Gender male~
|
||||
Actflags npc~
|
||||
Stats1 -5 3 17 6 300 400
|
||||
Stats2 1 4 30
|
||||
Stats3 1 3 6
|
||||
Stats4 0 0 0 0 0
|
||||
Attribs 13 13 13 13 13 13 13
|
||||
Saves 0 0 0 0 0
|
||||
Speaks common~
|
||||
Speaking common~
|
||||
Bodyparts head arms legs heart hands feet eye~
|
||||
#ENDMOBILE
|
||||
|
||||
#OBJECT
|
||||
Vnum 50000
|
||||
Keywords placeholder obj~
|
||||
Type weapon~
|
||||
Short a placeholder obj~
|
||||
Long A placeholder obj is here, holding the place~
|
||||
WFlags take wield~
|
||||
Values 0 2 8 0 0 0
|
||||
Stats 15 600 60 0 0
|
||||
#ENDOBJECT
|
||||
|
||||
#OBJECT
|
||||
Vnum 54999
|
||||
Keywords placeholder obj~
|
||||
Type weapon~
|
||||
Short a placeholder obj~
|
||||
Long A placeholder obj is here, holding the place~
|
||||
WFlags take wield~
|
||||
Values 0 2 8 0 0 0
|
||||
Stats 15 600 60 0 0
|
||||
#ENDOBJECT
|
||||
|
||||
#ROOM
|
||||
Vnum 50000
|
||||
Name Placeholder Space~
|
||||
Sector inside~
|
||||
Flags nomob indoors~
|
||||
Desc It's really bland in here.
|
||||
~
|
||||
#ENDROOM
|
||||
|
||||
#ROOM
|
||||
Vnum 54999
|
||||
Name Placeholder Space~
|
||||
Sector inside~
|
||||
Flags nomob indoors~
|
||||
Desc It's really bland in here.
|
||||
~
|
||||
#ENDROOM
|
||||
|
||||
#ENDAREA
|
||||
1
houses/homeaccessories.dat
Normal file
1
houses/homeaccessories.dat
Normal file
|
|
@ -0,0 +1 @@
|
|||
#END
|
||||
1
houses/homebuy.dat
Normal file
1
houses/homebuy.dat
Normal file
|
|
@ -0,0 +1 @@
|
|||
#END
|
||||
1
houses/house.lst
Normal file
1
houses/house.lst
Normal file
|
|
@ -0,0 +1 @@
|
|||
$
|
||||
|
|
@ -27,7 +27,7 @@ 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 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 imm_host.c interp.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 mapout.c mapper.c mccp.c \
|
||||
misc.c mpxset.c mssp.c mud_comm.c mud_prog.c news.c planes.c player.c polymorph.c \
|
||||
renumber.c reset.c save.c services.c sha256.c shops.c skills.c special.c tables.c \
|
||||
|
|
|
|||
|
|
@ -4445,6 +4445,9 @@ void do_areas( CHAR_DATA* ch, const char* argument)
|
|||
send_to_pager( header_string2, ch );
|
||||
for( pArea = first_area; pArea; pArea = pArea->next )
|
||||
{
|
||||
if( IS_SET( pArea->flags, AFLAG_HIDDEN ) ) /* Blod, 2000 */
|
||||
continue;
|
||||
|
||||
pager_printf( ch, print_string,
|
||||
pArea->author, pArea->name,
|
||||
pArea->low_soft_range, pArea->hi_soft_range, pArea->low_hard_range, pArea->hi_hard_range );
|
||||
|
|
@ -4495,6 +4498,9 @@ void do_areas( CHAR_DATA* ch, const char* argument)
|
|||
|
||||
for( pArea = first_area_name; pArea; pArea = pArea->next_sort_name )
|
||||
{
|
||||
if( IS_SET( pArea->flags, AFLAG_HIDDEN ) ) /* Blod, 2000 */
|
||||
continue;
|
||||
|
||||
if( pArea->hi_soft_range >= lower_bound && pArea->low_soft_range <= upper_bound )
|
||||
{
|
||||
pager_printf( ch, print_string,
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
* External functions
|
||||
*/
|
||||
void write_corpses( CHAR_DATA * ch, const char *name, OBJ_DATA * objrem );
|
||||
void save_house_by_vnum( int vnum );
|
||||
|
||||
/*
|
||||
* how resistant an object is to damage -Thoric
|
||||
|
|
@ -204,6 +205,9 @@ void get_obj( CHAR_DATA * ch, OBJ_DATA * obj, OBJ_DATA * container )
|
|||
obj_from_room( obj );
|
||||
}
|
||||
|
||||
if( xIS_SET( ch->in_room->room_flags, ROOM_HOUSE ) )
|
||||
save_house_by_vnum( ch->in_room->vnum ); /* House Object Saving */
|
||||
|
||||
/*
|
||||
* Clan storeroom checks
|
||||
*/
|
||||
|
|
@ -773,6 +777,10 @@ void do_put( CHAR_DATA* ch, const char* argument)
|
|||
|
||||
if( save_char )
|
||||
save_char_obj( ch );
|
||||
|
||||
if( xIS_SET( ch->in_room->room_flags, ROOM_HOUSE ) )
|
||||
save_house_by_vnum( ch->in_room->vnum ); /* House Object Saving */
|
||||
|
||||
/*
|
||||
* Clan storeroom check
|
||||
*/
|
||||
|
|
@ -862,6 +870,9 @@ void do_put( CHAR_DATA* ch, const char* argument)
|
|||
if( container->item_type == ITEM_CORPSE_PC )
|
||||
write_corpses( NULL, container->short_descr + 14, NULL );
|
||||
|
||||
if( xIS_SET( ch->in_room->room_flags, ROOM_HOUSE ) )
|
||||
save_house_by_vnum( ch->in_room->vnum ); /* House Object Saving */
|
||||
|
||||
/*
|
||||
* Clan storeroom check
|
||||
*/
|
||||
|
|
@ -1069,6 +1080,10 @@ void do_drop( CHAR_DATA* ch, const char* argument)
|
|||
act( AT_PLAIN, "You are not carrying any $T.", ch, NULL, chk, TO_CHAR );
|
||||
}
|
||||
}
|
||||
|
||||
if( xIS_SET( ch->in_room->room_flags, ROOM_HOUSE ) )
|
||||
save_house_by_vnum( ch->in_room->vnum ); /* House Object Saving */
|
||||
|
||||
if( IS_SET( sysdata.save_flags, SV_DROP ) )
|
||||
save_char_obj( ch ); /* duping protector */
|
||||
return;
|
||||
|
|
@ -2264,11 +2279,17 @@ void do_sacrifice( CHAR_DATA* ch, const char* argument)
|
|||
act( AT_ACTION, buf, ch, obj, NULL, TO_ROOM );
|
||||
oprog_sac_trigger( ch, obj );
|
||||
if( obj_extracted( obj ) )
|
||||
{
|
||||
if( xIS_SET( ch->in_room->room_flags, ROOM_HOUSE ) )
|
||||
save_house_by_vnum( ch->in_room->vnum ); /* Prevent House Object Duplication */
|
||||
return;
|
||||
}
|
||||
if( cur_obj == obj->serial )
|
||||
global_objcode = rOBJ_SACCED;
|
||||
separate_obj( obj );
|
||||
extract_obj( obj );
|
||||
if( xIS_SET( ch->in_room->room_flags, ROOM_HOUSE ) )
|
||||
save_house_by_vnum( ch->in_room->vnum ); /* Prevent House Object Duplication */
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include "mud.h"
|
||||
#include "house.h"
|
||||
#include "sha256.h"
|
||||
|
||||
#define RESTORE_INTERVAL 21600
|
||||
|
|
@ -3340,6 +3341,8 @@ void do_purge( CHAR_DATA* ch, const char* argument)
|
|||
|
||||
act( AT_IMMORT, "$n purges the room!", ch, NULL, NULL, TO_ROOM );
|
||||
act( AT_IMMORT, "You have purged the room!", ch, NULL, NULL, TO_CHAR );
|
||||
if( xIS_SET( ch->in_room->room_flags, ROOM_HOUSE ) )
|
||||
save_house_by_vnum( ch->in_room->vnum ); /* Prevent House Object Duplication */
|
||||
|
||||
/*
|
||||
* Clan storeroom check
|
||||
|
|
@ -3369,13 +3372,15 @@ void do_purge( CHAR_DATA* ch, const char* argument)
|
|||
}
|
||||
}
|
||||
|
||||
/* Single object purge in room for high level purge - Scryn 8/12*/
|
||||
/* Single object purge in room for high level purge - Scryn 8/12*/
|
||||
if( obj )
|
||||
{
|
||||
separate_obj( obj );
|
||||
act( AT_IMMORT, "$n purges $p.", ch, obj, NULL, TO_ROOM );
|
||||
act( AT_IMMORT, "You make $p disappear in a puff of smoke!", ch, obj, NULL, TO_CHAR );
|
||||
extract_obj( obj );
|
||||
if( xIS_SET( ch->in_room->room_flags, ROOM_HOUSE ) )
|
||||
save_house_by_vnum( ch->in_room->vnum ); /* Prevent House Object Duplication */
|
||||
|
||||
/*
|
||||
* Clan storeroom check
|
||||
|
|
@ -3437,6 +3442,8 @@ void do_low_purge( CHAR_DATA* ch, const char* argument)
|
|||
act( AT_IMMORT, "$n purges $p!", ch, obj, NULL, TO_ROOM );
|
||||
act( AT_IMMORT, "You make $p disappear in a puff of smoke!", ch, obj, NULL, TO_CHAR );
|
||||
extract_obj( obj );
|
||||
if( xIS_SET( ch->in_room->room_flags, ROOM_HOUSE ) )
|
||||
save_house_by_vnum( ch->in_room->vnum ); /* Prevent House Object Duplication */
|
||||
|
||||
/*
|
||||
* Clan storeroom check
|
||||
|
|
@ -5990,6 +5997,15 @@ void do_destroy( CHAR_DATA* ch, const char* argument)
|
|||
|
||||
set_char_color( AT_RED, ch );
|
||||
ch_printf( ch, "Player %s destroyed. Pfile saved in backup directory.\r\n", name );
|
||||
sprintf( buf, "%s%s", HOUSE_DIR, name );
|
||||
if( !remove( buf ) )
|
||||
send_to_char( "Player's housing data destroyed.\r\n", ch );
|
||||
else if( errno != ENOENT )
|
||||
{
|
||||
ch_printf( ch, "Unknown error #%d - %s (housing data). Report to Coder.\r\n", errno, strerror( errno ) );
|
||||
snprintf( buf2, MAX_STRING_LENGTH, "%s destroying %s", ch->name, buf );
|
||||
perror( buf2 );
|
||||
}
|
||||
snprintf( buf, MAX_STRING_LENGTH, "%s%s", GOD_DIR, name );
|
||||
if( !remove( buf ) )
|
||||
send_to_char( "Player's immortal data destroyed.\r\n", ch );
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ const char *const sec_flags[] = {
|
|||
};
|
||||
|
||||
const char *const r_flags[] = {
|
||||
"dark", "death", "nomob", "indoors", "lawful", "neutral", "chaotic",
|
||||
"dark", "death", "nomob", "indoors", "house", "neutral", "chaotic",
|
||||
"nomagic", "tunnel", "private", "safe", "solitary", "petshop", "norecall",
|
||||
"donation", "nodropall", "silence", "logspeech", "nodrop", "clanstoreroom",
|
||||
"nosummon", "noastral", "teleport", "teleshowdesc", "nofloor",
|
||||
|
|
@ -102,7 +102,7 @@ const char *const item_w_flags[] = {
|
|||
};
|
||||
|
||||
const char *const area_flags[] = {
|
||||
"nopkill", "freekill", "noteleport", "spelllimit", "prototype", "r5", "r6", "r7", "r8",
|
||||
"nopkill", "freekill", "noteleport", "spelllimit", "prototype", "hidden", "r6", "r7", "r8",
|
||||
"r9", "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17",
|
||||
"r18", "r19", "r20", "r21", "r22", "r23", "r24",
|
||||
"r25", "r26", "r27", "r28", "r29", "r30", "r31"
|
||||
|
|
|
|||
21
src/comm.c
21
src/comm.c
|
|
@ -2599,6 +2599,7 @@ void nanny_read_motd( DESCRIPTOR_DATA * d, const char *argument )
|
|||
}
|
||||
do_look( ch, "auto" );
|
||||
mail_count( ch );
|
||||
check_loginmsg( ch );
|
||||
|
||||
if( !ch->was_in_room && ch->in_room == get_room_index( ROOM_VNUM_TEMPLE ) )
|
||||
ch->was_in_room = get_room_index( ROOM_VNUM_TEMPLE );
|
||||
|
|
@ -2789,6 +2790,7 @@ bool check_reconnect( DESCRIPTOR_DATA * d, const char *name, bool fConn )
|
|||
log_printf_plus( LOG_COMM, UMAX( sysdata.log_level, ch->level ), "%s (%s) reconnected.", ch->name, d->host );
|
||||
d->connected = CON_PLAYING;
|
||||
do_look( ch, "auto" );
|
||||
check_loginmsg( ch );
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -2837,6 +2839,7 @@ bool check_playing( DESCRIPTOR_DATA * d, const char *name, bool kick )
|
|||
ch->switched = NULL;
|
||||
send_to_char( "Reconnecting.\r\n", ch );
|
||||
do_look( ch, "auto" );
|
||||
check_loginmsg( ch );
|
||||
act( AT_ACTION, "$n has reconnected, kicking off old link.", ch, NULL, NULL, TO_CANSEE );
|
||||
log_printf_plus( LOG_COMM, UMAX( sysdata.log_level, ch->level ), "%s@%s reconnected, kicking off old link.",
|
||||
ch->pcdata->filename, d->host );
|
||||
|
|
@ -3107,11 +3110,25 @@ char *act_string( const char *format, CHAR_DATA * to, CHAR_DATA * ch, const void
|
|||
break;
|
||||
|
||||
case 't':
|
||||
i = ( char * )arg1;
|
||||
/* bug fix - Edmond i = (char *) arg1; break; */
|
||||
if ( arg1 )
|
||||
i = (char *) arg1;
|
||||
else
|
||||
{
|
||||
bug( "Act: Bad variable $t" );
|
||||
i = " <@@@> ";
|
||||
}
|
||||
break;
|
||||
|
||||
case 'T':
|
||||
i = ( char * )arg2;
|
||||
/* same bug fix as above - i = (char *) arg2; break; */
|
||||
if ( arg2 )
|
||||
i = (char *) arg2;
|
||||
else
|
||||
{
|
||||
bug( "Act: Bad variable $T" );
|
||||
i = " <@@@> ";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
14
src/db.c
14
src/db.c
|
|
@ -281,6 +281,9 @@ PROJECT_DATA *read_project( FILE * fp );
|
|||
NOTE_DATA *read_log( FILE * fp );
|
||||
void load_specfuns( void );
|
||||
void init_chess( void );
|
||||
void load_homedata( );
|
||||
void load_accessories( );
|
||||
void load_homebuy( );
|
||||
|
||||
/*
|
||||
* External booting function
|
||||
|
|
@ -735,6 +738,12 @@ void boot_db( bool fCopyOver )
|
|||
*/
|
||||
log_string( "Loading Morphs" );
|
||||
load_morphs( );
|
||||
|
||||
log_string( "Loading Housing System, Home Accessories Data, and Home Auctioning System" );
|
||||
load_homedata();
|
||||
load_accessories();
|
||||
load_homebuy();
|
||||
|
||||
MOBtrigger = TRUE;
|
||||
|
||||
/*
|
||||
|
|
@ -2088,6 +2097,8 @@ void load_rooms( AREA_DATA * tarea, FILE * fp )
|
|||
bug( "Fread_rooms: vnum %d has bad sector_type %d.", vnum, pRoomIndex->sector_type );
|
||||
pRoomIndex->sector_type = 1;
|
||||
}
|
||||
// if( xIS_SET( pRoomIndex->room_flags, ROOM_HOUSE ) )
|
||||
// pRoomIndex->max_weight = 2000;
|
||||
pRoomIndex->light = 0;
|
||||
pRoomIndex->first_exit = NULL;
|
||||
pRoomIndex->last_exit = NULL;
|
||||
|
|
@ -2795,6 +2806,7 @@ OBJ_DATA *create_object( OBJ_INDEX_DATA * pObjIndex, int level )
|
|||
case ITEM_CONTAINER:
|
||||
case ITEM_DRINK_CON:
|
||||
case ITEM_KEY:
|
||||
case ITEM_HOUSEKEY:
|
||||
case ITEM_KEYRING:
|
||||
case ITEM_ODOR:
|
||||
case ITEM_CHANCE:
|
||||
|
|
@ -9352,7 +9364,7 @@ void save_loginmsg( )
|
|||
fp = NULL;
|
||||
}
|
||||
|
||||
void add_loginmsg( char *name, short type, char *argument )
|
||||
void add_loginmsg( const char *name, short type, const char *argument )
|
||||
{
|
||||
LMSG_DATA *lmsg;
|
||||
|
||||
|
|
|
|||
2550
src/house.c
Normal file
2550
src/house.c
Normal file
File diff suppressed because it is too large
Load diff
127
src/house.h
Normal file
127
src/house.h
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
/****************************************************************************
|
||||
* [S]imulated [M]edieval [A]dventure multi[U]ser [G]ame | \\._.// *
|
||||
* -----------------------------------------------------------| (0...0) *
|
||||
* SMAUG 1.8 (C) 1994, 1995, 1996, 1998 by Derek Snider | ).:.( *
|
||||
* -----------------------------------------------------------| {o o} *
|
||||
* SMAUG code team: Thoric, Altrag, Blodkai, Narn, Haus, | / ' ' \ *
|
||||
* Scryn, Rennard, Swordbearer, Gorog, Grishnakh, Nivek, |~'~.VxvxV.~'~*
|
||||
* Tricops, Fireblade, Edmond, Conran | *
|
||||
* ------------------------------------------------------------------------ *
|
||||
* Merc 2.1 Diku Mud improvments copyright (C) 1992, 1993 by Michael *
|
||||
* Chastain, Michael Quan, and Mitchell Tse. *
|
||||
* Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, *
|
||||
* Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe. *
|
||||
* ------------------------------------------------------------------------ *
|
||||
* Housing Module Header File *
|
||||
****************************************************************************
|
||||
* Author : Senir *
|
||||
* E-Mail : oldgaijin@yahoo.com *
|
||||
****************************************************************************/
|
||||
|
||||
/* So other snippets know this is installed */
|
||||
#define HOUSING_CODE
|
||||
|
||||
/* Comment the line if you don't want support for house mobs */
|
||||
#define HOUSE_MOBS
|
||||
|
||||
/* Uncomment the line below and change the area if you want to search another area for free
|
||||
* rooms to turn into additional housing rooms, instead of having it search the area where
|
||||
* the original house room is.
|
||||
*/
|
||||
#define ADDED_ROOM_HOUSING_AREA "housing.are"
|
||||
|
||||
/* Location of housing directory */
|
||||
#define HOUSE_DIR "../houses/"
|
||||
|
||||
/* Location of housing list for loadup of houses */
|
||||
#define HOUSE_LIST "house.lst"
|
||||
|
||||
/* Location of automated housing auction file */
|
||||
#define HOMEBUY_FILE HOUSE_DIR "homebuy.dat"
|
||||
|
||||
/* Location of house accessories file */
|
||||
#define ACCESSORIES_FILE HOUSE_DIR "homeaccessories.dat"
|
||||
|
||||
/* Minimum amount a house may go up on auction for */
|
||||
#define MIN_HOUSE_BID 5000000
|
||||
|
||||
/* Minimum amount an apartment may go up on auction for */
|
||||
#define MIN_APARTMENT_BID 2000000
|
||||
|
||||
/* Default percentage of current bid to be used for the bid increment */
|
||||
#define DEFAULT_BID_INCREMENT_PERCENTAGE 3
|
||||
|
||||
/* Percentage of bid that will be taken from either the bidder or seller for a penalty */
|
||||
#define PENALTY_PERCENTAGE 20
|
||||
|
||||
/* Cost of a player creating another room for their house using 'home addroom' */
|
||||
#define ADDITIONAL_ROOM_COST 100000000
|
||||
|
||||
/* Max number of rooms allowed for a player house, this includes the first room given the player */
|
||||
#define MAX_HOUSE_ROOMS 5
|
||||
|
||||
#ifdef HOUSE_MOBS
|
||||
/* Default price for a mob on accessories. Used by the house mobs. */
|
||||
#define DEFAULT_MOB_PRICE 50000
|
||||
#endif
|
||||
|
||||
/*For automated housing auction*/
|
||||
typedef struct homebuy_data HOMEBUY_DATA;
|
||||
struct homebuy_data
|
||||
{
|
||||
HOMEBUY_DATA *next;
|
||||
HOMEBUY_DATA *prev;
|
||||
const char *bidder;
|
||||
const char *seller;
|
||||
int vnum;
|
||||
int bid;
|
||||
int endtime;
|
||||
short incpercent;
|
||||
bool apartment;
|
||||
};
|
||||
|
||||
extern HOMEBUY_DATA *first_homebuy;
|
||||
extern HOMEBUY_DATA *last_homebuy;
|
||||
|
||||
/* For basic housing */
|
||||
typedef struct home_data HOME_DATA;
|
||||
struct home_data
|
||||
{
|
||||
HOME_DATA *next;
|
||||
HOME_DATA *prev;
|
||||
const char *name;
|
||||
int vnum[MAX_HOUSE_ROOMS];
|
||||
bool apartment;
|
||||
};
|
||||
|
||||
extern HOME_DATA *first_home;
|
||||
extern HOME_DATA *last_home;
|
||||
|
||||
/* For the accessories auction */
|
||||
typedef struct accessories_data ACCESSORIES_DATA;
|
||||
struct accessories_data
|
||||
{
|
||||
ACCESSORIES_DATA *next;
|
||||
ACCESSORIES_DATA *prev;
|
||||
int vnum;
|
||||
int price;
|
||||
bool mob;
|
||||
};
|
||||
|
||||
extern ACCESSORIES_DATA *first_accessory;
|
||||
extern ACCESSORIES_DATA *last_accessory;
|
||||
|
||||
/* Commands added for housing system. */
|
||||
DECLARE_DO_FUN( do_accessories ); // Only command for housing accessories.
|
||||
DECLARE_DO_FUN( do_gohome ); // Command for a player to be instantly transported to their residence.
|
||||
DECLARE_DO_FUN( do_homebuy ); // Main housing auction command.
|
||||
DECLARE_DO_FUN( do_house ); // House personalization command and also immortal command to manually edit residences.
|
||||
DECLARE_DO_FUN( do_residence ); // Command to list current houses and their stats.
|
||||
DECLARE_DO_FUN( do_sellhouse ); // Player command to sell their residence and place it on auction.
|
||||
|
||||
/* Functions for accessories functionality */
|
||||
void save_accessories( );
|
||||
void fread_accessories( FILE * fp );
|
||||
|
||||
/* External Prototypes */
|
||||
void save_house_by_vnum( int vnum );
|
||||
|
|
@ -69,6 +69,8 @@ const char *const mod_types[MAX_CONDS] = {
|
|||
"Drunk", "Full", "Thirst", "Bloodthirst"
|
||||
};
|
||||
|
||||
void save_house_by_vnum( int vnum );
|
||||
|
||||
/* locals */
|
||||
int top_liquid;
|
||||
int liq_count;
|
||||
|
|
@ -1684,6 +1686,8 @@ void do_fill( CHAR_DATA* ch, const char* argument)
|
|||
{
|
||||
act( AT_ACTION, "You fill $p.", ch, obj, NULL, TO_CHAR );
|
||||
act( AT_ACTION, "$n fills $p.", ch, obj, NULL, TO_ROOM );
|
||||
if( xIS_SET( ch->in_room->room_flags, ROOM_HOUSE ) )
|
||||
save_house_by_vnum( ch->in_room->vnum );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -1794,6 +1798,8 @@ void do_fill( CHAR_DATA* ch, const char* argument)
|
|||
}
|
||||
if( found )
|
||||
{
|
||||
if( xIS_SET( ch->in_room->room_flags, ROOM_HOUSE ) )
|
||||
save_house_by_vnum( ch->in_room->vnum );
|
||||
act( AT_ACTION, "You fill $p from $P.", ch, obj, source, TO_CHAR );
|
||||
act( AT_ACTION, "$n fills $p from $P.", ch, obj, source, TO_ROOM );
|
||||
}
|
||||
|
|
@ -2023,6 +2029,8 @@ void do_empty( CHAR_DATA* ch, const char* argument)
|
|||
else
|
||||
act( AT_ACTION, "$P is too full.", ch, obj, dest, TO_CHAR );
|
||||
}
|
||||
if( ch->in_room && xIS_SET( ch->in_room->room_flags, ROOM_HOUSE ) )
|
||||
save_house_by_vnum( ch->in_room->vnum );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
13
src/mud.h
13
src/mud.h
|
|
@ -1665,7 +1665,8 @@ typedef enum
|
|||
ITEM_MATCH, ITEM_TRAP, ITEM_MAP, ITEM_PORTAL, ITEM_PAPER,
|
||||
ITEM_TINDER, ITEM_LOCKPICK, ITEM_SPIKE, ITEM_DISEASE, ITEM_OIL, ITEM_FUEL,
|
||||
ITEM_EMPTY1, ITEM_EMPTY2, ITEM_MISSILE_WEAPON, ITEM_PROJECTILE, ITEM_QUIVER,
|
||||
ITEM_SHOVEL, ITEM_SALVE, ITEM_COOK, ITEM_KEYRING, ITEM_ODOR, ITEM_CHANCE, ITEM_DRINK_MIX
|
||||
ITEM_SHOVEL, ITEM_SALVE, ITEM_COOK, ITEM_KEYRING, ITEM_ODOR, ITEM_CHANCE,
|
||||
ITEM_HOUSEKEY, ITEM_DRINK_MIX
|
||||
} item_types;
|
||||
|
||||
#define MAX_ITEM_TYPE ITEM_DRINK_MIX
|
||||
|
|
@ -1839,7 +1840,7 @@ typedef enum
|
|||
*/
|
||||
typedef enum
|
||||
{
|
||||
ROOM_DARK, ROOM_DEATH, ROOM_NO_MOB, ROOM_INDOORS, ROOM_LAWFUL, ROOM_NEUTRAL, ROOM_CHAOTIC,
|
||||
ROOM_DARK, ROOM_DEATH, ROOM_NO_MOB, ROOM_INDOORS, ROOM_HOUSE, ROOM_NEUTRAL, ROOM_CHAOTIC,
|
||||
ROOM_NO_MAGIC, ROOM_TUNNEL, ROOM_PRIVATE, ROOM_SAFE, ROOM_SOLITARY, ROOM_PET_SHOP,
|
||||
ROOM_NO_RECALL, ROOM_DONATION, ROOM_NODROPALL, ROOM_SILENCE, ROOM_LOGSPEECH, ROOM_NODROP,
|
||||
ROOM_CLANSTOREROOM, ROOM_NO_SUMMON, ROOM_NO_ASTRAL, ROOM_TELEPORT, ROOM_TELESHOWDESC,
|
||||
|
|
@ -2070,6 +2071,7 @@ struct timer_data
|
|||
#define AFLAG_NOTELEPORT BV02
|
||||
#define AFLAG_SPELLLIMIT BV03
|
||||
#define AFLAG_PROTOTYPE BV04
|
||||
#define AFLAG_HIDDEN BV05 /* Hidden from area list. - Blod*/
|
||||
|
||||
/*
|
||||
* Prototype for a mob.
|
||||
|
|
@ -3733,6 +3735,7 @@ DECLARE_DO_FUN( do_enter );
|
|||
DECLARE_DO_FUN( do_equipment );
|
||||
DECLARE_DO_FUN( do_examine );
|
||||
DECLARE_DO_FUN( do_exits );
|
||||
DECLARE_DO_FUN( do_extinguish );
|
||||
DECLARE_DO_FUN( do_feed );
|
||||
DECLARE_DO_FUN( do_fill );
|
||||
DECLARE_DO_FUN( do_findnote );
|
||||
|
|
@ -3936,8 +3939,6 @@ DECLARE_DO_FUN( do_sacrifice );
|
|||
DECLARE_DO_FUN( do_save );
|
||||
DECLARE_DO_FUN( do_savearea );
|
||||
DECLARE_DO_FUN( do_say );
|
||||
DECLARE_DO_FUN( do_say2 );
|
||||
DECLARE_DO_FUN( do_pointing );
|
||||
DECLARE_DO_FUN( do_scan );
|
||||
DECLARE_DO_FUN( do_scatter );
|
||||
DECLARE_DO_FUN( do_score );
|
||||
|
|
@ -4450,7 +4451,8 @@ RD *add_reset( ROOM_INDEX_DATA * room, char letter, int extra, int arg1, int arg
|
|||
void reset_area( AREA_DATA * pArea );
|
||||
|
||||
/* db.c */
|
||||
void add_loginmsg( char *name, short type, char *argument );
|
||||
void add_loginmsg( const char *name, short type, const char *argument );
|
||||
void check_loginmsg( CHAR_DATA * ch );
|
||||
void show_file( CHAR_DATA * ch, const char *filename );
|
||||
char *str_dup( char const *str );
|
||||
void boot_db( bool fCopyOver );
|
||||
|
|
@ -4832,6 +4834,7 @@ ch_ret chain_spells( int sn, int level, CHAR_DATA * ch, void *vo, short chain );
|
|||
/* object saving defines for fread/write_obj. -- Altrag */
|
||||
#define OS_CARRY 0
|
||||
#define OS_CORPSE 1
|
||||
#define OS_VAULT 2
|
||||
void save_char_obj args( ( CHAR_DATA * ch ) );
|
||||
bool load_char_obj args( ( DESCRIPTOR_DATA * d, char *name, bool preload, bool copyover ) );
|
||||
void set_alarm args( ( long seconds ) );
|
||||
|
|
|
|||
69
src/save.c
69
src/save.c
|
|
@ -23,6 +23,7 @@
|
|||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#include "mud.h"
|
||||
#include "house.h"
|
||||
|
||||
/*
|
||||
* Increment with every major format change.
|
||||
|
|
@ -506,6 +507,26 @@ void fwrite_char( CHAR_DATA * ch, FILE * fp )
|
|||
else
|
||||
fprintf( fp, "Site (Link-Dead)\n" );
|
||||
|
||||
/* This MUST come after Room in pfile */
|
||||
if( xIS_SET( ch->in_room->room_flags, ROOM_HOUSE ) && !IS_IMMORTAL( ch ) )
|
||||
{
|
||||
HOME_DATA *tmphome;
|
||||
int i;
|
||||
|
||||
for( tmphome = first_home; tmphome; tmphome = tmphome->next )
|
||||
for( i = 0; i < MAX_HOUSE_ROOMS; ++i )
|
||||
if( tmphome->vnum[i] == ch->in_room->vnum )
|
||||
fprintf( fp, "Homeowner %s~\n", tmphome->name );
|
||||
}
|
||||
else
|
||||
{
|
||||
HOMEBUY_DATA *tmphb;
|
||||
|
||||
for( tmphb = first_homebuy; tmphb; tmphb = tmphb->next )
|
||||
if( ch->in_room->vnum == tmphb->vnum )
|
||||
fprintf( fp, "Homeowner %s~\n", tmphb->seller );
|
||||
}
|
||||
|
||||
for( sn = 1; sn < num_skills; ++sn )
|
||||
{
|
||||
if( skill_table[sn]->name && ch->pcdata->learned[sn] > 0 )
|
||||
|
|
@ -1325,6 +1346,27 @@ void fread_char( CHAR_DATA * ch, FILE * fp, bool preload, bool copyover )
|
|||
KEY( "Hitroll", ch->hitroll, fread_number( fp ) );
|
||||
KEY( "Homepage", ch->pcdata->homepage, fread_string_nohash( fp ) );
|
||||
|
||||
if( !strcmp( word, "Homeowner" ) )
|
||||
{
|
||||
int i;
|
||||
|
||||
fMatch = TRUE;
|
||||
|
||||
if( ch->in_room && xIS_SET( ch->in_room->room_flags, ROOM_HOUSE ) )
|
||||
{
|
||||
HOME_DATA *tmphome;
|
||||
|
||||
for( tmphome = first_home; tmphome; tmphome = tmphome->next )
|
||||
for( i = 0; i < MAX_HOUSE_ROOMS; ++i )
|
||||
if( tmphome->vnum[i] == ch->in_room->vnum )
|
||||
if( strcmp( tmphome->name, fread_string( fp ) ) )
|
||||
ch->in_room = get_room_index( ROOM_VNUM_TEMPLE );
|
||||
}
|
||||
else
|
||||
fread_flagstring( fp );
|
||||
break;
|
||||
}
|
||||
|
||||
if( !strcmp( word, "HpManaMove" ) )
|
||||
{
|
||||
ch->hit = fread_number( fp );
|
||||
|
|
@ -1875,6 +1917,17 @@ void fread_char( CHAR_DATA * ch, FILE * fp, bool preload, bool copyover )
|
|||
}
|
||||
}
|
||||
|
||||
bool check_owner( OBJ_DATA *obj )
|
||||
{
|
||||
HOME_DATA *home;
|
||||
|
||||
for( home = first_home; home; home = home->next )
|
||||
if( home->vnum[0] == obj->pIndexData->vnum )
|
||||
if( !str_cmp( home->name, obj->owner ) )
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void fread_obj( CHAR_DATA * ch, FILE * fp, short os_type )
|
||||
{
|
||||
OBJ_DATA *obj;
|
||||
|
|
@ -1980,6 +2033,22 @@ void fread_obj( CHAR_DATA * ch, FILE * fp, short os_type )
|
|||
|
||||
if( !strcmp( word, "End" ) )
|
||||
{
|
||||
if( obj->item_type == ITEM_HOUSEKEY )
|
||||
{
|
||||
if( !check_owner( obj ) )
|
||||
{
|
||||
bug( "%s: house key found not belonging to correct house", __FUNCTION__ );
|
||||
if( obj->name )
|
||||
STRFREE( obj->name );
|
||||
if( obj->description )
|
||||
STRFREE( obj->description );
|
||||
if( obj->short_descr )
|
||||
STRFREE( obj->short_descr );
|
||||
DISPOSE( obj );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if( !fNest || !fVnum )
|
||||
{
|
||||
if( obj->name )
|
||||
|
|
|
|||
10
src/update.c
10
src/update.c
|
|
@ -41,6 +41,9 @@ void subtract_times( struct timeval *etime, struct timeval *sttime );
|
|||
/* From interp.c */
|
||||
bool check_social( CHAR_DATA * ch, const char *command, const char *argument );
|
||||
|
||||
/* From house.c */
|
||||
void homebuy_update( );
|
||||
|
||||
/*
|
||||
* Global Variables
|
||||
*/
|
||||
|
|
@ -1959,6 +1962,7 @@ void update_handler( void )
|
|||
static int pulse_point;
|
||||
static int pulse_second;
|
||||
static int pulse_time;
|
||||
static int pulse_houseauc;
|
||||
struct timeval sttime;
|
||||
struct timeval etime;
|
||||
|
||||
|
|
@ -1969,6 +1973,12 @@ void update_handler( void )
|
|||
gettimeofday( &sttime, NULL );
|
||||
}
|
||||
|
||||
if( --pulse_houseauc <= 0 )
|
||||
{
|
||||
pulse_houseauc = 1800 * PULSE_PER_SECOND;
|
||||
homebuy_update();
|
||||
}
|
||||
|
||||
if( --pulse_area <= 0 )
|
||||
{
|
||||
pulse_area = number_range( PULSE_AREA / 2, 3 * PULSE_AREA / 2 );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue