From 033373a5a75599f8607107cb28b97cc6a653b0b5 Mon Sep 17 00:00:00 2001 From: ai4rei Date: Fri, 7 Oct 2011 21:35:12 +0000 Subject: * Merged changes from trunk [14895:14966/trunk]. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/renewal@14967 54d463be-8e91-2dee-dedb-b68131a5f0ec --- 3rdparty/CMakeLists.txt | 1 + 3rdparty/cmake/FindFunctionLibrary.cmake | 47 + 3rdparty/cmake/FindMYSQL.cmake | 37 + 3rdparty/cmake/FindPCRE.cmake | 36 + 3rdparty/msinttypes/CMakeLists.txt | 5 +- 3rdparty/msinttypes/include/stdint.h | 4 + 3rdparty/mysql/CMakeLists.txt | 1 - 3rdparty/mysql/FindMYSQL.cmake | 35 - 3rdparty/pcre/CMakeLists.txt | 1 - 3rdparty/pcre/FindPCRE.cmake | 35 - 3rdparty/pcre/lib/libpcre.dll.a | Bin 0 -> 19068 bytes CMakeLists.txt | 426 +++- Changelog-Renewal.txt | 2 + conf/Changelog.txt | 2 + conf/battle/client.conf | 8 + conf/mapflag/reset.txt | 42 + conf/mapflag/restricted.txt | 41 + configure | 49 + configure.in | 16 + db/Changelog.txt | 17 + db/item_noequip.txt | 73 +- db/mob_skill_db.txt | 40 +- db/packet_db.txt | 2 +- db/skill_cast_db.txt | 2 +- db/skill_nocast_db.txt | 36 +- doc/script_commands.txt | 43 +- npc/Changelog.txt | 10 + npc/cities/alberta.txt | 2 +- npc/guides/guides_brasilis.txt | 21 +- npc/instances/NydhoggsNest.txt | 10 +- npc/jobs/2-1/blacksmith.txt | 2 +- npc/jobs/2-2/sage.txt | 3 +- npc/quests/first_class/tu_archer.txt | 2 +- npc/quests/quests_amatsu.txt | 2 +- npc/quests/quests_brasilis.txt | 10 +- npc/quests/quests_hugel.txt | 18 +- npc/scripts_mapflags.conf | 1 + sql-files/item_db.sql | 4021 +++++++++++++++++------------- sql-files/mob_db.sql | 4 +- src/CMakeLists.txt | 22 +- src/char/CMakeLists.txt | 56 +- src/char/char.c | 42 +- src/char_sql/CMakeLists.txt | 23 +- src/char_sql/char.c | 125 +- src/char_sql/int_quest.c | 5 +- src/common/CMakeLists.txt | 22 +- src/common/cbasetypes.h | 39 + src/common/core.c | 4 - src/common/db.h | 6 +- src/common/grfio.c | 8 +- src/common/grfio.h | 4 +- src/common/malloc.c | 133 +- src/common/malloc.h | 102 +- src/common/plugin.h | 2 +- src/common/socket.c | 53 +- src/common/strlib.c | 4 +- src/login/CMakeLists.txt | 4 +- src/login/account_txt.c | 8 +- src/login/sql/CMakeLists.txt | 34 +- src/login/txt/CMakeLists.txt | 34 +- src/map/CMakeLists.txt | 4 +- src/map/atcommand.c | 18 +- src/map/battle.c | 1 + src/map/battle.h | 1 + src/map/chrif.c | 2 + src/map/clif.c | 248 +- src/map/clif.h | 5 +- src/map/itemdb.h | 2 +- src/map/map.c | 10 +- src/map/map.h | 1 + src/map/mob.c | 38 +- src/map/npc.c | 4 +- src/map/npc_chat.c | 14 +- src/map/pc.c | 86 +- src/map/pc.h | 2 - src/map/script.c | 73 +- src/map/searchstore.c | 4 +- src/map/skill.c | 90 +- src/map/sql/CMakeLists.txt | 166 +- src/map/status.c | 178 +- src/map/status.h | 3 +- src/map/txt/CMakeLists.txt | 166 +- src/map/unit.c | 31 +- src/plugins/CMakeLists.txt | 180 ++ src/plugins/sig.c | 7 +- src/tool/CMakeLists.txt | 21 +- src/tool/mapcache.c | 2 +- src/txt-converter/CMakeLists.txt | 17 + src/txt-converter/char/CMakeLists.txt | 76 + src/txt-converter/login/CMakeLists.txt | 60 + 90 files changed, 4557 insertions(+), 2790 deletions(-) create mode 100644 3rdparty/cmake/FindFunctionLibrary.cmake create mode 100644 3rdparty/cmake/FindMYSQL.cmake create mode 100644 3rdparty/cmake/FindPCRE.cmake delete mode 100644 3rdparty/mysql/FindMYSQL.cmake delete mode 100644 3rdparty/pcre/FindPCRE.cmake create mode 100644 3rdparty/pcre/lib/libpcre.dll.a create mode 100644 conf/mapflag/reset.txt create mode 100644 src/plugins/CMakeLists.txt create mode 100644 src/txt-converter/CMakeLists.txt create mode 100644 src/txt-converter/char/CMakeLists.txt create mode 100644 src/txt-converter/login/CMakeLists.txt diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 3e7cb4cc4..ebbac481a 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -47,6 +47,7 @@ macro( CONFIGURE_WITH_LOCAL_OR_SYSTEM name ) endmacro( CONFIGURE_WITH_LOCAL_OR_SYSTEM ) +set( CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake CACHE INTERNAL "" ) add_subdirectory( msinttypes ) add_subdirectory( mt19937ar ) add_subdirectory( mysql ) diff --git a/3rdparty/cmake/FindFunctionLibrary.cmake b/3rdparty/cmake/FindFunctionLibrary.cmake new file mode 100644 index 000000000..f1d32001e --- /dev/null +++ b/3rdparty/cmake/FindFunctionLibrary.cmake @@ -0,0 +1,47 @@ +# - Check which library is needed to link a C function +# find_function_library( [ ...] ) +# +# Check which library provides the . +# Sets to 0 if found in the global libraries. +# Sets to the library path if found in the provided libraries. +# Raises a FATAL_ERROR if not found. +# +# The following variables may be set before calling this macro to +# modify the way the check is run: +# +# CMAKE_REQUIRED_FLAGS = string of compile command line flags +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) +# CMAKE_REQUIRED_INCLUDES = list of include directories +# CMAKE_REQUIRED_LIBRARIES = list of libraries to link +include( CheckFunctionExists ) + +macro( find_function_library FUNC VAR ) + if( "${VAR}" MATCHES "^${VAR}$" ) + CHECK_FUNCTION_EXISTS( ${FUNC} ${VAR} ) + if( ${VAR} ) + message( STATUS "Found ${FUNC} in global libraries" ) + set( ${VAR} 0 CACHE INTERNAL "Found ${FUNC} in global libraries" )# global + else() + foreach( LIB IN ITEMS ${ARGN} ) + message( STATUS "Looking for ${FUNC} in ${LIB}" ) + find_library( ${LIB}_LIBRARY ${LIB} ) + mark_as_advanced( ${LIB}_LIBRARY ) + if( ${LIB}_LIBRARY ) + unset( ${VAR} CACHE ) + set( CMAKE_REQUIRED_LIBRARIES ${${LIB}_LIBRARY} ) + CHECK_FUNCTION_EXISTS( ${FUNC} ${VAR} ) + set( CMAKE_REQUIRED_LIBRARIES ) + if( ${VAR} ) + message( STATUS "Found ${FUNC} in ${LIB}: ${${LIB}_LIBRARY}" ) + set( ${VAR} ${${LIB}_LIBRARY} CACHE INTERNAL "Found ${FUNC} in ${LIB}" )# lib + break() + endif() + endif() + endforeach() + if( NOT ${VAR} ) + message( FATAL_ERROR "Function ${FUNC} not found" ) + endif() + endif() + endif() +endmacro( find_function_library ) + diff --git a/3rdparty/cmake/FindMYSQL.cmake b/3rdparty/cmake/FindMYSQL.cmake new file mode 100644 index 000000000..c18e8d637 --- /dev/null +++ b/3rdparty/cmake/FindMYSQL.cmake @@ -0,0 +1,37 @@ +# - Find mysqlclient +# Find the native MySQL includes and library +# +# MYSQL_INCLUDE_DIRS - where to find mysql.h, etc. +# MYSQL_LIBRARIES - mysqlclient library. +# MYSQL_FOUND - True if mysqlclient is found. +# + +find_path( MYSQL_INCLUDE_DIRS "mysql.h" + PATHS + "/usr/include/mysql" + "/usr/local/include/mysql" + "/usr/mysql/include/mysql" + "$ENV{PROGRAMFILES}/MySQL/*/include" + "$ENV{SYSTEMDRIVE}/MySQL/*/include" ) + +find_library( MYSQL_LIBRARIES + NAMES "mysqlclient" "mysqlclient_r" + PATHS + "/usr/lib/mysql" + "/usr/local/lib/mysql" + "/usr/mysql/lib/mysql" + "$ENV{PROGRAMFILES}/MySQL/*/lib" + "$ENV{SYSTEMDRIVE}/MySQL/*/lib" ) +mark_as_advanced( MYSQL_LIBRARIES MYSQL_INCLUDE_DIRS ) + +if( MYSQL_INCLUDE_DIRS AND EXISTS "${MYSQL_INCLUDE_DIRS}/mysql_version.h" ) + file( STRINGS "${MYSQL_INCLUDE_DIRS}/mysql_version.h" MYSQL_VERSION_H REGEX "^#define[ \t]+MYSQL_SERVER_VERSION[ \t]+\"[^\"]+\".*$" ) + string( REGEX REPLACE "^.*MYSQL_SERVER_VERSION[ \t]+\"([^\"]+)\".*$" "\\1" MYSQL_VERSION_STRING "${MYSQL_VERSION_H}" ) +endif() + +# handle the QUIETLY and REQUIRED arguments and set MYSQL_FOUND to TRUE if +# all listed variables are TRUE +include( FindPackageHandleStandardArgs ) +FIND_PACKAGE_HANDLE_STANDARD_ARGS( MYSQL + REQUIRED_VARS MYSQL_LIBRARIES MYSQL_INCLUDE_DIRS + VERSION_VAR MYSQL_VERSION_STRING ) diff --git a/3rdparty/cmake/FindPCRE.cmake b/3rdparty/cmake/FindPCRE.cmake new file mode 100644 index 000000000..2215451d1 --- /dev/null +++ b/3rdparty/cmake/FindPCRE.cmake @@ -0,0 +1,36 @@ +# - Find pcre +# Find the native PCRE includes and library +# +# PCRE_INCLUDE_DIRS - where to find pcre.h +# PCRE_LIBRARIES - List of libraries when using pcre. +# PCRE_FOUND - True if pcre found. + + +find_path( PCRE_INCLUDE_DIR pcre.h + PATHS + "/usr/include/pcre" ) +set( PCRE_NAMES pcre ) +find_library( PCRE_LIBRARY NAMES ${PCRE_NAMES} ) +mark_as_advanced( PCRE_LIBRARY PCRE_INCLUDE_DIR ) + +if( PCRE_INCLUDE_DIR AND EXISTS "${PCRE_INCLUDE_DIR}/pcre.h" ) + file( STRINGS "${PCRE_INCLUDE_DIR}/pcre.h" PCRE_H REGEX "^#define[ \t]+PCRE_M[A-Z]+[ \t]+[0-9]+.*$" ) + string( REGEX REPLACE "^.*PCRE_MAJOR[ \t]+([0-9]+).*$" "\\1" PCRE_MAJOR "${PCRE_H}" ) + string( REGEX REPLACE "^.*PCRE_MINOR[ \t]+([0-9]+).*$" "\\1" PCRE_MINOR "${PCRE_H}" ) + + set( PCRE_VERSION_STRING "${PCRE_MAJOR}.${PCRE_MINOR}" ) + set( PCRE_VERSION_MAJOR "${PCRE_MAJOR}" ) + set( PCRE_VERSION_MINOR "${PCRE_MINOR}" ) +endif() + +# handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if +# all listed variables are TRUE +include( FindPackageHandleStandardArgs ) +FIND_PACKAGE_HANDLE_STANDARD_ARGS( PCRE + REQUIRED_VARS PCRE_LIBRARY PCRE_INCLUDE_DIR + VERSION_VAR PCRE_VERSION_STRING ) + +if( PCRE_FOUND ) + set( PCRE_LIBRARIES ${PCRE_LIBRARY} ) + set( PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR} ) +endif() diff --git a/3rdparty/msinttypes/CMakeLists.txt b/3rdparty/msinttypes/CMakeLists.txt index f17c6f596..c11c1d72a 100644 --- a/3rdparty/msinttypes/CMakeLists.txt +++ b/3rdparty/msinttypes/CMakeLists.txt @@ -1,8 +1,9 @@ -if( WIN32 ) +if( MSVC ) find_path( MSINTTYPES_INCLUDE_DIRS "inttypes.h" PATHS "${CMAKE_CURRENT_SOURCE_DIR}/include" NO_DEFAULT_PATH ) mark_as_advanced( MSINTTYPES_INCLUDE_DIRS ) -set( GLOBAL_INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${MSINTTYPES_INCLUDE_DIRS} CACHE INTERNAL "" ) +message( STATUS "Adding global include directory: ${MSINTTYPES_INCLUDE_DIRS}" ) +set_property( CACHE GLOBAL_INCLUDE_DIRS PROPERTY VALUE ${GLOBAL_INCLUDE_DIRS} ${MSINTTYPES_INCLUDE_DIRS} ) endif() diff --git a/3rdparty/msinttypes/include/stdint.h b/3rdparty/msinttypes/include/stdint.h index d02608a59..cbb023bf9 100644 --- a/3rdparty/msinttypes/include/stdint.h +++ b/3rdparty/msinttypes/include/stdint.h @@ -47,8 +47,12 @@ // or compiler give many errors like this: // error C2733: second C linkage of overloaded function 'wmemchr' not allowed #ifdef __cplusplus +#if _MSC_VER < 1300 +extern "C++" { +#else extern "C" { #endif +#endif # include #ifdef __cplusplus } diff --git a/3rdparty/mysql/CMakeLists.txt b/3rdparty/mysql/CMakeLists.txt index f4996907f..e85fd626d 100644 --- a/3rdparty/mysql/CMakeLists.txt +++ b/3rdparty/mysql/CMakeLists.txt @@ -44,7 +44,6 @@ endif( WIN32 ) message( STATUS "Detecting system MYSQL" ) unset( MYSQL_LIBRARIES CACHE ) unset( MYSQL_INCLUDE_DIRS CACHE ) -set( CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_MODULE_PATH} ) find_package( MYSQL ) set( MYSQL_SYSTEM_LIBRARIES "${MYSQL_LIBRARIES}" CACHE PATH "system mysql libraries" ) diff --git a/3rdparty/mysql/FindMYSQL.cmake b/3rdparty/mysql/FindMYSQL.cmake deleted file mode 100644 index 0a07f3612..000000000 --- a/3rdparty/mysql/FindMYSQL.cmake +++ /dev/null @@ -1,35 +0,0 @@ -# - Find mysqlclient -# Find the native MySQL includes and library -# -# MYSQL_INCLUDE_DIRS - where to find mysql.h, etc. -# MYSQL_LIBRARIES - mysqlclient library. -# MYSQL_FOUND - True if mysqlclient is found. -# - -find_path( MYSQL_INCLUDE_DIRS "mysql.h" - PATHS - "/usr/include/mysql" - "/usr/local/include/mysql" - "$ENV{PROGRAMFILES}/MySQL/*/include" - "$ENV{SYSTEMDRIVE}/MySQL/*/include" ) - -find_library( MYSQL_LIBRARIES - NAMES "mysqlclient" "mysqlclient_r" - PATHS - "/usr/lib/mysql" - "/usr/local/lib/mysql" - "$ENV{PROGRAMFILES}/MySQL/*/lib" - "$ENV{SYSTEMDRIVE}/MySQL/*/lib" ) -mark_as_advanced( MYSQL_LIBRARIES MYSQL_INCLUDE_DIRS ) - -if( MYSQL_INCLUDE_DIRS AND EXISTS "${MYSQL_INCLUDE_DIRS}/mysql_version.h" ) - file( STRINGS "${MYSQL_INCLUDE_DIRS}/mysql_version.h" MYSQL_VERSION_H REGEX "^#define[ \t]+MYSQL_SERVER_VERSION[ \t]+\"[^\"]+\".*$" ) - string( REGEX REPLACE "^.*MYSQL_SERVER_VERSION[ \t]+\"([^\"]+)\".*$" "\\1" MYSQL_VERSION_STRING "${MYSQL_VERSION_H}" ) -endif() - -# handle the QUIETLY and REQUIRED arguments and set MYSQL_FOUND to TRUE if -# all listed variables are TRUE -include( FindPackageHandleStandardArgs ) -FIND_PACKAGE_HANDLE_STANDARD_ARGS( MYSQL - REQUIRED_VARS MYSQL_LIBRARIES MYSQL_INCLUDE_DIRS - VERSION_VAR MYSQL_VERSION_STRING ) diff --git a/3rdparty/pcre/CMakeLists.txt b/3rdparty/pcre/CMakeLists.txt index 70448d40e..57465a46c 100644 --- a/3rdparty/pcre/CMakeLists.txt +++ b/3rdparty/pcre/CMakeLists.txt @@ -39,7 +39,6 @@ endif( WIN32 ) # system # message( STATUS "Detecting system PCRE" ) -set( CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_MODULE_PATH} ) unset( PCRE_LIBRARIES CACHE ) unset( PCRE_INCLUDE_DIRS CACHE ) find_package( PCRE ) diff --git a/3rdparty/pcre/FindPCRE.cmake b/3rdparty/pcre/FindPCRE.cmake deleted file mode 100644 index cb4d9177b..000000000 --- a/3rdparty/pcre/FindPCRE.cmake +++ /dev/null @@ -1,35 +0,0 @@ -# - Find pcre -# Find the native PCRE includes and library -# -# PCRE_INCLUDE_DIRS - where to find pcre.h -# PCRE_LIBRARIES - List of libraries when using pcre. -# PCRE_FOUND - True if pcre found. - - -find_path( PCRE_INCLUDE_DIR pcre.h ) - -set( PCRE_NAMES pcre ) -find_library( PCRE_LIBRARY NAMES ${PCRE_NAMES} ) -mark_as_advanced( PCRE_LIBRARY PCRE_INCLUDE_DIR ) - -if( PCRE_INCLUDE_DIR AND EXISTS "${PCRE_INCLUDE_DIR}/pcre.h" ) - file( STRINGS "${PCRE_INCLUDE_DIR}/pcre.h" PCRE_H REGEX "^#define[ \t]+PCRE_M[A-Z]+[ \t]+[0-9]+.*$" ) - string( REGEX REPLACE "^.*PCRE_MAJOR[ \t]+([0-9]+).*$" "\\1" PCRE_MAJOR "${PCRE_H}" ) - string( REGEX REPLACE "^.*PCRE_MINOR[ \t]+([0-9]+).*$" "\\1" PCRE_MINOR "${PCRE_H}" ) - - set( PCRE_VERSION_STRING "${PCRE_MAJOR}.${PCRE_MINOR}" ) - set( PCRE_VERSION_MAJOR "${PCRE_MAJOR}" ) - set( PCRE_VERSION_MINOR "${PCRE_MINOR}" ) -endif() - -# handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if -# all listed variables are TRUE -include( FindPackageHandleStandardArgs ) -FIND_PACKAGE_HANDLE_STANDARD_ARGS( PCRE - REQUIRED_VARS PCRE_LIBRARY PCRE_INCLUDE_DIR - VERSION_VAR PCRE_VERSION_STRING ) - -if( PCRE_FOUND ) - set( PCRE_LIBRARIES ${PCRE_LIBRARY} ) - set( PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR} ) -endif() diff --git a/3rdparty/pcre/lib/libpcre.dll.a b/3rdparty/pcre/lib/libpcre.dll.a new file mode 100644 index 000000000..fe69e4e57 Binary files /dev/null and b/3rdparty/pcre/lib/libpcre.dll.a differ diff --git a/CMakeLists.txt b/CMakeLists.txt index 523d445ef..0aee569a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,5 @@ +##################################################################### +# # "Getting Started with CMake", a tutorial video by Eric Wing. # Part 1 of 6: http://www.youtube.com/watch?v=CLvZTyji_Uw # Part 2 of 6: http://www.youtube.com/watch?v=gUW-RrRQjEg @@ -11,8 +13,22 @@ # WITH_* : option to use an external package or not # ENABLE_* : option to use an internal feature/code or not # HAVE_* : internal variable indicating if we have and are using something -cmake_minimum_required( VERSION 2.8.4 ) -project( eAthena ) +# +##################################################################### + + +#cmake_minimum_required( VERSION 2.8.4 ) +# Functional changes from 2.8.3 to 2.8.4: +# string(SUBSTRING) works with length -1 as "rest of string" +# changes to some CPack generators +# CYGWIN no longer defines WIN32 +# CMP0017: Prefer files from the CMake module directory when including from there. +set( CMAKE_LEGACY_CYGWIN_WIN32 0 ) +cmake_minimum_required( VERSION 2.8.3 ) +project( eAthena C ) +if( CYGWIN ) + unset( WIN32 ) +endif() # @@ -21,26 +37,48 @@ project( eAthena ) if( ALLOW_SAME_DIRECTORY ) elseif( "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}" ) option( ALLOW_SAME_DIRECTORY "Allow CMake to build in the source directory." OFF ) - message( FATAL_ERROR "Do not use the source directory to build your files, instead create a separate folder and build there.\nExample:\n mkdir build\n cd build\n cmake -G\"Unix Makefiles\" ..\n make install\nTo skip this check, set ALLOW_SAME_DIRECTORY to 1 or ON" ) + message( FATAL_ERROR + "Do not use the source directory to build your files, instead delete CMakeCache.txt, create a separate folder and build there.\n" + "Example: (build in subdir 'build' and install to source dir)\n" + " rm -f CMakeCache.txt\n" + " mkdir build\n" + " cd build\n" + " cmake -G\"Unix Makefiles\" -DINSTALL_TO_SOURCE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo ..\n" + " make install\n" + " cd ..\n" + " rm -rf build\n" + "To skip this check, set ALLOW_SAME_DIRECTORY to ON (-DALLOW_SAME_DIRECTORY=ON)" ) endif() # # Global stuff # -set( GLOBAL_LIBRARIES CACHE INTERNAL "" ) -set( GLOBAL_INCLUDE_DIRS CACHE INTERNAL "" ) -set( GLOBAL_DEFINITIONS CACHE INTERNAL "" ) +set( GLOBAL_LIBRARIES ${LINK_LIBRARIES} CACHE INTERNAL "" )# list (comma separated values) +set( GLOBAL_INCLUDE_DIRS ${INCLUDE_DIRECTORIES} CACHE INTERNAL "" )# list (comma separated values) +set( GLOBAL_DEFINITIONS ${COMPILE_DEFINITIONS} CACHE INTERNAL "" )# string (space separated values -DFOO=bar) mark_as_advanced( GLOBAL_LIBRARIES GLOBAL_INCLUDE_DIRS GLOBAL_DEFINITIONS ) if( WIN32 ) - list( APPEND GLOBAL_DEFINITIONS FD_SETSIZE=4096 ) - list( APPEND GLOBAL_LIBRARIES "oldnames.lib" "ws2_32.lib" ) + set_property( CACHE GLOBAL_DEFINITIONS PROPERTY VALUE "${GLOBAL_DEFINITIONS} -DFD_SETSIZE=4096" ) endif() if( MSVC ) - list( APPEND GLOBAL_DEFINITIONS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE DB_MANUAL_CAST_TO_UNION ) + set_property( CACHE GLOBAL_LIBRARIES PROPERTY VALUE ${GLOBAL_LIBRARIES} "oldnames.lib" "ws2_32.lib" ) + set_property( CACHE GLOBAL_DEFINITIONS PROPERTY VALUE "${GLOBAL_DEFINITIONS} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE" ) endif() +# +# 3rd party +# +add_subdirectory( 3rdparty ) +include( CheckCSourceCompiles ) +include( CheckCSourceRuns ) +include( CheckIncludeFile ) +include( CheckFunctionExists ) +include( FindFunctionLibrary ) +include( TestBigEndian ) + + # # Find svnversion # @@ -60,20 +98,6 @@ message( STATUS "Detecting Subversion" ) find_package( Subversion ) message( STATUS "Detecting Subversion - done" ) - -# -# Find math library (FreeBSD) -# -message( STATUS "Detecting math library" ) -find_library( M_LIBRARIES m ) -mark_as_advanced( M_LIBRARIES ) -if( M_LIBRARIES ) - message( STATUS "Found m: ${M_LIBRARIES}" ) - list( APPEND GLOBAL_LIBRARIES ${M_LIBRARIES} ) -endif() -message( STATUS "Detecting math library - done" ) - - # # PACKETVER # @@ -87,17 +111,285 @@ endif() # SVNVERSION # if( SVNVERSION_EXECUTABLE ) + message( STATUS "Getting svn version" ) execute_process( COMMAND ${SVNVERSION_EXECUTABLE} ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE SVNVERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) string( REGEX REPLACE "[^1234567890MSexported]" "_" SVNVERSION ${SVNVERSION} ) + message( STATUS "Found version: ${SVNVERSION}" ) + message( STATUS "Getting svn version - done" ) endif() if( Subversion_FOUND AND SVNVERSION ) + message( STATUS "Getting svn branch" ) Subversion_WC_INFO( ${PROJECT_SOURCE_DIR} eAthena ) if( eAthena_WC_URL ) string( REGEX MATCH "[^/]+$" BRANCH ${eAthena_WC_URL} ) set( SVNVERSION "${BRANCH}-${SVNVERSION}" ) + message( STATUS "Found branch: ${BRANCH}" ) + endif() + message( STATUS "Getting svn branch - done" ) +endif() + + +# +# math library (FreeBSD/Linux/Solaris) +# +message( STATUS "Detecting math library (m)" ) +CHECK_INCLUDE_FILE( math.h HAVE_MATH_H ) +if( NOT HAVE_MATH_H ) + message( FATAL_ERROR "math.h not found" ) +endif() +set( CMAKE_REQUIRED_LIBRARIES ${GLOBAL_LIBRARIES} ) +find_function_library( floor FUNCTION_FLOOR_LIBRARIES m ) +if( FUNCTION_FLOOR_LIBRARIES ) + message( STATUS "Adding global library: ${FUNCTION_FLOOR_LIBRARIES}" ) + set_property( CACHE GLOBAL_LIBRARIES PROPERTY VALUE ${GLOBAL_LIBRARIES} ${FUNCTION_FLOOR_LIBRARIES} ) +endif() +message( STATUS "Detecting math library (m) - done" ) + + +# +# dynamic loading library (Linux) +# +if( NOT WIN32 ) +message( STATUS "Detecting dynamic loading library (dl)" ) +set( CMAKE_REQUIRED_LIBRARIES ${GLOBAL_LIBRARIES} ) +find_function_library( dlopen FUNCTION_DLOPEN_LIBRARIES dl ) +if( FUNCTION_DLOPEN_LIBRARIES ) + message( STATUS "Adding global library: ${FUNCTION_DLOPEN_LIBRARIES}" ) + set_property( CACHE GLOBAL_LIBRARIES PROPERTY VALUE ${GLOBAL_LIBRARIES} ${FUNCTION_DLOPEN_LIBRARIES} ) +endif() +message( STATUS "Detecting dynamic loading library (dl) - done" ) +endif() + + +# +# networking library (Solaris/MinGW) +# +if( NOT MSVC ) +message( STATUS "Detecting networking library (socket/nsl/ws2_32)" ) +set( CMAKE_REQUIRED_LIBRARIES ${GLOBAL_LIBRARIES} ) +find_function_library( bind FUNCTION_BIND_LIBRARIES socket ws2_32 ) +if( FUNCTION_BIND_LIBRARIES ) + message( STATUS "Adding global library: ${FUNCTION_BIND_LIBRARIES}" ) + set_property( CACHE GLOBAL_LIBRARIES PROPERTY VALUE ${GLOBAL_LIBRARIES} ${FUNCTION_BIND_LIBRARIES} ) +endif() +set( CMAKE_REQUIRED_LIBRARIES ${GLOBAL_LIBRARIES} ) +find_function_library( gethostbyname FUNCTION_GETHOSTBYNAME_LIBRARIES nsl ) +if( FUNCTION_GETHOSTBYNAME_LIBRARIES ) + message( STATUS "Adding global library: ${FUNCTION_GETHOSTBYNAME_LIBRARIES}" ) + set_property( CACHE GLOBAL_LIBRARIES PROPERTY VALUE ${GLOBAL_LIBRARIES} ${FUNCTION_GETHOSTBYNAME_LIBRARIES} ) +endif() +message( STATUS "Detecting networking library (socket/nsl/ws2_32) - done" ) +endif() + + +# +# Test for big endian +# +TEST_BIG_ENDIAN( BIG_ENDIAN ) +if( NOT DEFINED BIG_ENDIAN ) + message( WARNING "unable to determine endianess, only LITTLE ENDIAN is supported" ) +elseif( BIG_ENDIAN ) + message( FATAL_ERROR "bigendian is not supported" ) +endif() + + +# +# Test typecast to union +# +message( STATUS "Check for typecast to union" ) +set( SOURCECODE + "typedef union Foonion{\n" + " int i;\n" + " unsigned int ui;\n" + " const char* s;\n" + "} Foonion;\n" + "int get_i(Foonion onion){ return onion.i; }\n" + "int main(int argc, char** argv){\n" + " int i = 0;\n" + " return get_i(((Foonion)(int)i));\n" + "}\n" + ) +CHECK_C_SOURCE_COMPILES( "${SOURCECODE}" HAVE_TYPECAST_TO_UNION ) +if( HAVE_TYPECAST_TO_UNION ) + message( STATUS "Check for typecast to union - yes" ) +else() + message( STATUS "Check for typecast to union - no" ) + set_property( CACHE GLOBAL_DEFINITIONS PROPERTY VALUE "${GLOBAL_DEFINITIONS} -DDB_MANUAL_CAST_TO_UNION" ) +endif() + + +# +# Test monotonic clock +# +# CLOCK_MONOTONIC clock for clock_gettime +# Normally defines _POSIX_TIMERS > 0 and _POSIX_MONOTONIC_CLOCK (for posix +# compliant systems) and __FreeBSD_cc_version >= 500005 (for FreeBSD +# >= 5.1.0, which does not have the posix defines (ref. r11983)) would be +# checked but some systems define them even when they do not support it +# (ref. bugreport:1003). +# +message( STATUS "Check for monotonic clock" ) +set( SOURCECODE + "#include \n" + "#include \n" + "#include \n" + "int main(int argc, char** argv){\n" + " struct timespec tval;\n" + " return clock_gettime(CLOCK_MONOTONIC, &tval);\n" + "}\n" + ) +find_library( RT_LIBRARY rt )# (optional, rt on Debian) +mark_as_advanced( RT_LIBRARY ) +set( CMAKE_REQUIRED_LIBRARIES ${GLOBAL_LIBRARIES} ${RT_LIBRARY} ) +CHECK_C_SOURCE_RUNS( "${SOURCECODE}" HAVE_MONOTONIC_CLOCK ) +if( HAVE_MONOTONIC_CLOCK ) + message( STATUS "Check for monotonic clock - yes" ) + set_property( CACHE GLOBAL_LIBRARIES PROPERTY VALUE ${GLOBAL_LIBRARIES} ${RT_LIBRARY} ) + set_property( CACHE GLOBAL_DEFINITIONS PROPERTY VALUE "${GLOBAL_DEFINITIONS} -DHAVE_MONOTONIC_CLOCK" ) +else() + message( STATUS "Check for monotonic clock - no" ) +endif() + + +# +# Test if function exists: +# setrlimit - used to set the socket limit +# strnlen - string length with upper scan bound +# getpid - process id +# gettid - thread id +# +CHECK_FUNCTION_EXISTS( setrlimit HAVE_SETRLIMIT ) +CHECK_FUNCTION_EXISTS( strnlen HAVE_STRNLEN ) +CHECK_FUNCTION_EXISTS( getpid HAVE_GETPID ) +CHECK_FUNCTION_EXISTS( gettid HAVE_GETTID ) +foreach( define HAVE_SETRLIMIT HAVE_STRNLEN HAVE_GETPID HAVE_GETTID ) + if( ${define} ) + set_property( CACHE GLOBAL_DEFINITIONS PROPERTY VALUE "${GLOBAL_DEFINITIONS} -D${define}" ) + endif() +endforeach() + + +# +# Use RDTSC instruction as a timing source (time stamp counter on x86 since Pentium) (default=OFF) +# +# Enable it when you've timing issues. (ex: in conjunction with XEN or Other Virtualization mechanisms) +# Please ensure that you've disabled dynamic CPU-Frequencys, such as power saving options. +# (On the most modern Dedicated Servers cpufreq is preconfigured, see your distribution's manual how to disable it) +# +option( ENABLE_RDTSC "use RDTSC instruction as a timing source (default=OFF)" OFF ) +if( ENABLE_RDTSC ) + set_property( CACHE GLOBAL_DEFINITIONS PROPERTY VALUE "${GLOBAL_DEFINITIONS} -DENABLE_RDTSC" ) + message( STATUS "Enabled RDTSC as a timing source" ) +endif() + + +# +# Enable extra debug code (default=OFF) +# +option( ENABLE_EXTRA_DEBUG_CODE "enable extra debug code (default=OFF)" OFF ) +if( ENABLE_EXTRA_DEBUG_CODE ) + set_property( CACHE GLOBAL_DEFINITIONS PROPERTY VALUE "${GLOBAL_DEFINITIONS} -DDEBUG" ) + message( STATUS "Enabled extra DEBUG code" ) +endif() + + +# +# Enable builtin memory manager (default=default) +# +set( MEMMGR_OPTIONS "default;yes;no" ) +set( ENABLE_MEMMGR "default" CACHE STRING "enable builtin memory manager: ${MEMMGR_OPTIONS} (default=default)" ) +set_property( CACHE ENABLE_MEMMGR PROPERTY STRINGS ${MEMMGR_OPTIONS} ) +if( ENABLE_MEMMGR STREQUAL "default" ) + # use source code default +elseif( ENABLE_MEMMGR STREQUAL "yes" ) + set_property( CACHE GLOBAL_DEFINITIONS PROPERTY VALUE "${GLOBAL_DEFINITIONS} -DUSE_MEMMGR" ) + message( STATUS "Enabled the builtin memory manager" ) +elseif( ENABLE_MEMMGR STREQUAL "no" ) + set_property( CACHE GLOBAL_DEFINITIONS PROPERTY VALUE "${GLOBAL_DEFINITIONS} -DNO_MEMMGR" ) + message( STATUS "Disabled the builtin memory manager" ) +else() + message( FATAL_ERROR "invalid option ENABLE_MEMMGR=${ENABLE_MEMMGR} (valid options: ${MEMMGR_OPTIONS})" ) +endif() + + +# +# Enable memory library (default=system) +# +set( MEMORY_OPTIONS "system;memwatch;dmalloc;gcollect" ) +set( ENABLE_MEMORY "system" CACHE STRING "enable memory library: ${MEMORY_OPTIONS} (default=system)" ) +set_property( CACHE ENABLE_MEMORY PROPERTY STRINGS ${MEMORY_OPTIONS} ) +if( ENABLE_MEMORY STREQUAL "system" ) + # use system functions + +elseif( ENABLE_MEMORY STREQUAL "memwatch" ) + CHECK_INCLUDE_FILE( memwatch.h HAVE_MEMWATCH_H ) + find_library( MEMWATCH_LIBRARY memwatch ) + mark_as_advanced( MEMWATCH_LIBRARY ) + if( HAVE_MEMWATCH_H AND MEMWATCH_LIBRARY ) + message( STATUS "Adding global library: ${MEMWATCH_LIBRARY}" ) + set_property( CACHE GLOBAL_LIBRARIES PROPERTY VALUE ${GLOBAL_LIBRARIES} ${MEMWATCH_LIBRARY} ) + set_property( CACHE GLOBAL_DEFINITIONS PROPERTY VALUE "${GLOBAL_DEFINITIONS} -DMEMWATCH" ) + message( STATUS "Enabled the memory library memwatch" ) + else() + message( FATAL_ERROR "Failed to enable the memory library memwatch" ) + endif() + +elseif( ENABLE_MEMORY STREQUAL "dmalloc" ) + CHECK_INCLUDE_FILE( dmalloc.h HAVE_DMALLOC_H ) + find_library( DMALLOC_LIBRARY dmalloc ) + mark_as_advanced( DMALLOC_LIBRARY ) + if( HAVE_DMALLOC_H AND DMALLOC_LIBRARY ) + message( STATUS "Adding global library: ${DMALLOC_LIBRARY}" ) + set_property( CACHE GLOBAL_LIBRARIES PROPERTY VALUE ${GLOBAL_LIBRARIES} ${DMALLOC_LIBRARY} ) + set_property( CACHE GLOBAL_DEFINITIONS PROPERTY VALUE "${GLOBAL_DEFINITIONS} -DDMALLOC -DDMALLOC_FUNC_CHECK" ) + message( STATUS "Enabled the memory library dmalloc" ) + else() + message( FATAL_ERROR "Failed to enable the memory library dmalloc" ) + endif() + +elseif( ENABLE_MEMORY STREQUAL "gcollect" ) + CHECK_INCLUDE_FILE( gc.h HAVE_GC_H ) + find_library( GC_LIBRARY gc ) + mark_as_advanced( GC_LIBRARY ) + if( HAVE_GC_H AND GC_LIBRARY ) + message( STATUS "Adding global library: ${GC_LIBRARY}" ) + set_property( CACHE GLOBAL_LIBRARIES PROPERTY VALUE ${GLOBAL_LIBRARIES} ${GC_LIBRARY} ) + set_property( CACHE GLOBAL_DEFINITIONS PROPERTY VALUE "${GLOBAL_DEFINITIONS} -DGCOLLECT" ) + message( STATUS "Enabled the memory library gcollect" ) + else() + message( FATAL_ERROR "Failed to enable the memory library gcollect" ) + endif() + +else() + message( FATAL_ERROR "invalid option ENABLE_MEMORY=${ENABLE_MEMORY} (valid options: ${MEMORY_OPTIONS})" ) +endif() + + +# +# Enable profiler (default=none) +# +set( PROFILER_OPTIONS "none;gprof" ) +set( ENABLE_PROFILER "none" CACHE STRING "enable profiler: ${PROFILER_OPTIONS} (default=none)" ) +set_property( CACHE ENABLE_PROFILER PROPERTY STRINGS ${PROFILER_OPTIONS} ) +if( ENABLE_PROFILER STREQUAL "none" ) + # no profiler + +elseif( ENABLE_PROFILER STREQUAL "gprof" ) + if( CMAKE_C_COMPILER_ID STREQUAL "GNU" ) + if( NOT HAVE_GPROF_FLAGS ) + set_property( CACHE CMAKE_C_FLAGS PROPERTY VALUE "${CMAKE_C_FLAGS} -pg" ) + set_property( CACHE CMAKE_EXE_LINKER_FLAGS PROPERTY VALUE "${CMAKE_EXE_LINKER_FLAGS} -pg" ) + set( HAVE_GPROF_FLAGS ON CACHE INTERNAL "" ) + endif() + message( STATUS "Enabled the profiler gprof" ) + else() + message( FATAL_ERROR "Failed to enable the profiler gprof - not GNU" ) endif() + +else() + message( FATAL_ERROR "invalid option ENABLE_PROFILER=${ENABLE_PROFILER} (valid options: ${PROFILER_OPTIONS})" ) endif() @@ -110,13 +402,16 @@ set( CPACK_PACKAGE_VERSION ${SVNVERSION} ) set( CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE ) #set( CPACK_MONOLITHIC_INSTALL ON ) include( CPACK OPTIONAL RESULT_VARIABLE HAVE_CPACK ) -if( NOT HAVE_CPACK ) +if( HAVE_CPACK ) + option( WITH_CPACK "enable building packages with CPack ('package' target)" ON ) +endif() +if( NOT WITH_CPACK ) # empty replacements macro( cpack_add_component_group ) endmacro() macro( cpack_add_component ) endmacro() - message( STATUS "CPACK not found, package creation disabled" ) + message( STATUS "Disabled package creation" ) endif() set( Runtime "Runtime files" CACHE INTERNAL "" ) @@ -135,8 +430,8 @@ cpack_add_component( Development_base DESCRIPTION ${Development_base} DISPLAY_NA # # install stuff # -option( WITH_COMPONENT_RUNTIME "install/package files needed to run the project" ON ) -option( WITH_COMPONENT_DEVELOPMENT "install/package files needed to build the project" OFF ) +option( INSTALL_COMPONENT_RUNTIME "install/package files needed to run the project" ON ) +option( INSTALL_COMPONENT_DEVELOPMENT "install/package files needed to build the project" OFF ) option( INSTALL_TO_PATH "copy files to INSTALL_PATH" OFF ) option( INSTALL_TO_SOURCE "copy files to source directory, skips what is already there (${CMAKE_CURRENT_SOURCE_DIR})" OFF ) option( INSTALL_TO_SUBDIR "copy files to subdirectory (${CMAKE_CURRENT_BINARY_DIR}/install)" OFF ) @@ -221,7 +516,7 @@ set( RUNTIME_DIRECTORIES ) if( INSTALL_TO_SOURCE )# skip, already in the source dir else() - if( WITH_COMPONENT_RUNTIME ) + if( INSTALL_COMPONENT_RUNTIME ) install( FILES ${RUNTIME_FILES} DESTINATION "." COMPONENT Runtime_base ) @@ -232,8 +527,8 @@ else() PATTERN ${SVN_FOLDER_PATTERN} EXCLUDE PATTERN "conf/import-tmpl" EXCLUDE ) endforeach() - endif() - if( WITH_COMPONENT_DEVELOPMENT ) + endif( INSTALL_COMPONENT_RUNTIME ) + if( INSTALL_COMPONENT_DEVELOPMENT ) install( FILES ${DEVELOPMENT_FILES} DESTINATION "." COMPONENT Development_base ) @@ -243,23 +538,68 @@ else() COMPONENT Development_base PATTERN ${SVN_FOLDER_PATTERN} EXCLUDE ) endforeach() - endif() + endif( INSTALL_COMPONENT_DEVELOPMENT ) endif() -if( WITH_COMPONENT_RUNTIME ) +if( INSTALL_COMPONENT_RUNTIME ) # templates - install( DIRECTORY "save-tmpl/" - DESTINATION "save" - COMPONENT Runtime_templates - PATTERN ${SVN_FOLDER_PATTERN} EXCLUDE ) - install( DIRECTORY "conf/import-tmpl/" - DESTINATION "conf/import" - COMPONENT Runtime_templates - PATTERN ${SVN_FOLDER_PATTERN} EXCLUDE ) -endif() + set( _TEMPLATES + "save-tmpl" "save" + "conf/import-tmpl" "conf/import" + ) + set( INSTALL_TEMPLATES_FILE "${CMAKE_CURRENT_BINARY_DIR}/InstallTemplates.cmake" ) + file( WRITE "${INSTALL_TEMPLATES_FILE}" + "macro( INSTALL_TEMPLATE _SRC _DST )\n" + " set( SRC \"${CMAKE_CURRENT_SOURCE_DIR}/\${_SRC}\" )\n" + " set( DST \"\${CMAKE_INSTALL_PREFIX}/\${_DST}\" )\n" + " if( EXISTS \"\${DST}\" )\n" + " message( \"-- Already exists: \${DST}\" )\n" + " else()\n" + " message( \"-- Installing template: \${DST}\" )\n" + " execute_process( COMMAND \"${CMAKE_COMMAND}\" -E copy \"\${SRC}\" \"\${DST}\" )\n" + " endif()\n" + "endmacro()\n" + ) + while( _TEMPLATES ) + list( GET _TEMPLATES 0 _SRC ) + list( GET _TEMPLATES 1 _DST ) + list( REMOVE_AT _TEMPLATES 0 1 ) + if( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_SRC}" ) + file( GLOB _PATHS "${CMAKE_CURRENT_SOURCE_DIR}/${_SRC}/*" ) + foreach( _PATH IN ITEMS ${_PATHS} ) + string( REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/${_SRC}/" "" _PATH "${_PATH}" ) + if( NOT "${_PATH}" MATCHES "${SVN_FOLDER_PATTERN}" ) + list( APPEND _TEMPLATES "${_SRC}/${_PATH}" "${_DST}/${_PATH}" ) + endif() + endforeach() + else() + file( APPEND "${INSTALL_TEMPLATES_FILE}" "INSTALL_TEMPLATE( \"${_SRC}\" \"${_DST}\" )\n" ) + endif() + endwhile() + install( SCRIPT "${INSTALL_TEMPLATES_FILE}" + COMPONENT Runtime_templates ) +endif( INSTALL_COMPONENT_RUNTIME ) # -# subdirectories +# sources # -add_subdirectory( 3rdparty ) +set( TARGET_LIST CACHE INTERNAL "" ) add_subdirectory( src ) + + +##################################################################### +# final checks and warnings +# +if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) + message( WARNING "64bit should work, but is not recommended." ) +elseif( NOT CMAKE_SIZEOF_VOID_P EQUAL 4 ) + message( FATAL_ERROR "unexpected architecture (CMAKE_SIZEOF_VOID_P is ${CMAKE_SIZEOF_VOID_P})" ) +endif() +list( LENGTH TARGET_LIST _LEN ) +if( _LEN EQUAL 0 ) + message( FATAL_ERROR "no targets available" ) +endif() +message( STATUS "Available targets:" ) +foreach( _TARGET IN ITEMS ${TARGET_LIST} ) + message( STATUS "\t${_TARGET}" ) +endforeach() diff --git a/Changelog-Renewal.txt b/Changelog-Renewal.txt index f09e03fea..97cd2639c 100644 --- a/Changelog-Renewal.txt +++ b/Changelog-Renewal.txt @@ -1,5 +1,7 @@ Date Added +2011/10/07 + * Merged changes from trunk [14895:14966/trunk]. [Ai4rei] 2011/09/30 * Rev. 14965 Forgot to increase MAX_ITEMDELAYs to 18. [L0ne_W0lf] * Rev. 14964 Just a slew of back-logged source updates. [L0ne_W0lf] diff --git a/conf/Changelog.txt b/conf/Changelog.txt index 26351612c..43c92fc74 100644 --- a/conf/Changelog.txt +++ b/conf/Changelog.txt @@ -1,5 +1,7 @@ Date Added +2011/08/21 + * Rev. 14938 Added setting 'client_limit_unit_lv' to control the unit types which are affected by 'max_lv' and 'aura_lv' settings. [Ai4rei] 2011/08/10 * Rev. 14931 Upped max_lv and max_aura to 150, and max_aspd to 193. 2011/07/09 diff --git a/conf/battle/client.conf b/conf/battle/client.conf index 11bb215a2..c6a5159d5 100644 --- a/conf/battle/client.conf +++ b/conf/battle/client.conf @@ -17,6 +17,8 @@ //-------------------------------------------------------------- // Note 1: Value is a config switch (on/off, yes/no or 1/0) // Note 2: Value is in percents (100 means 100%) +// Note 3: Value is a bit field. If no description is given, +// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun, 16: Mercenary) //-------------------------------------------------------------- // Set here which client version do you accept. Add all values of clients: @@ -86,6 +88,12 @@ max_lv: 150 // 150 or more will be reported as having level 99 and show an aura. aura_lv: 150 +// Units types affected by max_lv and aura_lv settings. (Note 3) +// Note: If an unit type, which normally does not show an aura, is +// set it will obtain an aura when it meets the level requirement. +// Default: 0 (none) +client_limit_unit_lv: 0 + // Will tuxedo and wedding dresses be shown when worn? (Note 1) wedding_modifydisplay: no diff --git a/conf/mapflag/reset.txt b/conf/mapflag/reset.txt new file mode 100644 index 000000000..b6693eaf2 --- /dev/null +++ b/conf/mapflag/reset.txt @@ -0,0 +1,42 @@ +//===== eAthena Script ======================================= +//= Map flags that enable the use of Neuralizer +//===== By: ================================================== +//= Daegaladh +//===== Current Version: ===================================== +//= 1.0 [Daegaladh] +//===== Compatible With: ===================================== +//= +//===== Description: ========================================= +//= +//============================================================ + +alberta mapflag reset +aldebaran mapflag reset +amatsu mapflag reset +ayothaya mapflag reset +brasilis mapflag reset +comodo mapflag reset +einbroch mapflag reset +einbech mapflag reset +geffen mapflag reset +gonryun mapflag reset +izlude mapflag reset +jawaii mapflag reset +hugel mapflag reset +lighthalzen mapflag reset +louyang mapflag reset +manuk mapflag reset +mid_camp mapflag reset +moc_ruins mapflag reset +morocc mapflag reset +moscovia mapflag reset +niflheim mapflag reset +prontera mapflag reset +payon mapflag reset +pay_arche mapflag reset +rachel mapflag reset +splendide mapflag reset +umbala mapflag reset +veins mapflag reset +xmas mapflag reset +yuno mapflag reset diff --git a/conf/mapflag/restricted.txt b/conf/mapflag/restricted.txt index 6de962dff..908ea4476 100644 --- a/conf/mapflag/restricted.txt +++ b/conf/mapflag/restricted.txt @@ -6,6 +6,7 @@ //= 1.0 [Komurka] //= 1.1 Added WoE:SE Map restrictions. [L0ne_W0lf] //= 1.2 Added Endless Tower Restrictions. (bugreport:4707) [L0ne_W0lf] +//= 1.3 Added Orc's Memory, Nidhoggur's Nest and towns restrictions [Daegaladh] //===== Current Version: ===================================== //Aldebaran Turbo Track @@ -54,3 +55,43 @@ arug_cas05 mapflag restricted 4 4@tower mapflag restricted 6 5@tower mapflag restricted 6 6@tower mapflag restricted 6 + +//Orc's Memory =================== +1@orcs mapflag restricted 6 +2@orcs mapflag restricted 6 + +// Nidhoggr's Instance =========== +1@nyd mapflag restricted 6 +2@nyd mapflag restricted 6 + +//Towns +alberta mapflag restricted 7 +aldebaran mapflag restricted 7 +amatsu mapflag restricted 7 +ayothaya mapflag restricted 7 +brasilis mapflag restricted 7 +comodo mapflag restricted 7 +einbroch mapflag restricted 7 +einbech mapflag restricted 7 +geffen mapflag restricted 7 +gonryun mapflag restricted 7 +izlude mapflag restricted 7 +jawaii mapflag restricted 7 +hugel mapflag restricted 7 +lighthalzen mapflag restricted 7 +louyang mapflag restricted 7 +manuk mapflag restricted 7 +mid_camp mapflag restricted 7 +moc_ruins mapflag restricted 7 +morocc mapflag restricted 7 +moscovia mapflag restricted 7 +niflheim mapflag restricted 7 +prontera mapflag restricted 7 +payon mapflag restricted 7 +pay_arche mapflag restricted 7 +rachel mapflag restricted 7 +splendide mapflag restricted 7 +umbala mapflag restricted 7 +veins mapflag restricted 7 +xmas mapflag restricted 7 +yuno mapflag restricted 7 diff --git a/configure b/configure index fbc5e3a11..e26d187e8 100755 --- a/configure +++ b/configure @@ -3475,6 +3475,54 @@ rm -f conftest.err conftest.$ac_objext \ +# +# -O2 implies -fstrict-aliasing, but the code is not safe for that +# +echo "$as_me:$LINENO: checking whether $CC supports -fno-strict-aliasing" >&5 +echo $ECHO_N "checking whether $CC supports -fno-strict-aliasing... $ECHO_C" >&6 +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -fno-strict-aliasing" +cat >conftest.$ac_ext <<_ACEOF +int foo; +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + + # # DB_MANUAL_CAST_TO_UNION # @@ -6178,6 +6226,7 @@ do # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/common/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/common/Makefile" ;; + "3rdparty/mt19937ar/Makefile" ) CONFIG_FILES="$CONFIG_FILES 3rdparty/mt19937ar/Makefile" ;; "src/char/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/char/Makefile" ;; "src/login/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/login/Makefile" ;; "src/char_sql/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/char_sql/Makefile" ;; diff --git a/configure.in b/configure.in index 197a4a4ed..a9e4c289a 100644 --- a/configure.in +++ b/configure.in @@ -424,6 +424,22 @@ AC_LINK_IFELSE( AC_SUBST([WITH_PLUGINS]) +# +# -O2 implies -fstrict-aliasing, but the code is not safe for that +# +AC_MSG_CHECKING([whether $CC supports -fno-strict-aliasing]) +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -fno-strict-aliasing" +AC_COMPILE_IFELSE( + [int foo;], + [AC_MSG_RESULT([yes])], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + ] +) + + # # DB_MANUAL_CAST_TO_UNION # diff --git a/db/Changelog.txt b/db/Changelog.txt index 4883369e4..23b652d21 100644 --- a/db/Changelog.txt +++ b/db/Changelog.txt @@ -19,12 +19,29 @@ * Added Rune Knight skills to skill_cast_db * Updated Rune Knight skills, and Arch Bishop skills. * Updated SP requirements in skill_require_db. +2011/09/27 + * Rev. 14963 Updated item_noequip.txt examples to reflect recent changes (follow up to r14961). [Ai4rei] 2011/08/26 * Rev. 14941 Several updates in relation to 3rd jobs. [L0ne_W0lf] 2011/08/10 * Rev. 14931 Added Brasilis database updates from trunk r14928. [L0ne_W0lf] +2011/08/09 + * Rev. 14928 Added remaining database modifications for Brasilis. + - Added the skills for the Brasilis monsters. + - Added remaining entries for Bathroom Ghost quest. + - Added stats for the Suspicious Hydra monsters. + - Corrected the capture rate for Suspicious Hydra. 2011/08/07 * Rev. 14927 Merged database changes from trunk r14927. [L0ne_W0lf] + * Rev. 14926 Minor item-related updates, and a couple quest database updates. [L0ne_W0lf] +2011/07/11 + * Rev. 14901 Lots of updates. :] [L0ne_W0lf] + - Added several missing items to the item database, updated others. + - Raised level 10 Dec. AGI to be level 48, when used by mobs. + - Added missing mercenaries to the mercenary DB, and skills. + - Added missing monster_chat_db entries for Nydhoggr's Shadow. + - Added Brasilis pets to the pet DB, these pets are unhatchable on purpose. + - Added additional quests to the quest_db, mostly for RE. 2011/04/16 * Rev. 14797 Added Archangel Wings (2573) and their respective Box (16998) item based on client-side kRO description. [Ai4rei] 2011/03/19 diff --git a/db/item_noequip.txt b/db/item_noequip.txt index e73c7089d..6e8b65309 100644 --- a/db/item_noequip.txt +++ b/db/item_noequip.txt @@ -2,42 +2,59 @@ // here you define which items may not be used at PvP / GvG // format: , // mode -// 1- restricted in PVP -// 2- restricted in GVG -// 3- restricted in both PvP and GvG +// 1 - restricted in normal maps +// 2 - restricted in PVP +// 4 - restricted in GVG +// 8 - restricted in Battlegrounds // Restricted zones - they're configured by 'restricted ' mapflag -// 4 - restricted in zone 1 -// 8 - restricted in zone 2 -// 16 - restricted in zone 3 -// 32 - restricted in zone 4 -// 64 - restricted in zone 5 -// 128 - restricted in zone 6 -// 256 - restricted in zone 7 +// 32 - restricted in zone 1 +// 64 - restricted in zone 2 +// 128 - restricted in zone 3 +// 256 - restricted in zone 4 +// 512 - restricted in zone 5 +// 1024 - restricted in zone 6 +// 2048 - restricted in zone 7 //Examples: -//1201,1 you can't use KNIFE(ID 1201) on PvP and GvG -//608,3 you can't use Yggdrasil Seed(ID 608) on both PvP & GvG & WoE Castles -//4174,3 Forbid Deviling Card in every PVP or GVG map, and during woes. -//501,4 you can't use Red Potion on map marked as 'restricted zone 1' -//502,8 you can't use Orange Potion on map marked as 'restricted zone 2' -//503,16 you can't use Yellow Potion on map marked as 'restricted zone 3' +//1201,1 you can't use KNIFE(ID 1201) on normal maps +//608,4 you can't use Yggdrasil Seed(ID 608) on both GvG and WoE Castles +//4174,6 Forbid Deviling Card in every PVP or GVG map, and during woes. +//501,32 you can't use Red Potion on map marked as 'restricted zone 1' +//502,64 you can't use Orange Potion on map marked as 'restricted zone 2' +//503,128 you can't use Yellow Potion on map marked as 'restricted zone 3' // you can even mix modes -//519,41 (32+8+1) you can't use Milk on PVP, and maps marked as 'restricted zone 2' and 'restricted zone 4' +//519,322 (256+64+2) you can't use Milk on PVP, and maps marked as 'restricted zone 2' and 'restricted zone 4' + +//PVP +14529,2 //Greed Scroll + +//GVG +12218,4 //LV5 Assumptio Scroll +14529,4 //Greed Scroll +14590,4 //Party Assumptio 5 Scroll + +//BATTLEGROUND +12218,8 //LV5 Assumptio Scroll +14590,8 //Party Assumptio 5 Scroll //Zone 1 - Aldebaran Turbo Track -601,4 //Fly Wing -506,4 //Green Potion -525,4 //Panacea +601,32 //Fly Wing +605,32 //Anodyne +506,32 //Green Potion +525,32 //Panacea //Zone 2 - Jail -601,8 //Fly Wing - not really needed here but ... -602,8 //Butterfly Wing - also not needed -12212,8 //Giant Fly Wing -14582,8 -14583,8 -14584,8 -14585,8 +601,64 //Fly Wing - not really needed here but ... +602,64 //Butterfly Wing - also not needed +12212,64 //Giant Fly Wing +14582,64 +14583,64 +14584,64 +14585,64 //Zone 3 - Izlude Battle Arena -601,16 //Fly Wing +601,128 //Fly Wing + +//Zone 7 - Towns +14529,2048 //Greed Scroll diff --git a/db/mob_skill_db.txt b/db/mob_skill_db.txt index 57b16f0c7..ba0bd9028 100644 --- a/db/mob_skill_db.txt +++ b/db/mob_skill_db.txt @@ -250,8 +250,8 @@ 1046,Doppelganger@NPC_CRITICALSLASH,attack,170,1,2000,0,5000,yes,target,always,0,,,,,,, 1046,Doppelganger@CR_AUTOGUARD,attack,249,10,2000,500,300000,no,self,always,0,,,,,,29, 1046,Doppelganger@CR_AUTOGUARD,chase,249,10,2000,500,300000,no,self,longrangeattacked,,,,,,,29, -1046,Doppelganger@AL_DECAGI,attack,30,11,500,0,20000,no,target,always,0,,,,,,5, -1046,Doppelganger@AL_DECAGI,chase,30,11,500,0,20000,no,target,always,0,,,,,,5, +1046,Doppelganger@AL_DECAGI,attack,30,48,500,0,20000,no,target,always,0,,,,,,5, +1046,Doppelganger@AL_DECAGI,chase,30,48,500,0,20000,no,target,always,0,,,,,,5, 1046,Doppelganger@NPC_SUMMONSLAVE,attack,196,1,10000,700,10000,no,self,slavele,3,1427,,,,,, 1046,Doppelganger@NPC_SUMMONSLAVE,idle,196,1,10000,700,10000,no,self,slavele,3,1427,,,,,, 1046,Doppelganger@BS_HAMMERFALL,chase,110,11,10000,0,5000,yes,target,skillused,18,,,,,,, @@ -399,7 +399,7 @@ 1086,Golden Thief Bug@NPC_SUMMONSLAVE,idle,196,10,10000,0,0,no,self,onspawn,0,1054,,,,,, 1086,Golden Thief Bug@TF_HIDING,attack,51,1,1000,0,5000,no,self,myhpltmaxrate,20,,,,,,19, 1086,Golden Thief Bug@AL_HEAL,idle,28,11,10000,0,5000,yes,self,mystatuson,hiding,,,,,,, -1087,Orc Hero@AL_DECAGI,chase,30,11,2000,0,300000,no,target,always,0,,,,,,6, +1087,Orc Hero@AL_DECAGI,chase,30,48,2000,0,300000,no,target,always,0,,,,,,6, 1087,Orc Hero@AL_TELEPORT,idle,26,1,10000,0,0,yes,self,rudeattacked,,,,,,,, 1087,Orc Hero@AL_TELEPORT,idle,26,1,5000,0,5000,yes,self,rudeattacked,,,,,,,, 1087,Orc Hero@AL_TELEPORT,walk,26,1,5000,0,5000,yes,self,rudeattacked,,,,,,,, @@ -551,7 +551,7 @@ 1111,Drainliar@NPC_BLINDATTACK,attack,177,3,500,0,5000,yes,target,always,0,,,,,,, 1111,Drainliar@NPC_BLOODDRAIN,attack,199,1,500,0,5000,yes,target,always,0,,,,,,, 1111,Drainliar@NPC_DARKNESSATTACK,attack,190,1,2000,0,5000,yes,target,always,0,,,,,,, -1112,Drake@AL_DECAGI,chase,30,11,2000,0,60000,no,target,always,0,,,,,,29, +1112,Drake@AL_DECAGI,chase,30,48,2000,0,60000,no,target,always,0,,,,,,29, 1112,Drake@NPC_ARMORBRAKE,attack,344,10,2000,0,60000,no,target,always,0,,,,,,, 1112,Drake@AL_TELEPORT,idle,26,1,10000,0,0,yes,self,rudeattacked,,,,,,,, 1112,Drake@BS_MAXIMIZE,attack,114,1,500,0,5000,no,self,always,0,,,,,,, @@ -1151,7 +1151,7 @@ 1251,Stormy Knight@WZ_STORMGUST,chase,89,10,2000,500,5000,no,target,always,0,,,,,,21, 1251,Stormy Knight@WZ_STORMGUST,chase,89,10,10000,500,5000,no,target,skillused,18,,,,,,21, 1251,Stormy Knight@AL_HEAL,idle,28,11,10000,0,10000,yes,self,myhpltmaxrate,50,,,,,,, -1252,Garm@AL_DECAGI,chase,30,11,2000,0,300000,no,target,always,0,,,,,,6, +1252,Garm@AL_DECAGI,chase,30,48,2000,0,300000,no,target,always,0,,,,,,6, 1252,Garm@AL_TELEPORT,idle,26,1,10000,0,0,yes,self,rudeattacked,,,,,,,, 1252,Garm@AL_TELEPORT,idle,26,1,5000,0,5000,yes,self,rudeattacked,,,,,,,, 1252,Garm@AL_TELEPORT,walk,26,1,5000,0,5000,yes,self,rudeattacked,,,,,,,, @@ -1618,7 +1618,7 @@ 1372,Goat@NPC_EMOTION,chase,197,1,200,0,5000,yes,self,always,0,19,0x1089,,,,, 1372,Goat@NPC_SPLASHATTACK,attack,174,1,2000,0,5000,yes,target,attackpcge,2,,,,,,, 1372,Goat@NPC_STUNATTACK,attack,179,3,500,1500,5000,no,target,always,0,,,,,,6, -1373,Lord of Death@AL_DECAGI,chase,30,11,2000,0,60000,no,target,always,0,,,,,,, +1373,Lord of Death@AL_DECAGI,chase,30,48,2000,0,60000,no,target,always,0,,,,,,, 1373,Lord of Death@AL_TELEPORT,idle,26,1,10000,0,0,yes,self,rudeattacked,,,,,,,, 1373,Lord of Death@NPC_POWERUP,attack,349,5,10000,0,30000,yes,self,myhpltmaxrate,30,,,,,,6, 1373,Lord of Death@NPC_HELLJUDGEMENT,chase,662,10,10000,1000,10000,no,self,always,0,,,,,,36, @@ -1774,7 +1774,7 @@ 1388,Arc Angeling@NPC_SUMMONSLAVE,attack,196,7,10000,700,60000,no,self,slavele,3,1443,1246,1742,1743,1744,18, 1388,Arc Angeling@NPC_SUMMONSLAVE,idle,196,7,10000,700,60000,no,self,slavele,3,1443,1246,1742,1743,1744,18, 1388,Arc Angeling@RG_INTIMIDATE,attack,219,5,2000,0,5000,yes,target,always,0,,,,,,, -1389,Dracula@AL_DECAGI,chase,30,11,2000,0,5000,no,target,always,0,,,,,,, +1389,Dracula@AL_DECAGI,chase,30,48,2000,0,5000,no,target,always,0,,,,,,, 1389,Dracula@AL_TELEPORT,idle,26,1,10000,0,0,yes,self,rudeattacked,,,,,,,, 1389,Dracula@AL_TELEPORT,idle,26,1,5000,0,5000,yes,self,rudeattacked,,,,,,,, 1389,Dracula@AL_TELEPORT,walk,26,1,5000,0,5000,yes,self,rudeattacked,,,,,,,, @@ -2882,7 +2882,7 @@ 1637,Margaretha Sorin@AL_PNEUMA,idle,25,1,10000,0,0,yes,self,longrangeattacked,,,,,,,, 1637,Margaretha Sorin@AL_INCAGI,attack,29,10,2000,0,240000,yes,self,always,0,,,,,,2, 1637,Margaretha Sorin@AL_INCAGI,chase,29,10,2000,0,240000,yes,self,always,0,,,,,,2, -1637,Margaretha Sorin@AL_DECAGI,chase,30,11,2000,0,10000,yes,target,always,0,,,,,,, +1637,Margaretha Sorin@AL_DECAGI,chase,30,48,2000,0,10000,yes,target,always,0,,,,,,, 1637,Margaretha Sorin@MG_SAFETYWALL,attack,12,10,1000,0,5000,yes,self,always,0,,,,,,, 1637,Margaretha Sorin@AL_PNEUMA,attack,25,1,5000,0,10000,yes,self,longrangeattacked,,,,,,,19, 1637,Margaretha Sorin@AL_PNEUMA,chase,25,1,5000,0,10000,yes,self,longrangeattacked,,,,,,,19, @@ -3031,7 +3031,7 @@ 1643,High Priest Margaretha@AL_PNEUMA,idle,25,1,10000,0,0,yes,self,longrangeattacked,,,,,,,, 1643,High Priest Margaretha@AL_INCAGI,attack,29,10,2000,0,240000,yes,self,always,0,,,,,,2, 1643,High Priest Margaretha@AL_INCAGI,chase,29,10,2000,0,240000,yes,self,always,0,,,,,,2, -1643,High Priest Margaretha@AL_DECAGI,chase,30,11,2000,0,10000,yes,target,always,0,,,,,,, +1643,High Priest Margaretha@AL_DECAGI,chase,30,48,2000,0,10000,yes,target,always,0,,,,,,, 1643,High Priest Margaretha@MG_SAFETYWALL,attack,12,10,1000,0,5000,yes,self,always,0,,,,,,, 1643,High Priest Margaretha@AL_PNEUMA,attack,25,1,5000,0,10000,yes,self,longrangeattacked,,,,,,,19, 1643,High Priest Margaretha@AL_PNEUMA,chase,25,1,5000,0,10000,yes,self,longrangeattacked,,,,,,,19, @@ -3196,7 +3196,7 @@ 1649,High Priest Margaretha@AL_PNEUMA,idle,25,1,10000,0,0,yes,self,longrangeattacked,,,,,,,, 1649,High Priest Margaretha@AL_INCAGI,attack,29,10,2000,0,240000,yes,self,always,0,,,,,,2, 1649,High Priest Margaretha@AL_INCAGI,chase,29,10,2000,0,240000,yes,self,always,0,,,,,,2, -1649,High Priest Margaretha@AL_DECAGI,chase,30,11,2000,0,10000,yes,target,always,0,,,,,,, +1649,High Priest Margaretha@AL_DECAGI,chase,30,48,2000,0,10000,yes,target,always,0,,,,,,, 1649,High Priest Margaretha@MG_SAFETYWALL,attack,12,10,1000,0,5000,yes,self,always,0,,,,,,, 1649,High Priest Margaretha@AL_PNEUMA,attack,25,1,5000,0,10000,yes,self,longrangeattacked,,,,,,,19, 1649,High Priest Margaretha@AL_PNEUMA,chase,25,1,5000,0,10000,yes,self,longrangeattacked,,,,,,,19, @@ -3382,8 +3382,8 @@ 1661,Errende Ebecee@AL_HEAL,chase,28,11,10000,500,5000,yes,self,myhpltmaxrate,30,,,,,,3, 1661,Errende Ebecee@NPC_HOLYATTACK,attack,189,3,1000,0,5000,yes,target,always,0,,,,,,, 1661,Errende Ebecee@NPC_SILENCEATTACK,attack,178,4,1000,700,5000,no,target,always,0,,,,,,, -1661,Errende Ebecee@AL_DECAGI,attack,30,11,500,1000,5000,no,target,always,0,,,,,,29, -1661,Errende Ebecee@AL_DECAGI,chase,30,11,500,1000,5000,no,target,always,0,,,,,,29, +1661,Errende Ebecee@AL_DECAGI,attack,30,48,500,1000,5000,no,target,always,0,,,,,,29, +1661,Errende Ebecee@AL_DECAGI,chase,30,48,500,1000,5000,no,target,always,0,,,,,,29, 1662,Kavach Icarus@AC_DOUBLE,attack,46,10,500,1000,5000,no,target,always,0,,,,,,, 1662,Kavach Icarus@AC_DOUBLE,attack,46,10,10000,1000,1000,no,target,skillused,46,,,,,,, 1662,Kavach Icarus@AC_DOUBLE,chase,46,10,2000,1000,5000,no,target,always,0,,,,,,, @@ -3674,8 +3674,8 @@ 1707,Thanatos Dolor@NPC_MENTALBREAKER,chase,159,2,500,0,5000,yes,target,always,0,,,,,,30, 1707,Thanatos Dolor@NPC_DARKTHUNDER,attack,341,9,500,1000,5000,no,target,always,0,,,,,,, 1707,Thanatos Dolor@NPC_DARKTHUNDER,chase,341,9,500,1000,5000,no,target,always,0,,,,,,, -1707,Thanatos Dolor@AL_DECAGI,chase,30,11,2000,0,10000,yes,target,always,0,,,,,,, -1707,Thanatos Dolor@AL_DECAGI,attack,30,11,2000,0,10000,yes,target,always,0,,,,,,, +1707,Thanatos Dolor@AL_DECAGI,chase,30,48,2000,0,10000,yes,target,always,0,,,,,,, +1707,Thanatos Dolor@AL_DECAGI,attack,30,48,2000,0,10000,yes,target,always,0,,,,,,, 1707,Thanatos Dolor@AL_HEAL,attack,28,8,1000,0,5000,yes,friend,friendhpltmaxrate,40,,,,,,3, 1707,Thanatos Dolor@AL_HEAL,attack,28,8,1000,0,5000,yes,self,myhpltmaxrate,40,,,,,,3, 1707,Thanatos Dolor@AL_HEAL,idle,28,8,1000,0,5000,yes,friend,friendhpltmaxrate,40,,,,,,3, @@ -3740,8 +3740,8 @@ 1712,Thanatos Dolor@NPC_MENTALBREAKER,chase,159,2,500,1000,10000,no,target,always,0,,,,,,, 1712,Thanatos Dolor@NPC_DARKTHUNDER,attack,341,9,500,1000,5000,no,target,always,0,,,,,,, 1712,Thanatos Dolor@NPC_DARKTHUNDER,chase,341,9,500,1000,5000,no,target,always,0,,,,,,, -1712,Thanatos Dolor@AL_DECAGI,chase,30,11,2000,0,10000,yes,target,always,0,,,,,,, -1712,Thanatos Dolor@AL_DECAGI,attack,30,11,2000,0,10000,yes,target,always,0,,,,,,, +1712,Thanatos Dolor@AL_DECAGI,chase,30,48,2000,0,10000,yes,target,always,0,,,,,,, +1712,Thanatos Dolor@AL_DECAGI,attack,30,48,2000,0,10000,yes,target,always,0,,,,,,, 1712,Thanatos Dolor@AL_HEAL,attack,28,11,1000,0,5000,yes,friend,friendhpltmaxrate,70,,,,,,3, 1712,Thanatos Dolor@AL_HEAL,attack,28,11,1000,0,5000,yes,self,myhpltmaxrate,70,,,,,,3, 1712,Thanatos Dolor@AL_HEAL,idle,28,9,1000,0,5000,yes,friend,friendhpltmaxrate,70,,,,,,3, @@ -3982,8 +3982,8 @@ 1754,Skeggiold@AL_HEAL,idle,28,9,5000,500,5000,no,self,myhpltmaxrate,30,,,,,,18, 1754,Skeggiold@MG_THUNDERSTORM,attack,21,7,1000,1500,10000,no,target,always,0,,,,,,, 1754,Skeggiold@MG_THUNDERSTORM,chase,21,7,1000,1500,10000,no,target,always,0,,,,,,, -1754,Skeggiold@AL_DECAGI,attack,30,11,500,0,30000,no,target,always,0,,,,,,29, -1754,Skeggiold@AL_DECAGI,chase,30,11,500,0,30000,no,target,always,0,,,,,,29, +1754,Skeggiold@AL_DECAGI,attack,30,48,500,0,30000,no,target,always,0,,,,,,29, +1754,Skeggiold@AL_DECAGI,chase,30,48,500,0,30000,no,target,always,0,,,,,,29, 1754,Skeggiold@NPC_PETRIFYATTACK,attack,180,2,500,500,5000,no,target,always,0,,,,,,3, 1754,Skeggiold@NPC_PETRIFYATTACK,chase,180,2,500,500,5000,no,target,always,0,,,,,,3, 1754,Skeggiold@RG_STRIPARMOR,attack,217,3,500,0,5000,yes,target,always,0,,,,,,6, @@ -4116,7 +4116,7 @@ 1769,Agav@MG_SAFETYWALL,attack,12,10,2000,0,5000,yes,self,always,0,,,,,,, 1769,Agav@NPC_CURSEATTACK,attack,181,5,500,800,5000,no,target,always,0,,,,,,30, 1769,Agav@NPC_CURSEATTACK,chase,181,5,500,800,5000,no,target,always,0,,,,,,30, -1769,Agav@AL_DECAGI,chase,30,11,2000,0,10000,yes,target,always,0,,,,,,, +1769,Agav@AL_DECAGI,chase,30,48,2000,0,10000,yes,target,always,0,,,,,,, 1769,Agav@PR_LEXDIVINA,attack,76,1,1000,0,5000,yes,target,always,0,,,,,,36, 1769,Agav@PR_LEXDIVINA,chase,76,1,1000,0,5000,yes,target,always,0,,,,,,36, 1769,Agav@PR_LEXDIVINA,attack,76,1,5000,0,5000,yes,target,casttargeted,0,,,,,,36, @@ -4275,7 +4275,7 @@ 1786,Agav@MG_SAFETYWALL,attack,12,10,2000,0,5000,yes,self,always,0,,,,,,, 1786,Agav@NPC_CURSEATTACK,attack,181,5,500,800,5000,no,target,always,0,,,,,,30, 1786,Agav@NPC_CURSEATTACK,chase,181,5,500,800,5000,no,target,always,0,,,,,,30, -1786,Agav@AL_DECAGI,chase,30,11,2000,0,10000,yes,target,always,0,,,,,,, +1786,Agav@AL_DECAGI,chase,30,48,2000,0,10000,yes,target,always,0,,,,,,, 1786,Agav@PR_LEXDIVINA,attack,76,1,1000,0,5000,yes,target,always,0,,,,,,36, 1786,Agav@PR_LEXDIVINA,chase,76,1,1000,0,5000,yes,target,always,0,,,,,,36, 1786,Agav@PR_LEXDIVINA,attack,76,1,5000,0,5000,yes,target,casttargeted,0,,,,,,36, diff --git a/db/packet_db.txt b/db/packet_db.txt index cc3bcc353..34c488295 100644 --- a/db/packet_db.txt +++ b/db/packet_db.txt @@ -909,7 +909,7 @@ packet_ver: 20 0x0285,6 0x0286,4 0x0287,-1 -0x0288,6 +0x0288,6,cashshopbuy,2:4 0x0289,8 0x028a,18 0x028b,-1 diff --git a/db/skill_cast_db.txt b/db/skill_cast_db.txt index d2fe73298..3b694d8a1 100644 --- a/db/skill_cast_db.txt +++ b/db/skill_cast_db.txt @@ -88,7 +88,7 @@ //-- AL_HOLYWATER 31,800,400,500,0,0,0,0 //-- AL_CRUCIS -32,350,150,2000,0,0,0,0 +32,350,150,2000,0,60000,0 //-- AL ANGELUS 33,350,150,3500,0,0,30000:60000:90000:120000:150000:180000:210000:240000:270000:300000,0 //-- AL_BLESSING diff --git a/db/skill_nocast_db.txt b/db/skill_nocast_db.txt index 47ec1226b..fe7702560 100644 --- a/db/skill_nocast_db.txt +++ b/db/skill_nocast_db.txt @@ -21,29 +21,39 @@ // Example: // 8,6 = Endure cannot be used in PvP and GvG maps (2+4) +//PVP +1013,2 //BS_GREED + //GVG 26,4 //AL_TELEPORT 27,4 //AL_WARP 87,4 //WZ_ICEWALL 150,4 //TF_BACKSLIDING -290,4 //SA_ABRACADABRA +219,4 //RG_INTIMIDATE +336,4 //WE_CALLPARTNER 361,4 //HP_ASSUMPTIO 362,4 //HP_BASILICA 395,4 //CG_MOONLIT +409,4 //WE_CALLPARENT +410,4 //WE_CALLBABY 491,4 //CR_CULTIVATION 530,4 //NJ_KIRIKAGE 691,4 //CASH_ASSUMPTIO +1013,2048 //BS_GREED //BATTLEGROUND 26,8 //AL_TELEPORT 27,8 //AL_WARP 87,8 //WZ_ICEWALL 150,8 //TF_BACKSLIDING +219,8 //RG_INTIMIDATE 264,8 //MO_BODYRELOCATION +336,8 //WE_CALLPARTNER 361,8 //HP_ASSUMPTIO 362,8 //HP_BASILICA 395,8 //CG_MOONLIT -396,8 //CG_MARIONETTE +409,8 //WE_CALLPARENT +410,8 //WE_CALLBABY 491,8 //CR_CULTIVATION 411,8 //TK_RUN 426,8 //TK_HIGHJUMP @@ -72,19 +82,20 @@ 79,16 //PR_MAGNUS //Zone 1 - Aldebaran Turbo Track -219,32 //RG_INTIMIDATE +8,32 //SM_ENDURE 26,32 //AL_TELEPORT 27,32 //AL_WARP -51,32 //TF_HIDING -135,32 //AS_CLOAKING -389,32 //ST_CHASEWALK 35,32 //AL_CURE +51,32 //TF_HIDING 87,32 //WZ_ICEWALL +135,32 //AS_CLOAKING +219,32 //RG_INTIMIDATE +264,32 //MO_BODYRELOCATION +357,32 //LK_CONCENTRATION 359,32 //LK_BERSERK 362,32 //HP_BASILICA +389,32 //ST_CHASEWALK 395,32 //CG_MOONLIT -357,32 //LK_CONCENTRATION -264,32 //MO_BODYRELOCATION //Zone 2 - Jail 421,64 //TK_JUMPKICK @@ -96,6 +107,7 @@ //Zone 4 - WoE:SE 426,256 //TK_HIGHJUMP +290,256 //SA_ABRACADABRA //Zone 5 - Sealed Shrine 12,512 //MG_SAFETYWALL @@ -104,9 +116,15 @@ 361,512 //HP_ASSUMPTIO 691,512 //CASH_ASSUMPTIO -//Zone 6 -Endless Tower +//Zone 6 - Endless Tower, Orc's Memory, Nidhoggur's Nest 26,1024 //AL_TELEPORT 87,1024 //WZ_ICEWALL 219,1024 //RG_INTIMIDATE 405,1024 //PF_SPIDERWEB 674,1024 //NPC_EXPULSION + +//Zone 7 - Towns +232,2048 //AM_CANNIBALIZE +233,2048 //AM_SPHEREMINE +491,2048 //CR_CULTIVATION +1013,2048 //BS_GREED diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 42ccbcbbe..1afff5377 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -181,6 +181,8 @@ //= Documented special map names recognized by 'warpguild'. [Ai4rei] //= 3.45.20110709 //= Added 'getmercinfo' command. [Ai4rei] +//= 3.46.20110810 +//= Added information on OnTouchNPC and 'unitwarp' special case [Skotlex] //========================================================= This document is a reference manual for all the scripting commands and functions @@ -423,7 +425,8 @@ spanning triggerX cells in every direction across X and triggerY in every direction across Y. Walking into that area will trigger the NPC. If no 'OnTouch:' special label is present in the NPC code, the execution will start from the beginning of the script, otherwise, it will start from the 'OnTouch:' -label. +label. Monsters can also trigger the NPC, though the label 'OnTouchNPC:' is +used in this case. The code part is the script code that will execute whenever the NPC is triggered. It may contain commands and function calls, descriptions of which @@ -574,7 +577,9 @@ Variables --------- The meat of every programming language is variables - places where you store -data. +data. + +In the eAthena scripting language, variable names are not case sensitive. Variables are divided into and uniquely identified by the combination of: prefix - determines the scope and extent (or lifetime) of the variable @@ -611,7 +616,9 @@ nothing - A permanent variable attached to the character, the default variable "." - A NPC variable. They exist in the NPC and disappear when the server restarts or the NPC is reloaded. Can be accessed from inside the NPC or by calling - 'getvariableofnpc'. + 'getvariableofnpc'. Function objects can also have .variables which + are accessible from inside the function, however 'getvariableofnpc' + does NOT work on function objects. ".@" - A scope variable. They are unique to the instance and scope. Each instance has it's own scope that ends when the script ends. Calling a function with @@ -1301,6 +1308,9 @@ Example(s): //This will set the .var variable of TargetNPC to 1. set getvariableofnpc(.var,"TargetNPC"),1; +Note: even though function objects can have .variables, +getvariableofnpc will not work on them. + --------------------------------------- *goto