From 6a6aa10721249ce4e11660fedc1915a85564cef1 Mon Sep 17 00:00:00 2001 From: ai4rei Date: Fri, 7 Oct 2011 21:35:12 +0000 Subject: [PATCH] * Merged changes from trunk [14895:14966/trunk]. git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/renewal@14967 54d463be-8e91-2dee-dedb-b68131a5f0ec --- 3rdparty/CMakeLists.txt | 1 + 3rdparty/cmake/FindFunctionLibrary.cmake | 47 + 3rdparty/{mysql => cmake}/FindMYSQL.cmake | 2 + 3rdparty/{pcre => cmake}/FindPCRE.cmake | 5 +- 3rdparty/msinttypes/CMakeLists.txt | 5 +- 3rdparty/msinttypes/include/stdint.h | 4 + 3rdparty/mysql/CMakeLists.txt | 1 - 3rdparty/pcre/CMakeLists.txt | 1 - 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 + 88 files changed, 4489 insertions(+), 2722 deletions(-) create mode 100644 3rdparty/cmake/FindFunctionLibrary.cmake rename 3rdparty/{mysql => cmake}/FindMYSQL.cmake (95%) rename 3rdparty/{pcre => cmake}/FindPCRE.cmake (94%) 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 3e7cb4cc48..ebbac481aa 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 0000000000..f1d32001ef --- /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/mysql/FindMYSQL.cmake b/3rdparty/cmake/FindMYSQL.cmake similarity index 95% rename from 3rdparty/mysql/FindMYSQL.cmake rename to 3rdparty/cmake/FindMYSQL.cmake index 0a07f3612a..c18e8d6378 100644 --- a/3rdparty/mysql/FindMYSQL.cmake +++ b/3rdparty/cmake/FindMYSQL.cmake @@ -10,6 +10,7 @@ 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" ) @@ -18,6 +19,7 @@ find_library( MYSQL_LIBRARIES 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 ) diff --git a/3rdparty/pcre/FindPCRE.cmake b/3rdparty/cmake/FindPCRE.cmake similarity index 94% rename from 3rdparty/pcre/FindPCRE.cmake rename to 3rdparty/cmake/FindPCRE.cmake index cb4d9177ba..2215451d1e 100644 --- a/3rdparty/pcre/FindPCRE.cmake +++ b/3rdparty/cmake/FindPCRE.cmake @@ -6,8 +6,9 @@ # PCRE_FOUND - True if pcre found. -find_path( PCRE_INCLUDE_DIR pcre.h ) - +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 ) diff --git a/3rdparty/msinttypes/CMakeLists.txt b/3rdparty/msinttypes/CMakeLists.txt index f17c6f596b..c11c1d72a1 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 d02608a597..cbb023bf93 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 f4996907ff..e85fd626d5 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/pcre/CMakeLists.txt b/3rdparty/pcre/CMakeLists.txt index 70448d40e2..57465a46ca 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/lib/libpcre.dll.a b/3rdparty/pcre/lib/libpcre.dll.a new file mode 100644 index 0000000000000000000000000000000000000000..fe69e4e5771766bd0b47cce01f0b71587dd0934c GIT binary patch literal 19068 zcmeHPOOGVQ5ss~W%zC`+`w7cZjD|N}`Z?3XV=kwK=ivGm>LTJM6C%^=N|w>OP?|Iz6Bt9>>|?>e*_?U^6yMfeF;GH%ps=d z8UREuyh7C9TAdW_{@Q5NAC3nb1@!xG7lSp!hW@0uu|6rNWVo@_H(BHt?-i>SpR>fD zOg1NW0q3z~b#r6OD&Q>Dq5p0%*&c3=RiVohx$WuB+WSs!V`Zd6dl-a>McZ zrX#@&QFf!4_P2MgZ%-$~@s0jyxb0ReRvg~vJlwejxXT1jyh7BsUyL#1Rl8KiyiYt~ zyt8q=(1<80)NBIcnrUHB)1X}3xxOTqo^9V~W477xV#v&xwBu9WL47Ri06GUlx0mKEz5Ui?L6 z%z0N`Qs=d=qJl<-U6%uxKd3n3t!P9HM?9Ze!!6?0a4v&$$TuopYW{iAbB#uF&$V09 zgyyE_KE)>=M#6qlJ=YRhJe)ng0mCV6OJW_AYsooSd-lu;>EyDh#yXg7o6Nn=pGPoBnLenb7)-t|~-SiRYEVnG| za=$NP6^@G6;s{KO_oh}oi2oJReWX1qVQ=;cE=ZwhnA%jJ{@ZBok{}PyJtt5Yy zb;iVH!h|rKRl$U;%umLI^a4DeoH5Z$$3)MzarM#@cL+>~35fUxZ>^r7FJEZ|qbH8D zLa_A270IDf29My8CSE1;Dqm%=C2uXKsL4Kx68IW7UlX=w?>1{a83;a^4Ke{turCD37Tx6_pC<^`N7G4B?-W@kJMy zA&wce@vLHHWpOr7rAVA~X26L(V`M*s<^*Lr#j2pb%u95NKd-?XqB`X!7L?3u9G&tF z%9YG(v`#sTGBp43(ypDqpzvV@AgTOT%u?vR%KI=lxRcnJXgmnH0D6KaIM3nH)*D_d zRflOjz6TceS=%#UC7j#-+Ocxp#)^m)(r8o(D|c{(EUYvohfWzhjmHox9QHH;Jw}S; zMsd=b0Vm6~wLRw;FM1tE;aom!_Y!n+bmKWo44mK#7x)7Js*dXsDb;ff>VMMP^j>WfIMQx%Y>qeVAj4f3u zgD3EkwTZo|YOQoRY!5W7QJOQvTYDjD>Jo!L&8QKpu2r=?CnPWoT5<&yJZC`u3!^1i zJeG_&LeitJ-PTIrp>*)u-A}LBx*zL&vuu@y>=z|@D%C4_TrSWn560!RUb&3#O4Tc; z7$MI70$z5%R$2X`=0gTCkBk20Lk2J71tTWXEZbB?i{ofYkJWaYp}uM0i0y}_qt>YA zd!XsGC5H_yMbqWDT!5x~<8m5JxNRvJO(!F0!rLp0Bx)NagCxBej@%6XfX4`u9Dm0F z5thX9lOEUYcEYuw9*)s|__1Rl`5yQwS>x3q1&TkAmqRv^k~}G#1^Brdm(%#k@foSw z=!Auz$j+w9;%I?73X{PR#bi{<;7z==a1?1;pq8RCacrf>fxE3R4qO-Ablk_5-1Amd zzeq)L45oStPaERSoYSt7~xjSwDVJn3z)Rn)+sJYyJakyo{orGKdUX7izR2m78J!b zQhHoEwxg3~>18uE*$C&9m(18Ge*J@#^k!ntjO`}M{5LMAyNG6X6z8@h4VYCkJ3V8g zUA{B}^wO@K|BXS8U{`0oLPej=dc{3f#WSF0I;IJ=4l?vA`5vpDjsHiTt*)fY=+5t> zj193hwyOS2dem9&@HM|ki*Nbmb%{oL)VZ?~+MT-W-bT7qgl8v39D2|{R;>ztXu3VR>&0z~ce*B`Uy5}xw zYK^b^d&!|w2Cw0fW6A<5ezO8Bg#vLzrAL!HD#FLTbYF*lzp}@#$xF~OOFTGSL9dHm$sDv) zSFfc1vPGiBnR6Rn+y0<8Vd5_jITnZZ v>Nw7c`tt}Ag3 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 f09e03feae..97cd2639c2 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 26351612cc..43c92fc742 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 11bb215a26..c6a5159d51 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 0000000000..b6693eaf27 --- /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 6de962dff2..908ea44764 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 fbc5e3a115..e26d187e8f 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 197a4a4ed5..a9e4c289ae 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 4883369e43..23b652d21f 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 e73c7089d8..6e8b653099 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 57b16f0c76..ba0bd90288 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 cc3bcc3534..34c4882959 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 d2fe732984..3b694d8a1d 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 47ec1226b1..fe77025607 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 42ccbcbbe9..1afff5377e 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