forked from kyonshi/grenzland-mud
Compare commits
77 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 744286a1f7 | |||
| f6339b495e | |||
| df3aefe9b8 | |||
| 3e0c1ccc18 | |||
| b9d84fc325 | |||
| bdaca46e79 | |||
| f1794521cf | |||
| 89eb009c4f | |||
| 9a0a096f85 | |||
| ba7dc7bf6f | |||
| 558e71eed8 | |||
| a4af23538f | |||
| b471ff195e | |||
| 0e110b93d5 | |||
| 392f3d90b8 | |||
| be8de64cf8 | |||
| 5024dd8e66 | |||
| 69888a5d89 | |||
| 1ccb6adaee | |||
| b489a72c58 | |||
| 9c5787129b | |||
| d3227f1300 | |||
| fdb6ff3771 | |||
| 5c44f0575e | |||
| 88b3027ec6 | |||
| 7036a15782 | |||
| e6085172d5 | |||
| e59420363a | |||
| c838a513dd | |||
| ed9e5e1c5a | |||
| 762cb77c60 | |||
| 317286d051 | |||
| ac711ffff8 | |||
| cde4b84be1 | |||
| 5da67ddc6a | |||
| b2d38522e0 | |||
| 498b652546 | |||
| 213e52d255 | |||
| 79e2f91894 | |||
| 7f495670f2 | |||
| e9c9808a24 | |||
| c9ebc7174c | |||
| bde600051d | |||
| a745935421 | |||
| 0ee3aac10d | |||
| 15074b1d93 | |||
| 8f67dd880c | |||
| 34aca229df | |||
| 041765438a | |||
| 59398b2fdc | |||
| 97bd28ffd3 | |||
| 7039f9c402 | |||
| 3635026433 | |||
| 16a46903e4 | |||
| 2d8c05b4ed | |||
| 95d4da4972 | |||
| 9c801f9ab6 | |||
| 5305783e1b | |||
| 68dd901943 | |||
| 547c7ddccf | |||
| dceb563a9b | |||
| c0fb6f8a71 | |||
| 1f520546b2 | |||
| 6fede208d2 | |||
| fc223452e8 | |||
| a60f0eefb8 | |||
| 53870eba5d | |||
| d5a11618f1 | |||
| 140cdc5d22 | |||
| eb650c2811 | |||
| 4f875db90e | |||
| 7f0acefcb4 | |||
| 28ca86645b | |||
| 1ab51a0545 | |||
| bf31d98414 | |||
| 934d83b829 | |||
| 462807d9e8 |
@@ -0,0 +1,55 @@
|
|||||||
|
---
|
||||||
|
Language: Cpp
|
||||||
|
BasedOnStyle: LLVM
|
||||||
|
AccessModifierOffset: -4
|
||||||
|
AlignConsecutiveAssignments: false
|
||||||
|
AlignConsecutiveDeclarations: false
|
||||||
|
AlignOperands: Align
|
||||||
|
AlignTrailingComments: true
|
||||||
|
AlwaysBreakTemplateDeclarations: Yes
|
||||||
|
BraceWrapping:
|
||||||
|
AfterCaseLabel: true
|
||||||
|
AfterClass: true
|
||||||
|
AfterControlStatement: false
|
||||||
|
AfterEnum: true
|
||||||
|
AfterFunction: true
|
||||||
|
AfterNamespace: true
|
||||||
|
AfterStruct: true
|
||||||
|
AfterUnion: true
|
||||||
|
AfterExternBlock: false
|
||||||
|
BeforeCatch: true
|
||||||
|
BeforeElse: false
|
||||||
|
BeforeLambdaBody: true
|
||||||
|
BeforeWhile: true
|
||||||
|
SplitEmptyFunction: true
|
||||||
|
SplitEmptyRecord: true
|
||||||
|
SplitEmptyNamespace: true
|
||||||
|
BreakBeforeBraces: Custom
|
||||||
|
BreakBeforeBinaryOperators: All
|
||||||
|
BreakConstructorInitializers: AfterColon
|
||||||
|
BreakConstructorInitializersBeforeComma: false
|
||||||
|
|
||||||
|
ColumnLimit: 120
|
||||||
|
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||||
|
IncludeCategories:
|
||||||
|
- Regex: '^<.*'
|
||||||
|
Priority: 1
|
||||||
|
- Regex: '^".*'
|
||||||
|
Priority: 2
|
||||||
|
- Regex: '.*'
|
||||||
|
Priority: 3
|
||||||
|
IncludeIsMainRegex: '([-_](test|unittest))?$'
|
||||||
|
IndentCaseBlocks: true
|
||||||
|
IndentWidth: 2
|
||||||
|
InsertNewlineAtEOF: true
|
||||||
|
MacroBlockBegin: ''
|
||||||
|
MacroBlockEnd: ''
|
||||||
|
MaxEmptyLinesToKeep: 2
|
||||||
|
NamespaceIndentation: All
|
||||||
|
SpaceInEmptyParentheses: false
|
||||||
|
SpacesInAngles: false
|
||||||
|
SpacesInConditionalStatement: false
|
||||||
|
SpacesInCStyleCastParentheses: false
|
||||||
|
SpacesInParentheses: false
|
||||||
|
TabWidth: 2
|
||||||
|
...
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
Checks: >
|
||||||
|
-*,
|
||||||
|
clang-analyzer-*,
|
||||||
|
bugprone-*,
|
||||||
|
performance-*,
|
||||||
|
portability-*
|
||||||
|
#WarningsAsErrors: '*'
|
||||||
|
HeaderFilterRegex: 'src/.*'
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
name: C/C++ CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "master" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "master" ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: configure
|
||||||
|
run: ./configure
|
||||||
|
- name: build
|
||||||
|
run: cd src && touch .accepted && make
|
||||||
+83
@@ -10,3 +10,86 @@ src/util/Makefile
|
|||||||
src/.accepted
|
src/.accepted
|
||||||
src/depend
|
src/depend
|
||||||
src/util/depend
|
src/util/depend
|
||||||
|
build/*
|
||||||
|
|
||||||
|
# Do not commit files from players
|
||||||
|
lib/plrfiles/A-E/*
|
||||||
|
lib/plrfiles/F-J/*
|
||||||
|
lib/plrfiles/K-O/*
|
||||||
|
lib/plrfiles/P-T/*
|
||||||
|
lib/plrfiles/U-Z/*
|
||||||
|
lib/plrfiles/ZZZ/*
|
||||||
|
lib/plrfiles/index
|
||||||
|
|
||||||
|
# but do commit the placeholders
|
||||||
|
!lib/plrfiles/A-E/00
|
||||||
|
!lib/plrfiles/F-J/00
|
||||||
|
!lib/plrfiles/K-O/00
|
||||||
|
!lib/plrfiles/P-T/00
|
||||||
|
!lib/plrfiles/U-Z/00
|
||||||
|
!lib/plrfiles/ZZZ/00
|
||||||
|
|
||||||
|
# or vars
|
||||||
|
lib/plrvars/A-E/*
|
||||||
|
lib/plrvars/F-J/*
|
||||||
|
lib/plrvars/K-O/*
|
||||||
|
lib/plrvars/P-T/*
|
||||||
|
lib/plrvars/U-Z/*
|
||||||
|
lib/plrvars/ZZZ/*
|
||||||
|
lib/plrvars/index
|
||||||
|
|
||||||
|
# except the placeholders
|
||||||
|
!lib/plrvars/A-E/00
|
||||||
|
!lib/plrvars/F-J/00
|
||||||
|
!lib/plrvars/K-O/00
|
||||||
|
!lib/plrvars/P-T/00
|
||||||
|
!lib/plrvars/U-Z/00
|
||||||
|
!lib/plrvars/ZZZ/00
|
||||||
|
|
||||||
|
# or objects
|
||||||
|
lib/plrobjs/A-E/*
|
||||||
|
lib/plrobjs/F-J/*
|
||||||
|
lib/plrobjs/K-O/*
|
||||||
|
lib/plrobjs/P-T/*
|
||||||
|
lib/plrobjs/U-Z/*
|
||||||
|
lib/plrobjs/ZZZ/*
|
||||||
|
lib/plrobjs/index
|
||||||
|
|
||||||
|
# except the placeholders
|
||||||
|
!lib/plrobjs/A-E/00
|
||||||
|
!lib/plrobjs/F-J/00
|
||||||
|
!lib/plrobjs/K-O/00
|
||||||
|
!lib/plrobjs/P-T/00
|
||||||
|
!lib/plrobjs/U-Z/00
|
||||||
|
!lib/plrobjs/ZZZ/00
|
||||||
|
|
||||||
|
# also not autogenerated config file
|
||||||
|
/lib/etc/config
|
||||||
|
# or the list of last logins
|
||||||
|
/lib/etc/last
|
||||||
|
# or mail
|
||||||
|
lib/etc/plrmail
|
||||||
|
#or time
|
||||||
|
lib/etc/time
|
||||||
|
|
||||||
|
# test object files, etc
|
||||||
|
src/test/depend
|
||||||
|
src/test/*.o
|
||||||
|
src/test/testfile
|
||||||
|
|
||||||
|
|
||||||
|
# ide etc.
|
||||||
|
.vscode
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.idea
|
||||||
|
.cproject
|
||||||
|
|
||||||
|
# macOS generated files
|
||||||
|
.DS_Store
|
||||||
|
.DS_Store?
|
||||||
|
._*
|
||||||
|
.Spotlight-V100
|
||||||
|
.Trashes
|
||||||
|
ehthumbs.db
|
||||||
|
Thumbs.db
|
||||||
|
|||||||
+407
@@ -0,0 +1,407 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.12)
|
||||||
|
project(TbaMUD C)
|
||||||
|
|
||||||
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
|
||||||
|
# Include checker modules
|
||||||
|
include(CheckFunctionExists)
|
||||||
|
include(CheckIncludeFile)
|
||||||
|
include(CheckTypeSize)
|
||||||
|
include(CheckStructHasMember)
|
||||||
|
include(CheckSymbolExists)
|
||||||
|
include(CheckCSourceCompiles)
|
||||||
|
|
||||||
|
# Output paths
|
||||||
|
set(BIN_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/bin)
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIR})
|
||||||
|
|
||||||
|
# Include source and build paths
|
||||||
|
include_directories(src ${CMAKE_BINARY_DIR})
|
||||||
|
|
||||||
|
# ========== Compiler flags ==========
|
||||||
|
if (CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
include(CheckCCompilerFlag)
|
||||||
|
|
||||||
|
check_c_compiler_flag(-Wall SUPPORTS_WALL)
|
||||||
|
check_c_compiler_flag(-Wno-char-subscripts SUPPORTS_WNO_CHAR_SUBSCRIPTS)
|
||||||
|
|
||||||
|
if (SUPPORTS_WALL)
|
||||||
|
set(MYFLAGS "-Wall")
|
||||||
|
if (SUPPORTS_WNO_CHAR_SUBSCRIPTS)
|
||||||
|
set(MYFLAGS "${MYFLAGS} -Wno-char-subscripts")
|
||||||
|
endif()
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MYFLAGS}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# clang-tidy if available
|
||||||
|
find_program(CLANG_TIDY_EXE NAMES clang-tidy)
|
||||||
|
|
||||||
|
if(CLANG_TIDY_EXE AND STATIC_ANALYSIS)
|
||||||
|
message(STATUS "clang-tidy enabled: ${CLANG_TIDY_EXE}")
|
||||||
|
set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY_EXE}")
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
else()
|
||||||
|
message(WARNING "clang-tidy not found. Static analysis disabled.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# ========== Header checks ==========
|
||||||
|
check_include_file("fcntl.h" HAVE_FCNTL_H)
|
||||||
|
check_include_file("errno.h" HAVE_ERRNO_H)
|
||||||
|
check_include_file("string.h" HAVE_STRING_H)
|
||||||
|
check_include_file("strings.h" HAVE_STRINGS_H)
|
||||||
|
check_include_file("limits.h" HAVE_LIMITS_H)
|
||||||
|
check_include_file("sys/select.h" HAVE_SYS_SELECT_H)
|
||||||
|
check_include_file("sys/wait.h" HAVE_SYS_WAIT_H)
|
||||||
|
check_include_file("sys/types.h" HAVE_SYS_TYPES_H)
|
||||||
|
check_include_file("unistd.h" HAVE_UNISTD_H)
|
||||||
|
check_include_file("memory.h" HAVE_MEMORY_H)
|
||||||
|
check_include_file("assert.h" HAVE_ASSERT_H)
|
||||||
|
check_include_file("arpa/telnet.h" HAVE_ARPA_TELNET_H)
|
||||||
|
check_include_file("arpa/inet.h" HAVE_ARPA_INET_H)
|
||||||
|
check_include_file("sys/stat.h" HAVE_SYS_STAT_H)
|
||||||
|
check_include_file("sys/socket.h" HAVE_SYS_SOCKET_H)
|
||||||
|
check_include_file("sys/resource.h" HAVE_SYS_RESOURCE_H)
|
||||||
|
check_include_file("netinet/in.h" HAVE_NETINET_IN_H)
|
||||||
|
check_include_file("netdb.h" HAVE_NETDB_H)
|
||||||
|
check_include_file("signal.h" HAVE_SIGNAL_H)
|
||||||
|
check_include_file("sys/uio.h" HAVE_SYS_UIO_H)
|
||||||
|
check_include_file("mcheck.h" HAVE_MCHECK_H)
|
||||||
|
check_include_file("stdlib.h" HAVE_STDLIB_H)
|
||||||
|
check_include_file("stdarg.h" HAVE_STDARG_H)
|
||||||
|
check_include_file("float.h" HAVE_FLOAT_H)
|
||||||
|
|
||||||
|
if (HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H)
|
||||||
|
set(STDC_HEADERS 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# macros
|
||||||
|
macro(check_run_return_value CODE EXPECTED_RESULT VAR_NAME)
|
||||||
|
set(_file "${CMAKE_BINARY_DIR}/check_run_${VAR_NAME}.c")
|
||||||
|
file(WRITE "${_file}" "${CODE}")
|
||||||
|
try_run(_run_result _compile_result
|
||||||
|
${CMAKE_BINARY_DIR} ${_file}
|
||||||
|
)
|
||||||
|
if (_compile_result EQUAL 0 AND _run_result EQUAL ${EXPECTED_RESULT})
|
||||||
|
set(${VAR_NAME} TRUE)
|
||||||
|
else()
|
||||||
|
set(${VAR_NAME} FALSE)
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
# ========== Function checks ==========
|
||||||
|
foreach(FUNC gettimeofday select snprintf strcasecmp strdup strerror
|
||||||
|
stricmp strlcpy strncasecmp strnicmp strstr vsnprintf vprintf
|
||||||
|
inet_addr inet_aton)
|
||||||
|
string(TOUPPER "${FUNC}" _upper_name)
|
||||||
|
check_function_exists(${FUNC} HAVE_${_upper_name})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
if (NOT HAVE_VPRINTF)
|
||||||
|
check_function_exists(_doprnt HAVE_DOPRNT)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
# ========== Type checks ==========
|
||||||
|
check_type_size("pid_t" HAVE_PID_T)
|
||||||
|
check_type_size("size_t" HAVE_SIZE_T)
|
||||||
|
check_type_size("ssize_t" HAVE_SSIZE_T)
|
||||||
|
set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
|
||||||
|
check_type_size("socklen_t" HAVE_SOCKLEN_T)
|
||||||
|
unset(CMAKE_EXTRA_INCLUDE_FILES)
|
||||||
|
|
||||||
|
|
||||||
|
if (NOT HAVE_PID_T)
|
||||||
|
set(pid_t int)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT HAVE_SIZE_T)
|
||||||
|
set(size_t "unsigned")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT HAVE_SSIZE_T)
|
||||||
|
set(ssize_t int)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT HAVE_SOCKLEN_T)
|
||||||
|
set(socklen_t int)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# ========== const ==========
|
||||||
|
check_c_source_compiles("
|
||||||
|
int main() {
|
||||||
|
|
||||||
|
/* Ultrix mips cc rejects this. */
|
||||||
|
typedef int charset[2]; const charset x;
|
||||||
|
/* SunOS 4.1.1 cc rejects this. */
|
||||||
|
char const *const *ccp;
|
||||||
|
char **p;
|
||||||
|
/* NEC SVR4.0.2 mips cc rejects this. */
|
||||||
|
struct point {int x, y;};
|
||||||
|
static struct point const zero = {0,0};
|
||||||
|
/* AIX XL C 1.02.0.0 rejects this.
|
||||||
|
It does not let you subtract one const X* pointer from another in an arm
|
||||||
|
of an if-expression whose if-part is not a constant expression */
|
||||||
|
const char *g = \"string\";
|
||||||
|
ccp = &g + (g ? g-g : 0);
|
||||||
|
/* HPUX 7.0 cc rejects these. */
|
||||||
|
++ccp;
|
||||||
|
p = (char**) ccp;
|
||||||
|
ccp = (char const *const *) p;
|
||||||
|
{ /* SCO 3.2v4 cc rejects this. */
|
||||||
|
char *t;
|
||||||
|
char const *s = 0 ? (char *) 0 : (char const *) 0;
|
||||||
|
|
||||||
|
*t++ = 0;
|
||||||
|
}
|
||||||
|
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
|
||||||
|
int x[] = {25, 17};
|
||||||
|
const int *foo = &x[0];
|
||||||
|
++foo;
|
||||||
|
}
|
||||||
|
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
|
||||||
|
typedef const int *iptr;
|
||||||
|
iptr p = 0;
|
||||||
|
++p;
|
||||||
|
}
|
||||||
|
{ /* AIX XL C 1.02.0.0 rejects this saying
|
||||||
|
\"k.c\", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
|
||||||
|
struct s { int j; const int *ap[3]; };
|
||||||
|
struct s *b; b->j = 5;
|
||||||
|
}
|
||||||
|
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
|
||||||
|
const int foo = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
; return 0; }
|
||||||
|
" HAVE_CONST)
|
||||||
|
|
||||||
|
if (HAVE_CONST)
|
||||||
|
set(CONST_KEYWORD const)
|
||||||
|
else()
|
||||||
|
set(CONST_KEYWORD "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# ========== Struct checks ==========
|
||||||
|
if (HAVE_NETINET_IN_H)
|
||||||
|
check_struct_has_member("struct in_addr" s_addr netinet/in.h HAVE_STRUCT_IN_ADDR)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# ========== crypt()/libcrypt ==========
|
||||||
|
|
||||||
|
find_library(CRYPT_LIBRARY crypt)
|
||||||
|
if (CRYPT_LIBRARY)
|
||||||
|
message(STATUS "Found libcrypt: ${CRYPT_LIBRARY}")
|
||||||
|
list(APPEND EXTRA_LIBS ${CRYPT_LIBRARY})
|
||||||
|
set(_saved_lib_list ${CMAKE_REQUIRED_LIBRARIES})
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES ${CRYPT_LIBRARY})
|
||||||
|
check_include_file("crypt.h" HAVE_CRYPT_H)
|
||||||
|
check_function_exists(crypt CIRCLE_CRYPT)
|
||||||
|
|
||||||
|
check_run_return_value("
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
${HAVE_CRYPT_H} ? \"#include <crypt.h>\" : \"\"
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
char pwd[11], pwd2[11];
|
||||||
|
|
||||||
|
strncpy(pwd, (char *)crypt(\"FooBar\", \"BazQux\"), 10);
|
||||||
|
pwd[10] = '\\\\0';
|
||||||
|
strncpy(pwd2, (char *)crypt(\"xyzzy\", \"BazQux\"), 10);
|
||||||
|
pwd2[10] = '\\\\0';
|
||||||
|
if (strcmp(pwd, pwd2) == 0)
|
||||||
|
exit(0);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
" 0 HAVE_UNSAFE_CRYPT)
|
||||||
|
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES ${_saved_lib_list})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
# ========== network libs ==========
|
||||||
|
check_function_exists(gethostbyaddr HAVE_GETHOSTBYADDR)
|
||||||
|
if (NOT HAVE_GETHOSTBYADDR)
|
||||||
|
message(STATUS "gethostbyaddr() not available, trying nsllib")
|
||||||
|
find_library(NSL_LIBRARY nsl)
|
||||||
|
if (NSL_LIBRARY)
|
||||||
|
message(STATUS "...nsllib found.")
|
||||||
|
list(APPEND EXTRA_LIBS ${NSL_LIBRARY})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
check_function_exists(socket HAVE_SOCKET)
|
||||||
|
if (NOT HAVE_SOCKET)
|
||||||
|
message(STATUS "socket() not available, trying socketlib")
|
||||||
|
find_library(SOCKET_LIBRARY socket)
|
||||||
|
if (SOCKET_LIBRARY)
|
||||||
|
message(STATUS "...socketlib found")
|
||||||
|
list(APPEND EXTRA_LIBS ${SOCKET_LIBRARY})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# ========== time.h needs special treatment ==========
|
||||||
|
check_include_file("sys/time.h" HAVE_SYS_TIME_H)
|
||||||
|
check_include_file("sys/time.h" HAVE_TIME_H)
|
||||||
|
|
||||||
|
if (HAVE_SYS_TIME_H AND HAVE_TIME_H)
|
||||||
|
check_c_source_compiles("
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <time.h>
|
||||||
|
int main() {
|
||||||
|
struct tm *tp;
|
||||||
|
; return 0; }
|
||||||
|
" TIME_WITH_SYS_TIME)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# ========== Determine return value of signal() ==========
|
||||||
|
check_c_source_compiles("
|
||||||
|
#include <signal.h>
|
||||||
|
int handler(int sig) { return 0; }
|
||||||
|
int main() {
|
||||||
|
signal(SIGINT, handler);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
" SIGNAL_RETURNS_INT FAIL_REGEX ".*incompatible pointer type.*")
|
||||||
|
|
||||||
|
check_c_source_compiles("
|
||||||
|
#include <signal.h>
|
||||||
|
void handler(int sig) { }
|
||||||
|
int main() {
|
||||||
|
signal(SIGINT, handler);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
" SIGNAL_RETURNS_VOID FAIL_REGEX ".*incompatible pointer type.*")
|
||||||
|
|
||||||
|
if (SIGNAL_RETURNS_INT)
|
||||||
|
message(STATUS "signal() returns int.")
|
||||||
|
set(RETSIGTYPE int)
|
||||||
|
elseif (SIGNAL_RETURNS_VOID)
|
||||||
|
message(STATUS "signal() returns void.")
|
||||||
|
set(RETSIGTYPE void)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Could not determine return value from signal handler.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# ========== Define general UNIX-system ==========
|
||||||
|
if (UNIX)
|
||||||
|
set(CIRCLE_UNIX 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(PROTO_FUNCTIONS
|
||||||
|
accept
|
||||||
|
bind
|
||||||
|
gettimeofday
|
||||||
|
atoi
|
||||||
|
atol
|
||||||
|
bzero
|
||||||
|
chdir
|
||||||
|
close
|
||||||
|
fclose
|
||||||
|
fcntl
|
||||||
|
fflush
|
||||||
|
fprintf
|
||||||
|
fputc
|
||||||
|
fread
|
||||||
|
fscanf
|
||||||
|
fseek
|
||||||
|
fwrite
|
||||||
|
getpeername
|
||||||
|
getpid
|
||||||
|
getrlimit
|
||||||
|
getsockname
|
||||||
|
htonl
|
||||||
|
htons
|
||||||
|
inet_addr
|
||||||
|
inet_aton
|
||||||
|
inet_ntoa
|
||||||
|
listen
|
||||||
|
ntohl
|
||||||
|
perror
|
||||||
|
printf
|
||||||
|
qsort
|
||||||
|
read
|
||||||
|
remove
|
||||||
|
rewind
|
||||||
|
select
|
||||||
|
setitimer
|
||||||
|
setrlimit
|
||||||
|
setsockopt
|
||||||
|
snprintf
|
||||||
|
sprintf
|
||||||
|
sscanf
|
||||||
|
strcasecmp
|
||||||
|
strdup
|
||||||
|
strerror
|
||||||
|
stricmp
|
||||||
|
strlcpy
|
||||||
|
strncasecmp
|
||||||
|
strnicmp
|
||||||
|
system
|
||||||
|
time
|
||||||
|
unlink
|
||||||
|
vsnprintf
|
||||||
|
write
|
||||||
|
socket
|
||||||
|
)
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_SOURCE_DIR}/src/conf.h.cmake.in
|
||||||
|
${CMAKE_BINARY_DIR}/tmp_conf.h
|
||||||
|
)
|
||||||
|
|
||||||
|
macro(check_function_prototype FUNCTION)
|
||||||
|
set(_code "
|
||||||
|
#define NO_LIBRARY_PROTOTYPES
|
||||||
|
#define __COMM_C__
|
||||||
|
#define __ACT_OTHER_C__
|
||||||
|
#include \"${CMAKE_BINARY_DIR}/tmp_conf.h\"
|
||||||
|
#include \"${CMAKE_SOURCE_DIR}/src/sysdep.h\"
|
||||||
|
#ifdef ${FUNCTION}
|
||||||
|
error - already defined!
|
||||||
|
#endif
|
||||||
|
void ${FUNCTION}(int a, char b, int c, char d, int e, char f, int g, char h);
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
|
||||||
|
; return 0; }
|
||||||
|
")
|
||||||
|
string(TOUPPER "${FUNCTION}" _upper_name)
|
||||||
|
check_c_source_compiles("${_code}" NEED_${_upper_name}_PROTO FAIL_REGEX ".*incompatible pointer type.*")
|
||||||
|
if (NEED_${_upper_name}_PROTO)
|
||||||
|
message(STATUS "${FUNCTION}() has no prototype, NEED_${_upper_name}_PROTO set!")
|
||||||
|
else()
|
||||||
|
message(STATUS "${FUNCTION}() has a prototype, not setting NEED_${_upper_name}_PROTO")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
|
foreach (FUNC ${PROTO_FUNCTIONS})
|
||||||
|
check_function_prototype(${FUNC})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
|
||||||
|
# ========== Generate conf.h ==========
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_SOURCE_DIR}/src/conf.h.cmake.in
|
||||||
|
${CMAKE_BINARY_DIR}/conf.h
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# ========== Source-filer ==========
|
||||||
|
file(GLOB SRC_FILES src/*.c)
|
||||||
|
|
||||||
|
# ========== Bygg kjørbar ==========
|
||||||
|
add_executable(circle ${SRC_FILES})
|
||||||
|
target_link_libraries(circle ${EXTRA_LIBS})
|
||||||
|
|
||||||
|
add_subdirectory(src/util)
|
||||||
|
|
||||||
|
if (MEMORY_DEBUG)
|
||||||
|
message(STATUS "MEMORY_DEBUG is activated, setting up zmalloc")
|
||||||
|
target_compile_definitions(circle PRIVATE MEMORY_DEBUG)
|
||||||
|
endif()
|
||||||
@@ -1227,18 +1227,28 @@ if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
|
|||||||
cat >> confdefs.h <<\EOF
|
cat >> confdefs.h <<\EOF
|
||||||
#define CIRCLE_CRYPT 1
|
#define CIRCLE_CRYPT 1
|
||||||
EOF
|
EOF
|
||||||
|
CRYPTLIB="-lcrypt"
|
||||||
|
echo "CRYPTLIB set to: $CRYPTLIB" 1>&6
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "$ac_t""no" 1>&6
|
echo "$ac_t""no" 1>&6
|
||||||
echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
|
echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
|
||||||
echo "configure:1235: checking for crypt in -lcrypt" >&5
|
echo "configure:1235: checking for crypt in -lcrypt" >&5
|
||||||
ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
|
|
||||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
OS_NAME=$(uname)
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
if [ "$OS_NAME" = "Darwin" ]; then
|
||||||
else
|
# macOS: No need for -lcrypt
|
||||||
ac_save_LIBS="$LIBS"
|
CRYPTLIB=""
|
||||||
LIBS="-lcrypt $LIBS"
|
echo "CRYPTLIB not needed on macOS" 1>&6
|
||||||
cat > conftest.$ac_ext <<EOF
|
else
|
||||||
|
# Other systems (Linux): Use -lcrypt
|
||||||
|
ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
|
||||||
|
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||||
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
|
else
|
||||||
|
ac_save_LIBS="$LIBS"
|
||||||
|
LIBS="-lcrypt $LIBS"
|
||||||
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 1243 "configure"
|
#line 1243 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
/* Override any gcc2 internal prototype to avoid an error. */
|
/* Override any gcc2 internal prototype to avoid an error. */
|
||||||
@@ -1250,30 +1260,29 @@ int main() {
|
|||||||
crypt()
|
crypt()
|
||||||
; return 0; }
|
; return 0; }
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:1254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
if { (eval echo configure:1254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||||
else
|
else
|
||||||
echo "configure: failed program was:" >&5
|
echo "configure: failed program was:" >&5
|
||||||
cat conftest.$ac_ext >&5
|
cat conftest.$ac_ext >&5
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
eval "ac_cv_lib_$ac_lib_var=no"
|
eval "ac_cv_lib_$ac_lib_var=no"
|
||||||
fi
|
fi
|
||||||
rm -f conftest*
|
rm -f conftest*
|
||||||
LIBS="$ac_save_LIBS"
|
LIBS="$ac_save_LIBS"
|
||||||
|
fi
|
||||||
fi
|
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
|
||||||
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
|
echo "$ac_t""yes" 1>&6
|
||||||
echo "$ac_t""yes" 1>&6
|
cat >> confdefs.h <<\EOF
|
||||||
cat >> confdefs.h <<\EOF
|
|
||||||
#define CIRCLE_CRYPT 1
|
#define CIRCLE_CRYPT 1
|
||||||
EOF
|
EOF
|
||||||
CRYPTLIB="-lcrypt"
|
CRYPTLIB="-lcrypt"
|
||||||
else
|
echo "CRYPTLIB set to: $CRYPTLIB on Linux" 1>&6
|
||||||
echo "$ac_t""no" 1>&6
|
else
|
||||||
fi
|
echo "$ac_t""no" 1>&6
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -257,6 +257,9 @@ http://tbamud.com
|
|||||||
All donated areas have been added to the latest version of tbaMUD. If you
|
All donated areas have been added to the latest version of tbaMUD. If you
|
||||||
wish to donate some of your own work stop by the Builder Academy.
|
wish to donate some of your own work stop by the Builder Academy.
|
||||||
|
|
||||||
|
https://github.com/rds1983 has generated maps of all the existing areas,
|
||||||
|
and they can be found here: https://mudmapbuilder.github.io/
|
||||||
|
|
||||||
2.3. I have questions about tbaMUD. Where should I go?
|
2.3. I have questions about tbaMUD. Where should I go?
|
||||||
|
|
||||||
Stop by The Builder Academy at tbamud.com 9091 or the website at:
|
Stop by The Builder Academy at tbamud.com 9091 or the website at:
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
Updated: Apr 2007
|
Updated: Apr 2007
|
||||||
tbaMUD README
|
tbaMUD README
|
||||||
-------------
|
-------------
|
||||||
All requests for help or bugs should be reported to: builderacademy.net 9091.
|
All requests for help or bugs should be reported to: tbamud.com 9091.
|
||||||
|
|
||||||
Information about CircleMUD can be found at the CircleMUD Home Page and FTP:
|
Information about CircleMUD can be found at the CircleMUD Home Page and FTP:
|
||||||
http://www.circlemud.org
|
http://www.circlemud.org
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
Updated 2025-04
|
||||||
|
|
||||||
|
## Building TbaMUD with the cmake tool
|
||||||
|
|
||||||
|
# Building with CMake
|
||||||
|
|
||||||
|
This document describes how to configure, build and install tbamud
|
||||||
|
from source code using the CMake build tool. To build with CMake, you of
|
||||||
|
course first have to install CMake. The minimum required version of CMake is
|
||||||
|
specified in the file `CMakeLists.txt` found in the top of the tbamud source
|
||||||
|
tree. Once the correct version of CMake is installed you can follow the
|
||||||
|
instructions below for the platform you are building on.
|
||||||
|
|
||||||
|
CMake builds can be configured either from the command line, or from one of
|
||||||
|
CMake's GUIs.
|
||||||
|
|
||||||
|
NOTE: The current CMakeLists.txt only supports linux.
|
||||||
|
|
||||||
|
# Configuring
|
||||||
|
|
||||||
|
A CMake configuration of tbamud is similar to the autotools build of curl.
|
||||||
|
It consists of the following steps after you have unpacked the source.
|
||||||
|
|
||||||
|
We recommend building with CMake on Windows.
|
||||||
|
|
||||||
|
## Using `cmake`
|
||||||
|
|
||||||
|
You can configure for in source tree builds or for a build tree
|
||||||
|
that is apart from the source tree.
|
||||||
|
|
||||||
|
- Build in a separate directory (parallel to the source tree in this
|
||||||
|
example). The build directory is created for you. This is recommended over
|
||||||
|
building in the source tree to separate source and build artifacts.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ cmake -B build -S .
|
||||||
|
```
|
||||||
|
|
||||||
|
- Build in the source tree. Not recommended.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ cmake -B .
|
||||||
|
```
|
||||||
|
|
||||||
|
The examples below will assume you have created a build folder.
|
||||||
|
|
||||||
|
The above commands will generate the build files. If you need to regenerate
|
||||||
|
the files, you can delete the cmake cache file, and rerun the above command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ rm build/CMakeCache.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
Once the build files are generated, the build is run with cmake
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ cmake --build build
|
||||||
|
```
|
||||||
|
|
||||||
|
This will generate the object files in a subdirectory under the specified
|
||||||
|
build folder and link the executable. The resulting binaries will be in the
|
||||||
|
bin/ folder.
|
||||||
|
|
||||||
|
### Utilities
|
||||||
|
|
||||||
|
It is possible to build only single tools, none or all of them,
|
||||||
|
by specifying the target in the build command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# only build the mud
|
||||||
|
$ cmake --build build --target circle
|
||||||
|
|
||||||
|
# only build tools
|
||||||
|
$ cmake --build build --target utils
|
||||||
|
|
||||||
|
# only build one tool
|
||||||
|
$ cmake --build build --target wld2html
|
||||||
|
```
|
||||||
|
|
||||||
|
### Debugging memory
|
||||||
|
|
||||||
|
In case you want to run the mud with memory debugging turned on, you
|
||||||
|
can set the MEMORY_DEBUG flag during configuration by specifying the
|
||||||
|
flag:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ cmake -B build -S . -DMEMORY_DEBUG:int=1
|
||||||
|
$ cmake --build build
|
||||||
|
```
|
||||||
|
|
||||||
|
When the mud is shut down, the zmalloc code will identify any leaks in your code.
|
||||||
|
Note that memory debugging may consume quite a lot of memory and take some time
|
||||||
|
to be handled on shutdown.
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
Updated: Apr 2025
|
||||||
|
Compiling CircleMUD under Microsoft Windows XP
|
||||||
|
using Microsoft Visual C++ 2022 (8.0)
|
||||||
|
|
||||||
|
### Overview
|
||||||
|
This guide describes how to build TbaMUD in the Visual Studio through the new experimental CMake environment.
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
* [Visual Studio 2022+](https://visualstudio.microsoft.com/ru/vs/)
|
||||||
|
* [CMake 3.27+](https://cmake.org/)
|
||||||
|
|
||||||
|
### Build Steps
|
||||||
|
1. Goto the folder `src` and copy `conf.h.win` to `conf.h`.
|
||||||
|
|
||||||
|
2. Run this command in the root folder:
|
||||||
|
|
||||||
|
cmake -B build -S . -G "Visual Studio 17 2022"
|
||||||
|
|
||||||
|
3. Open `build/circle.sln` in Visual Studio.
|
||||||
|
|
||||||
|
4. Compile and run.
|
||||||
+15
-15
@@ -24,7 +24,7 @@ Contents
|
|||||||
1.1 Overview
|
1.1 Overview
|
||||||
The act() function is used to process and send strings of text to characters
|
The act() function is used to process and send strings of text to characters
|
||||||
in a room. It can be used to send the same basic string to a number of
|
in a room. It can be used to send the same basic string to a number of
|
||||||
characters filling in certain segments – designated by control characters –
|
characters filling in certain segments – designated by control characters –
|
||||||
in different ways, dependant on what each character can see and who each
|
in different ways, dependant on what each character can see and who each
|
||||||
character is. Once the text string passed to the function has been parsed, it
|
character is. Once the text string passed to the function has been parsed, it
|
||||||
is capitalized and a newline is added to its tail.
|
is capitalized and a newline is added to its tail.
|
||||||
@@ -38,17 +38,17 @@ struct obj_data *obj, const void *vict_obj, int type)
|
|||||||
These pieces are used as follows:
|
These pieces are used as follows:
|
||||||
|
|
||||||
str: This is the basic string, a null terminated character array, including
|
str: This is the basic string, a null terminated character array, including
|
||||||
control characters (see section 1.4 on ‘Control Characters’), to be sent to
|
control characters (see section 1.4 on ‘Control Characters’), to be sent to
|
||||||
characters designated by the targets.
|
characters designated by the targets.
|
||||||
|
|
||||||
hide_invisible: A TRUE or FALSE value indicating whether or not to hide the
|
hide_invisible: A TRUE or FALSE value indicating whether or not to hide the
|
||||||
entire output from any characters that cannot see the “performing character”.
|
entire output from any characters that cannot see the “performing character”.
|
||||||
|
|
||||||
ch: The “performing character”. This is the character that the output string
|
ch: The “performing character”. This is the character that the output string
|
||||||
is associated with. The character is used to determine the room for the output
|
is associated with. The character is used to determine the room for the output
|
||||||
of the action in question.
|
of the action in question.
|
||||||
|
|
||||||
obj: An object (an actual item – obj_data) used in the course of the action.
|
obj: An object (an actual item – obj_data) used in the course of the action.
|
||||||
|
|
||||||
vict_obj: This can be either a character involved in the action, another
|
vict_obj: This can be either a character involved in the action, another
|
||||||
object, or even a predefined string of text.
|
object, or even a predefined string of text.
|
||||||
@@ -73,7 +73,7 @@ The next parameter vict_objcan be a number of things ranging from a game object
|
|||||||
null terminated character array (char *).
|
null terminated character array (char *).
|
||||||
|
|
||||||
Do note, however, that obj and vict_obj are both ignored if there is no control
|
Do note, however, that obj and vict_obj are both ignored if there is no control
|
||||||
character reference (see section 1.4 ‘Control Characters’) to them and the type
|
character reference (see section 1.4 ‘Control Characters’) to them and the type
|
||||||
is set to TO_ROOM or TO_CHAR. In these cases, NULL should be supplied as the
|
is set to TO_ROOM or TO_CHAR. In these cases, NULL should be supplied as the
|
||||||
input to the function.
|
input to the function.
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ TO_CHAR: Finally, this option sends the output to the ch.
|
|||||||
|
|
||||||
TO_SLEEP: This is a special option that must be combined with one of the above
|
TO_SLEEP: This is a special option that must be combined with one of the above
|
||||||
options. It tells act() that the output is to be sent even to characters that
|
options. It tells act() that the output is to be sent even to characters that
|
||||||
are sleeping. It is combined with a bitwise ‘or’. i.e. TO_VICT | TO_SLEEP.
|
are sleeping. It is combined with a bitwise ‘or’. i.e. TO_VICT | TO_SLEEP.
|
||||||
|
|
||||||
When the string has been parsed, it is capitalized and a newline is added.
|
When the string has been parsed, it is capitalized and a newline is added.
|
||||||
|
|
||||||
@@ -105,20 +105,20 @@ In a manner similar to the printf() family of functions, act() uses control
|
|||||||
characters. However, instead of using the % symbol, act() uses the $ character
|
characters. However, instead of using the % symbol, act() uses the $ character
|
||||||
to indicate control characters.
|
to indicate control characters.
|
||||||
|
|
||||||
$n Write name, short description, or “someone”, for ch, depending on whether
|
$n Write name, short description, or “someone”, for ch, depending on whether
|
||||||
ch is a PC, a NPC, or an invisible PC/NPC.
|
ch is a PC, a NPC, or an invisible PC/NPC.
|
||||||
$N Like $n, except insert the text for vict_obj.*
|
$N Like $n, except insert the text for vict_obj.*
|
||||||
$m “him,” “her,” or “it,” depending on the gender of ch.
|
$m “him,” “her,” or “it,” depending on the gender of ch.
|
||||||
$M Like $m, for vict_obj.*
|
$M Like $m, for vict_obj.*
|
||||||
$s “his,” “her,”or “it,” depending on the gender of ch.
|
$s “his,” “her,”or “it,” depending on the gender of ch.
|
||||||
$S Like $s, for vict_obj.*
|
$S Like $s, for vict_obj.*
|
||||||
$e “he,” “she,” “it,” depending on the gender of ch.
|
$e “he,” “she,” “it,” depending on the gender of ch.
|
||||||
$E Like $e, for vict_obj.*
|
$E Like $e, for vict_obj.*
|
||||||
$o Name or “something” for obj, depending on visibility.
|
$o Name or “something” for obj, depending on visibility.
|
||||||
$O Like $o, for vict_obj.*
|
$O Like $o, for vict_obj.*
|
||||||
$p Short description or “something” for obj.
|
$p Short description or “something” for obj.
|
||||||
$P Like $p for vict_obj.*
|
$P Like $p for vict_obj.*
|
||||||
$a “an” or“a”, depending on the first character of obj’s name.
|
$a “an” or“a”, depending on the first character of obj’s name.
|
||||||
$A Like $a, for vict_obj.*
|
$A Like $a, for vict_obj.*
|
||||||
$T Prints the string pointed to by vict_obj.*
|
$T Prints the string pointed to by vict_obj.*
|
||||||
$F Processes the string pointed to by vict_obj with the fname() function prior
|
$F Processes the string pointed to by vict_obj with the fname() function prior
|
||||||
@@ -129,7 +129,7 @@ no action is taken.
|
|||||||
$U Processes the buffer and uppercases the first letter of the following word
|
$U Processes the buffer and uppercases the first letter of the following word
|
||||||
(the word immediately after to the control code). If there is no following
|
(the word immediately after to the control code). If there is no following
|
||||||
word, no action is taken.
|
word, no action is taken.
|
||||||
$$ Print the character ‘$’.
|
$$ Print the character ‘$’.
|
||||||
|
|
||||||
NOTE*: vict_obj must be a pointer of type struct char_data *.
|
NOTE*: vict_obj must be a pointer of type struct char_data *.
|
||||||
|
|
||||||
|
|||||||
+24
-24
@@ -9,8 +9,8 @@ to players in color in the tbaMUD game engine. Its intended audience is for
|
|||||||
Coders of tbaMUD.
|
Coders of tbaMUD.
|
||||||
|
|
||||||
tbaMUD allows you to create colorful messages by using ANSI control sequences.
|
tbaMUD allows you to create colorful messages by using ANSI control sequences.
|
||||||
Each player may select what “level” of color he/she desires from the four
|
Each player may select what “level” of color he/she desires from the four
|
||||||
levels “off,” “brief,” “normal,” and “complete.” Each player can select his/her
|
levels “off,” “brief,” “normal,” and “complete.” Each player can select his/her
|
||||||
color level by using the TOGGLE COLOR command from within the MUD; you as the
|
color level by using the TOGGLE COLOR command from within the MUD; you as the
|
||||||
programmer must decide which messages will be colored for each of the color
|
programmer must decide which messages will be colored for each of the color
|
||||||
levels.
|
levels.
|
||||||
@@ -21,17 +21,17 @@ All files in which you wish to use color must have the line:
|
|||||||
|
|
||||||
This should be put in after all other includes in the beginning of the file.
|
This should be put in after all other includes in the beginning of the file.
|
||||||
|
|
||||||
There are 8 colors available – “normal,” red, green, yellow, blue, magenta,
|
There are 8 colors available – “normal,” red, green, yellow, blue, magenta,
|
||||||
cyan and white. They are accessible by sending control sequences as part of
|
cyan and white. They are accessible by sending control sequences as part of
|
||||||
another string, for example:
|
another string, for example:
|
||||||
|
|
||||||
sprintf(buf, "If you’re %shappy%s and you know it clap "
|
sprintf(buf, "If you’re %shappy%s and you know it clap "
|
||||||
"%d of your hands.\n\r", x, y, num_of_hands);
|
"%d of your hands.\n\r", x, y, num_of_hands);
|
||||||
send_to_char(ch, buf);
|
send_to_char(ch, buf);
|
||||||
|
|
||||||
In this example, x and y are the “on” and “off” sequences for the color you
|
In this example, x and y are the “on” and “off” sequences for the color you
|
||||||
want. There are 2 main series of color macros available for you to use (don’t
|
want. There are 2 main series of color macros available for you to use (don’t
|
||||||
actually use “x” and “y,” of course!): the K series and the CC series. The CC
|
actually use “x” and “y,” of course!): the K series and the CC series. The CC
|
||||||
(Conditional Color) series is recommended for most general use.
|
(Conditional Color) series is recommended for most general use.
|
||||||
|
|
||||||
The name of the actual sequence starts with the name of its series, plus a
|
The name of the actual sequence starts with the name of its series, plus a
|
||||||
@@ -51,21 +51,21 @@ CCBLU() (arguments defined below).
|
|||||||
|
|
||||||
The K series requires no arguments, and is simply a macro to the ANSI color
|
The K series requires no arguments, and is simply a macro to the ANSI color
|
||||||
code. Therefore, if you use a K-series color code, the color will ALWAYS be
|
code. Therefore, if you use a K-series color code, the color will ALWAYS be
|
||||||
sent, even if the person you’re sending it to has color off. This can very bad.
|
sent, even if the person you’re sending it to has color off. This can very bad.
|
||||||
Some people who do not have ANSI-compatible terminals will see garbage
|
Some people who do not have ANSI-compatible terminals will see garbage
|
||||||
characters instead of colors. If the terminal correctly ignores ANSI color
|
characters instead of colors. If the terminal correctly ignores ANSI color
|
||||||
codes, then nothing will show up on their screen at all. The K series is mainly
|
codes, then nothing will show up on their screen at all. The K series is mainly
|
||||||
used to print colors to a string if the player’s color level will later be
|
used to print colors to a string if the player’s color level will later be
|
||||||
tested manually (for an example, see do_gen_com in act.comm.c).
|
tested manually (for an example, see do_gen_com in act.comm.c).
|
||||||
|
|
||||||
The recommended series is the CC series (i.e. CCNRM(), CCRED(), etc.) The CC
|
The recommended series is the CC series (i.e. CCNRM(), CCRED(), etc.) The CC
|
||||||
series macros require two arguments – a pointer to the character to whom the
|
series macros require two arguments – a pointer to the character to whom the
|
||||||
string is being sent, and the minimum color level the player must be set to in
|
string is being sent, and the minimum color level the player must be set to in
|
||||||
order to see the color. Color sent as 'brief' (formerly known as sparse it was
|
order to see the color. Color sent as 'brief' (formerly known as sparse it was
|
||||||
changed for consistency with the syslog command) (C_SPR) will be seen by people
|
changed for consistency with the syslog command) (C_SPR) will be seen by people
|
||||||
with color set to sparse, normal, or complete; color sent as ‘normal’ (C_NRM)
|
with color set to sparse, normal, or complete; color sent as ‘normal’ (C_NRM)
|
||||||
will be seen only by people with color set to normal or complete; color sent as
|
will be seen only by people with color set to normal or complete; color sent as
|
||||||
‘complete’ (C_CMP) will be seen only by people with color set to complete.
|
‘complete’ (C_CMP) will be seen only by people with color set to complete.
|
||||||
|
|
||||||
To illustrate the above, an example is in order:
|
To illustrate the above, an example is in order:
|
||||||
|
|
||||||
@@ -76,29 +76,29 @@ ACMD(do_showcolor)
|
|||||||
{
|
{
|
||||||
char buf[300];
|
char buf[300];
|
||||||
|
|
||||||
sprintf(buf, "Don’t you just love %scolor%s, %scolor%s, " "%sCOLOR%s!\n\r",
|
sprintf(buf, "Don’t you just love %scolor%s, %scolor%s, " "%sCOLOR%s!\n\r",
|
||||||
CCBLU(ch, C_CMP), CCNRM(ch, C_CMP), CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
|
CCBLU(ch, C_CMP), CCNRM(ch, C_CMP), CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
|
||||||
CCRED(ch, C_SPR), CCNRM(ch, C_SPR));
|
CCRED(ch, C_SPR), CCNRM(ch, C_SPR));
|
||||||
send_to_char(ch, buf);
|
send_to_char(ch, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
What does this do? For people with color set to Complete, it prints:
|
What does this do? For people with color set to Complete, it prints:
|
||||||
Don’t you just love color, color, COLOR! (blue) (yellow) (red)
|
Don’t you just love color, color, COLOR! (blue) (yellow) (red)
|
||||||
|
|
||||||
People who have color set to Normal will see:
|
People who have color set to Normal will see:
|
||||||
Don’t you just love color, color, COLOR! (yellow) (red)
|
Don’t you just love color, color, COLOR! (yellow) (red)
|
||||||
|
|
||||||
People who have color set to Sparse will see:
|
People who have color set to Sparse will see:
|
||||||
Don’t you just love color, color, COLOR! (red)
|
Don’t you just love color, color, COLOR! (red)
|
||||||
|
|
||||||
People who have color set to Off will see:
|
People who have color set to Off will see:
|
||||||
Don’t you just love color, color, COLOR! (no color, as you’d expect)
|
Don’t you just love color, color, COLOR! (no color, as you’d expect)
|
||||||
|
|
||||||
There are several common pitfalls with using the CC series of color macros:
|
There are several common pitfalls with using the CC series of color macros:
|
||||||
|
|
||||||
Do not confuse CCNRM with C_NRM. CCNRM() is a macro to turn the color back to
|
Do not confuse CCNRM with C_NRM. CCNRM() is a macro to turn the color back to
|
||||||
normal; C_NRMis a color level of “normal.” Always make sure that every pair of
|
normal; C_NRMis a color level of “normal.” Always make sure that every pair of
|
||||||
“on” and “off” codes are at the same color level. For example:
|
“on” and “off” codes are at the same color level. For example:
|
||||||
|
|
||||||
WRONG: sprintf(buf, "%sCOLOR%s\n\r", CCBLU(ch, C_NRM), CCNRM(ch, C_CMP));
|
WRONG: sprintf(buf, "%sCOLOR%s\n\r", CCBLU(ch, C_NRM), CCNRM(ch, C_CMP));
|
||||||
|
|
||||||
@@ -110,14 +110,14 @@ WRONG: sprintf(buf, "%sCOLOR%s\n\r", CCBLU(ch, C_CMP), CCNRM(ch, C_NRM));
|
|||||||
|
|
||||||
The above statement is also wrong, although not as bad. In this case, someone
|
The above statement is also wrong, although not as bad. In this case, someone
|
||||||
with color set to Normal will (correctly) not get the CCBLU code, but will then
|
with color set to Normal will (correctly) not get the CCBLU code, but will then
|
||||||
unnecessarily get the CCNRM code. Never send a color code if you don’t have to.
|
unnecessarily get the CCNRM code. Never send a color code if you don’t have to.
|
||||||
The codes are several bytes long, and cause a noticeable pause at 2400 baud.
|
The codes are several bytes long, and cause a noticeable pause at 2400 baud.
|
||||||
|
|
||||||
This should go without saying, but don’t ever send color at the C_OFF level.
|
This should go without saying, but don’t ever send color at the C_OFF level.
|
||||||
|
|
||||||
Special precautions must be taken when sending a colored string to a large
|
Special precautions must be taken when sending a colored string to a large
|
||||||
group of people. You can’t use the color level of “ch” (the person sending the
|
group of people. You can’t use the color level of “ch” (the person sending the
|
||||||
string) – each person receiving the string must get a string appropriately
|
string) – each person receiving the string must get a string appropriately
|
||||||
colored for his/her level. In such cases, it is usually best to set up two
|
colored for his/her level. In such cases, it is usually best to set up two
|
||||||
strings (one colored and one not), and test each player’s color level
|
strings (one colored and one not), and test each player’s color level
|
||||||
individually (see do_gen_comin act.comm.c for an example).
|
individually (see do_gen_comin act.comm.c for an example).
|
||||||
|
|||||||
+42
-42
@@ -4,14 +4,14 @@ Builder Academy at telnet://tbamud.com:9091 or email rumble@tbamud.com -- Rumble
|
|||||||
The Art of Debugging
|
The Art of Debugging
|
||||||
Originally by Michael Chastain and Sammy
|
Originally by Michael Chastain and Sammy
|
||||||
|
|
||||||
The following documentation is excerpted from Merc 2.0’s hacker.txt file. It
|
The following documentation is excerpted from Merc 2.0’s hacker.txt file. It
|
||||||
was written by Furey of MERC Industries and is included here with his
|
was written by Furey of MERC Industries and is included here with his
|
||||||
permission. We have packaged it with tbaMUD (changed in a couple of places,
|
permission. We have packaged it with tbaMUD (changed in a couple of places,
|
||||||
such as specific filenames) because it offers good advice and insight into the
|
such as specific filenames) because it offers good advice and insight into the
|
||||||
art and science of software engineering. More information about tbaMUD,
|
art and science of software engineering. More information about tbaMUD,
|
||||||
can be found at the tbaMUD home page http://tbamud.com.
|
can be found at the tbaMUD home page http://tbamud.com.
|
||||||
|
|
||||||
1 “I’m running a Mud so I can learn C programming!”
|
1 “I’m running a Mud so I can learn C programming!”
|
||||||
|
|
||||||
Yeah, right. The purpose of this document is to record some of our knowledge,
|
Yeah, right. The purpose of this document is to record some of our knowledge,
|
||||||
experience and philosophy. No matter what your level, we hope that this
|
experience and philosophy. No matter what your level, we hope that this
|
||||||
@@ -31,11 +31,11 @@ Play with it some more.
|
|||||||
Read documentation again.
|
Read documentation again.
|
||||||
Get the idea?
|
Get the idea?
|
||||||
|
|
||||||
The idea is that your mind can accept only so much “new data” in a single
|
The idea is that your mind can accept only so much “new data” in a single
|
||||||
session. Playing with something doesn’t introduce very much new data, but it
|
session. Playing with something doesn’t introduce very much new data, but it
|
||||||
does transform data in your head from the “new” category to the “familiar”
|
does transform data in your head from the “new” category to the “familiar”
|
||||||
category. Reading documentation doesn’t make anything “familiar,” but it
|
category. Reading documentation doesn’t make anything “familiar,” but it
|
||||||
refills your “new” hopper.
|
refills your “new” hopper.
|
||||||
|
|
||||||
Most people, if they even read documentation in the first place, never return
|
Most people, if they even read documentation in the first place, never return
|
||||||
to it. They come to a certain minimum level of proficiency and then never
|
to it. They come to a certain minimum level of proficiency and then never
|
||||||
@@ -47,17 +47,17 @@ through the two-step learning cycle many times to master it.
|
|||||||
|
|
||||||
man gives you online manual pages.
|
man gives you online manual pages.
|
||||||
|
|
||||||
grep stands for “global regular expression print;” searches for strings in text
|
grep stands for “global regular expression print;” searches for strings in text
|
||||||
files.
|
files.
|
||||||
|
|
||||||
vi, emacs, jove use whatever editor floats your boat, but learn the hell out
|
vi, emacs, jove use whatever editor floats your boat, but learn the hell out
|
||||||
of it; you should know every command in your editor.
|
of it; you should know every command in your editor.
|
||||||
|
|
||||||
ctags mags “tags” for your editor which allows you to go to functions by name
|
ctags mags “tags” for your editor which allows you to go to functions by name
|
||||||
in any source file.
|
in any source file.
|
||||||
|
|
||||||
>, >>, <, | input and output redirection at the command line; get someone to
|
>, >>, <, | input and output redirection at the command line; get someone to
|
||||||
show you, or dig it out of “man csh”
|
show you, or dig it out of “man csh”
|
||||||
|
|
||||||
These are the basic day-in day-out development tools. Developing without
|
These are the basic day-in day-out development tools. Developing without
|
||||||
knowing how to use all of these well is like driving a car without knowing
|
knowing how to use all of these well is like driving a car without knowing
|
||||||
@@ -70,21 +70,21 @@ the hypothesis, run the program and provide it experimental input, observe its
|
|||||||
behavior, and confirm or refute the hypothesis.
|
behavior, and confirm or refute the hypothesis.
|
||||||
|
|
||||||
A good hypothesis is one which makes surprising predictions which then come
|
A good hypothesis is one which makes surprising predictions which then come
|
||||||
true; predictions that other hypotheses don’t make.
|
true; predictions that other hypotheses don’t make.
|
||||||
|
|
||||||
The first step in debugging is not to write bugs in the first place. This
|
The first step in debugging is not to write bugs in the first place. This
|
||||||
sounds obvious, but sadly, is all too often ignored.
|
sounds obvious, but sadly, is all too often ignored.
|
||||||
|
|
||||||
If you build a program, and you get any errors or any warnings, you should fix
|
If you build a program, and you get any errors or any warnings, you should fix
|
||||||
them before continuing. C was designed so that many buggy ways of writing code
|
them before continuing. C was designed so that many buggy ways of writing code
|
||||||
are legal, but will draw warnings from a suitably smart compiler (such as “gcc”
|
are legal, but will draw warnings from a suitably smart compiler (such as “gcc”
|
||||||
with the -Wall flag enabled). It takes only minutes to check your warnings and
|
with the -Wall flag enabled). It takes only minutes to check your warnings and
|
||||||
to fix the code that generates them, but it takes hours to find bugs otherwise.
|
to fix the code that generates them, but it takes hours to find bugs otherwise.
|
||||||
|
|
||||||
“Desk checking” (proof reading) is almost a lost art these days. Too bad. You
|
“Desk checking” (proof reading) is almost a lost art these days. Too bad. You
|
||||||
should desk check your code before even compiling it, and desk-check it again
|
should desk check your code before even compiling it, and desk-check it again
|
||||||
periodically to keep it fresh in mind and find new errors. If you have someone
|
periodically to keep it fresh in mind and find new errors. If you have someone
|
||||||
in your group whose only job it is to desk-check other people’s code, that
|
in your group whose only job it is to desk-check other people’s code, that
|
||||||
person will find and fix more bugs than everyone else combined.
|
person will find and fix more bugs than everyone else combined.
|
||||||
|
|
||||||
One can desk-check several hundred lines of code per hour. A top-flight
|
One can desk-check several hundred lines of code per hour. A top-flight
|
||||||
@@ -95,20 +95,20 @@ fixing technique. Compare that to all the hours you spend screwing around with
|
|||||||
broken programs trying to find one bug at a time.
|
broken programs trying to find one bug at a time.
|
||||||
|
|
||||||
The next technique beyond desk-checking is the time-honored technique of
|
The next technique beyond desk-checking is the time-honored technique of
|
||||||
inserting “print” statements into the code, and then watching the logged
|
inserting “print” statements into the code, and then watching the logged
|
||||||
values. Within tbaMUD code, you can call printf(), fprintf(), or log()to dump
|
values. Within tbaMUD code, you can call printf(), fprintf(), or log()to dump
|
||||||
interesting values at interesting times. Where and when to dump these values
|
interesting values at interesting times. Where and when to dump these values
|
||||||
is an art, which you will learn only with practice.
|
is an art, which you will learn only with practice.
|
||||||
|
|
||||||
If you don’t already know how to redirect output in your operating system, now
|
If you don’t already know how to redirect output in your operating system, now
|
||||||
is the time to learn. On Unix, type the command “man csh”, and read the part
|
is the time to learn. On Unix, type the command “man csh”, and read the part
|
||||||
about the “>” operator. You should also learn the difference between “standard
|
about the “>” operator. You should also learn the difference between “standard
|
||||||
output” (for example, output from “printf”) and “standard error” (for example,
|
output” (for example, output from “printf”) and “standard error” (for example,
|
||||||
output from “fprintf(stderr, ...)”).
|
output from “fprintf(stderr, ...)”).
|
||||||
|
|
||||||
Ultimately, you cannot fix a program unless you understand how it is operating
|
Ultimately, you cannot fix a program unless you understand how it is operating
|
||||||
in the first place. Powerful debugging tools will help you collect data, but
|
in the first place. Powerful debugging tools will help you collect data, but
|
||||||
they can’t interpret it, and they can’t fix the underlying problems. Only you
|
they can’t interpret it, and they can’t fix the underlying problems. Only you
|
||||||
can do that.
|
can do that.
|
||||||
|
|
||||||
When you find a bug... your first impulse will be to change the code, kill the
|
When you find a bug... your first impulse will be to change the code, kill the
|
||||||
@@ -117,9 +117,9 @@ observe is often just the symptom of a deeper bug. You should keep pursuing the
|
|||||||
bug, all the way down. You should grok the bug and cherish it in fullness
|
bug, all the way down. You should grok the bug and cherish it in fullness
|
||||||
before causing its discorporation.
|
before causing its discorporation.
|
||||||
|
|
||||||
Also, when finding a bug, ask yourself two questions: “What design and
|
Also, when finding a bug, ask yourself two questions: “What design and
|
||||||
programming habits led to the introduction of the bug in the first place?” And:
|
programming habits led to the introduction of the bug in the first place?” And:
|
||||||
“What habits would systematically prevent the introduction of bugs like this?”
|
“What habits would systematically prevent the introduction of bugs like this?”
|
||||||
|
|
||||||
5 Debugging: Tools
|
5 Debugging: Tools
|
||||||
|
|
||||||
@@ -127,20 +127,20 @@ When a Unix process accesses an invalid memory location, or (more rarely)
|
|||||||
executes an illegal instruction, or (even more rarely) something else goes
|
executes an illegal instruction, or (even more rarely) something else goes
|
||||||
wrong, the Unix operating system takes control. The process is incapable of
|
wrong, the Unix operating system takes control. The process is incapable of
|
||||||
further execution and must be killed. Before killing the process, however, the
|
further execution and must be killed. Before killing the process, however, the
|
||||||
operating system does something for you: it opens a file named “core” and
|
operating system does something for you: it opens a file named “core” and
|
||||||
writes the entire data space of the process into it.
|
writes the entire data space of the process into it.
|
||||||
|
|
||||||
Thus, “dumping core” is not a cause of problems, or even an effect of problems.
|
Thus, “dumping core” is not a cause of problems, or even an effect of problems.
|
||||||
It’s something the operating system does to help you find fatal problems which
|
It’s something the operating system does to help you find fatal problems which
|
||||||
have rendered your process unable to continue.
|
have rendered your process unable to continue.
|
||||||
|
|
||||||
One reads a “core” file with a debugger. The two most popular debuggers on Unix
|
One reads a “core” file with a debugger. The two most popular debuggers on Unix
|
||||||
are adb and gdb, although occasionally one finds dbx. Typically one starts a
|
are adb and gdb, although occasionally one finds dbx. Typically one starts a
|
||||||
debugger like this: “gdb bin/circle” or “gdb bin/circle lib/core”.
|
debugger like this: “gdb bin/circle” or “gdb bin/circle lib/core”.
|
||||||
|
|
||||||
The first thing, and often the only thing, you need to do inside the debugger
|
The first thing, and often the only thing, you need to do inside the debugger
|
||||||
is take a stack trace. In adb, the command for this is “$c”. In gdb, the
|
is take a stack trace. In adb, the command for this is “$c”. In gdb, the
|
||||||
command is “backtrace”. In dbx, the command is “where”. The stack trace will
|
command is “backtrace”. In dbx, the command is “where”. The stack trace will
|
||||||
tell you what function your program was in when it crashed, and what functions
|
tell you what function your program was in when it crashed, and what functions
|
||||||
were calling it. The debugger will also list the arguments to these functions.
|
were calling it. The debugger will also list the arguments to these functions.
|
||||||
Interpreting these arguments, and using more advanced debugger features,
|
Interpreting these arguments, and using more advanced debugger features,
|
||||||
@@ -343,12 +343,12 @@ new tools.
|
|||||||
|
|
||||||
7 Profiling
|
7 Profiling
|
||||||
|
|
||||||
Another useful technique is “profiling,” to find out where your program is
|
Another useful technique is “profiling,” to find out where your program is
|
||||||
spending most of its time. This can help you to make a program more efficient.
|
spending most of its time. This can help you to make a program more efficient.
|
||||||
|
|
||||||
Here is how to profile a program:
|
Here is how to profile a program:
|
||||||
|
|
||||||
1. Remove all the .o files and the “circle” executable:
|
1. Remove all the .o files and the “circle” executable:
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
2. Edit your Makefile, and change the PROFILE=line:
|
2. Edit your Makefile, and change the PROFILE=line:
|
||||||
@@ -359,25 +359,25 @@ make
|
|||||||
|
|
||||||
4. Run circle as usual. Shutdown the game with the shutdown command when you
|
4. Run circle as usual. Shutdown the game with the shutdown command when you
|
||||||
have run long enough to get a good profiling base under normal usage
|
have run long enough to get a good profiling base under normal usage
|
||||||
conditions. If you crash the game, or kill the process externally, you won’t
|
conditions. If you crash the game, or kill the process externally, you won’t
|
||||||
get profiling information.
|
get profiling information.
|
||||||
|
|
||||||
5. Run the profcommand:
|
5. Run the profcommand:
|
||||||
prof bin/circle > prof.out
|
prof bin/circle > prof.out
|
||||||
|
|
||||||
6. Read prof.out. Run “man prof” to understand the format of the output. For
|
6. Read prof.out. Run “man prof” to understand the format of the output. For
|
||||||
advanced profiling, you can use “PROFILE = -pg” in step 2, and use the “gprof”
|
advanced profiling, you can use “PROFILE = -pg” in step 2, and use the “gprof”
|
||||||
command in step 5. The “gprof” form of profiling gives you a report which lists
|
command in step 5. The “gprof” form of profiling gives you a report which lists
|
||||||
exactly how many times any function calls any other function. This information
|
exactly how many times any function calls any other function. This information
|
||||||
is valuable for debugging as well as performance analysis.
|
is valuable for debugging as well as performance analysis.
|
||||||
|
|
||||||
Availability of “prof” and “gprof” varies from system to system. Almost every
|
Availability of “prof” and “gprof” varies from system to system. Almost every
|
||||||
Unix system has “prof”. Only some systems have “gprof”.
|
Unix system has “prof”. Only some systems have “gprof”.
|
||||||
|
|
||||||
7 Books for Serious Programmers
|
7 Books for Serious Programmers
|
||||||
|
|
||||||
Out of all the thousands of books out there, three stand out:
|
Out of all the thousands of books out there, three stand out:
|
||||||
|
|
||||||
Kernighan and Plaugher, “The Elements of Programming Style”
|
Kernighan and Plaugher, “The Elements of Programming Style”
|
||||||
Kernighan and Ritchie, “The C Programming Language”
|
Kernighan and Ritchie, “The C Programming Language”
|
||||||
Brooks, “The Mythical Man Month”
|
Brooks, “The Mythical Man Month”
|
||||||
|
|||||||
+18
-18
@@ -3,7 +3,7 @@ Builder Academy at telnet://tbamud.com:9091 or email rumble@tbamud.com -- Rumble
|
|||||||
|
|
||||||
tbaMUD File Manifest
|
tbaMUD File Manifest
|
||||||
|
|
||||||
The main ‘tbaMUD/’ directory has the following subdirectories and files:
|
The main ‘tbaMUD/’ directory has the following subdirectories and files:
|
||||||
|
|
||||||
autorun - Shell script to run the MUD (./autorun &).
|
autorun - Shell script to run the MUD (./autorun &).
|
||||||
FAQ - Frequently Aske Questions with answers.
|
FAQ - Frequently Aske Questions with answers.
|
||||||
@@ -16,7 +16,7 @@ lib/ - MUD data.
|
|||||||
log/ - System logs.
|
log/ - System logs.
|
||||||
src/ - Source code.
|
src/ - Source code.
|
||||||
|
|
||||||
The bin/directory contains only binaries: ‘circle’ (the main MUD) and its
|
The bin/directory contains only binaries: ‘circle’ (the main MUD) and its
|
||||||
utilities, which are described in utils.txt.
|
utilities, which are described in utils.txt.
|
||||||
|
|
||||||
The doc/ directory has its own README file, describing the contents of each
|
The doc/ directory has its own README file, describing the contents of each
|
||||||
@@ -51,12 +51,12 @@ time - Where the MUD time is saved.
|
|||||||
|
|
||||||
The lib/misc/ directory contains the following files:
|
The lib/misc/ directory contains the following files:
|
||||||
|
|
||||||
bugs - Bugs reported by players with the ’bug’ command.
|
bugs - Bugs reported by players with the ’bug’ command.
|
||||||
ideas - Ideas from players from ’idea’ command.
|
ideas - Ideas from players from ’idea’ command.
|
||||||
messages - Spell and skill damage messages.
|
messages - Spell and skill damage messages.
|
||||||
socials - Text file with text of the socials.
|
socials - Text file with text of the socials.
|
||||||
socials.new - New format of socials you can edit via AEDIT.
|
socials.new - New format of socials you can edit via AEDIT.
|
||||||
typos - Typos reported by players with the ’typo’ command.
|
typos - Typos reported by players with the ’typo’ command.
|
||||||
xnames - Text file of invalid names.
|
xnames - Text file of invalid names.
|
||||||
|
|
||||||
The lib/plrobjs/ contains the following files and directories:
|
The lib/plrobjs/ contains the following files and directories:
|
||||||
@@ -80,18 +80,18 @@ zzz/
|
|||||||
The lib/text/ directory contains the following files:
|
The lib/text/ directory contains the following files:
|
||||||
|
|
||||||
background - Background story (for option 3 from main menu).
|
background - Background story (for option 3 from main menu).
|
||||||
credits - Text for ’credits’ command.
|
credits - Text for ’credits’ command.
|
||||||
greetings - Greeting message.
|
greetings - Greeting message.
|
||||||
handbook - Text for Immortal Handbook (’handbook’ command).
|
handbook - Text for Immortal Handbook (’handbook’ command).
|
||||||
immlist - Text for ’immlist’ command.
|
immlist - Text for ’immlist’ command.
|
||||||
imotd - Immortal MOTD --seen by immortals on login.
|
imotd - Immortal MOTD --seen by immortals on login.
|
||||||
info - Text for ’info’ command.
|
info - Text for ’info’ command.
|
||||||
motd - MOTD --seen by mortals on login.
|
motd - MOTD --seen by mortals on login.
|
||||||
news - Text for ’news’ command.
|
news - Text for ’news’ command.
|
||||||
policies - Text for ’policy’ command.
|
policies - Text for ’policy’ command.
|
||||||
wizlist - Text for ’wizlist’ command.
|
wizlist - Text for ’wizlist’ command.
|
||||||
/help/screen - Text for ’help’ command as a mortal with no arguments.
|
/help/screen - Text for ’help’ command as a mortal with no arguments.
|
||||||
/help/iscreen - Text for ’help’ command an an immortal with no arguments.
|
/help/iscreen - Text for ’help’ command an an immortal with no arguments.
|
||||||
|
|
||||||
The lib/world/directory contains the following subdirectories:
|
The lib/world/directory contains the following subdirectories:
|
||||||
|
|
||||||
@@ -103,8 +103,8 @@ wld - Contains *.wld files (world files)
|
|||||||
zon - Contains *.zon files (zone files)
|
zon - Contains *.zon files (zone files)
|
||||||
|
|
||||||
Each of the 6 subdirectories in the lib/world/ directory also contains two
|
Each of the 6 subdirectories in the lib/world/ directory also contains two
|
||||||
additional files – one called ‘index’, which specifies which files in that
|
additional files – one called ‘index’, which specifies which files in that
|
||||||
directory should be loaded when the MUD boots, and ‘index.mini’, which
|
directory should be loaded when the MUD boots, and ‘index.mini’, which
|
||||||
specifies which files should be loaded if the MUD is booted with the -m
|
specifies which files should be loaded if the MUD is booted with the -m
|
||||||
(mini-mud) option.
|
(mini-mud) option.
|
||||||
|
|
||||||
@@ -128,6 +128,6 @@ trigger - Trigedit log messages.
|
|||||||
usage - Mud system usage (player load & memory usage info).
|
usage - Mud system usage (player load & memory usage info).
|
||||||
|
|
||||||
The src/ directory contains all of the C and header files for the MUD, along
|
The src/ directory contains all of the C and header files for the MUD, along
|
||||||
with a Makefile. The src/util/ directory contains source for tbaMUD’s utility
|
with a Makefile. The src/util/ directory contains source for tbaMUD’s utility
|
||||||
programs. See admin.txt for more information on how to compile the MUD. See
|
programs. See admin.txt for more information on how to compile the MUD. See
|
||||||
utils.txt for more information on how to use tbaMUD’s utilities.
|
utils.txt for more information on how to use tbaMUD’s utilities.
|
||||||
|
|||||||
+23
-23
@@ -9,16 +9,16 @@ every platform that exists. This document is for experienced programmers
|
|||||||
trying to make tbaMUD work on their platform.
|
trying to make tbaMUD work on their platform.
|
||||||
|
|
||||||
tbaMUD should work on most UNIX platforms without any modifications; simply run
|
tbaMUD should work on most UNIX platforms without any modifications; simply run
|
||||||
the “configure” script and it should automatically detect what type of system
|
the “configure” script and it should automatically detect what type of system
|
||||||
you have and anything that may be strange about it. These findings are all
|
you have and anything that may be strange about it. These findings are all
|
||||||
stored in a header file called conf.h which is created in the src directory
|
stored in a header file called conf.h which is created in the src directory
|
||||||
from a template called conf.h.in. A Makefile is also created from the template
|
from a template called conf.h.in. A Makefile is also created from the template
|
||||||
Makefile.in.
|
Makefile.in.
|
||||||
|
|
||||||
Non-UNIX platforms are a problem. Some can’t run tbaMUD at all. However, any
|
Non-UNIX platforms are a problem. Some can’t run tbaMUD at all. However, any
|
||||||
multitasking OS that has an ANSI C compiler, and supports non-blocking I/O and
|
multitasking OS that has an ANSI C compiler, and supports non-blocking I/O and
|
||||||
socket-based TCP/IP networking, should theoretically be able to run tbaMUD; for
|
socket-based TCP/IP networking, should theoretically be able to run tbaMUD; for
|
||||||
example, OS/2, AmigaOS, Mac OS (Classic versions; Mac OS X supports tbaMUD’s
|
example, OS/2, AmigaOS, Mac OS (Classic versions; Mac OS X supports tbaMUD’s
|
||||||
configure script from the command line), and all versions of Windows.
|
configure script from the command line), and all versions of Windows.
|
||||||
|
|
||||||
The port can be very easy or very difficult, depending mainly on whether or nor
|
The port can be very easy or very difficult, depending mainly on whether or nor
|
||||||
@@ -26,7 +26,7 @@ your OS supports the Berkeley socket API.
|
|||||||
|
|
||||||
The general steps for porting tbaMUD to a non-UNIX platform are listed below. A
|
The general steps for porting tbaMUD to a non-UNIX platform are listed below. A
|
||||||
number of tips for porting can be found after the porting steps. Note that we
|
number of tips for porting can be found after the porting steps. Note that we
|
||||||
have already ported tba to Windows, so if you’re confused as to how to perform
|
have already ported tba to Windows, so if you’re confused as to how to perform
|
||||||
some of these steps, you can look at what we have done as an example (see the
|
some of these steps, you can look at what we have done as an example (see the
|
||||||
files README.CYGWIN).
|
files README.CYGWIN).
|
||||||
|
|
||||||
@@ -36,11 +36,11 @@ trying to port the code.
|
|||||||
|
|
||||||
Porting the Code
|
Porting the Code
|
||||||
|
|
||||||
Step 1. Create a “conf.h” file for your system. Copy the template “conf.h.in”
|
Step 1. Create a “conf.h” file for your system. Copy the template “conf.h.in”
|
||||||
to “conf.h”, and then define or undefine each item as directed by the comments
|
to “conf.h”, and then define or undefine each item as directed by the comments
|
||||||
and based on the characteristics of your system. To write the conf.h file,
|
and based on the characteristics of your system. To write the conf.h file,
|
||||||
you’ll need to know which header files are included with your system, the
|
you’ll need to know which header files are included with your system, the
|
||||||
return type of signals, whether or not your compiler supports the ‘const’
|
return type of signals, whether or not your compiler supports the ‘const’
|
||||||
keyword, and whether or not you have various functions such as crypt()and
|
keyword, and whether or not you have various functions such as crypt()and
|
||||||
random(). Also, you can ignore the HAVE_LIBxxx and HAVE_xxx_PROTO constants at
|
random(). Also, you can ignore the HAVE_LIBxxx and HAVE_xxx_PROTO constants at
|
||||||
the end of conf.h.in; they are not used in the code (they are part of UNIX
|
the end of conf.h.in; they are not used in the code (they are part of UNIX
|
||||||
@@ -58,12 +58,12 @@ be in the source file comm.c.
|
|||||||
|
|
||||||
Step 4. Test your changes! Make sure that multiple people can log in
|
Step 4. Test your changes! Make sure that multiple people can log in
|
||||||
simultaneously and that they can all type commands at the same time. No player
|
simultaneously and that they can all type commands at the same time. No player
|
||||||
should ever have a “frozen” screen just because another is waiting at a prompt.
|
should ever have a “frozen” screen just because another is waiting at a prompt.
|
||||||
Leave the MUD up for at least 24 hours, preferably with people playing it, to
|
Leave the MUD up for at least 24 hours, preferably with people playing it, to
|
||||||
make sure that your changes are stable. Make sure that automatic events such as
|
make sure that your changes are stable. Make sure that automatic events such as
|
||||||
zone resets, point regeneration, and corpse decomposition are being timed
|
zone resets, point regeneration, and corpse decomposition are being timed
|
||||||
correctly (a tick should be about 75 seconds). Try resetting all the zones
|
correctly (a tick should be about 75 seconds). Try resetting all the zones
|
||||||
repeatedly by typing “zr *” many times. Play the MUD and make sure that the
|
repeatedly by typing “zr *” many times. Play the MUD and make sure that the
|
||||||
basic commands (killing mobs as a mortal, casting spells, etc.) work correctly.
|
basic commands (killing mobs as a mortal, casting spells, etc.) work correctly.
|
||||||
|
|
||||||
Step 5. If you are satisfied that your changes work correctly, you are
|
Step 5. If you are satisfied that your changes work correctly, you are
|
||||||
@@ -71,20 +71,20 @@ encouraged to submit them to be included as part of the tbaMUD distribution so
|
|||||||
that future releases of tbaMUD will support your platform. This prevents you
|
that future releases of tbaMUD will support your platform. This prevents you
|
||||||
from re-porting the code every time a new version is released and allows other
|
from re-porting the code every time a new version is released and allows other
|
||||||
people who use your platform to enjoy tbaMUD as well. To submit your changes
|
people who use your platform to enjoy tbaMUD as well. To submit your changes
|
||||||
you must make a patch file using the GNU ‘diff’ program. diff will create a
|
you must make a patch file using the GNU ‘diff’ program. diff will create a
|
||||||
patch file which can be later used with the ‘patch’ utility to incorporate
|
patch file which can be later used with the ‘patch’ utility to incorporate
|
||||||
your changes into the stock tbaMUD distribution. For example, if you have a
|
your changes into the stock tbaMUD distribution. For example, if you have a
|
||||||
copy of tbaMUD in the “stock-tba” directory, and your changes are in “my-tba”,
|
copy of tbaMUD in the “stock-tba” directory, and your changes are in “my-tba”,
|
||||||
you can create a patch file like this:
|
you can create a patch file like this:
|
||||||
|
|
||||||
diff -u --new-file --recursive stock-tba/src my-tba/src > patch
|
diff -u --new-file --recursive stock-tba/src my-tba/src > patch
|
||||||
|
|
||||||
This will create a file called ‘patch’ with your patches. You should then try
|
This will create a file called ‘patch’ with your patches. You should then try
|
||||||
to use the ‘patch’ program (the inverse of ‘diff’) on a copy of tbaMUD to make
|
to use the ‘patch’ program (the inverse of ‘diff’) on a copy of tbaMUD to make
|
||||||
sure that tbaMUD is correctly changed to incorporate your patches. This step is
|
sure that tbaMUD is correctly changed to incorporate your patches. This step is
|
||||||
very important: if you don’t create these patches correctly, your work will be
|
very important: if you don’t create these patches correctly, your work will be
|
||||||
useless because no one will be able to figure out what you did! Make sure to
|
useless because no one will be able to figure out what you did! Make sure to
|
||||||
read the documentation to ‘diff’ and ‘patch’ if you don’t understand how to use
|
read the documentation to ‘diff’ and ‘patch’ if you don’t understand how to use
|
||||||
them. If your patches work, CELEBRATE!!
|
them. If your patches work, CELEBRATE!!
|
||||||
|
|
||||||
Step 6. Write a README file for your operating system that describes everything
|
Step 6. Write a README file for your operating system that describes everything
|
||||||
@@ -107,7 +107,7 @@ Each system to which tba is already ported has a CIRCLE_xx constant associated
|
|||||||
with it: CIRCLE_UNIX for plain vanilla UNIX tbaMUD, CIRCLE_WINDOWS for MS
|
with it: CIRCLE_UNIX for plain vanilla UNIX tbaMUD, CIRCLE_WINDOWS for MS
|
||||||
Windows, CIRCLE_OS2 for IBM OS/2, and CIRCLE_AMIGA for the Amiga. You must use
|
Windows, CIRCLE_OS2 for IBM OS/2, and CIRCLE_AMIGA for the Amiga. You must use
|
||||||
a similar constant for your system. At the top of your conf.h, make sure to
|
a similar constant for your system. At the top of your conf.h, make sure to
|
||||||
comment out “#define CIRCLE_UNIX” and add “#define CIRCLE_YOUR_SYSTEM”.
|
comment out “#define CIRCLE_UNIX” and add “#define CIRCLE_YOUR_SYSTEM”.
|
||||||
|
|
||||||
3.2 ANSI C and GCC
|
3.2 ANSI C and GCC
|
||||||
As long as your system has an ANSI C compiler, all of the code (except for
|
As long as your system has an ANSI C compiler, all of the code (except for
|
||||||
@@ -122,22 +122,22 @@ you use gcc.
|
|||||||
Make absolutely sure to use non-blocking I/O; i.e. make sure to enable the
|
Make absolutely sure to use non-blocking I/O; i.e. make sure to enable the
|
||||||
option so that the read() system call will immediately return with an error if
|
option so that the read() system call will immediately return with an error if
|
||||||
there is no data available. If you do not use non-blocking I/O, read() will
|
there is no data available. If you do not use non-blocking I/O, read() will
|
||||||
“block,” meaning it will wait infinitely for one particular player to type
|
“block,” meaning it will wait infinitely for one particular player to type
|
||||||
something even if other players are trying to enter commands. If your system
|
something even if other players are trying to enter commands. If your system
|
||||||
does not implement non-blocking I/O correctly, try using the
|
does not implement non-blocking I/O correctly, try using the
|
||||||
POSIX_NONBLOCK_BROKEN constant in sysdep.h.
|
POSIX_NONBLOCK_BROKEN constant in sysdep.h.
|
||||||
|
|
||||||
3.4 Timing
|
3.4 Timing
|
||||||
tbaMUD needs a fairly precise (on the order of 5 or 10 ms) timer in order to
|
tbaMUD needs a fairly precise (on the order of 5 or 10 ms) timer in order to
|
||||||
correctly schedule events such as zone resets, point regeneration (“ticks”),
|
correctly schedule events such as zone resets, point regeneration (“ticks”),
|
||||||
corpse decomposition, and other automatic tasks. If your system supports the
|
corpse decomposition, and other automatic tasks. If your system supports the
|
||||||
select() system call with sufficient precision, the default timing code should
|
select() system call with sufficient precision, the default timing code should
|
||||||
work correctly. If not, you’ll have to find out which system calls your system
|
work correctly. If not, you’ll have to find out which system calls your system
|
||||||
supports for determining how much time has passed and replace the select()
|
supports for determining how much time has passed and replace the select()
|
||||||
timing method.
|
timing method.
|
||||||
|
|
||||||
3.5 Signals and Signal Handlers
|
3.5 Signals and Signal Handlers
|
||||||
A note about signals: Most systems don’t support the concept of signals in the
|
A note about signals: Most systems don’t support the concept of signals in the
|
||||||
same way that UNIX does. Since signals are not a critical part of how tbaMUD
|
same way that UNIX does. Since signals are not a critical part of how tbaMUD
|
||||||
works anyway (they are only used for updating the wizlist and some other
|
works anyway (they are only used for updating the wizlist and some other
|
||||||
trivial things), all signal handling is turned off by default when compiling
|
trivial things), all signal handling is turned off by default when compiling
|
||||||
@@ -147,7 +147,7 @@ conf.h file and all signal code will be ignored automatically.
|
|||||||
|
|
||||||
4 Final Note
|
4 Final Note
|
||||||
IMPORTANT: Remember to keep any changes you make surrounded by #ifdef
|
IMPORTANT: Remember to keep any changes you make surrounded by #ifdef
|
||||||
statements (i.e. “#ifdef CIRCLE_WINDOWS ... #endif”). If you make absolutely
|
statements (i.e. “#ifdef CIRCLE_WINDOWS ... #endif”). If you make absolutely
|
||||||
sure to mark all of your changes with #ifdef statements, then your patches
|
sure to mark all of your changes with #ifdef statements, then your patches
|
||||||
(once you get them to work) will be suitable for incorporation into the
|
(once you get them to work) will be suitable for incorporation into the
|
||||||
tbaMUD distribution, meaning that tbaMUD will officially support your platform.
|
tbaMUD distribution, meaning that tbaMUD will officially support your platform.
|
||||||
|
|||||||
+4
-1
@@ -10,6 +10,9 @@ to rec.games.mud.diku which originally announced CircleMUD as a publicly
|
|||||||
available MUD source code.
|
available MUD source code.
|
||||||
|
|
||||||
tbaMUD Release history:
|
tbaMUD Release history:
|
||||||
|
Version 2025 release: January, 2025
|
||||||
|
Version 2023 release: January, 2023
|
||||||
|
Version 2021 release: March, 2021
|
||||||
Version 2020 release: January, 2020
|
Version 2020 release: January, 2020
|
||||||
Version 2019 release: January, 2019
|
Version 2019 release: January, 2019
|
||||||
Version 2018 release: January, 2018
|
Version 2018 release: January, 2018
|
||||||
@@ -140,7 +143,7 @@ communication channels
|
|||||||
totally ignores all commands from that player until they are thawed.
|
totally ignores all commands from that player until they are thawed.
|
||||||
--Even handier DELETE flag allows you to delete players on the fly.
|
--Even handier DELETE flag allows you to delete players on the fly.
|
||||||
--"set" command (mentioned above) allows you to freeze/unfreeze/
|
--"set" command (mentioned above) allows you to freeze/unfreeze/
|
||||||
delete/siteok/un-siteok players --even if they aren’t logged in!
|
delete/siteok/un-siteok players --even if they aren’t logged in!
|
||||||
--Bad password attempts are written to the system log and saved;
|
--Bad password attempts are written to the system log and saved;
|
||||||
if someone tries to hack your account, you see "4 LOGIN FAILURES
|
if someone tries to hack your account, you see "4 LOGIN FAILURES
|
||||||
SINCE LAST SUCCESSFUL LOGIN" next time you log on.
|
SINCE LAST SUCCESSFUL LOGIN" next time you log on.
|
||||||
|
|||||||
+3
-3
@@ -110,12 +110,12 @@ is being specified. The command sort name is the shortest part of the command a
|
|||||||
player must type for it to match. The hide-flag can be either 0 or 1; if 1, the
|
player must type for it to match. The hide-flag can be either 0 or 1; if 1, the
|
||||||
social is hidden from OTHERS if they cannot see the character performing the
|
social is hidden from OTHERS if they cannot see the character performing the
|
||||||
social. The action is not hidden from the VICTIM, even if s/he cannot see the
|
social. The action is not hidden from the VICTIM, even if s/he cannot see the
|
||||||
character performing the social, although in such cases the character’s name
|
character performing the social, although in such cases the character’s name
|
||||||
will, of course, be replaced with “someone”. The min positions should be set to
|
will, of course, be replaced with “someone”. The min positions should be set to
|
||||||
dictate the minimum position a player must be in to target the victim and
|
dictate the minimum position a player must be in to target the victim and
|
||||||
perform the social. Min level allows you to further customize who can use what
|
perform the social. Min level allows you to further customize who can use what
|
||||||
socials.Where it makes sense to do so, text fields may be left empty. If
|
socials.Where it makes sense to do so, text fields may be left empty. If
|
||||||
editing manually you should by put a ‘#’ in the first column on the line. Aedit
|
editing manually you should by put a ‘#’ in the first column on the line. Aedit
|
||||||
does this automatically.
|
does this automatically.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|||||||
+4
-4
@@ -34,7 +34,7 @@ older CircleMUD data files to the versions used in CircleMUD v3, while others
|
|||||||
are used to convert currently existing files into different formats.
|
are used to convert currently existing files into different formats.
|
||||||
|
|
||||||
Overall, these utilities have been created in an attempt to make the tbaMUD
|
Overall, these utilities have been created in an attempt to make the tbaMUD
|
||||||
administrator’s life a bit easier, and to give the administrator some ideas of
|
administrator’s life a bit easier, and to give the administrator some ideas of
|
||||||
further and more grandiose utilities to create. Some are no longer applicable
|
further and more grandiose utilities to create. Some are no longer applicable
|
||||||
but are retained as examples.
|
but are retained as examples.
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ the second, and so forth.
|
|||||||
The split utility is designed to split large world files into smaller, zone
|
The split utility is designed to split large world files into smaller, zone
|
||||||
sized files that are easier to manage and maintain. The utility reads its input
|
sized files that are easier to manage and maintain. The utility reads its input
|
||||||
from the standard input and writes the output to files with names specified
|
from the standard input and writes the output to files with names specified
|
||||||
within the larger world file. This is done by inserting ‘=filename’ into the
|
within the larger world file. This is done by inserting ‘=filename’ into the
|
||||||
world file at the appropriate points, where filename is the name of the file
|
world file at the appropriate points, where filename is the name of the file
|
||||||
for the following section.
|
for the following section.
|
||||||
|
|
||||||
@@ -141,8 +141,8 @@ The command line syntax for autowiz is as follows:
|
|||||||
autowiz <wizlev> <wizlistfile> <immlev> <immlistfile> [pid to signal]
|
autowiz <wizlev> <wizlistfile> <immlev> <immlistfile> [pid to signal]
|
||||||
|
|
||||||
where <wizlev> is equal to whatever LVL_GOD is set to in your tbaMUD server,
|
where <wizlev> is equal to whatever LVL_GOD is set to in your tbaMUD server,
|
||||||
<wizlistfile> is the filename for the file containing the game’s Wizlist.
|
<wizlistfile> is the filename for the file containing the game’s Wizlist.
|
||||||
<immlev> should be set to your game’s LVL_IMMORT, while <immlistfile>
|
<immlev> should be set to your game’s LVL_IMMORT, while <immlistfile>
|
||||||
is the name of the Immlist file.
|
is the name of the Immlist file.
|
||||||
|
|
||||||
This utility must be recompiled if you make any changes to the player file structure.
|
This utility must be recompiled if you make any changes to the player file structure.
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
select foo.com 1745106858 Welcor
|
||||||
|
|||||||
@@ -2893,7 +2893,7 @@ $n looks at your $t and seems to think it could use a little trimming off the to
|
|||||||
You look at $p and think it could use a little trimming off the top.
|
You look at $p and think it could use a little trimming off the top.
|
||||||
$n looks at $p and seems to think it could use a little trimming off the top.
|
$n looks at $p and seems to think it could use a little trimming off the top.
|
||||||
|
|
||||||
~halo halo 0 8 8 31
|
~halo halo 0 8 8 1
|
||||||
You whip out the ol' halo. That should prove your innocence.
|
You whip out the ol' halo. That should prove your innocence.
|
||||||
$n loads a halo and dons it.
|
$n loads a halo and dons it.
|
||||||
$N could use a good disguise.
|
$N could use a good disguise.
|
||||||
@@ -6109,7 +6109,7 @@ $n looks around for a victim to strangle.
|
|||||||
You throw yourself against $N's throat, trying to squeeze the life out.
|
You throw yourself against $N's throat, trying to squeeze the life out.
|
||||||
$n throws $mself after $N's throat.
|
$n throws $mself after $N's throat.
|
||||||
$n throws $mself after your throat, you try to defend yourself.
|
$n throws $mself after your throat, you try to defend yourself.
|
||||||
AARGH! They must have left... #&%£@!
|
AARGH! They must have left...
|
||||||
You put your hands around your throat and stop breathing.
|
You put your hands around your throat and stop breathing.
|
||||||
$n tries to strangle $mself, making a very strange noise and getting blue in the face.
|
$n tries to strangle $mself, making a very strange noise and getting blue in the face.
|
||||||
You strangle $M $t.
|
You strangle $M $t.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
T B A M U D
|
T B A M U D
|
||||||
2 0 2 0
|
2 0 2 5
|
||||||
|
|
||||||
Based on CircleMUD by Jeremy Elson and DikuMUD by Hans-Henrik Staerfeldt,
|
Based on CircleMUD by Jeremy Elson and DikuMUD by Hans-Henrik Staerfeldt,
|
||||||
Katja Nyboe, Tom Madsen, Michael Seifert, and Sebastian Hammer
|
Katja Nyboe, Tom Madsen, Michael Seifert, and Sebastian Hammer
|
||||||
|
|||||||
+60
-82
@@ -865,7 +865,7 @@ AUTOQUESTS QUESTS QUESTMASTERS QUEST-MOBS QUESTMOBS
|
|||||||
|
|
||||||
An autoquest is a quest that can be automatically started and completed
|
An autoquest is a quest that can be automatically started and completed
|
||||||
without the intervention of an immortal. Simply visit a questmaster and join
|
without the intervention of an immortal. Simply visit a questmaster and join
|
||||||
an available quest, and get rewarded on it’s completion. Keep an eye out for
|
an available quest, and get rewarded on it's completion. Keep an eye out for
|
||||||
autoquests scattered throughout the World.
|
autoquests scattered throughout the World.
|
||||||
|
|
||||||
See Also: QUEST-FLAG, QUESTPOINTS
|
See Also: QUEST-FLAG, QUESTPOINTS
|
||||||
@@ -1584,7 +1584,6 @@ qedit (quest editor)
|
|||||||
questpoints
|
questpoints
|
||||||
buildwalk
|
buildwalk
|
||||||
dig
|
dig
|
||||||
tell m-w (an in game dictionary lookup)
|
|
||||||
gemote
|
gemote
|
||||||
history
|
history
|
||||||
file
|
file
|
||||||
@@ -2444,25 +2443,6 @@ Example:
|
|||||||
> diagnose doctor
|
> diagnose doctor
|
||||||
|
|
||||||
See also: CONSIDER, HIT, KILL
|
See also: CONSIDER, HIT, KILL
|
||||||
#0
|
|
||||||
DICTIONARY DICTIONARIES THESAURUS M-W.COM DEFINITION MERRIAM-WEBSTER M-W-DEFINITION WEBSTER MW TELL-M-W BREATHER SPELLING WORDS
|
|
||||||
|
|
||||||
Usage: tell m-w <word>
|
|
||||||
|
|
||||||
We have a direct link to Merriam Webster. To use the dictionary just
|
|
||||||
tell m-w <word>
|
|
||||||
|
|
||||||
>tell m-w breather
|
|
||||||
You get this feedback from Merriam-Webster:
|
|
||||||
That means:
|
|
||||||
1 : one that breathes
|
|
||||||
2 : a break in activity for rest or relief
|
|
||||||
3 : a small vent in an otherwise airtight enclosure
|
|
||||||
|
|
||||||
A few obscure definitions are not available through m-w since they are in the
|
|
||||||
unabridged version that requires membership. They also offer a thesaurus at:
|
|
||||||
@Chttp://m-w.com/@n
|
|
||||||
|
|
||||||
#31
|
#31
|
||||||
DIG UNDIG RDIG RELINK RLINKS
|
DIG UNDIG RDIG RELINK RLINKS
|
||||||
|
|
||||||
@@ -3173,7 +3153,7 @@ game.
|
|||||||
Invest in a thesaurus. Makes a world of difference, and if that doesn't
|
Invest in a thesaurus. Makes a world of difference, and if that doesn't
|
||||||
help, just make up your own words for things you create (just be sure to
|
help, just make up your own words for things you create (just be sure to
|
||||||
describe them very well. Use @Chttp://m-w.com/@n for an online thesaurus
|
describe them very well. Use @Chttp://m-w.com/@n for an online thesaurus
|
||||||
and dictionary. You can @Rtell m-w <word>@n to lookup a definition.
|
and dictionary.
|
||||||
|
|
||||||
4. Where can I learn Trigedit?
|
4. Where can I learn Trigedit?
|
||||||
Here! Welcor is now the developer of trigedit. We have extensive help files,
|
Here! Welcor is now the developer of trigedit. We have extensive help files,
|
||||||
@@ -3312,7 +3292,7 @@ the earthquake spell.
|
|||||||
|
|
||||||
See also: WATERWALK, EARTHQUAKE
|
See also: WATERWALK, EARTHQUAKE
|
||||||
#0
|
#0
|
||||||
FOLLOWERS
|
FOLLOWERS UNFOLLOW
|
||||||
|
|
||||||
Usage: follow <leader>
|
Usage: follow <leader>
|
||||||
|
|
||||||
@@ -3350,7 +3330,7 @@ The 3rd number is liquid type from the following:
|
|||||||
value 1: Initial drink units. Must be 1 or greater.
|
value 1: Initial drink units. Must be 1 or greater.
|
||||||
value 2: see below
|
value 2: see below
|
||||||
value 3: 0 for not poisoned. Otherwise, the number of hours until the poison
|
value 3: 0 for not poisoned. Otherwise, the number of hours until the poison
|
||||||
burns off?
|
burns off.
|
||||||
|
|
||||||
value 2: The type of liquid in the drink-container, one of:
|
value 2: The type of liquid in the drink-container, one of:
|
||||||
|
|
||||||
@@ -3564,8 +3544,8 @@ GRAMMAR GRAMMER TIPS
|
|||||||
words can be particularly tricky and elude electronic spell checkers. A good
|
words can be particularly tricky and elude electronic spell checkers. A good
|
||||||
dictionary, however, will help you spell archaic words. Whenever I am building
|
dictionary, however, will help you spell archaic words. Whenever I am building
|
||||||
I use our Merriam Webster dictionary link on TBA to check any tough words for
|
I use our Merriam Webster dictionary link on TBA to check any tough words for
|
||||||
proper spelling. Test it out @RTELL M-W DEFINITION@n. We hope to add a thesaurus
|
proper spelling. We hope to add a thesaurus soon! Goto @Chttp://m-w.com/@n
|
||||||
soon! Goto @Chttp://m-w.com/@n until then.
|
until then.
|
||||||
I have found that a good principle to make is to avoid the use of all
|
I have found that a good principle to make is to avoid the use of all
|
||||||
contractions. For example, if you mean to say "it is", do not use "it's", spell
|
contractions. For example, if you mean to say "it is", do not use "it's", spell
|
||||||
it out. This will help differentiate between "its" (which means 'belonging to
|
it out. This will help differentiate between "its" (which means 'belonging to
|
||||||
@@ -7093,31 +7073,28 @@ See also: FLAGS, PLR
|
|||||||
#31
|
#31
|
||||||
PROMOTE PROMOTIONS ADVANCEMENTS RAISES LVLS LEVELS GAINS 31 32 33 34 RANKS RANKING HIRING JOBS STAFFING
|
PROMOTE PROMOTIONS ADVANCEMENTS RAISES LVLS LEVELS GAINS 31 32 33 34 RANKS RANKING HIRING JOBS STAFFING
|
||||||
|
|
||||||
Here at The Builder Academy the level of an immortal generally denotes
|
Here at The Builder Academy, the level of an immortal generally reflects that
|
||||||
their skill at building. This makes it easier for people to know who is in
|
immortal's building skill and willingness to help others. If you have
|
||||||
charge, who they can ask for help, and who they should be wary of taking tips
|
questions, you may want to ask someone whose level is at least 32. Of course,
|
||||||
from. I encourage everyone to help each other. Just realize that if the person
|
everyone is encouraged to help everyone else, but know that those who are not
|
||||||
is not at least a Great God they may have relatively little experience.
|
at least level 32 may have relatively little experience.
|
||||||
|
|
||||||
Level 31 (Immortal) Anyone who is new to TBA and is working on their trial
|
Level 31 (Immortal) Anyone who is new to TBA and is working on their trial
|
||||||
vnum or zone.
|
vnum or zone.
|
||||||
Level 32 (God) An experienced builder that has proven their knowledge and is
|
Level 32 (God) An experienced builder with proven knowledge that is
|
||||||
willing to teach others. Level 2 and above is considered staff.
|
willing to teach others. Immortals of level 32 and above
|
||||||
Level 33 (Greater God) An experienced builder that has contributed
|
are considered staff.
|
||||||
significantly to TBA.
|
Level 33 (Greater God) An experienced builder that has contributed significantly
|
||||||
|
to TBA.
|
||||||
Level 34 (Implementor) Current developers: Welcor, Wyld, and Opie.
|
Level 34 (Implementor) Current developers: Welcor, Wyld, and Opie.
|
||||||
|
|
||||||
Do not bother asking to be advanced, and if that is why you are here, you
|
Please do not bother asking to be advanced. If your goal is merely to rise in
|
||||||
are wasting your time. Note, this does not mean you are not a quality builder,
|
the ranks, you are wasting your time. The Gods here are dedicated to helping
|
||||||
but TBA is not your typical MUD. On the contrary, we are here as dedicated
|
others learn to build. Thus, those who advance in level are those who become
|
||||||
people to help you learn to build. Because of this the only chance of
|
proficient builders that offer their time to teach others. If you are willing
|
||||||
advancement is if you are willing to learn to build and then help teach others.
|
to give back to the tbaMUD community and have the requisite skills, you will be
|
||||||
If you are willing to give back to the tbaMUD community, and have the
|
advanced and given further tools to teach others via your level. Generally, if
|
||||||
necessary skills to do so, you will be advanced and given further privileges
|
you ask for a promotion, you will be less likely to receive it.
|
||||||
to help teach others. Generally, if you have to ask for a promotion you will be
|
|
||||||
less likely to receive it. Performance is everything here.
|
|
||||||
|
|
||||||
q
|
|
||||||
#0
|
#0
|
||||||
PROPOSALS GUIDELINES ZONE-PROPOSALS PROPOSITIONS PROPOSE REQUESTS CRITERIA
|
PROPOSALS GUIDELINES ZONE-PROPOSALS PROPOSITIONS PROPOSE REQUESTS CRITERIA
|
||||||
|
|
||||||
@@ -7195,7 +7172,7 @@ prefer to add the quest in the zone where quest completion takes place.
|
|||||||
Quests use vnums in exactly the same way as mobiles, object and rooms. Each
|
Quests use vnums in exactly the same way as mobiles, object and rooms. Each
|
||||||
zone will normally have 100 vnums available (#00 to #99, where # is the zone
|
zone will normally have 100 vnums available (#00 to #99, where # is the zone
|
||||||
number). Usually, when creating the first quest in a zone, #00 is used,
|
number). Usually, when creating the first quest in a zone, #00 is used,
|
||||||
then #01, etc…
|
then #01, etc.
|
||||||
|
|
||||||
When you qedit <vnum> to create a new quest (or edit an existing one), you will
|
When you qedit <vnum> to create a new quest (or edit an existing one), you will
|
||||||
see the menu in @RHELP QEDIT-MENU@n
|
see the menu in @RHELP QEDIT-MENU@n
|
||||||
@@ -7206,12 +7183,12 @@ QEDIT-ACCEPT
|
|||||||
|
|
||||||
This is the text that is sent to the player when they start the quest. It
|
This is the text that is sent to the player when they start the quest. It
|
||||||
should describe in detail exactly what is required to complete the quest. The
|
should describe in detail exactly what is required to complete the quest. The
|
||||||
text is simply output on the player’s screen, so be creative here. An example
|
text is simply output on the player's screen, so be creative here. An example
|
||||||
of an accept message text could be something like:
|
of an accept message text could be something like:
|
||||||
|
|
||||||
The questmaster rummages in a large pile of papers.
|
The questmaster rummages in a large pile of papers.
|
||||||
The questmaster says ‘Ah, here it is’
|
The questmaster says "Ah, here it is"
|
||||||
The questmaster says ‘Bob, the local butcher has offered this quest’
|
The questmaster says "Bob, the local butcher has offered this quest"
|
||||||
The questmaster shows you a hastily scrawled note, that reads:
|
The questmaster shows you a hastily scrawled note, that reads:
|
||||||
|
|
||||||
I am willing to offer any plucky adventurer 10 quest points if they bring me a
|
I am willing to offer any plucky adventurer 10 quest points if they bring me a
|
||||||
@@ -7221,7 +7198,7 @@ order to fill. I need these within 24 hours
|
|||||||
|
|
||||||
Thanks, Bob the Butcher, Midgaard
|
Thanks, Bob the Butcher, Midgaard
|
||||||
The questmaster sighs.
|
The questmaster sighs.
|
||||||
The questmaster says ‘A tricky quest, but it’ll cost you 5qp to back out now’
|
The questmaster says "A tricky quest, but it'll cost you 5qp to back out now"
|
||||||
#31
|
#31
|
||||||
QEDIT-COMPLETED QEDIT-ABANDONED
|
QEDIT-COMPLETED QEDIT-ABANDONED
|
||||||
|
|
||||||
@@ -7235,7 +7212,7 @@ all timed quests.
|
|||||||
QEDIT-COMPLETION
|
QEDIT-COMPLETION
|
||||||
|
|
||||||
Just like the accept message, this is simply text that is output on the
|
Just like the accept message, this is simply text that is output on the
|
||||||
player’s screen when they successfully complete the quest. Prizes (quest
|
player's screen when they successfully complete the quest. Prizes (quest
|
||||||
points, gold coins, experience points or an object) are automatically
|
points, gold coins, experience points or an object) are automatically
|
||||||
announced after this text is shown, so this text does not need to have that
|
announced after this text is shown, so this text does not need to have that
|
||||||
information in it.
|
information in it.
|
||||||
@@ -7261,7 +7238,7 @@ Quest flags: @cNOBITS@n
|
|||||||
Enter quest flags, 0 to quit :
|
Enter quest flags, 0 to quit :
|
||||||
|
|
||||||
Currently, only one flag is available, the REPEATABLE flag. When you have
|
Currently, only one flag is available, the REPEATABLE flag. When you have
|
||||||
finished turning this on or off, select ‘0’ (zero) to return to the main menu.
|
finished turning this on or off, select "0" (zero) to return to the main menu.
|
||||||
#31
|
#31
|
||||||
QEDIT-LEVELS
|
QEDIT-LEVELS
|
||||||
|
|
||||||
@@ -7315,12 +7292,12 @@ QEDIT-NEXT
|
|||||||
|
|
||||||
This is the quest vnum of next quest in a chain. When a player completes
|
This is the quest vnum of next quest in a chain. When a player completes
|
||||||
the current quest, the next quest will automatically be joined. This allows
|
the current quest, the next quest will automatically be joined. This allows
|
||||||
for long quests with a number of ‘steps’.
|
for long quests with a number of "steps".
|
||||||
#31
|
#31
|
||||||
QEDIT-PREREQUISITE
|
QEDIT-PREREQUISITE
|
||||||
|
|
||||||
This is the object vnum for a prerequisite object. The prerequisite object
|
This is the object vnum for a prerequisite object. The prerequisite object
|
||||||
should be in the player’s inventory in order for them to be able to join the
|
should be in the player's inventory in order for them to be able to join the
|
||||||
quest. It is not taken from the player when the quest starts.
|
quest. It is not taken from the player when the quest starts.
|
||||||
#31
|
#31
|
||||||
QEDIT-PREVIOUS
|
QEDIT-PREVIOUS
|
||||||
@@ -7331,15 +7308,15 @@ completed by the player in order to join this quest.
|
|||||||
QEDIT-QUANTITY
|
QEDIT-QUANTITY
|
||||||
|
|
||||||
This is the number of times the player needs to repeat the quest. For
|
This is the number of times the player needs to repeat the quest. For
|
||||||
example, it could be the number of items the player needs to find in a ‘object’
|
example, it could be the number of items the player needs to find in a "object"
|
||||||
quest of the number of mobs the player should kill in a ‘kill mob’ quest. This
|
quest of the number of mobs the player should kill in a "kill mob" quest. This
|
||||||
should be used with caution, however. In an object quest ‘picking up’ the same
|
should be used with caution, however. In an object quest picking up the same
|
||||||
object 20 times will also complete the quest.
|
object 20 times will also complete the quest.
|
||||||
#31
|
#31
|
||||||
QEDIT-QUIT QEDIT-MESSAGE
|
QEDIT-QUIT QEDIT-MESSAGE
|
||||||
|
|
||||||
The quit message is sent to the player when they type quest leave. Players
|
The quit message is sent to the player when they type quest leave. Players
|
||||||
can lose quest points for abandoning a quest (see “Abandoned” on the next
|
can lose quest points for abandoning a quest (see "Abandoned" on the next
|
||||||
page), so if they lose quest points, this text really should inform them of
|
page), so if they lose quest points, this text really should inform them of
|
||||||
that.
|
that.
|
||||||
#31
|
#31
|
||||||
@@ -7368,14 +7345,14 @@ Room, Clear Room - Room VNUM
|
|||||||
#31
|
#31
|
||||||
QEDIT-TIME
|
QEDIT-TIME
|
||||||
|
|
||||||
This is the number of ‘ticks’ or game hours that the player has to complete
|
This is the number of 'ticks' or game hours that the player has to complete
|
||||||
the quest. If this is set, then the builder should really try to do the quest
|
the quest. If this is set, then the builder should really try to do the quest
|
||||||
themselves, and time how long it takes (typing ‘time’ before and after the
|
themselves, and time how long it takes (typing 'time' before and after the
|
||||||
attempt), and then giving at least one extra ‘tick’ for players to complete it.
|
attempt), and then giving at least one extra 'tick' for players to complete it.
|
||||||
#31
|
#31
|
||||||
QEDIT-TYPE
|
QEDIT-TYPE
|
||||||
|
|
||||||
There are a few different quest types. When you select option ‘7’ from the
|
There are a few different quest types. When you select option '7' from the
|
||||||
main menu, you will be shown a list to choose from:
|
main menu, you will be shown a list to choose from:
|
||||||
|
|
||||||
0) Object - Player needs to find a particular object.
|
0) Object - Player needs to find a particular object.
|
||||||
@@ -7450,7 +7427,7 @@ Usage: quest [list | join <#> | progress | leave | history]
|
|||||||
|
|
||||||
quest - Show usage information for the quest command.
|
quest - Show usage information for the quest command.
|
||||||
quest list - Used at the questmaster to see which quests are available.
|
quest list - Used at the questmaster to see which quests are available.
|
||||||
quest join # - Used to the questmaster to join the quest listed as number ‘nn’ on quest list.
|
quest join # - Used to the questmaster to join the quest listed as number 'nn' on quest list.
|
||||||
quest progress - Shows the player which quest they are doing, and their quest progress.
|
quest progress - Shows the player which quest they are doing, and their quest progress.
|
||||||
quest leave - Allows the player to abandon the current quest, taking the quest point penalty.
|
quest leave - Allows the player to abandon the current quest, taking the quest point penalty.
|
||||||
quest history - Shows all previously completed non-repeatable quests.
|
quest history - Shows all previously completed non-repeatable quests.
|
||||||
@@ -9355,7 +9332,7 @@ and simply bearing artistic merit. Second, by ensuring that they are absolutely
|
|||||||
necessary to achieve the goals of the game! If your game is made for experience
|
necessary to achieve the goals of the game! If your game is made for experience
|
||||||
and equipment gathering, and failure to read descriptions directly impedes this
|
and equipment gathering, and failure to read descriptions directly impedes this
|
||||||
goal, then players will learn to read everything. If your game is made for
|
goal, then players will learn to read everything. If your game is made for
|
||||||
exploring or role-play, most of your players probably already read them Â-
|
exploring or role-play, most of your players probably already read them -
|
||||||
because knowing their environment is a basic requirement of play. In any case,
|
because knowing their environment is a basic requirement of play. In any case,
|
||||||
builders exist to ensure that the goals of play are supported by game
|
builders exist to ensure that the goals of play are supported by game
|
||||||
descriptions.
|
descriptions.
|
||||||
@@ -9367,7 +9344,7 @@ meaning behind descriptions, areas to find, special items, unique nooks and
|
|||||||
crannies to spend time socializing, and hints that point to these things
|
crannies to spend time socializing, and hints that point to these things
|
||||||
elsewhere outside of your own zone is an excellent idea. In fact, if you
|
elsewhere outside of your own zone is an excellent idea. In fact, if you
|
||||||
don't wish to be building descriptions no one will read, you should employ
|
don't wish to be building descriptions no one will read, you should employ
|
||||||
special secrets Â- most especially on games where knowing one's environment
|
special secrets - most especially on games where knowing one's environment
|
||||||
does deeply affect a character's development. No matter what kind of zone you
|
does deeply affect a character's development. No matter what kind of zone you
|
||||||
are building, keep it interesting throughout!
|
are building, keep it interesting throughout!
|
||||||
|
|
||||||
@@ -9390,7 +9367,7 @@ road.
|
|||||||
shouldn't be the sole builder of your zone. Instead, seek the assistance of
|
shouldn't be the sole builder of your zone. Instead, seek the assistance of
|
||||||
someone who adds creative merit to your descriptions. You can do practically
|
someone who adds creative merit to your descriptions. You can do practically
|
||||||
everything from plot to secrets to minutiae, even write the zone in full and
|
everything from plot to secrets to minutiae, even write the zone in full and
|
||||||
just ask someone you know who writes well to Â'say it better' and rewrite
|
just ask someone you know who writes well to 'say it better' and rewrite
|
||||||
what you intended to have there all along. Novels have editors, and so
|
what you intended to have there all along. Novels have editors, and so
|
||||||
should any zone.
|
should any zone.
|
||||||
|
|
||||||
@@ -9662,19 +9639,19 @@ have a point and here it is: *drum roll please*
|
|||||||
Building is hard work! It is a form of expression and creativity. What kind
|
Building is hard work! It is a form of expression and creativity. What kind
|
||||||
of areas you build generally reflects on what kind of person you are. You
|
of areas you build generally reflects on what kind of person you are. You
|
||||||
do not have to be a good speller but you do need a good dictionary/thesaurus.
|
do not have to be a good speller but you do need a good dictionary/thesaurus.
|
||||||
@RHELP M-W@n. Sometimes building can seem like a thankless job and sometimes
|
Sometimes building can seem like a thankless job and sometimes building can be
|
||||||
building can be a reward in itself. Building a few areas, even a few good
|
a reward in itself. Building a few areas, even a few good ones, does not make
|
||||||
ones, does not make you an Immortal or an Imp. It takes more than building to
|
you an Immortal or an Imp. It takes more than building to be one of those and
|
||||||
be one of those and it entails even more work. Respect others and they will
|
it entails even more work. Respect others and they will respect you. The more
|
||||||
respect you. The more detailed an area the better it is. Always choose Quality
|
detailed an area the better it is. Always choose Quality over Quantity. Put
|
||||||
over Quantity. Put some pride in your areas, develop a style of your own. Try
|
some pride in your areas, develop a style of your own. Try new things keep it
|
||||||
new things keep it interesting, if you become bored with building an area take
|
interesting, if you become bored with building an area take a break and play a
|
||||||
a break and play a mortal or do something else, don't take advantage of builder
|
mortal or do something else, don't take advantage of builder privileges.
|
||||||
privileges. Treat others as you wish to be treated. One more warning I would
|
Treat others as you wish to be treated. One more warning I would give to
|
||||||
give to builders before they take things personally or get insulted. Everyone
|
builders before they take things personally or get insulted. Everyone has their
|
||||||
has their own ideas on how to run a MUD, what it comes down to is whoever owns
|
own ideas on how to run a MUD, what it comes down to is whoever owns the MUD
|
||||||
the MUD makes the final decision, so it does not matter how good you think your
|
makes the final decision, so it does not matter how good you think your idea
|
||||||
idea is, it may never be used if the owner does not like it. Plain and simple.
|
is, it may never be used if the owner does not like it. Plain and simple.
|
||||||
You see this on every MUD. So please keep the ideas coming, but do not try to
|
You see this on every MUD. So please keep the ideas coming, but do not try to
|
||||||
force them onto anyone. Be constructive, not critical about peoples ideas.
|
force them onto anyone. Be constructive, not critical about peoples ideas.
|
||||||
Everyone is allowed their opinions.
|
Everyone is allowed their opinions.
|
||||||
@@ -9882,6 +9859,7 @@ tbalim test 61165
|
|||||||
return
|
return
|
||||||
toggle nohassle on
|
toggle nohassle on
|
||||||
|
|
||||||
|
To list empty zones "show zone none"
|
||||||
To setup test with zone 348
|
To setup test with zone 348
|
||||||
return
|
return
|
||||||
saveall
|
saveall
|
||||||
|
|||||||
@@ -990,7 +990,6 @@ He is covered in a film of dirt and grime. He smells even worse than you.
|
|||||||
30 900
|
30 900
|
||||||
8 8 1
|
8 8 1
|
||||||
E
|
E
|
||||||
T 206
|
|
||||||
#169
|
#169
|
||||||
citizen~
|
citizen~
|
||||||
a citizen~
|
a citizen~
|
||||||
|
|||||||
+57
-59
@@ -7,28 +7,6 @@ A granite fountain is gurgling here.~
|
|||||||
-1 2 15 0
|
-1 2 15 0
|
||||||
0 0 0 0 0
|
0 0 0 0 0
|
||||||
E
|
E
|
||||||
fountain basin~
|
|
||||||
The fountain is made of black granite and the water
|
|
||||||
in it looks and inviting to drink. In the center is a
|
|
||||||
'SPADE' shaped centerstone that seems to have writing
|
|
||||||
all over it.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
spade~
|
|
||||||
The spade seems to be the headstone of the center of the
|
|
||||||
fountain here. It is made of black stone and is an obelisk
|
|
||||||
in shape. It has 'Directory' on the side of it and it also
|
|
||||||
has a 'MAP' on the side of it as well.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
Map~
|
|
||||||
Nth: God Hall - Nth, Inn, Post Office, Coffee Alcove
|
|
||||||
Sth: God Hall - Sth, Bus. Ctr, Bldr Brd Rm, God Hall, Ext
|
|
||||||
Est: God Hall - Est, Imm/Mrtl Brd Rm, Upr Imm Hall, Grd Lvl, God Hl - Ext
|
|
||||||
Wst: God Hall - Wst, H.O.Jst/Chpl, Mtn Rm, Upr Imm Hall, Grd Lvl, God Hl - Ext
|
|
||||||
Dwn: Midguaard
|
|
||||||
~
|
|
||||||
E
|
|
||||||
Directory~
|
Directory~
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
Immortal Name: ===== Room # ====== Location: =======
|
Immortal Name: ===== Room # ====== Location: =======
|
||||||
@@ -57,6 +35,26 @@ Niamh ----------- 34351 ----------- God Hall, Southeast
|
|||||||
Fade ----------- 34337 ------------ God Hall, West
|
Fade ----------- 34337 ------------ God Hall, West
|
||||||
Angela -------- 34636 --------God Hall, South Extension
|
Angela -------- 34636 --------God Hall, South Extension
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
Map~
|
||||||
|
Nth: God Hall - Nth, Inn, Post Office, Coffee Alcove
|
||||||
|
Sth: God Hall - Sth, Bus. Ctr, Bldr Brd Rm, God Hall, Ext
|
||||||
|
Est: God Hall - Est, Imm/Mrtl Brd Rm, Upr Imm Hall, Grd Lvl, God Hl - Ext
|
||||||
|
Wst: God Hall - Wst, H.O.Jst/Chpl, Mtn Rm, Upr Imm Hall, Grd Lvl, God Hl - Ext
|
||||||
|
Dwn: Midguaard
|
||||||
|
~
|
||||||
|
E
|
||||||
|
spade~
|
||||||
|
The spade seems to be the headstone of the center of the fountain here. It
|
||||||
|
is made of black stone and is an obelisk in shape. It has 'Directory' on the
|
||||||
|
side of it and it also has a 'MAP' on the side of it as well.
|
||||||
|
~
|
||||||
|
E
|
||||||
|
fountain basin~
|
||||||
|
The fountain is made of black granite and the water in it looks and inviting
|
||||||
|
to drink. In the center is a 'SPADE' shaped centerstone that seems to have
|
||||||
|
writing all over it.
|
||||||
|
~
|
||||||
#34301
|
#34301
|
||||||
fouton~
|
fouton~
|
||||||
a Fouton(tm) ~
|
a Fouton(tm) ~
|
||||||
@@ -287,8 +285,8 @@ A plush couch is here in front of a coffee table.~
|
|||||||
0 0 0 0 0
|
0 0 0 0 0
|
||||||
E
|
E
|
||||||
couch~
|
couch~
|
||||||
The couch is long, has a frame of oak wood and a long
|
The couch is long, has a frame of oak wood and a long blue cushion. It
|
||||||
blue cushion. It happens to be a Futon (tm).
|
happens to be a Futon (tm).
|
||||||
~
|
~
|
||||||
#34319
|
#34319
|
||||||
LazyBoy recliner~
|
LazyBoy recliner~
|
||||||
@@ -684,15 +682,15 @@ A toilet is here made of porclein.~
|
|||||||
1 0 0 0
|
1 0 0 0
|
||||||
0 0 0 0 0
|
0 0 0 0 0
|
||||||
E
|
E
|
||||||
sign~
|
|
||||||
Be sure to Flush!
|
|
||||||
~
|
|
||||||
E
|
|
||||||
toilet toidy throne~
|
toilet toidy throne~
|
||||||
The toilet is made of white porcelien and it stands with a tank near the
|
The toilet is made of white porcelien and it stands with a tank near the
|
||||||
wall. It has a wooden seat that is made of carved walnut and it has gold
|
wall. It has a wooden seat that is made of carved walnut and it has gold
|
||||||
fixtures all around, which include the handles.
|
fixtures all around, which include the handles.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
sign~
|
||||||
|
Be sure to Flush!
|
||||||
|
~
|
||||||
#34344
|
#34344
|
||||||
sink~
|
sink~
|
||||||
a sink and granite counter~
|
a sink and granite counter~
|
||||||
@@ -702,15 +700,15 @@ A sink and long granite counter is here.~
|
|||||||
0 0 0 0
|
0 0 0 0
|
||||||
0 0 0 0 0
|
0 0 0 0 0
|
||||||
E
|
E
|
||||||
counter~
|
|
||||||
The counters are made of granite and are immaculately carved with such
|
|
||||||
precision into a smooth flowing shape and designs all over them.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
sink~
|
sink~
|
||||||
The sink is clean and white, with a shiny chrome faucet system and drain in
|
The sink is clean and white, with a shiny chrome faucet system and drain in
|
||||||
the bottom.
|
the bottom.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
counter~
|
||||||
|
The counters are made of granite and are immaculately carved with such
|
||||||
|
precision into a smooth flowing shape and designs all over them.
|
||||||
|
~
|
||||||
#34345
|
#34345
|
||||||
tub clawtub~
|
tub clawtub~
|
||||||
an old fashioned claw tub and shower~
|
an old fashioned claw tub and shower~
|
||||||
@@ -720,16 +718,16 @@ An old fashioned claw tub and shower is here.~
|
|||||||
3 0 0 0
|
3 0 0 0
|
||||||
0 0 0 0 0
|
0 0 0 0 0
|
||||||
E
|
E
|
||||||
|
tub~
|
||||||
|
The tub is made of iron and porcelin and it has claw feet in which it sits.
|
||||||
|
It is quite large and deep holding several meters of water.
|
||||||
|
~
|
||||||
|
E
|
||||||
shower~
|
shower~
|
||||||
The shower is a gold tube and a nozzle that is located on one side of the tub
|
The shower is a gold tube and a nozzle that is located on one side of the tub
|
||||||
and the water pours down over the person or persons. The valve is located just
|
and the water pours down over the person or persons. The valve is located just
|
||||||
above the fixture on the bottom of the tub that fills it.
|
above the fixture on the bottom of the tub that fills it.
|
||||||
~
|
~
|
||||||
E
|
|
||||||
tub~
|
|
||||||
The tub is made of iron and porcelin and it has claw feet in which it sits.
|
|
||||||
It is quite large and deep holding several meters of water.
|
|
||||||
~
|
|
||||||
#34346
|
#34346
|
||||||
bench~
|
bench~
|
||||||
a short teak bench~
|
a short teak bench~
|
||||||
@@ -752,16 +750,16 @@ A gurgling spring is here splashing into a golden basin.~
|
|||||||
-1 2 15 0
|
-1 2 15 0
|
||||||
0 0 0 0 0
|
0 0 0 0 0
|
||||||
E
|
E
|
||||||
|
spring~
|
||||||
|
The spring is just a free flowing stream of water that flows from the ground
|
||||||
|
with a murmuring, gurgling sound.
|
||||||
|
~
|
||||||
|
E
|
||||||
basin~
|
basin~
|
||||||
The basin is made of gold and it holds the water as it splashes out from the
|
The basin is made of gold and it holds the water as it splashes out from the
|
||||||
spring from the ground. When full it runs into what appears to be a channel
|
spring from the ground. When full it runs into what appears to be a channel
|
||||||
leading to the lagoon.
|
leading to the lagoon.
|
||||||
~
|
~
|
||||||
E
|
|
||||||
spring~
|
|
||||||
The spring is just a free flowing stream of water that flows from the ground
|
|
||||||
with a murmuring, gurgling sound.
|
|
||||||
~
|
|
||||||
#34348
|
#34348
|
||||||
statue~
|
statue~
|
||||||
a guardian statue of Rumble~
|
a guardian statue of Rumble~
|
||||||
@@ -771,6 +769,12 @@ A guardian statue of Rumble is here next to a pedistal.~
|
|||||||
0 0 0 0
|
0 0 0 0
|
||||||
0 0 0 31 0
|
0 0 0 31 0
|
||||||
E
|
E
|
||||||
|
pedistal~
|
||||||
|
The pedistal is made of rounded carved marble and it has unique designs,
|
||||||
|
portraying extreme power. The top of the pedistal is empty, but it seems that
|
||||||
|
something should go there.
|
||||||
|
~
|
||||||
|
E
|
||||||
statue Rumble rumble guardian~
|
statue Rumble rumble guardian~
|
||||||
The statue is a guardian to this shrine, it depicts one of the immortals of
|
The statue is a guardian to this shrine, it depicts one of the immortals of
|
||||||
TBA and his power and influence over all who worship here. He stands clad as a
|
TBA and his power and influence over all who worship here. He stands clad as a
|
||||||
@@ -778,12 +782,6 @@ Battle Mage, in flowing robes and carries a staff. His hair is long and flowing
|
|||||||
as he seems to be raising the staff in battle. You seem to feel at ease by this
|
as he seems to be raising the staff in battle. You seem to feel at ease by this
|
||||||
statue.
|
statue.
|
||||||
~
|
~
|
||||||
E
|
|
||||||
pedistal~
|
|
||||||
The pedistal is made of rounded carved marble and it has unique designs,
|
|
||||||
portraying extreme power. The top of the pedistal is empty, but it seems that
|
|
||||||
something should go there.
|
|
||||||
~
|
|
||||||
#34349
|
#34349
|
||||||
Opie~
|
Opie~
|
||||||
a guardian statue of Opie~
|
a guardian statue of Opie~
|
||||||
@@ -793,6 +791,11 @@ A guardian statue of Opie is here.~
|
|||||||
0 0 0 0
|
0 0 0 0
|
||||||
0 0 0 31 0
|
0 0 0 31 0
|
||||||
E
|
E
|
||||||
|
nametag~
|
||||||
|
The nametag reads Opie the Cunning and that is carved at the base of the
|
||||||
|
statue near the foot of his statue.
|
||||||
|
~
|
||||||
|
E
|
||||||
Opie Guardian~
|
Opie Guardian~
|
||||||
The statue is a guardian to this shine, it depicts one of the immortals of
|
The statue is a guardian to this shine, it depicts one of the immortals of
|
||||||
TBA and the influence of steath and cunning to all who worhip here. He stands
|
TBA and the influence of steath and cunning to all who worhip here. He stands
|
||||||
@@ -800,11 +803,6 @@ clad in carved battle armor of leather, a loose flowing shirt and a sash about
|
|||||||
his waist. In his hand he carries a dagger that is thrust outward in a backstab
|
his waist. In his hand he carries a dagger that is thrust outward in a backstab
|
||||||
motion. You feel a strange surge of adventure looking at this statue.
|
motion. You feel a strange surge of adventure looking at this statue.
|
||||||
~
|
~
|
||||||
E
|
|
||||||
nametag~
|
|
||||||
The nametag reads Opie the Cunning and that is carved at the base of the
|
|
||||||
statue near the foot of his statue.
|
|
||||||
~
|
|
||||||
#34350
|
#34350
|
||||||
Welcor~
|
Welcor~
|
||||||
a guardian statue of Welcor~
|
a guardian statue of Welcor~
|
||||||
@@ -814,6 +812,11 @@ A guardian statue of Welcor is here.~
|
|||||||
0 0 0 0
|
0 0 0 0
|
||||||
0 0 0 31 0
|
0 0 0 31 0
|
||||||
E
|
E
|
||||||
|
nametag~
|
||||||
|
The nametag reads Welcor the Bishop and that is carved at the base of the
|
||||||
|
statue near the foot of it.
|
||||||
|
~
|
||||||
|
E
|
||||||
Welcor guardian~
|
Welcor guardian~
|
||||||
The statue is a guardian to this shine, it depicts one of the immortals of
|
The statue is a guardian to this shine, it depicts one of the immortals of
|
||||||
TBA and the influence of Justice to all who worship here. He/She stands clad in
|
TBA and the influence of Justice to all who worship here. He/She stands clad in
|
||||||
@@ -821,9 +824,4 @@ a long flowing set of robes and he/she carries a warhammer in their hand. The
|
|||||||
feeling of peace overwhelms the senses when you look at the statue that seems to
|
feeling of peace overwhelms the senses when you look at the statue that seems to
|
||||||
be floating and glowing brightly.
|
be floating and glowing brightly.
|
||||||
~
|
~
|
||||||
E
|
|
||||||
nametag~
|
|
||||||
The nametag reads Welcor the Bishop and that is carved at the base of the
|
|
||||||
statue near the foot of it.
|
|
||||||
~
|
|
||||||
$~
|
$~
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ A dagger is lying here, its jewels sparkling merrily.~
|
|||||||
5 2 3 14
|
5 2 3 14
|
||||||
4 120 12 0 0
|
4 120 12 0 0
|
||||||
#3928
|
#3928
|
||||||
14~
|
curving dagger~
|
||||||
a wickedly curving dagger~
|
a wickedly curving dagger~
|
||||||
A dagger lies here on the ground, its curve looking particularly wicked.~
|
A dagger lies here on the ground, its curve looking particularly wicked.~
|
||||||
~
|
~
|
||||||
|
|||||||
+1
-1
@@ -127,6 +127,7 @@ Smelly Bum - M168~
|
|||||||
* By Rumble of The Builder Academy tbamud.com 9091
|
* By Rumble of The Builder Academy tbamud.com 9091
|
||||||
* A trig to let people smell the bum from 1 room away.
|
* A trig to let people smell the bum from 1 room away.
|
||||||
* For the first move there is no from_room so set it.
|
* For the first move there is no from_room so set it.
|
||||||
|
* Not working - something broke
|
||||||
if !%from_room%
|
if !%from_room%
|
||||||
eval from_room %self.room.vnum%
|
eval from_room %self.room.vnum%
|
||||||
global from_room
|
global from_room
|
||||||
@@ -157,7 +158,6 @@ end
|
|||||||
*
|
*
|
||||||
eval from_room %self.room.vnum%
|
eval from_room %self.room.vnum%
|
||||||
global from_room
|
global from_room
|
||||||
%echo% FROM:%from_room% TO:%inroom%
|
|
||||||
~
|
~
|
||||||
#207
|
#207
|
||||||
Mob Blocks opening of chest~
|
Mob Blocks opening of chest~
|
||||||
|
|||||||
+10
-8
@@ -65,6 +65,7 @@ D1
|
|||||||
~
|
~
|
||||||
0 0 4
|
0 0 4
|
||||||
S
|
S
|
||||||
|
T 56
|
||||||
#4
|
#4
|
||||||
The Beginning~
|
The Beginning~
|
||||||
By simply following the different halls new builders will be taught the
|
By simply following the different halls new builders will be taught the
|
||||||
@@ -135,7 +136,7 @@ HELP BREATHE@n
|
|||||||
D0
|
D0
|
||||||
~
|
~
|
||||||
~
|
~
|
||||||
0 0 24
|
0 0 -1
|
||||||
D1
|
D1
|
||||||
~
|
~
|
||||||
~
|
~
|
||||||
@@ -143,7 +144,7 @@ D1
|
|||||||
D2
|
D2
|
||||||
~
|
~
|
||||||
~
|
~
|
||||||
0 0 25
|
0 0 -1
|
||||||
D3
|
D3
|
||||||
~
|
~
|
||||||
~
|
~
|
||||||
@@ -151,7 +152,7 @@ D3
|
|||||||
D4
|
D4
|
||||||
~
|
~
|
||||||
~
|
~
|
||||||
0 0 26
|
0 0 -1
|
||||||
S
|
S
|
||||||
#7
|
#7
|
||||||
Writing Good Descriptions~
|
Writing Good Descriptions~
|
||||||
@@ -215,7 +216,7 @@ D3
|
|||||||
D4
|
D4
|
||||||
~
|
~
|
||||||
~
|
~
|
||||||
0 0 27
|
0 0 -1
|
||||||
S
|
S
|
||||||
#9
|
#9
|
||||||
How to Use Oedit~
|
How to Use Oedit~
|
||||||
@@ -570,6 +571,7 @@ John Stuart Mill
|
|||||||
~
|
~
|
||||||
0 8 0 0 0 0
|
0 8 0 0 0 0
|
||||||
S
|
S
|
||||||
|
T 308
|
||||||
#34
|
#34
|
||||||
Pool of Images~
|
Pool of Images~
|
||||||
A broad mosaic walkway wraps around the natural hotsprings in this cavernous
|
A broad mosaic walkway wraps around the natural hotsprings in this cavernous
|
||||||
@@ -775,14 +777,14 @@ D2
|
|||||||
~
|
~
|
||||||
0 0 98
|
0 0 98
|
||||||
E
|
E
|
||||||
|
sky winds~
|
||||||
|
Cold winds plunge ceaselessly at you from the dark, cloudless sky.
|
||||||
|
~
|
||||||
|
E
|
||||||
floor~
|
floor~
|
||||||
The stone floor is the same shade of gray as the sky and is completely plain
|
The stone floor is the same shade of gray as the sky and is completely plain
|
||||||
and unscratched. It is probably too hard for anything to leave as much as a
|
and unscratched. It is probably too hard for anything to leave as much as a
|
||||||
scratch on it.
|
scratch on it.
|
||||||
~
|
~
|
||||||
E
|
|
||||||
sky winds~
|
|
||||||
Cold winds plunge ceaselessly at you from the dark, cloudless sky.
|
|
||||||
~
|
|
||||||
S
|
S
|
||||||
$~
|
$~
|
||||||
|
|||||||
+38
-38
@@ -72,7 +72,7 @@ Zone 1 is linked to the following zones:
|
|||||||
2 Sanctus II at 199 (south) ---> 206
|
2 Sanctus II at 199 (south) ---> 206
|
||||||
~
|
~
|
||||||
S
|
S
|
||||||
T 56
|
T 24
|
||||||
#101
|
#101
|
||||||
The Temple of the Gods~
|
The Temple of the Gods~
|
||||||
This seems to be the highest point in the kingdom of Sanctus. It is from
|
This seems to be the highest point in the kingdom of Sanctus. It is from
|
||||||
@@ -92,19 +92,19 @@ D5
|
|||||||
~
|
~
|
||||||
0 0 100
|
0 0 100
|
||||||
E
|
E
|
||||||
altar~
|
|
||||||
The altar is made from black granite and has been carved into a small basin
|
|
||||||
with a high back. Almost as if it was meant to be some sort of seat.
|
|
||||||
Inscriptions in some foreign tongue are written on every square inch of the
|
|
||||||
altar. You wonder what they must say and who could have written it.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
statue~
|
statue~
|
||||||
As you examine the statues more closely you realize they must resemble the
|
As you examine the statues more closely you realize they must resemble the
|
||||||
two gods responsible for the creation and ongoing protection of Sanctus, Ferret
|
two gods responsible for the creation and ongoing protection of Sanctus, Ferret
|
||||||
and Rumble. They both radiate a strength and power that resembles the solid
|
and Rumble. They both radiate a strength and power that resembles the solid
|
||||||
white marble they were crafted from.
|
white marble they were crafted from.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
altar~
|
||||||
|
The altar is made from black granite and has been carved into a small basin
|
||||||
|
with a high back. Almost as if it was meant to be some sort of seat.
|
||||||
|
Inscriptions in some foreign tongue are written on every square inch of the
|
||||||
|
altar. You wonder what they must say and who could have written it.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
T 158
|
T 158
|
||||||
T 163
|
T 163
|
||||||
@@ -240,17 +240,17 @@ D5
|
|||||||
~
|
~
|
||||||
0 0 142
|
0 0 142
|
||||||
E
|
E
|
||||||
table~
|
|
||||||
The table is made out of cherry. It is worn from years of use. The glass
|
|
||||||
top allows for an excellent view of the map protected within.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
map~
|
map~
|
||||||
The map is a geographic representation of Sanctus. Not even really a map,
|
The map is a geographic representation of Sanctus. Not even really a map,
|
||||||
more of a scaled model. The walls and buildings of the city are raised higher
|
more of a scaled model. The walls and buildings of the city are raised higher
|
||||||
than the rest of the map to give it a third dimension. Small soldiers are
|
than the rest of the map to give it a third dimension. Small soldiers are
|
||||||
scattered around the top of the table to help the War Master place his men.
|
scattered around the top of the table to help the War Master place his men.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
table~
|
||||||
|
The table is made out of cherry. It is worn from years of use. The glass
|
||||||
|
top allows for an excellent view of the map protected within.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#109
|
#109
|
||||||
Thieves Retreat~
|
Thieves Retreat~
|
||||||
@@ -383,18 +383,18 @@ D1
|
|||||||
~
|
~
|
||||||
0 0 100
|
0 0 100
|
||||||
E
|
E
|
||||||
hole~
|
|
||||||
You can look out over the inner wall to the western side of Sanctus. The
|
|
||||||
smell of charred human remains and smoldering plaster makes your eyes water so
|
|
||||||
it is difficult to see much else through the tiny hole.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
man silhouette~
|
man silhouette~
|
||||||
The distinct outline of a human body that must have taken the brunt of the
|
The distinct outline of a human body that must have taken the brunt of the
|
||||||
blast when the portal imploded. You wonder what or who it might have been.
|
blast when the portal imploded. You wonder what or who it might have been.
|
||||||
You can still see pieces of cloth and bone buried deeply into the wall inside
|
You can still see pieces of cloth and bone buried deeply into the wall inside
|
||||||
the shadow of the unlucky man.
|
the shadow of the unlucky man.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
hole~
|
||||||
|
You can look out over the inner wall to the western side of Sanctus. The
|
||||||
|
smell of charred human remains and smoldering plaster makes your eyes water so
|
||||||
|
it is difficult to see much else through the tiny hole.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#117
|
#117
|
||||||
Travelling Room~
|
Travelling Room~
|
||||||
@@ -530,19 +530,19 @@ D2
|
|||||||
~
|
~
|
||||||
0 0 129
|
0 0 129
|
||||||
E
|
E
|
||||||
shrine~
|
|
||||||
A beutiful shrine. It has two white marble figures facing each other with a
|
|
||||||
painting of the city below them. The two figures seem to be looking down at
|
|
||||||
the city with looks of worry and hopelessness. An unlit candle and mirror lay
|
|
||||||
on the floor beside the small shrine.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
table desk chair~
|
table desk chair~
|
||||||
The table, desk, and chair are made from solid oak of the highest quality.
|
The table, desk, and chair are made from solid oak of the highest quality.
|
||||||
A thin goose down mattress and pillow are the only comfortable looking items in
|
A thin goose down mattress and pillow are the only comfortable looking items in
|
||||||
the room. The desk is bare and all the drawers are empty. It is as if no one
|
the room. The desk is bare and all the drawers are empty. It is as if no one
|
||||||
even lives here.
|
even lives here.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
shrine~
|
||||||
|
A beutiful shrine. It has two white marble figures facing each other with a
|
||||||
|
painting of the city below them. The two figures seem to be looking down at
|
||||||
|
the city with looks of worry and hopelessness. An unlit candle and mirror lay
|
||||||
|
on the floor beside the small shrine.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#125
|
#125
|
||||||
Plane of the Magi~
|
Plane of the Magi~
|
||||||
@@ -816,10 +816,14 @@ D0
|
|||||||
~
|
~
|
||||||
0 0 128
|
0 0 128
|
||||||
E
|
E
|
||||||
bed~
|
window~
|
||||||
The bed is made of a sturdy pine. A thin mattress covered in a white sheet
|
Overlooking the western gate you can see the shimmering protective dome.
|
||||||
with a down pillow overlaying it. The mattress is too thin to hold anything of
|
You hope it lasts, peace and tranquility is a good thing.
|
||||||
value.
|
~
|
||||||
|
E
|
||||||
|
chair~
|
||||||
|
It's just your standard wooden chair. Uncomfortable and only real
|
||||||
|
usefulness would be as firewood.
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
desk~
|
desk~
|
||||||
@@ -829,14 +833,10 @@ centered on the top of the desk. The desk has three drawers. All of them are
|
|||||||
empty.
|
empty.
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
chair~
|
bed~
|
||||||
It's just your standard wooden chair. Uncomfortable and only real
|
The bed is made of a sturdy pine. A thin mattress covered in a white sheet
|
||||||
usefulness would be as firewood.
|
with a down pillow overlaying it. The mattress is too thin to hold anything of
|
||||||
~
|
value.
|
||||||
E
|
|
||||||
window~
|
|
||||||
Overlooking the western gate you can see the shimmering protective dome.
|
|
||||||
You hope it lasts, peace and tranquility is a good thing.
|
|
||||||
~
|
~
|
||||||
S
|
S
|
||||||
#136
|
#136
|
||||||
|
|||||||
+9
-3
@@ -1372,15 +1372,21 @@ D5
|
|||||||
door~
|
door~
|
||||||
2 0 225
|
2 0 225
|
||||||
E
|
E
|
||||||
|
sky winds~
|
||||||
|
Cold winds plunge ceaselessly at you from the dark, cloudless sky.
|
||||||
|
~
|
||||||
|
E
|
||||||
floor~
|
floor~
|
||||||
The stone floor is the same shade of gray as the sky and is completely plain
|
The stone floor is the same shade of gray as the sky and is completely plain
|
||||||
and unscratched. It is probably too hard for anything to leave as much as a
|
and unscratched. It is probably too hard for anything to leave as much as a
|
||||||
scratch on it.
|
scratch on it.
|
||||||
~
|
~
|
||||||
E
|
S
|
||||||
sky winds~
|
#391
|
||||||
Cold winds plunge ceaselessly at you from the dark, cloudless sky.
|
Bomber's Trial Vnum~
|
||||||
|
You are in an unfinished room.
|
||||||
~
|
~
|
||||||
|
3 0 0 0 0 0
|
||||||
S
|
S
|
||||||
#399
|
#399
|
||||||
Welcome to the Builder Academy~
|
Welcome to the Builder Academy~
|
||||||
|
|||||||
+203
-203
@@ -12,6 +12,11 @@ Campus Crescent continues to the east.
|
|||||||
~
|
~
|
||||||
0 -1 30101
|
0 -1 30101
|
||||||
E
|
E
|
||||||
|
sign~
|
||||||
|
Campus by Matrix and The Wandering Bard
|
||||||
|
Copyright 1994 by Curious Areas Workshop
|
||||||
|
~
|
||||||
|
E
|
||||||
info credits~
|
info credits~
|
||||||
Campus by Matrix and The Wandering Bard
|
Campus by Matrix and The Wandering Bard
|
||||||
Copyright 1994 by Curious Areas Workshop
|
Copyright 1994 by Curious Areas Workshop
|
||||||
@@ -55,11 +60,6 @@ Zone 301 is linked to the following zones:
|
|||||||
301, 302 and 303. Please ensure that any entrances into the area are flagged
|
301, 302 and 303. Please ensure that any entrances into the area are flagged
|
||||||
nomob to keep them in. - Parna for TBAMud.)
|
nomob to keep them in. - Parna for TBAMud.)
|
||||||
~
|
~
|
||||||
E
|
|
||||||
sign~
|
|
||||||
Campus by Matrix and The Wandering Bard
|
|
||||||
Copyright 1994 by Curious Areas Workshop
|
|
||||||
~
|
|
||||||
S
|
S
|
||||||
#30101
|
#30101
|
||||||
Campus Crescent~
|
Campus Crescent~
|
||||||
@@ -112,13 +112,13 @@ Campus Crescent continues to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30101
|
0 -1 30101
|
||||||
E
|
E
|
||||||
dorm dormitory dormitories~
|
|
||||||
Well, they're dormitories. What else can be said?
|
|
||||||
~
|
|
||||||
E
|
|
||||||
cobblestone stone cobble~
|
cobblestone stone cobble~
|
||||||
The cobblestones are clean.
|
The cobblestones are clean.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
dorm dormitory dormitories~
|
||||||
|
Well, they're dormitories. What else can be said?
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30103
|
#30103
|
||||||
Campus Crescent~
|
Campus Crescent~
|
||||||
@@ -144,13 +144,13 @@ Campus Crescent continues to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30102
|
0 -1 30102
|
||||||
E
|
E
|
||||||
cobblestone stone cobble~
|
|
||||||
The cobblestones are clean.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
caf cafeteria~
|
caf cafeteria~
|
||||||
You barely see, through the thick putrid fumes, the Mary Rotte Cafeteria.
|
You barely see, through the thick putrid fumes, the Mary Rotte Cafeteria.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
cobblestone stone cobble~
|
||||||
|
The cobblestones are clean.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30104
|
#30104
|
||||||
The Crossroads~
|
The Crossroads~
|
||||||
@@ -214,13 +214,13 @@ The Crossroads lie to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30104
|
0 -1 30104
|
||||||
E
|
E
|
||||||
cobblestone stone cobble~
|
|
||||||
The cobblestones are clean.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
building~
|
building~
|
||||||
The buildings seem warm and inviting. You almost feel like hugging one.
|
The buildings seem warm and inviting. You almost feel like hugging one.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
cobblestone stone cobble~
|
||||||
|
The cobblestones are clean.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30106
|
#30106
|
||||||
Campus Crescent~
|
Campus Crescent~
|
||||||
@@ -251,8 +251,8 @@ Campus Crescent continues to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30105
|
0 -1 30105
|
||||||
E
|
E
|
||||||
cobblestone stone cobble~
|
round building~
|
||||||
The cobblestones are still clean.
|
Yes... It's a round building. Go figure.
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
bookstore~
|
bookstore~
|
||||||
@@ -260,8 +260,8 @@ bookstore~
|
|||||||
floor.
|
floor.
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
round building~
|
cobblestone stone cobble~
|
||||||
Yes... It's a round building. Go figure.
|
The cobblestones are still clean.
|
||||||
~
|
~
|
||||||
S
|
S
|
||||||
#30107
|
#30107
|
||||||
@@ -286,13 +286,13 @@ Campus Crescent and its cobblestones are to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30106
|
0 -1 30106
|
||||||
E
|
E
|
||||||
cobblestone stone cobble~
|
|
||||||
It's asphalt, you idiot! If you want to look at cobblestones, go west.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
asphalt pavement~
|
asphalt pavement~
|
||||||
It's asphalt.
|
It's asphalt.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
cobblestone stone cobble~
|
||||||
|
It's asphalt, you idiot! If you want to look at cobblestones, go west.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30108
|
#30108
|
||||||
University Avenue~
|
University Avenue~
|
||||||
@@ -316,8 +316,8 @@ The cafeteria lies to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30128
|
0 -1 30128
|
||||||
E
|
E
|
||||||
cobblestone stone cobble~
|
cafeteria fog~
|
||||||
It's a dirt road. There are NO cobblestones here, although to the north...
|
The fog seems to be coming from the Mary Rotte Cafeteria.
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
dirt~
|
dirt~
|
||||||
@@ -325,8 +325,8 @@ dirt~
|
|||||||
World Dictionary)
|
World Dictionary)
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
cafeteria fog~
|
cobblestone stone cobble~
|
||||||
The fog seems to be coming from the Mary Rotte Cafeteria.
|
It's a dirt road. There are NO cobblestones here, although to the north...
|
||||||
~
|
~
|
||||||
S
|
S
|
||||||
#30109
|
#30109
|
||||||
@@ -346,14 +346,14 @@ Morris House lies to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30129
|
0 -1 30129
|
||||||
E
|
E
|
||||||
|
dormitory dorm~
|
||||||
|
They are student living establishments.
|
||||||
|
~
|
||||||
|
E
|
||||||
dirt~
|
dirt~
|
||||||
It's unclean matter, such as mud, trash, earth, or soil. (Webster's New
|
It's unclean matter, such as mud, trash, earth, or soil. (Webster's New
|
||||||
World Dictionary)
|
World Dictionary)
|
||||||
~
|
~
|
||||||
E
|
|
||||||
dormitory dorm~
|
|
||||||
They are student living establishments.
|
|
||||||
~
|
|
||||||
S
|
S
|
||||||
#30110
|
#30110
|
||||||
University Avenue~
|
University Avenue~
|
||||||
@@ -382,8 +382,8 @@ The Engineering building, Ellis Hall, lies to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30132
|
0 -1 30132
|
||||||
E
|
E
|
||||||
cobblestone stone cobble~
|
building buildings~
|
||||||
It's a dirt road. There are NO cobblestones here, although to the south...
|
There are two buildings here. Which one?
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
dirt~
|
dirt~
|
||||||
@@ -391,8 +391,8 @@ dirt~
|
|||||||
World Dictionary)
|
World Dictionary)
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
building buildings~
|
cobblestone stone cobble~
|
||||||
There are two buildings here. Which one?
|
It's a dirt road. There are NO cobblestones here, although to the south...
|
||||||
~
|
~
|
||||||
S
|
S
|
||||||
#30111
|
#30111
|
||||||
@@ -422,14 +422,14 @@ The Commerce building, Dunning Hall, lies to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30135
|
0 -1 30135
|
||||||
E
|
E
|
||||||
|
building buildings~
|
||||||
|
There are two buildings here. Which one?
|
||||||
|
~
|
||||||
|
E
|
||||||
dirt~
|
dirt~
|
||||||
It's unclean matter, such as mud, trash, earth, or soil. (Webster's New
|
It's unclean matter, such as mud, trash, earth, or soil. (Webster's New
|
||||||
World Dictionary)
|
World Dictionary)
|
||||||
~
|
~
|
||||||
E
|
|
||||||
building buildings~
|
|
||||||
There are two buildings here. Which one?
|
|
||||||
~
|
|
||||||
S
|
S
|
||||||
#30112
|
#30112
|
||||||
University Avenue~
|
University Avenue~
|
||||||
@@ -481,23 +481,23 @@ University Avenue continues to the south.
|
|||||||
~
|
~
|
||||||
0 -1 30112
|
0 -1 30112
|
||||||
E
|
E
|
||||||
dirt~
|
building~
|
||||||
It's unclean matter, such as mud, trash, earth, or soil. (Webster's New
|
The student center lies to the east.
|
||||||
World Dictionary)
|
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
sign warning~
|
sign warning~
|
||||||
The sign says:
|
The sign says:
|
||||||
Welcome to the Student Ghetto!
|
Welcome to the Student Ghetto!
|
||||||
@n
|
n
|
||||||
Fine $103.50 for carrying open alcohol in the streets.
|
Fine $103.50 for carrying open alcohol in the streets.
|
||||||
Fine $ 53.75 for excessively loud noises.
|
Fine $ 53.75 for excessively loud noises.
|
||||||
@n
|
n
|
||||||
ENTER AT YOUR OWN RISK!
|
ENTER AT YOUR OWN RISK!
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
building~
|
dirt~
|
||||||
The student center lies to the east.
|
It's unclean matter, such as mud, trash, earth, or soil. (Webster's New
|
||||||
|
World Dictionary)
|
||||||
~
|
~
|
||||||
S
|
S
|
||||||
#30114
|
#30114
|
||||||
@@ -522,13 +522,13 @@ University Avenue lies to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30112
|
0 -1 30112
|
||||||
E
|
E
|
||||||
non-descript non descript~
|
|
||||||
(No description)
|
|
||||||
~
|
|
||||||
E
|
|
||||||
building~
|
building~
|
||||||
The student center lies to the north.
|
The student center lies to the north.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
non-descript non descript~
|
||||||
|
(No description)
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30115
|
#30115
|
||||||
Union Street~
|
Union Street~
|
||||||
@@ -557,13 +557,13 @@ Union Street continues to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30114
|
0 -1 30114
|
||||||
E
|
E
|
||||||
non-descript non descript~
|
|
||||||
(No description)
|
|
||||||
~
|
|
||||||
E
|
|
||||||
building buildings~
|
building buildings~
|
||||||
There are two buildings here. Which one?
|
There are two buildings here. Which one?
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
non-descript non descript~
|
||||||
|
(No description)
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30116
|
#30116
|
||||||
Division Road~
|
Division Road~
|
||||||
@@ -588,13 +588,13 @@ Union Street is to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30115
|
0 -1 30115
|
||||||
E
|
E
|
||||||
building gym arena~
|
|
||||||
The Jock Hardy Arena lies to the north.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
asphalt pavement~
|
asphalt pavement~
|
||||||
It's asphalt.
|
It's asphalt.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
building gym arena~
|
||||||
|
The Jock Hardy Arena lies to the north.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30117
|
#30117
|
||||||
Division Road~
|
Division Road~
|
||||||
@@ -613,13 +613,13 @@ Division Road continues south.
|
|||||||
~
|
~
|
||||||
0 -1 30118
|
0 -1 30118
|
||||||
E
|
E
|
||||||
asphalt pavement~
|
|
||||||
It's asphalt.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
zork~
|
zork~
|
||||||
What would possess you to look at that? What is a zork anyways?
|
What would possess you to look at that? What is a zork anyways?
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
asphalt pavement~
|
||||||
|
It's asphalt.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30118
|
#30118
|
||||||
Division Road~
|
Division Road~
|
||||||
@@ -643,14 +643,14 @@ The Campus bookstore lies to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30141
|
0 -1 30141
|
||||||
E
|
E
|
||||||
|
asphalt pavement~
|
||||||
|
It's asphalt.
|
||||||
|
~
|
||||||
|
E
|
||||||
bookstore building~
|
bookstore building~
|
||||||
The bookstore is a 2-story cubical building, loud noises emanate from the top
|
The bookstore is a 2-story cubical building, loud noises emanate from the top
|
||||||
floor.
|
floor.
|
||||||
~
|
~
|
||||||
E
|
|
||||||
asphalt pavement~
|
|
||||||
It's asphalt.
|
|
||||||
~
|
|
||||||
S
|
S
|
||||||
#30119
|
#30119
|
||||||
Division Road~
|
Division Road~
|
||||||
@@ -669,13 +669,13 @@ Division Road continues south.
|
|||||||
~
|
~
|
||||||
0 -1 30120
|
0 -1 30120
|
||||||
E
|
E
|
||||||
asphalt pavement~
|
|
||||||
It's asphalt.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
zork~
|
zork~
|
||||||
What would possess you to look at that? What is a zork anyways?
|
What would possess you to look at that? What is a zork anyways?
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
asphalt pavement~
|
||||||
|
It's asphalt.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30120
|
#30120
|
||||||
Division Road~
|
Division Road~
|
||||||
@@ -694,14 +694,14 @@ Division Road continues south.
|
|||||||
~
|
~
|
||||||
0 -1 30121
|
0 -1 30121
|
||||||
E
|
E
|
||||||
asphalt pavement~
|
|
||||||
It's asphalt.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
tree~
|
tree~
|
||||||
It has been placed here just to relieve the monotony. It serves no other
|
It has been placed here just to relieve the monotony. It serves no other
|
||||||
purpose whatsoever.
|
purpose whatsoever.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
asphalt pavement~
|
||||||
|
It's asphalt.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30121
|
#30121
|
||||||
Division Road~
|
Division Road~
|
||||||
@@ -721,16 +721,16 @@ Wally World sits to the east.
|
|||||||
~
|
~
|
||||||
0 -1 30142
|
0 -1 30142
|
||||||
E
|
E
|
||||||
asphalt pavement~
|
|
||||||
It's asphalt.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
dorm dormitory~
|
dorm dormitory~
|
||||||
This is a rather tall dormitory. You'd guess that in real life, it's
|
This is a rather tall dormitory. You'd guess that in real life, it's
|
||||||
probably 11-stories high, but since that would take an absurd amount of time to
|
probably 11-stories high, but since that would take an absurd amount of time to
|
||||||
program, you don't think that there are that many floors in this replica of the
|
program, you don't think that there are that many floors in this replica of the
|
||||||
building.
|
building.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
asphalt pavement~
|
||||||
|
It's asphalt.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30122
|
#30122
|
||||||
The Northern Campus Entrance~
|
The Northern Campus Entrance~
|
||||||
@@ -747,6 +747,12 @@ The Student GHETTO... Beware!
|
|||||||
~
|
~
|
||||||
0 -1 30123
|
0 -1 30123
|
||||||
E
|
E
|
||||||
|
gate gateway pillar~
|
||||||
|
The gateway is made of limestone and covered in ivy. As you already knew
|
||||||
|
that you feel rather silly wasting your time looking at it. There is a sign on
|
||||||
|
the left pillar.
|
||||||
|
~
|
||||||
|
E
|
||||||
sign plaque~
|
sign plaque~
|
||||||
The nicely polished brass plaque reads:
|
The nicely polished brass plaque reads:
|
||||||
|
|
||||||
@@ -754,12 +760,6 @@ sign plaque~
|
|||||||
|
|
||||||
ENTER AT YOUR OWN RISK
|
ENTER AT YOUR OWN RISK
|
||||||
~
|
~
|
||||||
E
|
|
||||||
gate gateway pillar~
|
|
||||||
The gateway is made of limestone and covered in ivy. As you already knew
|
|
||||||
that you feel rather silly wasting your time looking at it. There is a sign on
|
|
||||||
the left pillar.
|
|
||||||
~
|
|
||||||
S
|
S
|
||||||
#30123
|
#30123
|
||||||
The Ghetto~
|
The Ghetto~
|
||||||
@@ -834,14 +834,14 @@ There is a locked door leading to a stairwell.
|
|||||||
door~
|
door~
|
||||||
1 30105 30295
|
1 30105 30295
|
||||||
E
|
E
|
||||||
mailbox mailboxes~
|
|
||||||
All of the mailboxes are all empty ... Just like normal you think.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
tiles floor~
|
tiles floor~
|
||||||
The floor is covered with tiles that are so ugly, you have a difficult time
|
The floor is covered with tiles that are so ugly, you have a difficult time
|
||||||
keeping your lunch down
|
keeping your lunch down
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
mailbox mailboxes~
|
||||||
|
All of the mailboxes are all empty ... Just like normal you think.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30127
|
#30127
|
||||||
Mary Rotte Cafeteria Entrance~
|
Mary Rotte Cafeteria Entrance~
|
||||||
@@ -868,14 +868,14 @@ There is a doorway leading to the kitchen.
|
|||||||
door doorway~
|
door doorway~
|
||||||
1 -1 30143
|
1 -1 30143
|
||||||
E
|
E
|
||||||
cafeteria caf~
|
|
||||||
Yes, this is the cafeteria.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
door doorway~
|
door doorway~
|
||||||
You believe that the doorway leads to the kitchen. Let's give our
|
You believe that the doorway leads to the kitchen. Let's give our
|
||||||
compliments to the chef... *grin*
|
compliments to the chef... *grin*
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
cafeteria caf~
|
||||||
|
Yes, this is the cafeteria.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30128
|
#30128
|
||||||
Mary Rotte Cafeteria Entrance~
|
Mary Rotte Cafeteria Entrance~
|
||||||
@@ -902,14 +902,14 @@ The dining hall lies to the west... Beware!
|
|||||||
~
|
~
|
||||||
0 -1 30148
|
0 -1 30148
|
||||||
E
|
E
|
||||||
cafeteria caf~
|
|
||||||
Yes, this is the cafeteria.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
door doorway~
|
door doorway~
|
||||||
You believe that the doorway leads to the kitchen. Let's give our
|
You believe that the doorway leads to the kitchen. Let's give our
|
||||||
compliments to the chef... *grin*
|
compliments to the chef... *grin*
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
cafeteria caf~
|
||||||
|
Yes, this is the cafeteria.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30129
|
#30129
|
||||||
Morris House~
|
Morris House~
|
||||||
@@ -959,16 +959,16 @@ The hallway continues west.
|
|||||||
~
|
~
|
||||||
0 -1 30324
|
0 -1 30324
|
||||||
E
|
E
|
||||||
round circle circular~
|
|
||||||
Yes, it's round.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
footnote~
|
footnote~
|
||||||
Yes, believe it or not, this is a reasonably accurate representation of the
|
Yes, believe it or not, this is a reasonably accurate representation of the
|
||||||
Physics building, Stirling Hall at our university. The lecture halls are
|
Physics building, Stirling Hall at our university. The lecture halls are
|
||||||
numbered in the same manner as represented and it is in fact round, so that you
|
numbered in the same manner as represented and it is in fact round, so that you
|
||||||
can walk in one direction all the way around the building.
|
can walk in one direction all the way around the building.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
round circle circular~
|
||||||
|
Yes, it's round.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30131
|
#30131
|
||||||
The Student Health Services Entrance~
|
The Student Health Services Entrance~
|
||||||
@@ -1038,13 +1038,13 @@ University Avenue lies to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30110
|
0 -1 30110
|
||||||
E
|
E
|
||||||
halls hallways hall hallway~
|
|
||||||
They are twisting alright.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
minds mind great greatest~
|
minds mind great greatest~
|
||||||
All of whom were probably smarter than you.
|
All of whom were probably smarter than you.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
halls hallways hall hallway~
|
||||||
|
They are twisting alright.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30134
|
#30134
|
||||||
Corry-Mack Hall~
|
Corry-Mack Hall~
|
||||||
@@ -1065,13 +1065,13 @@ Campus Crescent lies to the south.
|
|||||||
~
|
~
|
||||||
0 -1 30105
|
0 -1 30105
|
||||||
E
|
E
|
||||||
halls hallways hall hallway~
|
|
||||||
They are twisting alright.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
minds mind great greatest~
|
minds mind great greatest~
|
||||||
All of whom were probably smarter than you.
|
All of whom were probably smarter than you.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
halls hallways hall hallway~
|
||||||
|
They are twisting alright.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30135
|
#30135
|
||||||
Dunning Hall Lobby~
|
Dunning Hall Lobby~
|
||||||
@@ -1163,7 +1163,7 @@ You can distinctly see a post office here, it might have a message in it, but
|
|||||||
you are not quite sure.
|
you are not quite sure.
|
||||||
~
|
~
|
||||||
~
|
~
|
||||||
0 -1 30170
|
0 -1 -1
|
||||||
D1
|
D1
|
||||||
There are electronic sounds coming from the east.
|
There are electronic sounds coming from the east.
|
||||||
~
|
~
|
||||||
@@ -1208,18 +1208,18 @@ A long hallway lies to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30153
|
0 -1 30153
|
||||||
E
|
E
|
||||||
plaque plaques~
|
|
||||||
They are rather boring. A bunch of people you don't know.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
sign~
|
sign~
|
||||||
The sign says:
|
The sign says:
|
||||||
@n
|
n
|
||||||
Gym -> North
|
Gym -> North
|
||||||
Arena -> East
|
Arena -> East
|
||||||
Locker Rooms -> West
|
Locker Rooms -> West
|
||||||
Exit -> South
|
Exit -> South
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
plaque plaques~
|
||||||
|
They are rather boring. A bunch of people you don't know.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30140
|
#30140
|
||||||
The Grant Hall Building~
|
The Grant Hall Building~
|
||||||
@@ -1308,13 +1308,13 @@ The kitchen continues south.
|
|||||||
~
|
~
|
||||||
0 -1 30144
|
0 -1 30144
|
||||||
E
|
E
|
||||||
door doorway~
|
|
||||||
You stare intently at the door. Its wooden frame enthrals you.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
food~
|
food~
|
||||||
Believe me, you don't want to look at that!
|
Believe me, you don't want to look at that!
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
door doorway~
|
||||||
|
You stare intently at the door. Its wooden frame enthrals you.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30144
|
#30144
|
||||||
The Kitchen~
|
The Kitchen~
|
||||||
@@ -1357,13 +1357,13 @@ The dining hall continues south.
|
|||||||
~
|
~
|
||||||
0 -1 30147
|
0 -1 30147
|
||||||
E
|
E
|
||||||
food~
|
|
||||||
Believe me, you don't want to look at that!
|
|
||||||
~
|
|
||||||
E
|
|
||||||
students poor~
|
students poor~
|
||||||
You feel sorry for them.
|
You feel sorry for them.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
food~
|
||||||
|
Believe me, you don't want to look at that!
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30146
|
#30146
|
||||||
Dining Hall~
|
Dining Hall~
|
||||||
@@ -1384,13 +1384,13 @@ The dining hall continues west.
|
|||||||
~
|
~
|
||||||
0 -1 30145
|
0 -1 30145
|
||||||
E
|
E
|
||||||
food~
|
|
||||||
Believe me, you don't want to look at that!
|
|
||||||
~
|
|
||||||
E
|
|
||||||
students poor~
|
students poor~
|
||||||
You feel sorry for them.
|
You feel sorry for them.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
food~
|
||||||
|
Believe me, you don't want to look at that!
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30147
|
#30147
|
||||||
Dining Hall~
|
Dining Hall~
|
||||||
@@ -1411,13 +1411,13 @@ The dining hall continues east.
|
|||||||
~
|
~
|
||||||
0 -1 30148
|
0 -1 30148
|
||||||
E
|
E
|
||||||
food~
|
|
||||||
Believe me, you don't want to look at that!
|
|
||||||
~
|
|
||||||
E
|
|
||||||
students poor~
|
students poor~
|
||||||
You feel sorry for them.
|
You feel sorry for them.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
food~
|
||||||
|
Believe me, you don't want to look at that!
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30148
|
#30148
|
||||||
Dining Hall~
|
Dining Hall~
|
||||||
@@ -1443,13 +1443,13 @@ The dining hall continues west.
|
|||||||
~
|
~
|
||||||
0 -1 30147
|
0 -1 30147
|
||||||
E
|
E
|
||||||
food~
|
|
||||||
Believe me, you don't want to look at that!
|
|
||||||
~
|
|
||||||
E
|
|
||||||
students poor~
|
students poor~
|
||||||
You feel sorry for them.
|
You feel sorry for them.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
food~
|
||||||
|
Believe me, you don't want to look at that!
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30149
|
#30149
|
||||||
Kitchen~
|
Kitchen~
|
||||||
@@ -1470,13 +1470,13 @@ There is a storeroom beyond the door to the south.
|
|||||||
door doorway~
|
door doorway~
|
||||||
1 -1 30150
|
1 -1 30150
|
||||||
E
|
E
|
||||||
food~
|
|
||||||
Believe me, you don't want to look at that!
|
|
||||||
~
|
|
||||||
E
|
|
||||||
door doorway~
|
door doorway~
|
||||||
It's a door. It has a nice steel frame surrounding a metallic door.
|
It's a door. It has a nice steel frame surrounding a metallic door.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
food~
|
||||||
|
Believe me, you don't want to look at that!
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30150
|
#30150
|
||||||
A Storeroom~
|
A Storeroom~
|
||||||
@@ -1491,16 +1491,16 @@ These stairs lead back to the door to the kitchen.
|
|||||||
door doorway~
|
door doorway~
|
||||||
1 -1 30149
|
1 -1 30149
|
||||||
E
|
E
|
||||||
food~
|
door doorway~
|
||||||
Well, it's food.
|
It's a door. It has a nice steel frame surrounding a metallic door.
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
spam pre-made packages ingredients uninteresting stuff~
|
spam pre-made packages ingredients uninteresting stuff~
|
||||||
It's rather uninteresting.
|
It's rather uninteresting.
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
door doorway~
|
food~
|
||||||
It's a door. It has a nice steel frame surrounding a metallic door.
|
Well, it's food.
|
||||||
~
|
~
|
||||||
S
|
S
|
||||||
#30151
|
#30151
|
||||||
@@ -1522,13 +1522,13 @@ The kitchen continues west.
|
|||||||
~
|
~
|
||||||
0 -1 30149
|
0 -1 30149
|
||||||
E
|
E
|
||||||
door doorway~
|
|
||||||
You stare intently at the door. Its wooden frame enthrals you.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
food~
|
food~
|
||||||
Believe me, you don't want to look at that!
|
Believe me, you don't want to look at that!
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
door doorway~
|
||||||
|
You stare intently at the door. Its wooden frame enthrals you.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30152
|
#30152
|
||||||
Stairway~
|
Stairway~
|
||||||
@@ -1829,13 +1829,13 @@ The only way out is down.
|
|||||||
~
|
~
|
||||||
0 -1 30165
|
0 -1 30165
|
||||||
E
|
E
|
||||||
zorpa~
|
|
||||||
You see nothing special. Now what is a zorpa anyways?
|
|
||||||
~
|
|
||||||
E
|
|
||||||
moshing mosh~
|
moshing mosh~
|
||||||
All you can see is a mass of bodies moving up and down, up and down...
|
All you can see is a mass of bodies moving up and down, up and down...
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
zorpa~
|
||||||
|
You see nothing special. Now what is a zorpa anyways?
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30167
|
#30167
|
||||||
The Infobank~
|
The Infobank~
|
||||||
@@ -1856,17 +1856,17 @@ D5
|
|||||||
plank~
|
plank~
|
||||||
1 -1 30171
|
1 -1 30171
|
||||||
E
|
E
|
||||||
map~
|
|
||||||
This map shows absolutely nothing, further proving the value of student
|
|
||||||
governments to you.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
list~
|
list~
|
||||||
The list reads:
|
The list reads:
|
||||||
<name scratched out> President
|
<name scratched out> President
|
||||||
<name scratched out> Vice-President
|
<name scratched out> Vice-President
|
||||||
Seems as though everyone is claiming ignorance today.
|
Seems as though everyone is claiming ignorance today.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
map~
|
||||||
|
This map shows absolutely nothing, further proving the value of student
|
||||||
|
governments to you.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30168
|
#30168
|
||||||
The Games Room~
|
The Games Room~
|
||||||
@@ -1899,34 +1899,6 @@ You can see the central annex to the east.
|
|||||||
~
|
~
|
||||||
0 -1 30137
|
0 -1 30137
|
||||||
S
|
S
|
||||||
#30170
|
|
||||||
The Post Office~
|
|
||||||
This seems to be the standard post office given to any university by the
|
|
||||||
wonderful XXX government. You can tell that it is a university post office
|
|
||||||
because of the surplus amount of obscene graffiti upon the walls. The back
|
|
||||||
hall is south of here.
|
|
||||||
~
|
|
||||||
301 8 0 0 0 0
|
|
||||||
D2
|
|
||||||
You can see the back hall from here complete with humming bank machines.
|
|
||||||
~
|
|
||||||
~
|
|
||||||
0 -1 30138
|
|
||||||
E
|
|
||||||
graffiti~
|
|
||||||
You really don't want to read this! (if you want to continue reading type
|
|
||||||
"look wirt")
|
|
||||||
~
|
|
||||||
E
|
|
||||||
wirt~
|
|
||||||
You really are a sucker for punishment now aren't you? If you still want to
|
|
||||||
read it type "look prawn"
|
|
||||||
~
|
|
||||||
E
|
|
||||||
prawn~
|
|
||||||
You see nothing special. The Prawn is in excellent condition.
|
|
||||||
~
|
|
||||||
S
|
|
||||||
#30171
|
#30171
|
||||||
The Special Hidden Room~
|
The Special Hidden Room~
|
||||||
This room is completely empty except for the things you can see in it. The
|
This room is completely empty except for the things you can see in it. The
|
||||||
@@ -1957,6 +1929,34 @@ pamphlet leaflet photograph photo~
|
|||||||
even your stomach... Blech!
|
even your stomach... Blech!
|
||||||
~
|
~
|
||||||
S
|
S
|
||||||
|
#30170
|
||||||
|
The Post Office~
|
||||||
|
This seems to be the standard post office given to any university by the
|
||||||
|
wonderful XXX government. You can tell that it is a university post office
|
||||||
|
because of the surplus amount of obscene graffiti upon the walls. The back
|
||||||
|
hall is south of here.
|
||||||
|
~
|
||||||
|
301 8 0 0 0 0
|
||||||
|
D2
|
||||||
|
You can see the back hall from here complete with humming bank machines.
|
||||||
|
~
|
||||||
|
~
|
||||||
|
0 -1 30138
|
||||||
|
E
|
||||||
|
graffiti~
|
||||||
|
You really don't want to read this! (if you want to continue reading type
|
||||||
|
"look wirt")
|
||||||
|
~
|
||||||
|
E
|
||||||
|
wirt~
|
||||||
|
You really are a sucker for punishment now aren't you? If you still want to
|
||||||
|
read it type "look prawn"
|
||||||
|
~
|
||||||
|
E
|
||||||
|
prawn~
|
||||||
|
You see nothing special. The Prawn is in excellent condition.
|
||||||
|
~
|
||||||
|
S
|
||||||
#30173
|
#30173
|
||||||
De-Tox Unit~
|
De-Tox Unit~
|
||||||
This room seems to be the place where people get "detoxified". Although it
|
This room seems to be the place where people get "detoxified". Although it
|
||||||
@@ -2002,15 +2002,15 @@ be interesting.
|
|||||||
~
|
~
|
||||||
0 -1 30180
|
0 -1 30180
|
||||||
E
|
E
|
||||||
neat engineering devices~
|
|
||||||
You see lots of neat engineering devices which were used in the real world at
|
|
||||||
some point or another. At least you think they were.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
award awards~
|
award awards~
|
||||||
These are awards for various Engineering competitions which the university
|
These are awards for various Engineering competitions which the university
|
||||||
entered at one time or another.
|
entered at one time or another.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
neat engineering devices~
|
||||||
|
You see lots of neat engineering devices which were used in the real world at
|
||||||
|
some point or another. At least you think they were.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30175
|
#30175
|
||||||
Hallway~
|
Hallway~
|
||||||
@@ -2047,9 +2047,12 @@ The hallway you probably entered from is handily located to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30175
|
0 -1 30175
|
||||||
E
|
E
|
||||||
stage~
|
goalie~
|
||||||
The stage is located at the west end of the room. In one corner of the
|
How did you know it was a goalie stick? Have you been reading the keywords?
|
||||||
stage, there is a hockey stick lying on the ground.
|
~
|
||||||
|
E
|
||||||
|
crest~
|
||||||
|
The crest seems to be the crest belonging to the class of `97.
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
hockey stick~
|
hockey stick~
|
||||||
@@ -2057,12 +2060,9 @@ hockey stick~
|
|||||||
crest prominently displayed.
|
crest prominently displayed.
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
crest~
|
stage~
|
||||||
The crest seems to be the crest belonging to the class of `97.
|
The stage is located at the west end of the room. In one corner of the
|
||||||
~
|
stage, there is a hockey stick lying on the ground.
|
||||||
E
|
|
||||||
goalie~
|
|
||||||
How did you know it was a goalie stick? Have you been reading the keywords?
|
|
||||||
~
|
~
|
||||||
S
|
S
|
||||||
#30177
|
#30177
|
||||||
@@ -2270,13 +2270,13 @@ This leads into the building.
|
|||||||
door~
|
door~
|
||||||
2 30101 30178
|
2 30101 30178
|
||||||
E
|
E
|
||||||
pathway~
|
|
||||||
The path is well worn, but there are no discernible footsteps upon it.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
building~
|
building~
|
||||||
This is the back side of Ellis Hall, the Engineering building.
|
This is the back side of Ellis Hall, the Engineering building.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
pathway~
|
||||||
|
The path is well worn, but there are no discernible footsteps upon it.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30188
|
#30188
|
||||||
A Pathway~
|
A Pathway~
|
||||||
|
|||||||
+76
-76
@@ -1,6 +1,6 @@
|
|||||||
#30200
|
#30200
|
||||||
The Top Of The Greasepole~
|
The Top of the Greasepole~
|
||||||
You've made it to the top! All you have to do now is get down...
|
You've made it to the top! All you have to do now is get down.
|
||||||
~
|
~
|
||||||
302 4 0 0 0 5
|
302 4 0 0 0 5
|
||||||
D5
|
D5
|
||||||
@@ -9,6 +9,11 @@ It's a long slide down.
|
|||||||
~
|
~
|
||||||
0 -1 30192
|
0 -1 30192
|
||||||
E
|
E
|
||||||
|
pole greasepole~
|
||||||
|
The pole still looks pretty bad, but it doesn't look quite as bad as before.
|
||||||
|
|
||||||
|
~
|
||||||
|
E
|
||||||
info credits~
|
info credits~
|
||||||
See zone description room for Campus.
|
See zone description room for Campus.
|
||||||
Zone 302 is linked to the following zones:
|
Zone 302 is linked to the following zones:
|
||||||
@@ -48,11 +53,6 @@ Links: 64e to catacombs
|
|||||||
(Mobs Stay_Zone flags have all been disabled to allow free access between
|
(Mobs Stay_Zone flags have all been disabled to allow free access between
|
||||||
301, 302 and 303. Please ensure that any entrances into the area are flagged
|
301, 302 and 303. Please ensure that any entrances into the area are flagged
|
||||||
nomob to keep them in. - Parna for TBAMud.)
|
nomob to keep them in. - Parna for TBAMud.)
|
||||||
~
|
|
||||||
E
|
|
||||||
pole greasepole~
|
|
||||||
The pole still looks pretty bad, but it doesn't look quite as bad as before.
|
|
||||||
|
|
||||||
~
|
~
|
||||||
S
|
S
|
||||||
#30201
|
#30201
|
||||||
@@ -71,13 +71,13 @@ D2
|
|||||||
~
|
~
|
||||||
0 -1 30142
|
0 -1 30142
|
||||||
E
|
E
|
||||||
mail~
|
|
||||||
Why are you trying to look at the mail, it's private!
|
|
||||||
~
|
|
||||||
E
|
|
||||||
hooks hook key keys~
|
hooks hook key keys~
|
||||||
Unfortunately you don't see any keys hanging off of any of the hooks.
|
Unfortunately you don't see any keys hanging off of any of the hooks.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
mail~
|
||||||
|
Why are you trying to look at the mail, it's private!
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30202
|
#30202
|
||||||
Main Office~
|
Main Office~
|
||||||
@@ -92,9 +92,10 @@ This way leads back to the reception desk.
|
|||||||
door~
|
door~
|
||||||
1 30103 30201
|
1 30103 30201
|
||||||
E
|
E
|
||||||
chair~
|
filing cabinet files~
|
||||||
The chair is not unusual in any way whatsoever. The chair is in excellent
|
Looking through the files you see that Wally World was originally slated to
|
||||||
condition.
|
have at least eleven levels but the designers got sick and tired of it and gave
|
||||||
|
up after just a few levels.
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
desk~
|
desk~
|
||||||
@@ -102,10 +103,9 @@ desk~
|
|||||||
excellent condition.
|
excellent condition.
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
filing cabinet files~
|
chair~
|
||||||
Looking through the files you see that Wally World was originally slated to
|
The chair is not unusual in any way whatsoever. The chair is in excellent
|
||||||
have at least eleven levels but the designers got sick and tired of it and gave
|
condition.
|
||||||
up after just a few levels.
|
|
||||||
~
|
~
|
||||||
S
|
S
|
||||||
#30203
|
#30203
|
||||||
@@ -230,14 +230,14 @@ You can't tell where this leads.
|
|||||||
door~
|
door~
|
||||||
1 -1 30210
|
1 -1 30210
|
||||||
E
|
E
|
||||||
door~
|
|
||||||
The door on the west has the number 206 and the door on the east, 205.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
floor carpet~
|
floor carpet~
|
||||||
This is a nice, groovy, red patterned carpet which extends all the way down
|
This is a nice, groovy, red patterned carpet which extends all the way down
|
||||||
the hall.
|
the hall.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
door~
|
||||||
|
The door on the west has the number 206 and the door on the east, 205.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30209
|
#30209
|
||||||
Private Room 205~
|
Private Room 205~
|
||||||
@@ -300,15 +300,15 @@ You can't tell where this leads.
|
|||||||
door~
|
door~
|
||||||
1 -1 30213
|
1 -1 30213
|
||||||
E
|
E
|
||||||
door~
|
|
||||||
The door on the west has the number 204 and the door on the east, 203 while
|
|
||||||
the door to the north has the number 201.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
floor carpet~
|
floor carpet~
|
||||||
This is a nice, groovy, red patterned carpet which extends all the way down
|
This is a nice, groovy, red patterned carpet which extends all the way down
|
||||||
the hall.
|
the hall.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
door~
|
||||||
|
The door on the west has the number 204 and the door on the east, 203 while
|
||||||
|
the door to the north has the number 201.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30212
|
#30212
|
||||||
Private Room 203~
|
Private Room 203~
|
||||||
@@ -388,14 +388,14 @@ You can't tell where this leads.
|
|||||||
door~
|
door~
|
||||||
1 -1 30217
|
1 -1 30217
|
||||||
E
|
E
|
||||||
door~
|
|
||||||
The door on the west has the number 208 and the door on the east, 207.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
floor carpet~
|
floor carpet~
|
||||||
This is a nice, groovy, red patterned carpet which extends all the way down
|
This is a nice, groovy, red patterned carpet which extends all the way down
|
||||||
the hall.
|
the hall.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
door~
|
||||||
|
The door on the west has the number 208 and the door on the east, 207.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30216
|
#30216
|
||||||
Private Room 207~
|
Private Room 207~
|
||||||
@@ -458,15 +458,15 @@ You can't tell where this leads.
|
|||||||
door~
|
door~
|
||||||
1 -1 30220
|
1 -1 30220
|
||||||
E
|
E
|
||||||
door~
|
|
||||||
The door on the west has the number 210 and the door on the east, 209 and the
|
|
||||||
door to the south has the number 202.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
floor carpet~
|
floor carpet~
|
||||||
This is a nice, groovy, red patterned carpet which extends all the way down
|
This is a nice, groovy, red patterned carpet which extends all the way down
|
||||||
the hall.
|
the hall.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
door~
|
||||||
|
The door on the west has the number 210 and the door on the east, 209 and the
|
||||||
|
door to the south has the number 202.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30219
|
#30219
|
||||||
Private Room 209~
|
Private Room 209~
|
||||||
@@ -654,14 +654,14 @@ The trapdoor leads up... beyond that, you aren't sure where it goes.
|
|||||||
trapdoor door~
|
trapdoor door~
|
||||||
1 -1 30233
|
1 -1 30233
|
||||||
E
|
E
|
||||||
|
trapdoor~
|
||||||
|
The trapdoor is neatly fastened with a small hook.
|
||||||
|
~
|
||||||
|
E
|
||||||
desk chair plush~
|
desk chair plush~
|
||||||
The desk and chairs are neatly arranged as if in preparation for an upcoming
|
The desk and chairs are neatly arranged as if in preparation for an upcoming
|
||||||
meeting or something of the sort.
|
meeting or something of the sort.
|
||||||
~
|
~
|
||||||
E
|
|
||||||
trapdoor~
|
|
||||||
The trapdoor is neatly fastened with a small hook.
|
|
||||||
~
|
|
||||||
S
|
S
|
||||||
#30229
|
#30229
|
||||||
Hallway~
|
Hallway~
|
||||||
@@ -770,13 +770,13 @@ A chute leads down from this room.
|
|||||||
~
|
~
|
||||||
0 -1 30235
|
0 -1 30235
|
||||||
E
|
E
|
||||||
chute~
|
|
||||||
The chute is rather smooth and looks to be a fun ride.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
grate~
|
grate~
|
||||||
Beyond the grate you can see the attic.
|
Beyond the grate you can see the attic.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
chute~
|
||||||
|
The chute is rather smooth and looks to be a fun ride.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30235
|
#30235
|
||||||
The Chute~
|
The Chute~
|
||||||
@@ -871,13 +871,13 @@ An exit from this hellhole.
|
|||||||
~
|
~
|
||||||
0 -1 30240
|
0 -1 30240
|
||||||
E
|
E
|
||||||
mess~
|
|
||||||
Need you ask?
|
|
||||||
~
|
|
||||||
E
|
|
||||||
hell hole hellhole~
|
hell hole hellhole~
|
||||||
Never seen one before?
|
Never seen one before?
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
mess~
|
||||||
|
Need you ask?
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30240
|
#30240
|
||||||
The Ghetto~
|
The Ghetto~
|
||||||
@@ -897,13 +897,13 @@ A run-down house lies to the west.
|
|||||||
~
|
~
|
||||||
0 -1 30239
|
0 -1 30239
|
||||||
E
|
E
|
||||||
house run-down~
|
|
||||||
It's in bad shape.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
overturned police policemobile mobile~
|
overturned police policemobile mobile~
|
||||||
It is blocking the road quite nicely. Maybe it is meant to impede passage.
|
It is blocking the road quite nicely. Maybe it is meant to impede passage.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
house run-down~
|
||||||
|
It's in bad shape.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30241
|
#30241
|
||||||
The Ghetto Intersection~
|
The Ghetto Intersection~
|
||||||
@@ -1344,16 +1344,16 @@ The auditorium is to the north.
|
|||||||
~
|
~
|
||||||
0 -1 30259
|
0 -1 30259
|
||||||
E
|
E
|
||||||
drab brown curtains curtain~
|
sturdy wooden plank planks~
|
||||||
They are just your average, everyday, drab brown curtains.
|
They are sturdy. They are wooden. They are planks.
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
cords cord pulley pulleys~
|
cords cord pulley pulleys~
|
||||||
Hey! It can make you look like you are flying!
|
Hey! It can make you look like you are flying!
|
||||||
~
|
~
|
||||||
E
|
E
|
||||||
sturdy wooden plank planks~
|
drab brown curtains curtain~
|
||||||
They are sturdy. They are wooden. They are planks.
|
They are just your average, everyday, drab brown curtains.
|
||||||
~
|
~
|
||||||
S
|
S
|
||||||
#30262
|
#30262
|
||||||
@@ -1403,13 +1403,13 @@ It's the same stairwell.
|
|||||||
~
|
~
|
||||||
0 -1 30257
|
0 -1 30257
|
||||||
E
|
E
|
||||||
cobweb cobwebs web webs~
|
|
||||||
Don't disturb them now!
|
|
||||||
~
|
|
||||||
E
|
|
||||||
huge stone door~
|
huge stone door~
|
||||||
The huge stone door looks very inviting.
|
The huge stone door looks very inviting.
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
cobweb cobwebs web webs~
|
||||||
|
Don't disturb them now!
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30265
|
#30265
|
||||||
The Grant Hall Clock~
|
The Grant Hall Clock~
|
||||||
@@ -1785,10 +1785,6 @@ It is too dark to tell.
|
|||||||
~
|
~
|
||||||
0 -1 30276
|
0 -1 30276
|
||||||
E
|
E
|
||||||
door~
|
|
||||||
This door is covered with all types of non-magical sigils.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
sigils~
|
sigils~
|
||||||
The sigils seem to form some strange shapes:
|
The sigils seem to form some strange shapes:
|
||||||
SSSSS
|
SSSSS
|
||||||
@@ -1805,6 +1801,10 @@ sigils~
|
|||||||
SSSSS
|
SSSSS
|
||||||
I wonder what it could be?
|
I wonder what it could be?
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
door~
|
||||||
|
This door is covered with all types of non-magical sigils.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30281
|
#30281
|
||||||
A Classroom~
|
A Classroom~
|
||||||
@@ -1851,13 +1851,13 @@ You are repulsed by this exit since the exit to the east is well lit.
|
|||||||
~
|
~
|
||||||
0 -1 30274
|
0 -1 30274
|
||||||
E
|
E
|
||||||
light~
|
|
||||||
It's nice, warm, and inviting.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
dark~
|
dark~
|
||||||
Are you mad?
|
Are you mad?
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
light~
|
||||||
|
It's nice, warm, and inviting.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30283
|
#30283
|
||||||
The Exit~
|
The Exit~
|
||||||
@@ -1875,13 +1875,13 @@ Back into darkness, I don't think so!
|
|||||||
~
|
~
|
||||||
0 -1 30282
|
0 -1 30282
|
||||||
E
|
E
|
||||||
light~
|
|
||||||
It's nice, warm, and inviting.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
dark~
|
dark~
|
||||||
Are you mad?
|
Are you mad?
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
light~
|
||||||
|
It's nice, warm, and inviting.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30284
|
#30284
|
||||||
Mob Chute A~
|
Mob Chute A~
|
||||||
@@ -1916,10 +1916,6 @@ This is just an exit.
|
|||||||
~
|
~
|
||||||
0 -1 30106
|
0 -1 30106
|
||||||
E
|
E
|
||||||
door~
|
|
||||||
This door is covered with all types of non-magical sigils.
|
|
||||||
~
|
|
||||||
E
|
|
||||||
sigils~
|
sigils~
|
||||||
The sigils seem to form some strange shapes:
|
The sigils seem to form some strange shapes:
|
||||||
MMM MMM OOO OOO !!
|
MMM MMM OOO OOO !!
|
||||||
@@ -1929,6 +1925,10 @@ sigils~
|
|||||||
MM M MM OO OO OO OO
|
MM M MM OO OO OO OO
|
||||||
MM MM OOO OOO !!
|
MM MM OOO OOO !!
|
||||||
~
|
~
|
||||||
|
E
|
||||||
|
door~
|
||||||
|
This door is covered with all types of non-magical sigils.
|
||||||
|
~
|
||||||
S
|
S
|
||||||
#30285
|
#30285
|
||||||
Mob Chute B~
|
Mob Chute B~
|
||||||
|
|||||||
@@ -105,10 +105,10 @@ S
|
|||||||
#34306
|
#34306
|
||||||
The Social Gathering Room~
|
The Social Gathering Room~
|
||||||
This is the Main Social Gathering Room of the Immortals. It is circular in
|
This is the Main Social Gathering Room of the Immortals. It is circular in
|
||||||
design and it connects four foyers in all directions to the north, south, east,
|
design, and it connects four foyers in all directions to the north, south, east,
|
||||||
and west. The room is quite plush with many fountains, couches, and carpeted
|
and west. The room is quite plush with many fountains, couches, and carpeted
|
||||||
areas, also with a few planters filled with thick green bushes and trees. The
|
areas, also with a few planters filled with thick green bushes and trees. The
|
||||||
fountain seems to be glowing best to look at it.
|
fountain seems to be glowing.
|
||||||
~
|
~
|
||||||
343 28 0 0 0 0
|
343 28 0 0 0 0
|
||||||
D0
|
D0
|
||||||
@@ -159,10 +159,10 @@ D3
|
|||||||
S
|
S
|
||||||
#34308
|
#34308
|
||||||
Eastern Foyer~
|
Eastern Foyer~
|
||||||
This is the Eastern End of the Gathering Hall. This foyer continues to the
|
You are in the Eastern End of the Gathering Hall. Several pillars line this
|
||||||
east into what appears to be a hallway and west into a circular central room.
|
room. The foyer continues east into what looks like a hallway and west into a
|
||||||
Several pillars line the room here, Archways north and south lead into the
|
circular central room. Archways north and south lead into the Immortal Board
|
||||||
Immortal Board Room and the Mortal Board Room.
|
Room and the Mortal Board Room.
|
||||||
~
|
~
|
||||||
343 24 0 0 0 0
|
343 24 0 0 0 0
|
||||||
D0
|
D0
|
||||||
|
|||||||
@@ -103,8 +103,6 @@ E 1 30135 4 16 (a T-square of Death)
|
|||||||
O 0 30100 1 30176 (a red key)
|
O 0 30100 1 30176 (a red key)
|
||||||
O 0 30101 1 30186 (a brass key)
|
O 0 30101 1 30186 (a brass key)
|
||||||
O 0 30102 5 30150 (an Oreo(tm) cookie)
|
O 0 30102 5 30150 (an Oreo(tm) cookie)
|
||||||
O 0 30111 99 30172 (a condom)
|
|
||||||
O 0 30122 8 30171 (Magebane)
|
|
||||||
O 0 30129 1 30110 (the extension cord)
|
O 0 30129 1 30110 (the extension cord)
|
||||||
O 0 30129 1 30111 (the extension cord)
|
O 0 30129 1 30111 (the extension cord)
|
||||||
O 0 30129 1 30112 (the extension cord)
|
O 0 30129 1 30112 (the extension cord)
|
||||||
@@ -129,7 +127,6 @@ D 0 30155 1 1 (Locker Room)
|
|||||||
D 0 30165 0 1 (Campus Pub Stairwell)
|
D 0 30165 0 1 (Campus Pub Stairwell)
|
||||||
D 0 30141 2 1 (Campus Bookstore)
|
D 0 30141 2 1 (Campus Bookstore)
|
||||||
D 0 30167 5 1 (The Infobank)
|
D 0 30167 5 1 (The Infobank)
|
||||||
D 0 30171 4 1 (The Special Hidden Room)
|
|
||||||
D 0 30177 0 1 (Hallway)
|
D 0 30177 0 1 (Hallway)
|
||||||
D 0 30179 2 1 (Library)
|
D 0 30179 2 1 (Library)
|
||||||
D 0 30178 3 2 (The Back Exit)
|
D 0 30178 3 2 (The Back Exit)
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
Matrix of C.A.W.~
|
Matrix of C.A.W.~
|
||||||
Campus II~
|
Campus II~
|
||||||
30200 30299 30 2
|
30200 30299 30 2
|
||||||
|
R 0 30200 30112 -1 (a tam)
|
||||||
|
O 1 30112 99 30200 (a tam)
|
||||||
M 0 30105 4 30284 (Security)
|
M 0 30105 4 30284 (Security)
|
||||||
E 1 30115 99 16 (a flashlight)
|
E 1 30115 99 16 (a flashlight)
|
||||||
M 0 30105 4 30284 (Security)
|
M 0 30105 4 30284 (Security)
|
||||||
@@ -32,8 +34,6 @@ M 0 30132 1 30284 (Chris)
|
|||||||
M 0 30137 1 30284 (Alex)
|
M 0 30137 1 30284 (Alex)
|
||||||
M 0 30138 1 30284 (Steve)
|
M 0 30138 1 30284 (Steve)
|
||||||
M 0 30145 10 30284 (a copy of Golden World)
|
M 0 30145 10 30284 (a copy of Golden World)
|
||||||
R 0 30200 30112 -1 (a tam)
|
|
||||||
O 1 30112 99 30200 (a tam)
|
|
||||||
M 0 30139 1 30245 (Bob the storekeeper)
|
M 0 30139 1 30245 (Bob the storekeeper)
|
||||||
G 1 30136 99 -1 (a pale apple)
|
G 1 30136 99 -1 (a pale apple)
|
||||||
G 1 30140 99 -1 (a can of PopCoke)
|
G 1 30140 99 -1 (a can of PopCoke)
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
#4
|
#4
|
||||||
Unknown~
|
trunks shaoden~
|
||||||
Jade Forest~
|
Rename~
|
||||||
400 499 30 2 d 0 0 0 10 25
|
400 499 30 2 d 0 0 0 10 25
|
||||||
M 0 481 1 481 (Zachary)
|
M 0 481 1 481 (Zachary)
|
||||||
G 1 403 99 -1 (rawhide whip)
|
G 1 403 99 -1 (rawhide whip)
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
#6
|
#6
|
||||||
Unknown~
|
q~
|
||||||
Sea of Souls~
|
Sea of Souls~
|
||||||
600 699 30 2 d 0 0 0 10 25
|
600 699 30 2 d 0 0 0 10 25
|
||||||
M 0 600 1 600 (a snail)
|
M 0 600 1 600 (a snail)
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,26 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.27)
|
||||||
|
|
||||||
|
# Set the project name
|
||||||
|
project(circle)
|
||||||
|
|
||||||
|
# Global definitions
|
||||||
|
if(MSVC)
|
||||||
|
# using Visual Studio C++
|
||||||
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# circle itself
|
||||||
|
file(GLOB CIRCLE_SOURCES
|
||||||
|
"*.h"
|
||||||
|
"*.c"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_executable(circle ${CIRCLE_SOURCES})
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
target_link_libraries(circle wsock32.lib)
|
||||||
|
|
||||||
|
set_target_properties(circle PROPERTIES
|
||||||
|
VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/.."
|
||||||
|
)
|
||||||
|
endif()
|
||||||
+2
-2
@@ -20,8 +20,8 @@ CFLAGS = @CFLAGS@ $(MYFLAGS) $(PROFILE)
|
|||||||
|
|
||||||
LIBS = @LIBS@ @CRYPTLIB@ @NETLIB@
|
LIBS = @LIBS@ @CRYPTLIB@ @NETLIB@
|
||||||
|
|
||||||
SRCFILES := act.comm.c act.informative.c act.item.c act.movement.c act.offensive.c act.other.c act.social.c act.wizard.c aedit.c asciimap.c ban.c boards.c bsd-snprintf.c castle.c cedit.c class.c comm.c config.c constants.c db.c dg_comm.c dg_db_scripts.c dg_event.c dg_handler.c dg_misc.c dg_mobcmd.c dg_objcmd.c dg_olc.c dg_scripts.c dg_triggers.c dg_variables.c dg_wldcmd.c fight.c genmob.c genobj.c genolc.c genqst.c genshp.c genwld.c genzon.c graph.c handler.c hedit.c house.c ibt.c improved-edit.c interpreter.c limits.c lists.c magic.c mail.c medit.c mobact.c modify.c msgedit.c mud_event.c oasis.c oasis_copy.c oasis_delete.c oasis_list.c objsave.c oedit.c players.c prefedit.c protocol.c qedit.c quest.c random.c redit.c sedit.c shop.c spec_assign.c spec_procs.c spell_parser.c spells.c tedit.c utils.c weather.c zedit.c zmalloc.c
|
SRCFILES := $(shell ls *.c | sort)
|
||||||
OBJFILES := act.comm.o act.informative.o act.item.o act.movement.o act.offensive.o act.other.o act.social.o act.wizard.o aedit.o asciimap.o ban.o boards.o bsd-snprintf.o castle.o cedit.o class.o comm.o config.o constants.o db.o dg_comm.o dg_db_scripts.o dg_event.o dg_handler.o dg_misc.o dg_mobcmd.o dg_objcmd.o dg_olc.o dg_scripts.o dg_triggers.o dg_variables.o dg_wldcmd.o fight.o genmob.o genobj.o genolc.o genqst.o genshp.o genwld.o genzon.o graph.o handler.o hedit.o house.o ibt.o improved-edit.o interpreter.o limits.o lists.o magic.o mail.o medit.o mobact.o modify.o msgedit.o mud_event.o oasis.o oasis_copy.o oasis_delete.o oasis_list.o objsave.o oedit.o players.o prefedit.o protocol.o qedit.o quest.o random.o redit.o sedit.o shop.o spec_assign.o spec_procs.o spell_parser.o spells.o tedit.o utils.o weather.o zedit.o zmalloc.o
|
OBJFILES := $(patsubst %.c,%.o,$(SRCFILES))
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
# tbaMUD Makefile.in - Makefile template used by 'configure'
|
||||||
|
# Clean-up provided by seqwith.
|
||||||
|
|
||||||
|
# C compiler to use
|
||||||
|
CC = gcc
|
||||||
|
|
||||||
|
# Any special flags you want to pass to the compiler
|
||||||
|
MYFLAGS = -Wall -Wno-char-subscripts -Wno-invalid-source-encoding -DMEMORY_DEBUG
|
||||||
|
|
||||||
|
#flags for profiling (see hacker.doc for more information)
|
||||||
|
PROFILE =
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Do Not Modify Anything Below This Line (unless you know what you're doing) #
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
BINDIR = ../bin
|
||||||
|
|
||||||
|
CFLAGS = -g -O0 $(MYFLAGS) $(PROFILE)
|
||||||
|
|
||||||
|
LIBS =
|
||||||
|
|
||||||
|
SRCFILES := $(shell ls *.c | sort)
|
||||||
|
OBJFILES := $(patsubst %.c,%.o,$(SRCFILES))
|
||||||
|
|
||||||
|
default: all
|
||||||
|
|
||||||
|
all: .accepted
|
||||||
|
$(MAKE) $(BINDIR)/circle
|
||||||
|
$(MAKE) utils
|
||||||
|
|
||||||
|
.accepted:
|
||||||
|
@./licheck less
|
||||||
|
|
||||||
|
utils: .accepted
|
||||||
|
(cd util; $(MAKE) all)
|
||||||
|
|
||||||
|
circle:
|
||||||
|
$(MAKE) $(BINDIR)/circle
|
||||||
|
|
||||||
|
$(BINDIR)/circle : $(OBJFILES)
|
||||||
|
$(CC) -o $(BINDIR)/circle $(PROFILE) $(OBJFILES) $(LIBS)
|
||||||
|
|
||||||
|
$%.o: %.c
|
||||||
|
$(CC) $< $(CFLAGS) -c -o $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.o depend
|
||||||
|
|
||||||
|
# Dependencies for the object files (automagically generated with
|
||||||
|
# gcc -MM)
|
||||||
|
|
||||||
|
depend:
|
||||||
|
$(CC) -MM *.c > depend
|
||||||
|
|
||||||
|
-include depend
|
||||||
+84
-106
@@ -22,9 +22,9 @@
|
|||||||
#include "act.h"
|
#include "act.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
|
|
||||||
static bool legal_communication(char * arg);
|
static bool legal_communication(char *arg);
|
||||||
|
|
||||||
static bool legal_communication(char * arg)
|
static bool legal_communication(char *arg)
|
||||||
{
|
{
|
||||||
while (*arg) {
|
while (*arg) {
|
||||||
if (*arg == '@') {
|
if (*arg == '@') {
|
||||||
@@ -45,7 +45,7 @@ ACMD(do_say)
|
|||||||
send_to_char(ch, "Yes, but WHAT do you want to say?\r\n");
|
send_to_char(ch, "Yes, but WHAT do you want to say?\r\n");
|
||||||
else {
|
else {
|
||||||
char buf[MAX_INPUT_LENGTH + 14], *msg;
|
char buf[MAX_INPUT_LENGTH + 14], *msg;
|
||||||
struct char_data *vict;
|
char_data *vict;
|
||||||
|
|
||||||
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
||||||
parse_at(argument);
|
parse_at(argument);
|
||||||
@@ -86,16 +86,17 @@ ACMD(do_gsay)
|
|||||||
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
||||||
parse_at(argument);
|
parse_at(argument);
|
||||||
|
|
||||||
send_to_group(ch, ch->group, "%s%s%s says, '%s'%s\r\n", CCGRN(ch, C_NRM), CCGRN(ch, C_NRM), GET_NAME(ch), argument, CCNRM(ch, C_NRM));
|
send_to_group(ch, ch->group, "%s%s%s says, '%s'%s\r\n", CCGRN(ch, C_NRM), CCGRN(ch, C_NRM), GET_NAME(ch),
|
||||||
|
argument, CCNRM(ch, C_NRM));
|
||||||
|
|
||||||
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
|
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
|
||||||
send_to_char(ch, "%s", CONFIG_OK);
|
send_to_char(ch, "%s", CONFIG_OK);
|
||||||
else
|
else
|
||||||
send_to_char(ch, "%sYou group-say, '%s'%s\r\n", CCGRN(ch, C_NRM), argument, CCNRM(ch, C_NRM));
|
send_to_char(ch, "%sYou group-say, '%s'%s\r\n", CCGRN(ch, C_NRM), argument, CCNRM(ch, C_NRM));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void perform_tell(struct char_data *ch, struct char_data *vict, char *arg)
|
static void perform_tell(char_data *ch, char_data *vict, char *arg)
|
||||||
{
|
{
|
||||||
char buf[MAX_STRING_LENGTH], *msg;
|
char buf[MAX_STRING_LENGTH], *msg;
|
||||||
|
|
||||||
@@ -115,7 +116,7 @@ static void perform_tell(struct char_data *ch, struct char_data *vict, char *arg
|
|||||||
GET_LAST_TELL(vict) = GET_IDNUM(ch);
|
GET_LAST_TELL(vict) = GET_IDNUM(ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int is_tell_ok(struct char_data *ch, struct char_data *vict)
|
static int is_tell_ok(char_data *ch, char_data *vict)
|
||||||
{
|
{
|
||||||
if (!ch)
|
if (!ch)
|
||||||
log("SYSERR: is_tell_ok called with no characters");
|
log("SYSERR: is_tell_ok called with no characters");
|
||||||
@@ -127,11 +128,12 @@ static int is_tell_ok(struct char_data *ch, struct char_data *vict)
|
|||||||
send_to_char(ch, "You can't tell other people while you have notell on.\r\n");
|
send_to_char(ch, "You can't tell other people while you have notell on.\r\n");
|
||||||
else if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD))
|
else if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD))
|
||||||
send_to_char(ch, "The walls seem to absorb your words.\r\n");
|
send_to_char(ch, "The walls seem to absorb your words.\r\n");
|
||||||
else if (!IS_NPC(vict) && !vict->desc) /* linkless */
|
else if (!IS_NPC(vict) && !vict->desc) /* linkless */
|
||||||
act("$E's linkless at the moment.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
act("$E's linkless at the moment.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
||||||
else if (PLR_FLAGGED(vict, PLR_WRITING))
|
else if (PLR_FLAGGED(vict, PLR_WRITING))
|
||||||
act("$E's writing a message right now; try again later.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
act("$E's writing a message right now; try again later.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
||||||
else if ((!IS_NPC(vict) && PRF_FLAGGED(vict, PRF_NOTELL)) || (ROOM_FLAGGED(IN_ROOM(vict), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD)))
|
else if ((!IS_NPC(vict) && PRF_FLAGGED(vict, PRF_NOTELL)) || (
|
||||||
|
ROOM_FLAGGED(IN_ROOM(vict), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD)))
|
||||||
act("$E can't hear you.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
act("$E can't hear you.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
||||||
else
|
else
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
@@ -143,46 +145,14 @@ static int is_tell_ok(struct char_data *ch, struct char_data *vict)
|
|||||||
* called frequently, and should IMHO be kept as tight as possible. */
|
* called frequently, and should IMHO be kept as tight as possible. */
|
||||||
ACMD(do_tell)
|
ACMD(do_tell)
|
||||||
{
|
{
|
||||||
struct char_data *vict = NULL;
|
char_data *vict = NULL;
|
||||||
char buf[MAX_INPUT_LENGTH + 25], buf2[MAX_INPUT_LENGTH]; // +25 to make room for constants
|
char buf[MAX_INPUT_LENGTH + 25], buf2[MAX_INPUT_LENGTH]; // +25 to make room for constants
|
||||||
|
|
||||||
half_chop(argument, buf, buf2);
|
half_chop(argument, buf, buf2);
|
||||||
|
|
||||||
if (!*buf || !*buf2)
|
if (!*buf || !*buf2)
|
||||||
send_to_char(ch, "Who do you wish to tell what??\r\n");
|
send_to_char(ch, "Who do you wish to tell what??\r\n");
|
||||||
else if (!strcmp(buf, "m-w")) {
|
else if (GET_LEVEL(ch) < LVL_IMMORT && !(vict = get_player_vis(ch, buf, NULL, FIND_CHAR_WORLD)))
|
||||||
#ifdef CIRCLE_WINDOWS
|
|
||||||
/* getpid() is not portable */
|
|
||||||
send_to_char(ch, "Sorry, that is not available in the windows port.\r\n");
|
|
||||||
#else /* all other configurations */
|
|
||||||
char word[MAX_INPUT_LENGTH], *p, *q;
|
|
||||||
|
|
||||||
if (last_webster_teller != -1L) {
|
|
||||||
if (GET_IDNUM(ch) == last_webster_teller) {
|
|
||||||
send_to_char(ch, "You are still waiting for a response.\r\n");
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
send_to_char(ch, "Hold on, m-w is busy. Try again in a couple of seconds.\r\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Only a-z and +/- allowed. */
|
|
||||||
for (p = buf2, q = word; *p ; p++)
|
|
||||||
if ((LOWER(*p) <= 'z' && LOWER(*p) >= 'a') || (*p == '+') || (*p == '-'))
|
|
||||||
*q++ = *p;
|
|
||||||
|
|
||||||
*q = '\0';
|
|
||||||
|
|
||||||
if (!*word) {
|
|
||||||
send_to_char(ch, "Sorry, only letters and +/- are allowed characters.\r\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
snprintf(buf, sizeof(buf), "../bin/webster %s %d &", word, (int) getpid());
|
|
||||||
last_webster_teller = GET_IDNUM(ch);
|
|
||||||
send_to_char(ch, "You look up '%s' in Merriam-Webster.\r\n", word);
|
|
||||||
#endif /* platform specific part */
|
|
||||||
} else if (GET_LEVEL(ch) < LVL_IMMORT && !(vict = get_player_vis(ch, buf, NULL, FIND_CHAR_WORLD)))
|
|
||||||
send_to_char(ch, "%s", CONFIG_NOPERSON);
|
send_to_char(ch, "%s", CONFIG_NOPERSON);
|
||||||
else if (GET_LEVEL(ch) >= LVL_IMMORT && !(vict = get_char_vis(ch, buf, NULL, FIND_CHAR_WORLD)))
|
else if (GET_LEVEL(ch) >= LVL_IMMORT && !(vict = get_char_vis(ch, buf, NULL, FIND_CHAR_WORLD)))
|
||||||
send_to_char(ch, "%s", CONFIG_NOPERSON);
|
send_to_char(ch, "%s", CONFIG_NOPERSON);
|
||||||
@@ -190,12 +160,12 @@ ACMD(do_tell)
|
|||||||
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
||||||
parse_at(buf2);
|
parse_at(buf2);
|
||||||
perform_tell(ch, vict, buf2);
|
perform_tell(ch, vict, buf2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ACMD(do_reply)
|
ACMD(do_reply)
|
||||||
{
|
{
|
||||||
struct char_data *tch = character_list;
|
char_data *tch = character_list;
|
||||||
|
|
||||||
if (IS_NPC(ch))
|
if (IS_NPC(ch))
|
||||||
return;
|
return;
|
||||||
@@ -222,14 +192,14 @@ ACMD(do_reply)
|
|||||||
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
||||||
parse_at(argument);
|
parse_at(argument);
|
||||||
perform_tell(ch, tch, argument);
|
perform_tell(ch, tch, argument);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ACMD(do_spec_comm)
|
ACMD(do_spec_comm)
|
||||||
{
|
{
|
||||||
char buf[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH];
|
char buf[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH];
|
||||||
struct char_data *vict;
|
char_data *vict;
|
||||||
const char *action_sing, *action_plur, *action_others;
|
const char *action_sing, *action_plur, *action_others;
|
||||||
|
|
||||||
switch (subcmd) {
|
switch (subcmd) {
|
||||||
@@ -279,7 +249,7 @@ ACMD(do_spec_comm)
|
|||||||
|
|
||||||
ACMD(do_write)
|
ACMD(do_write)
|
||||||
{
|
{
|
||||||
struct obj_data *paper, *pen = NULL;
|
obj_data *paper, *pen = NULL;
|
||||||
char *papername, *penname;
|
char *papername, *penname;
|
||||||
char buf1[MAX_STRING_LENGTH], buf2[MAX_STRING_LENGTH];
|
char buf1[MAX_STRING_LENGTH], buf2[MAX_STRING_LENGTH];
|
||||||
|
|
||||||
@@ -358,8 +328,8 @@ ACMD(do_write)
|
|||||||
|
|
||||||
ACMD(do_page)
|
ACMD(do_page)
|
||||||
{
|
{
|
||||||
struct descriptor_data *d;
|
descriptor_data *d;
|
||||||
struct char_data *vict;
|
char_data *vict;
|
||||||
char buf2[MAX_INPUT_LENGTH], arg[MAX_INPUT_LENGTH];
|
char buf2[MAX_INPUT_LENGTH], arg[MAX_INPUT_LENGTH];
|
||||||
|
|
||||||
half_chop(argument, arg, buf2);
|
half_chop(argument, arg, buf2);
|
||||||
@@ -374,19 +344,19 @@ ACMD(do_page)
|
|||||||
snprintf(buf, sizeof(buf), "\007\007*$n* %s", buf2);
|
snprintf(buf, sizeof(buf), "\007\007*$n* %s", buf2);
|
||||||
if (!str_cmp(arg, "all")) {
|
if (!str_cmp(arg, "all")) {
|
||||||
if (GET_LEVEL(ch) > LVL_GOD) {
|
if (GET_LEVEL(ch) > LVL_GOD) {
|
||||||
for (d = descriptor_list; d; d = d->next)
|
for (d = descriptor_list; d; d = d->next)
|
||||||
if (STATE(d) == CON_PLAYING && d->character)
|
if (STATE(d) == CON_PLAYING && d->character)
|
||||||
act(buf, FALSE, ch, 0, d->character, TO_VICT);
|
act(buf, FALSE, ch, 0, d->character, TO_VICT);
|
||||||
} else
|
} else
|
||||||
send_to_char(ch, "You will never be godly enough to do that!\r\n");
|
send_to_char(ch, "You will never be godly enough to do that!\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((vict = get_char_vis(ch, arg, NULL, FIND_CHAR_WORLD))) {
|
if ((vict = get_char_vis(ch, arg, NULL, FIND_CHAR_WORLD))) {
|
||||||
act(buf, FALSE, ch, 0, vict, TO_VICT);
|
act(buf, FALSE, ch, 0, vict, TO_VICT);
|
||||||
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
|
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
|
||||||
send_to_char(ch, "%s", CONFIG_OK);
|
send_to_char(ch, "%s", CONFIG_OK);
|
||||||
else
|
else
|
||||||
act(buf, FALSE, ch, 0, vict, TO_CHAR);
|
act(buf, FALSE, ch, 0, vict, TO_CHAR);
|
||||||
} else
|
} else
|
||||||
send_to_char(ch, "There is no such person in the game!\r\n");
|
send_to_char(ch, "There is no such person in the game!\r\n");
|
||||||
}
|
}
|
||||||
@@ -395,28 +365,28 @@ ACMD(do_page)
|
|||||||
/* Generalized communication function by Fred C. Merkel (Torg). */
|
/* Generalized communication function by Fred C. Merkel (Torg). */
|
||||||
ACMD(do_gen_comm)
|
ACMD(do_gen_comm)
|
||||||
{
|
{
|
||||||
struct descriptor_data *i;
|
descriptor_data *i;
|
||||||
char color_on[24];
|
char color_on[24];
|
||||||
char buf1[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH + 50], *msg; // + 50 to make room for color codes
|
char buf1[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH + 50], *msg; // + 50 to make room for color codes
|
||||||
bool emoting = FALSE;
|
bool emoting = FALSE;
|
||||||
|
|
||||||
/* Array of flags which must _not_ be set in order for comm to be heard. */
|
/* Array of flags which must _not_ be set in order for comm to be heard. */
|
||||||
int channels[] = {
|
int channels[] = {
|
||||||
0,
|
0,
|
||||||
PRF_NOSHOUT,
|
PRF_NOSHOUT,
|
||||||
PRF_NOGOSS,
|
PRF_NOGOSS,
|
||||||
PRF_NOAUCT,
|
PRF_NOAUCT,
|
||||||
PRF_NOGRATZ,
|
PRF_NOGRATZ,
|
||||||
PRF_NOGOSS,
|
PRF_NOGOSS,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
int hist_type[] = {
|
int hist_type[] = {
|
||||||
HIST_HOLLER,
|
HIST_HOLLER,
|
||||||
HIST_SHOUT,
|
HIST_SHOUT,
|
||||||
HIST_GOSSIP,
|
HIST_GOSSIP,
|
||||||
HIST_AUCTION,
|
HIST_AUCTION,
|
||||||
HIST_GRATS,
|
HIST_GRATS,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* com_msgs: [0] Message if you can't perform the action because of noshout
|
/* com_msgs: [0] Message if you can't perform the action because of noshout
|
||||||
@@ -424,35 +394,42 @@ ACMD(do_gen_comm)
|
|||||||
* [2] message if you're not on the channel
|
* [2] message if you're not on the channel
|
||||||
* [3] a color string. */
|
* [3] a color string. */
|
||||||
const char *com_msgs[][4] = {
|
const char *com_msgs[][4] = {
|
||||||
{"You cannot holler!!\r\n",
|
{
|
||||||
"holler",
|
"You cannot holler!!\r\n",
|
||||||
"",
|
"holler",
|
||||||
KYEL},
|
"",
|
||||||
|
KYEL
|
||||||
{"You cannot shout!!\r\n",
|
},
|
||||||
"shout",
|
{
|
||||||
"Turn off your noshout flag first!\r\n",
|
"You cannot shout!!\r\n",
|
||||||
KYEL},
|
"shout",
|
||||||
|
"Turn off your noshout flag first!\r\n",
|
||||||
{"You cannot gossip!!\r\n",
|
KYEL
|
||||||
"gossip",
|
},
|
||||||
"You aren't even on the channel!\r\n",
|
{
|
||||||
KYEL},
|
"You cannot gossip!!\r\n",
|
||||||
|
"gossip",
|
||||||
{"You cannot auction!!\r\n",
|
"You aren't even on the channel!\r\n",
|
||||||
"auction",
|
KYEL
|
||||||
"You aren't even on the channel!\r\n",
|
},
|
||||||
KMAG},
|
{
|
||||||
|
"You cannot auction!!\r\n",
|
||||||
{"You cannot congratulate!\r\n",
|
"auction",
|
||||||
"congrat",
|
"You aren't even on the channel!\r\n",
|
||||||
"You aren't even on the channel!\r\n",
|
KMAG
|
||||||
KGRN},
|
},
|
||||||
|
{
|
||||||
{"You cannot gossip your emotions!\r\n",
|
"You cannot congratulate!\r\n",
|
||||||
"gossip",
|
"congrat",
|
||||||
"You aren't even on the channel!\r\n",
|
"You aren't even on the channel!\r\n",
|
||||||
KYEL}
|
KGRN
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"You cannot gossip your emotions!\r\n",
|
||||||
|
"gossip",
|
||||||
|
"You aren't even on the channel!\r\n",
|
||||||
|
KYEL
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (PLR_FLAGGED(ch, PLR_NOSHOUT)) {
|
if (PLR_FLAGGED(ch, PLR_NOSHOUT)) {
|
||||||
@@ -475,7 +452,8 @@ ACMD(do_gen_comm)
|
|||||||
|
|
||||||
/* Level_can_shout defined in config.c. */
|
/* Level_can_shout defined in config.c. */
|
||||||
if (GET_LEVEL(ch) < CONFIG_LEVEL_CAN_SHOUT) {
|
if (GET_LEVEL(ch) < CONFIG_LEVEL_CAN_SHOUT) {
|
||||||
send_to_char(ch, "You must be at least level %d before you can %s.\r\n", CONFIG_LEVEL_CAN_SHOUT, com_msgs[subcmd][1]);
|
send_to_char(ch, "You must be at least level %d before you can %s.\r\n", CONFIG_LEVEL_CAN_SHOUT,
|
||||||
|
com_msgs[subcmd][1]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* Make sure the char is on the channel. */
|
/* Make sure the char is on the channel. */
|
||||||
@@ -506,11 +484,11 @@ ACMD(do_gen_comm)
|
|||||||
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
|
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
|
||||||
send_to_char(ch, "%s", CONFIG_OK);
|
send_to_char(ch, "%s", CONFIG_OK);
|
||||||
else {
|
else {
|
||||||
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
||||||
parse_at(argument);
|
parse_at(argument);
|
||||||
|
|
||||||
snprintf(buf1, sizeof(buf1), "%sYou %s, '%s%s'%s", COLOR_LEV(ch) >= C_CMP ? color_on : "",
|
snprintf(buf1, sizeof(buf1), "%sYou %s, '%s%s'%s", COLOR_LEV(ch) >= C_CMP ? color_on : "",
|
||||||
com_msgs[subcmd][1], argument, COLOR_LEV(ch) >= C_CMP ? color_on : "", CCNRM(ch, C_CMP));
|
com_msgs[subcmd][1], argument, COLOR_LEV(ch) >= C_CMP ? color_on : "", CCNRM(ch, C_CMP));
|
||||||
|
|
||||||
msg = act(buf1, FALSE, ch, 0, 0, TO_CHAR | TO_SLEEP);
|
msg = act(buf1, FALSE, ch, 0, 0, TO_CHAR | TO_SLEEP);
|
||||||
add_history(ch, msg, hist_type[subcmd]);
|
add_history(ch, msg, hist_type[subcmd]);
|
||||||
@@ -520,7 +498,7 @@ ACMD(do_gen_comm)
|
|||||||
|
|
||||||
/* Now send all the strings out. */
|
/* Now send all the strings out. */
|
||||||
for (i = descriptor_list; i; i = i->next) {
|
for (i = descriptor_list; i; i = i->next) {
|
||||||
if (STATE(i) != CON_PLAYING || i == ch->desc || !i->character )
|
if (STATE(i) != CON_PLAYING || i == ch->desc || !i->character)
|
||||||
continue;
|
continue;
|
||||||
if (!IS_NPC(ch) && (PRF_FLAGGED(i->character, channels[subcmd]) || PLR_FLAGGED(i->character, PLR_WRITING)))
|
if (!IS_NPC(ch) && (PRF_FLAGGED(i->character, channels[subcmd]) || PLR_FLAGGED(i->character, PLR_WRITING)))
|
||||||
continue;
|
continue;
|
||||||
@@ -529,7 +507,7 @@ ACMD(do_gen_comm)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (subcmd == SCMD_SHOUT && ((world[IN_ROOM(ch)].zone != world[IN_ROOM(i->character)].zone) ||
|
if (subcmd == SCMD_SHOUT && ((world[IN_ROOM(ch)].zone != world[IN_ROOM(i->character)].zone) ||
|
||||||
!AWAKE(i->character)))
|
!AWAKE(i->character)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
snprintf(buf2, sizeof(buf2), "%s%s%s", (COLOR_LEV(i->character) >= C_NRM) ? color_on : "", buf1, KNRM);
|
snprintf(buf2, sizeof(buf2), "%s%s%s", (COLOR_LEV(i->character) >= C_NRM) ? color_on : "", buf1, KNRM);
|
||||||
@@ -550,7 +528,7 @@ ACMD(do_qcomm)
|
|||||||
send_to_char(ch, "%c%s? Yes, fine, %s we must, but WHAT??\r\n", UPPER(*CMD_NAME), CMD_NAME + 1, CMD_NAME);
|
send_to_char(ch, "%c%s? Yes, fine, %s we must, but WHAT??\r\n", UPPER(*CMD_NAME), CMD_NAME + 1, CMD_NAME);
|
||||||
else {
|
else {
|
||||||
char buf[MAX_STRING_LENGTH];
|
char buf[MAX_STRING_LENGTH];
|
||||||
struct descriptor_data *i;
|
descriptor_data *i;
|
||||||
|
|
||||||
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
||||||
parse_at(argument);
|
parse_at(argument);
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ char *find_exdesc(char *word, struct extra_descr_data *list);
|
|||||||
void space_to_minus(char *str);
|
void space_to_minus(char *str);
|
||||||
/** @todo Move to a help module? */
|
/** @todo Move to a help module? */
|
||||||
int search_help(const char *argument, int level);
|
int search_help(const char *argument, int level);
|
||||||
void free_history(struct char_data *ch, int type);
|
void free_history(char_data *ch, int type);
|
||||||
void free_recent_players(void);
|
void free_recent_players(void);
|
||||||
/* functions with subcommands */
|
/* functions with subcommands */
|
||||||
/* do_commands */
|
/* do_commands */
|
||||||
@@ -109,10 +109,10 @@ ACMD(do_whois);
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
/* Utility Functions */
|
/* Utility Functions */
|
||||||
/** @todo Compare with needs of find_eq_pos_script. */
|
/** @todo Compare with needs of find_eq_pos_script. */
|
||||||
int find_eq_pos(struct char_data *ch, struct obj_data *obj, char *arg);
|
int find_eq_pos(char_data *ch, obj_data *obj, char *arg);
|
||||||
void name_from_drinkcon(struct obj_data *obj);
|
void name_from_drinkcon(obj_data *obj);
|
||||||
void name_to_drinkcon(struct obj_data *obj, int type);
|
void name_to_drinkcon(obj_data *obj, int type);
|
||||||
void weight_change_object(struct obj_data *obj, int weight);
|
void weight_change_object(obj_data *obj, int weight);
|
||||||
/* functions with subcommands */
|
/* functions with subcommands */
|
||||||
/* do_drop */
|
/* do_drop */
|
||||||
ACMD(do_drop);
|
ACMD(do_drop);
|
||||||
@@ -268,7 +268,6 @@ ACMD(do_action);
|
|||||||
ACMD(do_gmote);
|
ACMD(do_gmote);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Begin Functions and defines for act.wizard.c
|
* Begin Functions and defines for act.wizard.c
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -276,11 +275,11 @@ ACMD(do_gmote);
|
|||||||
/** @todo should probably be moved to a more general file handler module */
|
/** @todo should probably be moved to a more general file handler module */
|
||||||
void clean_llog_entries(void);
|
void clean_llog_entries(void);
|
||||||
/** @todo This should be moved to a more general utility file */
|
/** @todo This should be moved to a more general utility file */
|
||||||
int script_command_interpreter(struct char_data *ch, char *arg);
|
int script_command_interpreter(char_data *ch, char *arg);
|
||||||
room_rnum find_target_room(struct char_data *ch, char *rawroomstr);
|
room_rnum find_target_room(char_data *ch, char *rawroomstr);
|
||||||
void perform_immort_vis(struct char_data *ch);
|
void perform_immort_vis(char_data *ch);
|
||||||
void snoop_check(struct char_data *ch);
|
void snoop_check(char_data *ch);
|
||||||
bool change_player_name(struct char_data *ch, struct char_data *vict, char *new_name);
|
bool change_player_name(char_data *ch, char_data *vict, char *new_name);
|
||||||
bool AddRecentPlayer(char *chname, char *chhost, bool newplr, bool cpyplr);
|
bool AddRecentPlayer(char *chname, char *chhost, bool newplr, bool cpyplr);
|
||||||
/* Functions with subcommands */
|
/* Functions with subcommands */
|
||||||
/* do_date */
|
/* do_date */
|
||||||
@@ -327,7 +326,7 @@ ACMD(do_plist);
|
|||||||
ACMD(do_purge);
|
ACMD(do_purge);
|
||||||
ACMD(do_recent);
|
ACMD(do_recent);
|
||||||
ACMD(do_restore);
|
ACMD(do_restore);
|
||||||
void return_to_char(struct char_data * ch);
|
void return_to_char(char_data *ch);
|
||||||
ACMD(do_return);
|
ACMD(do_return);
|
||||||
ACMD(do_saveall);
|
ACMD(do_saveall);
|
||||||
ACMD(do_send);
|
ACMD(do_send);
|
||||||
|
|||||||
+757
-597
File diff suppressed because it is too large
Load Diff
+407
-400
File diff suppressed because it is too large
Load Diff
+110
-127
@@ -27,18 +27,18 @@
|
|||||||
|
|
||||||
/* local only functions */
|
/* local only functions */
|
||||||
/* do_simple_move utility functions */
|
/* do_simple_move utility functions */
|
||||||
static int has_boat(struct char_data *ch);
|
static int has_boat(char_data *ch);
|
||||||
/* do_gen_door utility functions */
|
/* do_gen_door utility functions */
|
||||||
static int find_door(struct char_data *ch, const char *type, char *dir, const char *cmdname);
|
static int find_door(char_data *ch, const char *type, char *dir, const char *cmdname);
|
||||||
static int has_key(struct char_data *ch, obj_vnum key);
|
static int has_key(char_data *ch, obj_vnum key);
|
||||||
static void do_doorcmd(struct char_data *ch, struct obj_data *obj, int door, int scmd);
|
static void do_doorcmd(char_data *ch, obj_data *obj, int door, int scmd);
|
||||||
static int ok_pick(struct char_data *ch, obj_vnum keynum, int pickproof, int scmd);
|
static int ok_pick(char_data *ch, obj_vnum keynum, int pickproof, int scmd);
|
||||||
|
|
||||||
|
|
||||||
/* simple function to determine if char can walk on water */
|
/* simple function to determine if char can walk on water */
|
||||||
static int has_boat(struct char_data *ch)
|
static int has_boat(char_data *ch)
|
||||||
{
|
{
|
||||||
struct obj_data *obj;
|
obj_data *obj;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (GET_LEVEL(ch) > LVL_IMMORT)
|
if (GET_LEVEL(ch) > LVL_IMMORT)
|
||||||
@@ -61,9 +61,9 @@ static int has_boat(struct char_data *ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Simple function to determine if char can fly. */
|
/* Simple function to determine if char can fly. */
|
||||||
static int has_flight(struct char_data *ch)
|
static int has_flight(char_data *ch)
|
||||||
{
|
{
|
||||||
struct obj_data *obj;
|
obj_data *obj;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (GET_LEVEL(ch) > LVL_IMMORT)
|
if (GET_LEVEL(ch) > LVL_IMMORT)
|
||||||
@@ -86,9 +86,9 @@ static int has_flight(struct char_data *ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Simple function to determine if char can scuba. */
|
/* Simple function to determine if char can scuba. */
|
||||||
static int has_scuba(struct char_data *ch)
|
static int has_scuba(char_data *ch)
|
||||||
{
|
{
|
||||||
struct obj_data *obj;
|
obj_data *obj;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (GET_LEVEL(ch) > LVL_IMMORT)
|
if (GET_LEVEL(ch) > LVL_IMMORT)
|
||||||
@@ -126,7 +126,7 @@ static int has_scuba(struct char_data *ch)
|
|||||||
* @param need_specials_check If TRUE will cause
|
* @param need_specials_check If TRUE will cause
|
||||||
* @retval int 1 for a successful move (ch is now in a new location)
|
* @retval int 1 for a successful move (ch is now in a new location)
|
||||||
* or 0 for a failed move (ch is still in the original location). */
|
* or 0 for a failed move (ch is still in the original location). */
|
||||||
int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
int do_simple_move(char_data *ch, int dir, int need_specials_check)
|
||||||
{
|
{
|
||||||
/* Begin Local variable definitions */
|
/* Begin Local variable definitions */
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
@@ -166,8 +166,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Charm effect: Does it override the movement? */
|
/* Charm effect: Does it override the movement? */
|
||||||
if (AFF_FLAGGED(ch, AFF_CHARM) && ch->master && was_in == IN_ROOM(ch->master))
|
if (AFF_FLAGGED(ch, AFF_CHARM) && ch->master && was_in == IN_ROOM(ch->master)) {
|
||||||
{
|
|
||||||
send_to_char(ch, "The thought of leaving your master makes you weep.\r\n");
|
send_to_char(ch, "The thought of leaving your master makes you weep.\r\n");
|
||||||
act("$n bursts into tears.", FALSE, ch, 0, 0, TO_ROOM);
|
act("$n bursts into tears.", FALSE, ch, 0, 0, TO_ROOM);
|
||||||
return (0);
|
return (0);
|
||||||
@@ -175,28 +174,23 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
|||||||
|
|
||||||
/* Water, No Swimming Rooms: Does the deep water prevent movement? */
|
/* Water, No Swimming Rooms: Does the deep water prevent movement? */
|
||||||
if ((SECT(was_in) == SECT_WATER_NOSWIM) ||
|
if ((SECT(was_in) == SECT_WATER_NOSWIM) ||
|
||||||
(SECT(going_to) == SECT_WATER_NOSWIM))
|
(SECT(going_to) == SECT_WATER_NOSWIM)) {
|
||||||
{
|
if (!has_boat(ch)) {
|
||||||
if (!has_boat(ch))
|
|
||||||
{
|
|
||||||
send_to_char(ch, "You need a boat to go there.\r\n");
|
send_to_char(ch, "You need a boat to go there.\r\n");
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Flying Required: Does lack of flying prevent movement? */
|
/* Flying Required: Does lack of flying prevent movement? */
|
||||||
if ((SECT(was_in) == SECT_FLYING) || (SECT(going_to) == SECT_FLYING))
|
if ((SECT(was_in) == SECT_FLYING) || (SECT(going_to) == SECT_FLYING)) {
|
||||||
{
|
if (!has_flight(ch)) {
|
||||||
if (!has_flight(ch))
|
|
||||||
{
|
|
||||||
send_to_char(ch, "You need to be flying to go there!\r\n");
|
send_to_char(ch, "You need to be flying to go there!\r\n");
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Underwater Room: Does lack of underwater breathing prevent movement? */
|
/* Underwater Room: Does lack of underwater breathing prevent movement? */
|
||||||
if ((SECT(was_in) == SECT_UNDERWATER) || (SECT(going_to) == SECT_UNDERWATER))
|
if ((SECT(was_in) == SECT_UNDERWATER) || (SECT(going_to) == SECT_UNDERWATER)) {
|
||||||
{
|
|
||||||
if (!has_scuba(ch) && !IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE)) {
|
if (!has_scuba(ch) && !IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE)) {
|
||||||
send_to_char(ch, "You need to be able to breathe water to go there!\r\n");
|
send_to_char(ch, "You need to be able to breathe water to go there!\r\n");
|
||||||
return (0);
|
return (0);
|
||||||
@@ -204,10 +198,8 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Houses: Can the player walk into the house? */
|
/* Houses: Can the player walk into the house? */
|
||||||
if (ROOM_FLAGGED(was_in, ROOM_ATRIUM))
|
if (ROOM_FLAGGED(was_in, ROOM_ATRIUM)) {
|
||||||
{
|
if (!House_can_enter(ch, GET_ROOM_VNUM(going_to))) {
|
||||||
if (!House_can_enter(ch, GET_ROOM_VNUM(going_to)))
|
|
||||||
{
|
|
||||||
send_to_char(ch, "That's private property -- no trespassing!\r\n");
|
send_to_char(ch, "That's private property -- no trespassing!\r\n");
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@@ -223,15 +215,15 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
|||||||
send_to_char(ch, "A mysterious barrier forces you back! That area is off-limits.\r\n");
|
send_to_char(ch, "A mysterious barrier forces you back! That area is off-limits.\r\n");
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
if (ZONE_FLAGGED(GET_ROOM_ZONE(going_to), ZONE_NOIMMORT) && (GET_LEVEL(ch) >= LVL_IMMORT) && (GET_LEVEL(ch) < LVL_GRGOD)) {
|
if (ZONE_FLAGGED(GET_ROOM_ZONE(going_to), ZONE_NOIMMORT) && (GET_LEVEL(ch) >= LVL_IMMORT) && (
|
||||||
|
GET_LEVEL(ch) < LVL_GRGOD)) {
|
||||||
send_to_char(ch, "A mysterious barrier forces you back! That area is off-limits.\r\n");
|
send_to_char(ch, "A mysterious barrier forces you back! That area is off-limits.\r\n");
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Room Size Capacity: Is the room full of people already? */
|
/* Room Size Capacity: Is the room full of people already? */
|
||||||
if (ROOM_FLAGGED(going_to, ROOM_TUNNEL) &&
|
if (ROOM_FLAGGED(going_to, ROOM_TUNNEL) &&
|
||||||
num_pc_in_room(&(world[going_to])) >= CONFIG_TUNNEL_SIZE)
|
num_pc_in_room(&(world[going_to])) >= CONFIG_TUNNEL_SIZE) {
|
||||||
{
|
|
||||||
if (CONFIG_TUNNEL_SIZE > 1)
|
if (CONFIG_TUNNEL_SIZE > 1)
|
||||||
send_to_char(ch, "There isn't enough room for you to go there!\r\n");
|
send_to_char(ch, "There isn't enough room for you to go there!\r\n");
|
||||||
else
|
else
|
||||||
@@ -240,8 +232,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Room Level Requirements: Is ch privileged enough to enter the room? */
|
/* Room Level Requirements: Is ch privileged enough to enter the room? */
|
||||||
if (ROOM_FLAGGED(going_to, ROOM_GODROOM) && GET_LEVEL(ch) < LVL_GOD)
|
if (ROOM_FLAGGED(going_to, ROOM_GODROOM) && GET_LEVEL(ch) < LVL_GOD) {
|
||||||
{
|
|
||||||
send_to_char(ch, "You aren't godly enough to use that room!\r\n");
|
send_to_char(ch, "You aren't godly enough to use that room!\r\n");
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@@ -250,11 +241,10 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
|||||||
* move points. */
|
* move points. */
|
||||||
/* move points needed is avg. move loss for src and destination sect type */
|
/* move points needed is avg. move loss for src and destination sect type */
|
||||||
need_movement = (movement_loss[SECT(was_in)] +
|
need_movement = (movement_loss[SECT(was_in)] +
|
||||||
movement_loss[SECT(going_to)]) / 2;
|
movement_loss[SECT(going_to)]) / 2;
|
||||||
|
|
||||||
/* Move Point Requirement Check */
|
/* Move Point Requirement Check */
|
||||||
if (GET_MOVE(ch) < need_movement && !IS_NPC(ch))
|
if (GET_MOVE(ch) < need_movement && !IS_NPC(ch)) {
|
||||||
{
|
|
||||||
if (need_specials_check && ch->master)
|
if (need_specials_check && ch->master)
|
||||||
send_to_char(ch, "You are too exhausted to follow.\r\n");
|
send_to_char(ch, "You are too exhausted to follow.\r\n");
|
||||||
else
|
else
|
||||||
@@ -274,8 +264,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
|||||||
GET_MOVE(ch) -= need_movement;
|
GET_MOVE(ch) -= need_movement;
|
||||||
|
|
||||||
/* Generate the leave message and display to others in the was_in room. */
|
/* Generate the leave message and display to others in the was_in room. */
|
||||||
if (!AFF_FLAGGED(ch, AFF_SNEAK))
|
if (!AFF_FLAGGED(ch, AFF_SNEAK)) {
|
||||||
{
|
|
||||||
snprintf(leave_message, sizeof(leave_message), "$n leaves %s.", dirs[dir]);
|
snprintf(leave_message, sizeof(leave_message), "$n leaves %s.", dirs[dir]);
|
||||||
act(leave_message, TRUE, ch, 0, 0, TO_ROOM);
|
act(leave_message, TRUE, ch, 0, 0, TO_ROOM);
|
||||||
}
|
}
|
||||||
@@ -307,9 +296,9 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
|||||||
look_at_room(ch, 0);
|
look_at_room(ch, 0);
|
||||||
|
|
||||||
/* ... and Kill the player if the room is a death trap. */
|
/* ... and Kill the player if the room is a death trap. */
|
||||||
if (ROOM_FLAGGED(going_to, ROOM_DEATH) && GET_LEVEL(ch) < LVL_IMMORT)
|
if (ROOM_FLAGGED(going_to, ROOM_DEATH) && GET_LEVEL(ch) < LVL_IMMORT) {
|
||||||
{
|
mudlog(BRF, LVL_IMMORT, TRUE, "%s hit death trap #%d (%s)", GET_NAME(ch), GET_ROOM_VNUM(going_to),
|
||||||
mudlog(BRF, LVL_IMMORT, TRUE, "%s hit death trap #%d (%s)", GET_NAME(ch), GET_ROOM_VNUM(going_to), world[going_to].name);
|
world[going_to].name);
|
||||||
death_cry(ch);
|
death_cry(ch);
|
||||||
extract_char(ch);
|
extract_char(ch);
|
||||||
return (0);
|
return (0);
|
||||||
@@ -319,15 +308,13 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
|||||||
/* Fire memory and greet triggers, check and see if the greet trigger
|
/* Fire memory and greet triggers, check and see if the greet trigger
|
||||||
* prevents movement, and if so, move the player back to the previous room. */
|
* prevents movement, and if so, move the player back to the previous room. */
|
||||||
entry_memory_mtrigger(ch);
|
entry_memory_mtrigger(ch);
|
||||||
if (!greet_mtrigger(ch, dir))
|
if (!greet_mtrigger(ch, dir)) {
|
||||||
{
|
|
||||||
char_from_room(ch);
|
char_from_room(ch);
|
||||||
char_to_room(ch, was_in);
|
char_to_room(ch, was_in);
|
||||||
look_at_room(ch, 0);
|
look_at_room(ch, 0);
|
||||||
/* Failed move, return a failure */
|
/* Failed move, return a failure */
|
||||||
return (0);
|
return (0);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
greet_memory_mtrigger(ch);
|
greet_memory_mtrigger(ch);
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
/* End: Post-move operations. */
|
/* End: Post-move operations. */
|
||||||
@@ -337,7 +324,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int perform_move(struct char_data *ch, int dir, int need_specials_check)
|
int perform_move(char_data *ch, int dir, int need_specials_check)
|
||||||
{
|
{
|
||||||
room_rnum was_in;
|
room_rnum was_in;
|
||||||
struct follow_type *k, *next;
|
struct follow_type *k, *next;
|
||||||
@@ -348,7 +335,8 @@ int perform_move(struct char_data *ch, int dir, int need_specials_check)
|
|||||||
send_to_char(ch, "Alas, you cannot go that way...\r\n");
|
send_to_char(ch, "Alas, you cannot go that way...\r\n");
|
||||||
else if ((!EXIT(ch, dir) && !buildwalk(ch, dir)) || EXIT(ch, dir)->to_room == NOWHERE)
|
else if ((!EXIT(ch, dir) && !buildwalk(ch, dir)) || EXIT(ch, dir)->to_room == NOWHERE)
|
||||||
send_to_char(ch, "Alas, you cannot go that way...\r\n");
|
send_to_char(ch, "Alas, you cannot go that way...\r\n");
|
||||||
else if (EXIT_FLAGGED(EXIT(ch, dir), EX_CLOSED) && (GET_LEVEL(ch) < LVL_IMMORT || (!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE)))) {
|
else if (EXIT_FLAGGED(EXIT(ch, dir), EX_CLOSED) && (GET_LEVEL(ch) < LVL_IMMORT || (
|
||||||
|
!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE)))) {
|
||||||
if (EXIT(ch, dir)->keyword)
|
if (EXIT(ch, dir)->keyword)
|
||||||
send_to_char(ch, "The %s seems to be closed.\r\n", fname(EXIT(ch, dir)->keyword));
|
send_to_char(ch, "The %s seems to be closed.\r\n", fname(EXIT(ch, dir)->keyword));
|
||||||
else
|
else
|
||||||
@@ -364,9 +352,9 @@ int perform_move(struct char_data *ch, int dir, int need_specials_check)
|
|||||||
for (k = ch->followers; k; k = next) {
|
for (k = ch->followers; k; k = next) {
|
||||||
next = k->next;
|
next = k->next;
|
||||||
if ((IN_ROOM(k->follower) == was_in) &&
|
if ((IN_ROOM(k->follower) == was_in) &&
|
||||||
(GET_POS(k->follower) >= POS_STANDING)) {
|
(GET_POS(k->follower) >= POS_STANDING)) {
|
||||||
act("You follow $N.\r\n", FALSE, k->follower, 0, ch, TO_CHAR);
|
act("You follow $N.\r\n", FALSE, k->follower, 0, ch, TO_CHAR);
|
||||||
perform_move(k->follower, dir, 1);
|
perform_move(k->follower, dir, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (1);
|
return (1);
|
||||||
@@ -380,18 +368,18 @@ ACMD(do_move)
|
|||||||
perform_move(ch, subcmd, 0);
|
perform_move(ch, subcmd, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int find_door(struct char_data *ch, const char *type, char *dir, const char *cmdname)
|
static int find_door(char_data *ch, const char *type, char *dir, const char *cmdname)
|
||||||
{
|
{
|
||||||
int door;
|
int door;
|
||||||
|
|
||||||
if (*dir) { /* a direction was specified */
|
if (*dir) { /* a direction was specified */
|
||||||
if ((door = search_block(dir, dirs, FALSE)) == -1) { /* Partial Match */
|
if ((door = search_block(dir, dirs, FALSE)) == -1) { /* Partial Match */
|
||||||
if ((door = search_block(dir, autoexits, FALSE)) == -1) { /* Check 'short' dirs too */
|
if ((door = search_block(dir, autoexits, FALSE)) == -1) { /* Check 'short' dirs too */
|
||||||
send_to_char(ch, "That's not a direction.\r\n");
|
send_to_char(ch, "That's not a direction.\r\n");
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (EXIT(ch, door)) { /* Braces added according to indent. -gg */
|
if (EXIT(ch, door)) { /* Braces added according to indent. -gg */
|
||||||
if (EXIT(ch, door)->keyword) {
|
if (EXIT(ch, door)->keyword) {
|
||||||
if (is_name(type, EXIT(ch, door)->keyword))
|
if (is_name(type, EXIT(ch, door)->keyword))
|
||||||
return (door);
|
return (door);
|
||||||
@@ -400,40 +388,34 @@ static int find_door(struct char_data *ch, const char *type, char *dir, const ch
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
return (door);
|
return (door);
|
||||||
} else {
|
} else {
|
||||||
send_to_char(ch, "I really don't see how you can %s anything there.\r\n", cmdname);
|
send_to_char(ch, "I really don't see how you can %s anything there.\r\n", cmdname);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
} else { /* try to locate the keyword */
|
} else { /* try to locate the keyword */
|
||||||
if (!*type) {
|
if (!*type) {
|
||||||
send_to_char(ch, "What is it you want to %s?\r\n", cmdname);
|
send_to_char(ch, "What is it you want to %s?\r\n", cmdname);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
for (door = 0; door < DIR_COUNT; door++)
|
for (door = 0; door < DIR_COUNT; door++) {
|
||||||
{
|
if (EXIT(ch, door)) {
|
||||||
if (EXIT(ch, door))
|
if (EXIT(ch, door)->keyword) {
|
||||||
{
|
if (isname(type, EXIT(ch, door)->keyword)) {
|
||||||
if (EXIT(ch, door)->keyword)
|
|
||||||
{
|
|
||||||
if (isname(type, EXIT(ch, door)->keyword))
|
|
||||||
{
|
|
||||||
if ((!IS_NPC(ch)) && (!PRF_FLAGGED(ch, PRF_AUTODOOR)))
|
if ((!IS_NPC(ch)) && (!PRF_FLAGGED(ch, PRF_AUTODOOR)))
|
||||||
return door;
|
return door;
|
||||||
else if (is_abbrev(cmdname, "open"))
|
else if (is_abbrev(cmdname, "open")) {
|
||||||
{
|
|
||||||
if (IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))
|
if (IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))
|
||||||
return door;
|
return door;
|
||||||
else if (IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED))
|
else if (IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED))
|
||||||
return door;
|
return door;
|
||||||
}
|
} else if ((is_abbrev(cmdname, "close")) && (!(IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))))
|
||||||
else if ((is_abbrev(cmdname, "close")) && (!(IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))) )
|
|
||||||
return door;
|
return door;
|
||||||
else if ((is_abbrev(cmdname, "lock")) && (!(IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED))) )
|
else if ((is_abbrev(cmdname, "lock")) && (!(IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED))))
|
||||||
return door;
|
return door;
|
||||||
else if ((is_abbrev(cmdname, "unlock")) && (IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED)) )
|
else if ((is_abbrev(cmdname, "unlock")) && (IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED)))
|
||||||
return door;
|
return door;
|
||||||
else if ((is_abbrev(cmdname, "pick")) && (IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED)) )
|
else if ((is_abbrev(cmdname, "pick")) && (IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED)))
|
||||||
return door;
|
return door;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -457,9 +439,12 @@ static int find_door(struct char_data *ch, const char *type, char *dir, const ch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int has_key(struct char_data *ch, obj_vnum key)
|
int has_key(char_data *ch, obj_vnum key)
|
||||||
{
|
{
|
||||||
struct obj_data *o;
|
obj_data *o;
|
||||||
|
|
||||||
|
if (key == NOTHING)
|
||||||
|
return (0);
|
||||||
|
|
||||||
for (o = ch->carrying; o; o = o->next_content)
|
for (o = ch->carrying; o; o = o->next_content)
|
||||||
if (GET_OBJ_VNUM(o) == key)
|
if (GET_OBJ_VNUM(o) == key)
|
||||||
@@ -480,20 +465,20 @@ int has_key(struct char_data *ch, obj_vnum key)
|
|||||||
/* cmd_door is required external from act.movement.c */
|
/* cmd_door is required external from act.movement.c */
|
||||||
const char *cmd_door[] =
|
const char *cmd_door[] =
|
||||||
{
|
{
|
||||||
"open",
|
"open",
|
||||||
"close",
|
"close",
|
||||||
"unlock",
|
"unlock",
|
||||||
"lock",
|
"lock",
|
||||||
"pick"
|
"pick"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int flags_door[] =
|
static const int flags_door[] =
|
||||||
{
|
{
|
||||||
NEED_CLOSED | NEED_UNLOCKED,
|
NEED_CLOSED | NEED_UNLOCKED,
|
||||||
NEED_OPEN,
|
NEED_OPEN,
|
||||||
NEED_CLOSED | NEED_LOCKED,
|
NEED_CLOSED | NEED_LOCKED,
|
||||||
NEED_CLOSED | NEED_UNLOCKED,
|
NEED_CLOSED | NEED_UNLOCKED,
|
||||||
NEED_CLOSED | NEED_LOCKED
|
NEED_CLOSED | NEED_LOCKED
|
||||||
};
|
};
|
||||||
|
|
||||||
#define EXITN(room, door) (world[room].dir_option[door])
|
#define EXITN(room, door) (world[room].dir_option[door])
|
||||||
@@ -513,7 +498,7 @@ static const int flags_door[] =
|
|||||||
(TOGGLE_BIT(GET_OBJ_VAL(obj, 1), CONT_LOCKED)) :\
|
(TOGGLE_BIT(GET_OBJ_VAL(obj, 1), CONT_LOCKED)) :\
|
||||||
(TOGGLE_BIT(EXITN(room, door)->exit_info, EX_LOCKED)))
|
(TOGGLE_BIT(EXITN(room, door)->exit_info, EX_LOCKED)))
|
||||||
|
|
||||||
static void do_doorcmd(struct char_data *ch, struct obj_data *obj, int door, int scmd)
|
static void do_doorcmd(char_data *ch, obj_data *obj, int door, int scmd)
|
||||||
{
|
{
|
||||||
char buf[MAX_STRING_LENGTH];
|
char buf[MAX_STRING_LENGTH];
|
||||||
size_t len;
|
size_t len;
|
||||||
@@ -573,18 +558,18 @@ static void do_doorcmd(struct char_data *ch, struct obj_data *obj, int door, int
|
|||||||
/* Notify the room. */
|
/* Notify the room. */
|
||||||
if (len < sizeof(buf))
|
if (len < sizeof(buf))
|
||||||
snprintf(buf + len, sizeof(buf) - len, "%s%s.",
|
snprintf(buf + len, sizeof(buf) - len, "%s%s.",
|
||||||
obj ? "" : "the ", obj ? "$p" : EXIT(ch, door)->keyword ? "$F" : "door");
|
obj ? "" : "the ", obj ? "$p" : EXIT(ch, door)->keyword ? "$F" : "door");
|
||||||
if (!obj || IN_ROOM(obj) != NOWHERE)
|
if (!obj || IN_ROOM(obj) != NOWHERE)
|
||||||
act(buf, FALSE, ch, obj, obj ? 0 : EXIT(ch, door)->keyword, TO_ROOM);
|
act(buf, FALSE, ch, obj, obj ? 0 : EXIT(ch, door)->keyword, TO_ROOM);
|
||||||
|
|
||||||
/* Notify the other room */
|
/* Notify the other room */
|
||||||
if (back && (scmd == SCMD_OPEN || scmd == SCMD_CLOSE))
|
if (back && (scmd == SCMD_OPEN || scmd == SCMD_CLOSE))
|
||||||
send_to_room(EXIT(ch, door)->to_room, "The %s is %s%s from the other side.\r\n",
|
send_to_room(EXIT(ch, door)->to_room, "The %s is %s%s from the other side.\r\n",
|
||||||
back->keyword ? fname(back->keyword) : "door", cmd_door[scmd],
|
back->keyword ? fname(back->keyword) : "door", cmd_door[scmd],
|
||||||
scmd == SCMD_CLOSE ? "d" : "ed");
|
scmd == SCMD_CLOSE ? "d" : "ed");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ok_pick(struct char_data *ch, obj_vnum keynum, int pickproof, int scmd)
|
static int ok_pick(char_data *ch, obj_vnum keynum, int pickproof, int scmd)
|
||||||
{
|
{
|
||||||
int percent, skill_lvl;
|
int percent, skill_lvl;
|
||||||
|
|
||||||
@@ -625,8 +610,8 @@ ACMD(do_gen_door)
|
|||||||
int door = -1;
|
int door = -1;
|
||||||
obj_vnum keynum;
|
obj_vnum keynum;
|
||||||
char type[MAX_INPUT_LENGTH], dir[MAX_INPUT_LENGTH];
|
char type[MAX_INPUT_LENGTH], dir[MAX_INPUT_LENGTH];
|
||||||
struct obj_data *obj = NULL;
|
obj_data *obj = NULL;
|
||||||
struct char_data *victim = NULL;
|
char_data *victim = NULL;
|
||||||
|
|
||||||
skip_spaces(&argument);
|
skip_spaces(&argument);
|
||||||
if (!*argument) {
|
if (!*argument) {
|
||||||
@@ -652,18 +637,16 @@ ACMD(do_gen_door)
|
|||||||
send_to_char(ch, "But it's currently open!\r\n");
|
send_to_char(ch, "But it's currently open!\r\n");
|
||||||
else if (!(DOOR_IS_LOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_LOCKED))
|
else if (!(DOOR_IS_LOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_LOCKED))
|
||||||
send_to_char(ch, "Oh.. it wasn't locked, after all..\r\n");
|
send_to_char(ch, "Oh.. it wasn't locked, after all..\r\n");
|
||||||
else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) && ((!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOKEY))) && (has_key(ch, keynum)) )
|
else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) && ((
|
||||||
{
|
!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOKEY))) && (has_key(ch, keynum))) {
|
||||||
send_to_char(ch, "It is locked, but you have the key.\r\n");
|
send_to_char(ch, "It is locked, but you have the key.\r\n");
|
||||||
do_doorcmd(ch, obj, door, SCMD_UNLOCK);
|
do_doorcmd(ch, obj, door, SCMD_UNLOCK);
|
||||||
do_doorcmd(ch, obj, door, subcmd);
|
do_doorcmd(ch, obj, door, subcmd);
|
||||||
}
|
} else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) && ((
|
||||||
else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) && ((!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOKEY))) && (!has_key(ch, keynum)) )
|
!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOKEY))) && (!has_key(ch, keynum))) {
|
||||||
{
|
|
||||||
send_to_char(ch, "It is locked, and you do not have the key!\r\n");
|
send_to_char(ch, "It is locked, and you do not have the key!\r\n");
|
||||||
}
|
} else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) &&
|
||||||
else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) &&
|
(GET_LEVEL(ch) < LVL_IMMORT || (!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE))))
|
||||||
(GET_LEVEL(ch) < LVL_IMMORT || (!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE))))
|
|
||||||
send_to_char(ch, "It seems to be locked.\r\n");
|
send_to_char(ch, "It seems to be locked.\r\n");
|
||||||
else if (!has_key(ch, keynum) && (GET_LEVEL(ch) < LVL_GOD) && ((subcmd == SCMD_LOCK) || (subcmd == SCMD_UNLOCK)))
|
else if (!has_key(ch, keynum) && (GET_LEVEL(ch) < LVL_GOD) && ((subcmd == SCMD_LOCK) || (subcmd == SCMD_UNLOCK)))
|
||||||
send_to_char(ch, "You don't seem to have the proper key.\r\n");
|
send_to_char(ch, "You don't seem to have the proper key.\r\n");
|
||||||
@@ -680,7 +663,7 @@ ACMD(do_enter)
|
|||||||
|
|
||||||
one_argument(argument, buf);
|
one_argument(argument, buf);
|
||||||
|
|
||||||
if (*buf) { /* an argument was supplied, search for door
|
if (*buf) { /* an argument was supplied, search for door
|
||||||
* keyword */
|
* keyword */
|
||||||
for (door = 0; door < DIR_COUNT; door++)
|
for (door = 0; door < DIR_COUNT; door++)
|
||||||
if (EXIT(ch, door))
|
if (EXIT(ch, door))
|
||||||
@@ -696,12 +679,12 @@ ACMD(do_enter)
|
|||||||
/* try to locate an entrance */
|
/* try to locate an entrance */
|
||||||
for (door = 0; door < DIR_COUNT; door++)
|
for (door = 0; door < DIR_COUNT; door++)
|
||||||
if (EXIT(ch, door))
|
if (EXIT(ch, door))
|
||||||
if (EXIT(ch, door)->to_room != NOWHERE)
|
if (EXIT(ch, door)->to_room != NOWHERE)
|
||||||
if (!EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) &&
|
if (!EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) &&
|
||||||
ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_INDOORS)) {
|
ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_INDOORS)) {
|
||||||
perform_move(ch, door, 1);
|
perform_move(ch, door, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
send_to_char(ch, "You can't seem to find anything to enter.\r\n");
|
send_to_char(ch, "You can't seem to find anything to enter.\r\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -715,12 +698,12 @@ ACMD(do_leave)
|
|||||||
else {
|
else {
|
||||||
for (door = 0; door < DIR_COUNT; door++)
|
for (door = 0; door < DIR_COUNT; door++)
|
||||||
if (EXIT(ch, door))
|
if (EXIT(ch, door))
|
||||||
if (EXIT(ch, door)->to_room != NOWHERE)
|
if (EXIT(ch, door)->to_room != NOWHERE)
|
||||||
if (!EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) &&
|
if (!EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) &&
|
||||||
!ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_INDOORS)) {
|
!ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_INDOORS)) {
|
||||||
perform_move(ch, door, 1);
|
perform_move(ch, door, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
send_to_char(ch, "I see no obvious exits to the outside.\r\n");
|
send_to_char(ch, "I see no obvious exits to the outside.\r\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -734,16 +717,16 @@ ACMD(do_stand)
|
|||||||
case POS_SITTING:
|
case POS_SITTING:
|
||||||
send_to_char(ch, "You stand up.\r\n");
|
send_to_char(ch, "You stand up.\r\n");
|
||||||
act("$n clambers to $s feet.", TRUE, ch, 0, 0, TO_ROOM);
|
act("$n clambers to $s feet.", TRUE, ch, 0, 0, TO_ROOM);
|
||||||
/* Were they sitting in something? */
|
/* Were they sitting in something? */
|
||||||
char_from_furniture(ch);
|
char_from_furniture(ch);
|
||||||
/* Will be sitting after a successful bash and may still be fighting. */
|
/* Will be sitting after a successful bash and may still be fighting. */
|
||||||
GET_POS(ch) = FIGHTING(ch) ? POS_FIGHTING : POS_STANDING;
|
GET_POS(ch) = FIGHTING(ch) ? POS_FIGHTING : POS_STANDING;
|
||||||
break;
|
break;
|
||||||
case POS_RESTING:
|
case POS_RESTING:
|
||||||
send_to_char(ch, "You stop resting, and stand up.\r\n");
|
send_to_char(ch, "You stop resting, and stand up.\r\n");
|
||||||
act("$n stops resting, and clambers on $s feet.", TRUE, ch, 0, 0, TO_ROOM);
|
act("$n stops resting, and clambers on $s feet.", TRUE, ch, 0, 0, TO_ROOM);
|
||||||
GET_POS(ch) = POS_STANDING;
|
GET_POS(ch) = POS_STANDING;
|
||||||
/* Were they sitting in something. */
|
/* Were they sitting in something. */
|
||||||
char_from_furniture(ch);
|
char_from_furniture(ch);
|
||||||
break;
|
break;
|
||||||
case POS_SLEEPING:
|
case POS_SLEEPING:
|
||||||
@@ -755,7 +738,7 @@ ACMD(do_stand)
|
|||||||
default:
|
default:
|
||||||
send_to_char(ch, "You stop floating around, and put your feet on the ground.\r\n");
|
send_to_char(ch, "You stop floating around, and put your feet on the ground.\r\n");
|
||||||
act("$n stops floating around, and puts $s feet on the ground.",
|
act("$n stops floating around, and puts $s feet on the ground.",
|
||||||
TRUE, ch, 0, 0, TO_ROOM);
|
TRUE, ch, 0, 0, TO_ROOM);
|
||||||
GET_POS(ch) = POS_STANDING;
|
GET_POS(ch) = POS_STANDING;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -764,8 +747,8 @@ ACMD(do_stand)
|
|||||||
ACMD(do_sit)
|
ACMD(do_sit)
|
||||||
{
|
{
|
||||||
char arg[MAX_STRING_LENGTH];
|
char arg[MAX_STRING_LENGTH];
|
||||||
struct obj_data *furniture;
|
obj_data *furniture;
|
||||||
struct char_data *tempch;
|
char_data *tempch;
|
||||||
int found;
|
int found;
|
||||||
|
|
||||||
one_argument(argument, arg);
|
one_argument(argument, arg);
|
||||||
@@ -796,7 +779,7 @@ ACMD(do_sit)
|
|||||||
} else {
|
} else {
|
||||||
if (OBJ_SAT_IN_BY(furniture) == NULL)
|
if (OBJ_SAT_IN_BY(furniture) == NULL)
|
||||||
OBJ_SAT_IN_BY(furniture) = ch;
|
OBJ_SAT_IN_BY(furniture) = ch;
|
||||||
for (tempch = OBJ_SAT_IN_BY(furniture); tempch != ch ; tempch = NEXT_SITTING(tempch)) {
|
for (tempch = OBJ_SAT_IN_BY(furniture); tempch != ch; tempch = NEXT_SITTING(tempch)) {
|
||||||
if (NEXT_SITTING(tempch))
|
if (NEXT_SITTING(tempch))
|
||||||
continue;
|
continue;
|
||||||
NEXT_SITTING(tempch) = ch;
|
NEXT_SITTING(tempch) = ch;
|
||||||
@@ -881,7 +864,7 @@ ACMD(do_sleep)
|
|||||||
default:
|
default:
|
||||||
send_to_char(ch, "You stop floating around, and lie down to sleep.\r\n");
|
send_to_char(ch, "You stop floating around, and lie down to sleep.\r\n");
|
||||||
act("$n stops floating around, and lie down to sleep.",
|
act("$n stops floating around, and lie down to sleep.",
|
||||||
TRUE, ch, 0, 0, TO_ROOM);
|
TRUE, ch, 0, 0, TO_ROOM);
|
||||||
GET_POS(ch) = POS_SLEEPING;
|
GET_POS(ch) = POS_SLEEPING;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -890,7 +873,7 @@ ACMD(do_sleep)
|
|||||||
ACMD(do_wake)
|
ACMD(do_wake)
|
||||||
{
|
{
|
||||||
char arg[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH];
|
||||||
struct char_data *vict;
|
char_data *vict;
|
||||||
int self = 0;
|
int self = 0;
|
||||||
|
|
||||||
one_argument(argument, arg);
|
one_argument(argument, arg);
|
||||||
@@ -929,7 +912,7 @@ ACMD(do_wake)
|
|||||||
ACMD(do_follow)
|
ACMD(do_follow)
|
||||||
{
|
{
|
||||||
char buf[MAX_INPUT_LENGTH];
|
char buf[MAX_INPUT_LENGTH];
|
||||||
struct char_data *leader;
|
char_data *leader;
|
||||||
|
|
||||||
one_argument(argument, buf);
|
one_argument(argument, buf);
|
||||||
|
|
||||||
@@ -939,9 +922,9 @@ ACMD(do_follow)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ch->master != (char_data*) NULL) {
|
if (ch->master != (char_data *)NULL) {
|
||||||
send_to_char(ch, "You are following %s.\r\n",
|
send_to_char(ch, "You are following %s.\r\n",
|
||||||
GET_NAME(ch->master));
|
GET_NAME(ch->master));
|
||||||
} else {
|
} else {
|
||||||
send_to_char(ch, "Whom do you wish to follow?\r\n");
|
send_to_char(ch, "Whom do you wish to follow?\r\n");
|
||||||
}
|
}
|
||||||
@@ -954,7 +937,7 @@ ACMD(do_follow)
|
|||||||
}
|
}
|
||||||
if (AFF_FLAGGED(ch, AFF_CHARM) && (ch->master)) {
|
if (AFF_FLAGGED(ch, AFF_CHARM) && (ch->master)) {
|
||||||
act("But you only feel like following $N!", FALSE, ch, 0, ch->master, TO_CHAR);
|
act("But you only feel like following $N!", FALSE, ch, 0, ch->master, TO_CHAR);
|
||||||
} else { /* Not Charmed follow person */
|
} else { /* Not Charmed follow person */
|
||||||
if (leader == ch) {
|
if (leader == ch) {
|
||||||
if (!ch->master) {
|
if (!ch->master) {
|
||||||
send_to_char(ch, "You are already following yourself.\r\n");
|
send_to_char(ch, "You are already following yourself.\r\n");
|
||||||
@@ -978,8 +961,8 @@ ACMD(do_unfollow)
|
|||||||
{
|
{
|
||||||
if (ch->master) {
|
if (ch->master) {
|
||||||
if (AFF_FLAGGED(ch, AFF_CHARM)) {
|
if (AFF_FLAGGED(ch, AFF_CHARM)) {
|
||||||
send_to_char(ch, "You feel compelled to follow %s.\r\n",
|
send_to_char(ch, "You feel compelled to follow %s.\r\n",
|
||||||
GET_NAME(ch->master));
|
GET_NAME(ch->master));
|
||||||
} else {
|
} else {
|
||||||
stop_follower(ch);
|
stop_follower(ch);
|
||||||
}
|
}
|
||||||
|
|||||||
+50
-48
@@ -24,7 +24,7 @@
|
|||||||
ACMD(do_assist)
|
ACMD(do_assist)
|
||||||
{
|
{
|
||||||
char arg[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH];
|
||||||
struct char_data *helpee, *opponent;
|
char_data *helpee, *opponent;
|
||||||
|
|
||||||
if (FIGHTING(ch)) {
|
if (FIGHTING(ch)) {
|
||||||
send_to_char(ch, "You're already fighting! How can you assist someone else?\r\n");
|
send_to_char(ch, "You're already fighting! How can you assist someone else?\r\n");
|
||||||
@@ -46,14 +46,14 @@ ACMD(do_assist)
|
|||||||
opponent = FIGHTING(helpee);
|
opponent = FIGHTING(helpee);
|
||||||
else
|
else
|
||||||
for (opponent = world[IN_ROOM(ch)].people;
|
for (opponent = world[IN_ROOM(ch)].people;
|
||||||
opponent && (FIGHTING(opponent) != helpee);
|
opponent && (FIGHTING(opponent) != helpee);
|
||||||
opponent = opponent->next_in_room);
|
opponent = opponent->next_in_room);
|
||||||
|
|
||||||
if (!opponent)
|
if (!opponent)
|
||||||
act("But nobody is fighting $M!", FALSE, ch, 0, helpee, TO_CHAR);
|
act("But nobody is fighting $M!", FALSE, ch, 0, helpee, TO_CHAR);
|
||||||
else if (!CAN_SEE(ch, opponent))
|
else if (!CAN_SEE(ch, opponent))
|
||||||
act("You can't see who is fighting $M!", FALSE, ch, 0, helpee, TO_CHAR);
|
act("You can't see who is fighting $M!", FALSE, ch, 0, helpee, TO_CHAR);
|
||||||
/* prevent accidental pkill */
|
/* prevent accidental pkill */
|
||||||
else if (!CONFIG_PK_ALLOWED && !IS_NPC(opponent))
|
else if (!CONFIG_PK_ALLOWED && !IS_NPC(opponent))
|
||||||
send_to_char(ch, "You cannot kill other players.\r\n");
|
send_to_char(ch, "You cannot kill other players.\r\n");
|
||||||
else {
|
else {
|
||||||
@@ -68,9 +68,9 @@ ACMD(do_assist)
|
|||||||
ACMD(do_hit)
|
ACMD(do_hit)
|
||||||
{
|
{
|
||||||
char arg[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH];
|
||||||
struct char_data *vict;
|
char_data *vict;
|
||||||
|
|
||||||
one_argument(argument, arg);
|
one_argument(argument, arg);
|
||||||
|
|
||||||
if (!*arg)
|
if (!*arg)
|
||||||
send_to_char(ch, "Hit who?\r\n");
|
send_to_char(ch, "Hit who?\r\n");
|
||||||
@@ -86,10 +86,11 @@ ACMD(do_hit)
|
|||||||
check_killer(ch, vict);
|
check_killer(ch, vict);
|
||||||
|
|
||||||
if ((GET_POS(ch) == POS_STANDING) && (vict != FIGHTING(ch))) {
|
if ((GET_POS(ch) == POS_STANDING) && (vict != FIGHTING(ch))) {
|
||||||
if (GET_DEX(ch) > GET_DEX(vict) || (GET_DEX(ch) == GET_DEX(vict) && rand_number(1, 2) == 1)) /* if faster */
|
if (GET_DEX(ch) > GET_DEX(vict) || (GET_DEX(ch) == GET_DEX(vict) && rand_number(1, 2) == 1)) /* if faster */
|
||||||
hit(ch, vict, TYPE_UNDEFINED); /* first */
|
hit(ch, vict, TYPE_UNDEFINED); /* first */
|
||||||
else hit(vict, ch, TYPE_UNDEFINED); /* or the victim is first */
|
else
|
||||||
WAIT_STATE(ch, PULSE_VIOLENCE + 2);
|
hit(vict, ch, TYPE_UNDEFINED); /* or the victim is first */
|
||||||
|
WAIT_STATE(ch, PULSE_VIOLENCE + 2);
|
||||||
} else
|
} else
|
||||||
send_to_char(ch, "You're fighting the best you can!\r\n");
|
send_to_char(ch, "You're fighting the best you can!\r\n");
|
||||||
}
|
}
|
||||||
@@ -98,7 +99,7 @@ ACMD(do_hit)
|
|||||||
ACMD(do_kill)
|
ACMD(do_kill)
|
||||||
{
|
{
|
||||||
char arg[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH];
|
||||||
struct char_data *vict;
|
char_data *vict;
|
||||||
|
|
||||||
if (GET_LEVEL(ch) < LVL_GRGOD || IS_NPC(ch) || !PRF_FLAGGED(ch, PRF_NOHASSLE)) {
|
if (GET_LEVEL(ch) < LVL_GRGOD || IS_NPC(ch) || !PRF_FLAGGED(ch, PRF_NOHASSLE)) {
|
||||||
do_hit(ch, argument, cmd, subcmd);
|
do_hit(ch, argument, cmd, subcmd);
|
||||||
@@ -125,7 +126,7 @@ ACMD(do_kill)
|
|||||||
ACMD(do_backstab)
|
ACMD(do_backstab)
|
||||||
{
|
{
|
||||||
char buf[MAX_INPUT_LENGTH];
|
char buf[MAX_INPUT_LENGTH];
|
||||||
struct char_data *vict;
|
char_data *vict;
|
||||||
int percent, prob;
|
int percent, prob;
|
||||||
|
|
||||||
if (IS_NPC(ch) || !GET_SKILL(ch, SKILL_BACKSTAB)) {
|
if (IS_NPC(ch) || !GET_SKILL(ch, SKILL_BACKSTAB)) {
|
||||||
@@ -164,7 +165,7 @@ ACMD(do_backstab)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
percent = rand_number(1, 101); /* 101% is a complete failure */
|
percent = rand_number(1, 101); /* 101% is a complete failure */
|
||||||
prob = GET_SKILL(ch, SKILL_BACKSTAB);
|
prob = GET_SKILL(ch, SKILL_BACKSTAB);
|
||||||
|
|
||||||
if (AWAKE(vict) && (percent > prob))
|
if (AWAKE(vict) && (percent > prob))
|
||||||
@@ -179,7 +180,7 @@ ACMD(do_order)
|
|||||||
{
|
{
|
||||||
char name[MAX_INPUT_LENGTH], message[MAX_INPUT_LENGTH];
|
char name[MAX_INPUT_LENGTH], message[MAX_INPUT_LENGTH];
|
||||||
bool found = FALSE;
|
bool found = FALSE;
|
||||||
struct char_data *vict;
|
char_data *vict;
|
||||||
struct follow_type *k;
|
struct follow_type *k;
|
||||||
|
|
||||||
half_chop(argument, name, message);
|
half_chop(argument, name, message);
|
||||||
@@ -208,7 +209,7 @@ ACMD(do_order)
|
|||||||
send_to_char(ch, "%s", CONFIG_OK);
|
send_to_char(ch, "%s", CONFIG_OK);
|
||||||
command_interpreter(vict, message);
|
command_interpreter(vict, message);
|
||||||
}
|
}
|
||||||
} else { /* This is order "followers" */
|
} else { /* This is order "followers" */
|
||||||
char buf[MAX_STRING_LENGTH];
|
char buf[MAX_STRING_LENGTH];
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "$n issues the order '%s'.", message);
|
snprintf(buf, sizeof(buf), "$n issues the order '%s'.", message);
|
||||||
@@ -232,7 +233,7 @@ ACMD(do_order)
|
|||||||
ACMD(do_flee)
|
ACMD(do_flee)
|
||||||
{
|
{
|
||||||
int i, attempt, loss;
|
int i, attempt, loss;
|
||||||
struct char_data *was_fighting;
|
char_data *was_fighting;
|
||||||
|
|
||||||
if (GET_POS(ch) < POS_FIGHTING) {
|
if (GET_POS(ch) < POS_FIGHTING) {
|
||||||
send_to_char(ch, "You are in pretty bad shape, unable to flee!\r\n");
|
send_to_char(ch, "You are in pretty bad shape, unable to flee!\r\n");
|
||||||
@@ -242,22 +243,22 @@ ACMD(do_flee)
|
|||||||
for (i = 0; i < 6; i++) {
|
for (i = 0; i < 6; i++) {
|
||||||
attempt = rand_number(0, DIR_COUNT - 1); /* Select a random direction */
|
attempt = rand_number(0, DIR_COUNT - 1); /* Select a random direction */
|
||||||
if (CAN_GO(ch, attempt) &&
|
if (CAN_GO(ch, attempt) &&
|
||||||
!ROOM_FLAGGED(EXIT(ch, attempt)->to_room, ROOM_DEATH)) {
|
!ROOM_FLAGGED(EXIT(ch, attempt)->to_room, ROOM_DEATH)) {
|
||||||
act("$n panics, and attempts to flee!", TRUE, ch, 0, 0, TO_ROOM);
|
act("$n panics, and attempts to flee!", TRUE, ch, 0, 0, TO_ROOM);
|
||||||
was_fighting = FIGHTING(ch);
|
was_fighting = FIGHTING(ch);
|
||||||
if (do_simple_move(ch, attempt, TRUE)) {
|
if (do_simple_move(ch, attempt, TRUE)) {
|
||||||
send_to_char(ch, "You flee head over heels.\r\n");
|
send_to_char(ch, "You flee head over heels.\r\n");
|
||||||
if (was_fighting && !IS_NPC(ch)) {
|
if (was_fighting && !IS_NPC(ch)) {
|
||||||
loss = GET_MAX_HIT(was_fighting) - GET_HIT(was_fighting);
|
loss = GET_MAX_HIT(was_fighting) - GET_HIT(was_fighting);
|
||||||
loss *= GET_LEVEL(was_fighting);
|
loss *= GET_LEVEL(was_fighting);
|
||||||
gain_exp(ch, -loss);
|
gain_exp(ch, -loss);
|
||||||
}
|
}
|
||||||
if (FIGHTING(ch))
|
if (FIGHTING(ch))
|
||||||
stop_fighting(ch);
|
stop_fighting(ch);
|
||||||
if (was_fighting && ch == FIGHTING(was_fighting))
|
if (was_fighting && ch == FIGHTING(was_fighting))
|
||||||
stop_fighting(was_fighting);
|
stop_fighting(was_fighting);
|
||||||
} else {
|
} else {
|
||||||
act("$n tries to flee, but can't!", TRUE, ch, 0, 0, TO_ROOM);
|
act("$n tries to flee, but can't!", TRUE, ch, 0, 0, TO_ROOM);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -268,7 +269,7 @@ ACMD(do_flee)
|
|||||||
ACMD(do_bash)
|
ACMD(do_bash)
|
||||||
{
|
{
|
||||||
char arg[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH];
|
||||||
struct char_data *vict;
|
char_data *vict;
|
||||||
int percent, prob;
|
int percent, prob;
|
||||||
|
|
||||||
one_argument(argument, arg);
|
one_argument(argument, arg);
|
||||||
@@ -302,7 +303,7 @@ ACMD(do_bash)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
percent = rand_number(1, 101); /* 101% is a complete failure */
|
percent = rand_number(1, 101); /* 101% is a complete failure */
|
||||||
prob = GET_SKILL(ch, SKILL_BASH);
|
prob = GET_SKILL(ch, SKILL_BASH);
|
||||||
|
|
||||||
if (MOB_FLAGGED(vict, MOB_NOBASH))
|
if (MOB_FLAGGED(vict, MOB_NOBASH))
|
||||||
@@ -318,7 +319,7 @@ ACMD(do_bash)
|
|||||||
* first to make sure they don't flee, then we can't bash them! So now
|
* first to make sure they don't flee, then we can't bash them! So now
|
||||||
* we only set them sitting if they didn't flee. -gg 9/21/98
|
* we only set them sitting if they didn't flee. -gg 9/21/98
|
||||||
*/
|
*/
|
||||||
if (damage(ch, vict, 1, SKILL_BASH) > 0) { /* -1 = dead, 0 = miss */
|
if (damage(ch, vict, 1, SKILL_BASH) > 0) { /* -1 = dead, 0 = miss */
|
||||||
WAIT_STATE(vict, PULSE_VIOLENCE);
|
WAIT_STATE(vict, PULSE_VIOLENCE);
|
||||||
if (IN_ROOM(ch) == IN_ROOM(vict))
|
if (IN_ROOM(ch) == IN_ROOM(vict))
|
||||||
GET_POS(vict) = POS_SITTING;
|
GET_POS(vict) = POS_SITTING;
|
||||||
@@ -330,7 +331,7 @@ ACMD(do_bash)
|
|||||||
ACMD(do_rescue)
|
ACMD(do_rescue)
|
||||||
{
|
{
|
||||||
char arg[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH];
|
||||||
struct char_data *vict, *tmp_ch;
|
char_data *vict, *tmp_ch;
|
||||||
int percent, prob;
|
int percent, prob;
|
||||||
|
|
||||||
if (IS_NPC(ch) || !GET_SKILL(ch, SKILL_RESCUE)) {
|
if (IS_NPC(ch) || !GET_SKILL(ch, SKILL_RESCUE)) {
|
||||||
@@ -353,21 +354,21 @@ ACMD(do_rescue)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (tmp_ch = world[IN_ROOM(ch)].people; tmp_ch &&
|
for (tmp_ch = world[IN_ROOM(ch)].people; tmp_ch &&
|
||||||
(FIGHTING(tmp_ch) != vict); tmp_ch = tmp_ch->next_in_room);
|
(FIGHTING(tmp_ch) != vict); tmp_ch = tmp_ch->next_in_room);
|
||||||
|
|
||||||
if ((FIGHTING(vict) != NULL) && (FIGHTING(ch) == FIGHTING(vict)) && (tmp_ch == NULL)) {
|
if ((FIGHTING(vict) != NULL) && (FIGHTING(ch) == FIGHTING(vict)) && (tmp_ch == NULL)) {
|
||||||
tmp_ch = FIGHTING(vict);
|
tmp_ch = FIGHTING(vict);
|
||||||
if (FIGHTING(tmp_ch) == ch) {
|
if (FIGHTING(tmp_ch) == ch) {
|
||||||
send_to_char(ch, "You have already rescued %s from %s.\r\n", GET_NAME(vict), GET_NAME(FIGHTING(ch)));
|
send_to_char(ch, "You have already rescued %s from %s.\r\n", GET_NAME(vict), GET_NAME(FIGHTING(ch)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tmp_ch) {
|
if (!tmp_ch) {
|
||||||
act("But nobody is fighting $M!", FALSE, ch, 0, vict, TO_CHAR);
|
act("But nobody is fighting $M!", FALSE, ch, 0, vict, TO_CHAR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
percent = rand_number(1, 101); /* 101% is a complete failure */
|
percent = rand_number(1, 101); /* 101% is a complete failure */
|
||||||
prob = GET_SKILL(ch, SKILL_RESCUE);
|
prob = GET_SKILL(ch, SKILL_RESCUE);
|
||||||
|
|
||||||
if (percent > prob) {
|
if (percent > prob) {
|
||||||
@@ -393,7 +394,7 @@ ACMD(do_rescue)
|
|||||||
|
|
||||||
EVENTFUNC(event_whirlwind)
|
EVENTFUNC(event_whirlwind)
|
||||||
{
|
{
|
||||||
struct char_data *ch, *tch;
|
char_data *ch, *tch;
|
||||||
struct mud_event_data *pMudEvent;
|
struct mud_event_data *pMudEvent;
|
||||||
struct list_data *room_list;
|
struct list_data *room_list;
|
||||||
int count;
|
int count;
|
||||||
@@ -404,8 +405,8 @@ EVENTFUNC(event_whirlwind)
|
|||||||
|
|
||||||
/* For the sake of simplicity, we will place the event data in easily
|
/* For the sake of simplicity, we will place the event data in easily
|
||||||
* referenced pointers */
|
* referenced pointers */
|
||||||
pMudEvent = (struct mud_event_data *) event_obj;
|
pMudEvent = (struct mud_event_data *)event_obj;
|
||||||
ch = (struct char_data *) pMudEvent->pStruct;
|
ch = (char_data *)pMudEvent->pStruct;
|
||||||
|
|
||||||
/* When using a list, we have to make sure to allocate the list as it
|
/* When using a list, we have to make sure to allocate the list as it
|
||||||
* uses dynamic memory */
|
* uses dynamic memory */
|
||||||
@@ -491,7 +492,7 @@ ACMD(do_whirlwind)
|
|||||||
ACMD(do_kick)
|
ACMD(do_kick)
|
||||||
{
|
{
|
||||||
char arg[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH];
|
||||||
struct char_data *vict;
|
char_data *vict;
|
||||||
int percent, prob;
|
int percent, prob;
|
||||||
|
|
||||||
if (IS_NPC(ch) || !GET_SKILL(ch, SKILL_KICK)) {
|
if (IS_NPC(ch) || !GET_SKILL(ch, SKILL_KICK)) {
|
||||||
@@ -509,6 +510,8 @@ ACMD(do_kick)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
log("ch class = %d vict class = %d", GET_CLASS(ch), GET_CLASS(vict));
|
||||||
|
|
||||||
if (vict == ch) {
|
if (vict == ch) {
|
||||||
send_to_char(ch, "Aren't we funny today...\r\n");
|
send_to_char(ch, "Aren't we funny today...\r\n");
|
||||||
return;
|
return;
|
||||||
@@ -528,11 +531,10 @@ ACMD(do_kick)
|
|||||||
ACMD(do_bandage)
|
ACMD(do_bandage)
|
||||||
{
|
{
|
||||||
char arg[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH];
|
||||||
struct char_data * vict;
|
char_data *vict;
|
||||||
int percent, prob;
|
int percent, prob;
|
||||||
|
|
||||||
if (!GET_SKILL(ch, SKILL_BANDAGE))
|
if (!GET_SKILL(ch, SKILL_BANDAGE)) {
|
||||||
{
|
|
||||||
send_to_char(ch, "You are unskilled in the art of bandaging.\r\n");
|
send_to_char(ch, "You are unskilled in the art of bandaging.\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -556,21 +558,21 @@ ACMD(do_bandage)
|
|||||||
|
|
||||||
WAIT_STATE(ch, PULSE_VIOLENCE * 2);
|
WAIT_STATE(ch, PULSE_VIOLENCE * 2);
|
||||||
|
|
||||||
percent = rand_number(1, 101); /* 101% is a complete failure */
|
percent = rand_number(1, 101); /* 101% is a complete failure */
|
||||||
prob = GET_SKILL(ch, SKILL_BANDAGE);
|
prob = GET_SKILL(ch, SKILL_BANDAGE);
|
||||||
|
|
||||||
if (percent <= prob) {
|
if (percent <= prob) {
|
||||||
act("Your attempt to bandage fails.", FALSE, ch, 0, 0, TO_CHAR);
|
act("Your attempt to bandage fails.", FALSE, ch, 0, 0, TO_CHAR);
|
||||||
act("$n tries to bandage $N, but fails miserably.", TRUE, ch,
|
act("$n tries to bandage $N, but fails miserably.", TRUE, ch,
|
||||||
0, vict, TO_NOTVICT);
|
0, vict, TO_NOTVICT);
|
||||||
damage(vict, vict, 2, TYPE_SUFFERING);
|
damage(vict, vict, 2, TYPE_SUFFERING);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
act("You successfully bandage $N.", FALSE, ch, 0, vict, TO_CHAR);
|
act("You successfully bandage $N.", FALSE, ch, 0, vict, TO_CHAR);
|
||||||
act("$n bandages $N, who looks a bit better now.", TRUE, ch, 0,
|
act("$n bandages $N, who looks a bit better now.", TRUE, ch, 0,
|
||||||
vict, TO_NOTVICT);
|
vict, TO_NOTVICT);
|
||||||
act("Someone bandages you, and you feel a bit better now.",
|
act("Someone bandages you, and you feel a bit better now.",
|
||||||
FALSE, ch, 0, vict, TO_VICT);
|
FALSE, ch, 0, vict, TO_VICT);
|
||||||
GET_HIT(vict) = 0;
|
GET_HIT(vict) = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
+219
-234
@@ -32,8 +32,8 @@
|
|||||||
|
|
||||||
/* Local defined utility functions */
|
/* Local defined utility functions */
|
||||||
/* do_group utility functions */
|
/* do_group utility functions */
|
||||||
static void print_group(struct char_data *ch);
|
static void print_group(char_data *ch);
|
||||||
static void display_group_list(struct char_data * ch);
|
static void display_group_list(char_data *ch);
|
||||||
|
|
||||||
ACMD(do_quit)
|
ACMD(do_quit)
|
||||||
{
|
{
|
||||||
@@ -72,7 +72,7 @@ ACMD(do_quit)
|
|||||||
ch->desc->snoop_by = NULL;
|
ch->desc->snoop_by = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
extract_char(ch); /* Char is saved before extracting. */
|
extract_char(ch); /* Char is saved before extracting. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ ACMD(do_sneak)
|
|||||||
if (AFF_FLAGGED(ch, AFF_SNEAK))
|
if (AFF_FLAGGED(ch, AFF_SNEAK))
|
||||||
affect_from_char(ch, SKILL_SNEAK);
|
affect_from_char(ch, SKILL_SNEAK);
|
||||||
|
|
||||||
percent = rand_number(1, 101); /* 101% is a complete failure */
|
percent = rand_number(1, 101); /* 101% is a complete failure */
|
||||||
|
|
||||||
if (percent > GET_SKILL(ch, SKILL_SNEAK) + dex_app_skill[GET_DEX(ch)].sneak)
|
if (percent > GET_SKILL(ch, SKILL_SNEAK) + dex_app_skill[GET_DEX(ch)].sneak)
|
||||||
return;
|
return;
|
||||||
@@ -135,7 +135,7 @@ ACMD(do_hide)
|
|||||||
if (AFF_FLAGGED(ch, AFF_HIDE))
|
if (AFF_FLAGGED(ch, AFF_HIDE))
|
||||||
REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_HIDE);
|
REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_HIDE);
|
||||||
|
|
||||||
percent = rand_number(1, 101); /* 101% is a complete failure */
|
percent = rand_number(1, 101); /* 101% is a complete failure */
|
||||||
|
|
||||||
if (percent > GET_SKILL(ch, SKILL_HIDE) + dex_app_skill[GET_DEX(ch)].hide)
|
if (percent > GET_SKILL(ch, SKILL_HIDE) + dex_app_skill[GET_DEX(ch)].hide)
|
||||||
return;
|
return;
|
||||||
@@ -145,8 +145,8 @@ ACMD(do_hide)
|
|||||||
|
|
||||||
ACMD(do_steal)
|
ACMD(do_steal)
|
||||||
{
|
{
|
||||||
struct char_data *vict;
|
char_data *vict;
|
||||||
struct obj_data *obj;
|
obj_data *obj;
|
||||||
char vict_name[MAX_INPUT_LENGTH], obj_name[MAX_INPUT_LENGTH];
|
char vict_name[MAX_INPUT_LENGTH], obj_name[MAX_INPUT_LENGTH];
|
||||||
int percent, gold, eq_pos, pcsteal = 0, ohoh = 0;
|
int percent, gold, eq_pos, pcsteal = 0, ohoh = 0;
|
||||||
|
|
||||||
@@ -173,73 +173,73 @@ ACMD(do_steal)
|
|||||||
percent = rand_number(1, 101) - dex_app_skill[GET_DEX(ch)].p_pocket;
|
percent = rand_number(1, 101) - dex_app_skill[GET_DEX(ch)].p_pocket;
|
||||||
|
|
||||||
if (GET_POS(vict) < POS_SLEEPING)
|
if (GET_POS(vict) < POS_SLEEPING)
|
||||||
percent = -1; /* ALWAYS SUCCESS, unless heavy object. */
|
percent = -1; /* ALWAYS SUCCESS, unless heavy object. */
|
||||||
|
|
||||||
if (!CONFIG_PT_ALLOWED && !IS_NPC(vict))
|
if (!CONFIG_PT_ALLOWED && !IS_NPC(vict))
|
||||||
pcsteal = 1;
|
pcsteal = 1;
|
||||||
|
|
||||||
if (!AWAKE(vict)) /* Easier to steal from sleeping people. */
|
if (!AWAKE(vict)) /* Easier to steal from sleeping people. */
|
||||||
percent -= 50;
|
percent -= 50;
|
||||||
|
|
||||||
/* No stealing if not allowed. If it is no stealing from Imm's or Shopkeepers. */
|
/* No stealing if not allowed. If it is no stealing from Imm's or Shopkeepers. */
|
||||||
if (GET_LEVEL(vict) >= LVL_IMMORT || pcsteal || GET_MOB_SPEC(vict) == shop_keeper)
|
if (GET_LEVEL(vict) >= LVL_IMMORT || pcsteal || GET_MOB_SPEC(vict) == shop_keeper)
|
||||||
percent = 101; /* Failure */
|
percent = 101; /* Failure */
|
||||||
|
|
||||||
if (str_cmp(obj_name, "coins") && str_cmp(obj_name, "gold")) {
|
if (str_cmp(obj_name, "coins") && str_cmp(obj_name, "gold")) {
|
||||||
|
|
||||||
if (!(obj = get_obj_in_list_vis(ch, obj_name, NULL, vict->carrying))) {
|
if (!(obj = get_obj_in_list_vis(ch, obj_name, NULL, vict->carrying))) {
|
||||||
|
|
||||||
for (eq_pos = 0; eq_pos < NUM_WEARS; eq_pos++)
|
for (eq_pos = 0; eq_pos < NUM_WEARS; eq_pos++)
|
||||||
if (GET_EQ(vict, eq_pos) &&
|
if (GET_EQ(vict, eq_pos) &&
|
||||||
(isname(obj_name, GET_EQ(vict, eq_pos)->name)) &&
|
(isname(obj_name, GET_EQ(vict, eq_pos)->name)) &&
|
||||||
CAN_SEE_OBJ(ch, GET_EQ(vict, eq_pos))) {
|
CAN_SEE_OBJ(ch, GET_EQ(vict, eq_pos))) {
|
||||||
obj = GET_EQ(vict, eq_pos);
|
obj = GET_EQ(vict, eq_pos);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
act("$E hasn't got that item.", FALSE, ch, 0, vict, TO_CHAR);
|
act("$E hasn't got that item.", FALSE, ch, 0, vict, TO_CHAR);
|
||||||
return;
|
return;
|
||||||
} else { /* It is equipment */
|
} else { /* It is equipment */
|
||||||
if ((GET_POS(vict) > POS_STUNNED)) {
|
if ((GET_POS(vict) > POS_STUNNED)) {
|
||||||
send_to_char(ch, "Steal the equipment now? Impossible!\r\n");
|
send_to_char(ch, "Steal the equipment now? Impossible!\r\n");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (!give_otrigger(obj, vict, ch) ||
|
if (!give_otrigger(obj, vict, ch) ||
|
||||||
!receive_mtrigger(ch, vict, obj) ) {
|
!receive_mtrigger(ch, vict, obj)) {
|
||||||
send_to_char(ch, "Impossible!\r\n");
|
send_to_char(ch, "Impossible!\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
act("You unequip $p and steal it.", FALSE, ch, obj, 0, TO_CHAR);
|
act("You unequip $p and steal it.", FALSE, ch, obj, 0, TO_CHAR);
|
||||||
act("$n steals $p from $N.", FALSE, ch, obj, vict, TO_NOTVICT);
|
act("$n steals $p from $N.", FALSE, ch, obj, vict, TO_NOTVICT);
|
||||||
obj_to_char(unequip_char(vict, eq_pos), ch);
|
obj_to_char(unequip_char(vict, eq_pos), ch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { /* obj found in inventory */
|
} else { /* obj found in inventory */
|
||||||
|
|
||||||
percent += GET_OBJ_WEIGHT(obj); /* Make heavy harder */
|
percent += GET_OBJ_WEIGHT(obj); /* Make heavy harder */
|
||||||
|
|
||||||
if (percent > GET_SKILL(ch, SKILL_STEAL)) {
|
if (percent > GET_SKILL(ch, SKILL_STEAL)) {
|
||||||
ohoh = TRUE;
|
ohoh = TRUE;
|
||||||
send_to_char(ch, "Oops..\r\n");
|
send_to_char(ch, "Oops..\r\n");
|
||||||
act("$n tried to steal something from you!", FALSE, ch, 0, vict, TO_VICT);
|
act("$n tried to steal something from you!", FALSE, ch, 0, vict, TO_VICT);
|
||||||
act("$n tries to steal something from $N.", TRUE, ch, 0, vict, TO_NOTVICT);
|
act("$n tries to steal something from $N.", TRUE, ch, 0, vict, TO_NOTVICT);
|
||||||
} else { /* Steal the item */
|
} else { /* Steal the item */
|
||||||
if (IS_CARRYING_N(ch) + 1 < CAN_CARRY_N(ch)) {
|
if (IS_CARRYING_N(ch) + 1 < CAN_CARRY_N(ch)) {
|
||||||
if (!give_otrigger(obj, vict, ch) ||
|
if (!give_otrigger(obj, vict, ch) ||
|
||||||
!receive_mtrigger(ch, vict, obj) ) {
|
!receive_mtrigger(ch, vict, obj)) {
|
||||||
send_to_char(ch, "Impossible!\r\n");
|
send_to_char(ch, "Impossible!\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (IS_CARRYING_W(ch) + GET_OBJ_WEIGHT(obj) < CAN_CARRY_W(ch)) {
|
if (IS_CARRYING_W(ch) + GET_OBJ_WEIGHT(obj) < CAN_CARRY_W(ch)) {
|
||||||
obj_from_char(obj);
|
obj_from_char(obj);
|
||||||
obj_to_char(obj, ch);
|
obj_to_char(obj, ch);
|
||||||
send_to_char(ch, "Got it!\r\n");
|
send_to_char(ch, "Got it!\r\n");
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
send_to_char(ch, "You cannot carry that much.\r\n");
|
send_to_char(ch, "You cannot carry that much.\r\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { /* Steal some coins */
|
} else { /* Steal some coins */
|
||||||
if (AWAKE(vict) && (percent > GET_SKILL(ch, SKILL_STEAL))) {
|
if (AWAKE(vict) && (percent > GET_SKILL(ch, SKILL_STEAL))) {
|
||||||
ohoh = TRUE;
|
ohoh = TRUE;
|
||||||
send_to_char(ch, "Oops..\r\n");
|
send_to_char(ch, "Oops..\r\n");
|
||||||
@@ -250,14 +250,14 @@ ACMD(do_steal)
|
|||||||
gold = (GET_GOLD(vict) * rand_number(1, 10)) / 100;
|
gold = (GET_GOLD(vict) * rand_number(1, 10)) / 100;
|
||||||
gold = MIN(1782, gold);
|
gold = MIN(1782, gold);
|
||||||
if (gold > 0) {
|
if (gold > 0) {
|
||||||
increase_gold(ch, gold);
|
increase_gold(ch, gold);
|
||||||
decrease_gold(vict, gold);
|
decrease_gold(vict, gold);
|
||||||
if (gold > 1)
|
if (gold > 1)
|
||||||
send_to_char(ch, "Bingo! You got %d gold coins.\r\n", gold);
|
send_to_char(ch, "Bingo! You got %d gold coins.\r\n", gold);
|
||||||
else
|
else
|
||||||
send_to_char(ch, "You manage to swipe a solitary gold coin.\r\n");
|
send_to_char(ch, "You manage to swipe a solitary gold coin.\r\n");
|
||||||
} else {
|
} else {
|
||||||
send_to_char(ch, "You couldn't get any gold...\r\n");
|
send_to_char(ch, "You couldn't get any gold...\r\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -315,61 +315,62 @@ ACMD(do_title)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_group(struct char_data *ch)
|
static void print_group(char_data *ch)
|
||||||
{
|
{
|
||||||
struct char_data * k;
|
char_data *k;
|
||||||
|
|
||||||
send_to_char(ch, "Your group consists of:\r\n");
|
send_to_char(ch, "Your group consists of:\r\n");
|
||||||
|
|
||||||
while ((k = (struct char_data *) simple_list(ch->group->members)) != NULL)
|
while ((k = (char_data *)simple_list(ch->group->members)) != NULL)
|
||||||
send_to_char(ch, "%-*s: %s[%4d/%-4d]H [%4d/%-4d]M [%4d/%-4d]V%s\r\n",
|
send_to_char(ch, "%-*s: %s[%4d/%-4d]H [%4d/%-4d]M [%4d/%-4d]V%s\r\n",
|
||||||
count_color_chars(GET_NAME(k))+22, GET_NAME(k),
|
count_color_chars(GET_NAME(k)) + 22, GET_NAME(k),
|
||||||
GROUP_LEADER(GROUP(ch)) == k ? CBGRN(ch, C_NRM) : CCGRN(ch, C_NRM),
|
GROUP_LEADER(GROUP(ch)) == k ? CBGRN(ch, C_NRM) : CCGRN(ch, C_NRM),
|
||||||
GET_HIT(k), GET_MAX_HIT(k),
|
GET_HIT(k), GET_MAX_HIT(k),
|
||||||
GET_MANA(k), GET_MAX_MANA(k),
|
GET_MANA(k), GET_MAX_MANA(k),
|
||||||
GET_MOVE(k), GET_MAX_MOVE(k),
|
GET_MOVE(k), GET_MAX_MOVE(k),
|
||||||
CCNRM(ch, C_NRM));
|
CCNRM(ch, C_NRM));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void display_group_list(struct char_data * ch)
|
static void display_group_list(char_data *ch)
|
||||||
{
|
{
|
||||||
struct group_data * group;
|
struct group_data *group;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
if (group_list->iSize) {
|
if (group_list->iSize) {
|
||||||
send_to_char(ch, "# Group Leader # of Members In Zone\r\n"
|
send_to_char(ch, "# Group Leader # of Members In Zone\r\n"
|
||||||
"---------------------------------------------------\r\n");
|
"---------------------------------------------------\r\n");
|
||||||
|
|
||||||
while ((group = (struct group_data *) simple_list(group_list)) != NULL) {
|
while ((group = (struct group_data *)simple_list(group_list)) != NULL) {
|
||||||
if (IS_SET(GROUP_FLAGS(group), GROUP_NPC))
|
if (IS_SET(GROUP_FLAGS(group), GROUP_NPC))
|
||||||
continue;
|
continue;
|
||||||
if (GROUP_LEADER(group) && !IS_SET(GROUP_FLAGS(group), GROUP_ANON))
|
if (GROUP_LEADER(group) && !IS_SET(GROUP_FLAGS(group), GROUP_ANON))
|
||||||
send_to_char(ch, "%-2d) %s%-12s %-2d %s%s\r\n",
|
send_to_char(ch, "%-2d) %s%-12s %-2d %s%s\r\n",
|
||||||
++count,
|
++count,
|
||||||
IS_SET(GROUP_FLAGS(group), GROUP_OPEN) ? CCGRN(ch, C_NRM) : CCRED(ch, C_NRM),
|
IS_SET(GROUP_FLAGS(group), GROUP_OPEN) ? CCGRN(ch, C_NRM) : CCRED(ch, C_NRM),
|
||||||
GET_NAME(GROUP_LEADER(group)), group->members->iSize, zone_table[world[IN_ROOM(GROUP_LEADER(group))].zone].name,
|
GET_NAME(GROUP_LEADER(group)), group->members->iSize,
|
||||||
CCNRM(ch, C_NRM));
|
zone_table[world[IN_ROOM(GROUP_LEADER(group))].zone].name,
|
||||||
|
CCNRM(ch, C_NRM));
|
||||||
else
|
else
|
||||||
send_to_char(ch, "%-2d) Hidden\r\n", ++count);
|
send_to_char(ch, "%-2d) Hidden\r\n", ++count);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count)
|
if (count)
|
||||||
send_to_char(ch, "\r\n"
|
send_to_char(ch, "\r\n"
|
||||||
"%sSeeking Members%s\r\n"
|
"%sSeeking Members%s\r\n"
|
||||||
"%sClosed%s\r\n",
|
"%sClosed%s\r\n",
|
||||||
CCGRN(ch, C_NRM), CCNRM(ch, C_NRM),
|
CCGRN(ch, C_NRM), CCNRM(ch, C_NRM),
|
||||||
CCRED(ch, C_NRM), CCNRM(ch, C_NRM));
|
CCRED(ch, C_NRM), CCNRM(ch, C_NRM));
|
||||||
else
|
else
|
||||||
send_to_char(ch, "\r\n"
|
send_to_char(ch, "\r\n"
|
||||||
"Currently no groups formed.\r\n");
|
"Currently no groups formed.\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Vatiken's Group System: Version 1.1 */
|
/* Vatiken's Group System: Version 1.1 */
|
||||||
ACMD(do_group)
|
ACMD(do_group)
|
||||||
{
|
{
|
||||||
char buf[MAX_STRING_LENGTH];
|
char buf[MAX_STRING_LENGTH];
|
||||||
struct char_data *vict;
|
char_data *vict;
|
||||||
|
|
||||||
argument = one_argument(argument, buf);
|
argument = one_argument(argument, buf);
|
||||||
|
|
||||||
@@ -415,10 +416,10 @@ ACMD(do_group)
|
|||||||
} else if (vict == ch) {
|
} else if (vict == ch) {
|
||||||
send_to_char(ch, "There are easier ways to leave the group.\r\n");
|
send_to_char(ch, "There are easier ways to leave the group.\r\n");
|
||||||
return;
|
return;
|
||||||
} else if (!GROUP(ch) ) {
|
} else if (!GROUP(ch)) {
|
||||||
send_to_char(ch, "But you are not part of a group.\r\n");
|
send_to_char(ch, "But you are not part of a group.\r\n");
|
||||||
return;
|
return;
|
||||||
} else if (GROUP_LEADER(GROUP(ch)) != ch ) {
|
} else if (GROUP_LEADER(GROUP(ch)) != ch) {
|
||||||
send_to_char(ch, "Only the group's leader can kick members out.\r\n");
|
send_to_char(ch, "Only the group's leader can kick members out.\r\n");
|
||||||
return;
|
return;
|
||||||
} else if (GROUP(vict) != GROUP(ch)) {
|
} else if (GROUP(vict) != GROUP(ch)) {
|
||||||
@@ -459,10 +460,12 @@ ACMD(do_group)
|
|||||||
}
|
}
|
||||||
if (is_abbrev(argument, "open")) {
|
if (is_abbrev(argument, "open")) {
|
||||||
TOGGLE_BIT(GROUP_FLAGS(GROUP(ch)), GROUP_OPEN);
|
TOGGLE_BIT(GROUP_FLAGS(GROUP(ch)), GROUP_OPEN);
|
||||||
send_to_char(ch, "The group is now %s to new members.\r\n", IS_SET(GROUP_FLAGS(GROUP(ch)), GROUP_OPEN) ? "open" : "closed");
|
send_to_char(ch, "The group is now %s to new members.\r\n",
|
||||||
|
IS_SET(GROUP_FLAGS(GROUP(ch)), GROUP_OPEN) ? "open" : "closed");
|
||||||
} else if (is_abbrev(argument, "anonymous")) {
|
} else if (is_abbrev(argument, "anonymous")) {
|
||||||
TOGGLE_BIT(GROUP_FLAGS(GROUP(ch)), GROUP_ANON);
|
TOGGLE_BIT(GROUP_FLAGS(GROUP(ch)), GROUP_ANON);
|
||||||
send_to_char(ch, "The group location is now %s to other players.\r\n", IS_SET(GROUP_FLAGS(GROUP(ch)), GROUP_ANON) ? "invisible" : "visible");
|
send_to_char(ch, "The group location is now %s to other players.\r\n",
|
||||||
|
IS_SET(GROUP_FLAGS(GROUP(ch)), GROUP_ANON) ? "invisible" : "visible");
|
||||||
} else
|
} else
|
||||||
send_to_char(ch, "The flag options are: Open, Anonymous\r\n");
|
send_to_char(ch, "The flag options are: Open, Anonymous\r\n");
|
||||||
} else {
|
} else {
|
||||||
@@ -481,10 +484,10 @@ ACMD(do_report)
|
|||||||
}
|
}
|
||||||
|
|
||||||
send_to_group(NULL, group, "%s reports: %d/%dH, %d/%dM, %d/%dV\r\n",
|
send_to_group(NULL, group, "%s reports: %d/%dH, %d/%dM, %d/%dV\r\n",
|
||||||
GET_NAME(ch),
|
GET_NAME(ch),
|
||||||
GET_HIT(ch), GET_MAX_HIT(ch),
|
GET_HIT(ch), GET_MAX_HIT(ch),
|
||||||
GET_MANA(ch), GET_MAX_MANA(ch),
|
GET_MANA(ch), GET_MAX_MANA(ch),
|
||||||
GET_MOVE(ch), GET_MAX_MOVE(ch));
|
GET_MOVE(ch), GET_MAX_MOVE(ch));
|
||||||
}
|
}
|
||||||
|
|
||||||
ACMD(do_split)
|
ACMD(do_split)
|
||||||
@@ -492,7 +495,7 @@ ACMD(do_split)
|
|||||||
char buf[MAX_INPUT_LENGTH];
|
char buf[MAX_INPUT_LENGTH];
|
||||||
int amount, num = 0, share, rest;
|
int amount, num = 0, share, rest;
|
||||||
size_t len;
|
size_t len;
|
||||||
struct char_data *k;
|
char_data *k;
|
||||||
|
|
||||||
if (IS_NPC(ch))
|
if (IS_NPC(ch))
|
||||||
return;
|
return;
|
||||||
@@ -511,7 +514,7 @@ ACMD(do_split)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (GROUP(ch))
|
if (GROUP(ch))
|
||||||
while ((k = (struct char_data *) simple_list(GROUP(ch)->members)) != NULL)
|
while ((k = (char_data *)simple_list(GROUP(ch)->members)) != NULL)
|
||||||
if (IN_ROOM(ch) == IN_ROOM(k) && !IS_NPC(k))
|
if (IN_ROOM(ch) == IN_ROOM(k) && !IS_NPC(k))
|
||||||
num++;
|
num++;
|
||||||
|
|
||||||
@@ -527,26 +530,25 @@ ACMD(do_split)
|
|||||||
|
|
||||||
/* Abusing signed/unsigned to make sizeof work. */
|
/* Abusing signed/unsigned to make sizeof work. */
|
||||||
len = snprintf(buf, sizeof(buf), "%s splits %d coins; you receive %d.\r\n",
|
len = snprintf(buf, sizeof(buf), "%s splits %d coins; you receive %d.\r\n",
|
||||||
GET_NAME(ch), amount, share);
|
GET_NAME(ch), amount, share);
|
||||||
if (rest && len < sizeof(buf)) {
|
if (rest && len < sizeof(buf)) {
|
||||||
snprintf(buf + len, sizeof(buf) - len,
|
snprintf(buf + len, sizeof(buf) - len,
|
||||||
"%d coin%s %s not splitable, so %s keeps the money.\r\n", rest,
|
"%d coin%s %s not splitable, so %s keeps the money.\r\n", rest,
|
||||||
(rest == 1) ? "" : "s", (rest == 1) ? "was" : "were", GET_NAME(ch));
|
(rest == 1) ? "" : "s", (rest == 1) ? "was" : "were", GET_NAME(ch));
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((k = (struct char_data *) simple_list(GROUP(ch)->members)) != NULL)
|
while ((k = (char_data *)simple_list(GROUP(ch)->members)) != NULL)
|
||||||
if (k != ch && IN_ROOM(ch) == IN_ROOM(k) && !IS_NPC(k)) {
|
if (k != ch && IN_ROOM(ch) == IN_ROOM(k) && !IS_NPC(k)) {
|
||||||
increase_gold(k, share);
|
increase_gold(k, share);
|
||||||
send_to_char(k, "%s", buf);
|
send_to_char(k, "%s", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
send_to_char(ch, "You split %d coins among %d members -- %d coins each.\r\n",
|
send_to_char(ch, "You split %d coins among %d members -- %d coins each.\r\n",
|
||||||
amount, num, share);
|
amount, num, share);
|
||||||
|
|
||||||
if (rest) {
|
if (rest) {
|
||||||
send_to_char(ch, "%d coin%s %s not splitable, so you keep the money.\r\n",
|
send_to_char(ch, "%d coin%s %s not splitable, so you keep the money.\r\n",
|
||||||
rest, (rest == 1) ? "" : "s", (rest == 1) ? "was" : "were");
|
rest, (rest == 1) ? "" : "s", (rest == 1) ? "was" : "were");
|
||||||
increase_gold(ch, rest);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
send_to_char(ch, "How many coins do you wish to split with your group?\r\n");
|
send_to_char(ch, "How many coins do you wish to split with your group?\r\n");
|
||||||
@@ -557,7 +559,7 @@ ACMD(do_split)
|
|||||||
ACMD(do_use)
|
ACMD(do_use)
|
||||||
{
|
{
|
||||||
char buf[MAX_INPUT_LENGTH], arg[MAX_INPUT_LENGTH];
|
char buf[MAX_INPUT_LENGTH], arg[MAX_INPUT_LENGTH];
|
||||||
struct obj_data *mag_item;
|
obj_data *mag_item;
|
||||||
|
|
||||||
half_chop(argument, arg, buf);
|
half_chop(argument, arg, buf);
|
||||||
if (!*arg) {
|
if (!*arg) {
|
||||||
@@ -571,8 +573,8 @@ ACMD(do_use)
|
|||||||
case SCMD_RECITE:
|
case SCMD_RECITE:
|
||||||
case SCMD_QUAFF:
|
case SCMD_QUAFF:
|
||||||
if (!(mag_item = get_obj_in_list_vis(ch, arg, NULL, ch->carrying))) {
|
if (!(mag_item = get_obj_in_list_vis(ch, arg, NULL, ch->carrying))) {
|
||||||
send_to_char(ch, "You don't seem to have %s %s.\r\n", AN(arg), arg);
|
send_to_char(ch, "You don't seem to have %s %s.\r\n", AN(arg), arg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SCMD_USE:
|
case SCMD_USE:
|
||||||
@@ -580,8 +582,8 @@ ACMD(do_use)
|
|||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
log("SYSERR: Unknown subcmd %d passed to do_use.", subcmd);
|
log("SYSERR: Unknown subcmd %d passed to do_use.", subcmd);
|
||||||
/* SYSERR_DESC: This is the same as the unhandled case in do_gen_ps(),
|
/* SYSERR_DESC: This is the same as the unhandled case in do_gen_ps(),
|
||||||
* but in the function which handles 'quaff', 'recite', and 'use'. */
|
* but in the function which handles 'quaff', 'recite', and 'use'. */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -600,7 +602,7 @@ ACMD(do_use)
|
|||||||
break;
|
break;
|
||||||
case SCMD_USE:
|
case SCMD_USE:
|
||||||
if ((GET_OBJ_TYPE(mag_item) != ITEM_WAND) &&
|
if ((GET_OBJ_TYPE(mag_item) != ITEM_WAND) &&
|
||||||
(GET_OBJ_TYPE(mag_item) != ITEM_STAFF)) {
|
(GET_OBJ_TYPE(mag_item) != ITEM_STAFF)) {
|
||||||
send_to_char(ch, "You can't seem to figure out how to use it.\r\n");
|
send_to_char(ch, "You can't seem to figure out how to use it.\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -648,16 +650,16 @@ ACMD(do_display)
|
|||||||
switch (LOWER(argument[i])) {
|
switch (LOWER(argument[i])) {
|
||||||
case 'h':
|
case 'h':
|
||||||
SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPHP);
|
SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPHP);
|
||||||
break;
|
break;
|
||||||
case 'm':
|
case 'm':
|
||||||
SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMANA);
|
SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMANA);
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOVE);
|
SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOVE);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
send_to_char(ch, "Usage: prompt { { H | M | V } | all | auto | none }\r\n");
|
send_to_char(ch, "Usage: prompt { { H | M | V } | all | auto | none }\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -674,64 +676,64 @@ ACMD(do_gen_tog)
|
|||||||
char arg[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH];
|
||||||
|
|
||||||
const char *tog_messages[][2] = {
|
const char *tog_messages[][2] = {
|
||||||
{"You are now safe from summoning by other players.\r\n",
|
{"You are now safe from summoning by other players.\r\n",
|
||||||
"You may now be summoned by other players.\r\n"},
|
"You may now be summoned by other players.\r\n"},
|
||||||
{"Nohassle disabled.\r\n",
|
{"Nohassle disabled.\r\n",
|
||||||
"Nohassle enabled.\r\n"},
|
"Nohassle enabled.\r\n"},
|
||||||
{"Brief mode off.\r\n",
|
{"Brief mode off.\r\n",
|
||||||
"Brief mode on.\r\n"},
|
"Brief mode on.\r\n"},
|
||||||
{"Compact mode off.\r\n",
|
{"Compact mode off.\r\n",
|
||||||
"Compact mode on.\r\n"},
|
"Compact mode on.\r\n"},
|
||||||
{"You can now hear tells.\r\n",
|
{"You can now hear tells.\r\n",
|
||||||
"You are now deaf to tells.\r\n"},
|
"You are now deaf to tells.\r\n"},
|
||||||
{"You can now hear auctions.\r\n",
|
{"You can now hear auctions.\r\n",
|
||||||
"You are now deaf to auctions.\r\n"},
|
"You are now deaf to auctions.\r\n"},
|
||||||
{"You can now hear shouts.\r\n",
|
{"You can now hear shouts.\r\n",
|
||||||
"You are now deaf to shouts.\r\n"},
|
"You are now deaf to shouts.\r\n"},
|
||||||
{"You can now hear gossip.\r\n",
|
{"You can now hear gossip.\r\n",
|
||||||
"You are now deaf to gossip.\r\n"},
|
"You are now deaf to gossip.\r\n"},
|
||||||
{"You can now hear the congratulation messages.\r\n",
|
{"You can now hear the congratulation messages.\r\n",
|
||||||
"You are now deaf to the congratulation messages.\r\n"},
|
"You are now deaf to the congratulation messages.\r\n"},
|
||||||
{"You can now hear the Wiz-channel.\r\n",
|
{"You can now hear the Wiz-channel.\r\n",
|
||||||
"You are now deaf to the Wiz-channel.\r\n"},
|
"You are now deaf to the Wiz-channel.\r\n"},
|
||||||
{"You are no longer part of the Quest.\r\n",
|
{"You are no longer part of the Quest.\r\n",
|
||||||
"Okay, you are part of the Quest!\r\n"},
|
"Okay, you are part of the Quest!\r\n"},
|
||||||
{"You will no longer see the room flags.\r\n",
|
{"You will no longer see the room flags.\r\n",
|
||||||
"You will now see the room flags.\r\n"},
|
"You will now see the room flags.\r\n"},
|
||||||
{"You will now have your communication repeated.\r\n",
|
{"You will now have your communication repeated.\r\n",
|
||||||
"You will no longer have your communication repeated.\r\n"},
|
"You will no longer have your communication repeated.\r\n"},
|
||||||
{"HolyLight mode off.\r\n",
|
{"HolyLight mode off.\r\n",
|
||||||
"HolyLight mode on.\r\n"},
|
"HolyLight mode on.\r\n"},
|
||||||
{"Nameserver_is_slow changed to NO; IP addresses will now be resolved.\r\n",
|
{"Nameserver_is_slow changed to NO; IP addresses will now be resolved.\r\n",
|
||||||
"Nameserver_is_slow changed to YES; sitenames will no longer be resolved.\r\n"},
|
"Nameserver_is_slow changed to YES; sitenames will no longer be resolved.\r\n"},
|
||||||
{"Autoexits disabled.\r\n",
|
{"Autoexits disabled.\r\n",
|
||||||
"Autoexits enabled.\r\n"},
|
"Autoexits enabled.\r\n"},
|
||||||
{"Will no longer track through doors.\r\n",
|
{"Will no longer track through doors.\r\n",
|
||||||
"Will now track through doors.\r\n"},
|
"Will now track through doors.\r\n"},
|
||||||
{"Will no longer clear screen in OLC.\r\n",
|
{"Will no longer clear screen in OLC.\r\n",
|
||||||
"Will now clear screen in OLC.\r\n"},
|
"Will now clear screen in OLC.\r\n"},
|
||||||
{"Buildwalk Off.\r\n",
|
{"Buildwalk Off.\r\n",
|
||||||
"Buildwalk On.\r\n"},
|
"Buildwalk On.\r\n"},
|
||||||
{"AFK flag is now off.\r\n",
|
{"AFK flag is now off.\r\n",
|
||||||
"AFK flag is now on.\r\n"},
|
"AFK flag is now on.\r\n"},
|
||||||
{"Autoloot disabled.\r\n",
|
{"Autoloot disabled.\r\n",
|
||||||
"Autoloot enabled.\r\n"},
|
"Autoloot enabled.\r\n"},
|
||||||
{"Autogold disabled.\r\n",
|
{"Autogold disabled.\r\n",
|
||||||
"Autogold enabled.\r\n"},
|
"Autogold enabled.\r\n"},
|
||||||
{"Autosplit disabled.\r\n",
|
{"Autosplit disabled.\r\n",
|
||||||
"Autosplit enabled.\r\n"},
|
"Autosplit enabled.\r\n"},
|
||||||
{"Autosacrifice disabled.\r\n",
|
{"Autosacrifice disabled.\r\n",
|
||||||
"Autosacrifice enabled.\r\n"},
|
"Autosacrifice enabled.\r\n"},
|
||||||
{"Autoassist disabled.\r\n",
|
{"Autoassist disabled.\r\n",
|
||||||
"Autoassist enabled.\r\n"},
|
"Autoassist enabled.\r\n"},
|
||||||
{"Automap disabled.\r\n",
|
{"Automap disabled.\r\n",
|
||||||
"Automap enabled.\r\n"},
|
"Automap enabled.\r\n"},
|
||||||
{"Autokey disabled.\r\n",
|
{"Autokey disabled.\r\n",
|
||||||
"Autokey enabled.\r\n"},
|
"Autokey enabled.\r\n"},
|
||||||
{"Autodoor disabled.\r\n",
|
{"Autodoor disabled.\r\n",
|
||||||
"Autodoor enabled.\r\n"},
|
"Autodoor enabled.\r\n"},
|
||||||
{"ZoneResets disabled.\r\n",
|
{"ZoneResets disabled.\r\n",
|
||||||
"ZoneResets enabled.\r\n"}
|
"ZoneResets enabled.\r\n"}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (IS_NPC(ch))
|
if (IS_NPC(ch))
|
||||||
@@ -794,11 +796,11 @@ ACMD(do_gen_tog)
|
|||||||
result = PRF_TOG_CHK(ch, PRF_BUILDWALK);
|
result = PRF_TOG_CHK(ch, PRF_BUILDWALK);
|
||||||
if (PRF_FLAGGED(ch, PRF_BUILDWALK)) {
|
if (PRF_FLAGGED(ch, PRF_BUILDWALK)) {
|
||||||
one_argument(argument, arg);
|
one_argument(argument, arg);
|
||||||
for (i=0; *arg && *(sector_types[i]) != '\n'; i++)
|
for (i = 0; *arg && *(sector_types[i]) != '\n'; i++)
|
||||||
if (is_abbrev(arg, sector_types[i]))
|
if (is_abbrev(arg, sector_types[i]))
|
||||||
break;
|
break;
|
||||||
if (*(sector_types[i]) == '\n')
|
if (*(sector_types[i]) == '\n')
|
||||||
i=0;
|
i = 0;
|
||||||
GET_BUILDWALK_SECTOR(ch) = i;
|
GET_BUILDWALK_SECTOR(ch) = i;
|
||||||
send_to_char(ch, "Default sector type is %s\r\n", sector_types[i]);
|
send_to_char(ch, "Default sector type is %s\r\n", sector_types[i]);
|
||||||
|
|
||||||
@@ -858,35 +860,32 @@ ACMD(do_gen_tog)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void show_happyhour(struct char_data *ch)
|
static void show_happyhour(char_data *ch)
|
||||||
{
|
{
|
||||||
char happyexp[80], happygold[80], happyqp[80];
|
char happyexp[80], happygold[80], happyqp[80];
|
||||||
int secs_left;
|
int secs_left;
|
||||||
|
|
||||||
if ((IS_HAPPYHOUR) || (GET_LEVEL(ch) >= LVL_GRGOD))
|
if ((IS_HAPPYHOUR) || (GET_LEVEL(ch) >= LVL_GRGOD)) {
|
||||||
{
|
if (HAPPY_TIME)
|
||||||
if (HAPPY_TIME)
|
secs_left = ((HAPPY_TIME - 1) * SECS_PER_MUD_HOUR) + next_tick;
|
||||||
secs_left = ((HAPPY_TIME - 1) * SECS_PER_MUD_HOUR) + next_tick;
|
else
|
||||||
else
|
secs_left = 0;
|
||||||
secs_left = 0;
|
|
||||||
|
|
||||||
sprintf(happyqp, "%s+%d%%%s to Questpoints per quest\r\n", CCYEL(ch, C_NRM), HAPPY_QP, CCNRM(ch, C_NRM));
|
sprintf(happyqp, "%s+%d%%%s to Questpoints per quest\r\n", CCYEL(ch, C_NRM), HAPPY_QP, CCNRM(ch, C_NRM));
|
||||||
sprintf(happygold, "%s+%d%%%s to Gold gained per kill\r\n", CCYEL(ch, C_NRM), HAPPY_GOLD, CCNRM(ch, C_NRM));
|
sprintf(happygold, "%s+%d%%%s to Gold gained per kill\r\n", CCYEL(ch, C_NRM), HAPPY_GOLD, CCNRM(ch, C_NRM));
|
||||||
sprintf(happyexp, "%s+%d%%%s to Experience per kill\r\n", CCYEL(ch, C_NRM), HAPPY_EXP, CCNRM(ch, C_NRM));
|
sprintf(happyexp, "%s+%d%%%s to Experience per kill\r\n", CCYEL(ch, C_NRM), HAPPY_EXP, CCNRM(ch, C_NRM));
|
||||||
|
|
||||||
send_to_char(ch, "tbaMUD Happy Hour!\r\n"
|
send_to_char(ch, "tbaMUD Happy Hour!\r\n"
|
||||||
"------------------\r\n"
|
"------------------\r\n"
|
||||||
"%s%s%sTime Remaining: %s%d%s hours %s%d%s mins %s%d%s secs\r\n",
|
"%s%s%sTime Remaining: %s%d%s hours %s%d%s mins %s%d%s secs\r\n",
|
||||||
(IS_HAPPYEXP || (GET_LEVEL(ch) >= LVL_GOD)) ? happyexp : "",
|
(IS_HAPPYEXP || (GET_LEVEL(ch) >= LVL_GOD)) ? happyexp : "",
|
||||||
(IS_HAPPYGOLD || (GET_LEVEL(ch) >= LVL_GOD)) ? happygold : "",
|
(IS_HAPPYGOLD || (GET_LEVEL(ch) >= LVL_GOD)) ? happygold : "",
|
||||||
(IS_HAPPYQP || (GET_LEVEL(ch) >= LVL_GOD)) ? happyqp : "",
|
(IS_HAPPYQP || (GET_LEVEL(ch) >= LVL_GOD)) ? happyqp : "",
|
||||||
CCYEL(ch, C_NRM), (secs_left / 3600), CCNRM(ch, C_NRM),
|
CCYEL(ch, C_NRM), (secs_left / 3600), CCNRM(ch, C_NRM),
|
||||||
CCYEL(ch, C_NRM), (secs_left % 3600) / 60, CCNRM(ch, C_NRM),
|
CCYEL(ch, C_NRM), (secs_left % 3600) / 60, CCNRM(ch, C_NRM),
|
||||||
CCYEL(ch, C_NRM), (secs_left % 60), CCNRM(ch, C_NRM) );
|
CCYEL(ch, C_NRM), (secs_left % 60), CCNRM(ch, C_NRM));
|
||||||
}
|
} else {
|
||||||
else
|
send_to_char(ch, "Sorry, there is currently no happy hour!\r\n");
|
||||||
{
|
|
||||||
send_to_char(ch, "Sorry, there is currently no happy hour!\r\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -895,8 +894,7 @@ ACMD(do_happyhour)
|
|||||||
char arg[MAX_INPUT_LENGTH], val[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH], val[MAX_INPUT_LENGTH];
|
||||||
int num;
|
int num;
|
||||||
|
|
||||||
if (GET_LEVEL(ch) < LVL_GOD)
|
if (GET_LEVEL(ch) < LVL_GOD) {
|
||||||
{
|
|
||||||
show_happyhour(ch);
|
show_happyhour(ch);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -904,20 +902,15 @@ ACMD(do_happyhour)
|
|||||||
/* Only Imms get here, so check args */
|
/* Only Imms get here, so check args */
|
||||||
two_arguments(argument, arg, val);
|
two_arguments(argument, arg, val);
|
||||||
|
|
||||||
if (is_abbrev(arg, "experience"))
|
if (is_abbrev(arg, "experience")) {
|
||||||
{
|
|
||||||
num = MIN(MAX((atoi(val)), 0), 1000);
|
num = MIN(MAX((atoi(val)), 0), 1000);
|
||||||
HAPPY_EXP = num;
|
HAPPY_EXP = num;
|
||||||
send_to_char(ch, "Happy Hour Exp rate set to +%d%%\r\n", HAPPY_EXP);
|
send_to_char(ch, "Happy Hour Exp rate set to +%d%%\r\n", HAPPY_EXP);
|
||||||
}
|
} else if ((is_abbrev(arg, "gold")) || (is_abbrev(arg, "coins"))) {
|
||||||
else if ((is_abbrev(arg, "gold")) || (is_abbrev(arg, "coins")))
|
|
||||||
{
|
|
||||||
num = MIN(MAX((atoi(val)), 0), 1000);
|
num = MIN(MAX((atoi(val)), 0), 1000);
|
||||||
HAPPY_GOLD = num;
|
HAPPY_GOLD = num;
|
||||||
send_to_char(ch, "Happy Hour Gold rate set to +%d%%\r\n", HAPPY_GOLD);
|
send_to_char(ch, "Happy Hour Gold rate set to +%d%%\r\n", HAPPY_GOLD);
|
||||||
}
|
} else if ((is_abbrev(arg, "time")) || (is_abbrev(arg, "ticks"))) {
|
||||||
else if ((is_abbrev(arg, "time")) || (is_abbrev(arg, "ticks")))
|
|
||||||
{
|
|
||||||
num = MIN(MAX((atoi(val)), 0), 1000);
|
num = MIN(MAX((atoi(val)), 0), 1000);
|
||||||
if (HAPPY_TIME && !num)
|
if (HAPPY_TIME && !num)
|
||||||
game_info("Happyhour has been stopped!");
|
game_info("Happyhour has been stopped!");
|
||||||
@@ -926,47 +919,39 @@ ACMD(do_happyhour)
|
|||||||
|
|
||||||
HAPPY_TIME = num;
|
HAPPY_TIME = num;
|
||||||
send_to_char(ch, "Happy Hour Time set to %d ticks (%d hours %d mins and %d secs)\r\n",
|
send_to_char(ch, "Happy Hour Time set to %d ticks (%d hours %d mins and %d secs)\r\n",
|
||||||
HAPPY_TIME,
|
HAPPY_TIME,
|
||||||
(HAPPY_TIME*SECS_PER_MUD_HOUR)/3600,
|
(HAPPY_TIME * SECS_PER_MUD_HOUR) / 3600,
|
||||||
((HAPPY_TIME*SECS_PER_MUD_HOUR)%3600) / 60,
|
((HAPPY_TIME * SECS_PER_MUD_HOUR) % 3600) / 60,
|
||||||
(HAPPY_TIME*SECS_PER_MUD_HOUR)%60 );
|
(HAPPY_TIME * SECS_PER_MUD_HOUR) % 60);
|
||||||
}
|
} else if ((is_abbrev(arg, "qp")) || (is_abbrev(arg, "questpoints"))) {
|
||||||
else if ((is_abbrev(arg, "qp")) || (is_abbrev(arg, "questpoints")))
|
|
||||||
{
|
|
||||||
num = MIN(MAX((atoi(val)), 0), 1000);
|
num = MIN(MAX((atoi(val)), 0), 1000);
|
||||||
HAPPY_QP = num;
|
HAPPY_QP = num;
|
||||||
send_to_char(ch, "Happy Hour Questpoints rate set to +%d%%\r\n", HAPPY_QP);
|
send_to_char(ch, "Happy Hour Questpoints rate set to +%d%%\r\n", HAPPY_QP);
|
||||||
}
|
} else if (is_abbrev(arg, "show")) {
|
||||||
else if (is_abbrev(arg, "show"))
|
|
||||||
{
|
|
||||||
show_happyhour(ch);
|
show_happyhour(ch);
|
||||||
}
|
} else if (is_abbrev(arg, "default")) {
|
||||||
else if (is_abbrev(arg, "default"))
|
|
||||||
{
|
|
||||||
HAPPY_EXP = 100;
|
HAPPY_EXP = 100;
|
||||||
HAPPY_GOLD = 50;
|
HAPPY_GOLD = 50;
|
||||||
HAPPY_QP = 50;
|
HAPPY_QP = 50;
|
||||||
HAPPY_TIME = 48;
|
HAPPY_TIME = 48;
|
||||||
game_info("A Happyhour has started!");
|
game_info("A Happyhour has started!");
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
send_to_char(ch, "Usage: %shappyhour %s- show usage (this info)\r\n"
|
send_to_char(ch, "Usage: %shappyhour %s- show usage (this info)\r\n"
|
||||||
" %shappyhour show %s- display current settings (what mortals see)\r\n"
|
" %shappyhour show %s- display current settings (what mortals see)\r\n"
|
||||||
" %shappyhour time <ticks> %s- set happyhour time and start timer\r\n"
|
" %shappyhour time <ticks> %s- set happyhour time and start timer\r\n"
|
||||||
" %shappyhour qp <num> %s- set qp percentage gain\r\n"
|
" %shappyhour qp <num> %s- set qp percentage gain\r\n"
|
||||||
" %shappyhour exp <num> %s- set exp percentage gain\r\n"
|
" %shappyhour exp <num> %s- set exp percentage gain\r\n"
|
||||||
" %shappyhour gold <num> %s- set gold percentage gain\r\n"
|
" %shappyhour gold <num> %s- set gold percentage gain\r\n"
|
||||||
" \tyhappyhour default \tw- sets a default setting for happyhour\r\n\r\n"
|
" \tyhappyhour default \tw- sets a default setting for happyhour\r\n\r\n"
|
||||||
"Configure the happyhour settings and start a happyhour.\r\n"
|
"Configure the happyhour settings and start a happyhour.\r\n"
|
||||||
"Currently 1 hour IRL = %d ticks\r\n"
|
"Currently 1 hour IRL = %d ticks\r\n"
|
||||||
"If no number is specified, 0 (off) is assumed.\r\nThe command \tyhappyhour time\tn will therefore stop the happyhour timer.\r\n",
|
"If no number is specified, 0 (off) is assumed.\r\nThe command \tyhappyhour time\tn will therefore stop the happyhour timer.\r\n",
|
||||||
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
|
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
|
||||||
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
|
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
|
||||||
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
|
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
|
||||||
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
|
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
|
||||||
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
|
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
|
||||||
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
|
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
|
||||||
(3600 / SECS_PER_MUD_HOUR) );
|
(3600 / SECS_PER_MUD_HOUR));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+58
-40
@@ -30,8 +30,8 @@ ACMD(do_action)
|
|||||||
char arg[MAX_INPUT_LENGTH], part[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH], part[MAX_INPUT_LENGTH];
|
||||||
int act_nr;
|
int act_nr;
|
||||||
struct social_messg *action;
|
struct social_messg *action;
|
||||||
struct char_data *vict;
|
char_data *vict;
|
||||||
struct obj_data *targ;
|
obj_data *targ;
|
||||||
|
|
||||||
if ((act_nr = find_action(cmd)) < 0) {
|
if ((act_nr = find_action(cmd)) < 0) {
|
||||||
send_to_char(ch, "That action is not supported.\r\n");
|
send_to_char(ch, "That action is not supported.\r\n");
|
||||||
@@ -65,7 +65,8 @@ ACMD(do_action)
|
|||||||
if (!vict) {
|
if (!vict) {
|
||||||
if (action->char_obj_found) {
|
if (action->char_obj_found) {
|
||||||
targ = get_obj_in_list_vis(ch, arg, NULL, ch->carrying);
|
targ = get_obj_in_list_vis(ch, arg, NULL, ch->carrying);
|
||||||
if (!targ) targ = get_obj_in_list_vis(ch, arg, NULL, world[IN_ROOM(ch)].contents);
|
if (!targ)
|
||||||
|
targ = get_obj_in_list_vis(ch, arg, NULL, world[IN_ROOM(ch)].contents);
|
||||||
if (targ) {
|
if (targ) {
|
||||||
act(action->char_obj_found, action->hide, ch, targ, 0, TO_CHAR);
|
act(action->char_obj_found, action->hide, ch, targ, 0, TO_CHAR);
|
||||||
act(action->others_obj_found, action->hide, ch, targ, 0, TO_ROOM);
|
act(action->others_obj_found, action->hide, ch, targ, 0, TO_ROOM);
|
||||||
@@ -92,9 +93,9 @@ ACMD(do_action)
|
|||||||
act("$N is not in a proper position for that.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
act("$N is not in a proper position for that.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
||||||
else {
|
else {
|
||||||
if (*part) {
|
if (*part) {
|
||||||
act(action->char_body_found, 0, ch, (struct obj_data *)part, vict, TO_CHAR | TO_SLEEP);
|
act(action->char_body_found, 0, ch, (obj_data *)part, vict, TO_CHAR | TO_SLEEP);
|
||||||
act(action->others_body_found, action->hide, ch, (struct obj_data *)part, vict, TO_NOTVICT);
|
act(action->others_body_found, action->hide, ch, (obj_data *)part, vict, TO_NOTVICT);
|
||||||
act(action->vict_body_found, action->hide, ch, (struct obj_data *)part, vict, TO_VICT);
|
act(action->vict_body_found, action->hide, ch, (obj_data *)part, vict, TO_VICT);
|
||||||
} else {
|
} else {
|
||||||
act(action->char_found, 0, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
act(action->char_found, 0, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
||||||
act(action->others_found, action->hide, ch, 0, vict, TO_NOTVICT);
|
act(action->others_found, action->hide, ch, 0, vict, TO_NOTVICT);
|
||||||
@@ -128,7 +129,8 @@ void create_command_list(void)
|
|||||||
|
|
||||||
/* count the commands in the command list */
|
/* count the commands in the command list */
|
||||||
i = 0;
|
i = 0;
|
||||||
while(*cmd_info[i].command != '\n') i++;
|
while (*cmd_info[i].command != '\n')
|
||||||
|
i++;
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
CREATE(complete_cmd_info, struct command_info, top_of_socialt + i + 2);
|
CREATE(complete_cmd_info, struct command_info, top_of_socialt + i + 2);
|
||||||
@@ -137,21 +139,21 @@ void create_command_list(void)
|
|||||||
i = 0;
|
i = 0;
|
||||||
j = 0;
|
j = 0;
|
||||||
k = 0;
|
k = 0;
|
||||||
while ((*cmd_info[i].command != '\n') || (j <= top_of_socialt)) {
|
while ((*cmd_info[i].command != '\n') || (j <= top_of_socialt)) {
|
||||||
if ((i < RESERVE_CMDS) || (j > top_of_socialt) ||
|
if ((i < RESERVE_CMDS) || (j > top_of_socialt) ||
|
||||||
(str_cmp(cmd_info[i].sort_as, soc_mess_list[j].sort_as) < 1))
|
(str_cmp(cmd_info[i].sort_as, soc_mess_list[j].sort_as) < 1))
|
||||||
complete_cmd_info[k++] = cmd_info[i++];
|
complete_cmd_info[k++] = cmd_info[i++];
|
||||||
else {
|
else {
|
||||||
soc_mess_list[j].act_nr = k;
|
soc_mess_list[j].act_nr = k;
|
||||||
complete_cmd_info[k].command = soc_mess_list[j].command;
|
complete_cmd_info[k].command = soc_mess_list[j].command;
|
||||||
complete_cmd_info[k].sort_as = soc_mess_list[j].sort_as;
|
complete_cmd_info[k].sort_as = soc_mess_list[j].sort_as;
|
||||||
complete_cmd_info[k].minimum_position = soc_mess_list[j].min_char_position;
|
complete_cmd_info[k].minimum_position = soc_mess_list[j].min_char_position;
|
||||||
complete_cmd_info[k].command_pointer = do_action;
|
complete_cmd_info[k].command_pointer = do_action;
|
||||||
complete_cmd_info[k].minimum_level = soc_mess_list[j++].min_level_char;
|
complete_cmd_info[k].minimum_level = soc_mess_list[j++].min_level_char;
|
||||||
complete_cmd_info[k++].subcmd = 0;
|
complete_cmd_info[k++].subcmd = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
complete_cmd_info[k] = cmd_info[i];
|
complete_cmd_info[k] = cmd_info[i];
|
||||||
log("Command info rebuilt, %d total commands.", k);
|
log("Command info rebuilt, %d total commands.", k);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,29 +168,45 @@ void free_social_messages(void)
|
|||||||
struct social_messg *mess;
|
struct social_messg *mess;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0;i <= top_of_socialt;i++) {
|
for (i = 0; i <= top_of_socialt; i++) {
|
||||||
mess = &soc_mess_list[i];
|
mess = &soc_mess_list[i];
|
||||||
free_action(mess);
|
free_action(mess);
|
||||||
}
|
}
|
||||||
free(soc_mess_list);
|
free(soc_mess_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_action(struct social_messg *mess) {
|
void free_action(struct social_messg *mess)
|
||||||
if (mess->command) free(mess->command);
|
{
|
||||||
if (mess->sort_as) free(mess->sort_as);
|
if (mess->command)
|
||||||
if (mess->char_no_arg) free(mess->char_no_arg);
|
free(mess->command);
|
||||||
if (mess->others_no_arg) free(mess->others_no_arg);
|
if (mess->sort_as)
|
||||||
if (mess->char_found) free(mess->char_found);
|
free(mess->sort_as);
|
||||||
if (mess->others_found) free(mess->others_found);
|
if (mess->char_no_arg)
|
||||||
if (mess->vict_found) free(mess->vict_found);
|
free(mess->char_no_arg);
|
||||||
if (mess->char_body_found) free(mess->char_body_found);
|
if (mess->others_no_arg)
|
||||||
if (mess->others_body_found) free(mess->others_body_found);
|
free(mess->others_no_arg);
|
||||||
if (mess->vict_body_found) free(mess->vict_body_found);
|
if (mess->char_found)
|
||||||
if (mess->not_found) free(mess->not_found);
|
free(mess->char_found);
|
||||||
if (mess->char_auto) free(mess->char_auto);
|
if (mess->others_found)
|
||||||
if (mess->others_auto) free(mess->others_auto);
|
free(mess->others_found);
|
||||||
if (mess->char_obj_found) free(mess->char_obj_found);
|
if (mess->vict_found)
|
||||||
if (mess->others_obj_found) free(mess->others_obj_found);
|
free(mess->vict_found);
|
||||||
|
if (mess->char_body_found)
|
||||||
|
free(mess->char_body_found);
|
||||||
|
if (mess->others_body_found)
|
||||||
|
free(mess->others_body_found);
|
||||||
|
if (mess->vict_body_found)
|
||||||
|
free(mess->vict_body_found);
|
||||||
|
if (mess->not_found)
|
||||||
|
free(mess->not_found);
|
||||||
|
if (mess->char_auto)
|
||||||
|
free(mess->char_auto);
|
||||||
|
if (mess->others_auto)
|
||||||
|
free(mess->others_auto);
|
||||||
|
if (mess->char_obj_found)
|
||||||
|
free(mess->char_obj_found);
|
||||||
|
if (mess->others_obj_found)
|
||||||
|
free(mess->others_obj_found);
|
||||||
memset(mess, 0, sizeof(struct social_messg));
|
memset(mess, 0, sizeof(struct social_messg));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,11 +240,11 @@ ACMD(do_gmote)
|
|||||||
int act_nr, length;
|
int act_nr, length;
|
||||||
char arg[MAX_INPUT_LENGTH], buf[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH], buf[MAX_INPUT_LENGTH];
|
||||||
struct social_messg *action;
|
struct social_messg *action;
|
||||||
struct char_data *vict = NULL;
|
char_data *vict = NULL;
|
||||||
|
|
||||||
half_chop(argument, buf, arg);
|
half_chop(argument, buf, arg);
|
||||||
|
|
||||||
if(subcmd)
|
if (subcmd)
|
||||||
for (length = strlen(buf), cmd = 0; *complete_cmd_info[cmd].command != '\n'; cmd++)
|
for (length = strlen(buf), cmd = 0; *complete_cmd_info[cmd].command != '\n'; cmd++)
|
||||||
if (!strncmp(complete_cmd_info[cmd].command, buf, length))
|
if (!strncmp(complete_cmd_info[cmd].command, buf, length))
|
||||||
break;
|
break;
|
||||||
@@ -242,13 +260,13 @@ ACMD(do_gmote)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
action = &soc_mess_list[act_nr];
|
action = &soc_mess_list[act_nr];
|
||||||
|
|
||||||
if (!action->char_found)
|
if (!action->char_found)
|
||||||
*arg = '\0';
|
*arg = '\0';
|
||||||
|
|
||||||
if (!*arg) {
|
if (!*arg) {
|
||||||
if(!action->others_no_arg || !*action->others_no_arg) {
|
if (!action->others_no_arg || !*action->others_no_arg) {
|
||||||
send_to_char(ch, "Who are you going to do that to?\r\n");
|
send_to_char(ch, "Who are you going to do that to?\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -257,7 +275,7 @@ action = &soc_mess_list[act_nr];
|
|||||||
send_to_char(ch, "%s\r\n", action->not_found);
|
send_to_char(ch, "%s\r\n", action->not_found);
|
||||||
return;
|
return;
|
||||||
} else if (vict == ch) {
|
} else if (vict == ch) {
|
||||||
if(!action->others_auto || !*action->others_auto) {
|
if (!action->others_auto || !*action->others_auto) {
|
||||||
send_to_char(ch, "%s\r\n", action->char_auto);
|
send_to_char(ch, "%s\r\n", action->char_auto);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -265,7 +283,7 @@ action = &soc_mess_list[act_nr];
|
|||||||
} else {
|
} else {
|
||||||
if (GET_POS(vict) < action->min_victim_position) {
|
if (GET_POS(vict) < action->min_victim_position) {
|
||||||
act("$N is not in a proper position for that.",
|
act("$N is not in a proper position for that.",
|
||||||
FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
snprintf(buf, sizeof(buf), "Gemote: %s", action->others_found);
|
snprintf(buf, sizeof(buf), "Gemote: %s", action->others_found);
|
||||||
|
|||||||
+1737
-1730
File diff suppressed because it is too large
Load Diff
+676
-649
File diff suppressed because it is too large
Load Diff
+297
-270
@@ -15,12 +15,8 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
#include "interpreter.h"
|
#include "interpreter.h"
|
||||||
#include "handler.h"
|
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "spells.h"
|
|
||||||
#include "house.h"
|
|
||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
#include "dg_scripts.h"
|
|
||||||
#include "asciimap.h"
|
#include "asciimap.h"
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
@@ -33,29 +29,28 @@
|
|||||||
|
|
||||||
#define DEFAULT_MAP_SIZE CONFIG_MAP_SIZE
|
#define DEFAULT_MAP_SIZE CONFIG_MAP_SIZE
|
||||||
|
|
||||||
#define MAX_MAP_SIZE (CANVAS_WIDTH - 1)/4
|
#define MAX_MAP_SIZE ((CANVAS_WIDTH - 1)/4)
|
||||||
#define MAX_MAP CANVAS_WIDTH
|
#define MAX_MAP CANVAS_WIDTH
|
||||||
|
|
||||||
#define MAX_MAP_DIR 10
|
#define MAX_MAP_DIR 10
|
||||||
#define MAX_MAP_FOLLOW 10
|
|
||||||
|
|
||||||
#define SECT_EMPTY 30 /* anything greater than num sect types */
|
#define SECT_EMPTY 30 /* anything greater than num sect types */
|
||||||
#define SECT_STRANGE (SECT_EMPTY + 1)
|
#define SECT_STRANGE (SECT_EMPTY + 1)
|
||||||
#define SECT_HERE (SECT_STRANGE + 1)
|
#define SECT_HERE (SECT_STRANGE + 1)
|
||||||
|
|
||||||
#define DOOR_NS -1
|
#define DOOR_NS (-1)
|
||||||
#define DOOR_EW -2
|
#define DOOR_EW (-2)
|
||||||
#define DOOR_UP -3
|
#define DOOR_UP (-3)
|
||||||
#define DOOR_DOWN -4
|
#define DOOR_DOWN (-4)
|
||||||
#define DOOR_DIAGNE -5
|
#define DOOR_DIAGNE (-5)
|
||||||
#define DOOR_DIAGNW -6
|
#define DOOR_DIAGNW (-6)
|
||||||
#define VDOOR_NS -7
|
#define VDOOR_NS (-7)
|
||||||
#define VDOOR_EW -8
|
#define VDOOR_EW (-8)
|
||||||
#define VDOOR_DIAGNE -9
|
#define VDOOR_DIAGNE (-9)
|
||||||
#define VDOOR_DIAGNW -10
|
#define VDOOR_DIAGNW (-10)
|
||||||
#define DOOR_UP_AND_NE -11
|
#define DOOR_UP_AND_NE (-11)
|
||||||
#define DOOR_DOWN_AND_SE -12
|
#define DOOR_DOWN_AND_SE (-12)
|
||||||
#define DOOR_NONE -13
|
#define DOOR_NONE (-13)
|
||||||
#define NUM_DOOR_TYPES 13
|
#define NUM_DOOR_TYPES 13
|
||||||
|
|
||||||
#define MAP_CIRCLE 0
|
#define MAP_CIRCLE 0
|
||||||
@@ -64,46 +59,44 @@
|
|||||||
#define MAP_NORMAL 0
|
#define MAP_NORMAL 0
|
||||||
#define MAP_COMPACT 1
|
#define MAP_COMPACT 1
|
||||||
|
|
||||||
static bool show_worldmap(struct char_data *ch);
|
|
||||||
|
|
||||||
struct map_info_type
|
struct map_info_type
|
||||||
{
|
{
|
||||||
int sector_type;
|
int sector_type;
|
||||||
char disp[20];
|
char disp[20];
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct map_info_type door_info[] =
|
static struct map_info_type door_info[] =
|
||||||
{
|
{
|
||||||
{ DOOR_NONE, " " },
|
{DOOR_NONE, " "},
|
||||||
{ DOOR_DOWN_AND_SE, "\tr-\tn\\ " },
|
{DOOR_DOWN_AND_SE, "\tr-\tn\\ "},
|
||||||
{ DOOR_UP_AND_NE, "\tr+\tn/ " },
|
{DOOR_UP_AND_NE, "\tr+\tn/ "},
|
||||||
{ VDOOR_DIAGNW, " \tm+\tn " },
|
{VDOOR_DIAGNW, " \tm+\tn "},
|
||||||
{ VDOOR_DIAGNE, " \tm+\tn "},
|
{VDOOR_DIAGNE, " \tm+\tn "},
|
||||||
{ VDOOR_EW, " \tm+\tn " },
|
{VDOOR_EW, " \tm+\tn "},
|
||||||
{ VDOOR_NS, " \tm+\tn "},
|
{VDOOR_NS, " \tm+\tn "},
|
||||||
{ DOOR_DIAGNW, " \\ " },
|
{DOOR_DIAGNW, " \\ "},
|
||||||
{ DOOR_DIAGNE, " / " },
|
{DOOR_DIAGNE, " / "},
|
||||||
{ DOOR_DOWN, "\tr-\tn " },
|
{DOOR_DOWN, "\tr-\tn "},
|
||||||
{ DOOR_UP, "\tr+\tn " },
|
{DOOR_UP, "\tr+\tn "},
|
||||||
{ DOOR_EW, " - " },
|
{DOOR_EW, " - "},
|
||||||
{ DOOR_NS, " | " }
|
{DOOR_NS, " | "}
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct map_info_type compact_door_info[] =
|
static struct map_info_type compact_door_info[] =
|
||||||
{
|
{
|
||||||
{ DOOR_NONE, " " },
|
{DOOR_NONE, " "},
|
||||||
{ DOOR_DOWN_AND_SE, "\tR\\\tn" },
|
{DOOR_DOWN_AND_SE, "\tR\\\tn"},
|
||||||
{ DOOR_UP_AND_NE, "\tR/\tn" },
|
{DOOR_UP_AND_NE, "\tR/\tn"},
|
||||||
{ VDOOR_DIAGNW, "\tm+\tn" },
|
{VDOOR_DIAGNW, "\tm+\tn"},
|
||||||
{ VDOOR_DIAGNE, "\tm+\tn"},
|
{VDOOR_DIAGNE, "\tm+\tn"},
|
||||||
{ VDOOR_EW, " \tm+\tn " },
|
{VDOOR_EW, " \tm+\tn "},
|
||||||
{ VDOOR_NS, " \tm+\tn "},
|
{VDOOR_NS, " \tm+\tn "},
|
||||||
{ DOOR_DIAGNW,"\\" },
|
{DOOR_DIAGNW, "\\"},
|
||||||
{ DOOR_DIAGNE,"/" },
|
{DOOR_DIAGNE, "/"},
|
||||||
{ DOOR_DOWN, "\tr-\tn" },
|
{DOOR_DOWN, "\tr-\tn"},
|
||||||
{ DOOR_UP, "\tr+\tn" },
|
{DOOR_UP, "\tr+\tn"},
|
||||||
{ DOOR_EW, "-" },
|
{DOOR_EW, "-"},
|
||||||
{ DOOR_NS, " | " }
|
{DOOR_NS, " | "}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Add new sector types below for both map_info and world_map_info */
|
/* Add new sector types below for both map_info and world_map_info */
|
||||||
@@ -111,76 +104,76 @@ static struct map_info_type compact_door_info[] =
|
|||||||
/* New sectors also need to be added to the perform_map function below */
|
/* New sectors also need to be added to the perform_map function below */
|
||||||
static struct map_info_type map_info[] =
|
static struct map_info_type map_info[] =
|
||||||
{
|
{
|
||||||
{ SECT_INSIDE, "\tc[\tn.\tc]\tn" }, /* 0 */
|
{SECT_INSIDE, "\tc[\tn.\tc]\tn"}, /* 0 */
|
||||||
{ SECT_CITY, "\tc[\twC\tc]\tn" },
|
{SECT_CITY, "\tc[\twC\tc]\tn"},
|
||||||
{ SECT_FIELD, "\tc[\tg,\tc]\tn" },
|
{SECT_FIELD, "\tc[\tg,\tc]\tn"},
|
||||||
{ SECT_FOREST, "\tc[\tgY\tc]\tn" },
|
{SECT_FOREST, "\tc[\tgY\tc]\tn"},
|
||||||
{ SECT_HILLS, "\tc[\tMm\tc]\tn" },
|
{SECT_HILLS, "\tc[\tMm\tc]\tn"},
|
||||||
{ SECT_MOUNTAIN, "\tc[\trM\tc]\tn" }, /* 5 */
|
{SECT_MOUNTAIN, "\tc[\trM\tc]\tn"}, /* 5 */
|
||||||
{ SECT_WATER_SWIM, "\tc[\tc~\tc]\tn" },
|
{SECT_WATER_SWIM, "\tc[\tc~\tc]\tn"},
|
||||||
{ SECT_WATER_NOSWIM, "\tc[\tb=\tc]\tn" },
|
{SECT_WATER_NOSWIM, "\tc[\tb=\tc]\tn"},
|
||||||
{ SECT_FLYING, "\tc[\tC^\tc]\tn" },
|
{SECT_FLYING, "\tc[\tC^\tc]\tn"},
|
||||||
{ SECT_UNDERWATER, "\tc[\tbU\tc]\tn" },
|
{SECT_UNDERWATER, "\tc[\tbU\tc]\tn"},
|
||||||
{ -1, "" }, /* 10 */
|
{-1, ""}, /* 10 */
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" }, /* 15 */
|
{-1, ""}, /* 15 */
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" }, /* 20 */
|
{-1, ""}, /* 20 */
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" }, /* 25 */
|
{-1, ""}, /* 25 */
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ SECT_EMPTY, " " }, /* 30 */
|
{SECT_EMPTY, " "}, /* 30 */
|
||||||
{ SECT_STRANGE, "\tc[\tR?\tc]\tn" },
|
{SECT_STRANGE, "\tc[\tR?\tc]\tn"},
|
||||||
{ SECT_HERE, "\tc[\tB!\tc]\tn" },
|
{SECT_HERE, "\tc[\tB!\tc]\tn"},
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct map_info_type world_map_info[] =
|
static struct map_info_type world_map_info[] =
|
||||||
{
|
{
|
||||||
{ SECT_INSIDE, "\tn." }, /* 0 */
|
{SECT_INSIDE, "\tn."}, /* 0 */
|
||||||
{ SECT_CITY, "\twC" },
|
{SECT_CITY, "\twC"},
|
||||||
{ SECT_FIELD, "\tg," },
|
{SECT_FIELD, "\tg,"},
|
||||||
{ SECT_FOREST, "\tgY" },
|
{SECT_FOREST, "\tgY"},
|
||||||
{ SECT_HILLS, "\tMm" },
|
{SECT_HILLS, "\tMm"},
|
||||||
{ SECT_MOUNTAIN, "\trM" }, /* 5 */
|
{SECT_MOUNTAIN, "\trM"}, /* 5 */
|
||||||
{ SECT_WATER_SWIM, "\tc~" },
|
{SECT_WATER_SWIM, "\tc~"},
|
||||||
{ SECT_WATER_NOSWIM, "\tb=" },
|
{SECT_WATER_NOSWIM, "\tb="},
|
||||||
{ SECT_FLYING, "\tC^" },
|
{SECT_FLYING, "\tC^"},
|
||||||
{ SECT_UNDERWATER, "\tbU" },
|
{SECT_UNDERWATER, "\tbU"},
|
||||||
{ -1, "" }, /* 10 */
|
{-1, ""}, /* 10 */
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" }, /* 15 */
|
{-1, ""}, /* 15 */
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" }, /* 20 */
|
{-1, ""}, /* 20 */
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" }, /* 25 */
|
{-1, ""}, /* 25 */
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ -1, "" },
|
{-1, ""},
|
||||||
{ SECT_EMPTY, " " }, /* 30 */
|
{SECT_EMPTY, " "}, /* 30 */
|
||||||
{ SECT_STRANGE, "\tR?" },
|
{SECT_STRANGE, "\tR?"},
|
||||||
{ SECT_HERE, "\tB!" },
|
{SECT_HERE, "\tB!"},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -191,11 +184,14 @@ static int offsets_worldmap[4][2] ={ {-1, 0},{ 0, 1},{ 1, 0},{ 0, -1} };
|
|||||||
static int door_offsets[6][2] ={ {-1, 0},{ 0, 1},{ 1, 0},{ 0, -1},{ -1, 1},{ 1, 1} };
|
static int door_offsets[6][2] ={ {-1, 0},{ 0, 1},{ 1, 0},{ 0, -1},{ -1, 1},{ 1, 1} };
|
||||||
static int door_marks[6] = { DOOR_NS, DOOR_EW, DOOR_NS, DOOR_EW, DOOR_UP, DOOR_DOWN };
|
static int door_marks[6] = { DOOR_NS, DOOR_EW, DOOR_NS, DOOR_EW, DOOR_UP, DOOR_DOWN };
|
||||||
*/
|
*/
|
||||||
static int offsets[10][2] ={ {-2, 0},{ 0, 2},{ 2, 0},{ 0, -2},{0, 0},{ 0, 0},{ -2, -2},{ -2, 2},{2, 2},{ 2, -2} };
|
static int offsets[10][2] = {{-2, 0}, {0, 2}, {2, 0}, {0, -2}, {0, 0}, {0, 0}, {-2, -2}, {-2, 2}, {2, 2}, {2, -2}};
|
||||||
static int offsets_worldmap[10][2] ={ {-1, 0},{ 0, 1},{ 1, 0},{ 0, -1},{0, 0},{ 0, 0},{ -1, -1},{ -1, 1},{1, 1},{ 1, -1} };
|
static int offsets_worldmap[10][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}, {0, 0}, {0, 0}, {-1, -1}, {-1, 1}, {1, 1},
|
||||||
static int door_offsets[10][2] ={ {-1, 0},{ 0, 1},{ 1, 0},{ 0, -1},{ -1, 1},{ 1, 1},{ -1, -1},{ -1, 1},{ 1, 1},{ 1, -1} };
|
{1, -1}};
|
||||||
static int door_marks[10] = { DOOR_NS, DOOR_EW, DOOR_NS, DOOR_EW, DOOR_UP, DOOR_DOWN, DOOR_DIAGNW, DOOR_DIAGNE, DOOR_DIAGNW, DOOR_DIAGNE};
|
static int door_offsets[10][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}, {-1, 1}, {1, 1}, {-1, -1}, {-1, 1}, {1, 1},
|
||||||
static int vdoor_marks[4] = { VDOOR_NS, VDOOR_EW, VDOOR_NS, VDOOR_EW };
|
{1, -1}};
|
||||||
|
static int door_marks[10] = {DOOR_NS, DOOR_EW, DOOR_NS, DOOR_EW, DOOR_UP, DOOR_DOWN, DOOR_DIAGNW, DOOR_DIAGNE,
|
||||||
|
DOOR_DIAGNW, DOOR_DIAGNE};
|
||||||
|
static int vdoor_marks[4] = {VDOOR_NS, VDOOR_EW, VDOOR_NS, VDOOR_EW};
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* End Local (File Scope) Defines and Global Variables
|
* End Local (File Scope) Defines and Global Variables
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
@@ -203,118 +199,139 @@ static int vdoor_marks[4] = { VDOOR_NS, VDOOR_EW, VDOOR_NS, VDOOR_EW };
|
|||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Begin Local (File Scope) Function Prototypes
|
* Begin Local (File Scope) Function Prototypes
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
static void MapArea(room_rnum room, struct char_data *ch, int x, int y, int min, int max, sh_int xpos, sh_int ypos, bool worldmap);
|
static void MapArea(room_rnum room, const char_data *ch, int x, int y, int min, int max, int xpos, int ypos,
|
||||||
|
bool worldmap);
|
||||||
static char *StringMap(int centre, int size);
|
static char *StringMap(int centre, int size);
|
||||||
static char *WorldMap(int centre, int size, int mapshape, int maptype );
|
static char *WorldMap(int centre, int size, int mapshape, int maptype);
|
||||||
static char *CompactStringMap(int centre, int size);
|
static char *CompactStringMap(int centre, int size);
|
||||||
static void perform_map( struct char_data *ch, char *argument, bool worldmap );
|
static void perform_map(char_data *ch, char *argument, bool worldmap);
|
||||||
|
static bool show_worldmap(const char_data *ch);
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* End Local (File Scope) Function Prototypes
|
* End Local (File Scope) Function Prototypes
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
bool can_see_map(struct char_data *ch) {
|
bool can_see_map(const char_data *ch)
|
||||||
|
{
|
||||||
/* Is the map funcionality disabled? */
|
/* Is the map funcionality disabled? */
|
||||||
if (CONFIG_MAP == MAP_OFF)
|
if (CONFIG_MAP == MAP_OFF || (CONFIG_MAP == MAP_IMM_ONLY && GET_LEVEL(ch) < LVL_IMMORT))
|
||||||
return FALSE;
|
|
||||||
else if ((CONFIG_MAP == MAP_IMM_ONLY) && (GET_LEVEL(ch) < LVL_IMMORT))
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MapArea function - create the actual map */
|
/* MapArea function - create the actual map */
|
||||||
static void MapArea(room_rnum room, struct char_data *ch, int x, int y, int min, int max, sh_int xpos, sh_int ypos, bool worldmap)
|
static void MapArea(const room_rnum room, const char_data *ch, const int x, const int y, // NOLINT(*-no-recursion)
|
||||||
|
const int min, const int max, const int xpos, const int ypos, const bool worldmap)
|
||||||
{
|
{
|
||||||
room_rnum prospect_room;
|
room_rnum prospect_room;
|
||||||
struct room_direction_data *pexit;
|
struct room_direction_data *pexit;
|
||||||
int door, ew_size=0, ns_size=0, x_exit_pos=0, y_exit_pos=0;
|
int door;
|
||||||
sh_int prospect_xpos, prospect_ypos;
|
const int ew_size = 0, ns_size = 0, x_exit_pos = 0, y_exit_pos = 0;
|
||||||
|
int prospect_xpos, prospect_ypos;
|
||||||
|
|
||||||
if (map[x][y] < 0)
|
if (map[x][y] < 0)
|
||||||
return; /* this is a door */
|
return; /* this is a door */
|
||||||
|
|
||||||
/* marks the room as visited */
|
/* marks the room as visited */
|
||||||
if(room == IN_ROOM(ch))
|
if (room == IN_ROOM(ch))
|
||||||
map[x][y] = SECT_HERE;
|
map[x][y] = SECT_HERE;
|
||||||
else
|
else
|
||||||
map[x][y] = SECT(room);
|
map[x][y] = SECT(room);
|
||||||
|
|
||||||
if ( (x < min) || ( y < min) || ( x > max ) || ( y > max) ) return;
|
if (x < min || y < min || x > max || y > max)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Check for exits */
|
/* Check for exits */
|
||||||
for ( door = 0; door < MAX_MAP_DIR; door++ ) {
|
for (door = 0; door < MAX_MAP_DIR; door++) {
|
||||||
|
|
||||||
if( door < MAX_MAP_FOLLOW &&
|
if (xpos + door_offsets[door][0] >= 0 &&
|
||||||
xpos+door_offsets[door][0] >= 0 &&
|
xpos + door_offsets[door][0] <= ns_size &&
|
||||||
xpos+door_offsets[door][0] <= ns_size &&
|
ypos + door_offsets[door][1] >= 0 &&
|
||||||
ypos+door_offsets[door][1] >= 0 &&
|
ypos + door_offsets[door][1] <= ew_size) { /* Virtual exit */
|
||||||
ypos+door_offsets[door][1] <= ew_size)
|
// linting tells me vdoor_marks will have an index out of bounds here, since doors can have more values than
|
||||||
{ /* Virtual exit */
|
// vdoor_marks contains. Either we're not actually getting here for those values, or we're not getting here at all.
|
||||||
|
// Adding a guard for now. --welcor 20241230
|
||||||
|
if (door < sizeof(vdoor_marks))
|
||||||
|
map[x + door_offsets[door][0]][y + door_offsets[door][1]] = vdoor_marks[door];
|
||||||
|
|
||||||
map[x+door_offsets[door][0]][y+door_offsets[door][1]] = vdoor_marks[door] ;
|
if (map[x + offsets[door][0]][y + offsets[door][1]] == SECT_EMPTY)
|
||||||
if (map[x+offsets[door][0]][y+offsets[door][1]] == SECT_EMPTY )
|
MapArea(room, ch, x + offsets[door][0], y + offsets[door][1], min, max, xpos + door_offsets[door][0],
|
||||||
MapArea(room,ch,x + offsets[door][0], y + offsets[door][1], min, max, xpos+door_offsets[door][0], ypos+door_offsets[door][1], worldmap);
|
ypos + door_offsets[door][1], worldmap);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (pexit = world[room].dir_option[door]) != NULL &&
|
if ((pexit = world[room].dir_option[door]) != NULL &&
|
||||||
(pexit->to_room > 0 ) && (pexit->to_room != NOWHERE) &&
|
pexit->to_room > 0 && pexit->to_room != NOWHERE &&
|
||||||
(!IS_SET(pexit->exit_info, EX_CLOSED)) &&
|
!IS_SET(pexit->exit_info, EX_CLOSED) &&
|
||||||
(!IS_SET(pexit->exit_info, EX_HIDDEN) || PRF_FLAGGED(ch, PRF_HOLYLIGHT)) )
|
(!IS_SET(pexit->exit_info, EX_HIDDEN) || PRF_FLAGGED(ch, PRF_HOLYLIGHT))) { /* A real exit */
|
||||||
{ /* A real exit */
|
|
||||||
|
|
||||||
/* But is the door here... */
|
/* But is the door here... */
|
||||||
switch (door) {
|
switch (door) {
|
||||||
case NORTH:
|
case NORTH:
|
||||||
if(xpos > 0 || ypos!=y_exit_pos) continue;
|
if (xpos > 0 || ypos != y_exit_pos)
|
||||||
|
continue;
|
||||||
break;
|
break;
|
||||||
case SOUTH:
|
case SOUTH:
|
||||||
if(xpos < ns_size || ypos!=y_exit_pos) continue;
|
if (xpos < ns_size || ypos != y_exit_pos)
|
||||||
|
continue;
|
||||||
break;
|
break;
|
||||||
case EAST:
|
case EAST:
|
||||||
if(ypos < ew_size || xpos!=x_exit_pos) continue;
|
if (ypos < ew_size || xpos != x_exit_pos)
|
||||||
|
continue;
|
||||||
break;
|
break;
|
||||||
case WEST:
|
case WEST:
|
||||||
if(ypos > 0 || xpos!=x_exit_pos) continue;
|
if (ypos > 0 || xpos != x_exit_pos)
|
||||||
|
continue;
|
||||||
break;
|
break;
|
||||||
case NORTHWEST:
|
case NORTHWEST:
|
||||||
if(xpos > 0 || ypos!=y_exit_pos || ypos > 0 || xpos!=x_exit_pos) continue;
|
if (xpos > 0 || ypos != y_exit_pos || ypos > 0 || xpos != x_exit_pos)
|
||||||
|
continue;
|
||||||
break;
|
break;
|
||||||
case NORTHEAST:
|
case NORTHEAST:
|
||||||
if(xpos > 0 || ypos!=y_exit_pos || ypos < ew_size || xpos!=x_exit_pos) continue;
|
if (xpos > 0 || ypos != y_exit_pos || ypos < ew_size || xpos != x_exit_pos)
|
||||||
|
continue;
|
||||||
break;
|
break;
|
||||||
case SOUTHEAST:
|
case SOUTHEAST:
|
||||||
if(xpos < ns_size || ypos!=y_exit_pos || ypos < ew_size || xpos!=x_exit_pos) continue;
|
if (xpos < ns_size || ypos != y_exit_pos || ypos < ew_size || xpos != x_exit_pos)
|
||||||
|
continue;
|
||||||
break;
|
break;
|
||||||
case SOUTHWEST:
|
case SOUTHWEST:
|
||||||
if(xpos < ns_size || ypos!=y_exit_pos || ypos > 0 || xpos!=x_exit_pos) continue;
|
if (xpos < ns_size || ypos != y_exit_pos || ypos > 0 || xpos != x_exit_pos)
|
||||||
|
continue;
|
||||||
break;
|
break;
|
||||||
|
case UP:
|
||||||
|
case DOWN:
|
||||||
|
/* no check for up/down here */
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
log("Default case reached in switch in door check in asciimap. "
|
||||||
|
"Are any directions unaccounted for? door = %d", door);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* if ( (x < min) || ( y < min) || ( x > max ) || ( y > max) ) return;*/
|
/* if ( (x < min) || ( y < min) || ( x > max ) || ( y > max) ) return;*/
|
||||||
prospect_room = pexit->to_room;
|
prospect_room = pexit->to_room;
|
||||||
|
|
||||||
/* one way into area OR maze */
|
/* one way into area OR maze */
|
||||||
if ( world[prospect_room].dir_option[rev_dir[door]] &&
|
if (world[prospect_room].dir_option[rev_dir[door]] &&
|
||||||
world[prospect_room].dir_option[rev_dir[door]]->to_room != room) {
|
world[prospect_room].dir_option[rev_dir[door]]->to_room != room) {
|
||||||
map[x][y] = SECT_STRANGE;
|
map[x][y] = SECT_STRANGE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!worldmap) {
|
if (!worldmap) {
|
||||||
if ((map[x+door_offsets[door][0]][y+door_offsets[door][1]] == DOOR_NONE) ||
|
if (map[x + door_offsets[door][0]][y + door_offsets[door][1]] == DOOR_NONE ||
|
||||||
(map[x+door_offsets[door][0]][y+door_offsets[door][1]] == SECT_EMPTY) ) {
|
map[x + door_offsets[door][0]][y + door_offsets[door][1]] == SECT_EMPTY) {
|
||||||
map[x+door_offsets[door][0]][y+door_offsets[door][1]] = door_marks[door];
|
map[x + door_offsets[door][0]][y + door_offsets[door][1]] = door_marks[door];
|
||||||
} else {
|
} else {
|
||||||
if ( ((door == NORTHEAST) && (map[x+door_offsets[door][0]][y+door_offsets[door][1]] == DOOR_UP)) ||
|
if ((door == NORTHEAST && map[x + door_offsets[door][0]][y + door_offsets[door][1]] == DOOR_UP) ||
|
||||||
((door == UP) && (map[x+door_offsets[door][0]][y+door_offsets[door][1]] == DOOR_DIAGNE)) ) {
|
(door == UP && map[x + door_offsets[door][0]][y + door_offsets[door][1]] == DOOR_DIAGNE)) {
|
||||||
map[x+door_offsets[door][0]][y+door_offsets[door][1]] = DOOR_UP_AND_NE;
|
map[x + door_offsets[door][0]][y + door_offsets[door][1]] = DOOR_UP_AND_NE;
|
||||||
}
|
} else if ((door == SOUTHEAST && map[x + door_offsets[door][0]][y + door_offsets[door][1]] == DOOR_DOWN)
|
||||||
else if ( ((door == SOUTHEAST) && (map[x+door_offsets[door][0]][y+door_offsets[door][1]] == DOOR_DOWN)) ||
|
||
|
||||||
((door == DOWN) && (map[x+door_offsets[door][0]][y+door_offsets[door][1]] == DOOR_DIAGNW)) ) {
|
(door == DOWN && map[x + door_offsets[door][0]][y + door_offsets[door][1]] == DOOR_DIAGNW)) {
|
||||||
map[x+door_offsets[door][0]][y+door_offsets[door][1]] = DOOR_DOWN_AND_SE;
|
map[x + door_offsets[door][0]][y + door_offsets[door][1]] = DOOR_DOWN_AND_SE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -324,81 +341,86 @@ static void MapArea(room_rnum room, struct char_data *ch, int x, int y, int min,
|
|||||||
case NORTH:
|
case NORTH:
|
||||||
prospect_xpos = ns_size;
|
prospect_xpos = ns_size;
|
||||||
case SOUTH:
|
case SOUTH:
|
||||||
prospect_ypos = world[prospect_room].dir_option[rev_dir[door]] ? y_exit_pos : ew_size/2;
|
prospect_ypos = world[prospect_room].dir_option[rev_dir[door]] ? y_exit_pos : ew_size / 2;
|
||||||
break;
|
break;
|
||||||
case WEST:
|
case WEST:
|
||||||
prospect_ypos = ew_size;
|
prospect_ypos = ew_size;
|
||||||
case EAST:
|
case EAST:
|
||||||
prospect_xpos = world[prospect_room].dir_option[rev_dir[door]] ? x_exit_pos : ns_size/2;
|
prospect_xpos = world[prospect_room].dir_option[rev_dir[door]] ? x_exit_pos : ns_size / 2;
|
||||||
break;
|
break;
|
||||||
case NORTHEAST:
|
case NORTHEAST:
|
||||||
case NORTHWEST:
|
case NORTHWEST:
|
||||||
case SOUTHEAST:
|
case SOUTHEAST:
|
||||||
case SOUTHWEST:
|
case SOUTHWEST:
|
||||||
prospect_xpos = world[prospect_room].dir_option[rev_dir[door]] ? x_exit_pos : ns_size/2;
|
prospect_xpos = world[prospect_room].dir_option[rev_dir[door]] ? x_exit_pos : ns_size / 2;
|
||||||
prospect_ypos = world[prospect_room].dir_option[rev_dir[door]] ? y_exit_pos : ew_size/2;
|
prospect_ypos = world[prospect_room].dir_option[rev_dir[door]] ? y_exit_pos : ew_size / 2;
|
||||||
break;
|
break;
|
||||||
|
case UP:
|
||||||
|
case DOWN:
|
||||||
|
/* no check for up/down here */
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
log("Default case reached in prospect switch in asciimap. Are any directions unaccounted for? door = %d", door);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(worldmap) {
|
if (worldmap) {
|
||||||
if ( door < MAX_MAP_FOLLOW && map[x+offsets_worldmap[door][0]][y+offsets_worldmap[door][1]] == SECT_EMPTY )
|
if (map[x + offsets_worldmap[door][0]][y + offsets_worldmap[door][1]] == SECT_EMPTY)
|
||||||
MapArea(pexit->to_room,ch,x + offsets_worldmap[door][0], y + offsets_worldmap[door][1], min, max, prospect_xpos, prospect_ypos, worldmap);
|
MapArea(pexit->to_room, ch, x + offsets_worldmap[door][0], y + offsets_worldmap[door][1], min, max,
|
||||||
|
prospect_xpos, prospect_ypos, worldmap);
|
||||||
} else {
|
} else {
|
||||||
if ( door < MAX_MAP_FOLLOW && map[x+offsets[door][0]][y+offsets[door][1]] == SECT_EMPTY )
|
if (map[x + offsets[door][0]][y + offsets[door][1]] == SECT_EMPTY)
|
||||||
MapArea(pexit->to_room,ch,x + offsets[door][0], y + offsets[door][1], min, max, prospect_xpos, prospect_ypos, worldmap);
|
MapArea(pexit->to_room, ch, x + offsets[door][0], y + offsets[door][1], min, max, prospect_xpos,
|
||||||
|
prospect_ypos, worldmap);
|
||||||
}
|
}
|
||||||
} /* end if exit there */
|
} /* end if exit there */
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns a string representation of the map */
|
/* Returns a string representation of the map */
|
||||||
|
// ReSharper disable once CppDFAConstantParameter
|
||||||
static char *StringMap(int centre, int size)
|
static char *StringMap(int centre, int size)
|
||||||
{
|
{
|
||||||
static char strmap[MAX_MAP*MAX_MAP*11 + MAX_MAP*2 + 1];
|
static char strmap[MAX_MAP * MAX_MAP * 11 + MAX_MAP * 2 + 1];
|
||||||
char *mp = strmap;
|
char *mp = strmap;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
/* every row */
|
/* every row */
|
||||||
for (x = centre - CANVAS_HEIGHT/2; x <= centre + CANVAS_HEIGHT/2; x++) {
|
for (x = centre - CANVAS_HEIGHT / 2; x <= centre + CANVAS_HEIGHT / 2; x++) {
|
||||||
/* every column */
|
/* every column */
|
||||||
for (y = centre - CANVAS_WIDTH/6; y <= centre + CANVAS_WIDTH/6; y++) {
|
for (y = centre - CANVAS_WIDTH / 6; y <= centre + CANVAS_WIDTH / 6; y++) {
|
||||||
if (abs(centre - x)<=size && abs(centre-y)<=size)
|
if (abs(centre - x) <= size && abs(centre - y) <= size)
|
||||||
tmp = (map[x][y]<0) ? \
|
tmp = map[x][y] < 0 ? door_info[NUM_DOOR_TYPES + map[x][y]].disp : map_info[map[x][y]].disp;
|
||||||
door_info[NUM_DOOR_TYPES + map[x][y]].disp : \
|
|
||||||
map_info[map[x][y]].disp ;
|
|
||||||
else
|
else
|
||||||
tmp = map_info[SECT_EMPTY].disp;
|
tmp = map_info[SECT_EMPTY].disp;
|
||||||
strcpy(mp, tmp);
|
strcpy(mp, tmp);
|
||||||
mp += strlen(tmp);
|
mp += strlen(tmp);
|
||||||
}
|
}
|
||||||
strcpy(mp, "\r\n");
|
strcpy(mp, "\r\n");
|
||||||
mp+=2;
|
mp += 2;
|
||||||
}
|
}
|
||||||
*mp='\0';
|
*mp = '\0';
|
||||||
return strmap;
|
return strmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *WorldMap(int centre, int size, int mapshape, int maptype )
|
// ReSharper disable once CppDFAConstantParameter
|
||||||
|
static char *WorldMap(int centre, int size, int mapshape, int maptype)
|
||||||
{
|
{
|
||||||
static char strmap[MAX_MAP*MAX_MAP*4 + MAX_MAP*2 + 1];
|
static char strmap[MAX_MAP * MAX_MAP * 4 + MAX_MAP * 2 + 1];
|
||||||
char *mp = strmap;
|
char *mp = strmap;
|
||||||
int x, y;
|
int x, y;
|
||||||
int xmin, xmax, ymin, ymax;
|
int xmin, xmax, ymin, ymax;
|
||||||
|
|
||||||
switch(maptype) {
|
if (maptype == MAP_COMPACT) {
|
||||||
case MAP_COMPACT:
|
xmin = centre - size;
|
||||||
xmin = centre - size;
|
xmax = centre + size;
|
||||||
xmax = centre + size;
|
ymin = centre - 2 * size;
|
||||||
ymin = centre - 2*size;
|
ymax = centre + 2 * size;
|
||||||
ymax = centre + 2*size;
|
} else {
|
||||||
break;
|
xmin = centre - CANVAS_HEIGHT / 2;
|
||||||
default:
|
xmax = centre + CANVAS_HEIGHT / 2;
|
||||||
xmin = centre - CANVAS_HEIGHT/2;
|
ymin = centre - CANVAS_WIDTH / 2;
|
||||||
xmax = centre + CANVAS_HEIGHT/2;
|
ymax = centre + CANVAS_WIDTH / 2;
|
||||||
ymin = centre - CANVAS_WIDTH/2;
|
|
||||||
ymax = centre + CANVAS_WIDTH/2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -407,26 +429,28 @@ static char *WorldMap(int centre, int size, int mapshape, int maptype )
|
|||||||
for (x = xmin; x <= xmax; x++) {
|
for (x = xmin; x <= xmax; x++) {
|
||||||
/* every column */
|
/* every column */
|
||||||
/* for (y = centre - (2*size) ; y <= centre + (2*size) ; y++) { */
|
/* for (y = centre - (2*size) ; y <= centre + (2*size) ; y++) { */
|
||||||
for (y = ymin ; y <= ymax ; y++) {
|
for (y = ymin; y <= ymax; y++) {
|
||||||
|
|
||||||
if((mapshape == MAP_RECTANGLE && abs(centre - y) <= size*2 && abs(centre - x) <= size ) ||
|
if ((mapshape == MAP_RECTANGLE && abs(centre - y) <= size * 2 && abs(centre - x) <= size) ||
|
||||||
((mapshape == MAP_CIRCLE) && (centre-x)*(centre-x) + (centre-y)*(centre-y)/4 <= (size * size + 1))) {
|
(mapshape == MAP_CIRCLE && (centre - x) * (centre - x) + (centre - y) * (centre - y) / 4 <= size * size +
|
||||||
|
1)) {
|
||||||
strcpy(mp, world_map_info[map[x][y]].disp);
|
strcpy(mp, world_map_info[map[x][y]].disp);
|
||||||
mp += strlen(world_map_info[map[x][y]].disp);
|
mp += strlen(world_map_info[map[x][y]].disp);
|
||||||
} else {
|
} else {
|
||||||
strcpy(mp++, " ");
|
strcpy(mp++, " ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
strcpy(mp, "\tn\r\n");
|
strcpy(mp, "\tn\r\n");
|
||||||
mp+=4;
|
mp += 4;
|
||||||
}
|
}
|
||||||
*mp='\0';
|
*mp = '\0';
|
||||||
return strmap;
|
return strmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReSharper disable once CppDFAConstantParameter
|
||||||
static char *CompactStringMap(int centre, int size)
|
static char *CompactStringMap(int centre, int size)
|
||||||
{
|
{
|
||||||
static char strmap[MAX_MAP*MAX_MAP*12 + MAX_MAP*2 + 1];
|
static char strmap[MAX_MAP * MAX_MAP * 12 + MAX_MAP * 2 + 1];
|
||||||
char *mp = strmap;
|
char *mp = strmap;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
@@ -434,56 +458,53 @@ static char *CompactStringMap(int centre, int size)
|
|||||||
for (x = centre - size; x <= centre + size; x++) {
|
for (x = centre - size; x <= centre + size; x++) {
|
||||||
/* every column */
|
/* every column */
|
||||||
for (y = centre - size; y <= centre + size; y++) {
|
for (y = centre - size; y <= centre + size; y++) {
|
||||||
strcpy(mp, (map[x][y]<0) ? \
|
strcpy(mp, map[x][y] < 0 ? compact_door_info[NUM_DOOR_TYPES + map[x][y]].disp : map_info[map[x][y]].disp);
|
||||||
compact_door_info[NUM_DOOR_TYPES + map[x][y]].disp : \
|
mp += strlen(map[x][y] < 0 ? compact_door_info[NUM_DOOR_TYPES + map[x][y]].disp : map_info[map[x][y]].disp);
|
||||||
map_info[map[x][y]].disp);
|
|
||||||
mp += strlen((map[x][y]<0) ? \
|
|
||||||
compact_door_info[NUM_DOOR_TYPES + map[x][y]].disp : \
|
|
||||||
map_info[map[x][y]].disp);
|
|
||||||
}
|
}
|
||||||
strcpy(mp, "\r\n");
|
strcpy(mp, "\r\n");
|
||||||
mp+=2;
|
mp += 2;
|
||||||
}
|
}
|
||||||
*mp='\0';
|
*mp = '\0';
|
||||||
return strmap;
|
return strmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display a nicely formatted map with a legend */
|
/* Display a nicely formatted map with a legend */
|
||||||
static void perform_map( struct char_data *ch, char *argument, bool worldmap )
|
static void perform_map(char_data *ch, char *argument, bool worldmap)
|
||||||
{
|
{
|
||||||
int size = DEFAULT_MAP_SIZE;
|
int size = DEFAULT_MAP_SIZE;
|
||||||
int centre, x, y, min, max;
|
int centre, x, y, min, max;
|
||||||
char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH], buf1[MAX_STRING_LENGTH], buf2[MAX_STRING_LENGTH];
|
char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH], buf1[MAX_STRING_LENGTH], buf2[
|
||||||
|
MAX_STRING_LENGTH];
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int ew_size=0, ns_size=0;
|
const int ew_size = 0, ns_size = 0;
|
||||||
int mapshape = MAP_CIRCLE;
|
int mapshape = MAP_CIRCLE;
|
||||||
|
|
||||||
two_arguments( argument, arg1 , arg2 );
|
two_arguments(argument, arg1, arg2);
|
||||||
if(*arg1)
|
if (*arg1) {
|
||||||
{
|
size = parse_int(arg1);
|
||||||
size = atoi(arg1);
|
|
||||||
}
|
}
|
||||||
if (*arg2)
|
if (*arg2) {
|
||||||
{
|
if (is_abbrev(arg2, "normal"))
|
||||||
if (is_abbrev(arg2, "normal")) worldmap=FALSE;
|
worldmap = FALSE;
|
||||||
else if (is_abbrev(arg2, "world")) worldmap=TRUE;
|
else if (is_abbrev(arg2, "world"))
|
||||||
|
worldmap = TRUE;
|
||||||
else {
|
else {
|
||||||
send_to_char(ch, "Usage: \tymap <distance> [ normal | world ]\tn");
|
send_to_char(ch, "Usage: \tymap <distance> [ normal | world ]\tn");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(size<0) {
|
if (size < 0) {
|
||||||
size = -size;
|
size = -size;
|
||||||
mapshape = MAP_RECTANGLE;
|
mapshape = MAP_RECTANGLE;
|
||||||
}
|
}
|
||||||
size = URANGE(1,size,MAX_MAP_SIZE);
|
size = URANGE(1, size, MAX_MAP_SIZE);
|
||||||
|
|
||||||
centre = MAX_MAP/2;
|
centre = MAX_MAP / 2;
|
||||||
|
|
||||||
if(worldmap) {
|
if (worldmap) {
|
||||||
min = centre - 2*size;
|
min = centre - 2 * size;
|
||||||
max = centre + 2*size;
|
max = centre + 2 * size;
|
||||||
} else {
|
} else {
|
||||||
min = centre - size;
|
min = centre - size;
|
||||||
max = centre + size;
|
max = centre + size;
|
||||||
@@ -491,19 +512,19 @@ static void perform_map( struct char_data *ch, char *argument, bool worldmap )
|
|||||||
|
|
||||||
/* Blank the map */
|
/* Blank the map */
|
||||||
for (x = 0; x < MAX_MAP; ++x)
|
for (x = 0; x < MAX_MAP; ++x)
|
||||||
for (y = 0; y < MAX_MAP; ++y)
|
for (y = 0; y < MAX_MAP; ++y)
|
||||||
map[x][y]= (!(y%2) && !worldmap) ? DOOR_NONE : SECT_EMPTY;
|
map[x][y] = !(y % 2) && !worldmap ? DOOR_NONE : SECT_EMPTY;
|
||||||
|
|
||||||
/* starts the mapping with the centre room */
|
/* starts the mapping with the centre room */
|
||||||
MapArea(IN_ROOM(ch), ch, centre, centre, min, max, ns_size/2, ew_size/2, worldmap);
|
MapArea(IN_ROOM(ch), ch, centre, centre, min, max, ns_size / 2, ew_size / 2, worldmap);
|
||||||
|
|
||||||
/* marks the center, where ch is */
|
/* marks the center, where ch is */
|
||||||
map[centre][centre] = SECT_HERE;
|
map[centre][centre] = SECT_HERE;
|
||||||
|
|
||||||
/* Feel free to put your own MUD name or header in here */
|
/* Feel free to put your own MUD name or header in here */
|
||||||
send_to_char(ch, " \tY-\tytbaMUD Map System\tY-\tn\r\n"
|
send_to_char(ch, " \tY-\tytbaMUD Map System\tY-\tn\r\n"
|
||||||
"\tD .-.__--.,--.__.-.\tn\r\n" );
|
"\tD .-.__--.,--.__.-.\tn\r\n");
|
||||||
|
// TODO switch to snprintf
|
||||||
count += sprintf(buf + count, "\tn\tn\tn%s Up\\\\", door_info[NUM_DOOR_TYPES + DOOR_UP].disp);
|
count += sprintf(buf + count, "\tn\tn\tn%s Up\\\\", door_info[NUM_DOOR_TYPES + DOOR_UP].disp);
|
||||||
count += sprintf(buf + count, "\tn\tn\tn%s Down\\\\", door_info[NUM_DOOR_TYPES + DOOR_DOWN].disp);
|
count += sprintf(buf + count, "\tn\tn\tn%s Down\\\\", door_info[NUM_DOOR_TYPES + DOOR_DOWN].disp);
|
||||||
count += sprintf(buf + count, "\tn%s You\\\\", map_info[SECT_HERE].disp);
|
count += sprintf(buf + count, "\tn%s You\\\\", map_info[SECT_HERE].disp);
|
||||||
@@ -521,18 +542,18 @@ static void perform_map( struct char_data *ch, char *argument, bool worldmap )
|
|||||||
strcpy(buf, strfrmt(buf, LEGEND_WIDTH, CANVAS_HEIGHT + 2, FALSE, TRUE, TRUE));
|
strcpy(buf, strfrmt(buf, LEGEND_WIDTH, CANVAS_HEIGHT + 2, FALSE, TRUE, TRUE));
|
||||||
|
|
||||||
/* Start with an empty column */
|
/* Start with an empty column */
|
||||||
strcpy(buf1, strfrmt("",0, CANVAS_HEIGHT + 2, FALSE, FALSE, TRUE));
|
strcpy(buf1, strfrmt("", 0, CANVAS_HEIGHT + 2, FALSE, FALSE, TRUE));
|
||||||
|
|
||||||
/* Paste the legend */
|
/* Paste the legend */
|
||||||
strcpy(buf2, strpaste(buf1, buf, "\tD | \tn"));
|
strcpy(buf2, strpaste(buf1, buf, "\tD | \tn"));
|
||||||
|
|
||||||
/* Set up the map */
|
/* Set up the map */
|
||||||
memset(buf, ' ', CANVAS_WIDTH);
|
memset(buf, ' ', CANVAS_WIDTH);
|
||||||
count = (CANVAS_WIDTH);
|
count = CANVAS_WIDTH;
|
||||||
if(worldmap)
|
if (worldmap)
|
||||||
count += sprintf(buf + count , "\r\n%s", WorldMap(centre, size, mapshape, MAP_NORMAL));
|
count += sprintf(buf + count, "\r\n%s", WorldMap(centre, size, mapshape, MAP_NORMAL));
|
||||||
else
|
else
|
||||||
count += sprintf(buf + count , "\r\n%s", StringMap(centre, size));
|
count += sprintf(buf + count, "\r\n%s", StringMap(centre, size));
|
||||||
memset(buf + count, ' ', CANVAS_WIDTH);
|
memset(buf + count, ' ', CANVAS_WIDTH);
|
||||||
strcpy(buf + count + CANVAS_WIDTH, "\r\n");
|
strcpy(buf + count + CANVAS_WIDTH, "\r\n");
|
||||||
/* Paste it on */
|
/* Paste it on */
|
||||||
@@ -543,13 +564,13 @@ static void perform_map( struct char_data *ch, char *argument, bool worldmap )
|
|||||||
send_to_char(ch, "%s", buf2);
|
send_to_char(ch, "%s", buf2);
|
||||||
|
|
||||||
send_to_char(ch, "\tD `.-.__--.,-.__.-.-'\tn\r\n");
|
send_to_char(ch, "\tD `.-.__--.,-.__.-.-'\tn\r\n");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display a string with the map beside it */
|
/* Display a string with the map beside it */
|
||||||
void str_and_map(char *str, struct char_data *ch, room_vnum target_room ) {
|
void str_and_map(char *str, char_data *ch, room_vnum target_room)
|
||||||
|
{
|
||||||
int size, centre, x, y, min, max, char_size;
|
int size, centre, x, y, min, max, char_size;
|
||||||
int ew_size=0, ns_size=0;
|
int ew_size = 0, ns_size = 0;
|
||||||
bool worldmap;
|
bool worldmap;
|
||||||
|
|
||||||
/* Check MUDs map config options - if disabled, just show room decsription */
|
/* Check MUDs map config options - if disabled, just show room decsription */
|
||||||
@@ -560,48 +581,54 @@ void str_and_map(char *str, struct char_data *ch, room_vnum target_room ) {
|
|||||||
|
|
||||||
worldmap = show_worldmap(ch);
|
worldmap = show_worldmap(ch);
|
||||||
|
|
||||||
if(!PRF_FLAGGED(ch, PRF_AUTOMAP)) {
|
if (!PRF_FLAGGED(ch, PRF_AUTOMAP)) {
|
||||||
send_to_char(ch, "%s", strfrmt(str, GET_SCREEN_WIDTH(ch), 1, FALSE, FALSE, FALSE));
|
send_to_char(ch, "%s", strfrmt(str, GET_SCREEN_WIDTH(ch), 1, FALSE, FALSE, FALSE));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
size = CONFIG_MINIMAP_SIZE;
|
size = CONFIG_MINIMAP_SIZE;
|
||||||
centre = MAX_MAP/2;
|
centre = MAX_MAP / 2;
|
||||||
min = centre - 2*size;
|
min = centre - 2 * size;
|
||||||
max = centre + 2*size;
|
max = centre + 2 * size;
|
||||||
|
|
||||||
for (x = 0; x < MAX_MAP; ++x)
|
for (x = 0; x < MAX_MAP; ++x)
|
||||||
for (y = 0; y < MAX_MAP; ++y)
|
for (y = 0; y < MAX_MAP; ++y)
|
||||||
map[x][y]= (!(y%2) && !worldmap) ? DOOR_NONE : SECT_EMPTY;
|
map[x][y] = !(y % 2) && !worldmap ? DOOR_NONE : SECT_EMPTY;
|
||||||
|
|
||||||
/* starts the mapping with the center room */
|
/* starts the mapping with the center room */
|
||||||
MapArea(target_room, ch, centre, centre, min, max, ns_size/2, ew_size/2, worldmap );
|
MapArea(target_room, ch, centre, centre, min, max, ns_size / 2, ew_size / 2, worldmap);
|
||||||
map[centre][centre] = SECT_HERE;
|
map[centre][centre] = SECT_HERE;
|
||||||
|
|
||||||
/* char_size = rooms + doors + padding */
|
/* char_size = rooms + doors + padding */
|
||||||
if(worldmap)
|
if (worldmap)
|
||||||
char_size = size * 4 + 5;
|
char_size = size * 4 + 5;
|
||||||
else
|
else
|
||||||
char_size = 3*(size+1) + (size) + 4;
|
char_size = 3 * (size + 1) + size + 4;
|
||||||
|
|
||||||
if(worldmap)
|
if (worldmap)
|
||||||
send_to_char(ch, "%s", strpaste(strfrmt(str, GET_SCREEN_WIDTH(ch) - char_size, size*2 + 1, FALSE, TRUE, TRUE), WorldMap(centre, size, MAP_CIRCLE, MAP_COMPACT), " \tn"));
|
send_to_char(ch, "%s", strpaste(strfrmt(str, GET_SCREEN_WIDTH(ch) - char_size, size * 2 + 1, FALSE, TRUE, TRUE),
|
||||||
|
WorldMap(centre, size, MAP_CIRCLE, MAP_COMPACT), " \tn"));
|
||||||
else
|
else
|
||||||
send_to_char(ch, "%s", strpaste(strfrmt(str, GET_SCREEN_WIDTH(ch) - char_size, size*2 + 1, FALSE, TRUE, TRUE), CompactStringMap(centre, size), " \tn"));
|
send_to_char(ch, "%s", strpaste(strfrmt(str, GET_SCREEN_WIDTH(ch) - char_size, size * 2 + 1, FALSE, TRUE, TRUE),
|
||||||
|
CompactStringMap(centre, size), " \tn"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool show_worldmap(struct char_data *ch) {
|
static bool show_worldmap(const char_data *ch)
|
||||||
|
{
|
||||||
room_rnum rm = IN_ROOM(ch);
|
room_rnum rm = IN_ROOM(ch);
|
||||||
zone_rnum zn = GET_ROOM_ZONE(rm);
|
zone_rnum zn = GET_ROOM_ZONE(rm);
|
||||||
|
|
||||||
if (ROOM_FLAGGED(rm, ROOM_WORLDMAP)) return TRUE;
|
if (ROOM_FLAGGED(rm, ROOM_WORLDMAP))
|
||||||
if (ZONE_FLAGGED(zn, ZONE_WORLDMAP)) return TRUE;
|
return TRUE;
|
||||||
|
if (ZONE_FLAGGED(zn, ZONE_WORLDMAP))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ACMD(do_map) {
|
ACMD(do_map)
|
||||||
|
{
|
||||||
if (!can_see_map(ch)) {
|
if (!can_see_map(ch)) {
|
||||||
send_to_char(ch, "Sorry, the map is disabled!\r\n");
|
send_to_char(ch, "Sorry, the map is disabled!\r\n");
|
||||||
return;
|
return;
|
||||||
|
|||||||
+2
-2
@@ -16,8 +16,8 @@
|
|||||||
#define MAP_IMM_ONLY 2
|
#define MAP_IMM_ONLY 2
|
||||||
|
|
||||||
/* Exported function prototypes */
|
/* Exported function prototypes */
|
||||||
bool can_see_map(struct char_data *ch);
|
bool can_see_map(const char_data *ch);
|
||||||
void str_and_map(char *str, struct char_data *ch, room_vnum target_room );
|
void str_and_map(char *str, char_data *ch, room_vnum target_room);
|
||||||
ACMD(do_map);
|
ACMD(do_map);
|
||||||
|
|
||||||
#endif /* ASCIIMAP_H_*/
|
#endif /* ASCIIMAP_H_*/
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
#include "interpreter.h"
|
#include "interpreter.h"
|
||||||
#include "handler.h"
|
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "ban.h"
|
#include "ban.h"
|
||||||
|
|
||||||
@@ -28,44 +27,44 @@ static char *invalid_list[MAX_INVALID_NAMES];
|
|||||||
|
|
||||||
/* local utility functions */
|
/* local utility functions */
|
||||||
static void write_ban_list(void);
|
static void write_ban_list(void);
|
||||||
static void _write_one_node(FILE *fp, struct ban_list_element *node);
|
static void write_one_node(FILE *fp, struct ban_list_element *node);
|
||||||
|
|
||||||
static const char *ban_types[] = {
|
static const char *ban_types[] = {
|
||||||
"no",
|
"no",
|
||||||
"new",
|
"new",
|
||||||
"select",
|
"select",
|
||||||
"all",
|
"all",
|
||||||
"ERROR"
|
"ERROR"
|
||||||
};
|
};
|
||||||
|
|
||||||
void load_banned(void)
|
void load_banned(void)
|
||||||
{
|
{
|
||||||
FILE *fl;
|
FILE *fl;
|
||||||
int i, date;
|
int i;
|
||||||
char site_name[BANNED_SITE_LENGTH + 1], ban_type[100];
|
char site_name[BANNED_SITE_LENGTH + 1], ban_type[100];
|
||||||
char name[MAX_NAME_LENGTH + 1];
|
char name[MAX_NAME_LENGTH + 1], date_str[30];
|
||||||
struct ban_list_element *next_node;
|
struct ban_list_element *next_node;
|
||||||
|
|
||||||
ban_list = 0;
|
ban_list = 0;
|
||||||
|
|
||||||
if (!(fl = fopen(BAN_FILE, "r"))) {
|
if ((fl = fopen(BAN_FILE, "r")) != NULL) {
|
||||||
if (errno != ENOENT) {
|
if (errno != ENOENT) {
|
||||||
log("SYSERR: Unable to open banfile '%s': %s", BAN_FILE, strerror(errno));
|
log("SYSERR: Unable to open banfile '%s': %s", BAN_FILE, strerror(errno));
|
||||||
} else
|
} else
|
||||||
log(" Ban file '%s' doesn't exist.", BAN_FILE);
|
log(" Ban file '%s' doesn't exist.", BAN_FILE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
while (fscanf(fl, " %s %s %d %s ", ban_type, site_name, &date, name) == 4) {
|
while (fscanf(fl, " %s %s %s %s ", ban_type, site_name, date_str, name) == 4) {
|
||||||
CREATE(next_node, struct ban_list_element, 1);
|
CREATE(next_node, struct ban_list_element, 1);
|
||||||
strncpy(next_node->site, site_name, BANNED_SITE_LENGTH); /* strncpy: OK (n_n->site:BANNED_SITE_LENGTH+1) */
|
strncpy(next_node->site, site_name, BANNED_SITE_LENGTH); /* strncpy: OK (n_n->site:BANNED_SITE_LENGTH+1) */
|
||||||
next_node->site[BANNED_SITE_LENGTH] = '\0';
|
next_node->site[BANNED_SITE_LENGTH] = '\0';
|
||||||
strncpy(next_node->name, name, MAX_NAME_LENGTH); /* strncpy: OK (n_n->name:MAX_NAME_LENGTH+1) */
|
strncpy(next_node->name, name, MAX_NAME_LENGTH); /* strncpy: OK (n_n->name:MAX_NAME_LENGTH+1) */
|
||||||
next_node->name[MAX_NAME_LENGTH] = '\0';
|
next_node->name[MAX_NAME_LENGTH] = '\0';
|
||||||
next_node->date = date;
|
next_node->date = parse_int(date_str);
|
||||||
|
|
||||||
for (i = BAN_NOT; i <= BAN_ALL; i++)
|
for (i = BAN_NOT; i <= BAN_ALL; i++)
|
||||||
if (!strcmp(ban_type, ban_types[i]))
|
if (!strcmp(ban_type, ban_types[i]))
|
||||||
next_node->type = i;
|
next_node->type = i;
|
||||||
|
|
||||||
next_node->next = ban_list;
|
next_node->next = ban_list;
|
||||||
ban_list = next_node;
|
ban_list = next_node;
|
||||||
@@ -81,25 +80,25 @@ int isbanned(char *hostname)
|
|||||||
char *nextchar;
|
char *nextchar;
|
||||||
|
|
||||||
if (!hostname || !*hostname)
|
if (!hostname || !*hostname)
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
for (nextchar = hostname; *nextchar; nextchar++)
|
for (nextchar = hostname; *nextchar; nextchar++)
|
||||||
*nextchar = LOWER(*nextchar);
|
*nextchar = LOWER(*nextchar);
|
||||||
|
|
||||||
for (banned_node = ban_list; banned_node; banned_node = banned_node->next)
|
for (banned_node = ban_list; banned_node; banned_node = banned_node->next)
|
||||||
if (strstr(hostname, banned_node->site)) /* if hostname is a substring */
|
if (strstr(hostname, banned_node->site)) /* if hostname is a substring */
|
||||||
i = MAX(i, banned_node->type);
|
i = MAX(i, banned_node->type);
|
||||||
|
|
||||||
return (i);
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _write_one_node(FILE *fp, struct ban_list_element *node)
|
static void write_one_node(FILE *fp, struct ban_list_element *node) // NOLINT(*-no-recursion)
|
||||||
{
|
{
|
||||||
if (node) {
|
if (node) {
|
||||||
_write_one_node(fp, node->next);
|
write_one_node(fp, node->next);
|
||||||
fprintf(fp, "%s %s %ld %s\n", ban_types[node->type],
|
fprintf(fp, "%s %s %ld %s\n", ban_types[node->type],
|
||||||
node->site, (long) node->date, node->name);
|
node->site, node->date, node->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,13 +106,12 @@ static void write_ban_list(void)
|
|||||||
{
|
{
|
||||||
FILE *fl;
|
FILE *fl;
|
||||||
|
|
||||||
if (!(fl = fopen(BAN_FILE, "w"))) {
|
if ((fl = fopen(BAN_FILE, "w")) == NULL) {
|
||||||
perror("SYSERR: Unable to open '" BAN_FILE "' for writing");
|
perror("SYSERR: Unable to open '" BAN_FILE "' for writing");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_write_one_node(fl, ban_list);/* recursively write from end to start */
|
write_one_node(fl, ban_list); /* recursively write from end to start */
|
||||||
fclose(fl);
|
fclose(fl);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define BAN_LIST_FORMAT "%-25.25s %-8.8s %-15.15s %-16.16s\r\n"
|
#define BAN_LIST_FORMAT "%-25.25s %-8.8s %-15.15s %-16.16s\r\n"
|
||||||
@@ -130,21 +128,21 @@ ACMD(do_ban)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
send_to_char(ch, BAN_LIST_FORMAT,
|
send_to_char(ch, BAN_LIST_FORMAT,
|
||||||
"Banned Site Name",
|
"Banned Site Name",
|
||||||
"Ban Type",
|
"Ban Type",
|
||||||
"Banned On",
|
"Banned On",
|
||||||
"Banned By");
|
"Banned By");
|
||||||
send_to_char(ch, BAN_LIST_FORMAT,
|
send_to_char(ch, BAN_LIST_FORMAT,
|
||||||
"---------------------------------",
|
"---------------------------------",
|
||||||
"---------------------------------",
|
"---------------------------------",
|
||||||
"---------------------------------",
|
"---------------------------------",
|
||||||
"---------------------------------");
|
"---------------------------------");
|
||||||
|
|
||||||
for (ban_node = ban_list; ban_node; ban_node = ban_node->next) {
|
for (ban_node = ban_list; ban_node; ban_node = ban_node->next) {
|
||||||
if (ban_node->date) {
|
if (ban_node->date) {
|
||||||
strftime(timestr, sizeof(timestr), "%a %b %d %Y", localtime(&(ban_node->date)));
|
strftime(timestr, sizeof(timestr), "%a %b %d %Y", localtime(&(ban_node->date)));
|
||||||
} else
|
} else
|
||||||
strcpy(timestr, "Unknown"); /* strcpy: OK (strlen("Unknown") < 16) */
|
strcpy(timestr, "Unknown"); /* strcpy: OK (strlen("Unknown") < 16) */
|
||||||
|
|
||||||
send_to_char(ch, BAN_LIST_FORMAT, ban_node->site, ban_types[ban_node->type], timestr, ban_node->name);
|
send_to_char(ch, BAN_LIST_FORMAT, ban_node->site, ban_types[ban_node->type], timestr, ban_node->name);
|
||||||
}
|
}
|
||||||
@@ -168,11 +166,11 @@ ACMD(do_ban)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CREATE(ban_node, struct ban_list_element, 1);
|
CREATE(ban_node, struct ban_list_element, 1);
|
||||||
strncpy(ban_node->site, site, BANNED_SITE_LENGTH); /* strncpy: OK (b_n->site:BANNED_SITE_LENGTH+1) */
|
strncpy(ban_node->site, site, BANNED_SITE_LENGTH); /* strncpy: OK (b_n->site:BANNED_SITE_LENGTH+1) */
|
||||||
ban_node->site[BANNED_SITE_LENGTH] = '\0';
|
ban_node->site[BANNED_SITE_LENGTH] = '\0';
|
||||||
for (nextchar = ban_node->site; *nextchar; nextchar++)
|
for (nextchar = ban_node->site; *nextchar; nextchar++)
|
||||||
*nextchar = LOWER(*nextchar);
|
*nextchar = LOWER(*nextchar);
|
||||||
strncpy(ban_node->name, GET_NAME(ch), MAX_NAME_LENGTH); /* strncpy: OK (b_n->size:MAX_NAME_LENGTH+1) */
|
strncpy(ban_node->name, GET_NAME(ch), MAX_NAME_LENGTH); /* strncpy: OK (b_n->size:MAX_NAME_LENGTH+1) */
|
||||||
ban_node->name[MAX_NAME_LENGTH] = '\0';
|
ban_node->name[MAX_NAME_LENGTH] = '\0';
|
||||||
ban_node->date = time(0);
|
ban_node->date = time(0);
|
||||||
|
|
||||||
@@ -184,7 +182,7 @@ ACMD(do_ban)
|
|||||||
ban_list = ban_node;
|
ban_list = ban_node;
|
||||||
|
|
||||||
mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "%s has banned %s for %s players.",
|
mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "%s has banned %s for %s players.",
|
||||||
GET_NAME(ch), site, ban_types[ban_node->type]);
|
GET_NAME(ch), site, ban_types[ban_node->type]);
|
||||||
send_to_char(ch, "Site banned.\r\n");
|
send_to_char(ch, "Site banned.\r\n");
|
||||||
write_ban_list();
|
write_ban_list();
|
||||||
}
|
}
|
||||||
@@ -216,19 +214,19 @@ ACMD(do_unban)
|
|||||||
REMOVE_FROM_LIST(ban_node, ban_list, next);
|
REMOVE_FROM_LIST(ban_node, ban_list, next);
|
||||||
send_to_char(ch, "Site unbanned.\r\n");
|
send_to_char(ch, "Site unbanned.\r\n");
|
||||||
mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "%s removed the %s-player ban on %s.",
|
mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "%s removed the %s-player ban on %s.",
|
||||||
GET_NAME(ch), ban_types[ban_node->type], ban_node->site);
|
// ReSharper disable once CppDFANullDereference
|
||||||
|
GET_NAME(ch), ban_types[ban_node->type], ban_node->site);
|
||||||
|
|
||||||
free(ban_node);
|
free(ban_node);
|
||||||
write_ban_list();
|
write_ban_list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Check for invalid names (i.e., profanity, etc.) Written by Sharon P Garza. */
|
/* Check for invalid names (i.e., profanity, etc.) Written by Sharon P Garza. */
|
||||||
int valid_name(char *newname)
|
int valid_name(const char *newname)
|
||||||
{
|
{
|
||||||
int i, vowels = 0;
|
int i, vowels = 0;
|
||||||
struct descriptor_data *dt;
|
descriptor_data *dt;
|
||||||
char tempname[MAX_INPUT_LENGTH];
|
char tempname[MAX_INPUT_LENGTH];
|
||||||
|
|
||||||
/* Make sure someone isn't trying to create this same name. We want to do a
|
/* Make sure someone isn't trying to create this same name. We want to do a
|
||||||
@@ -290,7 +288,7 @@ void read_invalid_list(void)
|
|||||||
FILE *fp;
|
FILE *fp;
|
||||||
char temp[256];
|
char temp[256];
|
||||||
|
|
||||||
if (!(fp = fopen(XNAME_FILE, "r"))) {
|
if ((fp = fopen(XNAME_FILE, "r")) != NULL) {
|
||||||
perror("SYSERR: Unable to open '" XNAME_FILE "' for reading");
|
perror("SYSERR: Unable to open '" XNAME_FILE "' for reading");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,18 +26,18 @@
|
|||||||
|
|
||||||
#define BANNED_SITE_LENGTH 50
|
#define BANNED_SITE_LENGTH 50
|
||||||
struct ban_list_element {
|
struct ban_list_element {
|
||||||
char site[BANNED_SITE_LENGTH+1];
|
char site[BANNED_SITE_LENGTH+1];
|
||||||
int type;
|
int type;
|
||||||
time_t date;
|
time_t date;
|
||||||
char name[MAX_NAME_LENGTH+1];
|
char name[MAX_NAME_LENGTH+1];
|
||||||
struct ban_list_element *next;
|
struct ban_list_element *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Global functions */
|
/* Global functions */
|
||||||
/* Utility Functions */
|
/* Utility Functions */
|
||||||
void load_banned(void);
|
void load_banned(void);
|
||||||
int isbanned(char *hostname);
|
int isbanned(char *hostname);
|
||||||
int valid_name(char *newname);
|
int valid_name(const char *newname);
|
||||||
void read_invalid_list(void);
|
void read_invalid_list(void);
|
||||||
void free_invalid_list(void);
|
void free_invalid_list(void);
|
||||||
/* Command functions without subcommands */
|
/* Command functions without subcommands */
|
||||||
|
|||||||
+97
-95
@@ -46,13 +46,13 @@
|
|||||||
/* Format: vnum, read lvl, write lvl, remove lvl, filename, 0 at end. Be sure
|
/* Format: vnum, read lvl, write lvl, remove lvl, filename, 0 at end. Be sure
|
||||||
* to also change NUM_OF_BOARDS in board.h*/
|
* to also change NUM_OF_BOARDS in board.h*/
|
||||||
struct board_info_type board_info[NUM_OF_BOARDS] = {
|
struct board_info_type board_info[NUM_OF_BOARDS] = {
|
||||||
{3099, 0, 0, LVL_GOD, LIB_ETC "board.mortal", 0},
|
{3099, 0, 0, LVL_GOD, LIB_ETC "board.mortal", 0},
|
||||||
{3098, LVL_IMMORT, LVL_IMMORT, LVL_GRGOD, LIB_ETC "board.immortal", 0},
|
{3098, LVL_IMMORT, LVL_IMMORT, LVL_GRGOD, LIB_ETC "board.immortal", 0},
|
||||||
{3097, LVL_IMMORT, LVL_GRGOD, LVL_IMPL, LIB_ETC "board.freeze", 0},
|
{3097, LVL_IMMORT, LVL_GRGOD, LVL_IMPL, LIB_ETC "board.freeze", 0},
|
||||||
{3096, 0, 0, LVL_IMMORT, LIB_ETC "board.social", 0},
|
{3096, 0, 0, LVL_IMMORT, LIB_ETC "board.social", 0},
|
||||||
{1226, 0, 0, LVL_IMPL, LIB_ETC "board.builder", 0},
|
{1226, 0, 0, LVL_IMPL, LIB_ETC "board.builder", 0},
|
||||||
{1227, 0, 0, LVL_IMPL, LIB_ETC "board.staff", 0},
|
{1227, 0, 0, LVL_IMPL, LIB_ETC "board.staff", 0},
|
||||||
{1228, 0, 0, LVL_IMPL, LIB_ETC "board.advertising", 0},
|
{1228, 0, 0, LVL_IMPL, LIB_ETC "board.advertising", 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
/* local (file scope) global variables */
|
/* local (file scope) global variables */
|
||||||
@@ -63,7 +63,7 @@ static struct board_msginfo msg_index[NUM_OF_BOARDS][MAX_BOARD_MESSAGES];
|
|||||||
|
|
||||||
/* local static utility functions */
|
/* local static utility functions */
|
||||||
static int find_slot(void);
|
static int find_slot(void);
|
||||||
static int find_board(struct char_data *ch);
|
static int find_board(const char_data *ch);
|
||||||
static void init_boards(void);
|
static void init_boards(void);
|
||||||
static void board_reset_board(int board_type);
|
static void board_reset_board(int board_type);
|
||||||
static void board_clear_board(int board_type);
|
static void board_clear_board(int board_type);
|
||||||
@@ -75,29 +75,29 @@ static int find_slot(void)
|
|||||||
for (i = 0; i < INDEX_SIZE; i++)
|
for (i = 0; i < INDEX_SIZE; i++)
|
||||||
if (!msg_storage_taken[i]) {
|
if (!msg_storage_taken[i]) {
|
||||||
msg_storage_taken[i] = 1;
|
msg_storage_taken[i] = 1;
|
||||||
return (i);
|
return i;
|
||||||
}
|
}
|
||||||
return (-1);
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* search the room ch is standing in to find which board he's looking at */
|
/* search the room ch is standing in to find which board he's looking at */
|
||||||
static int find_board(struct char_data *ch)
|
static int find_board(const char_data *ch)
|
||||||
{
|
{
|
||||||
struct obj_data *obj;
|
obj_data *obj;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (obj = world[IN_ROOM(ch)].contents; obj; obj = obj->next_content)
|
for (obj = world[IN_ROOM(ch)].contents; obj; obj = obj->next_content)
|
||||||
for (i = 0; i < NUM_OF_BOARDS; i++)
|
for (i = 0; i < NUM_OF_BOARDS; i++)
|
||||||
if (BOARD_RNUM(i) == GET_OBJ_RNUM(obj))
|
if (BOARD_RNUM(i) == GET_OBJ_RNUM(obj))
|
||||||
return (i);
|
return i;
|
||||||
|
|
||||||
if (GET_LEVEL(ch) >= LVL_IMMORT)
|
if (GET_LEVEL(ch) >= LVL_IMMORT)
|
||||||
for (obj = ch->carrying; obj; obj = obj->next_content)
|
for (obj = ch->carrying; obj; obj = obj->next_content)
|
||||||
for (i = 0; i < NUM_OF_BOARDS; i++)
|
for (i = 0; i < NUM_OF_BOARDS; i++)
|
||||||
if (BOARD_RNUM(i) == GET_OBJ_RNUM(obj))
|
if (BOARD_RNUM(i) == GET_OBJ_RNUM(obj))
|
||||||
return (i);
|
return i;
|
||||||
|
|
||||||
return (-1);
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void init_boards(void)
|
static void init_boards(void)
|
||||||
@@ -112,12 +112,12 @@ static void init_boards(void)
|
|||||||
for (i = 0; i < NUM_OF_BOARDS; i++) {
|
for (i = 0; i < NUM_OF_BOARDS; i++) {
|
||||||
if ((BOARD_RNUM(i) = real_object(BOARD_VNUM(i))) == NOTHING) {
|
if ((BOARD_RNUM(i) = real_object(BOARD_VNUM(i))) == NOTHING) {
|
||||||
log("SYSERR: Fatal board error: board vnum %d does not exist!",
|
log("SYSERR: Fatal board error: board vnum %d does not exist!",
|
||||||
BOARD_VNUM(i));
|
BOARD_VNUM(i));
|
||||||
fatal_error = 1;
|
fatal_error = 1;
|
||||||
}
|
}
|
||||||
num_of_msgs[i] = 0;
|
num_of_msgs[i] = 0;
|
||||||
for (j = 0; j < MAX_BOARD_MESSAGES; j++) {
|
for (j = 0; j < MAX_BOARD_MESSAGES; j++) {
|
||||||
memset((char *) &(msg_index[i][j]), 0, sizeof(struct board_msginfo));
|
memset((char *)&msg_index[i][j], 0, sizeof(struct board_msginfo));
|
||||||
msg_index[i][j].slot_num = -1;
|
msg_index[i][j].slot_num = -1;
|
||||||
}
|
}
|
||||||
board_load_board(i);
|
board_load_board(i);
|
||||||
@@ -131,7 +131,7 @@ SPECIAL(gen_board)
|
|||||||
{
|
{
|
||||||
int board_type;
|
int board_type;
|
||||||
static int loaded = 0;
|
static int loaded = 0;
|
||||||
struct obj_data *board = (struct obj_data *)me;
|
obj_data *board = (obj_data *)me;
|
||||||
|
|
||||||
/* These were originally globals for some unknown reason. */
|
/* These were originally globals for some unknown reason. */
|
||||||
int ACMD_READ, ACMD_LOOK, ACMD_EXAMINE, ACMD_WRITE, ACMD_REMOVE;
|
int ACMD_READ, ACMD_LOOK, ACMD_EXAMINE, ACMD_WRITE, ACMD_REMOVE;
|
||||||
@@ -141,7 +141,7 @@ SPECIAL(gen_board)
|
|||||||
loaded = 1;
|
loaded = 1;
|
||||||
}
|
}
|
||||||
if (!ch->desc)
|
if (!ch->desc)
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
ACMD_READ = find_command("read");
|
ACMD_READ = find_command("read");
|
||||||
ACMD_WRITE = find_command("write");
|
ACMD_WRITE = find_command("write");
|
||||||
@@ -151,41 +151,42 @@ SPECIAL(gen_board)
|
|||||||
|
|
||||||
if (cmd != ACMD_WRITE && cmd != ACMD_LOOK && cmd != ACMD_EXAMINE &&
|
if (cmd != ACMD_WRITE && cmd != ACMD_LOOK && cmd != ACMD_EXAMINE &&
|
||||||
cmd != ACMD_READ && cmd != ACMD_REMOVE)
|
cmd != ACMD_READ && cmd != ACMD_REMOVE)
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
if ((board_type = find_board(ch)) == -1) {
|
if ((board_type = find_board(ch)) == -1) {
|
||||||
log("SYSERR: degenerate board! (what the hell...)");
|
log("SYSERR: degenerate board! (what the hell...)");
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
if (cmd == ACMD_WRITE)
|
if (cmd == ACMD_WRITE)
|
||||||
return (board_write_message(board_type, ch, argument, board));
|
return board_write_message(board_type, ch, argument, board);
|
||||||
else if (cmd == ACMD_LOOK || cmd == ACMD_EXAMINE)
|
if (cmd == ACMD_LOOK || cmd == ACMD_EXAMINE)
|
||||||
return (board_show_board(board_type, ch, argument, board));
|
return board_show_board(board_type, ch, argument, board);
|
||||||
else if (cmd == ACMD_READ)
|
if (cmd == ACMD_READ)
|
||||||
return (board_display_msg(board_type, ch, argument, board));
|
return board_display_msg(board_type, ch, argument, board);
|
||||||
else if (cmd == ACMD_REMOVE)
|
if (cmd == ACMD_REMOVE)
|
||||||
return (board_remove_msg(board_type, ch, argument, board));
|
return board_remove_msg(board_type, ch, argument, board);
|
||||||
else
|
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int board_write_message(int board_type, struct char_data *ch, char *arg, struct obj_data *board)
|
// ReSharper disable once CppDFAConstantFunctionResult
|
||||||
|
int board_write_message(int board_type, char_data *ch, char *arg, obj_data *board)
|
||||||
{
|
{
|
||||||
time_t ct;
|
time_t ct;
|
||||||
char buf[MAX_INPUT_LENGTH], buf2[MAX_NAME_LENGTH + 3], tmstr[100];
|
char buf[MAX_INPUT_LENGTH], buf2[MAX_NAME_LENGTH + 3], tmstr[100];
|
||||||
|
|
||||||
if (GET_LEVEL(ch) < WRITE_LVL(board_type)) {
|
if (GET_LEVEL(ch) < WRITE_LVL(board_type)) {
|
||||||
send_to_char(ch, "You are not holy enough to write on this board.\r\n");
|
send_to_char(ch, "You are not holy enough to write on this board.\r\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
if (num_of_msgs[board_type] >= MAX_BOARD_MESSAGES) {
|
if (num_of_msgs[board_type] >= MAX_BOARD_MESSAGES) {
|
||||||
send_to_char(ch, "The board is full.\r\n");
|
send_to_char(ch, "The board is full.\r\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
if ((NEW_MSG_INDEX(board_type).slot_num = find_slot()) == -1) {
|
if ((NEW_MSG_INDEX(board_type).slot_num = find_slot()) == -1) {
|
||||||
send_to_char(ch, "The board is malfunctioning - sorry.\r\n");
|
send_to_char(ch, "The board is malfunctioning - sorry.\r\n");
|
||||||
log("SYSERR: Board: failed to find empty slot on write.");
|
log("SYSERR: Board: failed to find empty slot on write.");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
/* skip blanks */
|
/* skip blanks */
|
||||||
skip_spaces(&arg);
|
skip_spaces(&arg);
|
||||||
@@ -196,7 +197,7 @@ int board_write_message(int board_type, struct char_data *ch, char *arg, struct
|
|||||||
|
|
||||||
if (!*arg) {
|
if (!*arg) {
|
||||||
send_to_char(ch, "We must have a headline!\r\n");
|
send_to_char(ch, "We must have a headline!\r\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
ct = time(0);
|
ct = time(0);
|
||||||
strftime(tmstr, sizeof(tmstr), "%a %b %d %Y", localtime(&ct));
|
strftime(tmstr, sizeof(tmstr), "%a %b %d %Y", localtime(&ct));
|
||||||
@@ -204,49 +205,50 @@ int board_write_message(int board_type, struct char_data *ch, char *arg, struct
|
|||||||
snprintf(buf2, sizeof(buf2), "(%s)", GET_NAME(ch));
|
snprintf(buf2, sizeof(buf2), "(%s)", GET_NAME(ch));
|
||||||
snprintf(buf, sizeof(buf), "%s %-12s :: %s", tmstr, buf2, arg);
|
snprintf(buf, sizeof(buf), "%s %-12s :: %s", tmstr, buf2, arg);
|
||||||
NEW_MSG_INDEX(board_type).heading = strdup(buf);
|
NEW_MSG_INDEX(board_type).heading = strdup(buf);
|
||||||
NEW_MSG_INDEX(board_type).level = GET_LEVEL(ch);
|
NEW_MSG_INDEX(board_type).level = (int)GET_LEVEL(ch);
|
||||||
|
|
||||||
send_to_char(ch, "Write your message.\r\n");
|
send_to_char(ch, "Write your message.\r\n");
|
||||||
send_editor_help(ch->desc);
|
send_editor_help(ch->desc);
|
||||||
act("$n starts to write a message.", TRUE, ch, 0, 0, TO_ROOM);
|
act("$n starts to write a message.", TRUE, ch, 0, 0, TO_ROOM);
|
||||||
|
|
||||||
string_write(ch->desc, &(msg_storage[NEW_MSG_INDEX(board_type).slot_num]),
|
string_write(ch->desc, &msg_storage[NEW_MSG_INDEX(board_type).slot_num],
|
||||||
MAX_MESSAGE_LENGTH, board_type + BOARD_MAGIC, NULL);
|
MAX_MESSAGE_LENGTH, board_type + BOARD_MAGIC, NULL);
|
||||||
|
|
||||||
num_of_msgs[board_type]++;
|
num_of_msgs[board_type]++;
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int board_show_board(int board_type, struct char_data *ch, char *arg, struct obj_data *board)
|
int board_show_board(int board_type, char_data *ch, char *arg, obj_data *board)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char tmp[MAX_STRING_LENGTH], buf[MAX_STRING_LENGTH];
|
char tmp[MAX_STRING_LENGTH], buf[MAX_STRING_LENGTH];
|
||||||
|
|
||||||
if (!ch->desc)
|
if (!ch->desc)
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
one_argument(arg, tmp);
|
one_argument(arg, tmp);
|
||||||
|
|
||||||
if (!*tmp || !isname(tmp, board->name))
|
if (!*tmp || !isname(tmp, board->name))
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
if (GET_LEVEL(ch) < READ_LVL(board_type)) {
|
if (GET_LEVEL(ch) < READ_LVL(board_type)) {
|
||||||
send_to_char(ch, "You try but fail to understand the holy words.\r\n");
|
send_to_char(ch, "You try but fail to understand the holy words.\r\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
act("$n studies the board.", TRUE, ch, 0, 0, TO_ROOM);
|
act("$n studies the board.", TRUE, ch, 0, 0, TO_ROOM);
|
||||||
|
|
||||||
if (!num_of_msgs[board_type])
|
if (!num_of_msgs[board_type])
|
||||||
send_to_char(ch, "This is a bulletin board. Usage: READ/REMOVE <messg #>, WRITE <header>.\r\nThe board is empty.\r\n");
|
send_to_char(
|
||||||
|
ch, "This is a bulletin board. Usage: READ/REMOVE <messg #>, WRITE <header>.\r\nThe board is empty.\r\n");
|
||||||
else {
|
else {
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
int nlen;
|
int nlen;
|
||||||
|
|
||||||
len = snprintf(buf, sizeof(buf),
|
len = snprintf(buf, sizeof(buf),
|
||||||
"This is a bulletin board. Usage: READ/REMOVE <messg #>, WRITE <header>.\r\n"
|
"This is a bulletin board. Usage: READ/REMOVE <messg #>, WRITE <header>.\r\n"
|
||||||
"You will need to look at the board to save your message.\r\n"
|
"You will need to look at the board to save your message.\r\n"
|
||||||
"There are %d messages on the board.\r\n",
|
"There are %d messages on the board.\r\n",
|
||||||
num_of_msgs[board_type]);
|
num_of_msgs[board_type]);
|
||||||
#if NEWEST_AT_TOP
|
#if NEWEST_AT_TOP
|
||||||
for (i = num_of_msgs[board_type] - 1; i >= 0; i--) {
|
for (i = num_of_msgs[board_type] - 1; i >= 0; i--) {
|
||||||
if (!MSG_HEADING(board_type, i))
|
if (!MSG_HEADING(board_type, i))
|
||||||
@@ -270,40 +272,40 @@ int board_show_board(int board_type, struct char_data *ch, char *arg, struct obj
|
|||||||
#endif
|
#endif
|
||||||
page_string(ch->desc, buf, TRUE);
|
page_string(ch->desc, buf, TRUE);
|
||||||
}
|
}
|
||||||
return (1);
|
return 1;
|
||||||
|
|
||||||
fubar:
|
fubar:
|
||||||
log("SYSERR: Board %d is fubar'd.", board_type);
|
log("SYSERR: Board %d is fubar'd.", board_type);
|
||||||
send_to_char(ch, "Sorry, the board isn't working.\r\n");
|
send_to_char(ch, "Sorry, the board isn't working.\r\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int board_display_msg(int board_type, struct char_data *ch, char *arg, struct obj_data *board)
|
int board_display_msg(int board_type, char_data *ch, char *arg, obj_data *board)
|
||||||
{
|
{
|
||||||
char number[MAX_INPUT_LENGTH], buffer[MAX_STRING_LENGTH];
|
char number[MAX_INPUT_LENGTH], buffer[MAX_STRING_LENGTH];
|
||||||
int msg, ind;
|
int msg, ind;
|
||||||
|
|
||||||
one_argument(arg, number);
|
one_argument(arg, number);
|
||||||
if (!*number)
|
if (!*number)
|
||||||
return (0);
|
return 0;
|
||||||
if (isname(number, board->name)) /* so "read board" works */
|
if (isname(number, board->name)) /* so "read board" works */
|
||||||
return (board_show_board(board_type, ch, arg, board));
|
return board_show_board(board_type, ch, arg, board);
|
||||||
if (!is_number(number)) /* read 2.mail, look 2.sword */
|
if (!is_number(number)) /* read 2.mail, look 2.sword */
|
||||||
return (0);
|
return 0;
|
||||||
if (!(msg = atoi(number)))
|
if ((msg = parse_int(number)) == 0)
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
if (GET_LEVEL(ch) < READ_LVL(board_type)) {
|
if (GET_LEVEL(ch) < READ_LVL(board_type)) {
|
||||||
send_to_char(ch, "You try but fail to understand the holy words.\r\n");
|
send_to_char(ch, "You try but fail to understand the holy words.\r\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
if (!num_of_msgs[board_type]) {
|
if (!num_of_msgs[board_type]) {
|
||||||
send_to_char(ch, "The board is empty!\r\n");
|
send_to_char(ch, "The board is empty!\r\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
if (msg < 1 || msg > num_of_msgs[board_type]) {
|
if (msg < 1 || msg > num_of_msgs[board_type]) {
|
||||||
send_to_char(ch, "That message exists only in your imagination.\r\n");
|
send_to_char(ch, "That message exists only in your imagination.\r\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
#if NEWEST_AT_TOP
|
#if NEWEST_AT_TOP
|
||||||
ind = num_of_msgs[board_type] - msg;
|
ind = num_of_msgs[board_type] - msg;
|
||||||
@@ -314,45 +316,45 @@ int board_display_msg(int board_type, struct char_data *ch, char *arg, struct ob
|
|||||||
MSG_SLOTNUM(board_type, ind) >= INDEX_SIZE) {
|
MSG_SLOTNUM(board_type, ind) >= INDEX_SIZE) {
|
||||||
send_to_char(ch, "Sorry, the board is not working.\r\n");
|
send_to_char(ch, "Sorry, the board is not working.\r\n");
|
||||||
log("SYSERR: Board is screwed up. (Room #%d)", GET_ROOM_VNUM(IN_ROOM(ch)));
|
log("SYSERR: Board is screwed up. (Room #%d)", GET_ROOM_VNUM(IN_ROOM(ch)));
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
if (!(MSG_HEADING(board_type, ind))) {
|
if (!MSG_HEADING(board_type, ind)) {
|
||||||
send_to_char(ch, "That message appears to be screwed up.\r\n");
|
send_to_char(ch, "That message appears to be screwed up.\r\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
if (!(msg_storage[MSG_SLOTNUM(board_type, ind)])) {
|
if (!msg_storage[MSG_SLOTNUM(board_type, ind)]) {
|
||||||
send_to_char(ch, "That message seems to be empty.\r\n");
|
send_to_char(ch, "That message seems to be empty.\r\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
snprintf(buffer, sizeof(buffer), "Message %d : %s\r\n\r\n%s\r\n", msg,
|
snprintf(buffer, sizeof(buffer), "Message %d : %s\r\n\r\n%s\r\n", msg,
|
||||||
MSG_HEADING(board_type, ind),
|
MSG_HEADING(board_type, ind),
|
||||||
msg_storage[MSG_SLOTNUM(board_type, ind)]);
|
msg_storage[MSG_SLOTNUM(board_type, ind)]);
|
||||||
|
|
||||||
page_string(ch->desc, buffer, TRUE);
|
page_string(ch->desc, buffer, TRUE);
|
||||||
|
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int board_remove_msg(int board_type, struct char_data *ch, char *arg, struct obj_data *board)
|
int board_remove_msg(int board_type, char_data *ch, char *arg, obj_data *board)
|
||||||
{
|
{
|
||||||
int ind, msg, slot_num;
|
int ind, msg, slot_num;
|
||||||
char number[MAX_INPUT_LENGTH], buf[MAX_INPUT_LENGTH];
|
char number[MAX_INPUT_LENGTH], buf[MAX_INPUT_LENGTH];
|
||||||
struct descriptor_data *d;
|
descriptor_data *d;
|
||||||
|
|
||||||
one_argument(arg, number);
|
one_argument(arg, number);
|
||||||
|
|
||||||
if (!*number || !is_number(number))
|
if (!*number || !is_number(number))
|
||||||
return (0);
|
return 0;
|
||||||
if (!(msg = atoi(number)))
|
if ((msg = parse_int(number)) == 0)
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
if (!num_of_msgs[board_type]) {
|
if (!num_of_msgs[board_type]) {
|
||||||
send_to_char(ch, "The board is empty!\r\n");
|
send_to_char(ch, "The board is empty!\r\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
if (msg < 1 || msg > num_of_msgs[board_type]) {
|
if (msg < 1 || msg > num_of_msgs[board_type]) {
|
||||||
send_to_char(ch, "That message exists only in your imagination.\r\n");
|
send_to_char(ch, "That message exists only in your imagination.\r\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
#if NEWEST_AT_TOP
|
#if NEWEST_AT_TOP
|
||||||
ind = num_of_msgs[board_type] - msg;
|
ind = num_of_msgs[board_type] - msg;
|
||||||
@@ -361,28 +363,28 @@ int board_remove_msg(int board_type, struct char_data *ch, char *arg, struct obj
|
|||||||
#endif
|
#endif
|
||||||
if (!MSG_HEADING(board_type, ind)) {
|
if (!MSG_HEADING(board_type, ind)) {
|
||||||
send_to_char(ch, "That message appears to be screwed up.\r\n");
|
send_to_char(ch, "That message appears to be screwed up.\r\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
snprintf(buf, sizeof(buf), "(%s)", GET_NAME(ch));
|
snprintf(buf, sizeof(buf), "(%s)", GET_NAME(ch));
|
||||||
if (GET_LEVEL(ch) < REMOVE_LVL(board_type) &&
|
if (GET_LEVEL(ch) < REMOVE_LVL(board_type) &&
|
||||||
!(strstr(MSG_HEADING(board_type, ind), buf))) {
|
!strstr(MSG_HEADING(board_type, ind), buf)) {
|
||||||
send_to_char(ch, "You are not holy enough to remove other people's messages.\r\n");
|
send_to_char(ch, "You are not holy enough to remove other people's messages.\r\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
if (GET_LEVEL(ch) < MSG_LEVEL(board_type, ind)) {
|
if (GET_LEVEL(ch) < MSG_LEVEL(board_type, ind)) {
|
||||||
send_to_char(ch, "You can't remove a message holier than yourself.\r\n");
|
send_to_char(ch, "You can't remove a message holier than yourself.\r\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
slot_num = MSG_SLOTNUM(board_type, ind);
|
slot_num = MSG_SLOTNUM(board_type, ind);
|
||||||
if (slot_num < 0 || slot_num >= INDEX_SIZE) {
|
if (slot_num < 0 || slot_num >= INDEX_SIZE) {
|
||||||
send_to_char(ch, "That message is majorly screwed up.\r\n");
|
send_to_char(ch, "That message is majorly screwed up.\r\n");
|
||||||
log("SYSERR: The board is seriously screwed up. (Room #%d)", GET_ROOM_VNUM(IN_ROOM(ch)));
|
log("SYSERR: The board is seriously screwed up. (Room #%d)", GET_ROOM_VNUM(IN_ROOM(ch)));
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
for (d = descriptor_list; d; d = d->next)
|
for (d = descriptor_list; d; d = d->next)
|
||||||
if (STATE(d) == CON_PLAYING && d->str == &(msg_storage[slot_num])) {
|
if (STATE(d) == CON_PLAYING && d->str == &msg_storage[slot_num]) {
|
||||||
send_to_char(ch, "At least wait until the author is finished before removing it!\r\n");
|
send_to_char(ch, "At least wait until the author is finished before removing it!\r\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
if (msg_storage[slot_num])
|
if (msg_storage[slot_num])
|
||||||
free(msg_storage[slot_num]);
|
free(msg_storage[slot_num]);
|
||||||
@@ -403,7 +405,7 @@ int board_remove_msg(int board_type, struct char_data *ch, char *arg, struct obj
|
|||||||
act(buf, FALSE, ch, 0, 0, TO_ROOM);
|
act(buf, FALSE, ch, 0, 0, TO_ROOM);
|
||||||
board_save_board(board_type);
|
board_save_board(board_type);
|
||||||
|
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void board_save_board(int board_type)
|
void board_save_board(int board_type)
|
||||||
@@ -416,26 +418,26 @@ void board_save_board(int board_type)
|
|||||||
remove(FILENAME(board_type));
|
remove(FILENAME(board_type));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!(fl = fopen(FILENAME(board_type), "wb"))) {
|
if ((fl = fopen(FILENAME(board_type), "wb")) == NULL) {
|
||||||
perror("SYSERR: Error writing board");
|
perror("SYSERR: Error writing board");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fwrite(&(num_of_msgs[board_type]), sizeof(int), 1, fl);
|
fwrite(&num_of_msgs[board_type], sizeof(int), 1, fl);
|
||||||
|
|
||||||
for (i = 0; i < num_of_msgs[board_type]; i++) {
|
for (i = 0; i < num_of_msgs[board_type]; i++) {
|
||||||
if ((tmp1 = MSG_HEADING(board_type, i)) != NULL)
|
if ((tmp1 = MSG_HEADING(board_type, i)) != NULL)
|
||||||
msg_index[board_type][i].heading_len = strlen(tmp1) + 1;
|
msg_index[board_type][i].heading_len = (int)strlen(tmp1) + 1;
|
||||||
else
|
else
|
||||||
msg_index[board_type][i].heading_len = 0;
|
msg_index[board_type][i].heading_len = 0;
|
||||||
|
|
||||||
if (MSG_SLOTNUM(board_type, i) < 0 ||
|
if (MSG_SLOTNUM(board_type, i) < 0 ||
|
||||||
MSG_SLOTNUM(board_type, i) >= INDEX_SIZE ||
|
MSG_SLOTNUM(board_type, i) >= INDEX_SIZE ||
|
||||||
(!(tmp2 = msg_storage[MSG_SLOTNUM(board_type, i)])))
|
(tmp2 = msg_storage[MSG_SLOTNUM(board_type, i)]) == NULL)
|
||||||
msg_index[board_type][i].message_len = 0;
|
msg_index[board_type][i].message_len = 0;
|
||||||
else
|
else
|
||||||
msg_index[board_type][i].message_len = strlen(tmp2) + 1;
|
msg_index[board_type][i].message_len = (int)strlen(tmp2) + 1;
|
||||||
|
|
||||||
fwrite(&(msg_index[board_type][i]), sizeof(struct board_msginfo), 1, fl);
|
fwrite(&msg_index[board_type][i], sizeof(struct board_msginfo), 1, fl);
|
||||||
if (tmp1)
|
if (tmp1)
|
||||||
fwrite(tmp1, sizeof(char), msg_index[board_type][i].heading_len, fl);
|
fwrite(tmp1, sizeof(char), msg_index[board_type][i].heading_len, fl);
|
||||||
if (tmp2)
|
if (tmp2)
|
||||||
@@ -451,12 +453,12 @@ void board_load_board(int board_type)
|
|||||||
int i, len1, len2;
|
int i, len1, len2;
|
||||||
char *tmp1, *tmp2;
|
char *tmp1, *tmp2;
|
||||||
|
|
||||||
if (!(fl = fopen(FILENAME(board_type), "rb"))) {
|
if ((fl = fopen(FILENAME(board_type), "rb")) == NULL) {
|
||||||
if (errno != ENOENT)
|
if (errno != ENOENT)
|
||||||
perror("SYSERR: Error reading board");
|
perror("SYSERR: Error reading board");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (fread(&(num_of_msgs[board_type]), sizeof(int), 1, fl) != 1)
|
if (fread(&num_of_msgs[board_type], sizeof(int), 1, fl) != 1)
|
||||||
return;
|
return;
|
||||||
if (num_of_msgs[board_type] < 1 || num_of_msgs[board_type] > MAX_BOARD_MESSAGES) {
|
if (num_of_msgs[board_type] < 1 || num_of_msgs[board_type] > MAX_BOARD_MESSAGES) {
|
||||||
log("SYSERR: Board file %d corrupt. Resetting.", board_type);
|
log("SYSERR: Board file %d corrupt. Resetting.", board_type);
|
||||||
@@ -464,7 +466,7 @@ void board_load_board(int board_type)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (i = 0; i < num_of_msgs[board_type]; i++) {
|
for (i = 0; i < num_of_msgs[board_type]; i++) {
|
||||||
if (fread(&(msg_index[board_type][i]), sizeof(struct board_msginfo), 1, fl) != 1) {
|
if (fread(&msg_index[board_type][i], sizeof(struct board_msginfo), 1, fl) != 1) {
|
||||||
if (feof(fl))
|
if (feof(fl))
|
||||||
log("SYSERR: Unexpected EOF encountered in board file %d! Resetting.", board_type);
|
log("SYSERR: Unexpected EOF encountered in board file %d! Resetting.", board_type);
|
||||||
else if (ferror(fl))
|
else if (ferror(fl))
|
||||||
@@ -540,7 +542,7 @@ void board_clear_board(int board_type)
|
|||||||
if (msg_storage[MSG_SLOTNUM(board_type, i)])
|
if (msg_storage[MSG_SLOTNUM(board_type, i)])
|
||||||
free(msg_storage[MSG_SLOTNUM(board_type, i)]);
|
free(msg_storage[MSG_SLOTNUM(board_type, i)]);
|
||||||
msg_storage_taken[MSG_SLOTNUM(board_type, i)] = 0;
|
msg_storage_taken[MSG_SLOTNUM(board_type, i)] = 0;
|
||||||
memset((char *)&(msg_index[board_type][i]),0,sizeof(struct board_msginfo));
|
memset((char *)&msg_index[board_type][i], 0, sizeof(struct board_msginfo));
|
||||||
msg_index[board_type][i].slot_num = -1;
|
msg_index[board_type][i].slot_num = -1;
|
||||||
}
|
}
|
||||||
num_of_msgs[board_type] = 0;
|
num_of_msgs[board_type] = 0;
|
||||||
|
|||||||
+20
-20
@@ -13,29 +13,29 @@
|
|||||||
#ifndef _BOARDS_H_
|
#ifndef _BOARDS_H_
|
||||||
#define _BOARDS_H_
|
#define _BOARDS_H_
|
||||||
|
|
||||||
#define NUM_OF_BOARDS 7 /* change if needed! */
|
#define NUM_OF_BOARDS 7 /* change if needed! */
|
||||||
#define MAX_BOARD_MESSAGES 60 /* arbitrary -- change if needed */
|
#define MAX_BOARD_MESSAGES 60 /* arbitrary -- change if needed */
|
||||||
#define MAX_MESSAGE_LENGTH 4096 /* arbitrary -- change if needed */
|
#define MAX_MESSAGE_LENGTH 4096 /* arbitrary -- change if needed */
|
||||||
|
|
||||||
#define INDEX_SIZE ((NUM_OF_BOARDS*MAX_BOARD_MESSAGES) + 5)
|
#define INDEX_SIZE ((NUM_OF_BOARDS*MAX_BOARD_MESSAGES) + 5)
|
||||||
|
|
||||||
#define BOARD_MAGIC 1048575 /* arbitrary number - see modify.c */
|
#define BOARD_MAGIC 1048575 /* arbitrary number - see modify.c */
|
||||||
|
|
||||||
struct board_msginfo {
|
struct board_msginfo {
|
||||||
int slot_num; /* pos of message in "master index" */
|
int slot_num; /* pos of message in "master index" */
|
||||||
char *heading; /* pointer to message's heading */
|
char *heading; /* pointer to message's heading */
|
||||||
int level; /* level of poster */
|
int level; /* level of poster */
|
||||||
int heading_len; /* size of header (for file write) */
|
int heading_len; /* size of header (for file write) */
|
||||||
int message_len; /* size of message text (for file write) */
|
int message_len; /* size of message text (for file write) */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct board_info_type {
|
struct board_info_type {
|
||||||
obj_vnum vnum; /* vnum of this board */
|
obj_vnum vnum; /* vnum of this board */
|
||||||
int read_lvl; /* min level to read messages on this board */
|
int read_lvl; /* min level to read messages on this board */
|
||||||
int write_lvl; /* min level to write messages on this board */
|
int write_lvl; /* min level to write messages on this board */
|
||||||
int remove_lvl; /* min level to remove messages from this board */
|
int remove_lvl; /* min level to remove messages from this board */
|
||||||
char filename[50]; /* file to save this board to */
|
char filename[50]; /* file to save this board to */
|
||||||
obj_rnum rnum; /* rnum of this board */
|
obj_rnum rnum; /* rnum of this board */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BOARD_VNUM(i) (board_info[i].vnum)
|
#define BOARD_VNUM(i) (board_info[i].vnum)
|
||||||
@@ -51,10 +51,10 @@ struct board_info_type {
|
|||||||
#define MSG_LEVEL(i, j) (msg_index[i][j].level)
|
#define MSG_LEVEL(i, j) (msg_index[i][j].level)
|
||||||
|
|
||||||
SPECIAL(gen_board);
|
SPECIAL(gen_board);
|
||||||
int board_display_msg(int board_type, struct char_data *ch, char *arg, struct obj_data *board);
|
int board_display_msg(int board_type, char_data *ch, char *arg, obj_data *board);
|
||||||
int board_show_board(int board_type, struct char_data *ch, char *arg, struct obj_data *board);
|
int board_show_board(int board_type, char_data *ch, char *arg, obj_data *board);
|
||||||
int board_remove_msg(int board_type, struct char_data *ch, char *arg, struct obj_data *board);
|
int board_remove_msg(int board_type, char_data *ch, char *arg, obj_data *board);
|
||||||
int board_write_message(int board_type, struct char_data *ch, char *arg, struct obj_data *board);
|
int board_write_message(int board_type, char_data *ch, char *arg, obj_data *board);
|
||||||
void board_save_board(int board_type);
|
void board_save_board(int board_type);
|
||||||
void board_load_board(int board_type);
|
void board_load_board(int board_type);
|
||||||
void board_clear_all(void);
|
void board_clear_all(void);
|
||||||
|
|||||||
+117
-114
@@ -13,7 +13,6 @@
|
|||||||
#include "structs.h"
|
#include "structs.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
#include "interpreter.h"
|
|
||||||
#include "handler.h"
|
#include "handler.h"
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "spells.h"
|
#include "spells.h"
|
||||||
@@ -30,18 +29,18 @@
|
|||||||
/* local, file scope restricted functions */
|
/* local, file scope restricted functions */
|
||||||
static mob_vnum castle_virtual(mob_vnum offset);
|
static mob_vnum castle_virtual(mob_vnum offset);
|
||||||
static room_rnum castle_real_room(room_vnum roomoffset);
|
static room_rnum castle_real_room(room_vnum roomoffset);
|
||||||
static struct char_data *find_npc_by_name(struct char_data *chAtChar, const char *pszName, int iLen);
|
static char_data *find_npc_by_name(const char_data *chAtChar, const char *pszName, int iLen);
|
||||||
static int block_way(struct char_data *ch, int cmd, char *arg, room_vnum iIn_room, int iProhibited_direction);
|
static int block_way(char_data *ch, int cmd, char *arg, room_vnum iIn_room, int iProhibited_direction);
|
||||||
static int member_of_staff(struct char_data *chChar);
|
static int member_of_staff(const char_data *chChar);
|
||||||
static int member_of_royal_guard(struct char_data *chChar);
|
static int member_of_royal_guard(const char_data *chChar);
|
||||||
static struct char_data *find_guard(struct char_data *chAtChar);
|
static char_data *find_guard(const char_data *chAtChar);
|
||||||
static struct char_data *get_victim(struct char_data *chAtChar);
|
static char_data *get_victim(const char_data *chAtChar);
|
||||||
static int banzaii(struct char_data *ch);
|
static int banzaii(char_data *ch);
|
||||||
static int do_npc_rescue(struct char_data *ch_hero, struct char_data *ch_victim);
|
static int do_npc_rescue(char_data *ch_hero, char_data *ch_victim);
|
||||||
static int is_trash(struct obj_data *i);
|
static int is_trash(const obj_data *i);
|
||||||
static void fry_victim(struct char_data *ch);
|
static void fry_victim(char_data *ch);
|
||||||
static int castle_cleaner(struct char_data *ch, int cmd, int gripe);
|
static int castle_cleaner(char_data *ch, int cmd, int gripe);
|
||||||
static int castle_twin_proc(struct char_data *ch, int cmd, char *arg, int ctlnum, const char *twinname);
|
static int castle_twin_proc(char_data *ch, int cmd, char *arg, int ctlnum, const char *twinname);
|
||||||
static void castle_mob_spec(mob_vnum mobnum, SPECIAL(*specproc));
|
static void castle_mob_spec(mob_vnum mobnum, SPECIAL(*specproc));
|
||||||
/* Special procedures for Kings Castle by Pjotr. Coded by Sapowox. */
|
/* Special procedures for Kings Castle by Pjotr. Coded by Sapowox. */
|
||||||
SPECIAL(CastleGuard);
|
SPECIAL(CastleGuard);
|
||||||
@@ -129,86 +128,86 @@ void assign_kings_castle(void)
|
|||||||
|
|
||||||
/* Routine: member_of_staff. Used to see if a character is a member of the
|
/* Routine: member_of_staff. Used to see if a character is a member of the
|
||||||
* castle staff. Used mainly by BANZAI:ng NPC:s. */
|
* castle staff. Used mainly by BANZAI:ng NPC:s. */
|
||||||
static int member_of_staff(struct char_data *chChar)
|
static int member_of_staff(const char_data *chChar)
|
||||||
{
|
{
|
||||||
int ch_num;
|
int ch_num;
|
||||||
|
|
||||||
if (!IS_NPC(chChar))
|
if (!IS_NPC(chChar))
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
ch_num = GET_MOB_VNUM(chChar);
|
ch_num = GET_MOB_VNUM(chChar);
|
||||||
|
|
||||||
if (ch_num == castle_virtual(1))
|
if (ch_num == castle_virtual(1))
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
|
|
||||||
if (ch_num > castle_virtual(2) && ch_num < castle_virtual(15))
|
if (ch_num > castle_virtual(2) && ch_num < castle_virtual(15))
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
|
|
||||||
if (ch_num > castle_virtual(15) && ch_num < castle_virtual(18))
|
if (ch_num > castle_virtual(15) && ch_num < castle_virtual(18))
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
|
|
||||||
if (ch_num > castle_virtual(18) && ch_num < castle_virtual(30))
|
if (ch_num > castle_virtual(18) && ch_num < castle_virtual(30))
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
|
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Function: member_of_royal_guard. Returns TRUE if the character is a guard on
|
/* Function: member_of_royal_guard. Returns TRUE if the character is a guard on
|
||||||
* duty, otherwise FALSE. Used by Peter the captain of the royal guard. */
|
* duty, otherwise FALSE. Used by Peter the captain of the royal guard. */
|
||||||
static int member_of_royal_guard(struct char_data *chChar)
|
static int member_of_royal_guard(const char_data *chChar)
|
||||||
{
|
{
|
||||||
int ch_num;
|
int ch_num;
|
||||||
|
|
||||||
if (!chChar || !IS_NPC(chChar))
|
if (!chChar || !IS_NPC(chChar))
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
ch_num = GET_MOB_VNUM(chChar);
|
ch_num = GET_MOB_VNUM(chChar);
|
||||||
|
|
||||||
if (ch_num == castle_virtual(3) || ch_num == castle_virtual(6))
|
if (ch_num == castle_virtual(3) || ch_num == castle_virtual(6))
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
|
|
||||||
if (ch_num > castle_virtual(7) && ch_num < castle_virtual(12))
|
if (ch_num > castle_virtual(7) && ch_num < castle_virtual(12))
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
|
|
||||||
if (ch_num > castle_virtual(23) && ch_num < castle_virtual(26))
|
if (ch_num > castle_virtual(23) && ch_num < castle_virtual(26))
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
|
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Function: find_npc_by_name. Returns a pointer to an npc by the given name.
|
/* Function: find_npc_by_name. Returns a pointer to an npc by the given name.
|
||||||
* Used by Tim and Tom. */
|
* Used by Tim and Tom. */
|
||||||
static struct char_data *find_npc_by_name(struct char_data *chAtChar,
|
static char_data *find_npc_by_name(const char_data *chAtChar,
|
||||||
const char *pszName, int iLen)
|
const char *pszName, int iLen)
|
||||||
{
|
{
|
||||||
struct char_data *ch;
|
char_data *ch;
|
||||||
|
|
||||||
for (ch = world[IN_ROOM(chAtChar)].people; ch; ch = ch->next_in_room)
|
for (ch = world[IN_ROOM(chAtChar)].people; ch; ch = ch->next_in_room)
|
||||||
if (IS_NPC(ch) && !strncmp(pszName, ch->player.short_descr, iLen))
|
if (IS_NPC(ch) && !strncmp(pszName, ch->player.short_descr, iLen))
|
||||||
return (ch);
|
return ch;
|
||||||
|
|
||||||
return (NULL);
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Function: find_guard. Returns the pointer to a guard on duty. Used by Peter
|
/* Function: find_guard. Returns the pointer to a guard on duty. Used by Peter
|
||||||
* the Captain of the Royal Guard */
|
* the Captain of the Royal Guard */
|
||||||
static struct char_data *find_guard(struct char_data *chAtChar)
|
static char_data *find_guard(const char_data *chAtChar)
|
||||||
{
|
{
|
||||||
struct char_data *ch;
|
char_data *ch;
|
||||||
|
|
||||||
for (ch = world[IN_ROOM(chAtChar)].people; ch; ch = ch->next_in_room)
|
for (ch = world[IN_ROOM(chAtChar)].people; ch; ch = ch->next_in_room)
|
||||||
if (!FIGHTING(ch) && member_of_royal_guard(ch))
|
if (!FIGHTING(ch) && member_of_royal_guard(ch))
|
||||||
return (ch);
|
return ch;
|
||||||
|
|
||||||
return (NULL);
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Function: get_victim. Returns a pointer to a randomly chosen character in
|
/* Function: get_victim. Returns a pointer to a randomly chosen character in
|
||||||
* the same room, fighting someone in the castle staff. Used by BANZAII-ing
|
* the same room, fighting someone in the castle staff. Used by BANZAII-ing
|
||||||
* characters and King Welmar... */
|
* characters and King Welmar... */
|
||||||
static struct char_data *get_victim(struct char_data *chAtChar)
|
static char_data *get_victim(const char_data *chAtChar)
|
||||||
{
|
{
|
||||||
struct char_data *ch;
|
char_data *ch;
|
||||||
int iNum_bad_guys = 0, iVictim;
|
int iNum_bad_guys = 0, iVictim;
|
||||||
|
|
||||||
for (ch = world[IN_ROOM(chAtChar)].people; ch; ch = ch->next_in_room)
|
for (ch = world[IN_ROOM(chAtChar)].people; ch; ch = ch->next_in_room)
|
||||||
@@ -216,11 +215,11 @@ static struct char_data *get_victim(struct char_data *chAtChar)
|
|||||||
iNum_bad_guys++;
|
iNum_bad_guys++;
|
||||||
|
|
||||||
if (!iNum_bad_guys)
|
if (!iNum_bad_guys)
|
||||||
return (NULL);
|
return NULL;
|
||||||
|
|
||||||
iVictim = rand_number(0, iNum_bad_guys); /* How nice, we give them a chance */
|
iVictim = rand_number(0, iNum_bad_guys); /* How nice, we give them a chance */
|
||||||
if (!iVictim)
|
if (!iVictim)
|
||||||
return (NULL);
|
return NULL;
|
||||||
|
|
||||||
iNum_bad_guys = 0;
|
iNum_bad_guys = 0;
|
||||||
|
|
||||||
@@ -234,39 +233,40 @@ static struct char_data *get_victim(struct char_data *chAtChar)
|
|||||||
if (++iNum_bad_guys != iVictim)
|
if (++iNum_bad_guys != iVictim)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
return (ch);
|
return ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (NULL);
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Banzaii. Makes a character banzaii on attackers of the castle staff. Used
|
/* Banzaii. Makes a character banzaii on attackers of the castle staff. Used
|
||||||
* by Guards, Tim, Tom, Dick, David, Peter, Master, and the King. */
|
* by Guards, Tim, Tom, Dick, David, Peter, Master, and the King. */
|
||||||
static int banzaii(struct char_data *ch)
|
static int banzaii(char_data *ch)
|
||||||
{
|
{
|
||||||
struct char_data *chOpponent;
|
char_data *chOpponent;
|
||||||
|
|
||||||
if (!AWAKE(ch) || GET_POS(ch) == POS_FIGHTING || !(chOpponent = get_victim(ch)))
|
if (!AWAKE(ch) || GET_POS(ch) == POS_FIGHTING || (chOpponent = get_victim(ch)) == NULL)
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
act("$n roars: 'Protect the Kingdom of Great King Welmar! BANZAIIII!!!'",
|
act("$n roars: 'Protect the Kingdom of Great King Welmar! BANZAIIII!!!'",
|
||||||
FALSE, ch, 0, 0, TO_ROOM);
|
FALSE, ch, 0, 0, TO_ROOM);
|
||||||
hit(ch, chOpponent, TYPE_UNDEFINED);
|
hit(ch, chOpponent, TYPE_UNDEFINED);
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do_npc_rescue. Makes ch_hero rescue ch_victim. Used by Tim and Tom. */
|
/* Do_npc_rescue. Makes ch_hero rescue ch_victim. Used by Tim and Tom. */
|
||||||
static int do_npc_rescue(struct char_data *ch_hero, struct char_data *ch_victim)
|
static int do_npc_rescue(char_data *ch_hero, char_data *ch_victim)
|
||||||
{
|
{
|
||||||
struct char_data *ch_bad_guy;
|
char_data *ch_bad_guy;
|
||||||
|
|
||||||
for (ch_bad_guy = world[IN_ROOM(ch_hero)].people;
|
for (ch_bad_guy = world[IN_ROOM(ch_hero)].people;
|
||||||
ch_bad_guy && (FIGHTING(ch_bad_guy) != ch_victim);
|
ch_bad_guy && FIGHTING(ch_bad_guy) != ch_victim;
|
||||||
ch_bad_guy = ch_bad_guy->next_in_room);
|
ch_bad_guy = ch_bad_guy->next_in_room)
|
||||||
|
;
|
||||||
|
|
||||||
/* NO WAY I'll rescue the one I'm fighting! */
|
/* NO WAY I'll rescue the one I'm fighting! */
|
||||||
if (!ch_bad_guy || ch_bad_guy == ch_hero)
|
if (!ch_bad_guy || ch_bad_guy == ch_hero)
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
act("You bravely rescue $N.\r\n", FALSE, ch_hero, 0, ch_victim, TO_CHAR);
|
act("You bravely rescue $N.\r\n", FALSE, ch_hero, 0, ch_victim, TO_CHAR);
|
||||||
act("You are rescued by $N, your loyal friend!\r\n",
|
act("You are rescued by $N, your loyal friend!\r\n",
|
||||||
@@ -280,54 +280,54 @@ static int do_npc_rescue(struct char_data *ch_hero, struct char_data *ch_victim)
|
|||||||
|
|
||||||
set_fighting(ch_hero, ch_bad_guy);
|
set_fighting(ch_hero, ch_bad_guy);
|
||||||
set_fighting(ch_bad_guy, ch_hero);
|
set_fighting(ch_bad_guy, ch_hero);
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Procedure to block a person trying to enter a room. Used by Tim/Tom at Kings
|
/* Procedure to block a person trying to enter a room. Used by Tim/Tom at Kings
|
||||||
* bedroom and Dick/David at treasury. */
|
* bedroom and Dick/David at treasury. */
|
||||||
static int block_way(struct char_data *ch, int cmd, char *arg, room_vnum iIn_room,
|
static int block_way(char_data *ch, int cmd, char *arg, room_vnum iIn_room,
|
||||||
int iProhibited_direction)
|
int iProhibited_direction)
|
||||||
{
|
{
|
||||||
if (cmd != ++iProhibited_direction)
|
if (cmd != ++iProhibited_direction)
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (ch->player.short_descr && !strncmp(ch->player.short_descr, "King Welmar", 11))
|
if (ch->player.short_descr && !strncmp(ch->player.short_descr, "King Welmar", 11))
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (IN_ROOM(ch) != real_room(iIn_room))
|
if (IN_ROOM(ch) != real_room(iIn_room))
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (!member_of_staff(ch))
|
if (!member_of_staff(ch))
|
||||||
act("The guard roars at $n and pushes $m back.", FALSE, ch, 0, 0, TO_ROOM);
|
act("The guard roars at $n and pushes $m back.", FALSE, ch, 0, 0, TO_ROOM);
|
||||||
|
|
||||||
send_to_char(ch, "The guard roars: 'Entrance is Prohibited!', and pushes you back.\r\n");
|
send_to_char(ch, "The guard roars: 'Entrance is Prohibited!', and pushes you back.\r\n");
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Routine to check if an object is trash. Used by James the Butler and the
|
/* Routine to check if an object is trash. Used by James the Butler and the
|
||||||
* Cleaning Lady. */
|
* Cleaning Lady. */
|
||||||
static int is_trash(struct obj_data *i)
|
static int is_trash(const obj_data *i)
|
||||||
{
|
{
|
||||||
if (!OBJWEAR_FLAGGED(i, ITEM_WEAR_TAKE))
|
if (!OBJWEAR_FLAGGED(i, ITEM_WEAR_TAKE))
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (GET_OBJ_TYPE(i) == ITEM_DRINKCON || GET_OBJ_COST(i) <= 10)
|
if (GET_OBJ_TYPE(i) == ITEM_DRINKCON || GET_OBJ_COST(i) <= 10)
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
|
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fry_victim. Finds a suitabe victim, and cast some _NASTY_ spell on him. Used
|
/* Fry_victim. Finds a suitabe victim, and cast some _NASTY_ spell on him. Used
|
||||||
* by King Welmar. */
|
* by King Welmar. */
|
||||||
static void fry_victim(struct char_data *ch)
|
static void fry_victim(char_data *ch)
|
||||||
{
|
{
|
||||||
struct char_data *tch;
|
char_data *tch;
|
||||||
|
|
||||||
if (ch->points.mana < 10)
|
if (ch->points.mana < 10)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Find someone suitable to fry ! */
|
/* Find someone suitable to fry ! */
|
||||||
if (!(tch = get_victim(ch)))
|
if ((tch = get_victim(ch)) == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (rand_number(0, 8)) {
|
switch (rand_number(0, 8)) {
|
||||||
@@ -358,8 +358,6 @@ static void fry_victim(struct char_data *ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ch->points.mana -= 10;
|
ch->points.mana -= 10;
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* King_welmar. Control the actions and movements of the King. */
|
/* King_welmar. Control the actions and movements of the King. */
|
||||||
@@ -397,18 +395,19 @@ SPECIAL(king_welmar)
|
|||||||
path_index = 0;
|
path_index = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cmd || (GET_POS(ch) < POS_SLEEPING) ||
|
if (cmd || GET_POS(ch) < POS_SLEEPING ||
|
||||||
(GET_POS(ch) == POS_SLEEPING && !move))
|
(GET_POS(ch) == POS_SLEEPING && !move))
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (GET_POS(ch) == POS_FIGHTING) {
|
if (GET_POS(ch) == POS_FIGHTING) {
|
||||||
fry_victim(ch);
|
fry_victim(ch);
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
} else if (banzaii(ch))
|
}
|
||||||
return (FALSE);
|
if (banzaii(ch))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (!move)
|
if (!move)
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
switch (path[path_index]) {
|
switch (path[path_index]) {
|
||||||
case '0':
|
case '0':
|
||||||
@@ -471,10 +470,14 @@ SPECIAL(king_welmar)
|
|||||||
case '.':
|
case '.':
|
||||||
move = FALSE;
|
move = FALSE;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
log("default case hit in king_welmar spec proc. path_index=%d path[path_index] = %c",
|
||||||
|
path_index, path[path_index]);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
path_index++;
|
path_index++;
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Training_master. Acts actions to the training room, if his students are
|
/* Training_master. Acts actions to the training room, if his students are
|
||||||
@@ -482,25 +485,25 @@ SPECIAL(king_welmar)
|
|||||||
* Master. */
|
* Master. */
|
||||||
SPECIAL(training_master)
|
SPECIAL(training_master)
|
||||||
{
|
{
|
||||||
struct char_data *pupil1, *pupil2 = NULL, *tch;
|
char_data *pupil1, *pupil2 = NULL, *tch;
|
||||||
|
|
||||||
if (!AWAKE(ch) || (GET_POS(ch) == POS_FIGHTING))
|
if (!AWAKE(ch) || GET_POS(ch) == POS_FIGHTING)
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (cmd)
|
if (cmd)
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (banzaii(ch) || rand_number(0, 2))
|
if (banzaii(ch) || rand_number(0, 2))
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (!(pupil1 = find_npc_by_name(ch, "Brian", 5)))
|
if ((pupil1 = find_npc_by_name(ch, "Brian", 5)) == NULL)
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (!(pupil2 = find_npc_by_name(ch, "Mick", 4)))
|
if ((pupil2 = find_npc_by_name(ch, "Mick", 4)) == NULL)
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (FIGHTING(pupil1) || FIGHTING(pupil2))
|
if (FIGHTING(pupil1) || FIGHTING(pupil2))
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (rand_number(0, 1)) {
|
if (rand_number(0, 1)) {
|
||||||
tch = pupil1;
|
tch = pupil1;
|
||||||
@@ -562,7 +565,7 @@ SPECIAL(training_master)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
SPECIAL(tom)
|
SPECIAL(tom)
|
||||||
@@ -576,12 +579,12 @@ SPECIAL(tim)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Common routine for the Castle Twins. */
|
/* Common routine for the Castle Twins. */
|
||||||
static int castle_twin_proc(struct char_data *ch, int cmd, char *arg, int ctlnum, const char *twinname)
|
static int castle_twin_proc(char_data *ch, int cmd, char *arg, int ctlnum, const char *twinname)
|
||||||
{
|
{
|
||||||
struct char_data *king, *twin;
|
char_data *king, *twin;
|
||||||
|
|
||||||
if (!AWAKE(ch))
|
if (!AWAKE(ch))
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (cmd)
|
if (cmd)
|
||||||
return block_way(ch, cmd, arg, castle_virtual(ctlnum), 1);
|
return block_way(ch, cmd, arg, castle_virtual(ctlnum), 1);
|
||||||
@@ -595,14 +598,14 @@ static int castle_twin_proc(struct char_data *ch, int cmd, char *arg, int ctlnum
|
|||||||
do_npc_rescue(ch, king);
|
do_npc_rescue(ch, king);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((twin = find_npc_by_name(ch, twinname, strlen(twinname))) != NULL)
|
if ((twin = find_npc_by_name(ch, twinname, (int)strlen(twinname))) != NULL)
|
||||||
if (FIGHTING(twin) && 2 * GET_HIT(twin) < GET_HIT(ch))
|
if (FIGHTING(twin) && 2 * GET_HIT(twin) < GET_HIT(ch))
|
||||||
do_npc_rescue(ch, twin);
|
do_npc_rescue(ch, twin);
|
||||||
|
|
||||||
if (GET_POS(ch) != POS_FIGHTING)
|
if (GET_POS(ch) != POS_FIGHTING)
|
||||||
banzaii(ch);
|
banzaii(ch);
|
||||||
|
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -614,12 +617,12 @@ SPECIAL(James)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Common code for James and the Cleaning Woman. */
|
/* Common code for James and the Cleaning Woman. */
|
||||||
static int castle_cleaner(struct char_data *ch, int cmd, int gripe)
|
static int castle_cleaner(char_data *ch, int cmd, int gripe)
|
||||||
{
|
{
|
||||||
struct obj_data *i;
|
obj_data *i;
|
||||||
|
|
||||||
if (cmd || !AWAKE(ch) || GET_POS(ch) == POS_FIGHTING)
|
if (cmd || !AWAKE(ch) || GET_POS(ch) == POS_FIGHTING)
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
for (i = world[IN_ROOM(ch)].contents; i; i = i->next_content) {
|
for (i = world[IN_ROOM(ch)].contents; i; i = i->next_content) {
|
||||||
if (!is_trash(i))
|
if (!is_trash(i))
|
||||||
@@ -632,10 +635,10 @@ static int castle_cleaner(struct char_data *ch, int cmd, int gripe)
|
|||||||
}
|
}
|
||||||
obj_from_room(i);
|
obj_from_room(i);
|
||||||
obj_to_char(i, ch);
|
obj_to_char(i, ch);
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Routine for the Cleaning Woman. Picks up any trash she finds. */
|
/* Routine for the Cleaning Woman. Picks up any trash she finds. */
|
||||||
@@ -647,36 +650,36 @@ SPECIAL(cleaning)
|
|||||||
/* CastleGuard. Standard routine for ordinary castle guards. */
|
/* CastleGuard. Standard routine for ordinary castle guards. */
|
||||||
SPECIAL(CastleGuard)
|
SPECIAL(CastleGuard)
|
||||||
{
|
{
|
||||||
if (cmd || !AWAKE(ch) || (GET_POS(ch) == POS_FIGHTING))
|
if (cmd || !AWAKE(ch) || GET_POS(ch) == POS_FIGHTING)
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
return (banzaii(ch));
|
return banzaii(ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DicknDave. Routine for the guards Dick and David. */
|
/* DicknDave. Routine for the guards Dick and David. */
|
||||||
SPECIAL(DicknDavid)
|
SPECIAL(DicknDavid)
|
||||||
{
|
{
|
||||||
if (!AWAKE(ch))
|
if (!AWAKE(ch))
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (!cmd && GET_POS(ch) != POS_FIGHTING)
|
if (!cmd && GET_POS(ch) != POS_FIGHTING)
|
||||||
banzaii(ch);
|
banzaii(ch);
|
||||||
|
|
||||||
return (block_way(ch, cmd, argument, castle_virtual(36), 1));
|
return block_way(ch, cmd, argument, castle_virtual(36), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Peter. Routine for Captain of the Guards. */
|
/*Peter. Routine for Captain of the Guards. */
|
||||||
SPECIAL(peter)
|
SPECIAL(peter)
|
||||||
{
|
{
|
||||||
struct char_data *ch_guard = NULL;
|
char_data *ch_guard = NULL;
|
||||||
|
|
||||||
if (cmd || !AWAKE(ch) || GET_POS(ch) == POS_FIGHTING)
|
if (cmd || !AWAKE(ch) || GET_POS(ch) == POS_FIGHTING)
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (banzaii(ch))
|
if (banzaii(ch))
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (!(rand_number(0, 3)) && (ch_guard = find_guard(ch)))
|
if (!rand_number(0, 3) && (ch_guard = find_guard(ch)) != NULL)
|
||||||
switch (rand_number(0, 5)) {
|
switch (rand_number(0, 5)) {
|
||||||
case 0:
|
case 0:
|
||||||
act("$N comes sharply into attention as $n inspects $M.",
|
act("$N comes sharply into attention as $n inspects $M.",
|
||||||
@@ -725,32 +728,32 @@ SPECIAL(peter)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Procedure for Jerry and Michael in x08 of King's Castle. Code by Sapowox
|
/* Procedure for Jerry and Michael in x08 of King's Castle. Code by Sapowox
|
||||||
* modified by Pjotr.(Original code from Master) */
|
* modified by Pjotr.(Original code from Master) */
|
||||||
SPECIAL(jerry)
|
SPECIAL(jerry)
|
||||||
{
|
{
|
||||||
struct char_data *gambler1, *gambler2 = NULL, *tch;
|
char_data *gambler1, *gambler2 = NULL, *tch;
|
||||||
|
|
||||||
if (!AWAKE(ch) || (GET_POS(ch) == POS_FIGHTING))
|
if (!AWAKE(ch) || GET_POS(ch) == POS_FIGHTING)
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (cmd)
|
if (cmd)
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (banzaii(ch) || rand_number(0, 2))
|
if (banzaii(ch) || rand_number(0, 2))
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (!(gambler1 = ch))
|
if ((gambler1 = ch) == NULL)
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (!(gambler2 = find_npc_by_name(ch, "Michael", 7)))
|
if ((gambler2 = find_npc_by_name(ch, "Michael", 7)) == NULL)
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (FIGHTING(gambler1) || FIGHTING(gambler2))
|
if (FIGHTING(gambler1) || FIGHTING(gambler2))
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
|
|
||||||
if (rand_number(0, 1)) {
|
if (rand_number(0, 1)) {
|
||||||
tch = gambler1;
|
tch = gambler1;
|
||||||
@@ -808,5 +811,5 @@ SPECIAL(jerry)
|
|||||||
FALSE, gambler1, 0, gambler2, TO_VICT);
|
FALSE, gambler1, 0, gambler2, TO_VICT);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
+31
-31
@@ -19,20 +19,20 @@
|
|||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
|
|
||||||
/* local scope functions, not used externally */
|
/* local scope functions, not used externally */
|
||||||
static void cedit_disp_menu(struct descriptor_data *d);
|
static void cedit_disp_menu(descriptor_data *d);
|
||||||
static void cedit_save_internally(struct descriptor_data *d);
|
static void cedit_save_internally(descriptor_data *d);
|
||||||
static void cedit_disp_game_play_options(struct descriptor_data *d);
|
static void cedit_disp_game_play_options(descriptor_data *d);
|
||||||
static void cedit_disp_crash_save_options(struct descriptor_data *d);
|
static void cedit_disp_crash_save_options(descriptor_data *d);
|
||||||
static void cedit_disp_room_numbers(struct descriptor_data *d);
|
static void cedit_disp_room_numbers(descriptor_data *d);
|
||||||
static void cedit_disp_operation_options(struct descriptor_data *d);
|
static void cedit_disp_operation_options(descriptor_data *d);
|
||||||
static void cedit_disp_autowiz_options(struct descriptor_data *d);
|
static void cedit_disp_autowiz_options(descriptor_data *d);
|
||||||
static void reassign_rooms(void);
|
static void reassign_rooms(void);
|
||||||
static void cedit_setup(struct descriptor_data *d);
|
static void cedit_setup(descriptor_data *d);
|
||||||
|
|
||||||
|
|
||||||
ACMD(do_oasis_cedit)
|
ACMD(do_oasis_cedit)
|
||||||
{
|
{
|
||||||
struct descriptor_data *d;
|
descriptor_data *d;
|
||||||
char buf1[MAX_STRING_LENGTH];
|
char buf1[MAX_STRING_LENGTH];
|
||||||
|
|
||||||
/* No building as a mob or while being forced. */
|
/* No building as a mob or while being forced. */
|
||||||
@@ -72,7 +72,7 @@ ACMD(do_oasis_cedit)
|
|||||||
cedit_save_to_disk();
|
cedit_save_to_disk();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cedit_setup(struct descriptor_data *d)
|
static void cedit_setup(descriptor_data *d)
|
||||||
{
|
{
|
||||||
/* Create the config_data struct. */
|
/* Create the config_data struct. */
|
||||||
CREATE(OLC_CONFIG(d), struct config_data, 1);
|
CREATE(OLC_CONFIG(d), struct config_data, 1);
|
||||||
@@ -178,7 +178,7 @@ static void cedit_setup(struct descriptor_data *d)
|
|||||||
cedit_disp_menu(d);
|
cedit_disp_menu(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cedit_save_internally(struct descriptor_data *d)
|
static void cedit_save_internally(descriptor_data *d)
|
||||||
{
|
{
|
||||||
/* see if we need to reassign spec procs on rooms */
|
/* see if we need to reassign spec procs on rooms */
|
||||||
int reassign = (CONFIG_DTS_ARE_DUMPS != OLC_CONFIG(d)->play.dts_are_dumps);
|
int reassign = (CONFIG_DTS_ARE_DUMPS != OLC_CONFIG(d)->play.dts_are_dumps);
|
||||||
@@ -578,7 +578,7 @@ int save_config( IDXTYPE nowhere )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Menu functions - The main menu. */
|
/* Menu functions - The main menu. */
|
||||||
static void cedit_disp_menu(struct descriptor_data *d)
|
static void cedit_disp_menu(descriptor_data *d)
|
||||||
{
|
{
|
||||||
|
|
||||||
get_char_colors(d->character);
|
get_char_colors(d->character);
|
||||||
@@ -606,7 +606,7 @@ static void cedit_disp_menu(struct descriptor_data *d)
|
|||||||
OLC_MODE(d) = CEDIT_MAIN_MENU;
|
OLC_MODE(d) = CEDIT_MAIN_MENU;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cedit_disp_game_play_options(struct descriptor_data *d)
|
static void cedit_disp_game_play_options(descriptor_data *d)
|
||||||
{
|
{
|
||||||
int m_opt;
|
int m_opt;
|
||||||
m_opt = OLC_CONFIG(d)->play.map_option;
|
m_opt = OLC_CONFIG(d)->play.map_option;
|
||||||
@@ -679,7 +679,7 @@ static void cedit_disp_game_play_options(struct descriptor_data *d)
|
|||||||
OLC_MODE(d) = CEDIT_GAME_OPTIONS_MENU;
|
OLC_MODE(d) = CEDIT_GAME_OPTIONS_MENU;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cedit_disp_crash_save_options(struct descriptor_data *d)
|
static void cedit_disp_crash_save_options(descriptor_data *d)
|
||||||
{
|
{
|
||||||
get_char_colors(d->character);
|
get_char_colors(d->character);
|
||||||
clear_screen(d);
|
clear_screen(d);
|
||||||
@@ -707,7 +707,7 @@ static void cedit_disp_crash_save_options(struct descriptor_data *d)
|
|||||||
OLC_MODE(d) = CEDIT_CRASHSAVE_OPTIONS_MENU;
|
OLC_MODE(d) = CEDIT_CRASHSAVE_OPTIONS_MENU;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cedit_disp_room_numbers(struct descriptor_data *d)
|
static void cedit_disp_room_numbers(descriptor_data *d)
|
||||||
{
|
{
|
||||||
get_char_colors(d->character);
|
get_char_colors(d->character);
|
||||||
clear_screen(d);
|
clear_screen(d);
|
||||||
@@ -733,7 +733,7 @@ static void cedit_disp_room_numbers(struct descriptor_data *d)
|
|||||||
OLC_MODE(d) = CEDIT_ROOM_NUMBERS_MENU;
|
OLC_MODE(d) = CEDIT_ROOM_NUMBERS_MENU;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cedit_disp_operation_options(struct descriptor_data *d)
|
static void cedit_disp_operation_options(descriptor_data *d)
|
||||||
{
|
{
|
||||||
get_char_colors(d->character);
|
get_char_colors(d->character);
|
||||||
clear_screen(d);
|
clear_screen(d);
|
||||||
@@ -785,7 +785,7 @@ static void cedit_disp_operation_options(struct descriptor_data *d)
|
|||||||
OLC_MODE(d) = CEDIT_OPERATION_OPTIONS_MENU;
|
OLC_MODE(d) = CEDIT_OPERATION_OPTIONS_MENU;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cedit_disp_autowiz_options(struct descriptor_data *d)
|
static void cedit_disp_autowiz_options(descriptor_data *d)
|
||||||
{
|
{
|
||||||
get_char_colors(d->character);
|
get_char_colors(d->character);
|
||||||
clear_screen(d);
|
clear_screen(d);
|
||||||
@@ -804,7 +804,7 @@ static void cedit_disp_autowiz_options(struct descriptor_data *d)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The event handler. */
|
/* The event handler. */
|
||||||
void cedit_parse(struct descriptor_data *d, char *arg)
|
void cedit_parse(descriptor_data *d, char *arg)
|
||||||
{
|
{
|
||||||
char *oldtext = NULL;
|
char *oldtext = NULL;
|
||||||
|
|
||||||
@@ -1520,12 +1520,12 @@ void cedit_parse(struct descriptor_data *d, char *arg)
|
|||||||
write_to_output(d,
|
write_to_output(d,
|
||||||
"That is an invalid choice!\r\n"
|
"That is an invalid choice!\r\n"
|
||||||
"Enter the room's vnum where mortals should load into : ");
|
"Enter the room's vnum where mortals should load into : ");
|
||||||
} else if (real_room(atoi(arg)) == NOWHERE) {
|
} else if (real_room(atoidx(arg)) == NOWHERE) {
|
||||||
write_to_output(d,
|
write_to_output(d,
|
||||||
"That room doesn't exist!\r\n"
|
"That room doesn't exist!\r\n"
|
||||||
"Enter the room's vnum where mortals should load into : ");
|
"Enter the room's vnum where mortals should load into : ");
|
||||||
} else {
|
} else {
|
||||||
OLC_CONFIG(d)->room_nums.mortal_start_room = atoi(arg);
|
OLC_CONFIG(d)->room_nums.mortal_start_room = atoidx(arg);
|
||||||
cedit_disp_room_numbers(d);
|
cedit_disp_room_numbers(d);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1535,12 +1535,12 @@ void cedit_parse(struct descriptor_data *d, char *arg)
|
|||||||
write_to_output(d,
|
write_to_output(d,
|
||||||
"That is an invalid choice!\r\n"
|
"That is an invalid choice!\r\n"
|
||||||
"Enter the room's vnum where immortals should load into : ");
|
"Enter the room's vnum where immortals should load into : ");
|
||||||
} else if (real_room(atoi(arg)) == NOWHERE) {
|
} else if (real_room(atoidx(arg)) == NOWHERE) {
|
||||||
write_to_output(d,
|
write_to_output(d,
|
||||||
"That room doesn't exist!\r\n"
|
"That room doesn't exist!\r\n"
|
||||||
"Enter the room's vnum where immortals should load into : ");
|
"Enter the room's vnum where immortals should load into : ");
|
||||||
} else {
|
} else {
|
||||||
OLC_CONFIG(d)->room_nums.immort_start_room = atoi(arg);
|
OLC_CONFIG(d)->room_nums.immort_start_room = atoidx(arg);
|
||||||
cedit_disp_room_numbers(d);
|
cedit_disp_room_numbers(d);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1550,12 +1550,12 @@ void cedit_parse(struct descriptor_data *d, char *arg)
|
|||||||
write_to_output(d,
|
write_to_output(d,
|
||||||
"That is an invalid choice!\r\n"
|
"That is an invalid choice!\r\n"
|
||||||
"Enter the room's vnum where frozen people should load into : ");
|
"Enter the room's vnum where frozen people should load into : ");
|
||||||
} else if (real_room(atoi(arg)) == NOWHERE) {
|
} else if (real_room(atoidx(arg)) == NOWHERE) {
|
||||||
write_to_output(d,
|
write_to_output(d,
|
||||||
"That room doesn't exist!\r\n"
|
"That room doesn't exist!\r\n"
|
||||||
"Enter the room's vnum where frozen people should load into : ");
|
"Enter the room's vnum where frozen people should load into : ");
|
||||||
} else {
|
} else {
|
||||||
OLC_CONFIG(d)->room_nums.frozen_start_room = atoi(arg);
|
OLC_CONFIG(d)->room_nums.frozen_start_room = atoidx(arg);
|
||||||
cedit_disp_room_numbers(d);
|
cedit_disp_room_numbers(d);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1565,12 +1565,12 @@ void cedit_parse(struct descriptor_data *d, char *arg)
|
|||||||
write_to_output(d,
|
write_to_output(d,
|
||||||
"That is an invalid choice!\r\n"
|
"That is an invalid choice!\r\n"
|
||||||
"Enter the vnum for donation room #1 : ");
|
"Enter the vnum for donation room #1 : ");
|
||||||
} else if (real_room(atoi(arg)) == NOWHERE) {
|
} else if (real_room(atoidx(arg)) == NOWHERE) {
|
||||||
write_to_output(d,
|
write_to_output(d,
|
||||||
"That room doesn't exist!\r\n"
|
"That room doesn't exist!\r\n"
|
||||||
"Enter the vnum for donation room #1 : ");
|
"Enter the vnum for donation room #1 : ");
|
||||||
} else {
|
} else {
|
||||||
OLC_CONFIG(d)->room_nums.donation_room_1 = atoi(arg);
|
OLC_CONFIG(d)->room_nums.donation_room_1 = atoidx(arg);
|
||||||
cedit_disp_room_numbers(d);
|
cedit_disp_room_numbers(d);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1580,12 +1580,12 @@ void cedit_parse(struct descriptor_data *d, char *arg)
|
|||||||
write_to_output(d,
|
write_to_output(d,
|
||||||
"That is an invalid choice!\r\n"
|
"That is an invalid choice!\r\n"
|
||||||
"Enter the vnum for donation room #2 : ");
|
"Enter the vnum for donation room #2 : ");
|
||||||
} else if (real_room(atoi(arg)) == NOWHERE) {
|
} else if (real_room(atoidx(arg)) == NOWHERE) {
|
||||||
write_to_output(d,
|
write_to_output(d,
|
||||||
"That room doesn't exist!\r\n"
|
"That room doesn't exist!\r\n"
|
||||||
"Enter the vnum for donation room #2 : ");
|
"Enter the vnum for donation room #2 : ");
|
||||||
} else {
|
} else {
|
||||||
OLC_CONFIG(d)->room_nums.donation_room_2 = atoi(arg);
|
OLC_CONFIG(d)->room_nums.donation_room_2 = atoidx(arg);
|
||||||
cedit_disp_room_numbers(d);
|
cedit_disp_room_numbers(d);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1595,12 +1595,12 @@ void cedit_parse(struct descriptor_data *d, char *arg)
|
|||||||
write_to_output(d,
|
write_to_output(d,
|
||||||
"That is an invalid choice!\r\n"
|
"That is an invalid choice!\r\n"
|
||||||
"Enter the vnum for donation room #3 : ");
|
"Enter the vnum for donation room #3 : ");
|
||||||
} else if (real_room(atoi(arg)) == NOWHERE) {
|
} else if (real_room(atoidx(arg)) == NOWHERE) {
|
||||||
write_to_output(d,
|
write_to_output(d,
|
||||||
"That room doesn't exist!\r\n"
|
"That room doesn't exist!\r\n"
|
||||||
"Enter the vnum for donation room #3 : ");
|
"Enter the vnum for donation room #3 : ");
|
||||||
} else {
|
} else {
|
||||||
OLC_CONFIG(d)->room_nums.donation_room_3 = atoi(arg);
|
OLC_CONFIG(d)->room_nums.donation_room_3 = atoidx(arg);
|
||||||
cedit_disp_room_numbers(d);
|
cedit_disp_room_numbers(d);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1729,7 +1729,7 @@ static void reassign_rooms(void)
|
|||||||
assign_rooms();
|
assign_rooms();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cedit_string_cleanup(struct descriptor_data *d, int terminator)
|
void cedit_string_cleanup(descriptor_data *d, int terminator)
|
||||||
{
|
{
|
||||||
switch (OLC_MODE(d)) {
|
switch (OLC_MODE(d)) {
|
||||||
case CEDIT_MENU:
|
case CEDIT_MENU:
|
||||||
|
|||||||
+4
-4
@@ -1343,7 +1343,7 @@ int thaco(int class_num, int level)
|
|||||||
/* Roll the 6 stats for a character... each stat is made of the sum of the best
|
/* Roll the 6 stats for a character... each stat is made of the sum of the best
|
||||||
* 3 out of 4 rolls of a 6-sided die. Each class then decides which priority
|
* 3 out of 4 rolls of a 6-sided die. Each class then decides which priority
|
||||||
* will be given for the best to worst stats. */
|
* will be given for the best to worst stats. */
|
||||||
void roll_real_abils(struct char_data *ch)
|
void roll_real_abils(char_data *ch)
|
||||||
{
|
{
|
||||||
int i, j, k, temp;
|
int i, j, k, temp;
|
||||||
ubyte table[6];
|
ubyte table[6];
|
||||||
@@ -1410,7 +1410,7 @@ void roll_real_abils(struct char_data *ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Some initializations for characters, including initial skills */
|
/* Some initializations for characters, including initial skills */
|
||||||
void do_start(struct char_data *ch)
|
void do_start(char_data *ch)
|
||||||
{
|
{
|
||||||
GET_LEVEL(ch) = 1;
|
GET_LEVEL(ch) = 1;
|
||||||
GET_EXP(ch) = 1;
|
GET_EXP(ch) = 1;
|
||||||
@@ -1459,7 +1459,7 @@ void do_start(struct char_data *ch)
|
|||||||
|
|
||||||
/* This function controls the change to maxmove, maxmana, and maxhp for each
|
/* This function controls the change to maxmove, maxmana, and maxhp for each
|
||||||
* class every time they gain a level. */
|
* class every time they gain a level. */
|
||||||
void advance_level(struct char_data *ch)
|
void advance_level(char_data *ch)
|
||||||
{
|
{
|
||||||
int add_hp, add_mana = 0, add_move = 0, i;
|
int add_hp, add_mana = 0, add_move = 0, i;
|
||||||
|
|
||||||
@@ -1537,7 +1537,7 @@ int backstab_mult(int level)
|
|||||||
|
|
||||||
/* invalid_class is used by handler.c to determine if a piece of equipment is
|
/* invalid_class is used by handler.c to determine if a piece of equipment is
|
||||||
* usable by a particular class, based on the ITEM_ANTI_{class} bitvectors. */
|
* usable by a particular class, based on the ITEM_ANTI_{class} bitvectors. */
|
||||||
int invalid_class(struct char_data *ch, struct obj_data *obj)
|
int invalid_class(char_data *ch, obj_data *obj)
|
||||||
{
|
{
|
||||||
if (OBJ_FLAGGED(obj, ITEM_ANTI_MAGIC_USER) && IS_MAGIC_USER(ch))
|
if (OBJ_FLAGGED(obj, ITEM_ANTI_MAGIC_USER) && IS_MAGIC_USER(ch))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|||||||
+3
-3
@@ -15,12 +15,12 @@
|
|||||||
|
|
||||||
/* Functions available through class.c */
|
/* Functions available through class.c */
|
||||||
int backstab_mult(int level);
|
int backstab_mult(int level);
|
||||||
void do_start(struct char_data *ch);
|
void do_start(char_data *ch);
|
||||||
bitvector_t find_class_bitvector(const char *arg);
|
bitvector_t find_class_bitvector(const char *arg);
|
||||||
int invalid_class(struct char_data *ch, struct obj_data *obj);
|
int invalid_class(char_data *ch, obj_data *obj);
|
||||||
int level_exp(int chclass, int level);
|
int level_exp(int chclass, int level);
|
||||||
int parse_class(char arg);
|
int parse_class(char arg);
|
||||||
void roll_real_abils(struct char_data *ch);
|
void roll_real_abils(char_data *ch);
|
||||||
byte saving_throws(int class_num, int type, int level);
|
byte saving_throws(int class_num, int type, int level);
|
||||||
int thaco(int class_num, int level);
|
int thaco(int class_num, int level);
|
||||||
const char *title_female(int chclass, int level);
|
const char *title_female(int chclass, int level);
|
||||||
|
|||||||
+283
-337
File diff suppressed because it is too large
Load Diff
+19
-28
@@ -13,24 +13,18 @@
|
|||||||
#ifndef _COMM_H_
|
#ifndef _COMM_H_
|
||||||
#define _COMM_H_
|
#define _COMM_H_
|
||||||
|
|
||||||
#define NUM_RESERVED_DESCS 8
|
#define NUM_RESERVED_DESCS 8
|
||||||
#define COPYOVER_FILE "copyover.dat"
|
#define COPYOVER_FILE "copyover.dat"
|
||||||
|
|
||||||
/* comm.c */
|
/* comm.c */
|
||||||
void close_socket(struct descriptor_data *d);
|
void close_socket(descriptor_data *d);
|
||||||
void game_info(const char *messg, ...) __attribute__ ((format (printf, 1, 2)));
|
void game_info(const char *messg, ...) __attribute__ ((format (printf, 1, 2)));
|
||||||
size_t send_to_char(struct char_data *ch, const char *messg, ...) __attribute__
|
size_t send_to_char(const char_data *ch, const char *messg, ...) __attribute__((format (printf, 2, 3)));
|
||||||
((format (printf, 2, 3)));
|
void send_to_all(const char *messg, ...) __attribute__ ((format (printf, 1, 2)));
|
||||||
void send_to_all(const char *messg, ...) __attribute__ ((format (printf, 1,
|
void send_to_room(room_rnum room, const char *messg, ...) __attribute__ ((format (printf, 2, 3)));
|
||||||
2)));
|
void send_to_outdoor(const char *messg, ...) __attribute__ ((format (printf, 1, 2)));
|
||||||
void send_to_room(room_rnum room, const char *messg, ...) __attribute__ ((format
|
void send_to_group(const char_data *ch, const struct group_data *group, const char * msg, ...) __attribute__ ((format(printf, 3, 4)));
|
||||||
(printf, 2, 3)));
|
void send_to_range(room_vnum start, room_vnum finish, const char *messg, ...) __attribute__ ((format (printf, 3, 4)));
|
||||||
void send_to_outdoor(const char *messg, ...) __attribute__ ((format (printf, 1,
|
|
||||||
2)));
|
|
||||||
void send_to_group(struct char_data *ch, struct group_data *group, const char * msg, ...) __attribute__ ((format
|
|
||||||
(printf, 3, 4)));
|
|
||||||
void send_to_range(room_vnum start, room_vnum finish, const char *messg, ...)
|
|
||||||
__attribute__ ((format (printf, 3, 4)));
|
|
||||||
|
|
||||||
/* Act type settings and flags */
|
/* Act type settings and flags */
|
||||||
#define TO_ROOM 1 /**< act() type: to everyone in room, except ch. */
|
#define TO_ROOM 1 /**< act() type: to everyone in room, except ch. */
|
||||||
@@ -38,32 +32,29 @@ void send_to_range(room_vnum start, room_vnum finish, const char *messg, ...)
|
|||||||
#define TO_NOTVICT 3 /**< act() type: to everyone in room, not ch or vict_obj. */
|
#define TO_NOTVICT 3 /**< act() type: to everyone in room, not ch or vict_obj. */
|
||||||
#define TO_CHAR 4 /**< act() type: to ch. */
|
#define TO_CHAR 4 /**< act() type: to ch. */
|
||||||
#define TO_GMOTE 5 /**< act() type: to gemote channel (global emote) */
|
#define TO_GMOTE 5 /**< act() type: to gemote channel (global emote) */
|
||||||
#define TO_SLEEP 128 /**< act() flag: to char, even if sleeping */
|
#define TO_SLEEP 128 /**< act() flag: to char, even if sleeping */
|
||||||
#define DG_NO_TRIG 256 /**< act() flag: don't check act trigger */
|
#define DG_NO_TRIG 256 /**< act() flag: don't check act trigger */
|
||||||
|
|
||||||
|
|
||||||
/* act functions */
|
/* act functions */
|
||||||
void perform_act(const char *orig, struct char_data *ch, struct obj_data *obj, void *vict_obj, struct char_data *to);
|
void perform_act(const char *orig, char_data *ch, obj_data *obj, void *vict_obj, char_data *to);
|
||||||
char * act(const char *str, int hide_invisible, struct char_data *ch, struct obj_data *obj, void *vict_obj, int type);
|
char * act(const char *str, int hide_invisible, char_data *ch, obj_data *obj, void *vict_obj, int type);
|
||||||
|
|
||||||
/* I/O functions */
|
/* I/O functions */
|
||||||
void write_to_q(const char *txt, struct txt_q *queue, int aliased);
|
void write_to_q(const char *txt, struct txt_q *queue, int aliased);
|
||||||
int write_to_descriptor(socket_t desc, const char *txt);
|
ssize_t write_to_descriptor(socket_t desc, const char *txt);
|
||||||
size_t write_to_output(struct descriptor_data *d, const char *txt, ...) __attribute__ ((format (printf, 2, 3)));
|
size_t write_to_output(descriptor_data *d, const char *txt, ...) __attribute__ ((format (printf, 2, 3)));
|
||||||
size_t vwrite_to_output(struct descriptor_data *d, const char *format, va_list args);
|
size_t vwrite_to_output(descriptor_data *d, const char *format, va_list args);
|
||||||
|
|
||||||
typedef RETSIGTYPE sigfunc(int);
|
typedef RETSIGTYPE sigfunc(int);
|
||||||
|
|
||||||
void echo_off(struct descriptor_data *d);
|
void echo_off(descriptor_data *d);
|
||||||
void echo_on(struct descriptor_data *d);
|
void echo_on(descriptor_data *d);
|
||||||
void game_loop(socket_t mother_desc);
|
void game_loop(socket_t mother_desc);
|
||||||
void heartbeat(int heart_pulse);
|
void heartbeat(unsigned long heart_pulse);
|
||||||
void copyover_recover(void);
|
void copyover_recover(void);
|
||||||
|
|
||||||
/** webster dictionary lookup */
|
extern descriptor_data *descriptor_list;
|
||||||
extern long last_webster_teller;
|
|
||||||
|
|
||||||
extern struct descriptor_data *descriptor_list;
|
|
||||||
extern int buf_largecount;
|
extern int buf_largecount;
|
||||||
extern int buf_overflows;
|
extern int buf_overflows;
|
||||||
extern int buf_switches;
|
extern int buf_switches;
|
||||||
|
|||||||
@@ -0,0 +1,337 @@
|
|||||||
|
/* src/conf.h.cmake.in. Used as basis for conf.h when building with cmake */
|
||||||
|
|
||||||
|
#ifndef _CONF_H_
|
||||||
|
#define _CONF_H_
|
||||||
|
|
||||||
|
/* Define to empty if the keyword does not work. */
|
||||||
|
#define const @CONST_KEYWORD@
|
||||||
|
|
||||||
|
/* Define if you don't have vprintf but do have _doprnt. */
|
||||||
|
#cmakedefine HAVE_DOPRNT
|
||||||
|
|
||||||
|
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||||
|
#cmakedefine HAVE_SYS_WAIT_H
|
||||||
|
|
||||||
|
/* Define if you have the vprintf function. */
|
||||||
|
#cmakedefine HAVE_VPRINTF
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
|
#cmakedefine pid_t @pid_t@
|
||||||
|
|
||||||
|
/* Define as the return type of signal handlers (int or void). */
|
||||||
|
#define RETSIGTYPE @RETSIGTYPE@
|
||||||
|
|
||||||
|
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||||
|
#cmakedefine size_t @size_t@
|
||||||
|
|
||||||
|
/* Define if you have the ANSI C header files. */
|
||||||
|
#cmakedefine STDC_HEADERS
|
||||||
|
|
||||||
|
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||||
|
#cmakedefine TIME_WITH_SYS_TIME
|
||||||
|
|
||||||
|
/* Define if we're compiling CircleMUD under any type of UNIX system. */
|
||||||
|
#cmakedefine CIRCLE_UNIX
|
||||||
|
|
||||||
|
/* Define if the system is capable of using crypt() to encrypt. */
|
||||||
|
#cmakedefine CIRCLE_CRYPT
|
||||||
|
|
||||||
|
/* Define if we don't have proper support for the system's crypt(). */
|
||||||
|
#cmakedefine HAVE_UNSAFE_CRYPT
|
||||||
|
|
||||||
|
/* Define is the system has struct in_addr. */
|
||||||
|
#cmakedefine HAVE_STRUCT_IN_ADDR
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/socket.h> doesn't define. */
|
||||||
|
#cmakedefine socklen_t @socklen_t@
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
|
#cmakedefine ssize_t @ssize_t@
|
||||||
|
|
||||||
|
/* Define if you have the gettimeofday function. */
|
||||||
|
#cmakedefine HAVE_GETTIMEOFDAY
|
||||||
|
|
||||||
|
/* Define if you have the inet_addr function. */
|
||||||
|
#cmakedefine HAVE_INET_ADDR
|
||||||
|
|
||||||
|
/* Define if you have the inet_aton function. */
|
||||||
|
#cmakedefine HAVE_INET_ATON
|
||||||
|
|
||||||
|
/* Define if you have the select function. */
|
||||||
|
#cmakedefine HAVE_SELECT
|
||||||
|
|
||||||
|
/* Define if you have the snprintf function. */
|
||||||
|
#cmakedefine HAVE_SNPRINTF
|
||||||
|
|
||||||
|
/* Define if you have the strcasecmp function. */
|
||||||
|
#cmakedefine HAVE_STRCASECMP
|
||||||
|
|
||||||
|
/* Define if you have the strdup function. */
|
||||||
|
#cmakedefine HAVE_STRDUP
|
||||||
|
|
||||||
|
/* Define if you have the strerror function. */
|
||||||
|
#cmakedefine HAVE_STRERROR
|
||||||
|
|
||||||
|
/* Define if you have the stricmp function. */
|
||||||
|
#cmakedefine HAVE_STRICMP
|
||||||
|
|
||||||
|
/* Define if you have the strlcpy function. */
|
||||||
|
#cmakedefine HAVE_STRLCPY
|
||||||
|
|
||||||
|
/* Define if you have the strncasecmp function. */
|
||||||
|
#cmakedefine HAVE_STRNCASECMP
|
||||||
|
|
||||||
|
/* Define if you have the strnicmp function. */
|
||||||
|
#cmakedefine HAVE_STRNICMP
|
||||||
|
|
||||||
|
/* Define if you have the strstr function. */
|
||||||
|
#cmakedefine HAVE_STRSTR
|
||||||
|
|
||||||
|
/* Define if you have the vsnprintf function. */
|
||||||
|
#cmakedefine HAVE_VSNPRINTF
|
||||||
|
|
||||||
|
/* Define if you have the <arpa/inet.h> header file. */
|
||||||
|
#cmakedefine HAVE_ARPA_INET_H
|
||||||
|
|
||||||
|
/* Define if you have the <arpa/telnet.h> header file. */
|
||||||
|
#cmakedefine HAVE_ARPA_TELNET_H
|
||||||
|
|
||||||
|
/* Define if you have the <assert.h> header file. */
|
||||||
|
#cmakedefine HAVE_ASSERT_H
|
||||||
|
|
||||||
|
/* Define if you have the <crypt.h> header file. */
|
||||||
|
#cmakedefine HAVE_CRYPT_H
|
||||||
|
|
||||||
|
/* Define if you have the <errno.h> header file. */
|
||||||
|
#cmakedefine HAVE_ERRNO_H
|
||||||
|
|
||||||
|
/* Define if you have the <fcntl.h> header file. */
|
||||||
|
#cmakedefine HAVE_FCNTL_H
|
||||||
|
|
||||||
|
/* Define if you have the <limits.h> header file. */
|
||||||
|
#cmakedefine HAVE_LIMITS_H
|
||||||
|
|
||||||
|
/* Define if you have the <mcheck.h> header file. */
|
||||||
|
#cmakedefine HAVE_MCHECK_H
|
||||||
|
|
||||||
|
/* Define if you have the <memory.h> header file. */
|
||||||
|
#cmakedefine HAVE_MEMORY_H
|
||||||
|
|
||||||
|
/* Define if you have the <net/errno.h> header file. */
|
||||||
|
#cmakedefine HAVE_NET_ERRNO_H
|
||||||
|
|
||||||
|
/* Define if you have the <netdb.h> header file. */
|
||||||
|
#cmakedefine HAVE_NETDB_H
|
||||||
|
|
||||||
|
/* Define if you have the <netinet/in.h> header file. */
|
||||||
|
#cmakedefine HAVE_NETINET_IN_H
|
||||||
|
|
||||||
|
/* Define if you have the <signal.h> header file. */
|
||||||
|
#cmakedefine HAVE_SIGNAL_H
|
||||||
|
|
||||||
|
/* Define if you have the <string.h> header file. */
|
||||||
|
#cmakedefine HAVE_STRING_H
|
||||||
|
|
||||||
|
/* Define if you have the <strings.h> header file. */
|
||||||
|
#cmakedefine HAVE_STRINGS_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/fcntl.h> header file. */
|
||||||
|
#cmakedefine HAVE_SYS_FCNTL_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/resource.h> header file. */
|
||||||
|
#cmakedefine HAVE_SYS_RESOURCE_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/select.h> header file. */
|
||||||
|
#cmakedefine HAVE_SYS_SELECT_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/socket.h> header file. */
|
||||||
|
#cmakedefine HAVE_SYS_SOCKET_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/stat.h> header file. */
|
||||||
|
#cmakedefine HAVE_SYS_STAT_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/time.h> header file. */
|
||||||
|
#cmakedefine HAVE_SYS_TIME_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/types.h> header file. */
|
||||||
|
#cmakedefine HAVE_SYS_TYPES_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/uio.h> header file. */
|
||||||
|
#cmakedefine HAVE_SYS_UIO_H
|
||||||
|
|
||||||
|
/* Define if you have the <unistd.h> header file. */
|
||||||
|
#cmakedefine HAVE_UNISTD_H
|
||||||
|
|
||||||
|
/* Define if you have the malloc library (-lmalloc). */
|
||||||
|
#cmakedefine HAVE_LIBMALLOC
|
||||||
|
|
||||||
|
/* Check for a prototype to accept. */
|
||||||
|
#cmakedefine NEED_ACCEPT_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to atoi. */
|
||||||
|
#cmakedefine NEED_ATOI_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to atol. */
|
||||||
|
#cmakedefine NEED_ATOL_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to bind. */
|
||||||
|
#cmakedefine NEED_BIND_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to bzero. */
|
||||||
|
#cmakedefine NEED_BZERO_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to chdir. */
|
||||||
|
#cmakedefine NEED_CHDIR_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to close. */
|
||||||
|
#cmakedefine NEED_CLOSE_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to crypt. */
|
||||||
|
#cmakedefine NEED_CRYPT_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to fclose. */
|
||||||
|
#cmakedefine NEED_FCLOSE_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to fcntl. */
|
||||||
|
#cmakedefine NEED_FCNTL_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to fflush. */
|
||||||
|
#cmakedefine NEED_FFLUSH_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to fprintf. */
|
||||||
|
#cmakedefine NEED_FPRINTF_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to fputc. */
|
||||||
|
#cmakedefine NEED_FPUTC_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to fputs. */
|
||||||
|
#cmakedefine NEED_FPUTS_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to fread. */
|
||||||
|
#cmakedefine NEED_FREAD_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to fscanf. */
|
||||||
|
#cmakedefine NEED_FSCANF_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to fseek. */
|
||||||
|
#cmakedefine NEED_FSEEK_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to fwrite. */
|
||||||
|
#cmakedefine NEED_FWRITE_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to getpeername. */
|
||||||
|
#cmakedefine NEED_GETPEERNAME_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to getpid. */
|
||||||
|
#cmakedefine NEED_GETPID_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to getrlimit. */
|
||||||
|
#cmakedefine NEED_GETRLIMIT_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to getsockname. */
|
||||||
|
#cmakedefine NEED_GETSOCKNAME_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to gettimeofday. */
|
||||||
|
#cmakedefine NEED_GETTIMEOFDAY_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to htonl. */
|
||||||
|
#cmakedefine NEED_HTONL_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to htons. */
|
||||||
|
#cmakedefine NEED_HTONS_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to inet_addr. */
|
||||||
|
#cmakedefine NEED_INET_ADDR_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to inet_aton. */
|
||||||
|
#cmakedefine NEED_INET_ATON_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to inet_ntoa. */
|
||||||
|
#cmakedefine NEED_INET_NTOA_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to listen. */
|
||||||
|
#cmakedefine NEED_LISTEN_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to ntohl. */
|
||||||
|
#cmakedefine NEED_NTOHL_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to perror. */
|
||||||
|
#cmakedefine NEED_PERROR_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to printf. */
|
||||||
|
#cmakedefine NEED_PRINTF_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to qsort. */
|
||||||
|
#cmakedefine NEED_QSORT_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to read. */
|
||||||
|
#cmakedefine NEED_READ_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to remove. */
|
||||||
|
#cmakedefine NEED_REMOVE_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to rewind. */
|
||||||
|
#cmakedefine NEED_REWIND_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to select. */
|
||||||
|
#cmakedefine NEED_SELECT_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to setitimer. */
|
||||||
|
#cmakedefine NEED_SETITIMER_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to setrlimit. */
|
||||||
|
#cmakedefine NEED_SETRLIMIT_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to setsockopt. */
|
||||||
|
#cmakedefine NEED_SETSOCKOPT_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to snprintf. */
|
||||||
|
#cmakedefine NEED_SNPRINTF_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to socket. */
|
||||||
|
#cmakedefine NEED_SOCKET_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to sprintf. */
|
||||||
|
#cmakedefine NEED_SPRINTF_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to sscanf. */
|
||||||
|
#cmakedefine NEED_SSCANF_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to strcasecmp. */
|
||||||
|
#cmakedefine NEED_STRCASECMP_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to strdup. */
|
||||||
|
#cmakedefine NEED_STRDUP_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to strerror. */
|
||||||
|
#cmakedefine NEED_STRERROR_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to stricmp. */
|
||||||
|
#cmakedefine NEED_STRICMP_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to strlcpy. */
|
||||||
|
#cmakedefine NEED_STRLCPY_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to strncasecmp. */
|
||||||
|
#cmakedefine NEED_STRNCASECMP_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to strnicmp. */
|
||||||
|
#cmakedefine NEED_STRNICMP_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to system. */
|
||||||
|
#cmakedefine NEED_SYSTEM_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to time. */
|
||||||
|
#cmakedefine NEED_TIME_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to unlink. */
|
||||||
|
#cmakedefine NEED_UNLINK_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to vsnprintf. */
|
||||||
|
#cmakedefine NEED_VSNPRINTF_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to write. */
|
||||||
|
#cmakedefine NEED_WRITE_PROTO
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _CONF_H_ */
|
||||||
@@ -0,0 +1,367 @@
|
|||||||
|
#ifndef _CONF_H_
|
||||||
|
#define _CONF_H_
|
||||||
|
|
||||||
|
/* Define to empty if the keyword does not work. */
|
||||||
|
/* #undef const */
|
||||||
|
|
||||||
|
/* Define if you don't have vprintf but do have _doprnt. */
|
||||||
|
/* #undef HAVE_DOPRNT */
|
||||||
|
|
||||||
|
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||||
|
#define HAVE_SYS_WAIT_H 1
|
||||||
|
|
||||||
|
/* Define if you have the vprintf function. */
|
||||||
|
#define HAVE_VPRINTF 1
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
|
/* #undef pid_t */
|
||||||
|
|
||||||
|
/* Define as the return type of signal handlers (int or void). */
|
||||||
|
#define RETSIGTYPE void
|
||||||
|
|
||||||
|
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||||
|
/* #undef size_t */
|
||||||
|
|
||||||
|
/* Define if you have the ANSI C header files. */
|
||||||
|
/* #undef STDC_HEADERS */
|
||||||
|
|
||||||
|
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||||
|
#define TIME_WITH_SYS_TIME 1
|
||||||
|
|
||||||
|
/* Define if we're compiling CircleMUD under any type of UNIX system. */
|
||||||
|
#define CIRCLE_UNIX 1
|
||||||
|
|
||||||
|
/* Machine-specific dependencies for running on modern macOS systems 10.13+ (High Sierra)
|
||||||
|
* Updated by Victor Augusto Borges Dias de Almeida (aka Stoneheart), 26 June 2024.
|
||||||
|
*
|
||||||
|
* Tested on:
|
||||||
|
* - macOS 10.13: High Sierra - September 25, 2017 (Latest: 10.13.6)
|
||||||
|
* - macOS 10.14: Mojave - September 24, 2018 (Latest: 10.14.6)
|
||||||
|
* - macOS 10.15: Catalina - October 7, 2019 (Latest: 10.15.7)
|
||||||
|
* - macOS 11: Big Sur - November 12, 2020 (Latest: 11.7.10)
|
||||||
|
* - macOS 12: Monterey - October 25, 2021 (Latest: 12.7)
|
||||||
|
* - macOS 13: Ventura - November 7, 2022 (Latest: 13.7)
|
||||||
|
* - macOS 14: Sonoma - November 7, 2023 (Latest: 14.3)
|
||||||
|
*
|
||||||
|
* This file works on Apple Silicon Chips (M1, M2, M3) without futher configurations. */
|
||||||
|
#if defined(__APPLE__) && defined(__MACH__)
|
||||||
|
#define CIRCLE_MAC_OS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define if the system is capable of using crypt() to encrypt. */
|
||||||
|
#define CIRCLE_CRYPT 1
|
||||||
|
|
||||||
|
/* Define if we don't have proper support for the system's crypt(). */
|
||||||
|
/* #undef HAVE_UNSAFE_CRYPT */
|
||||||
|
|
||||||
|
/* Define is the system has struct in_addr. */
|
||||||
|
#define HAVE_STRUCT_IN_ADDR 1
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/socket.h> doesn't define. */
|
||||||
|
/* #undef socklen_t */
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
|
/* #undef ssize_t */
|
||||||
|
|
||||||
|
/* Define if you have the gettimeofday function. */
|
||||||
|
#define HAVE_GETTIMEOFDAY 1
|
||||||
|
|
||||||
|
/* Define if you have the inet_addr function. */
|
||||||
|
#define HAVE_INET_ADDR 1
|
||||||
|
|
||||||
|
/* Define if you have the inet_aton function. */
|
||||||
|
#define HAVE_INET_ATON 1
|
||||||
|
|
||||||
|
/* Define if you have the select function. */
|
||||||
|
#define HAVE_SELECT 1
|
||||||
|
|
||||||
|
/* Define if you have the snprintf function. */
|
||||||
|
#define HAVE_SNPRINTF 1
|
||||||
|
|
||||||
|
/* Define if you have the strcasecmp function. */
|
||||||
|
#define HAVE_STRCASECMP 1
|
||||||
|
|
||||||
|
/* Define if you have the strdup function. */
|
||||||
|
#define HAVE_STRDUP 1
|
||||||
|
|
||||||
|
/* Define if you have the strerror function. */
|
||||||
|
#define HAVE_STRERROR 1
|
||||||
|
|
||||||
|
/* Define if you have the stricmp function. */
|
||||||
|
/* #undef HAVE_STRICMP */
|
||||||
|
|
||||||
|
/* Define if you have the strlcpy function. */
|
||||||
|
#ifndef CIRCLE_MAC_OS
|
||||||
|
#define HAVE_STRLCPY 1
|
||||||
|
#else
|
||||||
|
#define HAVE_STRLCPY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define if you have the strncasecmp function. */
|
||||||
|
#define HAVE_STRNCASECMP 1
|
||||||
|
|
||||||
|
/* Define if you have the strnicmp function. */
|
||||||
|
/* #undef HAVE_STRNICMP */
|
||||||
|
|
||||||
|
/* Define if you have the strstr function. */
|
||||||
|
#define HAVE_STRSTR 1
|
||||||
|
|
||||||
|
/* Define if you have the vsnprintf function. */
|
||||||
|
#define HAVE_VSNPRINTF 1
|
||||||
|
|
||||||
|
/* Define if you have the <arpa/inet.h> header file. */
|
||||||
|
#define HAVE_ARPA_INET_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <arpa/telnet.h> header file. */
|
||||||
|
#define HAVE_ARPA_TELNET_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <assert.h> header file. */
|
||||||
|
#define HAVE_ASSERT_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <crypt.h> header file. */
|
||||||
|
/* #undef HAVE_CRYPT_H */
|
||||||
|
#ifdef CIRCLE_MAC_OS
|
||||||
|
#define HAVE_CRYPT_H 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define if you have the <errno.h> header file. */
|
||||||
|
#define HAVE_ERRNO_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <fcntl.h> header file. */
|
||||||
|
#define HAVE_FCNTL_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <limits.h> header file. */
|
||||||
|
#define HAVE_LIMITS_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <mcheck.h> header file. */
|
||||||
|
/* #undef HAVE_MCHECK_H */
|
||||||
|
#ifdef CIRCLE_MAC_OS
|
||||||
|
#define HAVE_MCHECK_H 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define if you have the <memory.h> header file. */
|
||||||
|
#define HAVE_MEMORY_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <net/errno.h> header file. */
|
||||||
|
/* #undef HAVE_NET_ERRNO_H */
|
||||||
|
|
||||||
|
/* Define if you have the <netdb.h> header file. */
|
||||||
|
#define HAVE_NETDB_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <netinet/in.h> header file. */
|
||||||
|
#define HAVE_NETINET_IN_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <signal.h> header file. */
|
||||||
|
#define HAVE_SIGNAL_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <string.h> header file. */
|
||||||
|
#define HAVE_STRING_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <strings.h> header file. */
|
||||||
|
#define HAVE_STRINGS_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <sys/fcntl.h> header file. */
|
||||||
|
#define HAVE_SYS_FCNTL_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <sys/resource.h> header file. */
|
||||||
|
#define HAVE_SYS_RESOURCE_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <sys/select.h> header file. */
|
||||||
|
#define HAVE_SYS_SELECT_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <sys/socket.h> header file. */
|
||||||
|
#define HAVE_SYS_SOCKET_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <sys/stat.h> header file. */
|
||||||
|
#define HAVE_SYS_STAT_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <sys/time.h> header file. */
|
||||||
|
#define HAVE_SYS_TIME_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <sys/types.h> header file. */
|
||||||
|
#define HAVE_SYS_TYPES_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <sys/uio.h> header file. */
|
||||||
|
#define HAVE_SYS_UIO_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <unistd.h> header file. */
|
||||||
|
#define HAVE_UNISTD_H 1
|
||||||
|
|
||||||
|
/* Define if you have the malloc library (-lmalloc). */
|
||||||
|
/* #undef HAVE_LIBMALLOC */
|
||||||
|
|
||||||
|
/* Check for a prototype to accept. */
|
||||||
|
/* #undef NEED_ACCEPT_PROTO */
|
||||||
|
|
||||||
|
#ifndef CIRCLE_MAC_OS
|
||||||
|
/* Check for a prototype to atoi. */
|
||||||
|
#define NEED_ATOI_PROTO
|
||||||
|
/* Check for a prototype to atol. */
|
||||||
|
#define NEED_ATOL_PROTO
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Check for a prototype to bind. */
|
||||||
|
/* #undef NEED_BIND_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to bzero. */
|
||||||
|
/* #undef NEED_BZERO_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to chdir. */
|
||||||
|
/* #undef NEED_CHDIR_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to close. */
|
||||||
|
/* #undef NEED_CLOSE_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to crypt. */
|
||||||
|
/* #undef NEED_CRYPT_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to fclose. */
|
||||||
|
/* #undef NEED_FCLOSE_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to fcntl. */
|
||||||
|
/* #undef NEED_FCNTL_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to fflush. */
|
||||||
|
/* #undef NEED_FFLUSH_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to fprintf. */
|
||||||
|
/* #undef NEED_FPRINTF_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to fputc. */
|
||||||
|
/* #undef NEED_FPUTC_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to fputs. */
|
||||||
|
/* #undef NEED_FPUTS_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to fread. */
|
||||||
|
/* #undef NEED_FREAD_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to fscanf. */
|
||||||
|
/* #undef NEED_FSCANF_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to fseek. */
|
||||||
|
/* #undef NEED_FSEEK_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to fwrite. */
|
||||||
|
/* #undef NEED_FWRITE_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to getpeername. */
|
||||||
|
/* #undef NEED_GETPEERNAME_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to getpid. */
|
||||||
|
/* #undef NEED_GETPID_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to getrlimit. */
|
||||||
|
/* #undef NEED_GETRLIMIT_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to getsockname. */
|
||||||
|
/* #undef NEED_GETSOCKNAME_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to gettimeofday. */
|
||||||
|
/* #undef NEED_GETTIMEOFDAY_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to htonl. */
|
||||||
|
/* #undef NEED_HTONL_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to htons. */
|
||||||
|
/* #undef NEED_HTONS_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to inet_addr. */
|
||||||
|
/* #undef NEED_INET_ADDR_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to inet_aton. */
|
||||||
|
/* #undef NEED_INET_ATON_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to inet_ntoa. */
|
||||||
|
/* #undef NEED_INET_NTOA_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to listen. */
|
||||||
|
/* #undef NEED_LISTEN_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to ntohl. */
|
||||||
|
/* #undef NEED_NTOHL_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to perror. */
|
||||||
|
/* #undef NEED_PERROR_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to printf. */
|
||||||
|
/* #undef NEED_PRINTF_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to qsort. */
|
||||||
|
#ifndef CIRCLE_MAC_OS
|
||||||
|
#define NEED_QSORT_PROTO
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Check for a prototype to read. */
|
||||||
|
/* #undef NEED_READ_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to remove. */
|
||||||
|
/* #undef NEED_REMOVE_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to rewind. */
|
||||||
|
/* #undef NEED_REWIND_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to select. */
|
||||||
|
/* #undef NEED_SELECT_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to setitimer. */
|
||||||
|
/* #undef NEED_SETITIMER_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to setrlimit. */
|
||||||
|
/* #undef NEED_SETRLIMIT_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to setsockopt. */
|
||||||
|
/* #undef NEED_SETSOCKOPT_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to snprintf. */
|
||||||
|
/* #undef NEED_SNPRINTF_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to socket. */
|
||||||
|
/* #undef NEED_SOCKET_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to sprintf. */
|
||||||
|
/* #undef NEED_SPRINTF_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to sscanf. */
|
||||||
|
/* #undef NEED_SSCANF_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to strcasecmp. */
|
||||||
|
/* #undef NEED_STRCASECMP_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to strdup. */
|
||||||
|
/* #undef NEED_STRDUP_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to strerror. */
|
||||||
|
/* #undef NEED_STRERROR_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to stricmp. */
|
||||||
|
#define NEED_STRICMP_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to strlcpy. */
|
||||||
|
/* #undef NEED_STRLCPY_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to strncasecmp. */
|
||||||
|
/* #undef NEED_STRNCASECMP_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to strnicmp. */
|
||||||
|
#define NEED_STRNICMP_PROTO
|
||||||
|
|
||||||
|
/* Check for a prototype to system. */
|
||||||
|
#ifndef CIRCLE_MAC_OS
|
||||||
|
#define NEED_SYSTEM_PROTO
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Check for a prototype to time. */
|
||||||
|
/* #undef NEED_TIME_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to unlink. */
|
||||||
|
/* #undef NEED_UNLINK_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to vsnprintf. */
|
||||||
|
/* #undef NEED_VSNPRINTF_PROTO */
|
||||||
|
|
||||||
|
/* Check for a prototype to write. */
|
||||||
|
/* #undef NEED_WRITE_PROTO */
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _CONF_H_ */
|
||||||
+2
-1
@@ -24,7 +24,7 @@
|
|||||||
* @todo cpp_extern isn't needed here (or anywhere) as the extern reserved word
|
* @todo cpp_extern isn't needed here (or anywhere) as the extern reserved word
|
||||||
* works correctly with C compilers (at least in my Experience)
|
* works correctly with C compilers (at least in my Experience)
|
||||||
* Jeremy Osborne 1/28/2008 */
|
* Jeremy Osborne 1/28/2008 */
|
||||||
cpp_extern const char *tbamud_version = "tbaMUD 2020";
|
cpp_extern const char *tbamud_version = "tbaMUD 2025";
|
||||||
|
|
||||||
/* strings corresponding to ordinals/bitvectors in structs.h */
|
/* strings corresponding to ordinals/bitvectors in structs.h */
|
||||||
/* (Note: strings for class definitions in class.c instead of here) */
|
/* (Note: strings for class definitions in class.c instead of here) */
|
||||||
@@ -877,6 +877,7 @@ const char *trig_types[] = {
|
|||||||
"Door",
|
"Door",
|
||||||
"UNUSED",
|
"UNUSED",
|
||||||
"Time",
|
"Time",
|
||||||
|
"Damage",
|
||||||
"\n"
|
"\n"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -46,14 +46,14 @@ struct config_data config_info; /* Game configuration list. */
|
|||||||
struct room_data *world = NULL; /* array of rooms */
|
struct room_data *world = NULL; /* array of rooms */
|
||||||
room_rnum top_of_world = 0; /* ref to top element of world */
|
room_rnum top_of_world = 0; /* ref to top element of world */
|
||||||
|
|
||||||
struct char_data *character_list = NULL; /* global linked list of chars */
|
char_data *character_list = NULL; /* global linked list of chars */
|
||||||
struct index_data *mob_index; /* index table for mobile file */
|
struct index_data *mob_index; /* index table for mobile file */
|
||||||
struct char_data *mob_proto; /* prototypes for mobs */
|
char_data *mob_proto; /* prototypes for mobs */
|
||||||
mob_rnum top_of_mobt = 0; /* top of mobile index table */
|
mob_rnum top_of_mobt = 0; /* top of mobile index table */
|
||||||
|
|
||||||
struct obj_data *object_list = NULL; /* global linked list of objs */
|
obj_data *object_list = NULL; /* global linked list of objs */
|
||||||
struct index_data *obj_index; /* index table for object file */
|
struct index_data *obj_index; /* index table for object file */
|
||||||
struct obj_data *obj_proto; /* prototypes for objs */
|
obj_data *obj_proto; /* prototypes for objs */
|
||||||
obj_rnum top_of_objt = 0; /* top of object index table */
|
obj_rnum top_of_objt = 0; /* top of object index table */
|
||||||
|
|
||||||
struct zone_data *zone_table; /* zone table */
|
struct zone_data *zone_table; /* zone table */
|
||||||
@@ -128,9 +128,9 @@ static int converting = FALSE;
|
|||||||
|
|
||||||
/* Local (file scope) utility functions */
|
/* Local (file scope) utility functions */
|
||||||
static int check_bitvector_names(bitvector_t bits, size_t namecount, const char *whatami, const char *whatbits);
|
static int check_bitvector_names(bitvector_t bits, size_t namecount, const char *whatami, const char *whatbits);
|
||||||
static int check_object_spell_number(struct obj_data *obj, int val);
|
static int check_object_spell_number(obj_data *obj, int val);
|
||||||
static int check_object_level(struct obj_data *obj, int val);
|
static int check_object_level(obj_data *obj, int val);
|
||||||
static int check_object(struct obj_data *);
|
static int check_object(obj_data *);
|
||||||
static void load_zones(FILE *fl, char *zonename);
|
static void load_zones(FILE *fl, char *zonename);
|
||||||
static int file_to_string(const char *name, char *buf);
|
static int file_to_string(const char *name, char *buf);
|
||||||
static int file_to_string_alloc(const char *name, char **buf);
|
static int file_to_string_alloc(const char *name, char **buf);
|
||||||
@@ -501,15 +501,22 @@ static void free_extra_descriptions(struct extra_descr_data *edesc)
|
|||||||
void destroy_db(void)
|
void destroy_db(void)
|
||||||
{
|
{
|
||||||
ssize_t cnt, itr;
|
ssize_t cnt, itr;
|
||||||
struct char_data *chtmp;
|
char_data *chtmp, *i = character_list;
|
||||||
struct obj_data *objtmp;
|
obj_data *objtmp;
|
||||||
|
|
||||||
/* Active Mobiles & Players */
|
/* Active Mobiles & Players */
|
||||||
|
while (i) {
|
||||||
|
chtmp = i;
|
||||||
|
i = i->next;
|
||||||
|
|
||||||
|
if (chtmp->master)
|
||||||
|
stop_follower(chtmp);
|
||||||
|
}
|
||||||
|
|
||||||
while (character_list) {
|
while (character_list) {
|
||||||
chtmp = character_list;
|
chtmp = character_list;
|
||||||
character_list = character_list->next;
|
character_list = character_list->next;
|
||||||
if (chtmp->master)
|
|
||||||
stop_follower(chtmp);
|
|
||||||
free_char(chtmp);
|
free_char(chtmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1033,17 +1040,17 @@ void index_boot(int mode)
|
|||||||
log(" %d rooms, %d bytes.", rec_count, size[0]);
|
log(" %d rooms, %d bytes.", rec_count, size[0]);
|
||||||
break;
|
break;
|
||||||
case DB_BOOT_MOB:
|
case DB_BOOT_MOB:
|
||||||
CREATE(mob_proto, struct char_data, rec_count);
|
CREATE(mob_proto, char_data, rec_count);
|
||||||
CREATE(mob_index, struct index_data, rec_count);
|
CREATE(mob_index, struct index_data, rec_count);
|
||||||
size[0] = sizeof(struct index_data) * rec_count;
|
size[0] = sizeof(struct index_data) * rec_count;
|
||||||
size[1] = sizeof(struct char_data) * rec_count;
|
size[1] = sizeof(char_data) * rec_count;
|
||||||
log(" %d mobs, %d bytes in index, %d bytes in prototypes.", rec_count, size[0], size[1]);
|
log(" %d mobs, %d bytes in index, %d bytes in prototypes.", rec_count, size[0], size[1]);
|
||||||
break;
|
break;
|
||||||
case DB_BOOT_OBJ:
|
case DB_BOOT_OBJ:
|
||||||
CREATE(obj_proto, struct obj_data, rec_count);
|
CREATE(obj_proto, obj_data, rec_count);
|
||||||
CREATE(obj_index, struct index_data, rec_count);
|
CREATE(obj_index, struct index_data, rec_count);
|
||||||
size[0] = sizeof(struct index_data) * rec_count;
|
size[0] = sizeof(struct index_data) * rec_count;
|
||||||
size[1] = sizeof(struct obj_data) * rec_count;
|
size[1] = sizeof(obj_data) * rec_count;
|
||||||
log(" %d objs, %d bytes in index, %d bytes in prototypes.", rec_count, size[0], size[1]);
|
log(" %d objs, %d bytes in index, %d bytes in prototypes.", rec_count, size[0], size[1]);
|
||||||
break;
|
break;
|
||||||
case DB_BOOT_ZON:
|
case DB_BOOT_ZON:
|
||||||
@@ -1232,6 +1239,24 @@ static bitvector_t asciiflag_conv_aff(char *flag)
|
|||||||
return (flags);
|
return (flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Fix for crashes in the editor when formatting. E-descs are assumed to
|
||||||
|
* end with a \r\n. -Welcor */
|
||||||
|
void ensure_newline_terminated(struct extra_descr_data* new_descr) {
|
||||||
|
char *with_term, *end;
|
||||||
|
|
||||||
|
if (new_descr->description == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
end = strchr(new_descr->description, '\0');
|
||||||
|
if (end > new_descr->description && *(end - 1) != '\n') {
|
||||||
|
CREATE(with_term, char, strlen(new_descr->description) + 3);
|
||||||
|
sprintf(with_term, "%s\r\n", new_descr->description); /* snprintf ok : size checked above*/
|
||||||
|
free(new_descr->description);
|
||||||
|
new_descr->description = with_term;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* load the rooms */
|
/* load the rooms */
|
||||||
void parse_room(FILE *fl, int virtual_nr)
|
void parse_room(FILE *fl, int virtual_nr)
|
||||||
{
|
{
|
||||||
@@ -1301,7 +1326,7 @@ void parse_room(FILE *fl, int virtual_nr)
|
|||||||
world[room_nr].room_flags[2] = asciiflag_conv(flags3);
|
world[room_nr].room_flags[2] = asciiflag_conv(flags3);
|
||||||
world[room_nr].room_flags[3] = asciiflag_conv(flags4);
|
world[room_nr].room_flags[3] = asciiflag_conv(flags4);
|
||||||
|
|
||||||
sprintf(flags, "object #%d", virtual_nr); /* sprintf: OK (until 399-bit integers) */
|
sprintf(flags, "room #%d", virtual_nr); /* sprintf: OK (until 399-bit integers) */
|
||||||
for(taeller=0; taeller < AF_ARRAY_MAX; taeller++)
|
for(taeller=0; taeller < AF_ARRAY_MAX; taeller++)
|
||||||
check_bitvector_names(world[room_nr].room_flags[taeller], room_bits_count, flags, "room");
|
check_bitvector_names(world[room_nr].room_flags[taeller], room_bits_count, flags, "room");
|
||||||
|
|
||||||
@@ -1339,17 +1364,8 @@ void parse_room(FILE *fl, int virtual_nr)
|
|||||||
CREATE(new_descr, struct extra_descr_data, 1);
|
CREATE(new_descr, struct extra_descr_data, 1);
|
||||||
new_descr->keyword = fread_string(fl, buf2);
|
new_descr->keyword = fread_string(fl, buf2);
|
||||||
new_descr->description = fread_string(fl, buf2);
|
new_descr->description = fread_string(fl, buf2);
|
||||||
/* Fix for crashes in the editor when formatting. E-descs are assumed to
|
ensure_newline_terminated(new_descr);
|
||||||
* end with a \r\n. -Welcor */
|
|
||||||
{
|
|
||||||
char *end = strchr(new_descr->description, '\0');
|
|
||||||
if (end > new_descr->description && *(end-1) != '\n') {
|
|
||||||
CREATE(end, char, strlen(new_descr->description)+3);
|
|
||||||
sprintf(end, "%s\r\n", new_descr->description); /* snprintf ok : size checked above*/
|
|
||||||
free(new_descr->description);
|
|
||||||
new_descr->description = end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
new_descr->next = world[room_nr].ex_description;
|
new_descr->next = world[room_nr].ex_description;
|
||||||
world[room_nr].ex_description = new_descr;
|
world[room_nr].ex_description = new_descr;
|
||||||
break;
|
break;
|
||||||
@@ -2333,7 +2349,7 @@ static int hsort(const void *a, const void *b)
|
|||||||
return (str_cmp(a1->keywords, b1->keywords));
|
return (str_cmp(a1->keywords, b1->keywords));
|
||||||
}
|
}
|
||||||
|
|
||||||
int vnum_mobile(char *searchname, struct char_data *ch)
|
int vnum_mobile(char *searchname, char_data *ch)
|
||||||
{
|
{
|
||||||
int nr, found = 0;
|
int nr, found = 0;
|
||||||
|
|
||||||
@@ -2346,7 +2362,7 @@ int vnum_mobile(char *searchname, struct char_data *ch)
|
|||||||
return (found);
|
return (found);
|
||||||
}
|
}
|
||||||
|
|
||||||
int vnum_object(char *searchname, struct char_data *ch)
|
int vnum_object(char *searchname, char_data *ch)
|
||||||
{
|
{
|
||||||
int nr, found = 0;
|
int nr, found = 0;
|
||||||
|
|
||||||
@@ -2359,7 +2375,7 @@ int vnum_object(char *searchname, struct char_data *ch)
|
|||||||
return (found);
|
return (found);
|
||||||
}
|
}
|
||||||
|
|
||||||
int vnum_room(char *searchname, struct char_data *ch)
|
int vnum_room(char *searchname, char_data *ch)
|
||||||
{
|
{
|
||||||
int nr, found = 0;
|
int nr, found = 0;
|
||||||
|
|
||||||
@@ -2371,7 +2387,7 @@ int vnum_room(char *searchname, struct char_data *ch)
|
|||||||
return (found);
|
return (found);
|
||||||
}
|
}
|
||||||
|
|
||||||
int vnum_trig(char *searchname, struct char_data *ch)
|
int vnum_trig(char *searchname, char_data *ch)
|
||||||
{
|
{
|
||||||
int nr, found = 0;
|
int nr, found = 0;
|
||||||
for (nr = 0; nr < top_of_trigt; nr++)
|
for (nr = 0; nr < top_of_trigt; nr++)
|
||||||
@@ -2382,11 +2398,11 @@ int vnum_trig(char *searchname, struct char_data *ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* create a character, and add it to the char list */
|
/* create a character, and add it to the char list */
|
||||||
struct char_data *create_char(void)
|
char_data *create_char(void)
|
||||||
{
|
{
|
||||||
struct char_data *ch;
|
char_data *ch;
|
||||||
|
|
||||||
CREATE(ch, struct char_data, 1);
|
CREATE(ch, char_data, 1);
|
||||||
clear_char(ch);
|
clear_char(ch);
|
||||||
|
|
||||||
new_mobile_data(ch);
|
new_mobile_data(ch);
|
||||||
@@ -2399,7 +2415,7 @@ struct char_data *create_char(void)
|
|||||||
return (ch);
|
return (ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
void new_mobile_data(struct char_data *ch)
|
void new_mobile_data(char_data *ch)
|
||||||
{
|
{
|
||||||
ch->events = NULL;
|
ch->events = NULL;
|
||||||
ch->group = NULL;
|
ch->group = NULL;
|
||||||
@@ -2407,10 +2423,10 @@ void new_mobile_data(struct char_data *ch)
|
|||||||
|
|
||||||
|
|
||||||
/* create a new mobile from a prototype */
|
/* create a new mobile from a prototype */
|
||||||
struct char_data *read_mobile(mob_vnum nr, int type) /* and mob_rnum */
|
char_data *read_mobile(mob_vnum nr, int type) /* and mob_rnum */
|
||||||
{
|
{
|
||||||
mob_rnum i;
|
mob_rnum i;
|
||||||
struct char_data *mob;
|
char_data *mob;
|
||||||
|
|
||||||
if (type == VIRTUAL) {
|
if (type == VIRTUAL) {
|
||||||
if ((i = real_mobile(nr)) == NOBODY) {
|
if ((i = real_mobile(nr)) == NOBODY) {
|
||||||
@@ -2420,7 +2436,7 @@ struct char_data *read_mobile(mob_vnum nr, int type) /* and mob_rnum */
|
|||||||
} else
|
} else
|
||||||
i = nr;
|
i = nr;
|
||||||
|
|
||||||
CREATE(mob, struct char_data, 1);
|
CREATE(mob, char_data, 1);
|
||||||
clear_char(mob);
|
clear_char(mob);
|
||||||
|
|
||||||
*mob = mob_proto[i];
|
*mob = mob_proto[i];
|
||||||
@@ -2454,11 +2470,11 @@ struct char_data *read_mobile(mob_vnum nr, int type) /* and mob_rnum */
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* create an object, and add it to the object list */
|
/* create an object, and add it to the object list */
|
||||||
struct obj_data *create_obj(void)
|
obj_data *create_obj(void)
|
||||||
{
|
{
|
||||||
struct obj_data *obj;
|
obj_data *obj;
|
||||||
|
|
||||||
CREATE(obj, struct obj_data, 1);
|
CREATE(obj, obj_data, 1);
|
||||||
clear_object(obj);
|
clear_object(obj);
|
||||||
obj->next = object_list;
|
obj->next = object_list;
|
||||||
object_list = obj;
|
object_list = obj;
|
||||||
@@ -2471,9 +2487,9 @@ struct obj_data *create_obj(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* create a new object from a prototype */
|
/* create a new object from a prototype */
|
||||||
struct obj_data *read_object(obj_vnum nr, int type) /* and obj_rnum */
|
obj_data *read_object(obj_vnum nr, int type) /* and obj_rnum */
|
||||||
{
|
{
|
||||||
struct obj_data *obj;
|
obj_data *obj;
|
||||||
obj_rnum i = type == VIRTUAL ? real_object(nr) : nr;
|
obj_rnum i = type == VIRTUAL ? real_object(nr) : nr;
|
||||||
|
|
||||||
if (i == NOTHING || i > top_of_objt) {
|
if (i == NOTHING || i > top_of_objt) {
|
||||||
@@ -2481,7 +2497,7 @@ struct obj_data *read_object(obj_vnum nr, int type) /* and obj_rnum */
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATE(obj, struct obj_data, 1);
|
CREATE(obj, obj_data, 1);
|
||||||
clear_object(obj);
|
clear_object(obj);
|
||||||
*obj = obj_proto[i];
|
*obj = obj_proto[i];
|
||||||
obj->next = object_list;
|
obj->next = object_list;
|
||||||
@@ -2549,7 +2565,7 @@ void zone_update(void)
|
|||||||
reset_zone(update_u->zone_to_reset);
|
reset_zone(update_u->zone_to_reset);
|
||||||
mudlog(CMP, LVL_IMPL+1, FALSE, "Auto zone reset: %s (Zone %d)",
|
mudlog(CMP, LVL_IMPL+1, FALSE, "Auto zone reset: %s (Zone %d)",
|
||||||
zone_table[update_u->zone_to_reset].name, zone_table[update_u->zone_to_reset].number);
|
zone_table[update_u->zone_to_reset].name, zone_table[update_u->zone_to_reset].number);
|
||||||
struct descriptor_data *pt;
|
descriptor_data *pt;
|
||||||
for (pt = descriptor_list; pt; pt = pt->next)
|
for (pt = descriptor_list; pt; pt = pt->next)
|
||||||
if (IS_PLAYING(pt) && pt->character && PRF_FLAGGED(pt->character, PRF_ZONERESETS))
|
if (IS_PLAYING(pt) && pt->character && PRF_FLAGGED(pt->character, PRF_ZONERESETS))
|
||||||
send_to_char(pt->character, "%s[Auto zone reset: %s (Zone %d)]%s",
|
send_to_char(pt->character, "%s[Auto zone reset: %s (Zone %d)]%s",
|
||||||
@@ -2587,12 +2603,12 @@ static void log_zone_error(zone_rnum zone, int cmd_no, const char *message)
|
|||||||
void reset_zone(zone_rnum zone)
|
void reset_zone(zone_rnum zone)
|
||||||
{
|
{
|
||||||
int cmd_no, last_cmd = 0;
|
int cmd_no, last_cmd = 0;
|
||||||
struct char_data *mob = NULL;
|
char_data *mob = NULL;
|
||||||
struct obj_data *obj, *obj_to;
|
obj_data *obj, *obj_to;
|
||||||
room_vnum rvnum;
|
room_vnum rvnum;
|
||||||
room_rnum rrnum;
|
room_rnum rrnum;
|
||||||
struct char_data *tmob=NULL; /* for trigger assignment */
|
char_data *tmob=NULL; /* for trigger assignment */
|
||||||
struct obj_data *tobj=NULL; /* for trigger assignment */
|
obj_data *tobj=NULL; /* for trigger assignment */
|
||||||
|
|
||||||
for (cmd_no = 0; ZCMD.command != 'S'; cmd_no++) {
|
for (cmd_no = 0; ZCMD.command != 'S'; cmd_no++) {
|
||||||
|
|
||||||
@@ -2819,7 +2835,7 @@ void reset_zone(zone_rnum zone)
|
|||||||
/* for use in reset_zone; return TRUE if zone 'nr' is free of PC's */
|
/* for use in reset_zone; return TRUE if zone 'nr' is free of PC's */
|
||||||
int is_empty(zone_rnum zone_nr)
|
int is_empty(zone_rnum zone_nr)
|
||||||
{
|
{
|
||||||
struct descriptor_data *i;
|
descriptor_data *i;
|
||||||
|
|
||||||
for (i = descriptor_list; i; i = i->next) {
|
for (i = descriptor_list; i; i = i->next) {
|
||||||
if (STATE(i) != CON_PLAYING)
|
if (STATE(i) != CON_PLAYING)
|
||||||
@@ -2857,12 +2873,16 @@ char *fread_string(FILE *fl, const char *error)
|
|||||||
/* If there is a '~', end the string; else put an "\r\n" over the '\n'. */
|
/* If there is a '~', end the string; else put an "\r\n" over the '\n'. */
|
||||||
/* now only removes trailing ~'s -- Welcor */
|
/* now only removes trailing ~'s -- Welcor */
|
||||||
point = strchr(tmp, '\0');
|
point = strchr(tmp, '\0');
|
||||||
for (point-- ; (*point=='\r' || *point=='\n'); point--);
|
for (point-- ; (*point=='\r' || *point=='\n') && point > tmp; point--);
|
||||||
if (*point=='~') {
|
if (*point=='~') {
|
||||||
*point='\0';
|
*point='\0';
|
||||||
done = 1;
|
done = 1;
|
||||||
} else {
|
} else {
|
||||||
*(++point) = '\r';
|
if (*point == '\n' || *point == '\r')
|
||||||
|
*point = '\r';
|
||||||
|
else
|
||||||
|
*(++point) = '\r';
|
||||||
|
|
||||||
*(++point) = '\n';
|
*(++point) = '\n';
|
||||||
*(++point) = '\0';
|
*(++point) = '\0';
|
||||||
}
|
}
|
||||||
@@ -3206,7 +3226,7 @@ static void free_followers(struct follow_type *k)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* release memory allocated for a char struct */
|
/* release memory allocated for a char struct */
|
||||||
void free_char(struct char_data *ch)
|
void free_char(char_data *ch)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct alias_data *a;
|
struct alias_data *a;
|
||||||
@@ -3300,7 +3320,7 @@ void free_char(struct char_data *ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* release memory allocated for an obj struct */
|
/* release memory allocated for an obj struct */
|
||||||
void free_obj(struct obj_data *obj)
|
void free_obj(obj_data *obj)
|
||||||
{
|
{
|
||||||
if (GET_OBJ_RNUM(obj) == NOWHERE) {
|
if (GET_OBJ_RNUM(obj) == NOWHERE) {
|
||||||
free_object_strings(obj);
|
free_object_strings(obj);
|
||||||
@@ -3337,7 +3357,7 @@ static int file_to_string_alloc(const char *name, char **buf)
|
|||||||
{
|
{
|
||||||
int temppage;
|
int temppage;
|
||||||
char temp[MAX_STRING_LENGTH];
|
char temp[MAX_STRING_LENGTH];
|
||||||
struct descriptor_data *in_use;
|
descriptor_data *in_use;
|
||||||
|
|
||||||
for (in_use = descriptor_list; in_use; in_use = in_use->next)
|
for (in_use = descriptor_list; in_use; in_use = in_use->next)
|
||||||
if (in_use->showstr_vector && *in_use->showstr_vector == *buf)
|
if (in_use->showstr_vector && *in_use->showstr_vector == *buf)
|
||||||
@@ -3415,7 +3435,7 @@ static int file_to_string(const char *name, char *buf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* clear some of the the working variables of a char */
|
/* clear some of the the working variables of a char */
|
||||||
void reset_char(struct char_data *ch)
|
void reset_char(char_data *ch)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -3447,9 +3467,9 @@ void reset_char(struct char_data *ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* clear ALL the working variables of a char; do NOT free any space alloc'ed */
|
/* clear ALL the working variables of a char; do NOT free any space alloc'ed */
|
||||||
void clear_char(struct char_data *ch)
|
void clear_char(char_data *ch)
|
||||||
{
|
{
|
||||||
memset((char *) ch, 0, sizeof(struct char_data));
|
memset((char *) ch, 0, sizeof(char_data));
|
||||||
|
|
||||||
IN_ROOM(ch) = NOWHERE;
|
IN_ROOM(ch) = NOWHERE;
|
||||||
GET_PFILEPOS(ch) = -1;
|
GET_PFILEPOS(ch) = -1;
|
||||||
@@ -3464,9 +3484,9 @@ void clear_char(struct char_data *ch)
|
|||||||
ch->points.max_mana = 100;
|
ch->points.max_mana = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear_object(struct obj_data *obj)
|
void clear_object(obj_data *obj)
|
||||||
{
|
{
|
||||||
memset((char *) obj, 0, sizeof(struct obj_data));
|
memset((char *) obj, 0, sizeof(obj_data));
|
||||||
|
|
||||||
obj->item_number = NOTHING;
|
obj->item_number = NOTHING;
|
||||||
IN_ROOM(obj) = NOWHERE;
|
IN_ROOM(obj) = NOWHERE;
|
||||||
@@ -3475,7 +3495,7 @@ void clear_object(struct obj_data *obj)
|
|||||||
|
|
||||||
/* Called during character creation after picking character class (and then
|
/* Called during character creation after picking character class (and then
|
||||||
* never again for that character). */
|
* never again for that character). */
|
||||||
void init_char(struct char_data *ch)
|
void init_char(char_data *ch)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -3577,7 +3597,7 @@ room_rnum real_room(room_vnum vnum)
|
|||||||
bot = 0;
|
bot = 0;
|
||||||
top = top_of_world;
|
top = top_of_world;
|
||||||
|
|
||||||
if (world[bot].number > vnum || world[top].number < vnum)
|
if (vnum == NOWHERE || world[bot].number > vnum || world[top].number < vnum)
|
||||||
return (NOWHERE);
|
return (NOWHERE);
|
||||||
|
|
||||||
/* perform binary search on world-table */
|
/* perform binary search on world-table */
|
||||||
@@ -3603,7 +3623,7 @@ mob_rnum real_mobile(mob_vnum vnum)
|
|||||||
top = top_of_mobt;
|
top = top_of_mobt;
|
||||||
|
|
||||||
/* quickly reject out-of-range vnums */
|
/* quickly reject out-of-range vnums */
|
||||||
if (mob_index[bot].vnum > vnum || mob_index[top].vnum < vnum)
|
if (vnum == NOBODY || mob_index[bot].vnum > vnum || mob_index[top].vnum < vnum)
|
||||||
return (NOBODY);
|
return (NOBODY);
|
||||||
|
|
||||||
/* perform binary search on mob-table */
|
/* perform binary search on mob-table */
|
||||||
@@ -3629,7 +3649,7 @@ obj_rnum real_object(obj_vnum vnum)
|
|||||||
top = top_of_objt;
|
top = top_of_objt;
|
||||||
|
|
||||||
/* quickly reject out-of-range vnums */
|
/* quickly reject out-of-range vnums */
|
||||||
if (obj_index[bot].vnum > vnum || obj_index[top].vnum < vnum)
|
if (vnum == NOTHING || obj_index[bot].vnum > vnum || obj_index[top].vnum < vnum)
|
||||||
return (NOTHING);
|
return (NOTHING);
|
||||||
|
|
||||||
/* perform binary search on obj-table */
|
/* perform binary search on obj-table */
|
||||||
@@ -3654,7 +3674,7 @@ zone_rnum real_zone(zone_vnum vnum)
|
|||||||
bot = 0;
|
bot = 0;
|
||||||
top = top_of_zone_table;
|
top = top_of_zone_table;
|
||||||
|
|
||||||
if (zone_table[bot].number > vnum || zone_table[top].number < vnum)
|
if (vnum == NOWHERE || zone_table[bot].number > vnum || zone_table[top].number < vnum)
|
||||||
return (NOWHERE);
|
return (NOWHERE);
|
||||||
|
|
||||||
/* perform binary search on zone-table */
|
/* perform binary search on zone-table */
|
||||||
@@ -3672,7 +3692,7 @@ zone_rnum real_zone(zone_vnum vnum)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Extend later to include more checks and add checks for unknown bitvectors. */
|
/* Extend later to include more checks and add checks for unknown bitvectors. */
|
||||||
static int check_object(struct obj_data *obj)
|
static int check_object(obj_data *obj)
|
||||||
{
|
{
|
||||||
char objname[MAX_INPUT_LENGTH + 32];
|
char objname[MAX_INPUT_LENGTH + 32];
|
||||||
int error = FALSE, y;
|
int error = FALSE, y;
|
||||||
@@ -3750,7 +3770,7 @@ static int check_object(struct obj_data *obj)
|
|||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int check_object_spell_number(struct obj_data *obj, int val)
|
static int check_object_spell_number(obj_data *obj, int val)
|
||||||
{
|
{
|
||||||
int error = FALSE;
|
int error = FALSE;
|
||||||
const char *spellname;
|
const char *spellname;
|
||||||
@@ -3784,7 +3804,7 @@ static int check_object_spell_number(struct obj_data *obj, int val)
|
|||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int check_object_level(struct obj_data *obj, int val)
|
static int check_object_level(obj_data *obj, int val)
|
||||||
{
|
{
|
||||||
int error = FALSE;
|
int error = FALSE;
|
||||||
|
|
||||||
|
|||||||
@@ -15,98 +15,98 @@
|
|||||||
|
|
||||||
|
|
||||||
/* arbitrary constants used by index_boot() (must be unique) */
|
/* arbitrary constants used by index_boot() (must be unique) */
|
||||||
#define DB_BOOT_WLD 0
|
#define DB_BOOT_WLD 0
|
||||||
#define DB_BOOT_MOB 1
|
#define DB_BOOT_MOB 1
|
||||||
#define DB_BOOT_OBJ 2
|
#define DB_BOOT_OBJ 2
|
||||||
#define DB_BOOT_ZON 3
|
#define DB_BOOT_ZON 3
|
||||||
#define DB_BOOT_SHP 4
|
#define DB_BOOT_SHP 4
|
||||||
#define DB_BOOT_HLP 5
|
#define DB_BOOT_HLP 5
|
||||||
#define DB_BOOT_TRG 6
|
#define DB_BOOT_TRG 6
|
||||||
#define DB_BOOT_QST 7
|
#define DB_BOOT_QST 7
|
||||||
|
|
||||||
#if defined(CIRCLE_MACINTOSH)
|
#if defined(CIRCLE_MACINTOSH)
|
||||||
#define LIB_WORLD ":world:"
|
#define LIB_WORLD ":world:"
|
||||||
#define LIB_TEXT ":text:"
|
#define LIB_TEXT ":text:"
|
||||||
#define LIB_TEXT_HELP ":text:help:"
|
#define LIB_TEXT_HELP ":text:help:"
|
||||||
#define LIB_MISC ":misc:"
|
#define LIB_MISC ":misc:"
|
||||||
#define LIB_ETC ":etc:"
|
#define LIB_ETC ":etc:"
|
||||||
#define LIB_PLRTEXT ":plrtext:"
|
#define LIB_PLRTEXT ":plrtext:"
|
||||||
#define LIB_PLROBJS ":plrobjs:"
|
#define LIB_PLROBJS ":plrobjs:"
|
||||||
#define LIB_PLRVARS ":plrvars:"
|
#define LIB_PLRVARS ":plrvars:"
|
||||||
#define LIB_PLRFILES ":plrfiles:"
|
#define LIB_PLRFILES ":plrfiles:"
|
||||||
#define LIB_HOUSE ":house:"
|
#define LIB_HOUSE ":house:"
|
||||||
#define SLASH ":"
|
#define SLASH ":"
|
||||||
#elif defined(CIRCLE_AMIGA) || defined(CIRCLE_UNIX) || defined(CIRCLE_WINDOWS) || defined(CIRCLE_ACORN) || defined(CIRCLE_VMS)
|
#elif defined(CIRCLE_AMIGA) || defined(CIRCLE_UNIX) || defined(CIRCLE_WINDOWS) || defined(CIRCLE_ACORN) || defined(CIRCLE_VMS)
|
||||||
#define LIB_WORLD "world/"
|
#define LIB_WORLD "world/"
|
||||||
#define LIB_TEXT "text/"
|
#define LIB_TEXT "text/"
|
||||||
#define LIB_TEXT_HELP "text/help/"
|
#define LIB_TEXT_HELP "text/help/"
|
||||||
#define LIB_MISC "misc/"
|
#define LIB_MISC "misc/"
|
||||||
#define LIB_ETC "etc/"
|
#define LIB_ETC "etc/"
|
||||||
#define LIB_PLRTEXT "plrtext/"
|
#define LIB_PLRTEXT "plrtext/"
|
||||||
#define LIB_PLROBJS "plrobjs/"
|
#define LIB_PLROBJS "plrobjs/"
|
||||||
#define LIB_PLRVARS "plrvars/"
|
#define LIB_PLRVARS "plrvars/"
|
||||||
#define LIB_HOUSE "house/"
|
#define LIB_HOUSE "house/"
|
||||||
#define LIB_PLRFILES "plrfiles/"
|
#define LIB_PLRFILES "plrfiles/"
|
||||||
#define SLASH "/"
|
#define SLASH "/"
|
||||||
#else
|
#else
|
||||||
#error "Unknown path components."
|
#error "Unknown path components."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SUF_OBJS "objs"
|
#define SUF_OBJS "objs"
|
||||||
#define SUF_TEXT "text"
|
#define SUF_TEXT "text"
|
||||||
#define SUF_MEM "mem"
|
#define SUF_MEM "mem"
|
||||||
#define SUF_PLR "plr"
|
#define SUF_PLR "plr"
|
||||||
|
|
||||||
#if defined(CIRCLE_AMIGA)
|
#if defined(CIRCLE_AMIGA)
|
||||||
#define EXE_FILE "/bin/circle" /* maybe use argv[0] but it's not reliable */
|
#define EXE_FILE "/bin/circle" /* maybe use argv[0] but it's not reliable */
|
||||||
#define KILLSCRIPT_FILE "/.killscript" /* autorun: shut mud down */
|
#define KILLSCRIPT_FILE "/.killscript" /* autorun: shut mud down */
|
||||||
#define PAUSE_FILE "/pause" /* autorun: don't restart mud */
|
#define PAUSE_FILE "/pause" /* autorun: don't restart mud */
|
||||||
#elif defined(CIRCLE_MACINTOSH)
|
#elif defined(CIRCLE_MACINTOSH)
|
||||||
#define EXE_FILE "::bin:circle" /* maybe use argv[0] but it's not reliable */
|
#define EXE_FILE "::bin:circle" /* maybe use argv[0] but it's not reliable */
|
||||||
#define FASTBOOT_FILE "::.fastboot" /* autorun: boot without sleep */
|
#define FASTBOOT_FILE "::.fastboot" /* autorun: boot without sleep */
|
||||||
#define KILLSCRIPT_FILE "::.killscript" /* autorun: shut mud down */
|
#define KILLSCRIPT_FILE "::.killscript" /* autorun: shut mud down */
|
||||||
#define PAUSE_FILE "::pause" /* autorun: don't restart mud */
|
#define PAUSE_FILE "::pause" /* autorun: don't restart mud */
|
||||||
#else
|
#else
|
||||||
#define EXE_FILE "bin/circle" /* maybe use argv[0] but it's not reliable */
|
#define EXE_FILE "bin/circle" /* maybe use argv[0] but it's not reliable */
|
||||||
#define FASTBOOT_FILE "../.fastboot" /* autorun: boot without sleep */
|
#define FASTBOOT_FILE "../.fastboot" /* autorun: boot without sleep */
|
||||||
#define KILLSCRIPT_FILE "../.killscript"/* autorun: shut mud down */
|
#define KILLSCRIPT_FILE "../.killscript"/* autorun: shut mud down */
|
||||||
#define PAUSE_FILE "../pause" /* autorun: don't restart mud */
|
#define PAUSE_FILE "../pause" /* autorun: don't restart mud */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* names of various files and directories */
|
/* names of various files and directories */
|
||||||
#define INDEX_FILE "index" /* index of world files */
|
#define INDEX_FILE "index" /* index of world files */
|
||||||
#define MINDEX_FILE "index.mini" /* ... and for mini-mud-mode */
|
#define MINDEX_FILE "index.mini" /* ... and for mini-mud-mode */
|
||||||
#define WLD_PREFIX LIB_WORLD"wld"SLASH /* room definitions */
|
#define WLD_PREFIX LIB_WORLD"wld"SLASH /* room definitions */
|
||||||
#define MOB_PREFIX LIB_WORLD"mob"SLASH /* monster prototypes */
|
#define MOB_PREFIX LIB_WORLD"mob"SLASH /* monster prototypes */
|
||||||
#define OBJ_PREFIX LIB_WORLD"obj"SLASH /* object prototypes */
|
#define OBJ_PREFIX LIB_WORLD"obj"SLASH /* object prototypes */
|
||||||
#define ZON_PREFIX LIB_WORLD"zon"SLASH /* zon defs & command tables */
|
#define ZON_PREFIX LIB_WORLD"zon"SLASH /* zon defs & command tables */
|
||||||
#define SHP_PREFIX LIB_WORLD"shp"SLASH /* shop definitions */
|
#define SHP_PREFIX LIB_WORLD"shp"SLASH /* shop definitions */
|
||||||
#define TRG_PREFIX LIB_WORLD"trg"SLASH /* trigger files */
|
#define TRG_PREFIX LIB_WORLD"trg"SLASH /* trigger files */
|
||||||
#define HLP_PREFIX LIB_TEXT"help"SLASH /* Help files */
|
#define HLP_PREFIX LIB_TEXT"help"SLASH /* Help files */
|
||||||
#define QST_PREFIX LIB_WORLD"qst"SLASH /* quest files */
|
#define QST_PREFIX LIB_WORLD"qst"SLASH /* quest files */
|
||||||
|
|
||||||
#define CREDITS_FILE LIB_TEXT"credits" /* for the 'credits' command */
|
#define CREDITS_FILE LIB_TEXT"credits" /* for the 'credits' command */
|
||||||
#define NEWS_FILE LIB_TEXT"news" /* for the 'news' command */
|
#define NEWS_FILE LIB_TEXT"news" /* for the 'news' command */
|
||||||
#define MOTD_FILE LIB_TEXT"motd" /* messages of the day / mortal */
|
#define MOTD_FILE LIB_TEXT"motd" /* messages of the day / mortal */
|
||||||
#define IMOTD_FILE LIB_TEXT"imotd" /* messages of the day / immort */
|
#define IMOTD_FILE LIB_TEXT"imotd" /* messages of the day / immort */
|
||||||
#define GREETINGS_FILE LIB_TEXT"greetings" /* The opening screen. */
|
#define GREETINGS_FILE LIB_TEXT"greetings" /* The opening screen. */
|
||||||
#define HELP_PAGE_FILE LIB_TEXT_HELP"help" /* for HELP <CR> */
|
#define HELP_PAGE_FILE LIB_TEXT_HELP"help" /* for HELP <CR> */
|
||||||
#define IHELP_PAGE_FILE LIB_TEXT_HELP"ihelp" /* for HELP <CR> imms */
|
#define IHELP_PAGE_FILE LIB_TEXT_HELP"ihelp" /* for HELP <CR> imms */
|
||||||
#define INFO_FILE LIB_TEXT"info" /* for INFO */
|
#define INFO_FILE LIB_TEXT"info" /* for INFO */
|
||||||
#define WIZLIST_FILE LIB_TEXT"wizlist" /* for WIZLIST */
|
#define WIZLIST_FILE LIB_TEXT"wizlist" /* for WIZLIST */
|
||||||
#define IMMLIST_FILE LIB_TEXT"immlist" /* for IMMLIST */
|
#define IMMLIST_FILE LIB_TEXT"immlist" /* for IMMLIST */
|
||||||
#define BACKGROUND_FILE LIB_TEXT"background"/* for the background story */
|
#define BACKGROUND_FILE LIB_TEXT"background" /* for the background story */
|
||||||
#define POLICIES_FILE LIB_TEXT"policies" /* player policies/rules */
|
#define POLICIES_FILE LIB_TEXT"policies" /* player policies/rules */
|
||||||
#define HANDBOOK_FILE LIB_TEXT"handbook" /* handbook for new immorts */
|
#define HANDBOOK_FILE LIB_TEXT"handbook" /* handbook for new immorts */
|
||||||
#define HELP_FILE "help.hlp"
|
#define HELP_FILE "help.hlp"
|
||||||
|
|
||||||
#define IDEAS_FILE LIB_MISC"ideas" /* for the 'idea'-command */
|
#define IDEAS_FILE LIB_MISC"ideas" /* for the 'idea'-command */
|
||||||
#define TYPOS_FILE LIB_MISC"typos" /* 'typo' */
|
#define TYPOS_FILE LIB_MISC"typos" /* 'typo' */
|
||||||
#define BUGS_FILE LIB_MISC"bugs" /* 'bug' */
|
#define BUGS_FILE LIB_MISC"bugs" /* 'bug' */
|
||||||
#define MESS_FILE LIB_MISC"messages" /* damage messages */
|
#define MESS_FILE LIB_MISC"messages" /* damage messages */
|
||||||
#define SOCMESS_FILE LIB_MISC"socials" /* messages for social acts */
|
#define SOCMESS_FILE LIB_MISC"socials" /* messages for social acts */
|
||||||
#define SOCMESS_FILE_NEW LIB_MISC"socials.new" /* messages for social acts with aedit patch*/
|
#define SOCMESS_FILE_NEW LIB_MISC"socials.new" /* messages for social acts with aedit patch*/
|
||||||
#define XNAME_FILE LIB_MISC"xnames" /* invalid name substrings */
|
#define XNAME_FILE LIB_MISC"xnames" /* invalid name substrings */
|
||||||
|
|
||||||
/* BEGIN: Assumed default locations for logfiles, mainly used in do_file. */
|
/* BEGIN: Assumed default locations for logfiles, mainly used in do_file. */
|
||||||
/**/
|
/**/
|
||||||
@@ -129,109 +129,108 @@
|
|||||||
/**/
|
/**/
|
||||||
/* END: Assumed default locations for logfiles, mainly used in do_file. */
|
/* END: Assumed default locations for logfiles, mainly used in do_file. */
|
||||||
|
|
||||||
#define CONFIG_FILE LIB_ETC"config" /* OasisOLC * GAME CONFIG FL */
|
#define CONFIG_FILE LIB_ETC"config" /* OasisOLC * GAME CONFIG FL */
|
||||||
#define PLAYER_FILE LIB_ETC"players" /* the player database */
|
#define PLAYER_FILE LIB_ETC"players" /* the player database */
|
||||||
#define MAIL_FILE LIB_ETC"plrmail" /* for the mudmail system */
|
#define MAIL_FILE LIB_ETC"plrmail" /* for the mudmail system */
|
||||||
#define MAIL_FILE_TMP LIB_ETC"plrmail_tmp" /* for the mudmail system */
|
#define MAIL_FILE_TMP LIB_ETC"plrmail_tmp" /* for the mudmail system */
|
||||||
#define BAN_FILE LIB_ETC"badsites" /* for the siteban system */
|
#define BAN_FILE LIB_ETC"badsites" /* for the siteban system */
|
||||||
#define HCONTROL_FILE LIB_ETC"hcontrol" /* for the house system */
|
#define HCONTROL_FILE LIB_ETC"hcontrol" /* for the house system */
|
||||||
#define TIME_FILE LIB_ETC"time" /* for calendar system */
|
#define TIME_FILE LIB_ETC"time" /* for calendar system */
|
||||||
#define CHANGE_LOG_FILE "../changelog" /* for the changelog */
|
#define CHANGE_LOG_FILE "../changelog" /* for the changelog */
|
||||||
|
|
||||||
/* new bitvector data for use in player_index_element */
|
/* new bitvector data for use in player_index_element */
|
||||||
#define PINDEX_DELETED (1 << 0) /* deleted player */
|
#define PINDEX_DELETED (1 << 0) /* deleted player */
|
||||||
#define PINDEX_NODELETE (1 << 1) /* protected player */
|
#define PINDEX_NODELETE (1 << 1) /* protected player */
|
||||||
#define PINDEX_SELFDELETE (1 << 2) /* player is selfdeleting*/
|
#define PINDEX_SELFDELETE (1 << 2) /* player is selfdeleting */
|
||||||
#define PINDEX_NOWIZLIST (1 << 3) /* Player shouldn't be on wizlist*/
|
#define PINDEX_NOWIZLIST (1 << 3) /* Player shouldn't be on wizlist */
|
||||||
|
|
||||||
#define REAL 0
|
#define REAL 0
|
||||||
#define VIRTUAL 1
|
#define VIRTUAL 1
|
||||||
|
|
||||||
/* structure for the reset commands */
|
/* structure for the reset commands */
|
||||||
struct reset_com {
|
struct reset_com {
|
||||||
char command; /* current command */
|
char command; /* current command */
|
||||||
|
|
||||||
bool if_flag; /* if TRUE: exe only if preceding exe'd */
|
bool if_flag; /* if TRUE: exe only if preceding exe'd */
|
||||||
int arg1; /* */
|
int arg1; /* */
|
||||||
int arg2; /* Arguments to the command */
|
int arg2; /* Arguments to the command */
|
||||||
int arg3; /* */
|
int arg3; /* */
|
||||||
int line; /* line number this command appears on */
|
int line; /* line number this command appears on */
|
||||||
char *sarg1; /* string argument */
|
char *sarg1; /* string argument */
|
||||||
char *sarg2; /* string argument */
|
char *sarg2; /* string argument */
|
||||||
|
|
||||||
/* Commands:
|
/* Commands:
|
||||||
* 'M': Read a mobile
|
* 'M': Read a mobile
|
||||||
* 'O': Read an object
|
* 'O': Read an object
|
||||||
* 'G': Give obj to mob
|
* 'G': Give obj to mob
|
||||||
* 'P': Put obj in obj
|
* 'P': Put obj in obj
|
||||||
* 'G': Obj to char
|
* 'G': Obj to char
|
||||||
* 'E': Obj to char equip
|
* 'E': Obj to char equip
|
||||||
* 'D': Set state of door
|
* 'D': Set state of door
|
||||||
* 'T': Trigger command
|
* 'T': Trigger command
|
||||||
* 'V': Assign a variable */
|
* 'V': Assign a variable */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* zone definition structure. for the 'zone-table' */
|
/* zone definition structure. for the 'zone-table' */
|
||||||
struct zone_data {
|
struct zone_data {
|
||||||
char *name; /* name of this zone */
|
char *name; /* name of this zone */
|
||||||
char *builders; /* namelist of builders allowed to */
|
char *builders; /* namelist of builders allowed to modify this zone. */
|
||||||
/* modify this zone. */
|
int lifespan; /* how long between resets (minutes) */
|
||||||
int lifespan; /* how long between resets (minutes) */
|
int age; /* current age of this zone (minutes) */
|
||||||
int age; /* current age of this zone (minutes) */
|
room_vnum bot; /* starting room number for this zone */
|
||||||
room_vnum bot; /* starting room number for this zone */
|
room_vnum top; /* upper limit for rooms in this zone */
|
||||||
room_vnum top; /* upper limit for rooms in this zone */
|
|
||||||
|
|
||||||
int zone_flags[ZN_ARRAY_MAX]; /* Zone Flags bitvector */
|
int zone_flags[ZN_ARRAY_MAX]; /* Zone Flags bitvector */
|
||||||
int min_level; /* Minimum level a player must be to enter this zone */
|
int min_level; /* Minimum level a player must be to enter this zone */
|
||||||
int max_level; /* Maximum level a player must be to enter this zone */
|
int max_level; /* Maximum level a player must be to enter this zone */
|
||||||
|
|
||||||
int reset_mode; /* conditions for reset (see below) */
|
int reset_mode; /* conditions for reset (see below) */
|
||||||
zone_vnum number; /* virtual number of this zone */
|
zone_vnum number; /* virtual number of this zone */
|
||||||
struct reset_com *cmd; /* command table for reset */
|
struct reset_com *cmd; /* command table for reset */
|
||||||
|
|
||||||
/* Reset mode:
|
/* Reset mode:
|
||||||
* 0: Don't reset, and don't update age.
|
* 0: Don't reset, and don't update age.
|
||||||
* 1: Reset if no PC's are located in zone.
|
* 1: Reset if no PC's are located in zone.
|
||||||
* 2: Just reset. */
|
* 2: Just reset. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* for queueing zones for update */
|
/* for queueing zones for update */
|
||||||
struct reset_q_element {
|
struct reset_q_element {
|
||||||
zone_rnum zone_to_reset; /* ref to zone_data */
|
zone_rnum zone_to_reset; /* ref to zone_data */
|
||||||
struct reset_q_element *next;
|
struct reset_q_element *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* structure for the update queue */
|
/* structure for the update queue */
|
||||||
struct reset_q_type {
|
struct reset_q_type {
|
||||||
struct reset_q_element *head;
|
struct reset_q_element *head;
|
||||||
struct reset_q_element *tail;
|
struct reset_q_element *tail;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Added level, flags, and last, primarily for pfile autocleaning. You can also
|
/* Added level, flags, and last, primarily for pfile autocleaning. You can also
|
||||||
* use them to keep online statistics, and add race, class, etc if you like. */
|
* use them to keep online statistics, and add race, class, etc if you like. */
|
||||||
struct player_index_element {
|
struct player_index_element {
|
||||||
char *name;
|
char *name;
|
||||||
long id;
|
long id;
|
||||||
int level;
|
int level;
|
||||||
int flags;
|
int flags;
|
||||||
time_t last;
|
time_t last;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct help_index_element {
|
struct help_index_element {
|
||||||
char *index; /*Future Use */
|
char *index; /* Future Use */
|
||||||
char *keywords; /*Keyword Place holder and sorter */
|
char *keywords; /* Keyword Place holder and sorter */
|
||||||
char *entry; /*Entries for help files with Keywords at very top*/
|
char *entry; /* Entries for help files with Keywords at very top */
|
||||||
int duplicate; /*Duplicate entries for multple keywords*/
|
int duplicate; /* Duplicate entries for multple keywords */
|
||||||
int min_level; /*Min Level to read help entry*/
|
int min_level; /* Min Level to read help entry */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* The ban defines and structs were moved to ban.h */
|
/* The ban defines and structs were moved to ban.h */
|
||||||
|
|
||||||
/* for the "buffered" rent and house object loading */
|
/* for the "buffered" rent and house object loading */
|
||||||
struct obj_save_data_t {
|
struct obj_save_data_t {
|
||||||
struct obj_data *obj;
|
obj_data *obj;
|
||||||
int locate;
|
int locate;
|
||||||
struct obj_save_data_t *next;
|
struct obj_save_data_t *next;
|
||||||
};
|
};
|
||||||
typedef struct obj_save_data_t obj_save_data;
|
typedef struct obj_save_data_t obj_save_data;
|
||||||
|
|
||||||
@@ -256,7 +255,7 @@ void free_text_files(void);
|
|||||||
void free_help_table(void);
|
void free_help_table(void);
|
||||||
void free_player_index(void);
|
void free_player_index(void);
|
||||||
void load_help(FILE *fl, char *name);
|
void load_help(FILE *fl, char *name);
|
||||||
void new_mobile_data(struct char_data *ch);
|
void new_mobile_data(char_data *ch);
|
||||||
|
|
||||||
zone_rnum real_zone(zone_vnum vnum);
|
zone_rnum real_zone(zone_vnum vnum);
|
||||||
room_rnum real_room(room_vnum vnum);
|
room_rnum real_room(room_vnum vnum);
|
||||||
@@ -265,45 +264,45 @@ obj_rnum real_object(obj_vnum vnum);
|
|||||||
|
|
||||||
/* Public Procedures from objsave.c */
|
/* Public Procedures from objsave.c */
|
||||||
void Crash_save_all(void);
|
void Crash_save_all(void);
|
||||||
void Crash_idlesave(struct char_data *ch);
|
void Crash_idlesave(char_data *ch);
|
||||||
void Crash_crashsave(struct char_data *ch);
|
void Crash_crashsave(char_data *ch);
|
||||||
int Crash_load(struct char_data *ch);
|
int Crash_load(char_data *ch);
|
||||||
void Crash_listrent(struct char_data *ch, char *name);
|
void Crash_listrent(char_data *ch, char *name);
|
||||||
int Crash_clean_file(char *name);
|
int Crash_clean_file(char *name);
|
||||||
int Crash_delete_crashfile(struct char_data *ch);
|
int Crash_delete_crashfile(char_data *ch);
|
||||||
int Crash_delete_file(char *name);
|
int Crash_delete_file(char *name);
|
||||||
void update_obj_file(void);
|
void update_obj_file(void);
|
||||||
void Crash_rentsave(struct char_data *ch, int cost);
|
void Crash_rentsave(char_data *ch, int cost);
|
||||||
obj_save_data *objsave_parse_objects(FILE *fl);
|
obj_save_data *objsave_parse_objects(FILE *fl);
|
||||||
int objsave_save_obj_record(struct obj_data *obj, FILE *fl, int location);
|
int objsave_save_obj_record(obj_data *obj, FILE *fl, int location);
|
||||||
/* Special functions */
|
/* Special functions */
|
||||||
SPECIAL(receptionist);
|
SPECIAL(receptionist);
|
||||||
SPECIAL(cryogenicist);
|
SPECIAL(cryogenicist);
|
||||||
|
|
||||||
/* Functions from players.c */
|
/* Functions from players.c */
|
||||||
void tag_argument(char *argument, char *tag);
|
void tag_argument(char *argument, char *tag);
|
||||||
int load_char(const char *name, struct char_data *ch);
|
int load_char(const char *name, char_data *ch);
|
||||||
void save_char(struct char_data *ch);
|
void save_char(char_data *ch);
|
||||||
void init_char(struct char_data *ch);
|
void init_char(char_data *ch);
|
||||||
struct char_data* create_char(void);
|
char_data* create_char(void);
|
||||||
struct char_data *read_mobile(mob_vnum nr, int type);
|
char_data *read_mobile(mob_vnum nr, int type);
|
||||||
int vnum_mobile(char *searchname, struct char_data *ch);
|
int vnum_mobile(char *searchname, char_data *ch);
|
||||||
void clear_char(struct char_data *ch);
|
void clear_char(char_data *ch);
|
||||||
void reset_char(struct char_data *ch);
|
void reset_char(char_data *ch);
|
||||||
void free_char(struct char_data *ch);
|
void free_char(char_data *ch);
|
||||||
void save_player_index(void);
|
void save_player_index(void);
|
||||||
long get_ptable_by_name(const char *name);
|
long get_ptable_by_name(const char *name);
|
||||||
void remove_player(int pfilepos);
|
void remove_player(int pfilepos);
|
||||||
void clean_pfiles(void);
|
void clean_pfiles(void);
|
||||||
void build_player_index(void);
|
void build_player_index(void);
|
||||||
|
|
||||||
struct obj_data *create_obj(void);
|
obj_data *create_obj(void);
|
||||||
void clear_object(struct obj_data *obj);
|
void clear_object(obj_data *obj);
|
||||||
void free_obj(struct obj_data *obj);
|
void free_obj(obj_data *obj);
|
||||||
struct obj_data *read_object(obj_vnum nr, int type);
|
obj_data *read_object(obj_vnum nr, int type);
|
||||||
int vnum_object(char *searchname, struct char_data *ch);
|
int vnum_object(char *searchname, char_data *ch);
|
||||||
int vnum_room(char *, struct char_data *);
|
int vnum_room(char *, char_data *);
|
||||||
int vnum_trig(char *, struct char_data *);
|
int vnum_trig(char *, char_data *);
|
||||||
|
|
||||||
void setup_dir(FILE *fl, int room, int dir);
|
void setup_dir(FILE *fl, int room, int dir);
|
||||||
void index_boot(int mode);
|
void index_boot(int mode);
|
||||||
@@ -366,15 +365,15 @@ extern room_rnum top_of_world;
|
|||||||
extern struct zone_data *zone_table;
|
extern struct zone_data *zone_table;
|
||||||
extern zone_rnum top_of_zone_table;
|
extern zone_rnum top_of_zone_table;
|
||||||
|
|
||||||
extern struct char_data *character_list;
|
extern char_data *character_list;
|
||||||
|
|
||||||
extern struct index_data *mob_index;
|
extern struct index_data *mob_index;
|
||||||
extern struct char_data *mob_proto;
|
extern char_data *mob_proto;
|
||||||
extern mob_rnum top_of_mobt;
|
extern mob_rnum top_of_mobt;
|
||||||
|
|
||||||
extern struct index_data *obj_index;
|
extern struct index_data *obj_index;
|
||||||
extern struct obj_data *object_list;
|
extern obj_data *object_list;
|
||||||
extern struct obj_data *obj_proto;
|
extern obj_data *obj_proto;
|
||||||
extern obj_rnum top_of_objt;
|
extern obj_rnum top_of_objt;
|
||||||
|
|
||||||
extern struct social_messg *soc_mess_list;
|
extern struct social_messg *soc_mess_list;
|
||||||
|
|||||||
+1
-1
@@ -188,7 +188,7 @@ void sub_write(char *arg, char_data *ch, byte find_invis, int targets)
|
|||||||
|
|
||||||
void send_to_zone(char *messg, zone_rnum zone)
|
void send_to_zone(char *messg, zone_rnum zone)
|
||||||
{
|
{
|
||||||
struct descriptor_data *i;
|
descriptor_data *i;
|
||||||
|
|
||||||
if (!messg || !*messg)
|
if (!messg || !*messg)
|
||||||
return;
|
return;
|
||||||
|
|||||||
+3
-3
@@ -214,7 +214,7 @@ void dg_read_trigger(FILE *fp, void *proto, int type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dg_obj_trigger(char *line, struct obj_data *obj)
|
void dg_obj_trigger(char *line, obj_data *obj)
|
||||||
{
|
{
|
||||||
char junk[8];
|
char junk[8];
|
||||||
int vnum, rnum, count;
|
int vnum, rnum, count;
|
||||||
@@ -251,8 +251,8 @@ void dg_obj_trigger(char *line, struct obj_data *obj)
|
|||||||
|
|
||||||
void assign_triggers(void *i, int type)
|
void assign_triggers(void *i, int type)
|
||||||
{
|
{
|
||||||
struct char_data *mob = NULL;
|
char_data *mob = NULL;
|
||||||
struct obj_data *obj = NULL;
|
obj_data *obj = NULL;
|
||||||
struct room_data *room = NULL;
|
struct room_data *room = NULL;
|
||||||
int rnum;
|
int rnum;
|
||||||
struct trig_proto_list *trg_proto;
|
struct trig_proto_list *trg_proto;
|
||||||
|
|||||||
+2
-1
@@ -151,7 +151,8 @@ long event_time(struct event *event)
|
|||||||
/** Frees all events from event_q. */
|
/** Frees all events from event_q. */
|
||||||
void event_free_all(void)
|
void event_free_all(void)
|
||||||
{
|
{
|
||||||
queue_free(event_q);
|
if (event_q != NULL)
|
||||||
|
queue_free(event_q);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Boolean function to tell whether an event is queued or not. Does this by
|
/** Boolean function to tell whether an event is queued or not. Does this by
|
||||||
|
|||||||
+9
-9
@@ -30,10 +30,10 @@
|
|||||||
/** The event structure. Events get attached to the queue and are executed
|
/** The event structure. Events get attached to the queue and are executed
|
||||||
* when their turn comes up in the queue. */
|
* when their turn comes up in the queue. */
|
||||||
struct event {
|
struct event {
|
||||||
EVENTFUNC(*func); /**< The function called when this event comes up. */
|
EVENTFUNC(*func); /**< The function called when this event comes up. */
|
||||||
void *event_obj; /**< event_obj is passed to func when func is called */
|
void *event_obj; /**< event_obj is passed to func when func is called */
|
||||||
struct q_element *q_el; /**< Where this event is located in the queue */
|
struct q_element *q_el; /**< Where this event is located in the queue */
|
||||||
bool isMudEvent; /**< used by the memory routines */
|
bool isMudEvent; /**< used by the memory routines */
|
||||||
};
|
};
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* End event structures and defines.
|
* End event structures and defines.
|
||||||
@@ -47,15 +47,15 @@ struct event {
|
|||||||
|
|
||||||
/** The priority queue. */
|
/** The priority queue. */
|
||||||
struct dg_queue {
|
struct dg_queue {
|
||||||
struct q_element *head[NUM_EVENT_QUEUES]; /**< Front of each queue bucket. */
|
struct q_element *head[NUM_EVENT_QUEUES]; /**< Front of each queue bucket. */
|
||||||
struct q_element *tail[NUM_EVENT_QUEUES]; /**< Rear of each queue bucket. */
|
struct q_element *tail[NUM_EVENT_QUEUES]; /**< Rear of each queue bucket. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Queued elements. */
|
/** Queued elements. */
|
||||||
struct q_element {
|
struct q_element {
|
||||||
void *data; /**< The event to be handled. */
|
void *data; /**< The event to be handled. */
|
||||||
long key; /**< When the event should be handled. */
|
long key; /**< When the event should be handled. */
|
||||||
struct q_element *prev, *next; /**< Points to other q_elements in line. */
|
struct q_element *prev, *next; /**< Points to other q_elements in line. */
|
||||||
};
|
};
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* End priority queue structures and defines.
|
* End priority queue structures and defines.
|
||||||
|
|||||||
+8
-8
@@ -119,12 +119,12 @@ void extract_script(void *thing, int type)
|
|||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case MOB_TRIGGER:
|
case MOB_TRIGGER:
|
||||||
mob = (struct char_data *)thing;
|
mob = (char_data *)thing;
|
||||||
sc = SCRIPT(mob);
|
sc = SCRIPT(mob);
|
||||||
SCRIPT(mob) = NULL;
|
SCRIPT(mob) = NULL;
|
||||||
break;
|
break;
|
||||||
case OBJ_TRIGGER:
|
case OBJ_TRIGGER:
|
||||||
obj = (struct obj_data *)thing;
|
obj = (obj_data *)thing;
|
||||||
sc = SCRIPT(obj);
|
sc = SCRIPT(obj);
|
||||||
SCRIPT(obj) = NULL;
|
SCRIPT(obj) = NULL;
|
||||||
break;
|
break;
|
||||||
@@ -137,8 +137,8 @@ void extract_script(void *thing, int type)
|
|||||||
|
|
||||||
#if 1 /* debugging */
|
#if 1 /* debugging */
|
||||||
{
|
{
|
||||||
struct char_data *i = character_list;
|
char_data *i = character_list;
|
||||||
struct obj_data *j = object_list;
|
obj_data *j = object_list;
|
||||||
room_rnum k;
|
room_rnum k;
|
||||||
if (sc) {
|
if (sc) {
|
||||||
for ( ; i ; i = i->next)
|
for ( ; i ; i = i->next)
|
||||||
@@ -185,12 +185,12 @@ void free_proto_script(void *thing, int type)
|
|||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case MOB_TRIGGER:
|
case MOB_TRIGGER:
|
||||||
mob = (struct char_data *)thing;
|
mob = (char_data *)thing;
|
||||||
proto = mob->proto_script;
|
proto = mob->proto_script;
|
||||||
mob->proto_script = NULL;
|
mob->proto_script = NULL;
|
||||||
break;
|
break;
|
||||||
case OBJ_TRIGGER:
|
case OBJ_TRIGGER:
|
||||||
obj = (struct obj_data *)thing;
|
obj = (obj_data *)thing;
|
||||||
proto = obj->proto_script;
|
proto = obj->proto_script;
|
||||||
obj->proto_script = NULL;
|
obj->proto_script = NULL;
|
||||||
break;
|
break;
|
||||||
@@ -202,8 +202,8 @@ void free_proto_script(void *thing, int type)
|
|||||||
}
|
}
|
||||||
#if 1 /* debugging */
|
#if 1 /* debugging */
|
||||||
{
|
{
|
||||||
struct char_data *i = character_list;
|
char_data *i = character_list;
|
||||||
struct obj_data *j = object_list;
|
obj_data *j = object_list;
|
||||||
room_rnum k;
|
room_rnum k;
|
||||||
if (proto) {
|
if (proto) {
|
||||||
for ( ; i ; i = i->next)
|
for ( ; i ; i = i->next)
|
||||||
|
|||||||
+10
-10
@@ -35,9 +35,9 @@
|
|||||||
* the spell is set to TAR_IGNORE. Also, group spells are not permitted. */
|
* the spell is set to TAR_IGNORE. Also, group spells are not permitted. */
|
||||||
void do_dg_cast(void *go, struct script_data *sc, trig_data *trig, int type, char *cmd)
|
void do_dg_cast(void *go, struct script_data *sc, trig_data *trig, int type, char *cmd)
|
||||||
{
|
{
|
||||||
struct char_data *caster = NULL;
|
char_data *caster = NULL;
|
||||||
struct char_data *tch = NULL;
|
char_data *tch = NULL;
|
||||||
struct obj_data *tobj = NULL;
|
obj_data *tobj = NULL;
|
||||||
struct room_data *caster_room = NULL;
|
struct room_data *caster_room = NULL;
|
||||||
char *s, *t;
|
char *s, *t;
|
||||||
int spellnum, target = 0;
|
int spellnum, target = 0;
|
||||||
@@ -46,13 +46,13 @@ void do_dg_cast(void *go, struct script_data *sc, trig_data *trig, int type, cha
|
|||||||
/* need to get the caster or the room of the temporary caster */
|
/* need to get the caster or the room of the temporary caster */
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case MOB_TRIGGER:
|
case MOB_TRIGGER:
|
||||||
caster = (struct char_data *)go;
|
caster = (char_data *)go;
|
||||||
break;
|
break;
|
||||||
case WLD_TRIGGER:
|
case WLD_TRIGGER:
|
||||||
caster_room = (struct room_data *)go;
|
caster_room = (struct room_data *)go;
|
||||||
break;
|
break;
|
||||||
case OBJ_TRIGGER:
|
case OBJ_TRIGGER:
|
||||||
caster_room = dg_room_of_obj((struct obj_data *)go);
|
caster_room = dg_room_of_obj((obj_data *)go);
|
||||||
if (!caster_room) {
|
if (!caster_room) {
|
||||||
script_log("dg_do_cast: unknown room for object-caster!");
|
script_log("dg_do_cast: unknown room for object-caster!");
|
||||||
return;
|
return;
|
||||||
@@ -131,7 +131,7 @@ void do_dg_cast(void *go, struct script_data *sc, trig_data *trig, int type, cha
|
|||||||
/* set the caster's name to that of the object, or the gods.... */
|
/* set the caster's name to that of the object, or the gods.... */
|
||||||
if (type==OBJ_TRIGGER)
|
if (type==OBJ_TRIGGER)
|
||||||
caster->player.short_descr =
|
caster->player.short_descr =
|
||||||
strdup(((struct obj_data *)go)->short_description);
|
strdup(((obj_data *)go)->short_description);
|
||||||
else if (type==WLD_TRIGGER)
|
else if (type==WLD_TRIGGER)
|
||||||
caster->player.short_descr = strdup("The gods");
|
caster->player.short_descr = strdup("The gods");
|
||||||
caster->next_in_room = caster_room->people;
|
caster->next_in_room = caster_room->people;
|
||||||
@@ -152,7 +152,7 @@ void do_dg_cast(void *go, struct script_data *sc, trig_data *trig, int type, cha
|
|||||||
void do_dg_affect(void *go, struct script_data *sc, trig_data *trig,
|
void do_dg_affect(void *go, struct script_data *sc, trig_data *trig,
|
||||||
int script_type, char *cmd)
|
int script_type, char *cmd)
|
||||||
{
|
{
|
||||||
struct char_data *ch = NULL;
|
char_data *ch = NULL;
|
||||||
int value=0, duration=0;
|
int value=0, duration=0;
|
||||||
char junk[MAX_INPUT_LENGTH]; /* will be set to "dg_affect" */
|
char junk[MAX_INPUT_LENGTH]; /* will be set to "dg_affect" */
|
||||||
char charname[MAX_INPUT_LENGTH], property[MAX_INPUT_LENGTH];
|
char charname[MAX_INPUT_LENGTH], property[MAX_INPUT_LENGTH];
|
||||||
@@ -238,7 +238,7 @@ void do_dg_affect(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
affect_to_char(ch, &af);
|
affect_to_char(ch, &af);
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_char_pos(struct char_data *ch, int dam)
|
void send_char_pos(char_data *ch, int dam)
|
||||||
{
|
{
|
||||||
switch (GET_POS(ch)) {
|
switch (GET_POS(ch)) {
|
||||||
case POS_MORTALLYW:
|
case POS_MORTALLYW:
|
||||||
@@ -269,7 +269,7 @@ void send_char_pos(struct char_data *ch, int dam)
|
|||||||
/* Used throughout the xxxcmds.c files for checking if a char can be targetted
|
/* Used throughout the xxxcmds.c files for checking if a char can be targetted
|
||||||
* - allow_gods is false when called by %force%, for instance, while true for
|
* - allow_gods is false when called by %force%, for instance, while true for
|
||||||
* %teleport%. - Welcor */
|
* %teleport%. - Welcor */
|
||||||
int valid_dg_target(struct char_data *ch, int bitvector)
|
int valid_dg_target(char_data *ch, int bitvector)
|
||||||
{
|
{
|
||||||
if (IS_NPC(ch))
|
if (IS_NPC(ch))
|
||||||
return TRUE; /* all npcs are allowed as targets */
|
return TRUE; /* all npcs are allowed as targets */
|
||||||
@@ -286,7 +286,7 @@ int valid_dg_target(struct char_data *ch, int bitvector)
|
|||||||
return FALSE; /* The rest are gods with nohassle on... */
|
return FALSE; /* The rest are gods with nohassle on... */
|
||||||
}
|
}
|
||||||
|
|
||||||
void script_damage(struct char_data *vict, int dam)
|
void script_damage(char_data *vict, int dam)
|
||||||
{
|
{
|
||||||
if (GET_LEVEL(vict)>=LVL_IMMORT && (dam > 0)) {
|
if (GET_LEVEL(vict)>=LVL_IMMORT && (dam > 0)) {
|
||||||
send_to_char(vict, "Being the cool immortal you are, you sidestep a trap, "
|
send_to_char(vict, "Being the cool immortal you are, you sidestep a trap, "
|
||||||
|
|||||||
+10
-10
@@ -320,7 +320,7 @@ ACMD(do_mzoneecho)
|
|||||||
if (!*room_number || !*msg)
|
if (!*room_number || !*msg)
|
||||||
mob_log(ch, "mzoneecho called with too few args");
|
mob_log(ch, "mzoneecho called with too few args");
|
||||||
|
|
||||||
else if ((zone = real_zone_by_thing(atoi(room_number))) == NOWHERE)
|
else if ((zone = real_zone_by_thing(atoidx(room_number))) == NOWHERE)
|
||||||
mob_log(ch, "mzoneecho called for nonexistant zone");
|
mob_log(ch, "mzoneecho called for nonexistant zone");
|
||||||
|
|
||||||
else {
|
else {
|
||||||
@@ -355,7 +355,7 @@ ACMD(do_mload)
|
|||||||
|
|
||||||
target = two_arguments(argument, arg1, arg2);
|
target = two_arguments(argument, arg1, arg2);
|
||||||
|
|
||||||
if (!*arg1 || !*arg2 || !is_number(arg2) || ((number = atoi(arg2)) < 0)) {
|
if (!*arg1 || !*arg2 || !is_number(arg2) || ((number = atoidx(arg2)) == NOBODY)) {
|
||||||
mob_log(ch, "mload: bad syntax");
|
mob_log(ch, "mload: bad syntax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -366,7 +366,7 @@ ACMD(do_mload)
|
|||||||
if (!target || !*target) {
|
if (!target || !*target) {
|
||||||
rnum = IN_ROOM(ch);
|
rnum = IN_ROOM(ch);
|
||||||
} else {
|
} else {
|
||||||
if (!isdigit(*target) || (rnum = real_room(atoi(target))) == NOWHERE) {
|
if (!isdigit(*target) || (rnum = real_room(atoidx(target))) == NOWHERE) {
|
||||||
mob_log(ch, "mload: room target vnum doesn't exist "
|
mob_log(ch, "mload: room target vnum doesn't exist "
|
||||||
"(loading mob vnum %d to room %s)", number, target);
|
"(loading mob vnum %d to room %s)", number, target);
|
||||||
return;
|
return;
|
||||||
@@ -699,7 +699,7 @@ ACMD(do_mforce)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!str_cmp(arg, "all")) {
|
if (!str_cmp(arg, "all")) {
|
||||||
struct descriptor_data *i;
|
descriptor_data *i;
|
||||||
char_data *vch;
|
char_data *vch;
|
||||||
|
|
||||||
for (i = descriptor_list; i ; i = i->next) {
|
for (i = descriptor_list; i ; i = i->next) {
|
||||||
@@ -914,10 +914,10 @@ ACMD(do_mtransform)
|
|||||||
mob_log(ch, "mtransform: bad argument");
|
mob_log(ch, "mtransform: bad argument");
|
||||||
else {
|
else {
|
||||||
if (isdigit(*arg))
|
if (isdigit(*arg))
|
||||||
m = read_mobile(atoi(arg), VIRTUAL);
|
m = read_mobile(atoidx(arg), VIRTUAL);
|
||||||
else {
|
else {
|
||||||
keep_hp = 0;
|
keep_hp = 0;
|
||||||
m = read_mobile(atoi(arg+1), VIRTUAL);
|
m = read_mobile(atoidx(arg+1), VIRTUAL);
|
||||||
}
|
}
|
||||||
if (m==NULL) {
|
if (m==NULL) {
|
||||||
mob_log(ch, "mtransform: bad mobile vnum");
|
mob_log(ch, "mtransform: bad mobile vnum");
|
||||||
@@ -1070,7 +1070,7 @@ ACMD(do_mdoor)
|
|||||||
newexit->exit_info = (sh_int)asciiflag_conv(value);
|
newexit->exit_info = (sh_int)asciiflag_conv(value);
|
||||||
break;
|
break;
|
||||||
case 3: /* key */
|
case 3: /* key */
|
||||||
newexit->key = atoi(value);
|
newexit->key = atoidx(value);
|
||||||
break;
|
break;
|
||||||
case 4: /* name */
|
case 4: /* name */
|
||||||
if (newexit->keyword)
|
if (newexit->keyword)
|
||||||
@@ -1079,7 +1079,7 @@ ACMD(do_mdoor)
|
|||||||
strcpy(newexit->keyword, value);
|
strcpy(newexit->keyword, value);
|
||||||
break;
|
break;
|
||||||
case 5: /* room */
|
case 5: /* room */
|
||||||
if ((to_room = real_room(atoi(value))) != NOWHERE)
|
if ((to_room = real_room(atoidx(value))) != NOWHERE)
|
||||||
newexit->to_room = to_room;
|
newexit->to_room = to_room;
|
||||||
else
|
else
|
||||||
mob_log(ch, "mdoor: invalid door target");
|
mob_log(ch, "mdoor: invalid door target");
|
||||||
@@ -1091,7 +1091,7 @@ ACMD(do_mdoor)
|
|||||||
ACMD(do_mfollow)
|
ACMD(do_mfollow)
|
||||||
{
|
{
|
||||||
char buf[MAX_INPUT_LENGTH];
|
char buf[MAX_INPUT_LENGTH];
|
||||||
struct char_data *leader;
|
char_data *leader;
|
||||||
struct follow_type *j, *k;
|
struct follow_type *j, *k;
|
||||||
|
|
||||||
if (!MOB_OR_IMPL(ch)) {
|
if (!MOB_OR_IMPL(ch)) {
|
||||||
@@ -1176,5 +1176,5 @@ ACMD(do_mrecho)
|
|||||||
if (!*msg || !*start || !*finish || !is_number(start) || !is_number(finish))
|
if (!*msg || !*start || !*finish || !is_number(start) || !is_number(finish))
|
||||||
mob_log(ch, "mrecho called with too few args");
|
mob_log(ch, "mrecho called with too few args");
|
||||||
else
|
else
|
||||||
send_to_range(atoi(start), atoi(finish), "%s\r\n", msg);
|
send_to_range(atoidx(start), atoidx(finish), "%s\r\n", msg);
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-14
@@ -88,7 +88,7 @@ room_rnum obj_room(obj_data *obj)
|
|||||||
/* returns the real room number, or NOWHERE if not found or invalid */
|
/* returns the real room number, or NOWHERE if not found or invalid */
|
||||||
static room_rnum find_obj_target_room(obj_data *obj, char *rawroomstr)
|
static room_rnum find_obj_target_room(obj_data *obj, char *rawroomstr)
|
||||||
{
|
{
|
||||||
int tmp;
|
room_vnum tmp;
|
||||||
room_rnum location;
|
room_rnum location;
|
||||||
char_data *target_mob;
|
char_data *target_mob;
|
||||||
obj_data *target_obj;
|
obj_data *target_obj;
|
||||||
@@ -101,7 +101,7 @@ static room_rnum find_obj_target_room(obj_data *obj, char *rawroomstr)
|
|||||||
|
|
||||||
if (isdigit(*roomstr) && !strchr(roomstr, '.'))
|
if (isdigit(*roomstr) && !strchr(roomstr, '.'))
|
||||||
{
|
{
|
||||||
tmp = atoi(roomstr);
|
tmp = atoidx(roomstr);
|
||||||
if ((location = real_room(tmp)) == NOWHERE)
|
if ((location = real_room(tmp)) == NOWHERE)
|
||||||
return NOWHERE;
|
return NOWHERE;
|
||||||
}
|
}
|
||||||
@@ -220,7 +220,7 @@ static OCMD(do_ozoneecho)
|
|||||||
if (!*room_number || !*msg)
|
if (!*room_number || !*msg)
|
||||||
obj_log(obj, "ozoneecho called with too few args");
|
obj_log(obj, "ozoneecho called with too few args");
|
||||||
|
|
||||||
else if ((zone = real_zone_by_thing(atoi(room_number))) == NOWHERE)
|
else if ((zone = real_zone_by_thing(atoidx(room_number))) == NOWHERE)
|
||||||
obj_log(obj, "ozoneecho called for nonexistant zone");
|
obj_log(obj, "ozoneecho called for nonexistant zone");
|
||||||
|
|
||||||
else {
|
else {
|
||||||
@@ -275,7 +275,7 @@ static OCMD(do_orecho)
|
|||||||
if (!*msg || !*start || !*finish || !is_number(start) || !is_number(finish))
|
if (!*msg || !*start || !*finish || !is_number(start) || !is_number(finish))
|
||||||
obj_log(obj, "orecho: too few args");
|
obj_log(obj, "orecho: too few args");
|
||||||
else
|
else
|
||||||
send_to_range(atoi(start), atoi(finish), "%s\r\n", msg);
|
send_to_range(atoidx(start), atoidx(finish), "%s\r\n", msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -300,7 +300,7 @@ static OCMD(do_otransform)
|
|||||||
{
|
{
|
||||||
char arg[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH];
|
||||||
obj_data *o, tmpobj;
|
obj_data *o, tmpobj;
|
||||||
struct char_data *wearer=NULL;
|
char_data *wearer=NULL;
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
|
||||||
one_argument(argument, arg);
|
one_argument(argument, arg);
|
||||||
@@ -310,7 +310,7 @@ static OCMD(do_otransform)
|
|||||||
else if (!isdigit(*arg))
|
else if (!isdigit(*arg))
|
||||||
obj_log(obj, "otransform: bad argument");
|
obj_log(obj, "otransform: bad argument");
|
||||||
else {
|
else {
|
||||||
o = read_object(atoi(arg), VIRTUAL);
|
o = read_object(atoidx(arg), VIRTUAL);
|
||||||
if (o==NULL) {
|
if (o==NULL) {
|
||||||
obj_log(obj, "otransform: bad object vnum");
|
obj_log(obj, "otransform: bad object vnum");
|
||||||
return;
|
return;
|
||||||
@@ -459,7 +459,7 @@ static OCMD(do_dgoload)
|
|||||||
|
|
||||||
target = two_arguments(argument, arg1, arg2);
|
target = two_arguments(argument, arg1, arg2);
|
||||||
|
|
||||||
if (!*arg1 || !*arg2 || !is_number(arg2) || ((number = atoi(arg2)) < 0))
|
if (!*arg1 || !*arg2 || !is_number(arg2) || ((number = atoidx(arg2)) == NOTHING))
|
||||||
{
|
{
|
||||||
obj_log(obj, "oload: bad syntax");
|
obj_log(obj, "oload: bad syntax");
|
||||||
return;
|
return;
|
||||||
@@ -477,7 +477,7 @@ static OCMD(do_dgoload)
|
|||||||
if (!target || !*target) {
|
if (!target || !*target) {
|
||||||
rnum = room;
|
rnum = room;
|
||||||
} else {
|
} else {
|
||||||
if (!isdigit(*target) || (rnum = real_room(atoi(target))) == NOWHERE) {
|
if (!isdigit(*target) || (rnum = real_room(atoidx(target))) == NOWHERE) {
|
||||||
obj_log(obj, "oload: room target vnum doesn't exist "
|
obj_log(obj, "oload: room target vnum doesn't exist "
|
||||||
"(loading mob vnum %d to room %s)", number, target);
|
"(loading mob vnum %d to room %s)", number, target);
|
||||||
return;
|
return;
|
||||||
@@ -671,7 +671,7 @@ static OCMD(do_odoor)
|
|||||||
newexit->exit_info = (sh_int)asciiflag_conv(value);
|
newexit->exit_info = (sh_int)asciiflag_conv(value);
|
||||||
break;
|
break;
|
||||||
case 3: /* key */
|
case 3: /* key */
|
||||||
newexit->key = atoi(value);
|
newexit->key = atoidx(value);
|
||||||
break;
|
break;
|
||||||
case 4: /* name */
|
case 4: /* name */
|
||||||
if (newexit->keyword)
|
if (newexit->keyword)
|
||||||
@@ -680,7 +680,7 @@ static OCMD(do_odoor)
|
|||||||
strcpy(newexit->keyword, value);
|
strcpy(newexit->keyword, value);
|
||||||
break;
|
break;
|
||||||
case 5: /* room */
|
case 5: /* room */
|
||||||
if ((to_room = real_room(atoi(value))) != NOWHERE)
|
if ((to_room = real_room(atoidx(value))) != NOWHERE)
|
||||||
newexit->to_room = to_room;
|
newexit->to_room = to_room;
|
||||||
else
|
else
|
||||||
obj_log(obj, "odoor: invalid door target");
|
obj_log(obj, "odoor: invalid door target");
|
||||||
@@ -693,7 +693,7 @@ static OCMD(do_osetval)
|
|||||||
{
|
{
|
||||||
char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
|
char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
|
||||||
int position, new_value, worn_on;
|
int position, new_value, worn_on;
|
||||||
struct char_data *worn_by = NULL;
|
char_data *worn_by = NULL;
|
||||||
|
|
||||||
two_arguments(argument, arg1, arg2);
|
two_arguments(argument, arg1, arg2);
|
||||||
if (!*arg1 || !*arg2 || !is_number(arg1) || !is_number(arg2)) {
|
if (!*arg1 || !*arg2 || !is_number(arg1) || !is_number(arg2)) {
|
||||||
@@ -725,8 +725,8 @@ static OCMD(do_osetval)
|
|||||||
static OCMD(do_oat)
|
static OCMD(do_oat)
|
||||||
{
|
{
|
||||||
room_rnum loc = NOWHERE;
|
room_rnum loc = NOWHERE;
|
||||||
struct char_data *ch;
|
char_data *ch;
|
||||||
struct obj_data *object;
|
obj_data *object;
|
||||||
char arg[MAX_INPUT_LENGTH], *command;
|
char arg[MAX_INPUT_LENGTH], *command;
|
||||||
|
|
||||||
command = any_one_arg(argument, arg);
|
command = any_one_arg(argument, arg);
|
||||||
@@ -743,7 +743,7 @@ static OCMD(do_oat)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isdigit(*arg)) loc = real_room(atoi(arg));
|
if (isdigit(*arg)) loc = real_room(atoidx(arg));
|
||||||
else if ((ch = get_char_by_obj(obj, arg))) loc = IN_ROOM(ch);
|
else if ((ch = get_char_by_obj(obj, arg))) loc = IN_ROOM(ch);
|
||||||
|
|
||||||
if (loc == NOWHERE) {
|
if (loc == NOWHERE) {
|
||||||
|
|||||||
+67
-52
@@ -24,17 +24,17 @@
|
|||||||
|
|
||||||
|
|
||||||
/* local functions */
|
/* local functions */
|
||||||
static void trigedit_disp_menu(struct descriptor_data *d);
|
static void trigedit_disp_menu(descriptor_data *d);
|
||||||
static void trigedit_disp_types(struct descriptor_data *d);
|
static void trigedit_disp_types(descriptor_data *d);
|
||||||
static void trigedit_create_index(int znum, char *type);
|
static void trigedit_create_index(int znum, char *type);
|
||||||
static void trigedit_setup_new(struct descriptor_data *d);
|
static void trigedit_setup_new(descriptor_data *d);
|
||||||
|
|
||||||
|
|
||||||
/* Trigedit */
|
/* Trigedit */
|
||||||
ACMD(do_oasis_trigedit)
|
ACMD(do_oasis_trigedit)
|
||||||
{
|
{
|
||||||
int number, real_num;
|
int number, real_num;
|
||||||
struct descriptor_data *d;
|
descriptor_data *d;
|
||||||
|
|
||||||
/* No building as a mob or while being forced. */
|
/* No building as a mob or while being forced. */
|
||||||
if (IS_NPC(ch) || !ch->desc || STATE(ch->desc) != CON_PLAYING)
|
if (IS_NPC(ch) || !ch->desc || STATE(ch->desc) != CON_PLAYING)
|
||||||
@@ -115,9 +115,9 @@ void script_save_to_disk(FILE *fp, void *item, int type)
|
|||||||
struct trig_proto_list *t;
|
struct trig_proto_list *t;
|
||||||
|
|
||||||
if (type==MOB_TRIGGER)
|
if (type==MOB_TRIGGER)
|
||||||
t = ((struct char_data *)item)->proto_script;
|
t = ((char_data *)item)->proto_script;
|
||||||
else if (type==OBJ_TRIGGER)
|
else if (type==OBJ_TRIGGER)
|
||||||
t = ((struct obj_data *)item)->proto_script;
|
t = ((obj_data *)item)->proto_script;
|
||||||
else if (type==WLD_TRIGGER)
|
else if (type==WLD_TRIGGER)
|
||||||
t = ((struct room_data *)item)->proto_script;
|
t = ((struct room_data *)item)->proto_script;
|
||||||
else {
|
else {
|
||||||
@@ -132,7 +132,7 @@ void script_save_to_disk(FILE *fp, void *item, int type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void trigedit_setup_new(struct descriptor_data *d)
|
static void trigedit_setup_new(descriptor_data *d)
|
||||||
{
|
{
|
||||||
struct trig_data *trig;
|
struct trig_data *trig;
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ static void trigedit_setup_new(struct descriptor_data *d)
|
|||||||
OLC_VAL(d) = 0; /* Has changed flag. (It hasn't so far, we just made it.) */
|
OLC_VAL(d) = 0; /* Has changed flag. (It hasn't so far, we just made it.) */
|
||||||
}
|
}
|
||||||
|
|
||||||
void trigedit_setup_existing(struct descriptor_data *d, int rtrg_num)
|
void trigedit_setup_existing(descriptor_data *d, int rtrg_num)
|
||||||
{
|
{
|
||||||
struct trig_data *trig;
|
struct trig_data *trig;
|
||||||
struct cmdlist_element *c;
|
struct cmdlist_element *c;
|
||||||
@@ -182,7 +182,7 @@ void trigedit_setup_existing(struct descriptor_data *d, int rtrg_num)
|
|||||||
OLC_VAL(d) = 0; /* Has changed flag. (It hasn't so far, we just made it.) */
|
OLC_VAL(d) = 0; /* Has changed flag. (It hasn't so far, we just made it.) */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void trigedit_disp_menu(struct descriptor_data *d)
|
static void trigedit_disp_menu(descriptor_data *d)
|
||||||
{
|
{
|
||||||
struct trig_data *trig = OLC_TRIG(d);
|
struct trig_data *trig = OLC_TRIG(d);
|
||||||
char *attach_type;
|
char *attach_type;
|
||||||
@@ -227,7 +227,7 @@ static void trigedit_disp_menu(struct descriptor_data *d)
|
|||||||
OLC_MODE(d) = TRIGEDIT_MAIN_MENU;
|
OLC_MODE(d) = TRIGEDIT_MAIN_MENU;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void trigedit_disp_types(struct descriptor_data *d)
|
static void trigedit_disp_types(descriptor_data *d)
|
||||||
{
|
{
|
||||||
int i, columns = 0;
|
int i, columns = 0;
|
||||||
const char **types;
|
const char **types;
|
||||||
@@ -420,7 +420,7 @@ static const char *command_color_replacement[COMMAND_TERMS][2] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static void script_syntax_highlighting(struct descriptor_data *d, char *string)
|
static void script_syntax_highlighting(descriptor_data *d, char *string)
|
||||||
{
|
{
|
||||||
ACMD(do_action);
|
ACMD(do_action);
|
||||||
char buffer[MAX_STRING_LENGTH] = "";
|
char buffer[MAX_STRING_LENGTH] = "";
|
||||||
@@ -484,7 +484,7 @@ static void script_syntax_highlighting(struct descriptor_data *d, char *string)
|
|||||||
}
|
}
|
||||||
/****************************************************************************************/
|
/****************************************************************************************/
|
||||||
|
|
||||||
void trigedit_parse(struct descriptor_data *d, char *arg)
|
void trigedit_parse(descriptor_data *d, char *arg)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
@@ -602,7 +602,7 @@ void trigedit_parse(struct descriptor_data *d, char *arg)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case TRIGEDIT_COPY:
|
case TRIGEDIT_COPY:
|
||||||
if ((i = real_trigger(atoi(arg))) != NOWHERE) {
|
if ((i = real_trigger(atoidx(arg))) != NOWHERE) {
|
||||||
trigedit_setup_existing(d, i);
|
trigedit_setup_existing(d, i);
|
||||||
} else
|
} else
|
||||||
write_to_output(d, "That trigger does not exist.\r\n");
|
write_to_output(d, "That trigger does not exist.\r\n");
|
||||||
@@ -618,7 +618,7 @@ void trigedit_parse(struct descriptor_data *d, char *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* save the zone's triggers to internal memory and to disk */
|
/* save the zone's triggers to internal memory and to disk */
|
||||||
void trigedit_save(struct descriptor_data *d)
|
void trigedit_save(descriptor_data *d)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
trig_rnum rnum;
|
trig_rnum rnum;
|
||||||
@@ -629,7 +629,7 @@ void trigedit_save(struct descriptor_data *d)
|
|||||||
trig_data *live_trig;
|
trig_data *live_trig;
|
||||||
struct cmdlist_element *cmd, *next_cmd;
|
struct cmdlist_element *cmd, *next_cmd;
|
||||||
struct index_data **new_index;
|
struct index_data **new_index;
|
||||||
struct descriptor_data *dsc;
|
descriptor_data *dsc;
|
||||||
FILE *trig_file;
|
FILE *trig_file;
|
||||||
int zone, top;
|
int zone, top;
|
||||||
char buf[MAX_CMD_LENGTH];
|
char buf[MAX_CMD_LENGTH];
|
||||||
@@ -911,7 +911,7 @@ static void trigedit_create_index(int znum, char *type)
|
|||||||
rename(new_name, old_name);
|
rename(new_name, old_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dg_olc_script_copy(struct descriptor_data *d)
|
void dg_olc_script_copy(descriptor_data *d)
|
||||||
{
|
{
|
||||||
struct trig_proto_list *origscript, *editscript;
|
struct trig_proto_list *origscript, *editscript;
|
||||||
|
|
||||||
@@ -936,7 +936,7 @@ void dg_olc_script_copy(struct descriptor_data *d)
|
|||||||
OLC_SCRIPT(d) = NULL;
|
OLC_SCRIPT(d) = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dg_script_menu(struct descriptor_data *d)
|
void dg_script_menu(descriptor_data *d)
|
||||||
{
|
{
|
||||||
struct trig_proto_list *editscript;
|
struct trig_proto_list *editscript;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -972,7 +972,7 @@ void dg_script_menu(struct descriptor_data *d)
|
|||||||
grn, nrm, grn, nrm, grn, nrm);
|
grn, nrm, grn, nrm, grn, nrm);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dg_script_edit_parse(struct descriptor_data *d, char *arg)
|
int dg_script_edit_parse(descriptor_data *d, char *arg)
|
||||||
{
|
{
|
||||||
struct trig_proto_list *trig, *currtrig;
|
struct trig_proto_list *trig, *currtrig;
|
||||||
int count, pos, vnum;
|
int count, pos, vnum;
|
||||||
@@ -1077,7 +1077,7 @@ int dg_script_edit_parse(struct descriptor_data *d, char *arg)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void trigedit_string_cleanup(struct descriptor_data *d, int terminator)
|
void trigedit_string_cleanup(descriptor_data *d, int terminator)
|
||||||
{
|
{
|
||||||
switch (OLC_MODE(d)) {
|
switch (OLC_MODE(d)) {
|
||||||
case TRIGEDIT_COMMANDS:
|
case TRIGEDIT_COMMANDS:
|
||||||
@@ -1086,75 +1086,90 @@ void trigedit_string_cleanup(struct descriptor_data *d, int terminator)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int format_script(struct descriptor_data *d)
|
int format_script(descriptor_data *d)
|
||||||
{
|
{
|
||||||
char nsc[MAX_CMD_LENGTH], *t, line[READ_SIZE];
|
char nsc[MAX_CMD_LENGTH], *t, line[READ_SIZE];
|
||||||
char *sc;
|
char *sc;
|
||||||
size_t len = 0, nlen = 0, llen = 0;
|
size_t len = 0, nlen = 0, llen = 0;
|
||||||
int indent = 0, indent_next = FALSE, found_case = FALSE, i, line_num = 0, ret;
|
int indent = 0, indent_next = FALSE, line_num = 0, ret, i; // Declare i here
|
||||||
|
int block_stack[READ_SIZE]; // Stack to track block types
|
||||||
|
int stack_top = -1; // Initialize stack as empty
|
||||||
|
int switch_indent[READ_SIZE]; // Array to track switch indent levels
|
||||||
|
int switch_top = -1; // Index for switch_indent array
|
||||||
|
int case_indent = 0; // Track indent for case blocks
|
||||||
|
int in_switch = 0; // Flag to indicate if we're inside a switch block
|
||||||
|
|
||||||
if (!d->str || !*d->str)
|
if (!d->str || !*d->str)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
sc = strdup(*d->str); /* we work on a copy, because of strtok() */
|
sc = strdup(*d->str); // Work on a copy
|
||||||
t = strtok(sc, "\n\r");
|
t = strtok(sc, "\n\r");
|
||||||
*nsc = '\0';
|
*nsc = '\0';
|
||||||
|
|
||||||
while (t) {
|
while (t) {
|
||||||
line_num++;
|
line_num++;
|
||||||
skip_spaces(&t);
|
skip_spaces(&t);
|
||||||
if (!strn_cmp(t, "if ", 3) ||
|
|
||||||
!strn_cmp(t, "switch ", 7)) {
|
if (!strn_cmp(t, "switch ", 7)) {
|
||||||
indent_next = TRUE;
|
indent_next = TRUE;
|
||||||
} else if (!strn_cmp(t, "while ", 6)) {
|
stack_top++;
|
||||||
found_case = TRUE; /* so you can 'break' a loop without complains */
|
block_stack[stack_top] = 's'; // 's' for switch
|
||||||
|
switch_top++;
|
||||||
|
switch_indent[switch_top] = indent; // Save current indent level for switch
|
||||||
|
in_switch++; // We're entering a switch block
|
||||||
|
} else if (!strn_cmp(t, "case", 4) || !strn_cmp(t, "default", 7)) {
|
||||||
|
if (in_switch > 0) { // If we're inside a switch
|
||||||
|
indent = switch_indent[switch_top] + 1; // Indent cases one level under switch
|
||||||
|
indent_next = TRUE; // Indent the next line after case
|
||||||
|
case_indent = indent; // Save indent for case block
|
||||||
|
}
|
||||||
|
} else if (!strn_cmp(t, "if ", 3) || !strn_cmp(t, "while ", 6)) {
|
||||||
indent_next = TRUE;
|
indent_next = TRUE;
|
||||||
} else if (!strn_cmp(t, "end", 3) ||
|
stack_top++;
|
||||||
!strn_cmp(t, "done", 4)) {
|
block_stack[stack_top] = 'l'; // 'l' for loop or conditional
|
||||||
if (!indent) {
|
} else if (!strn_cmp(t, "end", 3) || !strn_cmp(t, "done", 4)) {
|
||||||
|
if (stack_top < 0) {
|
||||||
write_to_output(d, "Unmatched 'end' or 'done' (line %d)!\r\n", line_num);
|
write_to_output(d, "Unmatched 'end' or 'done' (line %d)!\r\n", line_num);
|
||||||
free(sc);
|
free(sc);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
indent--;
|
if (block_stack[stack_top] == 's') {
|
||||||
indent_next = FALSE;
|
indent = switch_indent[switch_top]; // Reset to the exact indent level where switch was declared
|
||||||
|
switch_top--; // Decrease switch stack if ending a switch
|
||||||
|
case_indent = 0; // Reset case indent since we're leaving the switch
|
||||||
|
in_switch--; // We're leaving a switch block
|
||||||
|
} else {
|
||||||
|
indent--; // For other blocks like while
|
||||||
|
}
|
||||||
|
stack_top--;
|
||||||
|
indent_next = FALSE; // Reset for next line
|
||||||
} else if (!strn_cmp(t, "else", 4)) {
|
} else if (!strn_cmp(t, "else", 4)) {
|
||||||
if (!indent) {
|
if (stack_top < 0 || block_stack[stack_top] != 'l') {
|
||||||
write_to_output(d, "Unmatched 'else' (line %d)!\r\n", line_num);
|
write_to_output(d, "Unmatched 'else' (line %d)!\r\n", line_num);
|
||||||
free(sc);
|
free(sc);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
indent--;
|
indent--; // Reduce indent for else, then increment for next statement
|
||||||
indent_next = TRUE;
|
indent_next = TRUE;
|
||||||
} else if (!strn_cmp(t, "case", 4) ||
|
|
||||||
!strn_cmp(t, "default", 7)) {
|
|
||||||
if (!indent) {
|
|
||||||
write_to_output(d, "Case/default outside switch (line %d)!\r\n", line_num);
|
|
||||||
free(sc);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (!found_case) /* so we don't indent multiple case statements without a break */
|
|
||||||
indent_next = TRUE;
|
|
||||||
found_case = TRUE;
|
|
||||||
} else if (!strn_cmp(t, "break", 5)) {
|
} else if (!strn_cmp(t, "break", 5)) {
|
||||||
if (!found_case || !indent ) {
|
if (stack_top < 0 || (block_stack[stack_top] != 's' && block_stack[stack_top] != 'l')) {
|
||||||
write_to_output(d, "Break not in case (line %d)!\r\n", line_num);
|
write_to_output(d, "Break not in case or loop (line %d)!\r\n", line_num);
|
||||||
free(sc);
|
free(sc);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
found_case = FALSE;
|
indent = case_indent + 1; // Indent break one level deeper than case
|
||||||
indent--;
|
indent_next = FALSE; // Ensure no automatic increase for next line after break
|
||||||
}
|
}
|
||||||
|
|
||||||
*line = '\0';
|
*line = '\0';
|
||||||
for (nlen = 0, i = 0;i<indent;i++) {
|
for (nlen = 0, i = 0; i < indent; i++) {
|
||||||
strncat(line, " ", sizeof(line)-1);
|
strncat(line, " ", sizeof(line) - strlen(line) - 1);
|
||||||
nlen += 2;
|
nlen += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = snprintf(line + nlen, sizeof(line) - nlen, "%s\r\n", t);
|
ret = snprintf(line + nlen, sizeof(line) - nlen, "%s\r\n", t);
|
||||||
llen = (size_t)ret;
|
llen = (size_t)ret;
|
||||||
if (ret < 0 || llen + nlen + len > d->max_str - 1 ) {
|
if (ret < 0 || llen + nlen + len > d->max_str - 1) {
|
||||||
write_to_output(d, "String too long, formatting aborted\r\n");
|
write_to_output(d, "String too long, formatting aborted\r\n");
|
||||||
free(sc);
|
free(sc);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -1169,8 +1184,8 @@ int format_script(struct descriptor_data *d)
|
|||||||
t = strtok(NULL, "\n\r");
|
t = strtok(NULL, "\n\r");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (indent)
|
if (stack_top >= 0)
|
||||||
write_to_output(d, "Unmatched if, while or switch ignored.\r\n");
|
write_to_output(d, "Unmatched block statements ignored.\r\n");
|
||||||
|
|
||||||
free(*d->str);
|
free(*d->str);
|
||||||
*d->str = strdup(nsc);
|
*d->str = strdup(nsc);
|
||||||
|
|||||||
+21
-21
@@ -16,34 +16,34 @@
|
|||||||
|
|
||||||
#include "dg_scripts.h"
|
#include "dg_scripts.h"
|
||||||
|
|
||||||
#define NUM_TRIG_TYPE_FLAGS 20
|
#define NUM_TRIG_TYPE_FLAGS 21
|
||||||
|
|
||||||
/* Submodes of TRIGEDIT connectedness. */
|
/* Submodes of TRIGEDIT connectedness. */
|
||||||
#define TRIGEDIT_MAIN_MENU 0
|
#define TRIGEDIT_MAIN_MENU 0
|
||||||
#define TRIGEDIT_TRIGTYPE 1
|
#define TRIGEDIT_TRIGTYPE 1
|
||||||
#define TRIGEDIT_CONFIRM_SAVESTRING 2
|
#define TRIGEDIT_CONFIRM_SAVESTRING 2
|
||||||
#define TRIGEDIT_NAME 3
|
#define TRIGEDIT_NAME 3
|
||||||
#define TRIGEDIT_INTENDED 4
|
#define TRIGEDIT_INTENDED 4
|
||||||
#define TRIGEDIT_TYPES 5
|
#define TRIGEDIT_TYPES 5
|
||||||
#define TRIGEDIT_COMMANDS 6
|
#define TRIGEDIT_COMMANDS 6
|
||||||
#define TRIGEDIT_NARG 7
|
#define TRIGEDIT_NARG 7
|
||||||
#define TRIGEDIT_ARGUMENT 8
|
#define TRIGEDIT_ARGUMENT 8
|
||||||
#define TRIGEDIT_COPY 9
|
#define TRIGEDIT_COPY 9
|
||||||
|
|
||||||
#define OLC_SCRIPT_EDIT 82766 /* arbitrary > highest possible room number */
|
#define OLC_SCRIPT_EDIT 82766 /* arbitrary > highest possible room number */
|
||||||
#define SCRIPT_MAIN_MENU 0
|
#define SCRIPT_MAIN_MENU 0
|
||||||
#define SCRIPT_NEW_TRIGGER 1
|
#define SCRIPT_NEW_TRIGGER 1
|
||||||
#define SCRIPT_DEL_TRIGGER 2
|
#define SCRIPT_DEL_TRIGGER 2
|
||||||
|
|
||||||
#define OLC_SCRIPT_EDIT_MODE(d) (OLC(d)->script_mode) /* parse input mode */
|
#define OLC_SCRIPT_EDIT_MODE(d) (OLC(d)->script_mode) /* parse input mode */
|
||||||
#define OLC_SCRIPT(d) (OLC(d)->script) /* script editing */
|
#define OLC_SCRIPT(d) (OLC(d)->script) /* script editing */
|
||||||
#define OLC_ITEM_TYPE(d) (OLC(d)->item_type) /* mob/obj/room */
|
#define OLC_ITEM_TYPE(d) (OLC(d)->item_type) /* mob/obj/room */
|
||||||
|
|
||||||
/* prototype exported functions from dg_olc.c */
|
/* prototype exported functions from dg_olc.c */
|
||||||
void script_save_to_disk(FILE *fp, void *item, int type);
|
void script_save_to_disk(FILE *fp, void *item, int type);
|
||||||
void dg_olc_script_copy(struct descriptor_data *d);
|
void dg_olc_script_copy(descriptor_data *d);
|
||||||
void dg_script_menu(struct descriptor_data *d);
|
void dg_script_menu(descriptor_data *d);
|
||||||
int dg_script_edit_parse(struct descriptor_data *d, char *arg);
|
int dg_script_edit_parse(descriptor_data *d, char *arg);
|
||||||
|
|
||||||
|
|
||||||
#endif /* _DG_OLC_H_ */
|
#endif /* _DG_OLC_H_ */
|
||||||
|
|||||||
+79
-60
@@ -35,7 +35,7 @@
|
|||||||
/* Local functions not used elsewhere */
|
/* Local functions not used elsewhere */
|
||||||
static obj_data *find_obj(long n);
|
static obj_data *find_obj(long n);
|
||||||
static room_data *find_room(long n);
|
static room_data *find_room(long n);
|
||||||
static void do_stat_trigger(struct char_data *ch, trig_data *trig);
|
static void do_stat_trigger(char_data *ch, trig_data *trig);
|
||||||
static void script_stat(char_data *ch, struct script_data *sc);
|
static void script_stat(char_data *ch, struct script_data *sc);
|
||||||
static int remove_trigger(struct script_data *sc, char *name);
|
static int remove_trigger(struct script_data *sc, char *name);
|
||||||
static int is_num(char *arg);
|
static int is_num(char *arg);
|
||||||
@@ -71,8 +71,8 @@ static void dg_letter_value(struct script_data *sc, trig_data *trig, char *cmd);
|
|||||||
static struct cmdlist_element * find_case(struct trig_data *trig, struct cmdlist_element *cl,
|
static struct cmdlist_element * find_case(struct trig_data *trig, struct cmdlist_element *cl,
|
||||||
void *go, struct script_data *sc, int type, char *cond);
|
void *go, struct script_data *sc, int type, char *cond);
|
||||||
static struct cmdlist_element *find_done(struct cmdlist_element *cl);
|
static struct cmdlist_element *find_done(struct cmdlist_element *cl);
|
||||||
static struct char_data *find_char_by_uid_in_lookup_table(long uid);
|
static char_data *find_char_by_uid_in_lookup_table(long uid);
|
||||||
static struct obj_data *find_obj_by_uid_in_lookup_table(long uid);
|
static obj_data *find_obj_by_uid_in_lookup_table(long uid);
|
||||||
static EVENTFUNC(trig_wait_event);
|
static EVENTFUNC(trig_wait_event);
|
||||||
|
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ obj_data *get_object_in_equip(char_data * ch, char *name)
|
|||||||
if (id == obj->script_id)
|
if (id == obj->script_id)
|
||||||
return (obj);
|
return (obj);
|
||||||
} else if (is_number(name)) {
|
} else if (is_number(name)) {
|
||||||
obj_vnum ovnum = atoi(name);
|
obj_vnum ovnum = atoidx(name);
|
||||||
for (j = 0; j < NUM_WEARS; j++)
|
for (j = 0; j < NUM_WEARS; j++)
|
||||||
if ((obj = GET_EQ(ch, j)))
|
if ((obj = GET_EQ(ch, j)))
|
||||||
if (GET_OBJ_VNUM(obj) == ovnum)
|
if (GET_OBJ_VNUM(obj) == ovnum)
|
||||||
@@ -258,7 +258,7 @@ int find_eq_pos_script(char *arg)
|
|||||||
* @param pos The defined wear location to check.
|
* @param pos The defined wear location to check.
|
||||||
* @retval int TRUE if obj can be worn on pos, FALSE if not.
|
* @retval int TRUE if obj can be worn on pos, FALSE if not.
|
||||||
*/
|
*/
|
||||||
int can_wear_on_pos(struct obj_data *obj, int pos)
|
int can_wear_on_pos(obj_data *obj, int pos)
|
||||||
{
|
{
|
||||||
switch (pos) {
|
switch (pos) {
|
||||||
case WEAR_HOLD:
|
case WEAR_HOLD:
|
||||||
@@ -288,7 +288,7 @@ int can_wear_on_pos(struct obj_data *obj, int pos)
|
|||||||
* @retval char_data * Pointer to the character structure if it exists, or NULL
|
* @retval char_data * Pointer to the character structure if it exists, or NULL
|
||||||
* if it cannot be found.
|
* if it cannot be found.
|
||||||
*/
|
*/
|
||||||
struct char_data *find_char(long n)
|
char_data *find_char(long n)
|
||||||
{
|
{
|
||||||
if (n>=ROOM_ID_BASE) /* See note in dg_scripts.h */
|
if (n>=ROOM_ID_BASE) /* See note in dg_scripts.h */
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -486,7 +486,7 @@ room_data *get_room(char *name)
|
|||||||
|
|
||||||
if (*name == UID_CHAR)
|
if (*name == UID_CHAR)
|
||||||
return find_room(atoi(name + 1));
|
return find_room(atoi(name + 1));
|
||||||
else if ((nr = real_room(atoi(name))) == NOWHERE)
|
else if ((nr = real_room(atoidx(name))) == NOWHERE)
|
||||||
return NULL;
|
return NULL;
|
||||||
else
|
else
|
||||||
return &world[nr];
|
return &world[nr];
|
||||||
@@ -722,14 +722,14 @@ static EVENTFUNC(trig_wait_event)
|
|||||||
{
|
{
|
||||||
int found = FALSE;
|
int found = FALSE;
|
||||||
if (type == MOB_TRIGGER) {
|
if (type == MOB_TRIGGER) {
|
||||||
struct char_data *tch;
|
char_data *tch;
|
||||||
for (tch = character_list;tch && !found;tch = tch->next)
|
for (tch = character_list;tch && !found;tch = tch->next)
|
||||||
if (tch == (struct char_data *)go)
|
if (tch == (char_data *)go)
|
||||||
found = TRUE;
|
found = TRUE;
|
||||||
} else if (type == OBJ_TRIGGER) {
|
} else if (type == OBJ_TRIGGER) {
|
||||||
struct obj_data *obj;
|
obj_data *obj;
|
||||||
for (obj = object_list;obj && !found;obj = obj->next)
|
for (obj = object_list;obj && !found;obj = obj->next)
|
||||||
if (obj == (struct obj_data *)go)
|
if (obj == (obj_data *)go)
|
||||||
found = TRUE;
|
found = TRUE;
|
||||||
} else {
|
} else {
|
||||||
room_rnum i;
|
room_rnum i;
|
||||||
@@ -753,7 +753,7 @@ static EVENTFUNC(trig_wait_event)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_stat_trigger(struct char_data *ch, trig_data *trig)
|
static void do_stat_trigger(char_data *ch, trig_data *trig)
|
||||||
{
|
{
|
||||||
struct cmdlist_element *cmd_list;
|
struct cmdlist_element *cmd_list;
|
||||||
char sb[MAX_STRING_LENGTH], buf[MAX_STRING_LENGTH];
|
char sb[MAX_STRING_LENGTH], buf[MAX_STRING_LENGTH];
|
||||||
@@ -878,7 +878,7 @@ static void script_stat (char_data *ch, struct script_data *sc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_sstat_room(struct char_data * ch, struct room_data *rm)
|
void do_sstat_room(char_data * ch, struct room_data *rm)
|
||||||
{
|
{
|
||||||
send_to_char(ch, "Triggers:\r\n");
|
send_to_char(ch, "Triggers:\r\n");
|
||||||
if (!SCRIPT(rm)) {
|
if (!SCRIPT(rm)) {
|
||||||
@@ -944,8 +944,11 @@ ACMD(do_attach)
|
|||||||
trig_data *trig;
|
trig_data *trig;
|
||||||
char targ_name[MAX_INPUT_LENGTH], trig_name[MAX_INPUT_LENGTH];
|
char targ_name[MAX_INPUT_LENGTH], trig_name[MAX_INPUT_LENGTH];
|
||||||
char loc_name[MAX_INPUT_LENGTH], arg[MAX_INPUT_LENGTH];
|
char loc_name[MAX_INPUT_LENGTH], arg[MAX_INPUT_LENGTH];
|
||||||
int loc, tn, rn, num_arg;
|
int loc;
|
||||||
|
trig_rnum rn;
|
||||||
room_rnum rnum;
|
room_rnum rnum;
|
||||||
|
IDXTYPE num_arg;
|
||||||
|
trig_vnum tn;
|
||||||
|
|
||||||
argument = two_arguments(argument, arg, trig_name);
|
argument = two_arguments(argument, arg, trig_name);
|
||||||
two_arguments(argument, targ_name, loc_name);
|
two_arguments(argument, targ_name, loc_name);
|
||||||
@@ -955,8 +958,8 @@ ACMD(do_attach)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
num_arg = atoi(targ_name);
|
num_arg = atoidx(targ_name);
|
||||||
tn = atoi(trig_name);
|
tn = atoidx(trig_name);
|
||||||
loc = (*loc_name) ? atoi(loc_name) : -1;
|
loc = (*loc_name) ? atoi(loc_name) : -1;
|
||||||
|
|
||||||
if (is_abbrev(arg, "mobile") || is_abbrev(arg, "mtr")) {
|
if (is_abbrev(arg, "mobile") || is_abbrev(arg, "mtr")) {
|
||||||
@@ -1147,13 +1150,15 @@ ACMD(do_detach)
|
|||||||
struct room_data *room;
|
struct room_data *room;
|
||||||
char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH], arg3[MAX_INPUT_LENGTH], *snum;
|
char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH], arg3[MAX_INPUT_LENGTH], *snum;
|
||||||
char *trigger = 0;
|
char *trigger = 0;
|
||||||
int num_arg, tn, rn;
|
IDXTYPE num_arg;
|
||||||
|
trig_vnum tn;
|
||||||
|
trig_rnum rn;
|
||||||
room_rnum rnum;
|
room_rnum rnum;
|
||||||
trig_data *trig;
|
trig_data *trig;
|
||||||
|
|
||||||
argument = two_arguments(argument, arg1, arg2);
|
argument = two_arguments(argument, arg1, arg2);
|
||||||
one_argument(argument, arg3);
|
one_argument(argument, arg3);
|
||||||
tn = atoi(arg3);
|
tn = atoidx(arg3);
|
||||||
rn = real_trigger(tn);
|
rn = real_trigger(tn);
|
||||||
trig = read_trigger(rn);
|
trig = read_trigger(rn);
|
||||||
|
|
||||||
@@ -1164,7 +1169,7 @@ ACMD(do_detach)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* vnum of mob/obj, if given */
|
/* vnum of mob/obj, if given */
|
||||||
num_arg = atoi(arg2);
|
num_arg = atoidx(arg2);
|
||||||
|
|
||||||
if (!str_cmp(arg1, "room") || !str_cmp(arg1, "wtr")) {
|
if (!str_cmp(arg1, "room") || !str_cmp(arg1, "wtr")) {
|
||||||
if (!*arg3 || (strchr(arg2, '.')))
|
if (!*arg3 || (strchr(arg2, '.')))
|
||||||
@@ -1321,7 +1326,7 @@ ACMD(do_detach)
|
|||||||
void script_vlog(const char *format, va_list args)
|
void script_vlog(const char *format, va_list args)
|
||||||
{
|
{
|
||||||
char output[MAX_STRING_LENGTH];
|
char output[MAX_STRING_LENGTH];
|
||||||
struct descriptor_data *i;
|
descriptor_data *i;
|
||||||
|
|
||||||
/* parse the args, making the error message */
|
/* parse the args, making the error message */
|
||||||
vsnprintf(output, sizeof(output) - 2, format, args);
|
vsnprintf(output, sizeof(output) - 2, format, args);
|
||||||
@@ -1793,7 +1798,8 @@ static void process_attach(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
char_data *c=NULL;
|
char_data *c=NULL;
|
||||||
obj_data *o=NULL;
|
obj_data *o=NULL;
|
||||||
room_data *r=NULL;
|
room_data *r=NULL;
|
||||||
long trignum, id;
|
long id;
|
||||||
|
trig_rnum trignum;
|
||||||
|
|
||||||
id_p = two_arguments(cmd, arg, trignum_s);
|
id_p = two_arguments(cmd, arg, trignum_s);
|
||||||
skip_spaces(&id_p);
|
skip_spaces(&id_p);
|
||||||
@@ -1831,7 +1837,7 @@ static void process_attach(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* locate and load the trigger specified */
|
/* locate and load the trigger specified */
|
||||||
trignum = real_trigger(atoi(trignum_s));
|
trignum = real_trigger(atoidx(trignum_s));
|
||||||
if (trignum == NOTHING || !(newtrig=read_trigger(trignum))) {
|
if (trignum == NOTHING || !(newtrig=read_trigger(trignum))) {
|
||||||
script_log("Trigger: %s, VNum %d. attach invalid trigger: '%s'",
|
script_log("Trigger: %s, VNum %d. attach invalid trigger: '%s'",
|
||||||
GET_TRIG_NAME(trig), GET_TRIG_VNUM(trig), trignum_s);
|
GET_TRIG_NAME(trig), GET_TRIG_VNUM(trig), trignum_s);
|
||||||
@@ -1953,7 +1959,7 @@ static void process_detach(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct room_data *dg_room_of_obj(struct obj_data *obj)
|
struct room_data *dg_room_of_obj(obj_data *obj)
|
||||||
{
|
{
|
||||||
if (IN_ROOM(obj) != NOWHERE) return &world[IN_ROOM(obj)];
|
if (IN_ROOM(obj) != NOWHERE) return &world[IN_ROOM(obj)];
|
||||||
if (obj->carried_by) return &world[IN_ROOM(obj->carried_by)];
|
if (obj->carried_by) return &world[IN_ROOM(obj->carried_by)];
|
||||||
@@ -2002,34 +2008,34 @@ static void makeuid_var(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_abbrev(arg, "mob")) {
|
if (is_abbrev(arg, "mob")) {
|
||||||
struct char_data *c = NULL;
|
char_data *c = NULL;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case WLD_TRIGGER:
|
case WLD_TRIGGER:
|
||||||
c = get_char_in_room((struct room_data *)go, name);
|
c = get_char_in_room((struct room_data *)go, name);
|
||||||
break;
|
break;
|
||||||
case OBJ_TRIGGER:
|
case OBJ_TRIGGER:
|
||||||
c = get_char_near_obj((struct obj_data *)go, name);
|
c = get_char_near_obj((obj_data *)go, name);
|
||||||
break;
|
break;
|
||||||
case MOB_TRIGGER:
|
case MOB_TRIGGER:
|
||||||
c = get_char_room_vis((struct char_data *)go, name, NULL);
|
c = get_char_room_vis((char_data *)go, name, NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (c)
|
if (c)
|
||||||
snprintf(uid, sizeof(uid), "%c%ld", UID_CHAR, char_script_id(c));
|
snprintf(uid, sizeof(uid), "%c%ld", UID_CHAR, char_script_id(c));
|
||||||
} else if (is_abbrev(arg, "obj")) {
|
} else if (is_abbrev(arg, "obj")) {
|
||||||
struct obj_data *o = NULL;
|
obj_data *o = NULL;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case WLD_TRIGGER:
|
case WLD_TRIGGER:
|
||||||
o = get_obj_in_room((struct room_data *)go, name);
|
o = get_obj_in_room((struct room_data *)go, name);
|
||||||
break;
|
break;
|
||||||
case OBJ_TRIGGER:
|
case OBJ_TRIGGER:
|
||||||
o = get_obj_near_obj((struct obj_data *)go, name);
|
o = get_obj_near_obj((obj_data *)go, name);
|
||||||
break;
|
break;
|
||||||
case MOB_TRIGGER:
|
case MOB_TRIGGER:
|
||||||
if ((o = get_obj_in_list_vis((struct char_data *)go, name, NULL,
|
if ((o = get_obj_in_list_vis((char_data *)go, name, NULL,
|
||||||
((struct char_data *)go)->carrying)) == NULL)
|
((char_data *)go)->carrying)) == NULL)
|
||||||
o = get_obj_in_list_vis((struct char_data *)go, name, NULL,
|
o = get_obj_in_list_vis((char_data *)go, name, NULL,
|
||||||
world[IN_ROOM((struct char_data *)go)].contents);
|
world[IN_ROOM((char_data *)go)].contents);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (o)
|
if (o)
|
||||||
@@ -2041,10 +2047,10 @@ static void makeuid_var(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
r = real_room(((struct room_data *) go)->number);
|
r = real_room(((struct room_data *) go)->number);
|
||||||
break;
|
break;
|
||||||
case OBJ_TRIGGER:
|
case OBJ_TRIGGER:
|
||||||
r = obj_room((struct obj_data *)go);
|
r = obj_room((obj_data *)go);
|
||||||
break;
|
break;
|
||||||
case MOB_TRIGGER:
|
case MOB_TRIGGER:
|
||||||
r = IN_ROOM((struct char_data *)go);
|
r = IN_ROOM((char_data *)go);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (r != NOWHERE)
|
if (r != NOWHERE)
|
||||||
@@ -2261,7 +2267,7 @@ ACMD(do_vdelete)
|
|||||||
|
|
||||||
/* Called from do_set - return 0 for failure, 1 for success. ch and vict are
|
/* Called from do_set - return 0 for failure, 1 for success. ch and vict are
|
||||||
* verified. */
|
* verified. */
|
||||||
int perform_set_dg_var(struct char_data *ch, struct char_data *vict, char *val_arg)
|
int perform_set_dg_var(char_data *ch, char_data *vict, char *val_arg)
|
||||||
{
|
{
|
||||||
char var_name[MAX_INPUT_LENGTH], *var_value;
|
char var_name[MAX_INPUT_LENGTH], *var_value;
|
||||||
|
|
||||||
@@ -2486,7 +2492,6 @@ int script_driver(void *go_adress, trig_data *trig, int type, int mode)
|
|||||||
char cmd[MAX_INPUT_LENGTH], *p;
|
char cmd[MAX_INPUT_LENGTH], *p;
|
||||||
struct script_data *sc = 0;
|
struct script_data *sc = 0;
|
||||||
struct cmdlist_element *temp;
|
struct cmdlist_element *temp;
|
||||||
unsigned long loops = 0;
|
|
||||||
void *go = NULL;
|
void *go = NULL;
|
||||||
|
|
||||||
void obj_command_interpreter(obj_data *obj, char *argument);
|
void obj_command_interpreter(obj_data *obj, char *argument);
|
||||||
@@ -2578,8 +2583,8 @@ int script_driver(void *go_adress, trig_data *trig, int type, int mode)
|
|||||||
if (process_if(p + 6, go, sc, trig, type)) {
|
if (process_if(p + 6, go, sc, trig, type)) {
|
||||||
temp->original = cl;
|
temp->original = cl;
|
||||||
} else {
|
} else {
|
||||||
|
cl->loops = 0;
|
||||||
cl = temp;
|
cl = temp;
|
||||||
loops = 0;
|
|
||||||
}
|
}
|
||||||
} else if (!strn_cmp("switch ", p, 7)) {
|
} else if (!strn_cmp("switch ", p, 7)) {
|
||||||
cl = find_case(trig, cl, go, sc, type, p + 7);
|
cl = find_case(trig, cl, go, sc, type, p + 7);
|
||||||
@@ -2599,9 +2604,10 @@ int script_driver(void *go_adress, trig_data *trig, int type, int mode)
|
|||||||
if (cl->original && process_if(orig_cmd + 6, go, sc, trig,
|
if (cl->original && process_if(orig_cmd + 6, go, sc, trig,
|
||||||
type)) {
|
type)) {
|
||||||
cl = cl->original;
|
cl = cl->original;
|
||||||
loops++;
|
cl->loops++;
|
||||||
GET_TRIG_LOOPS(trig)++;
|
GET_TRIG_LOOPS(trig)++;
|
||||||
if (loops == 30) {
|
if (cl->loops == 30) {
|
||||||
|
cl->loops = 0;
|
||||||
process_wait(go, trig, type, "wait 1", cl);
|
process_wait(go, trig, type, "wait 1", cl);
|
||||||
depth--;
|
depth--;
|
||||||
return ret_val;
|
return ret_val;
|
||||||
@@ -2725,7 +2731,7 @@ trig_rnum real_trigger(trig_vnum vnum)
|
|||||||
bot = 0;
|
bot = 0;
|
||||||
top = top_of_trigt - 1;
|
top = top_of_trigt - 1;
|
||||||
|
|
||||||
if (!top_of_trigt || trig_index[bot]->vnum > vnum || trig_index[top]->vnum < vnum)
|
if (vnum == NOTHING || !top_of_trigt || trig_index[bot]->vnum > vnum || trig_index[top]->vnum < vnum)
|
||||||
return (NOTHING);
|
return (NOTHING);
|
||||||
|
|
||||||
/* perform binary search on trigger-table */
|
/* perform binary search on trigger-table */
|
||||||
@@ -2749,7 +2755,7 @@ ACMD(do_tstat)
|
|||||||
|
|
||||||
half_chop(argument, str, argument);
|
half_chop(argument, str, argument);
|
||||||
if (*str) {
|
if (*str) {
|
||||||
rnum = real_trigger(atoi(str));
|
rnum = real_trigger(atoidx(str));
|
||||||
if (rnum == NOTHING) {
|
if (rnum == NOTHING) {
|
||||||
send_to_char(ch, "That vnum does not exist.\r\n");
|
send_to_char(ch, "That vnum does not exist.\r\n");
|
||||||
return;
|
return;
|
||||||
@@ -2821,7 +2827,7 @@ static struct cmdlist_element *find_done(struct cmdlist_element *cl)
|
|||||||
|
|
||||||
|
|
||||||
/* load in a character's saved variables */
|
/* load in a character's saved variables */
|
||||||
void read_saved_vars(struct char_data *ch)
|
void read_saved_vars(char_data *ch)
|
||||||
{
|
{
|
||||||
FILE *file;
|
FILE *file;
|
||||||
long context;
|
long context;
|
||||||
@@ -2868,7 +2874,7 @@ void read_saved_vars(struct char_data *ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* save a characters variables out to disk */
|
/* save a characters variables out to disk */
|
||||||
void save_char_vars(struct char_data *ch)
|
void save_char_vars(char_data *ch)
|
||||||
{
|
{
|
||||||
FILE *file;
|
FILE *file;
|
||||||
char fn[127];
|
char fn[127];
|
||||||
@@ -2907,7 +2913,7 @@ void save_char_vars(struct char_data *ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* load in a character's saved variables from an ASCII pfile*/
|
/* load in a character's saved variables from an ASCII pfile*/
|
||||||
void read_saved_vars_ascii(FILE *file, struct char_data *ch, int count)
|
void read_saved_vars_ascii(FILE *file, char_data *ch, int count)
|
||||||
{
|
{
|
||||||
long context;
|
long context;
|
||||||
char input_line[1024], *temp, *p;
|
char input_line[1024], *temp, *p;
|
||||||
@@ -2942,7 +2948,7 @@ void read_saved_vars_ascii(FILE *file, struct char_data *ch, int count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* save a characters variables out to an ASCII pfile */
|
/* save a characters variables out to an ASCII pfile */
|
||||||
void save_char_vars_ascii(FILE *file, struct char_data *ch)
|
void save_char_vars_ascii(FILE *file, char_data *ch)
|
||||||
{
|
{
|
||||||
struct trig_var_data *vars;
|
struct trig_var_data *vars;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
@@ -2994,38 +3000,52 @@ void init_lookup_table(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct char_data *find_char_by_uid_in_lookup_table(long uid)
|
static inline struct lookup_table_t *get_bucket_head(long uid)
|
||||||
{
|
{
|
||||||
int bucket = (int) (uid & (BUCKET_COUNT - 1));
|
int bucket = (int) (uid & (BUCKET_COUNT - 1));
|
||||||
struct lookup_table_t *lt = &lookup_table[bucket];
|
return &lookup_table[bucket];
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline struct lookup_table_t *find_element_by_uid_in_lookup_table(long uid)
|
||||||
|
{
|
||||||
|
struct lookup_table_t *lt = get_bucket_head(uid);
|
||||||
|
|
||||||
for (;lt && lt->uid != uid ; lt = lt->next) ;
|
for (;lt && lt->uid != uid ; lt = lt->next) ;
|
||||||
|
return lt;
|
||||||
|
}
|
||||||
|
|
||||||
|
static char_data *find_char_by_uid_in_lookup_table(long uid)
|
||||||
|
{
|
||||||
|
struct lookup_table_t *lt = find_element_by_uid_in_lookup_table(uid);
|
||||||
|
|
||||||
if (lt)
|
if (lt)
|
||||||
return (struct char_data *)(lt->c);
|
return (char_data *)(lt->c);
|
||||||
|
|
||||||
log("find_char_by_uid_in_lookup_table : No entity with number %ld in lookup table", uid);
|
log("find_char_by_uid_in_lookup_table : No entity with number %ld in lookup table", uid);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct obj_data *find_obj_by_uid_in_lookup_table(long uid)
|
static obj_data *find_obj_by_uid_in_lookup_table(long uid)
|
||||||
{
|
{
|
||||||
int bucket = (int) (uid & (BUCKET_COUNT - 1));
|
struct lookup_table_t *lt = find_element_by_uid_in_lookup_table(uid);
|
||||||
struct lookup_table_t *lt = &lookup_table[bucket];
|
|
||||||
|
|
||||||
for (;lt && lt->uid != uid ; lt = lt->next) ;
|
|
||||||
|
|
||||||
if (lt)
|
if (lt)
|
||||||
return (struct obj_data *)(lt->c);
|
return (obj_data *)(lt->c);
|
||||||
|
|
||||||
log("find_obj_by_uid_in_lookup_table : No entity with number %ld in lookup table", uid);
|
log("find_obj_by_uid_in_lookup_table : No entity with number %ld in lookup table", uid);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int has_obj_by_uid_in_lookup_table(long uid)
|
||||||
|
{
|
||||||
|
struct lookup_table_t *lt = find_element_by_uid_in_lookup_table(uid);
|
||||||
|
|
||||||
|
return lt != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void add_to_lookup_table(long uid, void *c)
|
void add_to_lookup_table(long uid, void *c)
|
||||||
{
|
{
|
||||||
int bucket = (int) (uid & (BUCKET_COUNT - 1));
|
struct lookup_table_t *lt = get_bucket_head(uid);
|
||||||
struct lookup_table_t *lt = &lookup_table[bucket];
|
|
||||||
|
|
||||||
if (lt && lt->uid == uid) {
|
if (lt && lt->uid == uid) {
|
||||||
log("add_to_lookup updating existing value for uid=%ld (%p -> %p)", uid, lt->c, c);
|
log("add_to_lookup updating existing value for uid=%ld (%p -> %p)", uid, lt->c, c);
|
||||||
@@ -3036,6 +3056,7 @@ void add_to_lookup_table(long uid, void *c)
|
|||||||
for (;lt && lt->next; lt = lt->next)
|
for (;lt && lt->next; lt = lt->next)
|
||||||
if (lt->next->uid == uid) {
|
if (lt->next->uid == uid) {
|
||||||
log("add_to_lookup updating existing value for uid=%ld (%p -> %p)", uid, lt->next->c, c);
|
log("add_to_lookup updating existing value for uid=%ld (%p -> %p)", uid, lt->next->c, c);
|
||||||
|
lt->next->c = c;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3054,9 +3075,7 @@ void remove_from_lookup_table(long uid)
|
|||||||
if (uid == 0)
|
if (uid == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (;lt;lt = lt->next)
|
flt = find_element_by_uid_in_lookup_table(uid);
|
||||||
if (lt->uid == uid)
|
|
||||||
flt = lt;
|
|
||||||
|
|
||||||
if (flt) {
|
if (flt) {
|
||||||
for (lt = &lookup_table[bucket];lt->next != flt;lt = lt->next)
|
for (lt = &lookup_table[bucket];lt->next != flt;lt = lt->next)
|
||||||
@@ -3083,7 +3102,7 @@ bool check_flags_by_name_ar(int *array, int numflags, char *search, const char *
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int trig_is_attached(struct script_data *sc, int trig_num)
|
int trig_is_attached(struct script_data *sc, trig_vnum trig_num)
|
||||||
{
|
{
|
||||||
trig_data *t;
|
trig_data *t;
|
||||||
|
|
||||||
|
|||||||
+88
-102
@@ -16,6 +16,7 @@
|
|||||||
#define _DG_SCRIPTS_H_
|
#define _DG_SCRIPTS_H_
|
||||||
|
|
||||||
#include "utils.h" /* To make sure ACMD is defined */
|
#include "utils.h" /* To make sure ACMD is defined */
|
||||||
|
#include "structs.h" /* To make sure we have access to typedefs */
|
||||||
|
|
||||||
#define MOB_TRIGGER 0
|
#define MOB_TRIGGER 0
|
||||||
#define OBJ_TRIGGER 1
|
#define OBJ_TRIGGER 1
|
||||||
@@ -53,8 +54,8 @@
|
|||||||
/* mob trigger types */
|
/* mob trigger types */
|
||||||
#define MTRIG_GLOBAL (1 << 0) /* check even if zone empty */
|
#define MTRIG_GLOBAL (1 << 0) /* check even if zone empty */
|
||||||
#define MTRIG_RANDOM (1 << 1) /* checked randomly */
|
#define MTRIG_RANDOM (1 << 1) /* checked randomly */
|
||||||
#define MTRIG_COMMAND (1 << 2) /* character types a command */
|
#define MTRIG_COMMAND (1 << 2) /* character types a command */
|
||||||
#define MTRIG_SPEECH (1 << 3) /* a char says a word/phrase */
|
#define MTRIG_SPEECH (1 << 3) /* a char says a word/phrase */
|
||||||
#define MTRIG_ACT (1 << 4) /* word or phrase sent to act */
|
#define MTRIG_ACT (1 << 4) /* word or phrase sent to act */
|
||||||
#define MTRIG_DEATH (1 << 5) /* character dies */
|
#define MTRIG_DEATH (1 << 5) /* character dies */
|
||||||
#define MTRIG_GREET (1 << 6) /* something enters room seen */
|
#define MTRIG_GREET (1 << 6) /* something enters room seen */
|
||||||
@@ -63,7 +64,7 @@
|
|||||||
#define MTRIG_RECEIVE (1 << 9) /* character is given obj */
|
#define MTRIG_RECEIVE (1 << 9) /* character is given obj */
|
||||||
#define MTRIG_FIGHT (1 << 10) /* each pulse while fighting */
|
#define MTRIG_FIGHT (1 << 10) /* each pulse while fighting */
|
||||||
#define MTRIG_HITPRCNT (1 << 11) /* fighting and below some hp */
|
#define MTRIG_HITPRCNT (1 << 11) /* fighting and below some hp */
|
||||||
#define MTRIG_BRIBE (1 << 12) /* coins are given to mob */
|
#define MTRIG_BRIBE (1 << 12) /* coins are given to mob */
|
||||||
#define MTRIG_LOAD (1 << 13) /* the mob is loaded */
|
#define MTRIG_LOAD (1 << 13) /* the mob is loaded */
|
||||||
#define MTRIG_MEMORY (1 << 14) /* mob see's someone remembered */
|
#define MTRIG_MEMORY (1 << 14) /* mob see's someone remembered */
|
||||||
#define MTRIG_CAST (1 << 15) /* mob targetted by spell */
|
#define MTRIG_CAST (1 << 15) /* mob targetted by spell */
|
||||||
@@ -71,10 +72,11 @@
|
|||||||
#define MTRIG_DOOR (1 << 17) /* door manipulated in room */
|
#define MTRIG_DOOR (1 << 17) /* door manipulated in room */
|
||||||
|
|
||||||
#define MTRIG_TIME (1 << 19) /* trigger based on game hour */
|
#define MTRIG_TIME (1 << 19) /* trigger based on game hour */
|
||||||
|
#define MTRIG_DAMAGE (1 << 20) /* trigger whenever mob is damaged */
|
||||||
|
|
||||||
/* obj trigger types */
|
/* obj trigger types */
|
||||||
#define OTRIG_GLOBAL (1 << 0) /* unused */
|
#define OTRIG_GLOBAL (1 << 0) /* unused */
|
||||||
#define OTRIG_RANDOM (1 << 1) /* checked randomly */
|
#define OTRIG_RANDOM (1 << 1) /* checked randomly */
|
||||||
#define OTRIG_COMMAND (1 << 2) /* character types a command */
|
#define OTRIG_COMMAND (1 << 2) /* character types a command */
|
||||||
|
|
||||||
#define OTRIG_TIMER (1 << 5) /* item's timer expires */
|
#define OTRIG_TIMER (1 << 5) /* item's timer expires */
|
||||||
@@ -94,12 +96,12 @@
|
|||||||
|
|
||||||
/* wld trigger types */
|
/* wld trigger types */
|
||||||
#define WTRIG_GLOBAL (1 << 0) /* check even if zone empty */
|
#define WTRIG_GLOBAL (1 << 0) /* check even if zone empty */
|
||||||
#define WTRIG_RANDOM (1 << 1) /* checked randomly */
|
#define WTRIG_RANDOM (1 << 1) /* checked randomly */
|
||||||
#define WTRIG_COMMAND (1 << 2) /* character types a command */
|
#define WTRIG_COMMAND (1 << 2) /* character types a command */
|
||||||
#define WTRIG_SPEECH (1 << 3) /* a char says word/phrase */
|
#define WTRIG_SPEECH (1 << 3) /* a char says word/phrase */
|
||||||
|
|
||||||
#define WTRIG_RESET (1 << 5) /* zone has been reset */
|
#define WTRIG_RESET (1 << 5) /* zone has been reset */
|
||||||
#define WTRIG_ENTER (1 << 6) /* character enters room */
|
#define WTRIG_ENTER (1 << 6) /* character enters room */
|
||||||
#define WTRIG_DROP (1 << 7) /* something dropped in room */
|
#define WTRIG_DROP (1 << 7) /* something dropped in room */
|
||||||
|
|
||||||
#define WTRIG_CAST (1 << 15) /* spell cast in room */
|
#define WTRIG_CAST (1 << 15) /* spell cast in room */
|
||||||
@@ -109,40 +111,40 @@
|
|||||||
#define WTRIG_TIME (1 << 19) /* trigger based on game hour */
|
#define WTRIG_TIME (1 << 19) /* trigger based on game hour */
|
||||||
|
|
||||||
/* obj command trigger types */
|
/* obj command trigger types */
|
||||||
#define OCMD_EQUIP (1 << 0) /* obj must be in char's equip */
|
#define OCMD_EQUIP (1 << 0) /* obj must be in char's equip */
|
||||||
#define OCMD_INVEN (1 << 1) /* obj must be in char's inven */
|
#define OCMD_INVEN (1 << 1) /* obj must be in char's inven */
|
||||||
#define OCMD_ROOM (1 << 2) /* obj must be in char's room */
|
#define OCMD_ROOM (1 << 2) /* obj must be in char's room */
|
||||||
|
|
||||||
/* obj consume trigger commands */
|
/* obj consume trigger commands */
|
||||||
#define OCMD_EAT 1
|
#define OCMD_EAT 1
|
||||||
#define OCMD_DRINK 2
|
#define OCMD_DRINK 2
|
||||||
#define OCMD_QUAFF 3
|
#define OCMD_QUAFF 3
|
||||||
|
|
||||||
#define TRIG_NEW 0 /* trigger starts from top */
|
#define TRIG_NEW 0 /* trigger starts from top */
|
||||||
#define TRIG_RESTART 1 /* trigger restarting */
|
#define TRIG_RESTART 1 /* trigger restarting */
|
||||||
|
|
||||||
/* These are slightly off of PULSE_MOBILE so everything isnt happening at the
|
/* These are slightly off of PULSE_MOBILE so everything isnt happening at the
|
||||||
* same time. */
|
* same time. */
|
||||||
#define PULSE_DG_SCRIPT (13 RL_SEC)
|
#define PULSE_DG_SCRIPT (13 RL_SEC)
|
||||||
|
|
||||||
#define MAX_SCRIPT_DEPTH 10 /* maximum depth triggers can
|
#define MAX_SCRIPT_DEPTH 10 /* maximum depth triggers can recurse into each other */
|
||||||
recurse into each other */
|
|
||||||
|
|
||||||
#define SCRIPT_ERROR_CODE -9999999 /* this shouldn't happen too often */
|
#define SCRIPT_ERROR_CODE -9999999 /* this shouldn't happen too often */
|
||||||
|
|
||||||
/* one line of the trigger */
|
/* one line of the trigger */
|
||||||
struct cmdlist_element {
|
struct cmdlist_element {
|
||||||
char *cmd; /* one line of a trigger */
|
char *cmd; /* one line of a trigger */
|
||||||
struct cmdlist_element *original;
|
struct cmdlist_element *original;
|
||||||
struct cmdlist_element *next;
|
struct cmdlist_element *next;
|
||||||
|
int loops; /* for counting number of runs in a while loop */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct trig_var_data {
|
struct trig_var_data {
|
||||||
char *name; /* name of variable */
|
char *name; /* name of variable */
|
||||||
char *value; /* value of variable */
|
char *value; /* value of variable */
|
||||||
long context; /* 0: global context */
|
long context; /* 0: global context */
|
||||||
|
|
||||||
struct trig_var_data *next;
|
struct trig_var_data *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** structure for triggers */
|
/** structure for triggers */
|
||||||
@@ -153,14 +155,14 @@ struct trig_data {
|
|||||||
char *name; /**< name of trigger */
|
char *name; /**< name of trigger */
|
||||||
long trigger_type; /**< type of trigger (for bitvector) */
|
long trigger_type; /**< type of trigger (for bitvector) */
|
||||||
struct cmdlist_element *cmdlist; /**< top of command list */
|
struct cmdlist_element *cmdlist; /**< top of command list */
|
||||||
struct cmdlist_element *curr_state; /**< ptr to current line of trigger */
|
struct cmdlist_element *curr_state; /**< ptr to current line of trigger */
|
||||||
int narg; /**< numerical argument */
|
int narg; /**< numerical argument */
|
||||||
char *arglist; /**< argument list */
|
char *arglist; /**< argument list */
|
||||||
int depth; /**< depth into nest ifs/whiles/etc */
|
int depth; /**< depth into nest ifs/whiles/etc */
|
||||||
int loops; /**< loop iteration counter */
|
int loops; /**< loop iteration counter */
|
||||||
struct event *wait_event; /**< event to pause the trigger */
|
struct event *wait_event; /**< event to pause the trigger */
|
||||||
ubyte purged; /**< trigger is set to be purged */
|
ubyte purged; /**< trigger is set to be purged */
|
||||||
struct trig_var_data *var_list; /**< list of local vars for trigger */
|
struct trig_var_data *var_list; /**< list of local vars for trigger */
|
||||||
|
|
||||||
struct trig_data *next;
|
struct trig_data *next;
|
||||||
struct trig_data *next_in_world; /**< next in the global trigger list */
|
struct trig_data *next_in_world; /**< next in the global trigger list */
|
||||||
@@ -168,44 +170,36 @@ struct trig_data {
|
|||||||
|
|
||||||
/** a complete script (composed of several triggers) */
|
/** a complete script (composed of several triggers) */
|
||||||
struct script_data {
|
struct script_data {
|
||||||
long types; /**< bitvector of trigger types */
|
long types; /**< bitvector of trigger types */
|
||||||
struct trig_data *trig_list; /**< list of triggers */
|
struct trig_data *trig_list; /**< list of triggers */
|
||||||
struct trig_var_data *global_vars; /**< list of global variables */
|
struct trig_var_data *global_vars; /**< list of global variables */
|
||||||
ubyte purged; /**< script is set to be purged */
|
ubyte purged; /**< script is set to be purged */
|
||||||
long context; /**< current context for statics */
|
long context; /**< current context for statics */
|
||||||
|
|
||||||
struct script_data *next; /**< used for purged_scripts */
|
struct script_data *next; /**< used for purged_scripts */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* The event data for the wait command */
|
/* The event data for the wait command */
|
||||||
struct wait_event_data {
|
struct wait_event_data {
|
||||||
struct trig_data *trigger;
|
struct trig_data *trigger;
|
||||||
void *go;
|
void *go;
|
||||||
int type;
|
int type;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* used for actor memory triggers */
|
/* used for actor memory triggers */
|
||||||
struct script_memory {
|
struct script_memory {
|
||||||
long id; /* id of who to remember */
|
long id; /* id of who to remember */
|
||||||
char *cmd; /* command, or NULL for generic */
|
char *cmd; /* command, or NULL for generic */
|
||||||
struct script_memory *next;
|
struct script_memory *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* typedefs that the dg functions rely on */
|
|
||||||
typedef struct index_data index_data;
|
|
||||||
typedef struct room_data room_data;
|
|
||||||
typedef struct obj_data obj_data;
|
|
||||||
typedef struct trig_data trig_data;
|
|
||||||
typedef struct char_data char_data;
|
|
||||||
|
|
||||||
|
|
||||||
/* function prototypes from dg_triggers.c */
|
/* function prototypes from dg_triggers.c */
|
||||||
char *one_phrase(char *arg, char *first_arg);
|
char *one_phrase(char *arg, char *first_arg);
|
||||||
int is_substring(char *sub, char *string);
|
int is_substring(char *sub, char *string);
|
||||||
int word_check(char *str, char *wordlist);
|
int word_check(char *str, char *wordlist);
|
||||||
|
|
||||||
void act_mtrigger(const char_data *ch, char *str,
|
void act_mtrigger(const char_data *ch, char *str, char_data *actor, char_data *victim, obj_data *object,
|
||||||
char_data *actor, char_data *victim, obj_data *object, obj_data *target, char *arg);
|
obj_data *target, char *arg);
|
||||||
void speech_mtrigger(char_data *actor, char *str);
|
void speech_mtrigger(char_data *actor, char *str);
|
||||||
void speech_wtrigger(char_data *actor, char *str);
|
void speech_wtrigger(char_data *actor, char *str);
|
||||||
void greet_memory_mtrigger(char_data *ch);
|
void greet_memory_mtrigger(char_data *ch);
|
||||||
@@ -217,17 +211,13 @@ int drop_otrigger(obj_data *obj, char_data *actor);
|
|||||||
void timer_otrigger(obj_data *obj);
|
void timer_otrigger(obj_data *obj);
|
||||||
int get_otrigger(obj_data *obj, char_data *actor);
|
int get_otrigger(obj_data *obj, char_data *actor);
|
||||||
int drop_wtrigger(obj_data *obj, char_data *actor);
|
int drop_wtrigger(obj_data *obj, char_data *actor);
|
||||||
int give_otrigger(obj_data *obj, char_data *actor,
|
int give_otrigger(obj_data *obj, char_data *actor, char_data *victim);
|
||||||
char_data *victim);
|
int receive_mtrigger(char_data *ch, char_data *actor, obj_data *obj);
|
||||||
int receive_mtrigger(char_data *ch, char_data *actor,
|
void bribe_mtrigger(char_data *ch, char_data *actor, int amount);
|
||||||
obj_data *obj);
|
|
||||||
void bribe_mtrigger(char_data *ch, char_data *actor,
|
|
||||||
int amount);
|
|
||||||
int wear_otrigger(obj_data *obj, char_data *actor, int where);
|
int wear_otrigger(obj_data *obj, char_data *actor, int where);
|
||||||
int remove_otrigger(obj_data *obj, char_data *actor);
|
int remove_otrigger(obj_data *obj, char_data *actor);
|
||||||
|
|
||||||
int cmd_otrig(obj_data *obj, char_data *actor, char *cmd,
|
int cmd_otrig(obj_data *obj, char_data *actor, char *cmd, char *argument, int type);
|
||||||
char *argument, int type);
|
|
||||||
int command_mtrigger(char_data *actor, char *cmd, char *argument);
|
int command_mtrigger(char_data *actor, char *cmd, char *argument);
|
||||||
int command_otrigger(char_data *actor, char *cmd, char *argument);
|
int command_otrigger(char_data *actor, char *cmd, char *argument);
|
||||||
int command_wtrigger(char_data *actor, char *cmd, char *argument);
|
int command_wtrigger(char_data *actor, char *cmd, char *argument);
|
||||||
@@ -263,6 +253,7 @@ void time_wtrigger(room_data *room);
|
|||||||
|
|
||||||
int login_wtrigger(struct room_data *room, char_data *actor);
|
int login_wtrigger(struct room_data *room, char_data *actor);
|
||||||
|
|
||||||
|
int damage_mtrigger(char_data *ch, char_data *victim, int dam, int attacktype);
|
||||||
/* function prototypes from dg_scripts.c */
|
/* function prototypes from dg_scripts.c */
|
||||||
ACMD(do_attach) ;
|
ACMD(do_attach) ;
|
||||||
ACMD(do_detach);
|
ACMD(do_detach);
|
||||||
@@ -270,8 +261,8 @@ ACMD(do_vdelete);
|
|||||||
ACMD(do_tstat);
|
ACMD(do_tstat);
|
||||||
char *str_str(char *cs, char *ct);
|
char *str_str(char *cs, char *ct);
|
||||||
int find_eq_pos_script(char *arg);
|
int find_eq_pos_script(char *arg);
|
||||||
int can_wear_on_pos(struct obj_data *obj, int pos);
|
int can_wear_on_pos(obj_data *obj, int pos);
|
||||||
struct char_data *find_char(long n);
|
char_data *find_char(long n);
|
||||||
char_data *get_char(char *name);
|
char_data *get_char(char *name);
|
||||||
char_data *get_char_near_obj(obj_data *obj, char *name);
|
char_data *get_char_near_obj(obj_data *obj, char *name);
|
||||||
char_data *get_char_in_room(room_data *room, char *name);
|
char_data *get_char_in_room(room_data *room, char *name);
|
||||||
@@ -289,28 +280,27 @@ obj_data *get_object_in_equip(char_data * ch, char *name);
|
|||||||
void script_trigger_check(void);
|
void script_trigger_check(void);
|
||||||
void check_time_triggers(void);
|
void check_time_triggers(void);
|
||||||
void find_uid_name(char *uid, char *name, size_t nlen);
|
void find_uid_name(char *uid, char *name, size_t nlen);
|
||||||
void do_sstat_room(struct char_data * ch, room_data *r);
|
void do_sstat_room(char_data * ch, room_data *r);
|
||||||
void do_sstat_object(char_data *ch, obj_data *j);
|
void do_sstat_object(char_data *ch, obj_data *j);
|
||||||
void do_sstat_character(char_data *ch, char_data *k);
|
void do_sstat_character(char_data *ch, char_data *k);
|
||||||
void add_trigger(struct script_data *sc, trig_data *t, int loc);
|
void add_trigger(struct script_data *sc, trig_data *t, int loc);
|
||||||
void script_vlog(const char *format, va_list args);
|
void script_vlog(const char *format, va_list args);
|
||||||
void script_log(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
|
void script_log(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
|
||||||
char *matching_quote(char *p);
|
char *matching_quote(char *p);
|
||||||
struct room_data *dg_room_of_obj(struct obj_data *obj);
|
struct room_data *dg_room_of_obj(obj_data *obj);
|
||||||
bool check_flags_by_name_ar(int *array, int numflags, char *search, const char *namelist[]);
|
bool check_flags_by_name_ar(int *array, int numflags, char *search, const char *namelist[]);
|
||||||
void read_saved_vars_ascii(FILE *file, struct char_data *ch, int count);
|
void read_saved_vars_ascii(FILE *file, char_data *ch, int count);
|
||||||
void save_char_vars_ascii(FILE *file, struct char_data *ch);
|
void save_char_vars_ascii(FILE *file, char_data *ch);
|
||||||
int perform_set_dg_var(struct char_data *ch, struct char_data *vict, char *val_arg);
|
int perform_set_dg_var(char_data *ch, char_data *vict, char *val_arg);
|
||||||
int trig_is_attached(struct script_data *sc, int trig_num);
|
int trig_is_attached(struct script_data *sc, trig_vnum trig_num);
|
||||||
|
|
||||||
/* To maintain strict-aliasing we'll have to do this trick with a union */
|
/* To maintain strict-aliasing we'll have to do this trick with a union */
|
||||||
/* Thanks to Chris Gilbert for reminding me that there are other options. */
|
/* Thanks to Chris Gilbert for reminding me that there are other options. */
|
||||||
int script_driver(void *go_adress, trig_data *trig, int type, int mode);
|
int script_driver(void *go_adress, trig_data *trig, int type, int mode);
|
||||||
trig_rnum real_trigger(trig_vnum vnum);
|
trig_rnum real_trigger(trig_vnum vnum);
|
||||||
void process_eval(void *go, struct script_data *sc, trig_data *trig,
|
void process_eval(void *go, struct script_data *sc, trig_data *trig, int type, char *cmd);
|
||||||
int type, char *cmd);
|
void read_saved_vars(char_data *ch);
|
||||||
void read_saved_vars(struct char_data *ch);
|
void save_char_vars(char_data *ch);
|
||||||
void save_char_vars(struct char_data *ch);
|
|
||||||
void init_lookup_table(void);
|
void init_lookup_table(void);
|
||||||
void add_to_lookup_table(long uid, void *c);
|
void add_to_lookup_table(long uid, void *c);
|
||||||
void remove_from_lookup_table(long uid);
|
void remove_from_lookup_table(long uid);
|
||||||
@@ -320,20 +310,18 @@ void parse_trigger(FILE *trig_f, int nr);
|
|||||||
trig_data *read_trigger(int nr);
|
trig_data *read_trigger(int nr);
|
||||||
void trig_data_copy(trig_data *this_data, const trig_data *trg);
|
void trig_data_copy(trig_data *this_data, const trig_data *trg);
|
||||||
void dg_read_trigger(FILE *fp, void *proto, int type);
|
void dg_read_trigger(FILE *fp, void *proto, int type);
|
||||||
void dg_obj_trigger(char *line, struct obj_data *obj);
|
void dg_obj_trigger(char *line, obj_data *obj);
|
||||||
void assign_triggers(void *i, int type);
|
void assign_triggers(void *i, int type);
|
||||||
|
|
||||||
/* From dg_variables.c */
|
/* From dg_variables.c */
|
||||||
void add_var(struct trig_var_data **var_list, const char *name, const char *value, long id);
|
void add_var(struct trig_var_data **var_list, const char *name, const char *value, long id);
|
||||||
int item_in_list(char *item, obj_data *list);
|
int item_in_list(char *item, obj_data *list);
|
||||||
char *skill_percent(struct char_data *ch, char *skill);
|
char *skill_percent(char_data *ch, char *skill);
|
||||||
int char_has_item(char *item, struct char_data *ch);
|
int char_has_item(char *item, char_data *ch);
|
||||||
void var_subst(void *go, struct script_data *sc, trig_data *trig,
|
void var_subst(void *go, struct script_data *sc, trig_data *trig, int type, char *line, char *buf);
|
||||||
int type, char *line, char *buf);
|
int text_processed(char *field, char *subfield, struct trig_var_data *vd, char *str, size_t slen);
|
||||||
int text_processed(char *field, char *subfield, struct trig_var_data *vd,
|
void find_replacement(void *go, struct script_data *sc, trig_data *trig, int type, char *var, char *field,
|
||||||
char *str, size_t slen);
|
char *subfield, char *str, size_t slen);
|
||||||
void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
|
||||||
int type, char *var, char *field, char *subfield, char *str, size_t slen);
|
|
||||||
|
|
||||||
/* From dg_handler.c */
|
/* From dg_handler.c */
|
||||||
void free_var_el(struct trig_var_data *var);
|
void free_var_el(struct trig_var_data *var);
|
||||||
@@ -354,11 +342,9 @@ void sub_write(char *arg, char_data *ch, byte find_invis, int targets);
|
|||||||
void send_to_zone(char *messg, zone_rnum zone);
|
void send_to_zone(char *messg, zone_rnum zone);
|
||||||
|
|
||||||
/* from dg_misc.c */
|
/* from dg_misc.c */
|
||||||
void do_dg_cast(void *go, struct script_data *sc, trig_data *trig,
|
void do_dg_cast(void *go, struct script_data *sc, trig_data *trig, int type, char *cmd);
|
||||||
int type, char *cmd);
|
void do_dg_affect(void *go, struct script_data *sc, trig_data *trig, int type, char *cmd);
|
||||||
void do_dg_affect(void *go, struct script_data *sc, trig_data *trig,
|
void send_char_pos(char_data *ch, int dam);
|
||||||
int type, char *cmd);
|
|
||||||
void send_char_pos(struct char_data *ch, int dam);
|
|
||||||
int valid_dg_target(char_data *ch, int bitvector);
|
int valid_dg_target(char_data *ch, int bitvector);
|
||||||
void script_damage(char_data *vict, int dam);
|
void script_damage(char_data *vict, int dam);
|
||||||
|
|
||||||
@@ -387,10 +373,10 @@ ACMD(do_mzoneecho);
|
|||||||
ACMD(do_mlog);
|
ACMD(do_mlog);
|
||||||
|
|
||||||
/* from dg_olc.c... thinking these should be moved to oasis.h */
|
/* from dg_olc.c... thinking these should be moved to oasis.h */
|
||||||
void trigedit_save(struct descriptor_data *d);
|
void trigedit_save(descriptor_data *d);
|
||||||
void trigedit_string_cleanup(struct descriptor_data *d, int terminator);
|
void trigedit_string_cleanup(descriptor_data *d, int terminator);
|
||||||
int format_script(struct descriptor_data *d);
|
int format_script(descriptor_data *d);
|
||||||
void trigedit_setup_existing(struct descriptor_data *d, int rtrg_num);
|
void trigedit_setup_existing(descriptor_data *d, int rtrg_num);
|
||||||
|
|
||||||
/* from dg_objcmd.c */
|
/* from dg_objcmd.c */
|
||||||
room_rnum obj_room(obj_data *obj);
|
room_rnum obj_room(obj_data *obj);
|
||||||
@@ -406,13 +392,13 @@ void wld_command_interpreter(room_data *room, char *argument);
|
|||||||
#define UID_CHAR '}'
|
#define UID_CHAR '}'
|
||||||
#define GET_TRIG_NAME(t) ((t)->name)
|
#define GET_TRIG_NAME(t) ((t)->name)
|
||||||
#define GET_TRIG_RNUM(t) ((t)->nr)
|
#define GET_TRIG_RNUM(t) ((t)->nr)
|
||||||
#define GET_TRIG_VNUM(t) (trig_index[(t)->nr]->vnum)
|
#define GET_TRIG_VNUM(t) (trig_index[(t)->nr]->vnum)
|
||||||
#define GET_TRIG_TYPE(t) ((t)->trigger_type)
|
#define GET_TRIG_TYPE(t) ((t)->trigger_type)
|
||||||
#define GET_TRIG_DATA_TYPE(t) ((t)->data_type)
|
#define GET_TRIG_DATA_TYPE(t) ((t)->data_type)
|
||||||
#define GET_TRIG_NARG(t) ((t)->narg)
|
#define GET_TRIG_NARG(t) ((t)->narg)
|
||||||
#define GET_TRIG_ARG(t) ((t)->arglist)
|
#define GET_TRIG_ARG(t) ((t)->arglist)
|
||||||
#define GET_TRIG_VARS(t) ((t)->var_list)
|
#define GET_TRIG_VARS(t) ((t)->var_list)
|
||||||
#define GET_TRIG_WAIT(t) ((t)->wait_event)
|
#define GET_TRIG_WAIT(t) ((t)->wait_event)
|
||||||
#define GET_TRIG_DEPTH(t) ((t)->depth)
|
#define GET_TRIG_DEPTH(t) ((t)->depth)
|
||||||
#define GET_TRIG_LOOPS(t) ((t)->loops)
|
#define GET_TRIG_LOOPS(t) ((t)->loops)
|
||||||
|
|
||||||
@@ -420,22 +406,20 @@ void wld_command_interpreter(room_data *room, char *argument);
|
|||||||
* mob id's: MOB_ID_BASE to ROOM_ID_BASE - 1
|
* mob id's: MOB_ID_BASE to ROOM_ID_BASE - 1
|
||||||
* room id's: ROOM_ID_BASE to OBJ_ID_BASE - 1
|
* room id's: ROOM_ID_BASE to OBJ_ID_BASE - 1
|
||||||
* object id's: OBJ_ID_BASE and higher */
|
* object id's: OBJ_ID_BASE and higher */
|
||||||
#define MOB_ID_BASE 10000000 /* 10000000 player IDNUMS should suffice */
|
#define MOB_ID_BASE 10000000 /* 10000000 player IDNUMS should suffice */
|
||||||
#define ROOM_ID_BASE (10000000 + MOB_ID_BASE) /* 10000000 Mobs */
|
#define ROOM_ID_BASE (10000000 + MOB_ID_BASE) /* 10000000 Mobs */
|
||||||
#define OBJ_ID_BASE (10000000 + ROOM_ID_BASE) /* 10000000 Rooms */
|
#define OBJ_ID_BASE (10000000 + ROOM_ID_BASE) /* 10000000 Rooms */
|
||||||
|
|
||||||
#define SCRIPT(o) ((o)->script)
|
#define SCRIPT(o) ((o)->script)
|
||||||
#define SCRIPT_MEM(c) ((c)->memory)
|
#define SCRIPT_MEM(c) ((c)->memory)
|
||||||
|
|
||||||
#define SCRIPT_TYPES(s) ((s)->types)
|
#define SCRIPT_TYPES(s) ((s)->types)
|
||||||
#define TRIGGERS(s) ((s)->trig_list)
|
#define TRIGGERS(s) ((s)->trig_list)
|
||||||
|
|
||||||
#define GET_SHORT(ch) ((ch)->player.short_descr)
|
#define GET_SHORT(ch) ((ch)->player.short_descr)
|
||||||
|
|
||||||
#define SCRIPT_CHECK(go, type) (SCRIPT(go) && \
|
#define SCRIPT_CHECK(go, type) (SCRIPT(go) && IS_SET(SCRIPT_TYPES(SCRIPT(go)), type))
|
||||||
IS_SET(SCRIPT_TYPES(SCRIPT(go)), type))
|
#define TRIGGER_CHECK(t, type) (IS_SET(GET_TRIG_TYPE(t), type) && !GET_TRIG_DEPTH(t))
|
||||||
#define TRIGGER_CHECK(t, type) (IS_SET(GET_TRIG_TYPE(t), type) && \
|
|
||||||
!GET_TRIG_DEPTH(t))
|
|
||||||
|
|
||||||
|
|
||||||
/* This formerly used 'go' instead of 'id' and referenced 'go->id' but this is
|
/* This formerly used 'go' instead of 'id' and referenced 'go->id' but this is
|
||||||
@@ -443,12 +427,14 @@ void wld_command_interpreter(room_data *room, char *argument);
|
|||||||
* and obj_script_id().
|
* and obj_script_id().
|
||||||
*/
|
*/
|
||||||
#define ADD_UID_VAR(buf, trig, id, name, context) do { \
|
#define ADD_UID_VAR(buf, trig, id, name, context) do { \
|
||||||
sprintf(buf, "%c%ld", UID_CHAR, id); \
|
sprintf(buf, "%c%ld", UID_CHAR, id); \
|
||||||
add_var(&GET_TRIG_VARS(trig), name, buf, context); } while (0)
|
add_var(&GET_TRIG_VARS(trig), name, buf, context); } while (0)
|
||||||
|
|
||||||
// id helpers
|
// id helpers
|
||||||
extern long char_script_id(char_data *ch);
|
extern long char_script_id(char_data *ch);
|
||||||
extern long obj_script_id(obj_data *obj);
|
extern long obj_script_id(obj_data *obj);
|
||||||
|
extern int has_obj_by_uid_in_lookup_table(long uid);
|
||||||
|
|
||||||
#define room_script_id(room) ((long)(room)->number + ROOM_ID_BASE)
|
#define room_script_id(room) ((long)(room)->number + ROOM_ID_BASE)
|
||||||
|
|
||||||
#endif /* _DG_SCRIPTS_H_ */
|
#endif /* _DG_SCRIPTS_H_ */
|
||||||
|
|||||||
+38
-7
@@ -412,7 +412,7 @@ void act_mtrigger(const char_data *ch, char *str, char_data *actor,
|
|||||||
|
|
||||||
void fight_mtrigger(char_data *ch)
|
void fight_mtrigger(char_data *ch)
|
||||||
{
|
{
|
||||||
struct char_data *actor;
|
char_data *actor;
|
||||||
trig_data *t;
|
trig_data *t;
|
||||||
char buf[MAX_INPUT_LENGTH];
|
char buf[MAX_INPUT_LENGTH];
|
||||||
|
|
||||||
@@ -437,7 +437,7 @@ void fight_mtrigger(char_data *ch)
|
|||||||
|
|
||||||
void hitprcnt_mtrigger(char_data *ch)
|
void hitprcnt_mtrigger(char_data *ch)
|
||||||
{
|
{
|
||||||
struct char_data *actor;
|
char_data *actor;
|
||||||
trig_data *t;
|
trig_data *t;
|
||||||
char buf[MAX_INPUT_LENGTH];
|
char buf[MAX_INPUT_LENGTH];
|
||||||
|
|
||||||
@@ -462,6 +462,7 @@ int receive_mtrigger(char_data *ch, char_data *actor, obj_data *obj)
|
|||||||
trig_data *t;
|
trig_data *t;
|
||||||
char buf[MAX_INPUT_LENGTH];
|
char buf[MAX_INPUT_LENGTH];
|
||||||
int ret_val;
|
int ret_val;
|
||||||
|
long object_id = obj_script_id(obj);
|
||||||
|
|
||||||
if (!SCRIPT_CHECK(ch, MTRIG_RECEIVE) || AFF_FLAGGED(ch, AFF_CHARM))
|
if (!SCRIPT_CHECK(ch, MTRIG_RECEIVE) || AFF_FLAGGED(ch, AFF_CHARM))
|
||||||
return 1;
|
return 1;
|
||||||
@@ -471,9 +472,10 @@ int receive_mtrigger(char_data *ch, char_data *actor, obj_data *obj)
|
|||||||
(rand_number(1, 100) <= GET_TRIG_NARG(t))){
|
(rand_number(1, 100) <= GET_TRIG_NARG(t))){
|
||||||
|
|
||||||
ADD_UID_VAR(buf, t, char_script_id(actor), "actor", 0);
|
ADD_UID_VAR(buf, t, char_script_id(actor), "actor", 0);
|
||||||
ADD_UID_VAR(buf, t, obj_script_id(obj), "object", 0);
|
ADD_UID_VAR(buf, t, object_id, "object", 0);
|
||||||
ret_val = script_driver(&ch, t, MOB_TRIGGER, TRIG_NEW);
|
ret_val = script_driver(&ch, t, MOB_TRIGGER, TRIG_NEW);
|
||||||
if (DEAD(actor) || DEAD(ch) || obj->carried_by != actor)
|
// check for purged item before dereferencing.
|
||||||
|
if (DEAD(actor) || DEAD(ch) || !has_obj_by_uid_in_lookup_table(object_id) || obj->carried_by != actor)
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return ret_val;
|
return ret_val;
|
||||||
@@ -552,6 +554,33 @@ int cast_mtrigger(char_data *actor, char_data *ch, int spellnum)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int damage_mtrigger(char_data *actor, char_data *victim, int dam, int attacktype)
|
||||||
|
{
|
||||||
|
trig_data *t;
|
||||||
|
char buf[MAX_INPUT_LENGTH];
|
||||||
|
|
||||||
|
if (victim == NULL)
|
||||||
|
return dam;
|
||||||
|
|
||||||
|
if (!SCRIPT_CHECK(victim, MTRIG_DAMAGE) || AFF_FLAGGED(victim, AFF_CHARM))
|
||||||
|
return dam;
|
||||||
|
|
||||||
|
for (t = TRIGGERS(SCRIPT(victim)); t; t = t->next) {
|
||||||
|
if (TRIGGER_CHECK(t, MTRIG_DAMAGE) &&
|
||||||
|
(rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
||||||
|
ADD_UID_VAR(buf, t, char_script_id(actor), "actor", 0);
|
||||||
|
ADD_UID_VAR(buf, t, char_script_id(victim), "victim", 0);
|
||||||
|
sprintf(buf, "%d", dam);
|
||||||
|
add_var(&GET_TRIG_VARS(t), "damage", buf, 0);
|
||||||
|
add_var(&GET_TRIG_VARS(t), "attacktype", skill_name(attacktype), 0);
|
||||||
|
return script_driver(&victim, t, MOB_TRIGGER, TRIG_NEW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return dam;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int leave_mtrigger(char_data *actor, int dir)
|
int leave_mtrigger(char_data *actor, int dir)
|
||||||
{
|
{
|
||||||
trig_data *t;
|
trig_data *t;
|
||||||
@@ -647,7 +676,7 @@ void random_otrigger(obj_data *obj)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void timer_otrigger(struct obj_data *obj)
|
void timer_otrigger(obj_data *obj)
|
||||||
{
|
{
|
||||||
trig_data *t;
|
trig_data *t;
|
||||||
|
|
||||||
@@ -1118,6 +1147,7 @@ int drop_wtrigger(obj_data *obj, char_data *actor)
|
|||||||
trig_data *t;
|
trig_data *t;
|
||||||
char buf[MAX_INPUT_LENGTH];
|
char buf[MAX_INPUT_LENGTH];
|
||||||
int ret_val;
|
int ret_val;
|
||||||
|
long object_id = obj_script_id(obj);
|
||||||
|
|
||||||
if (!actor || !SCRIPT_CHECK(&world[IN_ROOM(actor)], WTRIG_DROP))
|
if (!actor || !SCRIPT_CHECK(&world[IN_ROOM(actor)], WTRIG_DROP))
|
||||||
return 1;
|
return 1;
|
||||||
@@ -1127,9 +1157,10 @@ int drop_wtrigger(obj_data *obj, char_data *actor)
|
|||||||
if (TRIGGER_CHECK(t, WTRIG_DROP) &&
|
if (TRIGGER_CHECK(t, WTRIG_DROP) &&
|
||||||
(rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
(rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
||||||
ADD_UID_VAR(buf, t, char_script_id(actor), "actor", 0);
|
ADD_UID_VAR(buf, t, char_script_id(actor), "actor", 0);
|
||||||
ADD_UID_VAR(buf, t, obj_script_id(obj), "object", 0);
|
ADD_UID_VAR(buf, t, object_id, "object", 0);
|
||||||
ret_val = script_driver(&room, t, WLD_TRIGGER, TRIG_NEW);
|
ret_val = script_driver(&room, t, WLD_TRIGGER, TRIG_NEW);
|
||||||
if (obj->carried_by != actor)
|
// check for purged object before dereferencing.
|
||||||
|
if (!has_obj_by_uid_in_lookup_table(object_id) || obj->carried_by != actor)
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return ret_val;
|
return ret_val;
|
||||||
|
|||||||
+21
-20
@@ -65,7 +65,7 @@ void add_var(struct trig_var_data **var_list, const char *name, const char *valu
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* perhaps not the best place for this, but I didn't want a new file */
|
/* perhaps not the best place for this, but I didn't want a new file */
|
||||||
char *skill_percent(struct char_data *ch, char *skill)
|
char *skill_percent(char_data *ch, char *skill)
|
||||||
{
|
{
|
||||||
static char retval[16];
|
static char retval[16];
|
||||||
int skillnum;
|
int skillnum;
|
||||||
@@ -98,7 +98,7 @@ int item_in_list(char *item, obj_data *list)
|
|||||||
count += item_in_list(item, i->contains);
|
count += item_in_list(item, i->contains);
|
||||||
}
|
}
|
||||||
} else if (is_number(item)) { /* check for vnum */
|
} else if (is_number(item)) { /* check for vnum */
|
||||||
obj_vnum ovnum = atoi(item);
|
obj_vnum ovnum = atoidx(item);
|
||||||
|
|
||||||
for (i = list; i; i = i->next_content) {
|
for (i = list; i; i = i->next_content) {
|
||||||
if (GET_OBJ_VNUM(i) == ovnum)
|
if (GET_OBJ_VNUM(i) == ovnum)
|
||||||
@@ -120,7 +120,7 @@ int item_in_list(char *item, obj_data *list)
|
|||||||
/* BOOLEAN return, just check if a player or mob has an item of any sort,
|
/* BOOLEAN return, just check if a player or mob has an item of any sort,
|
||||||
* searched for by name or id. Searching equipment as well as inventory, and
|
* searched for by name or id. Searching equipment as well as inventory, and
|
||||||
* containers. Jamie Nelson */
|
* containers. Jamie Nelson */
|
||||||
int char_has_item(char *item, struct char_data *ch)
|
int char_has_item(char *item, char_data *ch)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* If this works, no more searching needed */
|
/* If this works, no more searching needed */
|
||||||
@@ -133,7 +133,7 @@ int char_has_item(char *item, struct char_data *ch)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int handle_oset(struct obj_data * obj, char * argument)
|
static int handle_oset(obj_data * obj, char * argument)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
bool found = FALSE;
|
bool found = FALSE;
|
||||||
@@ -141,7 +141,7 @@ static int handle_oset(struct obj_data * obj, char * argument)
|
|||||||
|
|
||||||
struct oset_handler {
|
struct oset_handler {
|
||||||
const char * type;
|
const char * type;
|
||||||
bool (* name)(struct obj_data *, char *);
|
bool (* name)(obj_data *, char *);
|
||||||
} handler[] = {
|
} handler[] = {
|
||||||
{ "alias", oset_alias },
|
{ "alias", oset_alias },
|
||||||
{ "apply", oset_apply },
|
{ "apply", oset_apply },
|
||||||
@@ -256,6 +256,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
struct room_data *room, *r = NULL;
|
struct room_data *room, *r = NULL;
|
||||||
char *name;
|
char *name;
|
||||||
int num, count, i, j, doors;
|
int num, count, i, j, doors;
|
||||||
|
IDXTYPE idx;
|
||||||
|
|
||||||
char *log_cmd[] = {"mlog ", "olog ", "wlog " };
|
char *log_cmd[] = {"mlog ", "olog ", "wlog " };
|
||||||
char *send_cmd[] = {"msend ", "osend ", "wsend " };
|
char *send_cmd[] = {"msend ", "osend ", "wsend " };
|
||||||
@@ -429,7 +430,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (!str_cmp(var, "people")) {
|
else if (!str_cmp(var, "people")) {
|
||||||
snprintf(str, slen, "%d",((num = atoi(field)) > 0) ? trgvar_in_room(num) : 0);
|
snprintf(str, slen, "%d",((num = atoidx(field)) > 0) ? trgvar_in_room(num) : 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (!str_cmp(var, "happyhour")) {
|
else if (!str_cmp(var, "happyhour")) {
|
||||||
@@ -469,8 +470,8 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
script_log("findmob.vnum(mvnum) - illegal syntax");
|
script_log("findmob.vnum(mvnum) - illegal syntax");
|
||||||
strcpy(str, "0");
|
strcpy(str, "0");
|
||||||
} else {
|
} else {
|
||||||
room_rnum rrnum = real_room(atoi(field));
|
room_rnum rrnum = real_room(atoidx(field));
|
||||||
mob_vnum mvnum = atoi(subfield);
|
mob_vnum mvnum = atoidx(subfield);
|
||||||
|
|
||||||
if (rrnum == NOWHERE) {
|
if (rrnum == NOWHERE) {
|
||||||
script_log("findmob.vnum(ovnum): No room with vnum %d", atoi(field));
|
script_log("findmob.vnum(ovnum): No room with vnum %d", atoi(field));
|
||||||
@@ -490,7 +491,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
script_log("findobj.vnum(ovnum) - illegal syntax");
|
script_log("findobj.vnum(ovnum) - illegal syntax");
|
||||||
strcpy(str, "0");
|
strcpy(str, "0");
|
||||||
} else {
|
} else {
|
||||||
room_rnum rrnum = real_room(atoi(field));
|
room_rnum rrnum = real_room(atoidx(field));
|
||||||
|
|
||||||
if (rrnum == NOWHERE) {
|
if (rrnum == NOWHERE) {
|
||||||
script_log("findobj.vnum(ovnum): No room with vnum %d", atoi(field));
|
script_log("findobj.vnum(ovnum): No room with vnum %d", atoi(field));
|
||||||
@@ -552,10 +553,10 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
in_room = real_room(((struct room_data *) go)->number);
|
in_room = real_room(((struct room_data *) go)->number);
|
||||||
break;
|
break;
|
||||||
case OBJ_TRIGGER:
|
case OBJ_TRIGGER:
|
||||||
in_room = obj_room((struct obj_data *) go);
|
in_room = obj_room((obj_data *) go);
|
||||||
break;
|
break;
|
||||||
case MOB_TRIGGER:
|
case MOB_TRIGGER:
|
||||||
in_room = IN_ROOM((struct char_data *)go);
|
in_room = IN_ROOM((char_data *)go);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (in_room == NOWHERE) {
|
if (in_room == NOWHERE) {
|
||||||
@@ -978,7 +979,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
else if (!str_cmp(field, "questdone"))
|
else if (!str_cmp(field, "questdone"))
|
||||||
{
|
{
|
||||||
if (!IS_NPC(c) && subfield && *subfield) {
|
if (!IS_NPC(c) && subfield && *subfield) {
|
||||||
int q_num = atoi(subfield);
|
qst_vnum q_num = atoidx(subfield);
|
||||||
if (is_complete(c, q_num))
|
if (is_complete(c, q_num))
|
||||||
strcpy(str, "1");
|
strcpy(str, "1");
|
||||||
else
|
else
|
||||||
@@ -1111,7 +1112,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
* something like if %actor.vnum(500)%. It should return false for PC's instead
|
* something like if %actor.vnum(500)%. It should return false for PC's instead
|
||||||
* -- Fizban 02/18
|
* -- Fizban 02/18
|
||||||
*/
|
*/
|
||||||
snprintf(str, slen, "%d", IS_NPC(c) ? (int)(GET_MOB_VNUM(c) == atoi(subfield)) : 0 );
|
snprintf(str, slen, "%d", IS_NPC(c) ? GET_MOB_VNUM(c) == atoidx(subfield) : 0 );
|
||||||
} else {
|
} else {
|
||||||
if (IS_NPC(c))
|
if (IS_NPC(c))
|
||||||
snprintf(str, slen, "%d", GET_MOB_VNUM(c));
|
snprintf(str, slen, "%d", GET_MOB_VNUM(c));
|
||||||
@@ -1249,8 +1250,8 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
if (!(subfield && *subfield))
|
if (!(subfield && *subfield))
|
||||||
*str = '\0';
|
*str = '\0';
|
||||||
else {
|
else {
|
||||||
i = atoi(subfield);
|
idx = atoidx(subfield);
|
||||||
snprintf(str, slen, "%d", trig_is_attached(SCRIPT(o), i));
|
snprintf(str, slen, "%d", trig_is_attached(SCRIPT(o), idx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1311,7 +1312,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
case 'v':
|
case 'v':
|
||||||
if (!str_cmp(field, "vnum"))
|
if (!str_cmp(field, "vnum"))
|
||||||
if (subfield && *subfield) {
|
if (subfield && *subfield) {
|
||||||
snprintf(str, slen, "%d", (int)(GET_OBJ_VNUM(o) == atoi(subfield)));
|
snprintf(str, slen, "%d", GET_OBJ_VNUM(o) == atoidx(subfield));
|
||||||
} else {
|
} else {
|
||||||
snprintf(str, slen, "%d", GET_OBJ_VNUM(o));
|
snprintf(str, slen, "%d", GET_OBJ_VNUM(o));
|
||||||
}
|
}
|
||||||
@@ -1403,14 +1404,14 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
|
|
||||||
else if (!str_cmp(field, "vnum")) {
|
else if (!str_cmp(field, "vnum")) {
|
||||||
if (subfield && *subfield) {
|
if (subfield && *subfield) {
|
||||||
snprintf(str, slen, "%d", (int)(r->number == atoi(subfield)));
|
snprintf(str, slen, "%d", r->number == atoidx(subfield));
|
||||||
} else {
|
} else {
|
||||||
snprintf(str, slen,"%d",r->number);
|
snprintf(str, slen,"%d",r->number);
|
||||||
}
|
}
|
||||||
} else if (!str_cmp(field, "contents")) {
|
} else if (!str_cmp(field, "contents")) {
|
||||||
if (subfield && *subfield) {
|
if (subfield && *subfield) {
|
||||||
for (obj = r->contents; obj; obj = obj->next_content) {
|
for (obj = r->contents; obj; obj = obj->next_content) {
|
||||||
if (GET_OBJ_VNUM(obj) == atoi(subfield)) {
|
if (GET_OBJ_VNUM(obj) == atoidx(subfield)) {
|
||||||
/* arg given, found */
|
/* arg given, found */
|
||||||
snprintf(str, slen, "%c%ld", UID_CHAR, obj_script_id(obj));
|
snprintf(str, slen, "%c%ld", UID_CHAR, obj_script_id(obj));
|
||||||
return;
|
return;
|
||||||
@@ -1457,8 +1458,8 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
if (!(subfield && *subfield))
|
if (!(subfield && *subfield))
|
||||||
*str = '\0';
|
*str = '\0';
|
||||||
else {
|
else {
|
||||||
i = atoi(subfield);
|
idx = atoidx(subfield);
|
||||||
snprintf(str, slen, "%d", trig_is_attached(SCRIPT(r), i));
|
snprintf(str, slen, "%d", trig_is_attached(SCRIPT(r), idx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!str_cmp(field, "zonenumber"))
|
else if (!str_cmp(field, "zonenumber"))
|
||||||
|
|||||||
+15
-13
@@ -169,7 +169,7 @@ WCMD(do_wzoneecho)
|
|||||||
if (!*room_num || !*msg)
|
if (!*room_num || !*msg)
|
||||||
wld_log(room, "wzoneecho called with too few args");
|
wld_log(room, "wzoneecho called with too few args");
|
||||||
|
|
||||||
else if ((zone = real_zone_by_thing(atoi(room_num))) == NOWHERE)
|
else if ((zone = real_zone_by_thing(atoidx(room_num))) == NOWHERE)
|
||||||
wld_log(room, "wzoneecho called for nonexistant zone");
|
wld_log(room, "wzoneecho called for nonexistant zone");
|
||||||
|
|
||||||
else {
|
else {
|
||||||
@@ -191,7 +191,7 @@ WCMD(do_wrecho)
|
|||||||
if (!*msg || !*start || !*finish || !is_number(start) || !is_number(finish))
|
if (!*msg || !*start || !*finish || !is_number(start) || !is_number(finish))
|
||||||
wld_log(room, "wrecho: too few args");
|
wld_log(room, "wrecho: too few args");
|
||||||
else
|
else
|
||||||
send_to_range(atoi(start), atoi(finish), "%s\r\n", msg);
|
send_to_range(atoidx(start), atoidx(finish), "%s\r\n", msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ WCMD(do_wdoor)
|
|||||||
newexit->exit_info = (sh_int)asciiflag_conv(value);
|
newexit->exit_info = (sh_int)asciiflag_conv(value);
|
||||||
break;
|
break;
|
||||||
case 3: /* key */
|
case 3: /* key */
|
||||||
newexit->key = atoi(value);
|
newexit->key = atoidx(value);
|
||||||
break;
|
break;
|
||||||
case 4: /* name */
|
case 4: /* name */
|
||||||
if (newexit->keyword)
|
if (newexit->keyword)
|
||||||
@@ -279,7 +279,7 @@ WCMD(do_wdoor)
|
|||||||
strcpy(newexit->keyword, value);
|
strcpy(newexit->keyword, value);
|
||||||
break;
|
break;
|
||||||
case 5: /* room */
|
case 5: /* room */
|
||||||
if ((to_room = real_room(atoi(value))) != NOWHERE)
|
if ((to_room = real_room(atoidx(value))) != NOWHERE)
|
||||||
newexit->to_room = to_room;
|
newexit->to_room = to_room;
|
||||||
else
|
else
|
||||||
wld_log(room, "wdoor: invalid door target");
|
wld_log(room, "wdoor: invalid door target");
|
||||||
@@ -291,7 +291,8 @@ WCMD(do_wdoor)
|
|||||||
WCMD(do_wteleport)
|
WCMD(do_wteleport)
|
||||||
{
|
{
|
||||||
char_data *ch, *next_ch;
|
char_data *ch, *next_ch;
|
||||||
room_rnum target, nr;
|
room_rnum target;
|
||||||
|
room_vnum nr;
|
||||||
char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
|
char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
|
||||||
|
|
||||||
two_arguments(argument, arg1, arg2);
|
two_arguments(argument, arg1, arg2);
|
||||||
@@ -301,7 +302,7 @@ WCMD(do_wteleport)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nr = atoi(arg2);
|
nr = atoidx(arg2);
|
||||||
target = real_room(nr);
|
target = real_room(nr);
|
||||||
|
|
||||||
if (target == NOWHERE)
|
if (target == NOWHERE)
|
||||||
@@ -435,7 +436,7 @@ WCMD(do_wpurge)
|
|||||||
WCMD(do_wload)
|
WCMD(do_wload)
|
||||||
{
|
{
|
||||||
char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
|
char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
|
||||||
int number = 0;
|
IDXTYPE number = NOTHING;
|
||||||
char_data *mob;
|
char_data *mob;
|
||||||
obj_data *object;
|
obj_data *object;
|
||||||
char *target;
|
char *target;
|
||||||
@@ -445,7 +446,7 @@ WCMD(do_wload)
|
|||||||
|
|
||||||
target = two_arguments(argument, arg1, arg2);
|
target = two_arguments(argument, arg1, arg2);
|
||||||
|
|
||||||
if (!*arg1 || !*arg2 || !is_number(arg2) || ((number = atoi(arg2)) < 0)) {
|
if (!*arg1 || !*arg2 || !is_number(arg2) || (number = atoidx(arg2)) == NOTHING) {
|
||||||
wld_log(room, "wload: bad syntax");
|
wld_log(room, "wload: bad syntax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -456,7 +457,7 @@ WCMD(do_wload)
|
|||||||
if (!target || !*target) {
|
if (!target || !*target) {
|
||||||
rnum = real_room(room->number);
|
rnum = real_room(room->number);
|
||||||
} else {
|
} else {
|
||||||
if (!isdigit(*target) || (rnum = real_room(atoi(target))) == NOWHERE) {
|
if (!isdigit(*target) || (rnum = real_room(atoidx(target))) == NOWHERE) {
|
||||||
wld_log(room, "wload: room target vnum doesn't exist (loading mob vnum %d to room %s)", number, target);
|
wld_log(room, "wload: room target vnum doesn't exist (loading mob vnum %d to room %s)", number, target);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -547,7 +548,7 @@ WCMD(do_wdamage) {
|
|||||||
WCMD(do_wat)
|
WCMD(do_wat)
|
||||||
{
|
{
|
||||||
room_rnum loc = NOWHERE;
|
room_rnum loc = NOWHERE;
|
||||||
struct char_data *ch;
|
char_data *ch;
|
||||||
char arg[MAX_INPUT_LENGTH], *command;
|
char arg[MAX_INPUT_LENGTH], *command;
|
||||||
|
|
||||||
command = any_one_arg(argument, arg);
|
command = any_one_arg(argument, arg);
|
||||||
@@ -564,7 +565,7 @@ WCMD(do_wat)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isdigit(*arg)) loc = real_room(atoi(arg));
|
if (isdigit(*arg)) loc = real_room(atoidx(arg));
|
||||||
else if ((ch = get_char_by_room(room, arg))) loc = IN_ROOM(ch);
|
else if ((ch = get_char_by_room(room, arg))) loc = IN_ROOM(ch);
|
||||||
|
|
||||||
if (loc == NOWHERE) {
|
if (loc == NOWHERE) {
|
||||||
@@ -577,7 +578,8 @@ WCMD(do_wat)
|
|||||||
WCMD(do_wmove)
|
WCMD(do_wmove)
|
||||||
{
|
{
|
||||||
obj_data *obj, *next_obj;
|
obj_data *obj, *next_obj;
|
||||||
room_rnum target, nr;
|
room_rnum target;
|
||||||
|
room_vnum nr;
|
||||||
char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
|
char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
|
||||||
|
|
||||||
two_arguments(argument, arg1, arg2);
|
two_arguments(argument, arg1, arg2);
|
||||||
@@ -587,7 +589,7 @@ WCMD(do_wmove)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nr = atoi(arg2);
|
nr = atoidx(arg2);
|
||||||
target = real_room(nr);
|
target = real_room(nr);
|
||||||
|
|
||||||
if (target == NOWHERE) {
|
if (target == NOWHERE) {
|
||||||
|
|||||||
@@ -1054,7 +1054,7 @@ INCLUDE_FILE_PATTERNS =
|
|||||||
# undefined via #undef or recursively expanded use the := operator
|
# undefined via #undef or recursively expanded use the := operator
|
||||||
# instead of the = operator.
|
# instead of the = operator.
|
||||||
|
|
||||||
PREDEFINED = "ACMD(name)=void name (struct char_data *ch, char *argument, int cmd, int subcmd)" "WCMD(name)=void name (room_data *room, char *argument, int cmd, int subcmd)" "OCMD(name)=void name(obj_data *obj, char *argument, int cmd, int subcmd)" "SPECIAL(name)=int name(struct char_data *ch, void *me, int cmd, char *argument)"
|
PREDEFINED = "ACMD(name)=void name (char_data *ch, char *argument, int cmd, int subcmd)" "WCMD(name)=void name (room_data *room, char *argument, int cmd, int subcmd)" "OCMD(name)=void name(obj_data *obj, char *argument, int cmd, int subcmd)" "SPECIAL(name)=int name(char_data *ch, void *me, int cmd, char *argument)"
|
||||||
|
|
||||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
|
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
|
||||||
# this tag can be used to specify a list of macro names that should be expanded.
|
# this tag can be used to specify a list of macro names that should be expanded.
|
||||||
|
|||||||
@@ -1054,7 +1054,7 @@ INCLUDE_FILE_PATTERNS =
|
|||||||
# undefined via #undef or recursively expanded use the := operator
|
# undefined via #undef or recursively expanded use the := operator
|
||||||
# instead of the = operator.
|
# instead of the = operator.
|
||||||
|
|
||||||
PREDEFINED = "ACMD(name)=void name (struct char_data *ch, char *argument, int cmd, int subcmd)" "WCMD(name)=void name (room_data *room, char *argument, int cmd, int subcmd)" "OCMD(name)=void name(obj_data *obj, char *argument, int cmd, int subcmd)" "SPECIAL(name)=int name(struct char_data *ch, void *me, int cmd, char *argument)"
|
PREDEFINED = "ACMD(name)=void name (char_data *ch, char *argument, int cmd, int subcmd)" "WCMD(name)=void name (room_data *room, char *argument, int cmd, int subcmd)" "OCMD(name)=void name(obj_data *obj, char *argument, int cmd, int subcmd)" "SPECIAL(name)=int name(char_data *ch, void *me, int cmd, char *argument)"
|
||||||
|
|
||||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
|
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
|
||||||
# this tag can be used to specify a list of macro names that should be expanded.
|
# this tag can be used to specify a list of macro names that should be expanded.
|
||||||
|
|||||||
+48
-43
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
/* locally defined global variables, used externally */
|
/* locally defined global variables, used externally */
|
||||||
/* head of l-list of fighting chars */
|
/* head of l-list of fighting chars */
|
||||||
struct char_data *combat_list = NULL;
|
char_data *combat_list = NULL;
|
||||||
/* Weapon attack texts */
|
/* Weapon attack texts */
|
||||||
struct attack_hit_type attack_hit_text[] =
|
struct attack_hit_type attack_hit_text[] =
|
||||||
{
|
{
|
||||||
@@ -51,23 +51,23 @@ struct attack_hit_type attack_hit_text[] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* local (file scope only) variables */
|
/* local (file scope only) variables */
|
||||||
static struct char_data *next_combat_list = NULL;
|
static char_data *next_combat_list = NULL;
|
||||||
|
|
||||||
/* local file scope utility functions */
|
/* local file scope utility functions */
|
||||||
static void perform_group_gain(struct char_data *ch, int base, struct char_data *victim);
|
static void perform_group_gain(char_data *ch, int base, char_data *victim);
|
||||||
static void dam_message(int dam, struct char_data *ch, struct char_data *victim, int w_type);
|
static void dam_message(int dam, char_data *ch, char_data *victim, int w_type);
|
||||||
static void make_corpse(struct char_data *ch);
|
static void make_corpse(char_data *ch);
|
||||||
static void change_alignment(struct char_data *ch, struct char_data *victim);
|
static void change_alignment(char_data *ch, char_data *victim);
|
||||||
static void group_gain(struct char_data *ch, struct char_data *victim);
|
static void group_gain(char_data *ch, char_data *victim);
|
||||||
static void solo_gain(struct char_data *ch, struct char_data *victim);
|
static void solo_gain(char_data *ch, char_data *victim);
|
||||||
/** @todo refactor this function name */
|
/** @todo refactor this function name */
|
||||||
static char *replace_string(const char *str, const char *weapon_singular, const char *weapon_plural);
|
static char *replace_string(const char *str, const char *weapon_singular, const char *weapon_plural);
|
||||||
static int compute_thaco(struct char_data *ch, struct char_data *vict);
|
static int compute_thaco(char_data *ch, char_data *vict);
|
||||||
|
|
||||||
|
|
||||||
#define IS_WEAPON(type) (((type) >= TYPE_HIT) && ((type) < TYPE_SUFFERING))
|
#define IS_WEAPON(type) (((type) >= TYPE_HIT) && ((type) < TYPE_SUFFERING))
|
||||||
/* The Fight related routines */
|
/* The Fight related routines */
|
||||||
void appear(struct char_data *ch)
|
void appear(char_data *ch)
|
||||||
{
|
{
|
||||||
if (affected_by_spell(ch, SPELL_INVISIBLE))
|
if (affected_by_spell(ch, SPELL_INVISIBLE))
|
||||||
affect_from_char(ch, SPELL_INVISIBLE);
|
affect_from_char(ch, SPELL_INVISIBLE);
|
||||||
@@ -82,7 +82,7 @@ void appear(struct char_data *ch)
|
|||||||
FALSE, ch, 0, 0, TO_ROOM);
|
FALSE, ch, 0, 0, TO_ROOM);
|
||||||
}
|
}
|
||||||
|
|
||||||
int compute_armor_class(struct char_data *ch)
|
int compute_armor_class(char_data *ch)
|
||||||
{
|
{
|
||||||
int armorclass = GET_AC(ch);
|
int armorclass = GET_AC(ch);
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ int compute_armor_class(struct char_data *ch)
|
|||||||
return (MAX(-100, armorclass)); /* -100 is lowest */
|
return (MAX(-100, armorclass)); /* -100 is lowest */
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_pos(struct char_data *victim)
|
void update_pos(char_data *victim)
|
||||||
{
|
{
|
||||||
if ((GET_HIT(victim) > 0) && (GET_POS(victim) > POS_STUNNED))
|
if ((GET_HIT(victim) > 0) && (GET_POS(victim) > POS_STUNNED))
|
||||||
return;
|
return;
|
||||||
@@ -108,7 +108,7 @@ void update_pos(struct char_data *victim)
|
|||||||
GET_POS(victim) = POS_STUNNED;
|
GET_POS(victim) = POS_STUNNED;
|
||||||
}
|
}
|
||||||
|
|
||||||
void check_killer(struct char_data *ch, struct char_data *vict)
|
void check_killer(char_data *ch, char_data *vict)
|
||||||
{
|
{
|
||||||
if (PLR_FLAGGED(vict, PLR_KILLER) || PLR_FLAGGED(vict, PLR_THIEF))
|
if (PLR_FLAGGED(vict, PLR_KILLER) || PLR_FLAGGED(vict, PLR_THIEF))
|
||||||
return;
|
return;
|
||||||
@@ -123,7 +123,7 @@ void check_killer(struct char_data *ch, struct char_data *vict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* start one char fighting another (yes, it is horrible, I know... ) */
|
/* start one char fighting another (yes, it is horrible, I know... ) */
|
||||||
void set_fighting(struct char_data *ch, struct char_data *vict)
|
void set_fighting(char_data *ch, char_data *vict)
|
||||||
{
|
{
|
||||||
if (ch == vict)
|
if (ch == vict)
|
||||||
return;
|
return;
|
||||||
@@ -147,9 +147,9 @@ void set_fighting(struct char_data *ch, struct char_data *vict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* remove a char from the list of fighting chars */
|
/* remove a char from the list of fighting chars */
|
||||||
void stop_fighting(struct char_data *ch)
|
void stop_fighting(char_data *ch)
|
||||||
{
|
{
|
||||||
struct char_data *temp;
|
char_data *temp;
|
||||||
|
|
||||||
if (ch == next_combat_list)
|
if (ch == next_combat_list)
|
||||||
next_combat_list = ch->next_fighting;
|
next_combat_list = ch->next_fighting;
|
||||||
@@ -161,11 +161,11 @@ void stop_fighting(struct char_data *ch)
|
|||||||
update_pos(ch);
|
update_pos(ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void make_corpse(struct char_data *ch)
|
static void make_corpse(char_data *ch)
|
||||||
{
|
{
|
||||||
char buf2[MAX_NAME_LENGTH + 64];
|
char buf2[MAX_NAME_LENGTH + 64];
|
||||||
struct obj_data *corpse, *o;
|
obj_data *corpse, *o;
|
||||||
struct obj_data *money;
|
obj_data *money;
|
||||||
int i, x, y;
|
int i, x, y;
|
||||||
|
|
||||||
corpse = create_obj();
|
corpse = create_obj();
|
||||||
@@ -232,14 +232,14 @@ static void make_corpse(struct char_data *ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* When ch kills victim */
|
/* When ch kills victim */
|
||||||
static void change_alignment(struct char_data *ch, struct char_data *victim)
|
static void change_alignment(char_data *ch, char_data *victim)
|
||||||
{
|
{
|
||||||
/* new alignment change algorithm: if you kill a monster with alignment A,
|
/* new alignment change algorithm: if you kill a monster with alignment A,
|
||||||
* you move 1/16th of the way to having alignment -A. Simple and fast. */
|
* you move 1/16th of the way to having alignment -A. Simple and fast. */
|
||||||
GET_ALIGNMENT(ch) += (-GET_ALIGNMENT(victim) - GET_ALIGNMENT(ch)) / 16;
|
GET_ALIGNMENT(ch) += (-GET_ALIGNMENT(victim) - GET_ALIGNMENT(ch)) / 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
void death_cry(struct char_data *ch)
|
void death_cry(char_data *ch)
|
||||||
{
|
{
|
||||||
int door;
|
int door;
|
||||||
|
|
||||||
@@ -250,9 +250,9 @@ void death_cry(struct char_data *ch)
|
|||||||
send_to_room(world[IN_ROOM(ch)].dir_option[door]->to_room, "Your blood freezes as you hear someone's death cry.\r\n");
|
send_to_room(world[IN_ROOM(ch)].dir_option[door]->to_room, "Your blood freezes as you hear someone's death cry.\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void raw_kill(struct char_data * ch, struct char_data * killer)
|
void raw_kill(char_data * ch, char_data * killer)
|
||||||
{
|
{
|
||||||
struct char_data *i;
|
char_data *i;
|
||||||
|
|
||||||
if (FIGHTING(ch))
|
if (FIGHTING(ch))
|
||||||
stop_fighting(ch);
|
stop_fighting(ch);
|
||||||
@@ -271,7 +271,7 @@ struct char_data *i;
|
|||||||
|
|
||||||
if (killer) {
|
if (killer) {
|
||||||
if (killer->group) {
|
if (killer->group) {
|
||||||
while ((i = (struct char_data *) simple_list(killer->group->members)) != NULL)
|
while ((i = (char_data *) simple_list(killer->group->members)) != NULL)
|
||||||
if(IN_ROOM(i) == IN_ROOM(ch) || (world[IN_ROOM(i)].zone == world[IN_ROOM(ch)].zone))
|
if(IN_ROOM(i) == IN_ROOM(ch) || (world[IN_ROOM(i)].zone == world[IN_ROOM(ch)].zone))
|
||||||
autoquest_trigger_check(i, ch, NULL, AQ_MOB_KILL);
|
autoquest_trigger_check(i, ch, NULL, AQ_MOB_KILL);
|
||||||
} else
|
} else
|
||||||
@@ -293,7 +293,7 @@ struct char_data *i;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void die(struct char_data * ch, struct char_data * killer)
|
void die(char_data * ch, char_data * killer)
|
||||||
{
|
{
|
||||||
gain_exp(ch, -(GET_EXP(ch) / 2));
|
gain_exp(ch, -(GET_EXP(ch) / 2));
|
||||||
if (!IS_NPC(ch)) {
|
if (!IS_NPC(ch)) {
|
||||||
@@ -303,8 +303,8 @@ void die(struct char_data * ch, struct char_data * killer)
|
|||||||
raw_kill(ch, killer);
|
raw_kill(ch, killer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void perform_group_gain(struct char_data *ch, int base,
|
static void perform_group_gain(char_data *ch, int base,
|
||||||
struct char_data *victim)
|
char_data *victim)
|
||||||
{
|
{
|
||||||
int share, hap_share;
|
int share, hap_share;
|
||||||
|
|
||||||
@@ -325,12 +325,12 @@ static void perform_group_gain(struct char_data *ch, int base,
|
|||||||
change_alignment(ch, victim);
|
change_alignment(ch, victim);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void group_gain(struct char_data *ch, struct char_data *victim)
|
static void group_gain(char_data *ch, char_data *victim)
|
||||||
{
|
{
|
||||||
int tot_members = 0, base, tot_gain;
|
int tot_members = 0, base, tot_gain;
|
||||||
struct char_data *k;
|
char_data *k;
|
||||||
|
|
||||||
while ((k = (struct char_data *) simple_list(GROUP(ch)->members)) != NULL)
|
while ((k = (char_data *) simple_list(GROUP(ch)->members)) != NULL)
|
||||||
if (IN_ROOM(ch) == IN_ROOM(k))
|
if (IN_ROOM(ch) == IN_ROOM(k))
|
||||||
tot_members++;
|
tot_members++;
|
||||||
|
|
||||||
@@ -346,12 +346,12 @@ static void group_gain(struct char_data *ch, struct char_data *victim)
|
|||||||
else
|
else
|
||||||
base = 0;
|
base = 0;
|
||||||
|
|
||||||
while ((k = (struct char_data *) simple_list(GROUP(ch)->members)) != NULL)
|
while ((k = (char_data *) simple_list(GROUP(ch)->members)) != NULL)
|
||||||
if (IN_ROOM(k) == IN_ROOM(ch))
|
if (IN_ROOM(k) == IN_ROOM(ch))
|
||||||
perform_group_gain(k, base, victim);
|
perform_group_gain(k, base, victim);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void solo_gain(struct char_data *ch, struct char_data *victim)
|
static void solo_gain(char_data *ch, char_data *victim)
|
||||||
{
|
{
|
||||||
int exp, happy_exp;
|
int exp, happy_exp;
|
||||||
|
|
||||||
@@ -407,7 +407,7 @@ static char *replace_string(const char *str, const char *weapon_singular, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* message for doing damage with a weapon */
|
/* message for doing damage with a weapon */
|
||||||
static void dam_message(int dam, struct char_data *ch, struct char_data *victim,
|
static void dam_message(int dam, char_data *ch, char_data *victim,
|
||||||
int w_type)
|
int w_type)
|
||||||
{
|
{
|
||||||
char *buf;
|
char *buf;
|
||||||
@@ -512,13 +512,13 @@ static void dam_message(int dam, struct char_data *ch, struct char_data *victim,
|
|||||||
|
|
||||||
/* message for doing damage with a spell or skill. Also used for weapon
|
/* message for doing damage with a spell or skill. Also used for weapon
|
||||||
* damage on miss and death blows. */
|
* damage on miss and death blows. */
|
||||||
int skill_message(int dam, struct char_data *ch, struct char_data *vict,
|
int skill_message(int dam, char_data *ch, char_data *vict,
|
||||||
int attacktype)
|
int attacktype)
|
||||||
{
|
{
|
||||||
int i, j, nr;
|
int i, j, nr;
|
||||||
struct message_type *msg;
|
struct message_type *msg;
|
||||||
|
|
||||||
struct obj_data *weap = GET_EQ(ch, WEAR_WIELD);
|
obj_data *weap = GET_EQ(ch, WEAR_WIELD);
|
||||||
|
|
||||||
/* @todo restructure the messages library to a pointer based system as
|
/* @todo restructure the messages library to a pointer based system as
|
||||||
* opposed to the current cyclic location system. */
|
* opposed to the current cyclic location system. */
|
||||||
@@ -585,12 +585,12 @@ int skill_message(int dam, struct char_data *ch, struct char_data *vict,
|
|||||||
* < 0 Victim died.
|
* < 0 Victim died.
|
||||||
* = 0 No damage.
|
* = 0 No damage.
|
||||||
* > 0 How much damage done. */
|
* > 0 How much damage done. */
|
||||||
int damage(struct char_data *ch, struct char_data *victim, int dam, int attacktype)
|
int damage(char_data *ch, char_data *victim, int dam, int attacktype)
|
||||||
{
|
{
|
||||||
long local_gold = 0, happy_gold = 0;
|
long local_gold = 0, happy_gold = 0;
|
||||||
char local_buf[256];
|
char local_buf[256];
|
||||||
struct char_data *tmp_char;
|
char_data *tmp_char;
|
||||||
struct obj_data *corpse_obj;
|
obj_data *corpse_obj;
|
||||||
|
|
||||||
if (GET_POS(victim) <= POS_DEAD) {
|
if (GET_POS(victim) <= POS_DEAD) {
|
||||||
/* This is "normal"-ish now with delayed extraction. -gg 3/15/2001 */
|
/* This is "normal"-ish now with delayed extraction. -gg 3/15/2001 */
|
||||||
@@ -620,6 +620,11 @@ int damage(struct char_data *ch, struct char_data *victim, int dam, int attackty
|
|||||||
if (!IS_NPC(victim) && ((GET_LEVEL(victim) >= LVL_IMMORT) && PRF_FLAGGED(victim, PRF_NOHASSLE)))
|
if (!IS_NPC(victim) && ((GET_LEVEL(victim) >= LVL_IMMORT) && PRF_FLAGGED(victim, PRF_NOHASSLE)))
|
||||||
dam = 0;
|
dam = 0;
|
||||||
|
|
||||||
|
dam = damage_mtrigger(ch, victim, dam, attacktype);
|
||||||
|
if (dam == -1) {
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
if (victim != ch) {
|
if (victim != ch) {
|
||||||
/* Start the attacker fighting the victim */
|
/* Start the attacker fighting the victim */
|
||||||
if (GET_POS(ch) > POS_STUNNED && (FIGHTING(ch) == NULL))
|
if (GET_POS(ch) > POS_STUNNED && (FIGHTING(ch) == NULL))
|
||||||
@@ -786,7 +791,7 @@ int damage(struct char_data *ch, struct char_data *victim, int dam, int attackty
|
|||||||
/* Calculate the THAC0 of the attacker. 'victim' currently isn't used but you
|
/* Calculate the THAC0 of the attacker. 'victim' currently isn't used but you
|
||||||
* could use it for special cases like weapons that hit evil creatures easier
|
* could use it for special cases like weapons that hit evil creatures easier
|
||||||
* or a weapon that always misses attacking an animal. */
|
* or a weapon that always misses attacking an animal. */
|
||||||
static int compute_thaco(struct char_data *ch, struct char_data *victim)
|
static int compute_thaco(char_data *ch, char_data *victim)
|
||||||
{
|
{
|
||||||
int calc_thaco;
|
int calc_thaco;
|
||||||
|
|
||||||
@@ -802,9 +807,9 @@ static int compute_thaco(struct char_data *ch, struct char_data *victim)
|
|||||||
return calc_thaco;
|
return calc_thaco;
|
||||||
}
|
}
|
||||||
|
|
||||||
void hit(struct char_data *ch, struct char_data *victim, int type)
|
void hit(char_data *ch, char_data *victim, int type)
|
||||||
{
|
{
|
||||||
struct obj_data *wielded = GET_EQ(ch, WEAR_WIELD);
|
obj_data *wielded = GET_EQ(ch, WEAR_WIELD);
|
||||||
int w_type, victim_ac, calc_thaco, dam, diceroll;
|
int w_type, victim_ac, calc_thaco, dam, diceroll;
|
||||||
|
|
||||||
/* Check that the attacker and victim exist */
|
/* Check that the attacker and victim exist */
|
||||||
@@ -905,7 +910,7 @@ void hit(struct char_data *ch, struct char_data *victim, int type)
|
|||||||
/* control the fights going on. Called every 2 seconds from comm.c. */
|
/* control the fights going on. Called every 2 seconds from comm.c. */
|
||||||
void perform_violence(void)
|
void perform_violence(void)
|
||||||
{
|
{
|
||||||
struct char_data *ch, *tch;
|
char_data *ch, *tch;
|
||||||
|
|
||||||
for (ch = combat_list; ch; ch = next_combat_list) {
|
for (ch = combat_list; ch; ch = next_combat_list) {
|
||||||
next_combat_list = ch->next_fighting;
|
next_combat_list = ch->next_fighting;
|
||||||
@@ -935,7 +940,7 @@ void perform_violence(void)
|
|||||||
if (GROUP(ch) && GROUP(ch)->members && GROUP(ch)->members->iSize) {
|
if (GROUP(ch) && GROUP(ch)->members && GROUP(ch)->members->iSize) {
|
||||||
struct iterator_data Iterator;
|
struct iterator_data Iterator;
|
||||||
|
|
||||||
tch = (struct char_data *) merge_iterator(&Iterator, GROUP(ch)->members);
|
tch = (char_data *) merge_iterator(&Iterator, GROUP(ch)->members);
|
||||||
for (; tch ; tch = next_in_list(&Iterator)) {
|
for (; tch ; tch = next_in_list(&Iterator)) {
|
||||||
if (tch == ch)
|
if (tch == ch)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
+14
-15
@@ -16,28 +16,27 @@
|
|||||||
/* Structures and defines */
|
/* Structures and defines */
|
||||||
/* Attacktypes with grammar */
|
/* Attacktypes with grammar */
|
||||||
struct attack_hit_type {
|
struct attack_hit_type {
|
||||||
const char *singular;
|
const char *singular;
|
||||||
const char *plural;
|
const char *plural;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Functions available in fight.c */
|
/* Functions available in fight.c */
|
||||||
void appear(struct char_data *ch);
|
void appear(char_data *ch);
|
||||||
void check_killer(struct char_data *ch, struct char_data *vict);
|
void check_killer(char_data *ch, char_data *vict);
|
||||||
int compute_armor_class(struct char_data *ch);
|
int compute_armor_class(char_data *ch);
|
||||||
int damage(struct char_data *ch, struct char_data *victim, int dam, int attacktype);
|
int damage(char_data *ch, char_data *victim, int dam, int attacktype);
|
||||||
void death_cry(struct char_data *ch);
|
void death_cry(char_data *ch);
|
||||||
void die(struct char_data * ch, struct char_data * killer);
|
void die(char_data * ch, char_data * killer);
|
||||||
void hit(struct char_data *ch, struct char_data *victim, int type);
|
void hit(char_data *ch, char_data *victim, int type);
|
||||||
void perform_violence(void);
|
void perform_violence(void);
|
||||||
void raw_kill(struct char_data * ch, struct char_data * killer);
|
void raw_kill(char_data * ch, char_data * killer);
|
||||||
void set_fighting(struct char_data *ch, struct char_data *victim);
|
void set_fighting(char_data *ch, char_data *victim);
|
||||||
int skill_message(int dam, struct char_data *ch, struct char_data *vict,
|
int skill_message(int dam, char_data *ch, char_data *vict, int attacktype);
|
||||||
int attacktype);
|
void stop_fighting(char_data *ch);
|
||||||
void stop_fighting(struct char_data *ch);
|
|
||||||
|
|
||||||
|
|
||||||
/* Global variables */
|
/* Global variables */
|
||||||
extern struct attack_hit_type attack_hit_text[];
|
extern struct attack_hit_type attack_hit_text[];
|
||||||
extern struct char_data *combat_list;
|
extern char_data *combat_list;
|
||||||
|
|
||||||
#endif /* _FIGHT_H_*/
|
#endif /* _FIGHT_H_*/
|
||||||
|
|||||||
+15
-15
@@ -21,11 +21,11 @@
|
|||||||
/* local functions */
|
/* local functions */
|
||||||
static void extract_mobile_all(mob_vnum vnum);
|
static void extract_mobile_all(mob_vnum vnum);
|
||||||
|
|
||||||
int add_mobile(struct char_data *mob, mob_vnum vnum)
|
int add_mobile(char_data *mob, mob_vnum vnum)
|
||||||
{
|
{
|
||||||
int rnum, i, found = FALSE, shop, cmd_no;
|
int rnum, i, found = FALSE, shop, cmd_no;
|
||||||
zone_rnum zone;
|
zone_rnum zone;
|
||||||
struct char_data *live_mob;
|
char_data *live_mob;
|
||||||
|
|
||||||
if ((rnum = real_mobile(vnum)) != NOBODY) {
|
if ((rnum = real_mobile(vnum)) != NOBODY) {
|
||||||
/* Copy over the mobile and free() the old strings. */
|
/* Copy over the mobile and free() the old strings. */
|
||||||
@@ -41,7 +41,7 @@ int add_mobile(struct char_data *mob, mob_vnum vnum)
|
|||||||
return rnum;
|
return rnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
RECREATE(mob_proto, struct char_data, top_of_mobt + 2);
|
RECREATE(mob_proto, char_data, top_of_mobt + 2);
|
||||||
RECREATE(mob_index, struct index_data, top_of_mobt + 2);
|
RECREATE(mob_index, struct index_data, top_of_mobt + 2);
|
||||||
top_of_mobt++;
|
top_of_mobt++;
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ int add_mobile(struct char_data *mob, mob_vnum vnum)
|
|||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
int copy_mobile(struct char_data *to, struct char_data *from)
|
int copy_mobile(char_data *to, char_data *from)
|
||||||
{
|
{
|
||||||
free_mobile_strings(to);
|
free_mobile_strings(to);
|
||||||
*to = *from;
|
*to = *from;
|
||||||
@@ -101,7 +101,7 @@ int copy_mobile(struct char_data *to, struct char_data *from)
|
|||||||
|
|
||||||
static void extract_mobile_all(mob_vnum vnum)
|
static void extract_mobile_all(mob_vnum vnum)
|
||||||
{
|
{
|
||||||
struct char_data *next, *ch;
|
char_data *next, *ch;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (ch = character_list; ch; ch = next) {
|
for (ch = character_list; ch; ch = next) {
|
||||||
@@ -140,8 +140,8 @@ static void extract_mobile_all(mob_vnum vnum)
|
|||||||
|
|
||||||
int delete_mobile(mob_rnum refpt)
|
int delete_mobile(mob_rnum refpt)
|
||||||
{
|
{
|
||||||
struct char_data *live_mob;
|
char_data *live_mob;
|
||||||
struct char_data *proto;
|
char_data *proto;
|
||||||
int counter, cmd_no;
|
int counter, cmd_no;
|
||||||
mob_vnum vnum;
|
mob_vnum vnum;
|
||||||
zone_rnum zone;
|
zone_rnum zone;
|
||||||
@@ -169,7 +169,7 @@ int delete_mobile(mob_rnum refpt)
|
|||||||
|
|
||||||
top_of_mobt--;
|
top_of_mobt--;
|
||||||
RECREATE(mob_index, struct index_data, top_of_mobt + 1);
|
RECREATE(mob_index, struct index_data, top_of_mobt + 1);
|
||||||
RECREATE(mob_proto, struct char_data, top_of_mobt + 1);
|
RECREATE(mob_proto, char_data, top_of_mobt + 1);
|
||||||
|
|
||||||
/* Update live mobile rnums. */
|
/* Update live mobile rnums. */
|
||||||
for (live_mob = character_list; live_mob; live_mob = live_mob->next)
|
for (live_mob = character_list; live_mob; live_mob = live_mob->next)
|
||||||
@@ -195,7 +195,7 @@ int delete_mobile(mob_rnum refpt)
|
|||||||
return refpt;
|
return refpt;
|
||||||
}
|
}
|
||||||
|
|
||||||
int copy_mobile_strings(struct char_data *t, struct char_data *f)
|
int copy_mobile_strings(char_data *t, char_data *f)
|
||||||
{
|
{
|
||||||
if (f->player.name)
|
if (f->player.name)
|
||||||
t->player.name = strdup(f->player.name);
|
t->player.name = strdup(f->player.name);
|
||||||
@@ -210,7 +210,7 @@ int copy_mobile_strings(struct char_data *t, struct char_data *f)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int update_mobile_strings(struct char_data *t, struct char_data *f)
|
int update_mobile_strings(char_data *t, char_data *f)
|
||||||
{
|
{
|
||||||
if (f->player.name)
|
if (f->player.name)
|
||||||
t->player.name = f->player.name;
|
t->player.name = f->player.name;
|
||||||
@@ -225,7 +225,7 @@ int update_mobile_strings(struct char_data *t, struct char_data *f)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int free_mobile_strings(struct char_data *mob)
|
int free_mobile_strings(char_data *mob)
|
||||||
{
|
{
|
||||||
if (mob->player.name)
|
if (mob->player.name)
|
||||||
free(mob->player.name);
|
free(mob->player.name);
|
||||||
@@ -242,7 +242,7 @@ int free_mobile_strings(struct char_data *mob)
|
|||||||
|
|
||||||
/* Free a mobile structure that has been edited. Take care of existing mobiles
|
/* Free a mobile structure that has been edited. Take care of existing mobiles
|
||||||
* and their mob_proto! */
|
* and their mob_proto! */
|
||||||
int free_mobile(struct char_data *mob)
|
int free_mobile(char_data *mob)
|
||||||
{
|
{
|
||||||
mob_rnum i;
|
mob_rnum i;
|
||||||
|
|
||||||
@@ -325,7 +325,7 @@ int save_mobiles(zone_rnum rznum)
|
|||||||
return written;
|
return written;
|
||||||
}
|
}
|
||||||
|
|
||||||
int write_mobile_espec(mob_vnum mvnum, struct char_data *mob, FILE *fd)
|
int write_mobile_espec(mob_vnum mvnum, char_data *mob, FILE *fd)
|
||||||
{
|
{
|
||||||
if (GET_ATTACK(mob) != 0)
|
if (GET_ATTACK(mob) != 0)
|
||||||
fprintf(fd, "BareHandAttack: %d\n", GET_ATTACK(mob));
|
fprintf(fd, "BareHandAttack: %d\n", GET_ATTACK(mob));
|
||||||
@@ -357,7 +357,7 @@ int write_mobile_espec(mob_vnum mvnum, struct char_data *mob, FILE *fd)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int write_mobile_record(mob_vnum mvnum, struct char_data *mob, FILE *fd)
|
int write_mobile_record(mob_vnum mvnum, char_data *mob, FILE *fd)
|
||||||
{
|
{
|
||||||
char ldesc[MAX_STRING_LENGTH];
|
char ldesc[MAX_STRING_LENGTH];
|
||||||
char ddesc[MAX_STRING_LENGTH];
|
char ddesc[MAX_STRING_LENGTH];
|
||||||
@@ -419,7 +419,7 @@ int write_mobile_record(mob_vnum mvnum, struct char_data *mob, FILE *fd)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void check_mobile_strings(struct char_data *mob)
|
void check_mobile_strings(char_data *mob)
|
||||||
{
|
{
|
||||||
mob_vnum mvnum = mob_index[mob->nr].vnum;
|
mob_vnum mvnum = mob_index[mob->nr].vnum;
|
||||||
check_mobile_string(mvnum, &GET_LDESC(mob), "long description");
|
check_mobile_string(mvnum, &GET_LDESC(mob), "long description");
|
||||||
|
|||||||
+19
-19
@@ -13,30 +13,30 @@
|
|||||||
#define _GENMOB_H_
|
#define _GENMOB_H_
|
||||||
|
|
||||||
int delete_mobile(mob_rnum);
|
int delete_mobile(mob_rnum);
|
||||||
int copy_mobile(struct char_data *to, struct char_data *from);
|
int copy_mobile(char_data *to, char_data *from);
|
||||||
int add_mobile(struct char_data *, mob_vnum);
|
int add_mobile(char_data *, mob_vnum);
|
||||||
int copy_mob_strings(struct char_data *to, struct char_data *from);
|
int copy_mob_strings(char_data *to, char_data *from);
|
||||||
int free_mob_strings(struct char_data *);
|
int free_mob_strings(char_data *);
|
||||||
int free_mobile(struct char_data *mob);
|
int free_mobile(char_data *mob);
|
||||||
int save_mobiles(zone_rnum rznum);
|
int save_mobiles(zone_rnum rznum);
|
||||||
int update_mobile_strings(struct char_data *t, struct char_data *f);
|
int update_mobile_strings(char_data *t, char_data *f);
|
||||||
void check_mobile_strings(struct char_data *mob);
|
void check_mobile_strings(char_data *mob);
|
||||||
void check_mobile_string(mob_vnum i, char **string, const char *desc);
|
void check_mobile_string(mob_vnum i, char **string, const char *desc);
|
||||||
int write_mobile_record(mob_vnum mvnum, struct char_data *mob, FILE *fd);
|
int write_mobile_record(mob_vnum mvnum, char_data *mob, FILE *fd);
|
||||||
int write_mobile_espec(mob_vnum mvnum, struct char_data *mob, FILE *fd);
|
int write_mobile_espec(mob_vnum mvnum, char_data *mob, FILE *fd);
|
||||||
int free_mobile_strings(struct char_data *mob);
|
int free_mobile_strings(char_data *mob);
|
||||||
int copy_mobile_strings(struct char_data *t, struct char_data *f);
|
int copy_mobile_strings(char_data *t, char_data *f);
|
||||||
#if CONFIG_GENOLC_MOBPROG
|
#if CONFIG_GENOLC_MOBPROG
|
||||||
int write_mobile_mobprog(mob_vnum mvnum, struct char_data *mob, FILE *fd);
|
int write_mobile_mobprog(mob_vnum mvnum, char_data *mob, FILE *fd);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Handy macros. */
|
/* Handy macros. */
|
||||||
#define GET_NDD(mob) ((mob)->mob_specials.damnodice)
|
#define GET_NDD(mob) ((mob)->mob_specials.damnodice)
|
||||||
#define GET_SDD(mob) ((mob)->mob_specials.damsizedice)
|
#define GET_SDD(mob) ((mob)->mob_specials.damsizedice)
|
||||||
#define GET_ALIAS(mob) ((mob)->player.name)
|
#define GET_ALIAS(mob) ((mob)->player.name)
|
||||||
#define GET_SDESC(mob) ((mob)->player.short_descr)
|
#define GET_SDESC(mob) ((mob)->player.short_descr)
|
||||||
#define GET_LDESC(mob) ((mob)->player.long_descr)
|
#define GET_LDESC(mob) ((mob)->player.long_descr)
|
||||||
#define GET_DDESC(mob) ((mob)->player.description)
|
#define GET_DDESC(mob) ((mob)->player.description)
|
||||||
#define GET_ATTACK(mob) ((mob)->mob_specials.attack_type)
|
#define GET_ATTACK(mob) ((mob)->mob_specials.attack_type)
|
||||||
|
|
||||||
#endif /* _GENMOB_H_ */
|
#endif /* _GENMOB_H_ */
|
||||||
|
|||||||
+23
-23
@@ -22,10 +22,10 @@
|
|||||||
|
|
||||||
|
|
||||||
/* local functions */
|
/* local functions */
|
||||||
static int update_all_objects(struct obj_data *obj);
|
static int update_all_objects(obj_data *obj);
|
||||||
static void copy_object_strings(struct obj_data *to, struct obj_data *from);
|
static void copy_object_strings(obj_data *to, obj_data *from);
|
||||||
|
|
||||||
obj_rnum add_object(struct obj_data *newobj, obj_vnum ovnum)
|
obj_rnum add_object(obj_data *newobj, obj_vnum ovnum)
|
||||||
{
|
{
|
||||||
int found = NOTHING;
|
int found = NOTHING;
|
||||||
zone_rnum rznum = real_zone_by_thing(ovnum);
|
zone_rnum rznum = real_zone_by_thing(ovnum);
|
||||||
@@ -48,9 +48,9 @@ obj_rnum add_object(struct obj_data *newobj, obj_vnum ovnum)
|
|||||||
* and every object currently in the game to see which ones are pointing to
|
* and every object currently in the game to see which ones are pointing to
|
||||||
* this prototype. If object is pointing to this prototype, then we need to
|
* this prototype. If object is pointing to this prototype, then we need to
|
||||||
* replace it with the new one. */
|
* replace it with the new one. */
|
||||||
static int update_all_objects(struct obj_data *refobj)
|
static int update_all_objects(obj_data *refobj)
|
||||||
{
|
{
|
||||||
struct obj_data *obj, swap;
|
obj_data *obj, swap;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
for (obj = object_list; obj; obj = obj->next) {
|
for (obj = object_list; obj; obj = obj->next) {
|
||||||
@@ -85,7 +85,7 @@ static int update_all_objects(struct obj_data *refobj)
|
|||||||
obj_rnum adjust_objects(obj_rnum refpt)
|
obj_rnum adjust_objects(obj_rnum refpt)
|
||||||
{
|
{
|
||||||
int shop, i, zone, cmd_no;
|
int shop, i, zone, cmd_no;
|
||||||
struct obj_data *obj;
|
obj_data *obj;
|
||||||
|
|
||||||
#if CIRCLE_UNSIGNED_INDEX
|
#if CIRCLE_UNSIGNED_INDEX
|
||||||
if (refpt == NOTHING || refpt > top_of_objt)
|
if (refpt == NOTHING || refpt > top_of_objt)
|
||||||
@@ -132,13 +132,13 @@ obj_rnum adjust_objects(obj_rnum refpt)
|
|||||||
/* Function handle the insertion of an object within the prototype framework.
|
/* Function handle the insertion of an object within the prototype framework.
|
||||||
* Note that this does not adjust internal values of other objects, use
|
* Note that this does not adjust internal values of other objects, use
|
||||||
* add_object() for that. */
|
* add_object() for that. */
|
||||||
obj_rnum insert_object(struct obj_data *obj, obj_vnum ovnum)
|
obj_rnum insert_object(obj_data *obj, obj_vnum ovnum)
|
||||||
{
|
{
|
||||||
obj_rnum i;
|
obj_rnum i;
|
||||||
|
|
||||||
top_of_objt++;
|
top_of_objt++;
|
||||||
RECREATE(obj_index, struct index_data, top_of_objt + 1);
|
RECREATE(obj_index, struct index_data, top_of_objt + 1);
|
||||||
RECREATE(obj_proto, struct obj_data, top_of_objt + 1);
|
RECREATE(obj_proto, obj_data, top_of_objt + 1);
|
||||||
|
|
||||||
/* Start counting through both tables. */
|
/* Start counting through both tables. */
|
||||||
for (i = top_of_objt; i > 0; i--) {
|
for (i = top_of_objt; i > 0; i--) {
|
||||||
@@ -156,7 +156,7 @@ obj_rnum insert_object(struct obj_data *obj, obj_vnum ovnum)
|
|||||||
return index_object(obj, ovnum, 0);
|
return index_object(obj, ovnum, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
obj_rnum index_object(struct obj_data *obj, obj_vnum ovnum, obj_rnum ornum)
|
obj_rnum index_object(obj_data *obj, obj_vnum ovnum, obj_rnum ornum)
|
||||||
{
|
{
|
||||||
#if CIRCLE_UNSIGNED_INDEX
|
#if CIRCLE_UNSIGNED_INDEX
|
||||||
if (obj == NULL || ornum == NOTHING || ornum > top_of_objt)
|
if (obj == NULL || ornum == NOTHING || ornum > top_of_objt)
|
||||||
@@ -184,7 +184,7 @@ int save_objects(zone_rnum zone_num)
|
|||||||
char pbuf1[MAX_STRING_LENGTH], pbuf2[MAX_STRING_LENGTH], pbuf3[MAX_STRING_LENGTH], pbuf4[MAX_STRING_LENGTH];
|
char pbuf1[MAX_STRING_LENGTH], pbuf2[MAX_STRING_LENGTH], pbuf3[MAX_STRING_LENGTH], pbuf4[MAX_STRING_LENGTH];
|
||||||
int counter, counter2, realcounter;
|
int counter, counter2, realcounter;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
struct obj_data *obj;
|
obj_data *obj;
|
||||||
struct extra_descr_data *ex_desc;
|
struct extra_descr_data *ex_desc;
|
||||||
|
|
||||||
#if CIRCLE_UNSIGNED_INDEX
|
#if CIRCLE_UNSIGNED_INDEX
|
||||||
@@ -299,7 +299,7 @@ int save_objects(zone_rnum zone_num)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Free all, unconditionally. */
|
/* Free all, unconditionally. */
|
||||||
void free_object_strings(struct obj_data *obj)
|
void free_object_strings(obj_data *obj)
|
||||||
{
|
{
|
||||||
if (obj->name)
|
if (obj->name)
|
||||||
free(obj->name);
|
free(obj->name);
|
||||||
@@ -314,7 +314,7 @@ void free_object_strings(struct obj_data *obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* For object instances that are not the prototype. */
|
/* For object instances that are not the prototype. */
|
||||||
void free_object_strings_proto(struct obj_data *obj)
|
void free_object_strings_proto(obj_data *obj)
|
||||||
{
|
{
|
||||||
int robj_num = GET_OBJ_RNUM(obj);
|
int robj_num = GET_OBJ_RNUM(obj);
|
||||||
|
|
||||||
@@ -349,7 +349,7 @@ void free_object_strings_proto(struct obj_data *obj)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void copy_object_strings(struct obj_data *to, struct obj_data *from)
|
static void copy_object_strings(obj_data *to, obj_data *from)
|
||||||
{
|
{
|
||||||
to->name = from->name ? strdup(from->name) : NULL;
|
to->name = from->name ? strdup(from->name) : NULL;
|
||||||
to->description = from->description ? strdup(from->description) : NULL;
|
to->description = from->description ? strdup(from->description) : NULL;
|
||||||
@@ -362,18 +362,18 @@ static void copy_object_strings(struct obj_data *to, struct obj_data *from)
|
|||||||
to->ex_description = NULL;
|
to->ex_description = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int copy_object(struct obj_data *to, struct obj_data *from)
|
int copy_object(obj_data *to, obj_data *from)
|
||||||
{
|
{
|
||||||
free_object_strings(to);
|
free_object_strings(to);
|
||||||
return copy_object_main(to, from, TRUE);
|
return copy_object_main(to, from, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int copy_object_preserve(struct obj_data *to, struct obj_data *from)
|
int copy_object_preserve(obj_data *to, obj_data *from)
|
||||||
{
|
{
|
||||||
return copy_object_main(to, from, FALSE);
|
return copy_object_main(to, from, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int copy_object_main(struct obj_data *to, struct obj_data *from, int free_object)
|
int copy_object_main(obj_data *to, obj_data *from, int free_object)
|
||||||
{
|
{
|
||||||
*to = *from;
|
*to = *from;
|
||||||
copy_object_strings(to, from);
|
copy_object_strings(to, from);
|
||||||
@@ -384,7 +384,7 @@ int delete_object(obj_rnum rnum)
|
|||||||
{
|
{
|
||||||
obj_rnum i;
|
obj_rnum i;
|
||||||
zone_rnum zrnum;
|
zone_rnum zrnum;
|
||||||
struct obj_data *obj, *tmp, *next_obj;
|
obj_data *obj, *tmp, *next_obj;
|
||||||
int shop, j, zone, cmd_no;
|
int shop, j, zone, cmd_no;
|
||||||
|
|
||||||
if (rnum == NOTHING || rnum > top_of_objt)
|
if (rnum == NOTHING || rnum > top_of_objt)
|
||||||
@@ -404,7 +404,7 @@ int delete_object(obj_rnum rnum)
|
|||||||
|
|
||||||
/* extract_obj() will just axe contents. */
|
/* extract_obj() will just axe contents. */
|
||||||
if (tmp->contains) {
|
if (tmp->contains) {
|
||||||
struct obj_data *this_content, *next_content;
|
obj_data *this_content, *next_content;
|
||||||
for (this_content = tmp->contains; this_content; this_content = next_content) {
|
for (this_content = tmp->contains; this_content; this_content = next_content) {
|
||||||
next_content = this_content->next_content;
|
next_content = this_content->next_content;
|
||||||
if (IN_ROOM(tmp)) {
|
if (IN_ROOM(tmp)) {
|
||||||
@@ -442,7 +442,7 @@ int delete_object(obj_rnum rnum)
|
|||||||
|
|
||||||
top_of_objt--;
|
top_of_objt--;
|
||||||
RECREATE(obj_index, struct index_data, top_of_objt + 1);
|
RECREATE(obj_index, struct index_data, top_of_objt + 1);
|
||||||
RECREATE(obj_proto, struct obj_data, top_of_objt + 1);
|
RECREATE(obj_proto, obj_data, top_of_objt + 1);
|
||||||
|
|
||||||
/* Renumber notice boards. */
|
/* Renumber notice boards. */
|
||||||
for (j = 0; j < NUM_OF_BOARDS; j++)
|
for (j = 0; j < NUM_OF_BOARDS; j++)
|
||||||
@@ -487,7 +487,7 @@ int delete_object(obj_rnum rnum)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* oset handling, this location should be temporary */
|
/* oset handling, this location should be temporary */
|
||||||
bool oset_alias(struct obj_data *obj, char * argument)
|
bool oset_alias(obj_data *obj, char * argument)
|
||||||
{
|
{
|
||||||
static size_t max_len = 64;
|
static size_t max_len = 64;
|
||||||
int i = GET_OBJ_RNUM(obj);
|
int i = GET_OBJ_RNUM(obj);
|
||||||
@@ -505,7 +505,7 @@ bool oset_alias(struct obj_data *obj, char * argument)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool oset_apply(struct obj_data *obj, char * argument)
|
bool oset_apply(obj_data *obj, char * argument)
|
||||||
{
|
{
|
||||||
int i = 0, apply = -1, location = -1, mod = 0, empty = -1, value;
|
int i = 0, apply = -1, location = -1, mod = 0, empty = -1, value;
|
||||||
char arg[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH];
|
||||||
@@ -558,7 +558,7 @@ bool oset_apply(struct obj_data *obj, char * argument)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool oset_short_description(struct obj_data *obj, char * argument)
|
bool oset_short_description(obj_data *obj, char * argument)
|
||||||
{
|
{
|
||||||
static size_t max_len = 64;
|
static size_t max_len = 64;
|
||||||
int i = GET_OBJ_RNUM(obj);
|
int i = GET_OBJ_RNUM(obj);
|
||||||
@@ -576,7 +576,7 @@ bool oset_short_description(struct obj_data *obj, char * argument)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool oset_long_description(struct obj_data *obj, char * argument)
|
bool oset_long_description(obj_data *obj, char * argument)
|
||||||
{
|
{
|
||||||
static size_t max_len = 128;
|
static size_t max_len = 128;
|
||||||
int i = GET_OBJ_RNUM(obj);
|
int i = GET_OBJ_RNUM(obj);
|
||||||
|
|||||||
+12
-12
@@ -12,20 +12,20 @@
|
|||||||
#ifndef _GENOBJ_H_
|
#ifndef _GENOBJ_H_
|
||||||
#define _GENOBJ_H_
|
#define _GENOBJ_H_
|
||||||
|
|
||||||
void free_object_strings_proto(struct obj_data *obj);
|
void free_object_strings_proto(obj_data *obj);
|
||||||
void free_object_strings(struct obj_data *obj);
|
void free_object_strings(obj_data *obj);
|
||||||
int copy_object(struct obj_data *to, struct obj_data *from);
|
int copy_object(obj_data *to, obj_data *from);
|
||||||
int copy_object_preserve(struct obj_data *to, struct obj_data *from);
|
int copy_object_preserve(obj_data *to, obj_data *from);
|
||||||
int save_objects(zone_rnum vznum);
|
int save_objects(zone_rnum vznum);
|
||||||
obj_rnum insert_object(struct obj_data *obj, obj_vnum ovnum);
|
obj_rnum insert_object(obj_data *obj, obj_vnum ovnum);
|
||||||
obj_rnum adjust_objects(obj_rnum refpt);
|
obj_rnum adjust_objects(obj_rnum refpt);
|
||||||
obj_rnum index_object(struct obj_data *obj, obj_vnum ovnum, obj_rnum ornum);
|
obj_rnum index_object(obj_data *obj, obj_vnum ovnum, obj_rnum ornum);
|
||||||
obj_rnum add_object(struct obj_data *, obj_vnum ovnum);
|
obj_rnum add_object(obj_data *, obj_vnum ovnum);
|
||||||
int copy_object_main(struct obj_data *to, struct obj_data *from, int free_object);
|
int copy_object_main(obj_data *to, obj_data *from, int free_object);
|
||||||
int delete_object(obj_rnum);
|
int delete_object(obj_rnum);
|
||||||
bool oset_alias(struct obj_data *obj, char * argument);
|
bool oset_alias(obj_data *obj, char * argument);
|
||||||
bool oset_apply(struct obj_data *obj, char * argument);
|
bool oset_apply(obj_data *obj, char * argument);
|
||||||
bool oset_short_description(struct obj_data *obj, char * argument);
|
bool oset_short_description(obj_data *obj, char * argument);
|
||||||
bool oset_long_description(struct obj_data *obj, char * argument);
|
bool oset_long_description(obj_data *obj, char * argument);
|
||||||
|
|
||||||
#endif /* _GENOBJ_H_ */
|
#endif /* _GENOBJ_H_ */
|
||||||
|
|||||||
+7
-7
@@ -60,11 +60,11 @@ static int export_save_zone(zone_rnum zrnum);
|
|||||||
static int export_save_objects(zone_rnum zrnum);
|
static int export_save_objects(zone_rnum zrnum);
|
||||||
static int export_save_rooms(zone_rnum zrnum);
|
static int export_save_rooms(zone_rnum zrnum);
|
||||||
static int export_save_triggers(zone_rnum zrnum);
|
static int export_save_triggers(zone_rnum zrnum);
|
||||||
static int export_mobile_record(mob_vnum mvnum, struct char_data *mob, FILE *fd);
|
static int export_mobile_record(mob_vnum mvnum, char_data *mob, FILE *fd);
|
||||||
static void export_script_save_to_disk(FILE *fp, void *item, int type);
|
static void export_script_save_to_disk(FILE *fp, void *item, int type);
|
||||||
static int export_info_file(zone_rnum zrnum);
|
static int export_info_file(zone_rnum zrnum);
|
||||||
|
|
||||||
int genolc_checkstring(struct descriptor_data *d, char *arg)
|
int genolc_checkstring(descriptor_data *d, char *arg)
|
||||||
{
|
{
|
||||||
smash_tilde(arg);
|
smash_tilde(arg);
|
||||||
parse_at(arg);
|
parse_at(arg);
|
||||||
@@ -330,7 +330,7 @@ ACMD(do_export_zone)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
zvnum = atoi(argument);
|
zvnum = atoidx(argument);
|
||||||
zrnum = real_zone(zvnum);
|
zrnum = real_zone(zvnum);
|
||||||
|
|
||||||
if (zrnum == NOWHERE) {
|
if (zrnum == NOWHERE) {
|
||||||
@@ -589,7 +589,7 @@ static int export_save_mobiles(zone_rnum rznum)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int export_mobile_record(mob_vnum mvnum, struct char_data *mob, FILE *fd)
|
static int export_mobile_record(mob_vnum mvnum, char_data *mob, FILE *fd)
|
||||||
{
|
{
|
||||||
|
|
||||||
char ldesc[MAX_STRING_LENGTH];
|
char ldesc[MAX_STRING_LENGTH];
|
||||||
@@ -774,7 +774,7 @@ static int export_save_objects(zone_rnum zrnum)
|
|||||||
obj_vnum ovnum;
|
obj_vnum ovnum;
|
||||||
int i;
|
int i;
|
||||||
FILE *obj_file;
|
FILE *obj_file;
|
||||||
struct obj_data *obj;
|
obj_data *obj;
|
||||||
struct extra_descr_data *ex_desc;
|
struct extra_descr_data *ex_desc;
|
||||||
|
|
||||||
if (!(obj_file = fopen("world/export/qq.obj", "w"))) {
|
if (!(obj_file = fopen("world/export/qq.obj", "w"))) {
|
||||||
@@ -996,9 +996,9 @@ static void export_script_save_to_disk(FILE *fp, void *item, int type)
|
|||||||
struct trig_proto_list *t;
|
struct trig_proto_list *t;
|
||||||
|
|
||||||
if (type==MOB_TRIGGER)
|
if (type==MOB_TRIGGER)
|
||||||
t = ((struct char_data *)item)->proto_script;
|
t = ((char_data *)item)->proto_script;
|
||||||
else if (type==OBJ_TRIGGER)
|
else if (type==OBJ_TRIGGER)
|
||||||
t = ((struct obj_data *)item)->proto_script;
|
t = ((obj_data *)item)->proto_script;
|
||||||
else if (type==WLD_TRIGGER)
|
else if (type==WLD_TRIGGER)
|
||||||
t = ((struct room_data *)item)->proto_script;
|
t = ((struct room_data *)item)->proto_script;
|
||||||
else {
|
else {
|
||||||
|
|||||||
+13
-13
@@ -13,9 +13,9 @@
|
|||||||
#define _GENOLC_H_
|
#define _GENOLC_H_
|
||||||
|
|
||||||
#define STRING_TERMINATOR '~'
|
#define STRING_TERMINATOR '~'
|
||||||
#define CONFIG_GENOLC_MOBPROG 0
|
#define CONFIG_GENOLC_MOBPROG 0
|
||||||
|
|
||||||
int genolc_checkstring(struct descriptor_data *d, char *arg);
|
int genolc_checkstring(descriptor_data *d, char *arg);
|
||||||
int remove_from_save_list(zone_vnum, int type);
|
int remove_from_save_list(zone_vnum, int type);
|
||||||
int add_to_save_list(zone_vnum, int type);
|
int add_to_save_list(zone_vnum, int type);
|
||||||
int in_save_list(zone_vnum, int type);
|
int in_save_list(zone_vnum, int type);
|
||||||
@@ -30,28 +30,28 @@ ACMD(do_export_zone);
|
|||||||
ACMD(do_show_save_list);
|
ACMD(do_show_save_list);
|
||||||
|
|
||||||
struct save_list_data {
|
struct save_list_data {
|
||||||
int zone;
|
int zone;
|
||||||
int type;
|
int type;
|
||||||
struct save_list_data *next;
|
struct save_list_data *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct save_list_data *save_list;
|
extern struct save_list_data *save_list;
|
||||||
|
|
||||||
/* save_list_data.type */
|
/* save_list_data.type */
|
||||||
#define SL_MOB 0
|
#define SL_MOB 0
|
||||||
#define SL_OBJ 1
|
#define SL_OBJ 1
|
||||||
#define SL_SHP 2
|
#define SL_SHP 2
|
||||||
#define SL_WLD 3
|
#define SL_WLD 3
|
||||||
#define SL_ZON 4
|
#define SL_ZON 4
|
||||||
#define SL_CFG 5
|
#define SL_CFG 5
|
||||||
#define SL_QST 6
|
#define SL_QST 6
|
||||||
#define SL_MAX 6
|
#define SL_MAX 6
|
||||||
#define SL_ACT SL_MAX + 1 /* must be above MAX */
|
#define SL_ACT SL_MAX + 1 /* must be above MAX */
|
||||||
#define SL_HLP SL_MAX + 2
|
#define SL_HLP SL_MAX + 2
|
||||||
|
|
||||||
#define ZCMD(zon, cmds) zone_table[(zon)].cmd[(cmds)]
|
#define ZCMD(zon, cmds) zone_table[(zon)].cmd[(cmds)]
|
||||||
|
|
||||||
#define LIMIT(var, low, high) MIN(high, MAX(var, low))
|
#define LIMIT(var, low, high) MIN(high, MAX(var, low))
|
||||||
|
|
||||||
room_vnum genolc_zone_bottom(zone_rnum rznum);
|
room_vnum genolc_zone_bottom(zone_rnum rznum);
|
||||||
room_vnum genolc_zonep_bottom(struct zone_data *zone);
|
room_vnum genolc_zonep_bottom(struct zone_data *zone);
|
||||||
|
|||||||
+28
-28
@@ -25,35 +25,35 @@ int save_shops(zone_rnum zone_num);
|
|||||||
shop_rnum real_shop(shop_vnum vnum);
|
shop_rnum real_shop(shop_vnum vnum);
|
||||||
|
|
||||||
/* Handy macros. */
|
/* Handy macros. */
|
||||||
#define S_NUM(i) ((i)->vnum)
|
#define S_NUM(i) ((i)->vnum)
|
||||||
#define S_KEEPER(i) ((i)->keeper)
|
#define S_KEEPER(i) ((i)->keeper)
|
||||||
#define S_OPEN1(i) ((i)->open1)
|
#define S_OPEN1(i) ((i)->open1)
|
||||||
#define S_CLOSE1(i) ((i)->close1)
|
#define S_CLOSE1(i) ((i)->close1)
|
||||||
#define S_OPEN2(i) ((i)->open2)
|
#define S_OPEN2(i) ((i)->open2)
|
||||||
#define S_CLOSE2(i) ((i)->close2)
|
#define S_CLOSE2(i) ((i)->close2)
|
||||||
#define S_BANK(i) ((i)->bankAccount)
|
#define S_BANK(i) ((i)->bankAccount)
|
||||||
#define S_BROKE_TEMPER(i) ((i)->temper1)
|
#define S_BROKE_TEMPER(i) ((i)->temper1)
|
||||||
#define S_BITVECTOR(i) ((i)->bitvector)
|
#define S_BITVECTOR(i) ((i)->bitvector)
|
||||||
#define S_NOTRADE(i) ((i)->with_who)
|
#define S_NOTRADE(i) ((i)->with_who)
|
||||||
#define S_SORT(i) ((i)->lastsort)
|
#define S_SORT(i) ((i)->lastsort)
|
||||||
#define S_BUYPROFIT(i) ((i)->profit_buy)
|
#define S_BUYPROFIT(i) ((i)->profit_buy)
|
||||||
#define S_SELLPROFIT(i) ((i)->profit_sell)
|
#define S_SELLPROFIT(i) ((i)->profit_sell)
|
||||||
#define S_FUNC(i) ((i)->func)
|
#define S_FUNC(i) ((i)->func)
|
||||||
|
|
||||||
#define S_ROOMS(i) ((i)->in_room)
|
#define S_ROOMS(i) ((i)->in_room)
|
||||||
#define S_PRODUCTS(i) ((i)->producing)
|
#define S_PRODUCTS(i) ((i)->producing)
|
||||||
#define S_NAMELISTS(i) ((i)->type)
|
#define S_NAMELISTS(i) ((i)->type)
|
||||||
#define S_ROOM(i, num) ((i)->in_room[(num)])
|
#define S_ROOM(i, num) ((i)->in_room[(num)])
|
||||||
#define S_PRODUCT(i, num) ((i)->producing[(num)])
|
#define S_PRODUCT(i, num) ((i)->producing[(num)])
|
||||||
#define S_BUYTYPE(i, num) (BUY_TYPE((i)->type[(num)]))
|
#define S_BUYTYPE(i, num) (BUY_TYPE((i)->type[(num)]))
|
||||||
#define S_BUYWORD(i, num) (BUY_WORD((i)->type[(num)]))
|
#define S_BUYWORD(i, num) (BUY_WORD((i)->type[(num)]))
|
||||||
|
|
||||||
#define S_NOITEM1(i) ((i)->no_such_item1)
|
#define S_NOITEM1(i) ((i)->no_such_item1)
|
||||||
#define S_NOITEM2(i) ((i)->no_such_item2)
|
#define S_NOITEM2(i) ((i)->no_such_item2)
|
||||||
#define S_NOCASH1(i) ((i)->missing_cash1)
|
#define S_NOCASH1(i) ((i)->missing_cash1)
|
||||||
#define S_NOCASH2(i) ((i)->missing_cash2)
|
#define S_NOCASH2(i) ((i)->missing_cash2)
|
||||||
#define S_NOBUY(i) ((i)->do_not_buy)
|
#define S_NOBUY(i) ((i)->do_not_buy)
|
||||||
#define S_BUY(i) ((i)->message_buy)
|
#define S_BUY(i) ((i)->message_buy)
|
||||||
#define S_SELL(i) ((i)->message_sell)
|
#define S_SELL(i) ((i)->message_sell)
|
||||||
|
|
||||||
#endif /* _GENSHP_H_ */
|
#endif /* _GENSHP_H_ */
|
||||||
|
|||||||
+4
-4
@@ -24,8 +24,8 @@
|
|||||||
* the description, title, and such. */
|
* the description, title, and such. */
|
||||||
room_rnum add_room(struct room_data *room)
|
room_rnum add_room(struct room_data *room)
|
||||||
{
|
{
|
||||||
struct char_data *tch;
|
char_data *tch;
|
||||||
struct obj_data *tobj;
|
obj_data *tobj;
|
||||||
int j, found = FALSE;
|
int j, found = FALSE;
|
||||||
room_rnum i;
|
room_rnum i;
|
||||||
|
|
||||||
@@ -123,8 +123,8 @@ int delete_room(room_rnum rnum)
|
|||||||
{
|
{
|
||||||
room_rnum i;
|
room_rnum i;
|
||||||
int j;
|
int j;
|
||||||
struct char_data *ppl, *next_ppl;
|
char_data *ppl, *next_ppl;
|
||||||
struct obj_data *obj, *next_obj;
|
obj_data *obj, *next_obj;
|
||||||
struct room_data *room;
|
struct room_data *room;
|
||||||
|
|
||||||
if (rnum <= 0 || rnum > top_of_world) /* Can't delete void yet. */
|
if (rnum <= 0 || rnum > top_of_world) /* Can't delete void yet. */
|
||||||
|
|||||||
+1
-1
@@ -268,7 +268,7 @@ void create_world_index(int znum, const char *type)
|
|||||||
while (get_line(oldfile, buf)) {
|
while (get_line(oldfile, buf)) {
|
||||||
if (*buf == '$') {
|
if (*buf == '$') {
|
||||||
/* The following used to add a blank line, thanks to Brian Taylor for the fix. */
|
/* The following used to add a blank line, thanks to Brian Taylor for the fix. */
|
||||||
fprintf(newfile, "%s", (!found ? strncat(buf1, "\n$\n", sizeof(buf1)-1) : "$\n"));
|
fprintf(newfile, "%s", (!found ? strncat(buf1, "\n$\n", sizeof(buf1) - strlen(buf1) - 1) : "$\n"));
|
||||||
break;
|
break;
|
||||||
} else if (!found) {
|
} else if (!found) {
|
||||||
sscanf(buf, "%d", &num);
|
sscanf(buf, "%d", &num);
|
||||||
|
|||||||
+3
-3
@@ -141,7 +141,7 @@ static int find_first_step(room_rnum src, room_rnum target)
|
|||||||
ACMD(do_track)
|
ACMD(do_track)
|
||||||
{
|
{
|
||||||
char arg[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH];
|
||||||
struct char_data *vict;
|
char_data *vict;
|
||||||
int dir;
|
int dir;
|
||||||
|
|
||||||
/* The character must have the track skill. */
|
/* The character must have the track skill. */
|
||||||
@@ -195,11 +195,11 @@ ACMD(do_track)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void hunt_victim(struct char_data *ch)
|
void hunt_victim(char_data *ch)
|
||||||
{
|
{
|
||||||
int dir;
|
int dir;
|
||||||
byte found;
|
byte found;
|
||||||
struct char_data *tmp;
|
char_data *tmp;
|
||||||
|
|
||||||
if (!ch || !HUNTING(ch) || FIGHTING(ch))
|
if (!ch || !HUNTING(ch) || FIGHTING(ch))
|
||||||
return;
|
return;
|
||||||
|
|||||||
+1
-1
@@ -15,6 +15,6 @@
|
|||||||
#define _GRAPH_H_
|
#define _GRAPH_H_
|
||||||
|
|
||||||
ACMD(do_track);
|
ACMD(do_track);
|
||||||
void hunt_victim(struct char_data *ch);
|
void hunt_victim(char_data *ch);
|
||||||
|
|
||||||
#endif /* _GRAPH_H_*/
|
#endif /* _GRAPH_H_*/
|
||||||
|
|||||||
+86
-78
@@ -29,9 +29,9 @@
|
|||||||
static int extractions_pending = 0;
|
static int extractions_pending = 0;
|
||||||
|
|
||||||
/* local file scope functions */
|
/* local file scope functions */
|
||||||
static int apply_ac(struct char_data *ch, int eq_pos);
|
static int apply_ac(char_data *ch, int eq_pos);
|
||||||
static void update_object(struct obj_data *obj, int use);
|
static void update_object(obj_data *obj, int use);
|
||||||
static void affect_modify_ar(struct char_data * ch, byte loc, sbyte mod, int bitv[], bool add);
|
static void affect_modify_ar(char_data * ch, byte loc, sbyte mod, int bitv[], bool add);
|
||||||
|
|
||||||
char *fname(const char *namelist)
|
char *fname(const char *namelist)
|
||||||
{
|
{
|
||||||
@@ -105,7 +105,7 @@ int isname(const char *str, const char *namelist)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void aff_apply_modify(struct char_data *ch, byte loc, sbyte mod, char *msg)
|
static void aff_apply_modify(char_data *ch, byte loc, sbyte mod, char *msg)
|
||||||
{
|
{
|
||||||
switch (loc) {
|
switch (loc) {
|
||||||
case APPLY_NONE:
|
case APPLY_NONE:
|
||||||
@@ -205,7 +205,7 @@ static void aff_apply_modify(struct char_data *ch, byte loc, sbyte mod, char *ms
|
|||||||
} /* switch */
|
} /* switch */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void affect_modify_ar(struct char_data * ch, byte loc, sbyte mod, int bitv[], bool add)
|
static void affect_modify_ar(char_data * ch, byte loc, sbyte mod, int bitv[], bool add)
|
||||||
{
|
{
|
||||||
int i , j;
|
int i , j;
|
||||||
|
|
||||||
@@ -227,7 +227,7 @@ static void affect_modify_ar(struct char_data * ch, byte loc, sbyte mod, int bit
|
|||||||
|
|
||||||
/* This updates a character by subtracting everything he is affected by
|
/* This updates a character by subtracting everything he is affected by
|
||||||
* restoring original abilities, and then affecting all again. */
|
* restoring original abilities, and then affecting all again. */
|
||||||
void affect_total(struct char_data *ch)
|
void affect_total(char_data *ch)
|
||||||
{
|
{
|
||||||
struct affected_type *af;
|
struct affected_type *af;
|
||||||
int i, j;
|
int i, j;
|
||||||
@@ -279,7 +279,7 @@ void affect_total(struct char_data *ch)
|
|||||||
|
|
||||||
/* Insert an affect_type in a char_data structure. Automatically sets
|
/* Insert an affect_type in a char_data structure. Automatically sets
|
||||||
* apropriate bits and apply's */
|
* apropriate bits and apply's */
|
||||||
void affect_to_char(struct char_data *ch, struct affected_type *af)
|
void affect_to_char(char_data *ch, struct affected_type *af)
|
||||||
{
|
{
|
||||||
struct affected_type *affected_alloc;
|
struct affected_type *affected_alloc;
|
||||||
|
|
||||||
@@ -296,7 +296,7 @@ void affect_to_char(struct char_data *ch, struct affected_type *af)
|
|||||||
/* Remove an affected_type structure from a char (called when duration reaches
|
/* Remove an affected_type structure from a char (called when duration reaches
|
||||||
* zero). Pointer *af must never be NIL! Frees mem and calls
|
* zero). Pointer *af must never be NIL! Frees mem and calls
|
||||||
* affect_location_apply */
|
* affect_location_apply */
|
||||||
void affect_remove(struct char_data *ch, struct affected_type *af)
|
void affect_remove(char_data *ch, struct affected_type *af)
|
||||||
{
|
{
|
||||||
struct affected_type *temp;
|
struct affected_type *temp;
|
||||||
|
|
||||||
@@ -312,7 +312,7 @@ void affect_remove(struct char_data *ch, struct affected_type *af)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Call affect_remove with every affect from the spell "type" */
|
/* Call affect_remove with every affect from the spell "type" */
|
||||||
void affect_from_char(struct char_data *ch, int type)
|
void affect_from_char(char_data *ch, int type)
|
||||||
{
|
{
|
||||||
struct affected_type *hjp, *next;
|
struct affected_type *hjp, *next;
|
||||||
|
|
||||||
@@ -325,7 +325,7 @@ void affect_from_char(struct char_data *ch, int type)
|
|||||||
|
|
||||||
/* Return TRUE if a char is affected by a spell (SPELL_XXX), FALSE indicates
|
/* Return TRUE if a char is affected by a spell (SPELL_XXX), FALSE indicates
|
||||||
* not affected. */
|
* not affected. */
|
||||||
bool affected_by_spell(struct char_data *ch, int type)
|
bool affected_by_spell(char_data *ch, int type)
|
||||||
{
|
{
|
||||||
struct affected_type *hjp;
|
struct affected_type *hjp;
|
||||||
|
|
||||||
@@ -336,7 +336,7 @@ bool affected_by_spell(struct char_data *ch, int type)
|
|||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void affect_join(struct char_data *ch, struct affected_type *af,
|
void affect_join(char_data *ch, struct affected_type *af,
|
||||||
bool add_dur, bool avg_dur, bool add_mod, bool avg_mod)
|
bool add_dur, bool avg_dur, bool add_mod, bool avg_mod)
|
||||||
{
|
{
|
||||||
struct affected_type *hjp, *next;
|
struct affected_type *hjp, *next;
|
||||||
@@ -365,9 +365,9 @@ void affect_join(struct char_data *ch, struct affected_type *af,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* move a player out of a room */
|
/* move a player out of a room */
|
||||||
void char_from_room(struct char_data *ch)
|
void char_from_room(char_data *ch)
|
||||||
{
|
{
|
||||||
struct char_data *temp;
|
char_data *temp;
|
||||||
|
|
||||||
if (ch == NULL || IN_ROOM(ch) == NOWHERE) {
|
if (ch == NULL || IN_ROOM(ch) == NOWHERE) {
|
||||||
log("SYSERR: NULL character or NOWHERE in %s, char_from_room", __FILE__);
|
log("SYSERR: NULL character or NOWHERE in %s, char_from_room", __FILE__);
|
||||||
@@ -390,7 +390,7 @@ void char_from_room(struct char_data *ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* place a character in a room */
|
/* place a character in a room */
|
||||||
void char_to_room(struct char_data *ch, room_rnum room)
|
void char_to_room(char_data *ch, room_rnum room)
|
||||||
{
|
{
|
||||||
if (ch == NULL || room == NOWHERE || room > top_of_world)
|
if (ch == NULL || room == NOWHERE || room > top_of_world)
|
||||||
log("SYSERR: Illegal value(s) passed to char_to_room. (Room: %d/%d Ch: %p",
|
log("SYSERR: Illegal value(s) passed to char_to_room. (Room: %d/%d Ch: %p",
|
||||||
@@ -417,7 +417,7 @@ void char_to_room(struct char_data *ch, room_rnum room)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Give an object to a char. */
|
/* Give an object to a char. */
|
||||||
void obj_to_char(struct obj_data *object, struct char_data *ch)
|
void obj_to_char(obj_data *object, char_data *ch)
|
||||||
{
|
{
|
||||||
if (object && ch) {
|
if (object && ch) {
|
||||||
object->next_content = ch->carrying;
|
object->next_content = ch->carrying;
|
||||||
@@ -437,9 +437,9 @@ void obj_to_char(struct obj_data *object, struct char_data *ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* take an object from a char */
|
/* take an object from a char */
|
||||||
void obj_from_char(struct obj_data *object)
|
void obj_from_char(obj_data *object)
|
||||||
{
|
{
|
||||||
struct obj_data *temp;
|
obj_data *temp;
|
||||||
|
|
||||||
if (object == NULL) {
|
if (object == NULL) {
|
||||||
log("SYSERR: NULL object passed to obj_from_char.");
|
log("SYSERR: NULL object passed to obj_from_char.");
|
||||||
@@ -458,7 +458,7 @@ void obj_from_char(struct obj_data *object)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Return the effect of a piece of armor in position eq_pos */
|
/* Return the effect of a piece of armor in position eq_pos */
|
||||||
static int apply_ac(struct char_data *ch, int eq_pos)
|
static int apply_ac(char_data *ch, int eq_pos)
|
||||||
{
|
{
|
||||||
int factor;
|
int factor;
|
||||||
|
|
||||||
@@ -489,7 +489,7 @@ static int apply_ac(struct char_data *ch, int eq_pos)
|
|||||||
return (factor * GET_OBJ_VAL(GET_EQ(ch, eq_pos), 0));
|
return (factor * GET_OBJ_VAL(GET_EQ(ch, eq_pos), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
int invalid_align(struct char_data *ch, struct obj_data *obj)
|
int invalid_align(char_data *ch, obj_data *obj)
|
||||||
{
|
{
|
||||||
if (OBJ_FLAGGED(obj, ITEM_ANTI_EVIL) && IS_EVIL(ch))
|
if (OBJ_FLAGGED(obj, ITEM_ANTI_EVIL) && IS_EVIL(ch))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -500,7 +500,7 @@ int invalid_align(struct char_data *ch, struct obj_data *obj)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void equip_char(struct char_data *ch, struct obj_data *obj, int pos)
|
void equip_char(char_data *ch, obj_data *obj, int pos)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
@@ -552,10 +552,10 @@ void equip_char(struct char_data *ch, struct obj_data *obj, int pos)
|
|||||||
affect_total(ch);
|
affect_total(ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct obj_data *unequip_char(struct char_data *ch, int pos)
|
obj_data *unequip_char(char_data *ch, int pos)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
struct obj_data *obj;
|
obj_data *obj;
|
||||||
|
|
||||||
if ((pos < 0 || pos >= NUM_WEARS) || GET_EQ(ch, pos) == NULL) {
|
if ((pos < 0 || pos >= NUM_WEARS) || GET_EQ(ch, pos) == NULL) {
|
||||||
core_dump();
|
core_dump();
|
||||||
@@ -611,9 +611,9 @@ int get_number(char **name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Search a given list for an object number, and return a ptr to that obj */
|
/* Search a given list for an object number, and return a ptr to that obj */
|
||||||
struct obj_data *get_obj_in_list_num(int num, struct obj_data *list)
|
obj_data *get_obj_in_list_num(int num, obj_data *list)
|
||||||
{
|
{
|
||||||
struct obj_data *i;
|
obj_data *i;
|
||||||
|
|
||||||
for (i = list; i; i = i->next_content)
|
for (i = list; i; i = i->next_content)
|
||||||
if (GET_OBJ_RNUM(i) == num)
|
if (GET_OBJ_RNUM(i) == num)
|
||||||
@@ -623,9 +623,9 @@ struct obj_data *get_obj_in_list_num(int num, struct obj_data *list)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* search the entire world for an object number, and return a pointer */
|
/* search the entire world for an object number, and return a pointer */
|
||||||
struct obj_data *get_obj_num(obj_rnum nr)
|
obj_data *get_obj_num(obj_rnum nr)
|
||||||
{
|
{
|
||||||
struct obj_data *i;
|
obj_data *i;
|
||||||
|
|
||||||
for (i = object_list; i; i = i->next)
|
for (i = object_list; i; i = i->next)
|
||||||
if (GET_OBJ_RNUM(i) == nr)
|
if (GET_OBJ_RNUM(i) == nr)
|
||||||
@@ -635,9 +635,9 @@ struct obj_data *get_obj_num(obj_rnum nr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* search a room for a char, and return a pointer if found.. */
|
/* search a room for a char, and return a pointer if found.. */
|
||||||
struct char_data *get_char_room(char *name, int *number, room_rnum room)
|
char_data *get_char_room(char *name, int *number, room_rnum room)
|
||||||
{
|
{
|
||||||
struct char_data *i;
|
char_data *i;
|
||||||
int num;
|
int num;
|
||||||
|
|
||||||
if (!number) {
|
if (!number) {
|
||||||
@@ -657,9 +657,9 @@ struct char_data *get_char_room(char *name, int *number, room_rnum room)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* search all over the world for a char num, and return a pointer if found */
|
/* search all over the world for a char num, and return a pointer if found */
|
||||||
struct char_data *get_char_num(mob_rnum nr)
|
char_data *get_char_num(mob_rnum nr)
|
||||||
{
|
{
|
||||||
struct char_data *i;
|
char_data *i;
|
||||||
|
|
||||||
for (i = character_list; i; i = i->next)
|
for (i = character_list; i; i = i->next)
|
||||||
if (GET_MOB_RNUM(i) == nr)
|
if (GET_MOB_RNUM(i) == nr)
|
||||||
@@ -669,14 +669,22 @@ struct char_data *get_char_num(mob_rnum nr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* put an object in a room */
|
/* put an object in a room */
|
||||||
void obj_to_room(struct obj_data *object, room_rnum room)
|
void obj_to_room(obj_data *object, room_rnum room)
|
||||||
{
|
{
|
||||||
if (!object || room == NOWHERE || room > top_of_world)
|
if (!object || room == NOWHERE || room > top_of_world){
|
||||||
log("SYSERR: Illegal value(s) passed to obj_to_room. (Room #%d/%d, obj %p)",
|
log("SYSERR: Illegal value(s) passed to obj_to_room. (Room #%d/%d, obj %p)",
|
||||||
room, top_of_world, (void *)object);
|
room, top_of_world, (void *)object);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
object->next_content = world[room].contents;
|
if (world[room].contents == NULL){ // if list is empty
|
||||||
world[room].contents = object;
|
world[room].contents = object; // add object to list
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
obj_data *i = world[room].contents; // define a temporary pointer
|
||||||
|
while (i->next_content != NULL) i = i->next_content; // find the first without a next_content
|
||||||
|
i->next_content = object; // add object at the end
|
||||||
|
}
|
||||||
|
object->next_content = NULL; // mostly for sanity. should do nothing.
|
||||||
IN_ROOM(object) = room;
|
IN_ROOM(object) = room;
|
||||||
object->carried_by = NULL;
|
object->carried_by = NULL;
|
||||||
if (ROOM_FLAGGED(room, ROOM_HOUSE))
|
if (ROOM_FLAGGED(room, ROOM_HOUSE))
|
||||||
@@ -685,10 +693,10 @@ void obj_to_room(struct obj_data *object, room_rnum room)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Take an object from a room */
|
/* Take an object from a room */
|
||||||
void obj_from_room(struct obj_data *object)
|
void obj_from_room(obj_data *object)
|
||||||
{
|
{
|
||||||
struct obj_data *temp;
|
obj_data *temp;
|
||||||
struct char_data *t, *tempch;
|
char_data *t, *tempch;
|
||||||
|
|
||||||
if (!object || IN_ROOM(object) == NOWHERE) {
|
if (!object || IN_ROOM(object) == NOWHERE) {
|
||||||
log("SYSERR: NULL object (%p) or obj not in a room (%d) passed to obj_from_room",
|
log("SYSERR: NULL object (%p) or obj not in a room (%d) passed to obj_from_room",
|
||||||
@@ -714,9 +722,9 @@ void obj_from_room(struct obj_data *object)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* put an object in an object (quaint) */
|
/* put an object in an object (quaint) */
|
||||||
void obj_to_obj(struct obj_data *obj, struct obj_data *obj_to)
|
void obj_to_obj(obj_data *obj, obj_data *obj_to)
|
||||||
{
|
{
|
||||||
struct obj_data *tmp_obj;
|
obj_data *tmp_obj;
|
||||||
|
|
||||||
if (!obj || !obj_to || obj == obj_to) {
|
if (!obj || !obj_to || obj == obj_to) {
|
||||||
log("SYSERR: NULL object (%p) or same source (%p) and target (%p) obj passed to obj_to_obj.",
|
log("SYSERR: NULL object (%p) or same source (%p) and target (%p) obj passed to obj_to_obj.",
|
||||||
@@ -741,9 +749,9 @@ void obj_to_obj(struct obj_data *obj, struct obj_data *obj_to)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* remove an object from an object */
|
/* remove an object from an object */
|
||||||
void obj_from_obj(struct obj_data *obj)
|
void obj_from_obj(obj_data *obj)
|
||||||
{
|
{
|
||||||
struct obj_data *temp, *obj_from;
|
obj_data *temp, *obj_from;
|
||||||
|
|
||||||
if (obj->in_obj == NULL) {
|
if (obj->in_obj == NULL) {
|
||||||
log("SYSERR: (%s): trying to illegally extract obj from obj.", __FILE__);
|
log("SYSERR: (%s): trying to illegally extract obj from obj.", __FILE__);
|
||||||
@@ -767,7 +775,7 @@ void obj_from_obj(struct obj_data *obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set all carried_by to point to new owner */
|
/* Set all carried_by to point to new owner */
|
||||||
void object_list_new_owner(struct obj_data *list, struct char_data *ch)
|
void object_list_new_owner(obj_data *list, char_data *ch)
|
||||||
{
|
{
|
||||||
if (list) {
|
if (list) {
|
||||||
object_list_new_owner(list->contains, ch);
|
object_list_new_owner(list->contains, ch);
|
||||||
@@ -777,10 +785,10 @@ void object_list_new_owner(struct obj_data *list, struct char_data *ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Extract an object from the world */
|
/* Extract an object from the world */
|
||||||
void extract_obj(struct obj_data *obj)
|
void extract_obj(obj_data *obj)
|
||||||
{
|
{
|
||||||
struct char_data *ch, *next = NULL;
|
char_data *ch, *next = NULL;
|
||||||
struct obj_data *temp;
|
obj_data *temp;
|
||||||
|
|
||||||
if (obj->worn_by != NULL)
|
if (obj->worn_by != NULL)
|
||||||
if (unequip_char(obj->worn_by, obj->worn_on) != obj)
|
if (unequip_char(obj->worn_by, obj->worn_on) != obj)
|
||||||
@@ -832,7 +840,7 @@ void extract_obj(struct obj_data *obj)
|
|||||||
free_obj(obj);
|
free_obj(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void update_object(struct obj_data *obj, int use)
|
static void update_object(obj_data *obj, int use)
|
||||||
{
|
{
|
||||||
/* dont update objects with a timer trigger */
|
/* dont update objects with a timer trigger */
|
||||||
if (!SCRIPT_CHECK(obj, OTRIG_TIMER) && (GET_OBJ_TIMER(obj) > 0))
|
if (!SCRIPT_CHECK(obj, OTRIG_TIMER) && (GET_OBJ_TIMER(obj) > 0))
|
||||||
@@ -843,7 +851,7 @@ static void update_object(struct obj_data *obj, int use)
|
|||||||
update_object(obj->next_content, use);
|
update_object(obj->next_content, use);
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_char_objects(struct char_data *ch)
|
void update_char_objects(char_data *ch)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -870,11 +878,11 @@ void update_char_objects(struct char_data *ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Extract a ch completely from the world, and leave his stuff behind */
|
/* Extract a ch completely from the world, and leave his stuff behind */
|
||||||
void extract_char_final(struct char_data *ch)
|
void extract_char_final(char_data *ch)
|
||||||
{
|
{
|
||||||
struct char_data *k, *temp;
|
char_data *k, *temp;
|
||||||
struct descriptor_data *d;
|
descriptor_data *d;
|
||||||
struct obj_data *obj;
|
obj_data *obj;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (IN_ROOM(ch) == NOWHERE) {
|
if (IN_ROOM(ch) == NOWHERE) {
|
||||||
@@ -993,7 +1001,7 @@ void extract_char_final(struct char_data *ch)
|
|||||||
* Fixed a bug where it would over-count extractions if you try to extract the
|
* Fixed a bug where it would over-count extractions if you try to extract the
|
||||||
* same character twice (e.g. double-purging in a script) -khufu / EmpireMUD
|
* same character twice (e.g. double-purging in a script) -khufu / EmpireMUD
|
||||||
*/
|
*/
|
||||||
void extract_char(struct char_data *ch)
|
void extract_char(char_data *ch)
|
||||||
{
|
{
|
||||||
char_from_furniture(ch);
|
char_from_furniture(ch);
|
||||||
clear_char_event_list(ch);
|
clear_char_event_list(ch);
|
||||||
@@ -1014,7 +1022,7 @@ void extract_char(struct char_data *ch)
|
|||||||
* confusing some code. -gg This doesn't handle recursive extractions. */
|
* confusing some code. -gg This doesn't handle recursive extractions. */
|
||||||
void extract_pending_chars(void)
|
void extract_pending_chars(void)
|
||||||
{
|
{
|
||||||
struct char_data *vict, *next_vict, *prev_vict;
|
char_data *vict, *next_vict, *prev_vict;
|
||||||
|
|
||||||
if (extractions_pending < 0)
|
if (extractions_pending < 0)
|
||||||
log("SYSERR: Negative (%d) extractions pending.", extractions_pending);
|
log("SYSERR: Negative (%d) extractions pending.", extractions_pending);
|
||||||
@@ -1049,9 +1057,9 @@ void extract_pending_chars(void)
|
|||||||
|
|
||||||
/* Here follows high-level versions of some earlier routines, ie functions
|
/* Here follows high-level versions of some earlier routines, ie functions
|
||||||
* which incorporate the actual player-data */
|
* which incorporate the actual player-data */
|
||||||
struct char_data *get_player_vis(struct char_data *ch, char *name, int *number, int inroom)
|
char_data *get_player_vis(char_data *ch, char *name, int *number, int inroom)
|
||||||
{
|
{
|
||||||
struct char_data *i;
|
char_data *i;
|
||||||
int num;
|
int num;
|
||||||
|
|
||||||
if (!number) {
|
if (!number) {
|
||||||
@@ -1076,9 +1084,9 @@ struct char_data *get_player_vis(struct char_data *ch, char *name, int *number,
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct char_data *get_char_room_vis(struct char_data *ch, char *name, int *number)
|
char_data *get_char_room_vis(char_data *ch, char *name, int *number)
|
||||||
{
|
{
|
||||||
struct char_data *i;
|
char_data *i;
|
||||||
int num;
|
int num;
|
||||||
|
|
||||||
if (!number) {
|
if (!number) {
|
||||||
@@ -1103,9 +1111,9 @@ struct char_data *get_char_room_vis(struct char_data *ch, char *name, int *numbe
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct char_data *get_char_world_vis(struct char_data *ch, char *name, int *number)
|
char_data *get_char_world_vis(char_data *ch, char *name, int *number)
|
||||||
{
|
{
|
||||||
struct char_data *i;
|
char_data *i;
|
||||||
int num;
|
int num;
|
||||||
|
|
||||||
if (!number) {
|
if (!number) {
|
||||||
@@ -1134,7 +1142,7 @@ struct char_data *get_char_world_vis(struct char_data *ch, char *name, int *numb
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct char_data *get_char_vis(struct char_data *ch, char *name, int *number, int where)
|
char_data *get_char_vis(char_data *ch, char *name, int *number, int where)
|
||||||
{
|
{
|
||||||
if (where == FIND_CHAR_ROOM)
|
if (where == FIND_CHAR_ROOM)
|
||||||
return get_char_room_vis(ch, name, number);
|
return get_char_room_vis(ch, name, number);
|
||||||
@@ -1144,9 +1152,9 @@ struct char_data *get_char_vis(struct char_data *ch, char *name, int *number, in
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct obj_data *get_obj_in_list_vis(struct char_data *ch, char *name, int *number, struct obj_data *list)
|
obj_data *get_obj_in_list_vis(char_data *ch, char *name, int *number, obj_data *list)
|
||||||
{
|
{
|
||||||
struct obj_data *i;
|
obj_data *i;
|
||||||
int num;
|
int num;
|
||||||
|
|
||||||
if (!number) {
|
if (!number) {
|
||||||
@@ -1167,9 +1175,9 @@ struct obj_data *get_obj_in_list_vis(struct char_data *ch, char *name, int *numb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* search the entire world for an object, and return a pointer */
|
/* search the entire world for an object, and return a pointer */
|
||||||
struct obj_data *get_obj_vis(struct char_data *ch, char *name, int *number)
|
obj_data *get_obj_vis(char_data *ch, char *name, int *number)
|
||||||
{
|
{
|
||||||
struct obj_data *i;
|
obj_data *i;
|
||||||
int num;
|
int num;
|
||||||
|
|
||||||
if (!number) {
|
if (!number) {
|
||||||
@@ -1198,7 +1206,7 @@ struct obj_data *get_obj_vis(struct char_data *ch, char *name, int *number)
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct obj_data *get_obj_in_equip_vis(struct char_data *ch, char *arg, int *number, struct obj_data *equipment[])
|
obj_data *get_obj_in_equip_vis(char_data *ch, char *arg, int *number, obj_data *equipment[])
|
||||||
{
|
{
|
||||||
int j, num;
|
int j, num;
|
||||||
|
|
||||||
@@ -1218,7 +1226,7 @@ struct obj_data *get_obj_in_equip_vis(struct char_data *ch, char *arg, int *numb
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int get_obj_pos_in_equip_vis(struct char_data *ch, char *arg, int *number, struct obj_data *equipment[])
|
int get_obj_pos_in_equip_vis(char_data *ch, char *arg, int *number, obj_data *equipment[])
|
||||||
{
|
{
|
||||||
int j, num;
|
int j, num;
|
||||||
|
|
||||||
@@ -1274,9 +1282,9 @@ const char *money_desc(int amount)
|
|||||||
return ("an absolutely colossal mountain of gold coins");
|
return ("an absolutely colossal mountain of gold coins");
|
||||||
}
|
}
|
||||||
|
|
||||||
struct obj_data *create_money(int amount)
|
obj_data *create_money(int amount)
|
||||||
{
|
{
|
||||||
struct obj_data *obj;
|
obj_data *obj;
|
||||||
struct extra_descr_data *new_descr;
|
struct extra_descr_data *new_descr;
|
||||||
char buf[200];
|
char buf[200];
|
||||||
int y;
|
int y;
|
||||||
@@ -1342,8 +1350,8 @@ struct obj_data *create_money(int amount)
|
|||||||
* The routine used to return a pointer to the next word in *arg (just
|
* The routine used to return a pointer to the next word in *arg (just
|
||||||
* like the one_argument routine), but now it returns an integer that
|
* like the one_argument routine), but now it returns an integer that
|
||||||
* describes what it filled in. */
|
* describes what it filled in. */
|
||||||
int generic_find(char *arg, bitvector_t bitvector, struct char_data *ch,
|
int generic_find(char *arg, bitvector_t bitvector, char_data *ch,
|
||||||
struct char_data **tar_ch, struct obj_data **tar_obj)
|
char_data **tar_ch, obj_data **tar_obj)
|
||||||
{
|
{
|
||||||
int i, found, number;
|
int i, found, number;
|
||||||
char name_val[MAX_INPUT_LENGTH];
|
char name_val[MAX_INPUT_LENGTH];
|
||||||
@@ -1410,7 +1418,7 @@ int find_all_dots(char *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Group Handlers */
|
/* Group Handlers */
|
||||||
struct group_data * create_group(struct char_data * leader)
|
struct group_data * create_group(char_data * leader)
|
||||||
{
|
{
|
||||||
struct group_data * new_group;
|
struct group_data * new_group;
|
||||||
|
|
||||||
@@ -1437,11 +1445,11 @@ struct group_data * create_group(struct char_data * leader)
|
|||||||
|
|
||||||
void free_group(struct group_data * group)
|
void free_group(struct group_data * group)
|
||||||
{
|
{
|
||||||
struct char_data *tch;
|
char_data *tch;
|
||||||
struct iterator_data Iterator;
|
struct iterator_data Iterator;
|
||||||
|
|
||||||
if (group->members->iSize) {
|
if (group->members->iSize) {
|
||||||
for (tch = (struct char_data *) merge_iterator(&Iterator, group->members);
|
for (tch = (char_data *) merge_iterator(&Iterator, group->members);
|
||||||
tch;
|
tch;
|
||||||
tch = next_in_list(&Iterator))
|
tch = next_in_list(&Iterator))
|
||||||
leave_group(tch);
|
leave_group(tch);
|
||||||
@@ -1454,10 +1462,10 @@ void free_group(struct group_data * group)
|
|||||||
free(group);
|
free(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
void leave_group(struct char_data *ch)
|
void leave_group(char_data *ch)
|
||||||
{
|
{
|
||||||
struct group_data *group;
|
struct group_data *group;
|
||||||
struct char_data *tch;
|
char_data *tch;
|
||||||
struct iterator_data Iterator;
|
struct iterator_data Iterator;
|
||||||
bool found_pc = FALSE;
|
bool found_pc = FALSE;
|
||||||
|
|
||||||
@@ -1470,7 +1478,7 @@ void leave_group(struct char_data *ch)
|
|||||||
ch->group = NULL;
|
ch->group = NULL;
|
||||||
|
|
||||||
if (group->members->iSize) {
|
if (group->members->iSize) {
|
||||||
for (tch = (struct char_data *) merge_iterator(&Iterator, group->members);
|
for (tch = (char_data *) merge_iterator(&Iterator, group->members);
|
||||||
tch; tch = next_in_list(&Iterator))
|
tch; tch = next_in_list(&Iterator))
|
||||||
if (!IS_NPC(tch))
|
if (!IS_NPC(tch))
|
||||||
found_pc = TRUE;
|
found_pc = TRUE;
|
||||||
@@ -1482,13 +1490,13 @@ void leave_group(struct char_data *ch)
|
|||||||
SET_BIT(GROUP_FLAGS(group), GROUP_NPC);
|
SET_BIT(GROUP_FLAGS(group), GROUP_NPC);
|
||||||
|
|
||||||
if (GROUP_LEADER(group) == ch && group->members->iSize) {
|
if (GROUP_LEADER(group) == ch && group->members->iSize) {
|
||||||
group->leader = (struct char_data *) random_from_list(group->members);
|
group->leader = (char_data *) random_from_list(group->members);
|
||||||
send_to_group(NULL, group, "%s has assumed leadership of the group.\r\n", GET_NAME(GROUP_LEADER(group)));
|
send_to_group(NULL, group, "%s has assumed leadership of the group.\r\n", GET_NAME(GROUP_LEADER(group)));
|
||||||
} else if (group->members->iSize == 0)
|
} else if (group->members->iSize == 0)
|
||||||
free_group(group);
|
free_group(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
void join_group(struct char_data *ch, struct group_data *group)
|
void join_group(char_data *ch, struct group_data *group)
|
||||||
{
|
{
|
||||||
add_to_list(ch, group->members);
|
add_to_list(ch, group->members);
|
||||||
|
|
||||||
|
|||||||
+59
-61
@@ -13,79 +13,77 @@
|
|||||||
#define _HANDLER_H_
|
#define _HANDLER_H_
|
||||||
|
|
||||||
/* handling the affected-structures */
|
/* handling the affected-structures */
|
||||||
void affect_total(struct char_data *ch);
|
void affect_total(char_data *ch);
|
||||||
void affect_to_char(struct char_data *ch, struct affected_type *af);
|
void affect_to_char(char_data *ch, struct affected_type *af);
|
||||||
void affect_remove(struct char_data *ch, struct affected_type *af);
|
void affect_remove(char_data *ch, struct affected_type *af);
|
||||||
void affect_from_char(struct char_data *ch, int type);
|
void affect_from_char(char_data *ch, int type);
|
||||||
bool affected_by_spell(struct char_data *ch, int type);
|
bool affected_by_spell(char_data *ch, int type);
|
||||||
void affect_join(struct char_data *ch, struct affected_type *af,
|
void affect_join(char_data *ch, struct affected_type *af, bool add_dur, bool avg_dur, bool add_mod, bool avg_mod);
|
||||||
bool add_dur, bool avg_dur, bool add_mod, bool avg_mod);
|
|
||||||
|
|
||||||
/* utility */
|
/* utility */
|
||||||
const char *money_desc(int amount);
|
const char *money_desc(int amount);
|
||||||
struct obj_data *create_money(int amount);
|
obj_data *create_money(int amount);
|
||||||
int isname(const char *str, const char *namelist);
|
int isname(const char *str, const char *namelist);
|
||||||
int is_name(const char *str, const char *namelist);
|
int is_name(const char *str, const char *namelist);
|
||||||
char *fname(const char *namelist);
|
char *fname(const char *namelist);
|
||||||
int get_number(char **name);
|
int get_number(char **name);
|
||||||
|
|
||||||
/* objects */
|
/* objects */
|
||||||
void obj_to_char(struct obj_data *object, struct char_data *ch);
|
void obj_to_char(obj_data *object, char_data *ch);
|
||||||
void obj_from_char(struct obj_data *object);
|
void obj_from_char(obj_data *object);
|
||||||
|
|
||||||
void equip_char(struct char_data *ch, struct obj_data *obj, int pos);
|
void equip_char(char_data *ch, obj_data *obj, int pos);
|
||||||
struct obj_data *unequip_char(struct char_data *ch, int pos);
|
obj_data *unequip_char(char_data *ch, int pos);
|
||||||
int invalid_align(struct char_data *ch, struct obj_data *obj);
|
int invalid_align(char_data *ch, obj_data *obj);
|
||||||
|
|
||||||
void obj_to_room(struct obj_data *object, room_rnum room);
|
void obj_to_room(obj_data *object, room_rnum room);
|
||||||
void obj_from_room(struct obj_data *object);
|
void obj_from_room(obj_data *object);
|
||||||
void obj_to_obj(struct obj_data *obj, struct obj_data *obj_to);
|
void obj_to_obj(obj_data *obj, obj_data *obj_to);
|
||||||
void obj_from_obj(struct obj_data *obj);
|
void obj_from_obj(obj_data *obj);
|
||||||
void object_list_new_owner(struct obj_data *list, struct char_data *ch);
|
void object_list_new_owner(obj_data *list, char_data *ch);
|
||||||
|
|
||||||
void extract_obj(struct obj_data *obj);
|
void extract_obj(obj_data *obj);
|
||||||
|
|
||||||
void update_char_objects(struct char_data *ch);
|
void update_char_objects(char_data *ch);
|
||||||
|
|
||||||
/* characters*/
|
/* characters*/
|
||||||
struct char_data *get_char_room(char *name, int *num, room_rnum room);
|
char_data *get_char_room(char *name, int *num, room_rnum room);
|
||||||
struct char_data *get_char_num(mob_rnum nr);
|
char_data *get_char_num(mob_rnum nr);
|
||||||
|
|
||||||
void char_from_room(struct char_data *ch);
|
void char_from_room(char_data *ch);
|
||||||
void char_to_room(struct char_data *ch, room_rnum room);
|
void char_to_room(char_data *ch, room_rnum room);
|
||||||
void extract_char(struct char_data *ch);
|
void extract_char(char_data *ch);
|
||||||
void extract_char_final(struct char_data *ch);
|
void extract_char_final(char_data *ch);
|
||||||
void extract_pending_chars(void);
|
void extract_pending_chars(void);
|
||||||
|
|
||||||
/* find if character can see */
|
/* find if character can see */
|
||||||
struct char_data *get_player_vis(struct char_data *ch, char *name, int *number, int inroom);
|
char_data *get_player_vis(char_data *ch, char *name, int *number, int inroom);
|
||||||
struct char_data *get_char_vis(struct char_data *ch, char *name, int *number, int where);
|
char_data *get_char_vis(char_data *ch, char *name, int *number, int where);
|
||||||
struct char_data *get_char_room_vis(struct char_data *ch, char *name, int *number);
|
char_data *get_char_room_vis(char_data *ch, char *name, int *number);
|
||||||
struct char_data *get_char_world_vis(struct char_data *ch, char *name, int *number);
|
char_data *get_char_world_vis(char_data *ch, char *name, int *number);
|
||||||
|
|
||||||
struct obj_data *get_obj_in_list_num(int num, struct obj_data *list);
|
obj_data *get_obj_in_list_num(int num, obj_data *list);
|
||||||
struct obj_data *get_obj_num(obj_rnum nr);
|
obj_data *get_obj_num(obj_rnum nr);
|
||||||
struct obj_data *get_obj_in_list_vis(struct char_data *ch, char *name, int *number, struct obj_data *list);
|
obj_data *get_obj_in_list_vis(char_data *ch, char *name, int *number, obj_data *list);
|
||||||
struct obj_data *get_obj_vis(struct char_data *ch, char *name, int *num);
|
obj_data *get_obj_vis(char_data *ch, char *name, int *num);
|
||||||
struct obj_data *get_obj_in_equip_vis(struct char_data *ch, char *arg, int *number, struct obj_data *equipment[]);
|
obj_data *get_obj_in_equip_vis(char_data *ch, char *arg, int *number, obj_data *equipment[]);
|
||||||
int get_obj_pos_in_equip_vis(struct char_data *ch, char *arg, int *num, struct obj_data *equipment[]);
|
int get_obj_pos_in_equip_vis(char_data *ch, char *arg, int *num, obj_data *equipment[]);
|
||||||
|
|
||||||
/* find all dots */
|
/* find all dots */
|
||||||
int find_all_dots(char *arg);
|
int find_all_dots(char *arg);
|
||||||
|
|
||||||
#define FIND_INDIV 0
|
#define FIND_INDIV 0
|
||||||
#define FIND_ALL 1
|
#define FIND_ALL 1
|
||||||
#define FIND_ALLDOT 2
|
#define FIND_ALLDOT 2
|
||||||
|
|
||||||
/* group */
|
/* group */
|
||||||
struct group_data * create_group(struct char_data * leader);
|
struct group_data * create_group(char_data * leader);
|
||||||
void free_group(struct group_data * group);
|
void free_group(struct group_data * group);
|
||||||
void leave_group(struct char_data *ch);
|
void leave_group(char_data *ch);
|
||||||
void join_group(struct char_data *ch, struct group_data *group);
|
void join_group(char_data *ch, struct group_data *group);
|
||||||
|
|
||||||
/* Generic Find */
|
/* Generic Find */
|
||||||
int generic_find(char *arg, bitvector_t bitvector, struct char_data *ch,
|
int generic_find(char *arg, bitvector_t bitvector, char_data *ch, char_data **tar_ch, obj_data **tar_obj);
|
||||||
struct char_data **tar_ch, struct obj_data **tar_obj);
|
|
||||||
|
|
||||||
#define FIND_CHAR_ROOM (1 << 0)
|
#define FIND_CHAR_ROOM (1 << 0)
|
||||||
#define FIND_CHAR_WORLD (1 << 1)
|
#define FIND_CHAR_WORLD (1 << 1)
|
||||||
@@ -96,10 +94,10 @@ int generic_find(char *arg, bitvector_t bitvector, struct char_data *ch,
|
|||||||
|
|
||||||
|
|
||||||
/* prototypes from mobact.c */
|
/* prototypes from mobact.c */
|
||||||
void forget(struct char_data *ch, struct char_data *victim);
|
void forget(char_data *ch, char_data *victim);
|
||||||
void remember(struct char_data *ch, struct char_data *victim);
|
void remember(char_data *ch, char_data *victim);
|
||||||
void mobile_activity(void);
|
void mobile_activity(void);
|
||||||
void clearMemory(struct char_data *ch);
|
void clearMemory(char_data *ch);
|
||||||
|
|
||||||
|
|
||||||
/* For new last command: */
|
/* For new last command: */
|
||||||
@@ -118,16 +116,16 @@ void clearMemory(struct char_data *ch);
|
|||||||
#define LAST_PLAYING 10
|
#define LAST_PLAYING 10
|
||||||
|
|
||||||
struct last_entry {
|
struct last_entry {
|
||||||
int close_type;
|
int close_type;
|
||||||
char hostname[256];
|
char hostname[256];
|
||||||
char username[16];
|
char username[16];
|
||||||
time_t time;
|
time_t time;
|
||||||
time_t close_time;
|
time_t close_time;
|
||||||
int idnum;
|
int idnum;
|
||||||
int punique;
|
int punique;
|
||||||
};
|
};
|
||||||
|
|
||||||
void add_llog_entry(struct char_data *ch, int type);
|
void add_llog_entry(char_data *ch, int type);
|
||||||
struct last_entry *find_llog_entry(int punique, long idnum);
|
struct last_entry *find_llog_entry(int punique, long idnum);
|
||||||
|
|
||||||
#endif /* _HANDLER_H_ */
|
#endif /* _HANDLER_H_ */
|
||||||
|
|||||||
+13
-13
@@ -26,17 +26,17 @@
|
|||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
|
|
||||||
/* local functions */
|
/* local functions */
|
||||||
static void hedit_disp_menu(struct descriptor_data *);
|
static void hedit_disp_menu(descriptor_data *);
|
||||||
static void hedit_setup_new(struct descriptor_data *);
|
static void hedit_setup_new(descriptor_data *);
|
||||||
static void hedit_setup_existing(struct descriptor_data *, int);
|
static void hedit_setup_existing(descriptor_data *, int);
|
||||||
static void hedit_save_to_disk(struct descriptor_data *);
|
static void hedit_save_to_disk(descriptor_data *);
|
||||||
static void hedit_save_internally(struct descriptor_data *);
|
static void hedit_save_internally(descriptor_data *);
|
||||||
|
|
||||||
|
|
||||||
ACMD(do_oasis_hedit)
|
ACMD(do_oasis_hedit)
|
||||||
{
|
{
|
||||||
char arg[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH];
|
||||||
struct descriptor_data *d;
|
descriptor_data *d;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* No building as a mob or while being forced. */
|
/* No building as a mob or while being forced. */
|
||||||
@@ -107,7 +107,7 @@ ACMD(do_oasis_hedit)
|
|||||||
TRUE, "OLC: %s starts editing help files.", GET_NAME(d->character));
|
TRUE, "OLC: %s starts editing help files.", GET_NAME(d->character));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hedit_setup_new(struct descriptor_data *d)
|
static void hedit_setup_new(descriptor_data *d)
|
||||||
{
|
{
|
||||||
CREATE(OLC_HELP(d), struct help_index_element, 1);
|
CREATE(OLC_HELP(d), struct help_index_element, 1);
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ static void hedit_setup_new(struct descriptor_data *d)
|
|||||||
hedit_disp_menu(d);
|
hedit_disp_menu(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hedit_setup_existing(struct descriptor_data *d, int rnum)
|
static void hedit_setup_existing(descriptor_data *d, int rnum)
|
||||||
{
|
{
|
||||||
CREATE(OLC_HELP(d), struct help_index_element, 1);
|
CREATE(OLC_HELP(d), struct help_index_element, 1);
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ static void hedit_setup_existing(struct descriptor_data *d, int rnum)
|
|||||||
hedit_disp_menu(d);
|
hedit_disp_menu(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hedit_save_internally(struct descriptor_data *d)
|
static void hedit_save_internally(descriptor_data *d)
|
||||||
{
|
{
|
||||||
struct help_index_element *new_help_table = NULL;
|
struct help_index_element *new_help_table = NULL;
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ static void hedit_save_internally(struct descriptor_data *d)
|
|||||||
hedit_save_to_disk(d);
|
hedit_save_to_disk(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hedit_save_to_disk(struct descriptor_data *d)
|
static void hedit_save_to_disk(descriptor_data *d)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char buf1[MAX_STRING_LENGTH], index_name[READ_SIZE];
|
char buf1[MAX_STRING_LENGTH], index_name[READ_SIZE];
|
||||||
@@ -187,7 +187,7 @@ static void hedit_save_to_disk(struct descriptor_data *d)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The main menu. */
|
/* The main menu. */
|
||||||
static void hedit_disp_menu(struct descriptor_data *d)
|
static void hedit_disp_menu(descriptor_data *d)
|
||||||
{
|
{
|
||||||
get_char_colors(d->character);
|
get_char_colors(d->character);
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@ static void hedit_disp_menu(struct descriptor_data *d)
|
|||||||
OLC_MODE(d) = HEDIT_MAIN_MENU;
|
OLC_MODE(d) = HEDIT_MAIN_MENU;
|
||||||
}
|
}
|
||||||
|
|
||||||
void hedit_parse(struct descriptor_data *d, char *arg)
|
void hedit_parse(descriptor_data *d, char *arg)
|
||||||
{
|
{
|
||||||
char buf[MAX_STRING_LENGTH];
|
char buf[MAX_STRING_LENGTH];
|
||||||
char *oldtext = "";
|
char *oldtext = "";
|
||||||
@@ -357,7 +357,7 @@ void hedit_parse(struct descriptor_data *d, char *arg)
|
|||||||
hedit_disp_menu(d);
|
hedit_disp_menu(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
void hedit_string_cleanup(struct descriptor_data *d, int terminator)
|
void hedit_string_cleanup(descriptor_data *d, int terminator)
|
||||||
{
|
{
|
||||||
switch (OLC_MODE(d)) {
|
switch (OLC_MODE(d)) {
|
||||||
case HEDIT_ENTRY:
|
case HEDIT_ENTRY:
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user