Compare commits

...

72 Commits

Author SHA1 Message Date
dannuic 974dbcd6ff Found and added task packets (#5101)
Build / Linux (push) Has been cancelled
Build / Windows (push) Has been cancelled
2026-06-17 21:22:09 -07:00
KimLS dc559710ed Merge master in, with fixes
Build / Linux (push) Has been cancelled
Build / Windows (push) Has been cancelled
2026-06-16 21:40:39 -07:00
dannuic 168995a5b5 Full Packet Review for Known Conversion (#5100)
Build / Linux (push) Has been cancelled
Build / Windows (push) Has been cancelled
2026-06-07 00:12:57 -07:00
brainiac 11a8e46ee8 CMake cleanup (#5082)
Build / Linux (push) Has been cancelled
Build / Windows (push) Has been cancelled
2026-05-17 15:05:46 -07:00
KimLS 7d98b10c18 Merge branch 'master' into develop
Build / Linux (push) Has been cancelled
Build / Windows (push) Has been cancelled
2026-05-07 20:56:48 -07:00
dannuic 65330af50e Validating packets (starting with loot) (#5079) 2026-05-07 20:56:10 -07:00
dannuic 99f99c8b8e Fixed the buff database entries and updated database migrations (#5076)
Build / Linux (push) Has been cancelled
Build / Windows (push) Has been cancelled
2026-05-05 21:23:43 -07:00
dannuic e5ce882b9d Updated the database scripts and re-synced the database bindings (#5077)
Build / Linux (push) Has been cancelled
Build / Windows (push) Has been cancelled
2026-05-03 21:37:24 -07:00
dannuic 18df055f16 Add Buff infrastructure to go through different logic paths from different patches (#5073)
Build / Linux (push) Waiting to run
Build / Windows (push) Waiting to run
2026-05-02 21:53:26 -07:00
KimLS c253734c57 Merge branch 'tob_patch' into develop
Build / Linux (push) Has been cancelled
Build / Windows (push) Has been cancelled
2026-04-30 00:06:37 -07:00
KimLS 9cc3d492ce Merge branch 'master' into develop
Build / Linux (push) Has been cancelled
Build / Windows (push) Has been cancelled
2026-04-28 20:39:33 -07:00
KimLS accda849ac Merge fix
Build / Linux (push) Waiting to run
Build / Windows (push) Waiting to run
2026-04-28 00:15:35 -07:00
dannuic 743fd45b17 Added component-based patch system (#5070)
Build / Linux (push) Has been cancelled
Build / Windows (push) Has been cancelled
2026-04-25 23:29:12 -07:00
Knightly 0ada77f340 Login Updates for TOB (#5068)
Build / Linux (push) Has been cancelled
Build / Windows (push) Has been cancelled
2026-04-20 22:45:58 -07:00
Alex 9c8107ce96 Merge pull request #5069 from Knightly1/update_ci
CI tob_patch branch
2026-04-20 21:13:28 -07:00
Knightly 4581059e78 CI tob_patch branch 2026-04-20 16:29:00 -10:00
KimLS dceec36fad Merge branch 'master' into tob_patch 2026-04-20 18:41:45 -07:00
Alex 3035e906fe Merge pull request #5067 from dannuic/tob_fullylogin
Validated up to OP_SimpleMessage
2026-04-20 18:40:08 -07:00
dannuic 0e0162edc0 Added spell links to interrupt and fizzle messages 2026-04-19 23:07:02 -06:00
dannuic af06fb703c confirmed consider 2026-04-18 12:37:56 -06:00
dannuic c5d089de68 Validated message and interrupt packets, needs refactor for full functionality 2026-04-18 12:08:54 -06:00
dannuic b8ee811ac6 Fixed unmemming spells on cast 2026-04-18 06:53:37 -06:00
dannuic 08cdd8234d Validated to OP_CastSpell -- still causes a spell to unmem after cast 2026-04-18 00:08:18 -06:00
dannuic 3bb7f94713 Fixed memorization for parity with RoF2 2026-04-17 23:35:34 -06:00
dannuic ec5a9d0bd4 Validated up to OP_MemorizeSpell (still needs testing in client) 2026-04-17 18:07:39 -06:00
dannuic 2da6d3f37c Fixed item index mapping 2026-04-17 14:57:35 -06:00
dannuic 6a7baf8f1c Validated through OP_SetServerFilter 2026-04-17 11:56:46 -06:00
dannuic a8e3ab41e1 Validated up to OP_ExpUpdate 2026-04-16 17:13:17 -06:00
dannuic fe4146050f Validated up to OP_UpdateAA 2026-04-16 16:51:41 -06:00
dannuic 36ea946255 Attempt to fix opcodes formatting 2026-04-16 16:28:08 -06:00
dannuic f29d87aced Validated up to OP_WorldObjectsSent 2026-04-16 15:59:54 -06:00
KimLS 767f04731b Merge fix 2026-04-15 22:06:39 -07:00
Alex 8e7964b835 Merge pull request #5066 from dannuic/tob_loginpatches
TOB packet work through zone in
2026-04-15 22:03:39 -07:00
dannuic a9333fb51b Added padding into client position struct 2026-04-15 22:52:21 -06:00
dannuic 27ad857ee5 Fixed spawn position struct 2026-04-15 22:51:23 -06:00
dannuic 5549daedb1 Some ZoneChange work 2026-04-15 21:10:41 -05:00
dannuic b5cc8dfab1 Verified and corrected packets through character select 2026-04-14 13:39:28 -05:00
dannuic 865f619e21 Validated and filled out SendMaxCharacters 2026-04-13 22:56:49 -06:00
dannuic a4785d30e0 Added some comments for trivial opcodes 2026-04-13 17:48:11 -05:00
dannuic a54711817d Validated EnterWorld (in & out) 2026-04-13 17:34:21 -05:00
dannuic 139575661d Validated SendCharInfo 2026-04-13 17:10:38 -05:00
dannuic 8dd24f4a70 Updated comments for LogServer 2026-04-13 15:47:13 -05:00
KimLS 517d9419a7 Update opcode tracker 2026-04-12 17:03:29 -07:00
KimLS a789b22fc7 Change from obr to tob dir, added a status doc 2026-04-12 13:16:23 -07:00
KimLS 6e1fe45090 Merge branch 'tob_patch' of https://github.com/EQEmu/EQEmu into tob_patch 2026-04-09 20:41:53 -07:00
KimLS 492d848f6a adjust offsets by 2 in OP_LogServer on tob, I had done it simply from assembly and misread the register and it's off by 2 for each one. 2026-04-09 20:41:40 -07:00
Alex ce5e216be9 Merge pull request #5058 from dannuic/tob_zonein
TOB zonein + all opcodes for TOB
2026-04-09 00:01:53 -07:00
dannuic 48e0847f21 renamed straggler file for tob 2026-04-08 23:06:09 -05:00
dannuic 7f42add39b Finished up player profile 2026-04-08 22:13:37 -05:00
dannuic 49161a618f Added up to DoN currency (not inclusive) 2026-04-08 17:57:08 -05:00
dannuic aac7bbf48a Fixed enough to allow zoning 2026-04-08 15:57:37 -05:00
dannuic 2c4d82f1b9 Fixed packed structs 2026-04-08 10:26:36 -05:00
dannuic dea5031d83 WIP attempts at zoning in 2026-04-07 23:35:16 -05:00
KimLS 30c9c6317f Update OP_LogServer
Fix the source group matching in common lib
Added a couple packet structure documentations I had looked at.
2026-04-06 20:51:52 -07:00
Alex c7eea72997 Merge pull request #5057 from dannuic/tob_charactercreate
Implemented through character creation packets
2026-04-06 14:51:18 -07:00
dannuic 28e6ef29d4 Corrected missing find/replace for steam_latest 2026-04-06 16:23:06 -05:00
dannuic a6f4438c0d Removed the _t for consistency 2026-04-06 16:15:20 -05:00
dannuic e5a111d8d8 Implemented through character creation packets 2026-04-06 16:09:59 -05:00
KimLS abbaf6f9a1 update opcodes 2026-04-04 16:47:41 -07:00
KimLS ccdc9f2e43 fix dumb compile errors from my hand merge 2026-04-04 15:48:43 -07:00
KimLS a9effc7bac A couple laurion renames i missed 2026-04-04 15:28:59 -07:00
KimLS a2b3b36cf1 WIP, porting old laurion changes to tob 2026-04-04 15:11:21 -07:00
KimLS 75ddf8dfc3 Merge branch 'master' into obr_login 2026-04-04 14:14:47 -07:00
KimLS a3802ff257 opcode fixes 2026-04-02 11:50:08 -07:00
KimLS ca23b8612e WIP world select packets 2026-03-30 21:54:15 -07:00
KimLS 485ae4809d some changes, working on login 2026-03-30 18:36:13 -07:00
KimLS 452407ed67 Fix seq in on login handshake 2026-03-26 21:59:53 -07:00
KimLS aa1c481f65 update opcodes 2026-03-26 13:01:24 -07:00
KimLS 780dcdab5a Renamed "larion" to "steam latest" 2026-03-26 12:50:46 -07:00
KimLS 16ec08e71c Some investigation on packets, mostly the same as rof2 / laurion but not entirely. 2026-03-25 18:08:46 -07:00
KimLS 0024073cee Login exploration 2026-03-24 23:59:42 -07:00
KimLS 37b8428c48 Starting research 2026-03-24 23:22:08 -07:00
287 changed files with 19640 additions and 5662 deletions
+5 -5
View File
@@ -39,7 +39,7 @@ jobs:
- name: Configure - name: Configure
run: | run: |
cmake -S . -B build -G Ninja \ cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DEQEMU_BUILD_TESTS=ON \ -DEQEMU_BUILD_TESTS=ON \
@@ -69,7 +69,7 @@ jobs:
- name: Enable long paths - name: Enable long paths
run: git config --global core.longpaths true run: git config --global core.longpaths true
- name: Setup MSVC environment - name: Setup MSVC environment
uses: TheMrMilchmann/setup-msvc-dev@v4 uses: TheMrMilchmann/setup-msvc-dev@v4
with: with:
@@ -89,7 +89,7 @@ jobs:
shell: pwsh shell: pwsh
run: | run: |
cmake -S . -B build -G "Visual Studio 18 2026" -A x64 ` cmake -S . -B build -G "Visual Studio 18 2026" -A x64 `
-DCMAKE_BUILD_TYPE=RelWithDebInfo ` -DCMAKE_BUILD_TYPE=Release `
-DEQEMU_BUILD_TESTS=ON ` -DEQEMU_BUILD_TESTS=ON `
-DEQEMU_BUILD_LOGIN=ON ` -DEQEMU_BUILD_LOGIN=ON `
-DEQEMU_BUILD_LUA=ON ` -DEQEMU_BUILD_LUA=ON `
@@ -98,8 +98,8 @@ jobs:
- name: Build - name: Build
shell: pwsh shell: pwsh
run: cmake --build build --config RelWithDebInfo --target ALL_BUILD -- /m run: cmake --build build --config Release --target ALL_BUILD -- /m
- name: Test - name: Test
working-directory: build working-directory: build
run: ./bin/RelWithDebInfo/tests.exe run: ./bin/Release/tests.exe
+3
View File
@@ -69,3 +69,6 @@ compile_flags.txt
# CMake Files # CMake Files
cmake-build-relwithdebinfo/* cmake-build-relwithdebinfo/*
skill-caps.diff skill-caps.diff
# Analysis files
tob/packet_analysis
+22 -17
View File
@@ -18,6 +18,17 @@ if(NOT CMAKE_TOOLCHAIN_FILE)
endif() endif()
endif() endif()
# Uncomment to generate just the standard Debug and Release configurations
#set(CMAKE_BUILD_TYPE "Debug")
#set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(dummy "${CMAKE_C_COMPILER}")
project(EQEmu project(EQEmu
VERSION 24.10.3 VERSION 24.10.3
LANGUAGES CXX LANGUAGES CXX
@@ -27,34 +38,28 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
#explicitly set CMP0167 for Find Boost #explicitly set CMP0167 for Find Boost
if(POLICY CMP0167) if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW) cmake_policy(SET CMP0167 NEW)
endif() endif()
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) option(EQEMU_BUILD_PCH "Build with precompiled headers" ON)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Build type")
endif()
set(CMAKE_CXX_STANDARD 20) include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
option(EQEMU_BUILD_PCH "Build with precompiled headers (Windows)" ON)
if(MSVC) if(MSVC)
add_compile_options(/bigobj) # Always build with debug symbols
add_compile_definitions(_CRT_SECURE_NO_WARNINGS NOMINMAX WIN32_LEAN_AND_MEAN CRASH_LOGGING) add_compile_options("$<$<CONFIG:RELEASE>:/Zi>")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") add_link_options("$<$<CONFIG:RELEASE>:/DEBUG /OPT:REF /OPT:ICF>")
option(EQEMU_DISABLE_MSVC_WARNINGS "Disable MSVC compile warnings." OFF) add_compile_options(/bigobj /MP)
if(EQEMU_DISABLE_MSVC_WARNINGS) add_compile_definitions(_CRT_SECURE_NO_WARNINGS NOMINMAX WIN32_LEAN_AND_MEAN CRASH_LOGGING)
add_compile_options(/W0 /wd4005 /wd4996 /nologo /Os)
endif()
option(EQEMU_MSVC_DEBUG_CRT "Use the debug CRT on MSVC debug builds" OFF) option(EQEMU_MSVC_DEBUG_CRT "Use the debug CRT on MSVC debug builds" OFF)
if(EQEMU_MSVC_DEBUG_CRT) if(EQEMU_MSVC_DEBUG_CRT)
add_compile_definitions(_CRT_DBG_MAP_ALLOC) add_compile_definitions(_CRT_DBG_MAP_ALLOC)
endif() endif()
else() else()
add_compile_options("$<$<CONFIG:RELEASE>:-g>")
add_compile_definitions(HAS_UNION_SEMUN) add_compile_definitions(HAS_UNION_SEMUN)
endif() endif()
@@ -71,7 +76,7 @@ if(UNIX)
endif() endif()
endif() endif()
find_package(Boost REQUIRED COMPONENTS dynamic_bitset foreach tuple) find_package(Boost REQUIRED COMPONENTS dynamic_bitset foreach tuple CONFIG REQUIRED)
find_package(cereal CONFIG REQUIRED) find_package(cereal CONFIG REQUIRED)
find_package(fmt CONFIG REQUIRED) find_package(fmt CONFIG REQUIRED)
find_package(glm CONFIG REQUIRED) find_package(glm CONFIG REQUIRED)
+73 -48
View File
@@ -1,49 +1,74 @@
{ {
"version": 3, "version": 3,
"cmakeMinimumRequired": { "cmakeMinimumRequired": {
"major": 3, "major": 3,
"minor": 19, "minor": 20,
"patch": 0 "patch": 0
}, },
"configurePresets": [ "configurePresets": [
{ {
"name": "linux-debug", "name": "linux",
"displayName": "Linux Debug", "displayName": "Linux-Ninja",
"generator": "Ninja", "generator": "Ninja",
"binaryDir": "${sourceDir}/build", "binaryDir": "${sourceDir}/build",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug", "EQEMU_BUILD_TESTS": "ON"
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON", }
"CMAKE_C_COMPILER_LAUNCHER": "ccache", },
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache", {
"EQEMU_BUILD_LOGIN": "ON", "name": "linux-clang",
"EQEMU_BUILD_TESTS": "ON", "displayName": "Linux-Ninja (Clang)",
"EQEMU_ADD_PROFILER": "ON" "generator": "Ninja",
} "binaryDir": "${sourceDir}/build",
}, "cacheVariables": {
{ "EQEMU_BUILD_TESTS": "ON",
"name": "linux-release", "CMAKE_C_COMPILER": "clang",
"displayName": "Linux Release", "CMAKE_CXX_COMPILER": "clang++"
"generator": "Ninja", }
"binaryDir": "${sourceDir}/build/release", },
"cacheVariables": { {
"CMAKE_BUILD_TYPE": "Release", "name": "linux-ccache",
"CMAKE_C_COMPILER_LAUNCHER": "ccache", "displayName": "Linux-Ninja (Ccache)",
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache", "generator": "Ninja",
"EQEMU_BUILD_LOGIN": "ON" "binaryDir": "${sourceDir}/build",
} "cacheVariables": {
}, "CMAKE_C_COMPILER_LAUNCHER": "ccache",
{ "CMAKE_CXX_COMPILER_LAUNCHER": "ccache",
"name": "win-msvc", "EQEMU_BUILD_TESTS": "ON"
"displayName": "Windows MSVC (VS 2022)", }
"generator": "Visual Studio 17 2022", },
"binaryDir": "${sourceDir}/build/${presetName}", {
"architecture": { "value": "x64" }, "name": "linux-clang-ccache",
"cacheVariables": { "displayName": "Linux-Ninja (Clang, Ccache)",
"CMAKE_CONFIGURATION_TYPES": "Debug;Release", "generator": "Ninja",
"EQEMU_BUILD_LOGIN": "ON", "binaryDir": "${sourceDir}/build",
"EQEMU_BUILD_TESTS": "ON" "cacheVariables": {
} "CMAKE_C_COMPILER_LAUNCHER": "ccache",
} "CMAKE_CXX_COMPILER_LAUNCHER": "ccache",
] "EQEMU_BUILD_TESTS": "ON",
} "CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++"
}
},
{
"name": "win-msvc-2022",
"displayName": "Windows MSVC (VS 2022)",
"generator": "Visual Studio 17 2022",
"binaryDir": "${sourceDir}/build",
"architecture": { "value": "x64" },
"cacheVariables": {
"EQEMU_BUILD_TESTS": "ON"
}
},
{
"name": "win-msvc-2026",
"displayName": "Windows MSVC (VS 2026)",
"generator": "Visual Studio 18 2026",
"binaryDir": "${sourceDir}/build",
"architecture": { "value": "x64" },
"cacheVariables": {
"EQEMU_BUILD_TESTS": "ON"
}
}
]
}
-2
View File
@@ -1,4 +1,2 @@
cmake_minimum_required(VERSION 3.20)
add_subdirectory(import) add_subdirectory(import)
add_subdirectory(export) add_subdirectory(export)
-3
View File
@@ -1,5 +1,3 @@
cmake_minimum_required(VERSION 3.20.0)
set(export_sources set(export_sources
main.cpp main.cpp
) )
@@ -12,7 +10,6 @@ add_executable(export_client_files ${export_sources} ${export_headers})
install(TARGETS export_client_files RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) install(TARGETS export_client_files RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
target_link_libraries(export_client_files common) target_link_libraries(export_client_files common)
target_include_directories(export_client_files PRIVATE ../..)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set_property(TARGET export_client_files PROPERTY FOLDER executables/tools) set_property(TARGET export_client_files PROPERTY FOLDER executables/tools)
-3
View File
@@ -1,5 +1,3 @@
cmake_minimum_required(VERSION 3.20.0)
set(import_sources set(import_sources
main.cpp main.cpp
) )
@@ -12,7 +10,6 @@ add_executable(import_client_files ${import_sources} ${import_headers})
install(TARGETS import_client_files RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) install(TARGETS import_client_files RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
target_link_libraries(import_client_files common) target_link_libraries(import_client_files common)
target_include_directories(import_client_files PRIVATE ../..)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set_property(TARGET import_client_files PROPERTY FOLDER executables/tools) set_property(TARGET import_client_files PROPERTY FOLDER executables/tools)
+754 -751
View File
File diff suppressed because it is too large Load Diff
+10
View File
@@ -62,6 +62,7 @@ public:
void WriteUInt8(uint8 value) { *(uint8 *)(pBuffer + _wpos) = value; _wpos += sizeof(uint8); } void WriteUInt8(uint8 value) { *(uint8 *)(pBuffer + _wpos) = value; _wpos += sizeof(uint8); }
void WriteUInt32(uint32 value) { *(uint32 *)(pBuffer + _wpos) = value; _wpos += sizeof(uint32); } void WriteUInt32(uint32 value) { *(uint32 *)(pBuffer + _wpos) = value; _wpos += sizeof(uint32); }
void WriteUInt64(uint64 value) { *(uint64 *)(pBuffer + _wpos) = value; _wpos += sizeof(uint64); } void WriteUInt64(uint64 value) { *(uint64 *)(pBuffer + _wpos) = value; _wpos += sizeof(uint64); }
void WriteSInt16(int32 value) { *(int16*)(pBuffer + _wpos) = value; _wpos += sizeof(int16); }
void WriteUInt16(uint32 value) { *(uint16 *)(pBuffer + _wpos) = value; _wpos += sizeof(uint16); } void WriteUInt16(uint32 value) { *(uint16 *)(pBuffer + _wpos) = value; _wpos += sizeof(uint16); }
void WriteSInt32(int32 value) { *(int32 *)(pBuffer + _wpos) = value; _wpos += sizeof(int32); } void WriteSInt32(int32 value) { *(int32 *)(pBuffer + _wpos) = value; _wpos += sizeof(int32); }
void WriteFloat(float value) { *(float *)(pBuffer + _wpos) = value; _wpos += sizeof(float); } void WriteFloat(float value) { *(float *)(pBuffer + _wpos) = value; _wpos += sizeof(float); }
@@ -73,13 +74,22 @@ public:
uint8 ReadUInt8() { uint8 value = *(uint8 *)(pBuffer + _rpos); _rpos += sizeof(uint8); return value; } uint8 ReadUInt8() { uint8 value = *(uint8 *)(pBuffer + _rpos); _rpos += sizeof(uint8); return value; }
uint8 ReadUInt8(uint32 Offset) const { uint8 value = *(uint8 *)(pBuffer + Offset); return value; } uint8 ReadUInt8(uint32 Offset) const { uint8 value = *(uint8 *)(pBuffer + Offset); return value; }
int8 ReadSInt8() { int8 value = *(int8 *)(pBuffer + _rpos); _rpos += sizeof(int8); return value; }
int8 ReadSint8(uint32 Offset) const { int8 value = *(int8 *)(pBuffer + Offset); return value; }
uint16 ReadUInt16() { uint16 value = *(uint16 *)(pBuffer + _rpos); _rpos += sizeof(uint16); return value; } uint16 ReadUInt16() { uint16 value = *(uint16 *)(pBuffer + _rpos); _rpos += sizeof(uint16); return value; }
uint16 ReadUInt16(uint32 Offset) const { uint16 value = *(uint16 *)(pBuffer + Offset); return value; } uint16 ReadUInt16(uint32 Offset) const { uint16 value = *(uint16 *)(pBuffer + Offset); return value; }
int16 ReadSInt16() { int16 value = *(int16 *)(pBuffer + _rpos); _rpos += sizeof(int16); return value; }
int16 ReadSInt16(uint32 Offset) const { int16 value = *(int16 *)(pBuffer + Offset); return value; }
uint32 ReadUInt32() { uint32 value = *(uint32 *)(pBuffer + _rpos); _rpos += sizeof(uint32); return value; } uint32 ReadUInt32() { uint32 value = *(uint32 *)(pBuffer + _rpos); _rpos += sizeof(uint32); return value; }
uint32 ReadUInt32(uint32 Offset) const { uint32 value = *(uint32 *)(pBuffer + Offset); return value; } uint32 ReadUInt32(uint32 Offset) const { uint32 value = *(uint32 *)(pBuffer + Offset); return value; }
int32 ReadSInt32() { int32 value = *(int32 *)(pBuffer + _rpos); _rpos += sizeof(int32); return value; }
int32 ReadSint32(uint32 Offset) const { int32 value = *(int32 *)(pBuffer + Offset); return value; }
float ReadFloat() { float value = *(float *)(pBuffer + _rpos); _rpos += sizeof(float); return value; }
float ReadFloat(uint32 Offset) const { float value = *(float *)(pBuffer + Offset); return value; }
void ReadString(char *str) { uint32 len = static_cast<uint32>(strlen((char *)(pBuffer + _rpos))) + 1; memcpy(str, pBuffer + _rpos, len); _rpos += len; } void ReadString(char *str) { uint32 len = static_cast<uint32>(strlen((char *)(pBuffer + _rpos))) + 1; memcpy(str, pBuffer + _rpos, len); _rpos += len; }
void ReadString(std::string &str) { str = reinterpret_cast<char *>(pBuffer + _rpos); _rpos += str.length() + 1; } void ReadString(std::string &str) { str = reinterpret_cast<char *>(pBuffer + _rpos); _rpos += str.length() + 1; }
void ReadString(char *str, uint32 Offset, uint32 MaxLength) const; void ReadString(char *str, uint32 Offset, uint32 MaxLength) const;
void ReadLengthString(std::string& str) { uint32 len = *(uint32*)(pBuffer + _rpos); _rpos += sizeof(uint32); str.resize(len); memcpy(&str[0], pBuffer + _rpos, len); _rpos += len; }
uint32 GetWritePosition() { return _wpos; } uint32 GetWritePosition() { return _wpos; }
uint32 GetReadPosition() { return _rpos; } uint32 GetReadPosition() { return _rpos; }
+3
View File
@@ -71,6 +71,9 @@ namespace Class {
constexpr uint8 FellowshipMaster = 69; constexpr uint8 FellowshipMaster = 69;
constexpr uint8 AlternateCurrencyMerchant = 70; constexpr uint8 AlternateCurrencyMerchant = 70;
constexpr uint8 MercenaryLiaison = 71; constexpr uint8 MercenaryLiaison = 71;
constexpr uint8 RealEstateMerchant = 72;
constexpr uint8 LoyaltyMerchant = 73;
constexpr uint8 TributeMaster2 = 74;
constexpr uint8 PLAYER_CLASS_COUNT = 16; constexpr uint8 PLAYER_CLASS_COUNT = 16;
constexpr uint16 ALL_CLASSES_BITMASK = 65535; constexpr uint16 ALL_CLASSES_BITMASK = 65535;
+18
View File
@@ -99,6 +99,24 @@ uint32 CRC32::GenerateNoFlip(const uint8* buf, uint32 bufsize) {
return Update(buf, bufsize); return Update(buf, bufsize);
} }
unsigned long CRC32::GetEQChecksum(uchar* in_data, uint32 in_length, uint32 start_at)
{
unsigned long data;
unsigned long check = 0xffffffff;
for (uint32 i = start_at; i < in_length; i++)
{
data = in_data[i];
data = data ^ (check);
data = data & 0x000000ff;
check = check >> 8;
data = CRC32Table[data];
check = check ^ data;
}
return check;
}
void CRC32::SetEQChecksum(uchar* in_data, uint32 in_length, uint32 start_at) void CRC32::SetEQChecksum(uchar* in_data, uint32 in_length, uint32 start_at)
{ {
unsigned long data; unsigned long data;
+1
View File
@@ -25,6 +25,7 @@ public:
static uint32 Generate(const uint8* buf, uint32 bufsize); static uint32 Generate(const uint8* buf, uint32 bufsize);
static uint32 GenerateNoFlip(const uint8* buf, uint32 bufsize); // Same as Generate(), but without the ~ static uint32 GenerateNoFlip(const uint8* buf, uint32 bufsize); // Same as Generate(), but without the ~
static void SetEQChecksum(uchar* in_data, uint32 in_length, uint32 start_at=4); static void SetEQChecksum(uchar* in_data, uint32 in_length, uint32 start_at=4);
static unsigned long GetEQChecksum(uchar* in_data, uint32 in_length, uint32 start_at = 4);
// Multiple buffer CRC32 // Multiple buffer CRC32
static uint32 Update(const uint8* buf, uint32 bufsize, uint32 crc32 = 0xFFFFFFFF); static uint32 Update(const uint8* buf, uint32 bufsize, uint32 crc32 = 0xFFFFFFFF);
+102 -146
View File
@@ -28,6 +28,7 @@
#include "common/strings.h" #include "common/strings.h"
#include <filesystem> #include <filesystem>
#include <ranges>
constexpr int BREAK_LENGTH = 70; constexpr int BREAK_LENGTH = 70;
@@ -73,35 +74,38 @@ void DatabaseUpdate::CheckDbUpdates()
return; return;
} }
if (UpdateManifest(manifest_entries, v.server_database_version, b.server_database_version)) { int server_database_version = UpdateManifest(manifest_entries, v.server_database_version, b.server_database_version);
if (server_database_version > v.server_database_version) {
LogInfo( LogInfo(
"Updates ran successfully, setting database version to [{}] from [{}]", "Updates ran successfully, setting database version to [{}] from [{}]",
b.server_database_version, server_database_version,
v.server_database_version v.server_database_version
); );
m_database->QueryDatabase(fmt::format("UPDATE `db_version` SET `version` = {}", b.server_database_version)); m_database->QueryDatabase(fmt::format("UPDATE `db_version` SET `version` = {}", server_database_version));
} }
if (UpdateManifest(manifest_entries_custom, v.custom_database_version, b.custom_database_version)) { int custom_database_version = UpdateManifest(manifest_entries_custom, v.custom_database_version, b.custom_database_version);
if (custom_database_version > v.server_database_version) {
LogInfo( LogInfo(
"Updates ran successfully, setting database version to [{}] from [{}]", "Updates ran successfully, setting database version to [{}] from [{}]",
b.custom_database_version, custom_database_version,
v.custom_database_version v.custom_database_version
); );
m_database->QueryDatabase(fmt::format("UPDATE `db_version` SET `custom_version` = {}", b.custom_database_version)); m_database->QueryDatabase(fmt::format("UPDATE `db_version` SET `custom_version` = {}", custom_database_version));
} }
if (b.bots_database_version > 0) { if (b.bots_database_version > 0) {
if (UpdateManifest(bot_manifest_entries, v.bots_database_version, b.bots_database_version)) { int bots_database_version = UpdateManifest(bot_manifest_entries, v.bots_database_version, b.bots_database_version);
if (bots_database_version > v.bots_database_version) {
LogInfo( LogInfo(
"Updates ran successfully, setting database version to [{}] from [{}]", "Updates ran successfully, setting database version to [{}] from [{}]",
b.bots_database_version, bots_database_version,
v.bots_database_version v.bots_database_version
); );
m_database->QueryDatabase( m_database->QueryDatabase(
fmt::format( fmt::format(
"UPDATE `db_version` SET `bots_version` = {}", "UPDATE `db_version` SET `bots_version` = {}",
b.bots_database_version bots_database_version
) )
); );
} }
@@ -131,7 +135,7 @@ std::string DatabaseUpdate::GetQueryResult(const ManifestEntry& e)
return Strings::Join(result_lines, "\n"); return Strings::Join(result_lines, "\n");
} }
bool DatabaseUpdate::ShouldRunMigration(ManifestEntry &e, std::string query_result) bool DatabaseUpdate::ShouldRunMigration(const ManifestEntry& e, std::string& query_result)
{ {
std::string r = Strings::Trim(query_result); std::string r = Strings::Trim(query_result);
if (e.condition == "contains") { if (e.condition == "contains") {
@@ -163,53 +167,52 @@ bool is_atty()
#endif #endif
} }
// return true if we ran updates std::string DisplayPrompt(const std::string& prompt)
bool DatabaseUpdate::UpdateManifest( {
std::vector<ManifestEntry> entries, std::string input;
if (is_atty()) {
LogInfo("{} (Timeout 60s)", prompt);
// user input
bool gave_input = false;
time_t start_time = time(nullptr);
time_t wait_time_seconds = 60;
// spawn a concurrent thread that waits for input from std::cin
std::thread t1(
[&]() {
std::cin >> input;
gave_input = true;
}
);
t1.detach();
// check the inputReceived flag once every 50ms for 10 seconds
while (time(nullptr) < start_time + wait_time_seconds && !gave_input) {
std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
}
return Strings::Trim(input);
}
// return last successful version updated
int DatabaseUpdate::UpdateManifest(
std::vector<ManifestEntry>& entries,
int version_low, int version_low,
int version_high int version_high
) )
{ {
std::vector<int> missing_migrations = {}; int latest_version = version_low;
if (version_low != version_high) { if (version_low != version_high) {
// assume at this point that we have a migration to do because there is a version number difference. If a
// migration for a specific manifest entry does not happen because of a missing test, then log it and
// continue (the assumption here is that the user has manually fixed the database at this point). If a force
// interactive flag is set, then stop for each query. Fail the migration if the user says no or it times out
// because it means the database isn't going to have a correct state to continue. Start with backing up the
// database as per user options.
EQEmuLogSys::Instance()->DisableMySQLErrorLogs(); if (!m_skip_backup) {
bool force_interactive = false;
for (int version = version_low + 1; version <= version_high; ++version) {
for (auto &e: entries) {
if (e.version == version) {
bool has_migration = true;
std::string r = GetQueryResult(e);
if (ShouldRunMigration(e, r)) {
has_migration = false;
missing_migrations.emplace_back(e.version);
}
std::string prefix = fmt::format(
"[{}]",
has_migration ? "ok" : "missing"
);
LogInfo(
"[{}] {:>10} | [{}]",
e.version,
prefix,
e.description
);
if (!has_migration && e.force_interactive) {
force_interactive = true;
}
}
}
}
EQEmuLogSys::Instance()->EnableMySQLErrorLogs();
LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
if (!missing_migrations.empty() && m_skip_backup) {
LogInfo("Skipping database backup");
}
else if (!missing_migrations.empty()) {
LogInfo("Automatically backing up database before applying updates"); LogInfo("Automatically backing up database before applying updates");
LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH)); LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
auto s = DatabaseDumpService(); auto s = DatabaseDumpService();
@@ -217,120 +220,73 @@ bool DatabaseUpdate::UpdateManifest(
s.SetDumpWithCompression(true); s.SetDumpWithCompression(true);
s.DatabaseDump(); s.DatabaseDump();
LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH)); LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
} else {
LogInfo("Skipping database backup");
} }
if (!missing_migrations.empty()) { LogInfo("Running database migrations. Please wait...");
LogInfo("Running database migrations. Please wait..."); LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
}
if (force_interactive && !std::getenv("FORCE_INTERACTIVE")) { auto filtered_entries = entries | std::views::filter(
LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH)); [version_low, version_high](const ManifestEntry& entry)
LogInfo("Some migrations require user input. Running interactively"); { return entry.version > version_low && entry.version <= version_high; });
LogInfo("This is usually due to a major change that could cause data loss");
LogInfo("Your server is automatically backed up before these updates are applied");
LogInfo("but you should also make sure you take a backup prior to running this update");
LogInfo("Would you like to run this update? [y/n] (Timeout 60s)");
LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
// user input std::vector<ManifestEntry> sorted_entries{filtered_entries.begin(), filtered_entries.end()};
std::string input; std::ranges::sort(sorted_entries, {}, &ManifestEntry::version);
bool gave_input = false;
time_t start_time = time(nullptr);
time_t wait_time_seconds = 60;
// spawn a concurrent thread that waits for input from std::cin for (const auto& entry : sorted_entries) {
std::thread t1( // this is the test to run this individual migration. If the test fails, then it is safe to assume
[&]() { // that this migration has already happened manually or otherwise and it's safe to skip
std::cin >> input; // suppress error messages here, it's all tested in the following function
gave_input = true; EQEmuLogSys::Instance()->DisableMySQLErrorLogs();
} std::string result = GetQueryResult(entry);
); EQEmuLogSys::Instance()->EnableMySQLErrorLogs();
t1.detach();
// check the inputReceived flag once every 50ms for 10 seconds if (ShouldRunMigration(entry, result)) {
while (time(nullptr) < start_time + wait_time_seconds && !gave_input) { if (entry.force_interactive && !std::getenv("FORCE_INTERACTIVE")) {
std::this_thread::sleep_for(std::chrono::milliseconds(50)); LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
} LogInfo("This migration requires user input. Running interactively");
LogInfo("This is usually due to a major change that could cause data loss");
LogInfo("Your server is automatically backed up before these updates are applied");
LogInfo("but you should also make sure you take a backup prior to running this update");
LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
// prompt for user skip // prompt for user skip
if (Strings::Trim(input) != "y") { if (DisplayPrompt("Would you like to run this update? [y/n]") != "y") {
LogInfo("Exiting due to user input"); LogInfo("Exiting due to user input");
std::exit(1); return latest_version;
}
}
for (auto &m: missing_migrations) {
for (auto &e: entries) {
if (e.version == m) {
bool errored_migration = false;
auto r = (e.content_schema_update ? m_content_database : m_database)->QueryDatabaseMulti(e.sql);
// ignore empty query result "errors"
if (r.ErrorNumber() != 1065 && !r.ErrorMessage().empty()) {
LogError("(#{}) [{}]", r.ErrorNumber(), r.ErrorMessage());
errored_migration = true;
LogInfo("Required database update failed. This could be a problem");
// if terminal attached then prompt for skip
if (is_atty()) {
LogInfo("Would you like to skip this update? [y/n] (Timeout 60s)");
// user input
std::string input;
bool gave_input = false;
time_t start_time = time(nullptr);
time_t wait_time_seconds = 60;
// spawn a concurrent thread that waits for input from std::cin
std::thread t1(
[&]() {
std::cin >> input;
gave_input = true;
}
);
t1.detach();
// check the inputReceived flag once every 50ms for 10 seconds
while (time(nullptr) < start_time + wait_time_seconds && !gave_input) {
std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
// prompt for user skip
if (Strings::Trim(input) == "y") {
errored_migration = false;
LogInfo("Skipping update [{}] [{}]", e.version, e.description);
}
} else {
errored_migration = true;
LogInfo("Skipping update [{}] [{}]", e.version, e.description);
}
} }
}
LogInfo( auto r = (entry.content_schema_update ? m_content_database : m_database)->QueryDatabaseMulti(entry.sql);
"[{}] [{}] [{}]",
e.version,
e.description,
(errored_migration ? "error" : "ok")
);
if (errored_migration) { // ignore empty query result "errors"
LogError("Fatal | Database migration [{}] failed to run", e.description); if (r.ErrorNumber() != 1065 && !r.ErrorMessage().empty()) {
LogError("(#{}) [{}]", r.ErrorNumber(), r.ErrorMessage());
LogInfo("Required database update failed.");
// if terminal attached then prompt for skip
if (DisplayPrompt("Would you like to skip this update? [y/n]") == "y") {
LogInfo("Skipping update [{}] [{}]", entry.version, entry.description);
} else {
LogError("Fatal | Database migration [{}] failed to run", entry.description);
LogError("Fatal | Shutting down"); LogError("Fatal | Shutting down");
std::exit(1); return latest_version;
} }
LogInfo("[{}] [{}] [error]", entry.version, entry.description);
} else {
LogInfo("[{}] [{}] [ok]", entry.version, entry.description);
} }
latest_version = entry.version;
} }
} }
LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH)); LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
return true;
} }
return false; return latest_version;
} }
DatabaseUpdate *DatabaseUpdate::SetDatabase(Database *db) DatabaseUpdate *DatabaseUpdate::SetDatabase(Database *db)
+2 -2
View File
@@ -42,8 +42,8 @@ public:
DatabaseVersion GetBinaryDatabaseVersions(); DatabaseVersion GetBinaryDatabaseVersions();
void CheckDbUpdates(); void CheckDbUpdates();
std::string GetQueryResult(const ManifestEntry& e); std::string GetQueryResult(const ManifestEntry& e);
static bool ShouldRunMigration(ManifestEntry &e, std::string query_result); static bool ShouldRunMigration(const ManifestEntry& e, std::string& query_result);
bool UpdateManifest(std::vector<ManifestEntry> entries, int version_low, int version_high); int UpdateManifest(std::vector<ManifestEntry>& entries, int version_low, int version_high);
DatabaseUpdate *SetDatabase(Database *db); DatabaseUpdate *SetDatabase(Database *db);
DatabaseUpdate *SetContentDatabase(Database *db); DatabaseUpdate *SetContentDatabase(Database *db);
@@ -7207,6 +7207,64 @@ ALTER TABLE `character_parcels_containers`
)", )",
.content_schema_update = false .content_schema_update = false
}, },
ManifestEntry{
.version = 9329,
.description = "2026_04_27_spell_id_type_correction.sql",
.check = "SHOW COLUMNS FROM `character_spells` WHERE `Field` LIKE 'spell_id' AND `Type` LIKE 'int(%)'",
.condition = "empty",
.match = "",
.sql = R"(
ALTER TABLE `blocked_spells` MODIFY COLUMN `spellid` INTEGER NULL;
ALTER TABLE `character_buffs` MODIFY COLUMN `spell_id` INTEGER NOT NULL;
ALTER TABLE `character_memmed_spells` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0;
ALTER TABLE `character_spells` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0;
ALTER TABLE `damageshieldtypes` MODIFY COLUMN `spellid` INTEGER NOT NULL DEFAULT 0;
ALTER TABLE `ldon_trap_templates` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0;
ALTER TABLE IF EXISTS `merc_buffs` MODIFY COLUMN `SpellId` INTEGER NOT NULL DEFAULT 0;
ALTER TABLE IF EXISTS `merc_spell_list_entries` MODIFY COLUMN `spell_id` INTEGER NOT NULL;
ALTER TABLE `npc_spells_entries` MODIFY COLUMN `spellid` INTEGER NOT NULL DEFAULT 0;
ALTER TABLE `spell_buckets` MODIFY COLUMN `spell_id` INTEGER NOT NULL;
)"
},
ManifestEntry{
.version = 9330,
.description = "2026_04_30_buffdurations.sql",
.check = "SHOW COLUMNS FROM `character_buffs` LIKE 'initialduration'",
.condition = "empty",
.match = "",
.sql = R"(
ALTER TABLE `character_buffs`
ADD COLUMN `initialduration` INT(11) SIGNED NOT NULL DEFAULT 0 AFTER `ticsremaining`,
CHANGE COLUMN `dot_rune` `dot_rune` INT(10) UNSIGNED NOT NULL DEFAULT 0;
UPDATE `character_buffs` SET `initialduration` = `ticsremaining` WHERE TRUE;
ALTER TABLE IF EXISTS `merc_buffs`
CHANGE COLUMN `dot_rune` `dot_rune` INT(10) UNSIGNED NOT NULL DEFAULT 0,
ADD COLUMN `InitialDuration` INT(11) SIGNED NOT NULL DEFAULT 0 AFTER `TicsRemaining`,
ADD COLUMN `instrument_mod` INT(10) UNSIGNED NOT NULL DEFAULT 10 AFTER `ExtraDIChance`;
IF EXISTS(
SELECT 1 FROM `information_schema`.`TABLES` WHERE `table_schema` = DATABASE() AND `table_name` = 'merc_buffs'
) THEN UPDATE `merc_buffs` SET `InitialDuration` = `TicsRemaining` WHERE TRUE; END IF;
ALTER TABLE `character_pet_buffs`
CHANGE COLUMN `char_id` `character_id` INT(11) UNSIGNED NOT NULL,
CHANGE COLUMN `slot` `slot_id` TINYINT(3) UNSIGNED NOT NULL,
CHANGE COLUMN `caster_level` `caster_level` TINYINT(3) UNSIGNED NOT NULL,
RENAME COLUMN `castername` TO `caster_name`,
ADD COLUMN `initialduration` INT(11) SIGNED NOT NULL DEFAULT 0 AFTER `ticsremaining`,
CHANGE COLUMN `counters` `counters` INT(10) UNSIGNED NOT NULL DEFAULT 0,
CHANGE COLUMN `numhits` `numhits` INT(10) UNSIGNED NOT NULL DEFAULT 0,
CHANGE COLUMN `rune` `melee_rune` INT(10) UNSIGNED NOT NULL DEFAULT 0,
ADD COLUMN `magic_rune` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `melee_rune`,
ADD COLUMN `persistent` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0 AFTER `magic_rune`,
ADD COLUMN `dot_rune` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `persistent`,
ADD COLUMN `caston_x` INT(10) NOT NULL DEFAULT 0 AFTER `dot_rune`,
ADD COLUMN `caston_y` INT(10) NOT NULL DEFAULT 0 AFTER `caston_x`,
ADD COLUMN `caston_z` INT(10) NOT NULL DEFAULT 0 AFTER `caston_y`,
ADD COLUMN `ExtraDIChance` INT(10) NOT NULL DEFAULT 0 AFTER `caston_z`,
CHANGE COLUMN `instrument_mod` `instrument_mod` INT(10) UNSIGNED NOT NULL DEFAULT 10 AFTER `ExtraDIChance`;
)",
},
// -- template; copy/paste this when you need to create a new entry // -- template; copy/paste this when you need to create a new entry
// ManifestEntry{ // ManifestEntry{
// .version = 9228, // .version = 9228,
@@ -2174,7 +2174,53 @@ FROM bot_settings
WHERE `setting_id` = 0 WHERE `setting_id` = 0
AND `setting_type` = 0; AND `setting_type` = 0;
)" )"
} },
ManifestEntry{
.version = 9056,
.description = "some_new_migration.sql",
.check = "SHOW COLUMNS FROM `table_name` LIKE 'column_name'",
.condition = "empty",
.match = "",
.sql = R"(
ALTER TABLE `bot_blocked_buffs` MODIFY COLUMN `spell_id` INTEGER NOT NULL;
ALTER TABLE `bot_buffs` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0;
ALTER TABLE `bot_pet_buffs` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0;
ALTER TABLE `bot_pets` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0;
ALTER TABLE `bot_spell_settings` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0;
ALTER TABLE `bot_spells_entries` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0;
ALTER TABLE `bot_timers` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0;
)"
},
ManifestEntry{
.version = 9057,
.description = "2026_04_30_buffdurations.sql",
.check = "SHOW COLUMNS FROM `bot_buffs` LIKE 'initial_duration'",
.condition = "empty",
.match = "",
.sql = R"(
ALTER TABLE `bot_buffs`
ADD COLUMN `caster_name` VARCHAR(64) NOT NULL DEFAULT '' AFTER `caster_level`,
ADD COLUMN `initial_duration` INT(11) SIGNED NOT NULL DEFAULT 0 AFTER `tics_remaining`;
UPDATE `bot_buffs` SET `initial_duration` = `tics_remaining` WHERE TRUE;
ALTER TABLE `bot_pet_buffs`
ADD COLUMN `caster_name` VARCHAR(64) NOT NULL DEFAULT '' AFTER `caster_level`,
CHANGE COLUMN `duration` `tics_remaining` INT(11) SIGNED NOT NULL DEFAULT 0 AFTER `caster_name`,
ADD COLUMN `initial_duration` INT(11) SIGNED NOT NULL DEFAULT 0 AFTER `tics_remaining`,
ADD COLUMN `counters` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `initial_duration`,
ADD COLUMN `numhits` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `counters`,
ADD COLUMN `melee_rune` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `numhits`,
ADD COLUMN `magic_rune` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `melee_rune`,
ADD COLUMN `dot_rune` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `magic_rune`,
ADD COLUMN `persistent` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0 AFTER `dot_rune`,
ADD COLUMN `caston_x` INT(10) NOT NULL DEFAULT 0 AFTER `persistent`,
ADD COLUMN `caston_y` INT(10) NOT NULL DEFAULT 0 AFTER `caston_x`,
ADD COLUMN `caston_z` INT(10) NOT NULL DEFAULT 0 AFTER `caston_y`,
ADD COLUMN `extra_di_chance` INT(10) NOT NULL DEFAULT 0 AFTER `caston_z`,
ADD COLUMN `instrument_mod` INT(10) UNSIGNED NOT NULL DEFAULT 10 AFTER `extra_di_chance`;
UPDATE `bot_pet_buffs` SET `initial_duration` = `tics_remaining` WHERE TRUE;
)",
},
// -- template; copy/paste this when you need to create a new entry // -- template; copy/paste this when you need to create a new entry
// ManifestEntry{ // ManifestEntry{
// .version = 9228, // .version = 9228,
+6 -6
View File
@@ -18,8 +18,6 @@
// system use // system use
N(OP_ExploreUnknown), N(OP_ExploreUnknown),
// start (please add new opcodes in descending order and re-order any name changes where applicable) // start (please add new opcodes in descending order and re-order any name changes where applicable)
N(OP_0x0193),
N(OP_0x0347),
N(OP_AAAction), N(OP_AAAction),
N(OP_AAExpUpdate), N(OP_AAExpUpdate),
N(OP_AcceptNewTask), N(OP_AcceptNewTask),
@@ -80,8 +78,8 @@ N(OP_Bind_Wound),
N(OP_BlockedBuffs), N(OP_BlockedBuffs),
N(OP_BoardBoat), N(OP_BoardBoat),
N(OP_BookButton), N(OP_BookButton),
N(OP_Buff), N(OP_BuffDefinition),
N(OP_BuffCreate), N(OP_RefreshBuffs),
N(OP_BuffRemoveRequest), N(OP_BuffRemoveRequest),
N(OP_Bug), N(OP_Bug),
N(OP_BuyerItems), N(OP_BuyerItems),
@@ -381,6 +379,7 @@ N(OP_MercenaryTimer),
N(OP_MercenaryTimerRequest), N(OP_MercenaryTimerRequest),
N(OP_MercenaryUnknown1), N(OP_MercenaryUnknown1),
N(OP_MercenaryUnsuspendResponse), N(OP_MercenaryUnsuspendResponse),
N(OP_MerchantBulkItems),
N(OP_MobEnduranceUpdate), N(OP_MobEnduranceUpdate),
N(OP_MobHealth), N(OP_MobHealth),
N(OP_MobManaUpdate), N(OP_MobManaUpdate),
@@ -399,6 +398,7 @@ N(OP_MultiLineMsg),
N(OP_NewSpawn), N(OP_NewSpawn),
N(OP_NewTitlesAvailable), N(OP_NewTitlesAvailable),
N(OP_NewZone), N(OP_NewZone),
N(OP_NPCMoveUpdate),
N(OP_OnLevelMessage), N(OP_OnLevelMessage),
N(OP_OpenContainer), N(OP_OpenContainer),
N(OP_OpenDiscordMerchant), N(OP_OpenDiscordMerchant),
@@ -406,7 +406,7 @@ N(OP_OpenGuildTributeMaster),
N(OP_OpenInventory), N(OP_OpenInventory),
N(OP_OpenTributeMaster), N(OP_OpenTributeMaster),
N(OP_PDeletePetition), N(OP_PDeletePetition),
N(OP_PetBuffWindow), N(OP_RefreshPetBuffs),
N(OP_PetCommands), N(OP_PetCommands),
N(OP_PetCommandState), N(OP_PetCommandState),
N(OP_PetHoTT), N(OP_PetHoTT),
@@ -562,7 +562,7 @@ N(OP_Stun),
N(OP_Surname), N(OP_Surname),
N(OP_SwapSpell), N(OP_SwapSpell),
N(OP_SystemFingerprint), N(OP_SystemFingerprint),
N(OP_TargetBuffs), N(OP_RefreshTargetBuffs),
N(OP_TargetCommand), N(OP_TargetCommand),
N(OP_TargetHoTT), N(OP_TargetHoTT),
N(OP_TargetMouse), N(OP_TargetMouse),
+111
View File
@@ -54,6 +54,8 @@ const char* EQ::versions::ClientVersionName(ClientVersion client_version)
return "RoF"; return "RoF";
case ClientVersion::RoF2: case ClientVersion::RoF2:
return "RoF2"; return "RoF2";
case ClientVersion::TOB:
return "TOB";
default: default:
return "Invalid Version"; return "Invalid Version";
}; };
@@ -74,6 +76,8 @@ uint32 EQ::versions::ConvertClientVersionToClientVersionBit(ClientVersion client
return bitRoF; return bitRoF;
case ClientVersion::RoF2: case ClientVersion::RoF2:
return bitRoF2; return bitRoF2;
case ClientVersion::TOB:
return bitTOB;
default: default:
return bitUnknown; return bitUnknown;
} }
@@ -94,6 +98,8 @@ EQ::versions::ClientVersion EQ::versions::ConvertClientVersionBitToClientVersion
return ClientVersion::RoF; return ClientVersion::RoF;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::RoF2) - 1)) : case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::RoF2) - 1)) :
return ClientVersion::RoF2; return ClientVersion::RoF2;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::TOB) - 1)) :
return ClientVersion::TOB;
default: default:
return ClientVersion::Unknown; return ClientVersion::Unknown;
} }
@@ -182,6 +188,8 @@ const char* EQ::versions::MobVersionName(MobVersion mob_version)
return "RoF"; return "RoF";
case MobVersion::RoF2: case MobVersion::RoF2:
return "RoF2"; return "RoF2";
case MobVersion::TOB:
return "TOB";
case MobVersion::NPC: case MobVersion::NPC:
return "NPC"; return "NPC";
case MobVersion::NPCMerchant: case MobVersion::NPCMerchant:
@@ -210,6 +218,8 @@ const char* EQ::versions::MobVersionName(MobVersion mob_version)
return "Offline RoF"; return "Offline RoF";
case MobVersion::OfflineRoF2: case MobVersion::OfflineRoF2:
return "Offline RoF2"; return "Offline RoF2";
case MobVersion::OfflineTOB:
return "Offline TOB";
default: default:
return "Invalid Version"; return "Invalid Version";
}; };
@@ -233,6 +243,8 @@ EQ::versions::ClientVersion EQ::versions::ConvertMobVersionToClientVersion(MobVe
return ClientVersion::RoF; return ClientVersion::RoF;
case MobVersion::RoF2: case MobVersion::RoF2:
return ClientVersion::RoF2; return ClientVersion::RoF2;
case MobVersion::TOB:
return ClientVersion::TOB;
default: default:
return ClientVersion::Unknown; return ClientVersion::Unknown;
} }
@@ -256,6 +268,8 @@ EQ::versions::MobVersion EQ::versions::ConvertClientVersionToMobVersion(ClientVe
return MobVersion::RoF; return MobVersion::RoF;
case ClientVersion::RoF2: case ClientVersion::RoF2:
return MobVersion::RoF2; return MobVersion::RoF2;
case ClientVersion::TOB:
return MobVersion::TOB;
default: default:
return MobVersion::Unknown; return MobVersion::Unknown;
} }
@@ -276,6 +290,8 @@ EQ::versions::MobVersion EQ::versions::ConvertPCMobVersionToOfflinePCMobVersion(
return MobVersion::OfflineRoF; return MobVersion::OfflineRoF;
case MobVersion::RoF2: case MobVersion::RoF2:
return MobVersion::OfflineRoF2; return MobVersion::OfflineRoF2;
case MobVersion::TOB:
return MobVersion::OfflineTOB;
default: default:
return MobVersion::Unknown; return MobVersion::Unknown;
} }
@@ -296,6 +312,8 @@ EQ::versions::MobVersion EQ::versions::ConvertOfflinePCMobVersionToPCMobVersion(
return MobVersion::RoF; return MobVersion::RoF;
case MobVersion::OfflineRoF2: case MobVersion::OfflineRoF2:
return MobVersion::RoF2; return MobVersion::RoF2;
case MobVersion::OfflineTOB:
return MobVersion::TOB;
default: default:
return MobVersion::Unknown; return MobVersion::Unknown;
} }
@@ -316,6 +334,8 @@ EQ::versions::ClientVersion EQ::versions::ConvertOfflinePCMobVersionToClientVers
return ClientVersion::RoF; return ClientVersion::RoF;
case MobVersion::OfflineRoF2: case MobVersion::OfflineRoF2:
return ClientVersion::RoF2; return ClientVersion::RoF2;
case MobVersion::OfflineTOB:
return ClientVersion::TOB;
default: default:
return ClientVersion::Unknown; return ClientVersion::Unknown;
} }
@@ -336,6 +356,8 @@ EQ::versions::MobVersion EQ::versions::ConvertClientVersionToOfflinePCMobVersion
return MobVersion::OfflineRoF; return MobVersion::OfflineRoF;
case ClientVersion::RoF2: case ClientVersion::RoF2:
return MobVersion::OfflineRoF2; return MobVersion::OfflineRoF2;
case ClientVersion::TOB:
return MobVersion::OfflineTOB;
default: default:
return MobVersion::Unknown; return MobVersion::Unknown;
} }
@@ -386,6 +408,28 @@ const char* EQ::expansions::ExpansionName(Expansion expansion)
return "Rain of Fear"; return "Rain of Fear";
case Expansion::CotF: case Expansion::CotF:
return "Call of the Forsaken"; return "Call of the Forsaken";
case Expansion::TDS:
return "The Darkened Sea";
case Expansion::TBM:
return "The Broken Mirror";
case Expansion::EoK:
return "Empires of Kunark";
case Expansion::RoS:
return "Ring of Scale";
case Expansion::TBL:
return "The Burning Lands";
case Expansion::ToV:
return "Torment of Velious";
case Expansion::CoV:
return "Claws of Veeshan";
case Expansion::ToL:
return "Terror of Luclin";
case Expansion::NoS:
return "Night of Shadows";
case Expansion::LS:
return "Laurion's Song";
case Expansion::TOB:
return "The Outer Brood";
default: default:
return "Invalid Expansion"; return "Invalid Expansion";
} }
@@ -439,6 +483,29 @@ uint32 EQ::expansions::ConvertExpansionToExpansionBit(Expansion expansion)
return bitRoF; return bitRoF;
case Expansion::CotF: case Expansion::CotF:
return bitCotF; return bitCotF;
case Expansion::TDS:
return bitTDS;
case Expansion::TBM:
return bitTBM;
case Expansion::EoK:
return bitEoK;
case Expansion::RoS:
return bitRoS;
case Expansion::TBL:
return bitTBL;
case Expansion::ToV:
return bitToV;
case Expansion::CoV:
return bitCoV;
case Expansion::ToL:
return bitToL;
case Expansion::NoS:
return bitNoS;
case Expansion::LS:
return bitLS;
case Expansion::TOB:
return bitTOB;
default: default:
return bitEverQuest; return bitEverQuest;
} }
@@ -487,6 +554,28 @@ EQ::expansions::Expansion EQ::expansions::ConvertExpansionBitToExpansion(uint32
return Expansion::RoF; return Expansion::RoF;
case bitCotF: case bitCotF:
return Expansion::CotF; return Expansion::CotF;
case bitTDS:
return Expansion::TDS;
case bitTBM:
return Expansion::TBM;
case bitEoK:
return Expansion::EoK;
case bitRoS:
return Expansion::RoS;
case bitTBL:
return Expansion::TBL;
case bitToV:
return Expansion::ToV;
case bitCoV:
return Expansion::CoV;
case bitToL:
return Expansion::ToL;
case bitNoS:
return Expansion::NoS;
case bitLS:
return Expansion::LS;
case bitTOB:
return Expansion::TOB;
default: default:
return Expansion::EverQuest; return Expansion::EverQuest;
} }
@@ -535,6 +624,28 @@ uint32 EQ::expansions::ConvertExpansionToExpansionsMask(Expansion expansion)
return maskRoF; return maskRoF;
case Expansion::CotF: case Expansion::CotF:
return maskCotF; return maskCotF;
case Expansion::TDS:
return maskTDS;
case Expansion::TBM:
return maskTBM;
case Expansion::EoK:
return maskEoK;
case Expansion::RoS:
return maskRoS;
case Expansion::TBL:
return maskTBL;
case Expansion::ToV:
return maskToV;
case Expansion::CoV:
return maskCoV;
case Expansion::ToL:
return maskToL;
case Expansion::NoS:
return maskNoS;
case Expansion::LS:
return maskLS;
case Expansion::TOB:
return maskTOB;
default: default:
return maskEverQuest; return maskEverQuest;
} }
+49 -10
View File
@@ -32,7 +32,8 @@ namespace EQ
SoD, // Build: 'Dec 19 2008 15:22:49' SoD, // Build: 'Dec 19 2008 15:22:49'
UF, // Build: 'Jun 8 2010 16:44:32' UF, // Build: 'Jun 8 2010 16:44:32'
RoF, // Build: 'Dec 10 2012 17:35:44' RoF, // Build: 'Dec 10 2012 17:35:44'
RoF2 // Build: 'May 10 2013 23:30:08' RoF2, // Build: 'May 10 2013 23:30:08'
TOB // Build: 'Sep 11 2025 11:54:10'
}; };
enum ClientVersionBitmask : uint32 { enum ClientVersionBitmask : uint32 {
@@ -44,6 +45,7 @@ namespace EQ
bitUF = 0x00000010, bitUF = 0x00000010,
bitRoF = 0x00000020, bitRoF = 0x00000020,
bitRoF2 = 0x00000040, bitRoF2 = 0x00000040,
bitTOB = 0x00000080,
maskUnknown = 0x00000000, maskUnknown = 0x00000000,
maskTitaniumAndEarlier = 0x00000003, maskTitaniumAndEarlier = 0x00000003,
maskSoFAndEarlier = 0x00000007, maskSoFAndEarlier = 0x00000007,
@@ -55,11 +57,12 @@ namespace EQ
maskUFAndLater = 0xFFFFFFF0, maskUFAndLater = 0xFFFFFFF0,
maskRoFAndLater = 0xFFFFFFE0, maskRoFAndLater = 0xFFFFFFE0,
maskRoF2AndLater = 0xFFFFFFC0, maskRoF2AndLater = 0xFFFFFFC0,
maskTOBAndLater = 0xFFFFFF80,
maskAllClients = 0xFFFFFFFF maskAllClients = 0xFFFFFFFF
}; };
const ClientVersion LastClientVersion = ClientVersion::RoF2; inline constexpr ClientVersion LastClientVersion = ClientVersion::TOB;
const size_t ClientVersionCount = (static_cast<size_t>(LastClientVersion) + 1); inline constexpr size_t ClientVersionCount = (static_cast<size_t>(LastClientVersion) + 1);
bool IsValidClientVersion(ClientVersion client_version); bool IsValidClientVersion(ClientVersion client_version);
ClientVersion ValidateClientVersion(ClientVersion client_version); ClientVersion ValidateClientVersion(ClientVersion client_version);
@@ -76,6 +79,7 @@ namespace EQ
UF, UF,
RoF, RoF,
RoF2, RoF2,
TOB,
NPC, NPC,
NPCMerchant, NPCMerchant,
Merc, Merc,
@@ -89,13 +93,14 @@ namespace EQ
OfflineSoD, OfflineSoD,
OfflineUF, OfflineUF,
OfflineRoF, OfflineRoF,
OfflineRoF2 OfflineRoF2,
OfflineTOB
}; };
const MobVersion LastMobVersion = MobVersion::OfflineRoF2; const MobVersion LastMobVersion = MobVersion::OfflineTOB;
const MobVersion LastPCMobVersion = MobVersion::RoF2; const MobVersion LastPCMobVersion = MobVersion::TOB;
const MobVersion LastNonPCMobVersion = MobVersion::BotPet; const MobVersion LastNonPCMobVersion = MobVersion::BotPet;
const MobVersion LastOfflinePCMobVersion = MobVersion::OfflineRoF2; const MobVersion LastOfflinePCMobVersion = MobVersion::OfflineTOB;
const size_t MobVersionCount = (static_cast<size_t>(LastMobVersion) + 1); const size_t MobVersionCount = (static_cast<size_t>(LastMobVersion) + 1);
bool IsValidMobVersion(MobVersion mob_version); bool IsValidMobVersion(MobVersion mob_version);
@@ -127,7 +132,8 @@ namespace EQ
ucsSoDCombined = 'D', ucsSoDCombined = 'D',
ucsUFCombined = 'E', ucsUFCombined = 'E',
ucsRoFCombined = 'F', ucsRoFCombined = 'F',
ucsRoF2Combined = 'G' ucsRoF2Combined = 'G',
ucsTOBCombined = 'H'
}; };
} /*versions*/ } /*versions*/
@@ -154,7 +160,18 @@ namespace EQ
HoT, HoT,
VoA, VoA,
RoF, RoF,
CotF CotF,
TDS,
TBM,
EoK,
RoS,
TBL,
ToV,
CoV,
ToL,
NoS,
LS,
TOB
}; };
enum ExpansionBitmask : uint32 { enum ExpansionBitmask : uint32 {
@@ -179,6 +196,17 @@ namespace EQ
bitVoA = 0x00020000, bitVoA = 0x00020000,
bitRoF = 0x00040000, bitRoF = 0x00040000,
bitCotF = 0x00080000, bitCotF = 0x00080000,
bitTDS = 0x00100000,
bitTBM = 0x00200000,
bitEoK = 0x00400000,
bitRoS = 0x00800000,
bitTBL = 0x01000000,
bitToV = 0x02000000,
bitCoV = 0x04000000,
bitToL = 0x08000000,
bitNoS = 0x10000000,
bitLS = 0x20000000,
bitTOB = 0x40000000,
maskEverQuest = 0x00000000, maskEverQuest = 0x00000000,
maskRoK = 0x00000001, maskRoK = 0x00000001,
maskSoV = 0x00000003, maskSoV = 0x00000003,
@@ -199,7 +227,18 @@ namespace EQ
maskHoT = 0x0001FFFF, maskHoT = 0x0001FFFF,
maskVoA = 0x0003FFFF, maskVoA = 0x0003FFFF,
maskRoF = 0x0007FFFF, maskRoF = 0x0007FFFF,
maskCotF = 0x000FFFFF maskCotF = 0x000FFFFF,
maskTDS = 0x001FFFFF,
maskTBM = 0x003FFFFF,
maskEoK = 0x007FFFFF,
maskRoS = 0x00FFFFFF,
maskTBL = 0x01FFFFFF,
maskToV = 0x03FFFFFF,
maskCoV = 0x07FFFFFF,
maskToL = 0x0FFFFFFF,
maskNoS = 0x1FFFFFFF,
maskLS = 0x3FFFFFFF,
maskTOB = 0x7FFFFFFF,
}; };
const char* ExpansionName(Expansion expansion); const char* ExpansionName(Expansion expansion);
+40
View File
@@ -759,6 +759,46 @@ typedef enum {
FilterStrikethrough = 26, //0=show, 1=hide // RoF2 Confirmed FilterStrikethrough = 26, //0=show, 1=hide // RoF2 Confirmed
FilterStuns = 27, //0=show, 1=hide // RoF2 Confirmed FilterStuns = 27, //0=show, 1=hide // RoF2 Confirmed
FilterBardSongsOnPets = 28, //0=show, 1=hide // RoF2 Confirmed FilterBardSongsOnPets = 28, //0=show, 1=hide // RoF2 Confirmed
FilterSwarmPetDeath = 29,
FilterFellowshipChat = 30,
FilterMercenaryMessages = 31,
FilterSpam = 32,
FilterAchievements = 33,
FilterPvPMessages = 34,
FilterSpellNameInCast = 35,
FilterRandomMine = 36,
FilterRandomGroupRaid = 37,
FilterRandomOthers = 38,
FilterEnvironmentalDamage = 39,
FilterMessages = 40,
FilterOverwriteDetrimental = 41,
FilterOverwriteBeneficial = 42,
FilterCantUseCommand = 43,
FilterCombatAbilityReuse = 44,
FilterAAAbilityReuse = 45,
FilterProcBeginCasting = 46,
FilterDestroyedItems = 47,
FilterYourAuras = 48,
FilterOtherAuras = 49,
FilterYourHeals = 50,
FilterOtherHeals = 51,
FilterYourDoTs = 52,
FilterOtherDoTs = 53,
FilterOtherDirectDamage = 54,
FilterSpellEmotes = 55,
FilterFactionMessages = 56,
FilterTauntMessages = 57,
FilterYourDisciplines = 58,
FilterOtherDisplines = 59,
FilterAchievementsOthers = 60,
FilterRaidVictory = 61,
FilterOtherDirectDamageCrits = 62,
FilterDoTYoursCritical = 63,
FilterDoTOthersCritical = 64,
FilterDoTDamageTaken = 65,
FilterHealsReceived = 66,
FilterHealsYoursCritical = 67,
FilterHealsOthersCritical = 68,
_FilterCount _FilterCount
} eqFilterType; } eqFilterType;
+89
View File
@@ -110,6 +110,15 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
RoF2::constants::CHARACTER_CREATION_LIMIT, RoF2::constants::CHARACTER_CREATION_LIMIT,
RoF2::constants::SAY_LINK_BODY_SIZE, RoF2::constants::SAY_LINK_BODY_SIZE,
RoF2::constants::MAX_BAZAAR_TRADERS RoF2::constants::MAX_BAZAAR_TRADERS
),
/*[ClientVersion::TOB] =*/
EQ::constants::LookupEntry(
TOB::constants::EXPANSION,
TOB::constants::EXPANSION_BIT,
TOB::constants::EXPANSIONS_MASK,
TOB::constants::CHARACTER_CREATION_LIMIT,
TOB::constants::SAY_LINK_BODY_SIZE,
TOB::constants::MAX_BAZAAR_TRADERS
) )
}; };
@@ -376,6 +385,34 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
RoF2::inventory::ConcatenateInvTypeLimbo, RoF2::inventory::ConcatenateInvTypeLimbo,
RoF2::inventory::AllowOverLevelEquipment RoF2::inventory::AllowOverLevelEquipment
), ),
/*[MobVersion::TOB] =*/
//TOBTodo: These need to be set to the latest values not just use RoF2
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, RoF2::invtype::BANK_SIZE, RoF2::invtype::SHARED_BANK_SIZE,
RoF2::invtype::TRADE_SIZE, RoF2::invtype::WORLD_SIZE, RoF2::invtype::LIMBO_SIZE,
RoF2::invtype::TRIBUTE_SIZE, RoF2::invtype::TROPHY_TRIBUTE_SIZE, RoF2::invtype::GUILD_TRIBUTE_SIZE,
RoF2::invtype::MERCHANT_SIZE, RoF2::invtype::DELETED_SIZE, RoF2::invtype::CORPSE_SIZE,
RoF2::invtype::BAZAAR_SIZE, RoF2::invtype::INSPECT_SIZE, RoF2::invtype::REAL_ESTATE_SIZE,
RoF2::invtype::VIEW_MOD_PC_SIZE, RoF2::invtype::VIEW_MOD_BANK_SIZE, RoF2::invtype::VIEW_MOD_SHARED_BANK_SIZE,
RoF2::invtype::VIEW_MOD_LIMBO_SIZE, RoF2::invtype::ALT_STORAGE_SIZE, RoF2::invtype::ARCHIVED_SIZE,
RoF2::invtype::MAIL_SIZE, RoF2::invtype::GUILD_TROPHY_TRIBUTE_SIZE, RoF2::invtype::KRONO_SIZE,
RoF2::invtype::GUILD_BANK_MAIN_SIZE, RoF2::invtype::GUILD_BANK_DEPOSIT_SIZE, RoF2::invtype::OTHER_SIZE
),
RoF2::invslot::EQUIPMENT_BITMASK,
RoF2::invslot::GENERAL_BITMASK,
RoF2::invslot::CURSOR_BITMASK,
RoF2::invslot::POSSESSIONS_BITMASK,
RoF2::invslot::CORPSE_BITMASK,
RoF2::invbag::SLOT_COUNT,
RoF2::invaug::SOCKET_COUNT,
RoF2::inventory::AllowEmptyBagInBag,
RoF2::inventory::AllowClickCastFromBag,
RoF2::inventory::ConcatenateInvTypeLimbo,
RoF2::inventory::AllowOverLevelEquipment
),
/*[MobVersion::NPC] =*/ /*[MobVersion::NPC] =*/
EQ::inventory::LookupEntry( EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct( EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
@@ -748,6 +785,35 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
RoF2::INULL, RoF2::INULL,
RoF2::invbag::SLOT_COUNT, RoF2::invbag::SLOT_COUNT,
RoF2::invaug::SOCKET_COUNT, RoF2::invaug::SOCKET_COUNT,
false,
false,
false,
false
),
/*[MobVersion::OfflineTOB] =*/
//TOBTodo: Need to use their own values instead of RoF2
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
RoF2::INULL, RoF2::INULL, RoF2::INULL,
RoF2::invtype::TRADE_SIZE, RoF2::INULL, RoF2::INULL,
RoF2::INULL, RoF2::INULL, RoF2::INULL,
RoF2::invtype::MERCHANT_SIZE, RoF2::INULL, RoF2::INULL,
RoF2::invtype::BAZAAR_SIZE, RoF2::invtype::INSPECT_SIZE, RoF2::INULL,
RoF2::invtype::VIEW_MOD_PC_SIZE, RoF2::invtype::VIEW_MOD_BANK_SIZE, RoF2::invtype::VIEW_MOD_SHARED_BANK_SIZE,
RoF2::invtype::VIEW_MOD_LIMBO_SIZE, RoF2::INULL, RoF2::INULL,
RoF2::INULL, RoF2::INULL, RoF2::INULL,
RoF2::INULL, RoF2::INULL, RoF2::INULL
),
RoF2::INULL,
RoF2::INULL,
RoF2::INULL,
RoF2::INULL,
RoF2::INULL,
RoF2::invbag::SLOT_COUNT,
RoF2::invaug::SOCKET_COUNT,
false, false,
false, false,
@@ -1000,6 +1066,11 @@ static const EQ::behavior::LookupEntry behavior_static_lookup_entries[EQ::versio
EQ::behavior::LookupEntry( EQ::behavior::LookupEntry(
RoF2::behavior::CoinHasWeight RoF2::behavior::CoinHasWeight
), ),
/*[MobVersion::TOB] =*/
//TOBTodo: We need this value set properly
EQ::behavior::LookupEntry(
RoF2::behavior::CoinHasWeight
),
/*[MobVersion::NPC] =*/ /*[MobVersion::NPC] =*/
EQ::behavior::LookupEntry( EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight EQ::behavior::CoinHasWeight
@@ -1053,6 +1124,11 @@ static const EQ::behavior::LookupEntry behavior_static_lookup_entries[EQ::versio
RoF::behavior::CoinHasWeight RoF::behavior::CoinHasWeight
), ),
/*[MobVersion::OfflineRoF2] =*/ /*[MobVersion::OfflineRoF2] =*/
EQ::behavior::LookupEntry(
RoF2::behavior::CoinHasWeight
),
/*[MobVersion::OfflineTOB] =*/
//TOBTodo: We need this value set properly
EQ::behavior::LookupEntry( EQ::behavior::LookupEntry(
RoF2::behavior::CoinHasWeight RoF2::behavior::CoinHasWeight
) )
@@ -1208,6 +1284,19 @@ static const EQ::spells::LookupEntry spells_static_lookup_entries[EQ::versions::
RoF2::spells::NPC_BUFFS, RoF2::spells::NPC_BUFFS,
RoF2::spells::PET_BUFFS, RoF2::spells::PET_BUFFS,
RoF2::spells::MERC_BUFFS RoF2::spells::MERC_BUFFS
),
/*[ClientVersion::TOB] =*/
EQ::spells::LookupEntry(
TOB::spells::SPELL_ID_MAX,
TOB::spells::SPELLBOOK_SIZE,
UF::spells::SPELL_GEM_COUNT, // client translators are setup to allow the max value a client supports..however, the top 4 indices are not valid in this case
TOB::spells::LONG_BUFFS,
TOB::spells::SHORT_BUFFS,
TOB::spells::DISC_BUFFS,
TOB::spells::TOTAL_BUFFS,
TOB::spells::NPC_BUFFS,
TOB::spells::PET_BUFFS,
TOB::spells::MERC_BUFFS
) )
}; };
+1
View File
@@ -23,6 +23,7 @@
#include "common/patches/rof2_limits.h" #include "common/patches/rof2_limits.h"
#include "common/patches/sod_limits.h" #include "common/patches/sod_limits.h"
#include "common/patches/sof_limits.h" #include "common/patches/sof_limits.h"
#include "common/patches/tob_limits.h"
#include "common/patches/titanium_limits.h" #include "common/patches/titanium_limits.h"
#include "common/patches/uf_limits.h" #include "common/patches/uf_limits.h"
#include "common/types.h" #include "common/types.h"
+29 -21
View File
@@ -47,6 +47,13 @@ static const uint32 ADVANCED_LORE_LENGTH = 8192;
#pragma pack(push) #pragma pack(push)
#pragma pack(1) #pragma pack(1)
struct EqGuid
{
uint32_t Id;
uint16_t WorldId;
uint16_t Reserved;
};
struct LoginInfo { struct LoginInfo {
/*000*/ char login_info[64]; /*000*/ char login_info[64];
/*064*/ uint8 unknown064[124]; /*064*/ uint8 unknown064[124];
@@ -121,7 +128,7 @@ struct LDoNTrapTemplate
{ {
uint32 id; uint32 id;
LDoNChestTypes type; LDoNChestTypes type;
uint32 spell_id; int32 spell_id;
uint16 skill; uint16 skill;
uint8 locked; uint8 locked;
}; };
@@ -326,6 +333,7 @@ union
bool buyer; bool buyer;
bool untargetable; bool untargetable;
uint32 npc_tint_id; uint32 npc_tint_id;
EqGuid CharacterGuid;
}; };
struct PlayerState_Struct { struct PlayerState_Struct {
@@ -414,7 +422,7 @@ struct NewZone_Struct {
*/ */
struct MemorizeSpell_Struct { struct MemorizeSpell_Struct {
uint32 slot; // Spot in the spell book/memorized slot uint32 slot; // Spot in the spell book/memorized slot
uint32 spell_id; // Spell id (200 or c8 is minor healing, etc) int32 spell_id; // Spell id (200 or c8 is minor healing, etc)
uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming
uint32 reduction; // lower reuse uint32 reduction; // lower reuse
}; };
@@ -463,7 +471,7 @@ struct ManaChange_Struct
{ {
/*00*/ uint32 new_mana; // New Mana AMount /*00*/ uint32 new_mana; // New Mana AMount
/*04*/ uint32 stamina; /*04*/ uint32 stamina;
/*08*/ uint32 spell_id; /*08*/ int32 spell_id;
/*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting? /*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting?
/*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like /*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like
/*16*/ int32 slot; // -1 normal, otherwise clear ETA and GCD /*16*/ int32 slot; // -1 normal, otherwise clear ETA and GCD
@@ -481,14 +489,14 @@ struct BeginCast_Struct
{ {
// len = 8 // len = 8
/*000*/ uint16 caster_id; /*000*/ uint16 caster_id;
/*002*/ uint16 spell_id; /*002*/ int16 spell_id;
/*004*/ uint32 cast_time; // in miliseconds /*004*/ uint32 cast_time; // in miliseconds
}; };
struct CastSpell_Struct struct CastSpell_Struct
{ {
uint32 slot; uint32 slot;
uint32 spell_id; int32 spell_id;
uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast
uint32 target_id; uint32 target_id;
uint32 cs_unknown1; uint32 cs_unknown1;
@@ -536,7 +544,7 @@ struct SpellBuff_Struct
/*001*/ uint8 level; /*001*/ uint8 level;
/*002*/ uint8 bard_modifier; /*002*/ uint8 bard_modifier;
/*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking? -- OSX client calls this "activated" /*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking? -- OSX client calls this "activated"
/*004*/ uint32 spellid; /*004*/ int32 spellid;
/*008*/ int32 duration; /*008*/ int32 duration;
/*012*/ uint32 counters; // single book keeping value (counters, rune/vie) /*012*/ uint32 counters; // single book keeping value (counters, rune/vie)
/*016*/ uint32 player_id; // caster ID, pretty sure just zone ID /*016*/ uint32 player_id; // caster ID, pretty sure just zone ID
@@ -566,7 +574,7 @@ struct BuffRemoveRequest_Struct
struct PetBuff_Struct { struct PetBuff_Struct {
/*000*/ uint32 petid; /*000*/ uint32 petid;
/*004*/ uint32 spellid[PET_BUFF_COUNT]; /*004*/ int32 spellid[PET_BUFF_COUNT];
/*124*/ int32 ticsremaining[PET_BUFF_COUNT]; /*124*/ int32 ticsremaining[PET_BUFF_COUNT];
/*244*/ uint32 buffcount; /*244*/ uint32 buffcount;
}; };
@@ -622,8 +630,8 @@ struct GMTrainEnd_Struct
struct GMSkillChange_Struct { struct GMSkillChange_Struct {
/*000*/ uint16 npcid; /*000*/ uint16 npcid;
/*002*/ uint8 unknown1[2]; // something like PC_ID, but not really. stays the same thru the session though /*002*/ uint8 unknown1[2]; // something like PC_ID, but not really. stays the same thru the session though
/*002*/ uint16 skillbank; // 0 if normal skills, 1 if languages /*004*/ uint16 skillbank; // 0 if normal skills, 1 if languages
/*002*/ uint8 unknown2[2]; /*006*/ uint8 unknown2[2];
/*008*/ uint16 skill_id; /*008*/ uint16 skill_id;
/*010*/ uint8 unknown3[2]; /*010*/ uint8 unknown3[2];
}; };
@@ -867,7 +875,7 @@ struct BindStruct {
struct SuspendedMinion_Struct struct SuspendedMinion_Struct
{ {
/*000*/ uint16 SpellID; /*000*/ int16 SpellID;
/*002*/ uint32 HP; /*002*/ uint32 HP;
/*006*/ uint32 Mana; /*006*/ uint32 Mana;
/*010*/ SpellBuff_Struct Buffs[BUFF_COUNT]; /*010*/ SpellBuff_Struct Buffs[BUFF_COUNT];
@@ -1002,7 +1010,7 @@ struct PlayerProfile_Struct
/*2505*/ uint8 unknown2541[47]; // ? /*2505*/ uint8 unknown2541[47]; // ?
/*2552*/ uint8 languages[MAX_PP_LANGUAGE]; /*2552*/ uint8 languages[MAX_PP_LANGUAGE];
/*2580*/ uint8 unknown2616[4]; /*2580*/ uint8 unknown2616[4];
/*2584*/ uint32 spell_book[EQ::spells::SPELLBOOK_SIZE]; /*2584*/ int32 spell_book[EQ::spells::SPELLBOOK_SIZE];
/*4504*/ uint8 unknown4540[128]; // Was [428] all 0xff /*4504*/ uint8 unknown4540[128]; // Was [428] all 0xff
/*4632*/ uint32 mem_spells[EQ::spells::SPELL_GEM_COUNT]; /*4632*/ uint32 mem_spells[EQ::spells::SPELL_GEM_COUNT];
/*4668*/ uint8 unknown4704[32]; // /*4668*/ uint8 unknown4704[32]; //
@@ -1336,7 +1344,7 @@ struct CombatDamage_Struct
/* 00 */ uint16 target; /* 00 */ uint16 target;
/* 02 */ uint16 source; /* 02 */ uint16 source;
/* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells, skill /* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells, skill
/* 05 */ uint16 spellid; /* 05 */ int16 spellid;
/* 07 */ uint32 damage; /* 07 */ uint32 damage;
/* 11 */ float force; /* 11 */ float force;
/* 15 */ float hit_heading; // see above notes in Action_Struct /* 15 */ float hit_heading; // see above notes in Action_Struct
@@ -1369,7 +1377,7 @@ struct Death_Struct
/*004*/ uint32 killer_id; /*004*/ uint32 killer_id;
/*008*/ uint32 corpseid; // was corpseid /*008*/ uint32 corpseid; // was corpseid
/*012*/ uint32 bindzoneid; /*012*/ uint32 bindzoneid;
/*016*/ uint32 spell_id; /*016*/ int32 spell_id;
/*020*/ uint32 attack_skill; /*020*/ uint32 attack_skill;
/*024*/ uint32 damage; /*024*/ uint32 damage;
/*028*/ uint32 unknown028; /*028*/ uint32 unknown028;
@@ -2975,7 +2983,7 @@ struct Resurrect_Struct {
/*024*/ char your_name[64]; /*024*/ char your_name[64];
/*088*/ uint32 unknown088; /*088*/ uint32 unknown088;
/*092*/ char rezzer_name[64]; /*092*/ char rezzer_name[64];
/*156*/ uint32 spellid; /*156*/ int32 spellid;
/*160*/ char corpse_name[64]; /*160*/ char corpse_name[64];
/*224*/ uint32 action; /*224*/ uint32 action;
/* 228 */ /* 228 */
@@ -2983,7 +2991,7 @@ struct Resurrect_Struct {
struct Translocate_Struct { struct Translocate_Struct {
/*000*/ uint32 ZoneID; /*000*/ uint32 ZoneID;
/*004*/ uint32 SpellID; /*004*/ int32 SpellID;
/*008*/ uint32 unknown008; //Heading ? /*008*/ uint32 unknown008; //Heading ?
/*012*/ char Caster[64]; /*012*/ char Caster[64];
/*076*/ float y; /*076*/ float y;
@@ -3000,7 +3008,7 @@ struct PendingTranslocate_Struct
float x; float x;
float y; float y;
float z; float z;
uint32 spell_id; int32 spell_id;
}; };
struct Sacrifice_Struct { struct Sacrifice_Struct {
@@ -4867,7 +4875,7 @@ struct MarkNPC_Struct
}; };
struct InspectBuffs_Struct { struct InspectBuffs_Struct {
/*000*/ uint32 spell_id[BUFF_COUNT]; /*000*/ int32 spell_id[BUFF_COUNT];
/*100*/ int32 tics_remaining[BUFF_COUNT]; /*100*/ int32 tics_remaining[BUFF_COUNT];
}; };
@@ -5136,7 +5144,7 @@ struct SendAA_Struct {
/*0040*/ uint32 prereq_skill; //is < 0, abs() is category # /*0040*/ uint32 prereq_skill; //is < 0, abs() is category #
/*0044*/ uint32 prereq_minpoints; //min points in the prereq /*0044*/ uint32 prereq_minpoints; //min points in the prereq
/*0048*/ uint32 type; /*0048*/ uint32 type;
/*0052*/ uint32 spellid; /*0052*/ int32 spellid;
/*0056*/ uint32 spell_type; /*0056*/ uint32 spell_type;
/*0060*/ uint32 spell_refresh; /*0060*/ uint32 spell_refresh;
/*0064*/ uint16 classes; /*0064*/ uint16 classes;
@@ -5326,7 +5334,7 @@ typedef struct {
struct ControlBoat_Struct { struct ControlBoat_Struct {
/*000*/ uint32 boatId; // entitylist id of the boat /*000*/ uint32 boatId; // entitylist id of the boat
/*004*/ bool TakeControl; // 01 if taking control, 00 if releasing it /*004*/ bool TakeControl; // 01 if taking control, 00 if releasing it
/*007*/ char unknown[3]; // no idea what these last three bytes represent /*005*/ char unknown[3]; // no idea what these last three bytes represent
}; };
struct AugmentInfo_Struct struct AugmentInfo_Struct
@@ -5637,7 +5645,7 @@ struct HideCorpse_Struct
struct BuffIconEntry_Struct struct BuffIconEntry_Struct
{ {
uint32 buff_slot; uint32 buff_slot;
uint32 spell_id; int32 spell_id;
int32 tics_remaining; int32 tics_remaining;
uint32 num_hits; uint32 num_hits;
char caster[64]; char caster[64];
@@ -5648,7 +5656,7 @@ struct BuffIcon_Struct
uint32 entity_id; uint32 entity_id;
uint8 all_buffs; uint8 all_buffs;
uint16 count; uint16 count;
uint8 type; // 0 = self buff window, 1 = self target window, 4 = group, 5 = PC, 7 = NPC uint8 type; // 0 = self buff window, 1 = self target window, 2 = pet buff or target window, 4 = group, 5 = PC, 7 = NPC
int32 tic_timer; int32 tic_timer;
int32 name_lengths; // so ahh we kind of do these packets hacky, this is the total length of all the names to make creating the real packets in the translators easier int32 name_lengths; // so ahh we kind of do these packets hacky, this is the total length of all the names to make creating the real packets in the translators easier
BuffIconEntry_Struct entries[0]; BuffIconEntry_Struct entries[0];
+2 -2
View File
@@ -960,7 +960,7 @@ namespace PlayerEvent {
struct ResurrectAcceptEvent { struct ResurrectAcceptEvent {
std::string resurrecter_name; std::string resurrecter_name;
std::string spell_name; std::string spell_name;
uint32 spell_id; int32 spell_id;
// cereal // cereal
template <class Archive> template <class Archive>
@@ -1058,7 +1058,7 @@ namespace PlayerEvent {
uint32 killer_id; uint32 killer_id;
std::string killer_name; std::string killer_name;
int64 damage; int64 damage;
uint32 spell_id; int32 spell_id;
std::string spell_name; std::string spell_name;
int skill_id; int skill_id;
std::string skill_name; std::string skill_name;
+31
View File
@@ -0,0 +1,31 @@
//
// Created by dannu on 4/18/2026.
//
#include "links.h"
#include "spdat.h"
void Links::FormatItemLink(char* Buffer, size_t BufferSize, const EQ::ItemInstance* item)
{
// TODO: Reverse 0x14064B220 to get definition of this function
}
void Links::FormatSpellLink(char* Buffer, size_t BufferSize, int32_t SpellID,
const char* spellNameOverride)
{
snprintf(Buffer, BufferSize, "%c%d3^%d^0^'%s%c", ITEM_TAG_CHAR, ETAG_SPELL, SpellID,
spellNameOverride && spellNameOverride[0] ? spellNameOverride : GetSpellName(SpellID), ITEM_TAG_CHAR);
}
void Links::FormatDialogLink(char* Buffer, size_t BufferSize, std::string_view keyword, std::string_view text)
{
if (text.empty()) {
snprintf(Buffer, BufferSize, "%c%d%.*s%c", ITEM_TAG_CHAR, ETAG_DIALOG_RESPONSE,
static_cast<int>(keyword.length()), keyword.data(), ITEM_TAG_CHAR);
} else {
snprintf(Buffer, BufferSize, "%c%d%.*s:%.*s%c", ITEM_TAG_CHAR, ETAG_DIALOG_RESPONSE,
static_cast<int>(keyword.length()), keyword.data(),
static_cast<int>(text.length()), text.data(), ITEM_TAG_CHAR);
}
}
+61
View File
@@ -0,0 +1,61 @@
//
// Created by dannu on 4/18/2026.
//
#pragma once
#include "item_instance.h"
namespace EQ { class ItemInstance; }
namespace Links
{
// Max Link Size in bytes
constexpr size_t MAX_LINK_SIZE = 512;
// Universal link tag character
constexpr char ITEM_TAG_CHAR = '\x12';
// Enumeration of different types of item tags
enum ETagCodes
{
ETAG_ITEM = 0,
ETAG_PLAYER,
ETAG_SPAM,
ETAG_ACHIEVEMENT,
ETAG_DIALOG_RESPONSE,
ETAG_COMMAND,
ETAG_SPELL,
ETAG_FACTION,
ETAG_COMMAND2,
ETAG_UNKNOWN9,
ETAG_COUNT,
ETAG_FIRST = ETAG_ITEM,
ETAG_LAST = ETAG_UNKNOWN9,
ETAG_INVALID = -1,
};
//----------------------------------------------------------------------------
// Link Formatting -- Pulled from MQ code
// Create an achievement link for the given achievement.
// TODO: implement this when achievements are added, leave the signature here for reference. Code in eqlib's ItemLinks.cpp
// void FormatAchievementLink(char* Buffer, size_t BufferSize, const Achievement* achievement,
// std::string_view playerName);
// Create an item link from the given item.
void FormatItemLink(char* Buffer, size_t BufferSize, const EQ::ItemInstance* item);
// Create a spell link for the given spell, with optional spell name override. Spells on items often have
// spell name overrides that changes the display name of the spell.
void FormatSpellLink(char* Buffer, size_t BufferSize, int32_t SpellID,
const char* spellNameOverride = nullptr);
// Format text into a clickable dialog link. The keyword is the text that will be displayed in the chat window,
// and the text is the text that will be sent to the server when the link is clicked. If no text is provided,
// then the keyword will be used as the text.
void FormatDialogLink(char* Buffer, size_t BufferSize, std::string_view keyword,
std::string_view text = {});
}
+60
View File
@@ -0,0 +1,60 @@
/* EQEmu: EQEmulator
Copyright (C) 2001-2026 EQEmu Development Team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "common/emu_opcodes.h"
#include <vector>
#include <functional>
class Client;
class Mob;
class EQApplicationPacket;
class Buffs_Struct;
namespace ClientPatch {
class IBuff
{
public:
using BuffSequenceFunc = std::function<std::unique_ptr<EQApplicationPacket>(const Client*)>;
IBuff(uint32_t maxLongBuffs, uint32_t maxShortBuffs)
: m_maxLongBuffs(maxLongBuffs)
, m_maxShortBuffs(maxShortBuffs)
{}
IBuff() = delete;
virtual ~IBuff() = default;
virtual std::unique_ptr<EQApplicationPacket> BuffDefinition(Mob* mob, const Buffs_Struct& buff, uint32_t slot,
bool fade) const = 0;
virtual std::unique_ptr<EQApplicationPacket> RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove,
bool buff_timers_suspended, const std::vector<uint32_t>& slots) const = 0;
virtual void SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, uint8_t refresh_type) const = 0;
virtual bool NeedsWearMessage() const = 0;
uint32_t ServerToPatchBuffSlot(uint32_t slot) const;
protected:
uint32_t m_maxLongBuffs;
uint32_t m_maxShortBuffs;
};
} // namespace Buff
+51
View File
@@ -0,0 +1,51 @@
/* EQEmu: EQEmulator
Copyright (C) 2001-2026 EQEmu Development Team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// Migration path: replace string_ids.h usage with ID enum values one call site at a time.
class Client;
class Mob;
class EQApplicationPacket;
namespace ClientPatch {
template<typename... Args>
concept AllConstChar = (std::is_convertible_v<Args, const char*> && ...);
class IMessage
{
public:
using FormattedArgs = std::array<const char*, 9>;
IMessage() = default;
virtual ~IMessage() = default;
// these two are the basic string message packets
virtual std::unique_ptr<EQApplicationPacket> Simple(uint32_t color, uint32_t id) const = 0;
virtual std::unique_ptr<EQApplicationPacket> Formatted(uint32_t color, uint32_t id,
const FormattedArgs& args) const = 0;
// These aren't technically messages, but they use the same format and are similar enough to include here
virtual std::unique_ptr<EQApplicationPacket> InterruptSpell(uint32_t message, uint32_t spawn_id,
const char* spell_link) const = 0;
virtual std::unique_ptr<EQApplicationPacket> InterruptSpellOther(Mob* sender, uint32_t message, uint32_t spawn_id,
const char* name, const char* spell_link) const = 0;
};
} // namespace Message
+123
View File
@@ -0,0 +1,123 @@
/* EQEmu: EQEmulator
Copyright (C) 2001-2026 EQEmu Development Team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "client_version.h"
#include "common/emu_constants.h"
#include "common/patches/titanium.h"
#include "common/patches/titanium_limits.h"
#include "common/patches/sof.h"
#include "common/patches/sof_limits.h"
#include "common/patches/sod.h"
#include "common/patches/sod_limits.h"
#include "common/patches/uf.h"
#include "common/patches/uf_limits.h"
#include "common/patches/rof.h"
#include "common/patches/rof_limits.h"
#include "common/patches/rof2.h"
#include "common/patches/rof2_limits.h"
#include "common/patches/tob.h"
#include "common/patches/tob_limits.h"
#include <array>
using Version = EQ::versions::ClientVersion;
struct ClientComponents
{
explicit ClientComponents(Version version) : version(version)
{
switch (version) {
case Version::TOB:
buffComponent = std::make_unique<TOB::BuffComponent>(TOB::spells::LONG_BUFFS, TOB::spells::SHORT_BUFFS);
messageComponent = std::make_unique<TOB::MessageComponent>();
break;
case Version::RoF2:
buffComponent = std::make_unique<UF::BuffComponent>(RoF2::spells::LONG_BUFFS, RoF2::spells::SHORT_BUFFS);
messageComponent = std::make_unique<Titanium::MessageComponent>();
break;
case Version::RoF:
buffComponent = std::make_unique<UF::BuffComponent>(RoF::spells::LONG_BUFFS, RoF::spells::SHORT_BUFFS);
messageComponent = std::make_unique<Titanium::MessageComponent>();
break;
case Version::UF:
buffComponent = std::make_unique<UF::BuffComponent>(UF::spells::LONG_BUFFS, UF::spells::SHORT_BUFFS);
messageComponent = std::make_unique<Titanium::MessageComponent>();
break;
case Version::SoD:
buffComponent = std::make_unique<SoD::BuffComponent>(SoD::spells::LONG_BUFFS, SoD::spells::SHORT_BUFFS);
messageComponent = std::make_unique<Titanium::MessageComponent>();
break;
case Version::SoF:
buffComponent = std::make_unique<Titanium::BuffComponent>(SoF::spells::LONG_BUFFS, SoF::spells::SHORT_BUFFS);
messageComponent = std::make_unique<Titanium::MessageComponent>();
break;
case Version::Titanium:
buffComponent = std::make_unique<Titanium::BuffComponent>(Titanium::spells::LONG_BUFFS, Titanium::spells::SHORT_BUFFS);
messageComponent = std::make_unique<Titanium::MessageComponent>();
break;
default:
break;
}
}
const Version version;
std::unique_ptr<ClientPatch::IBuff> buffComponent;
std::unique_ptr<ClientPatch::IMessage> messageComponent;
};
// this array must be in the same order as the Version enum because it converts Version to index directly
static const std::array<ClientComponents, EQ::versions::ClientVersionCount> s_patches = {
{
ClientComponents(Version::Unknown), // empty
ClientComponents(Version::Client62), // empty
ClientComponents(Version::Titanium),
ClientComponents(Version::SoF),
ClientComponents(Version::SoD),
ClientComponents(Version::UF),
ClientComponents(Version::RoF),
ClientComponents(Version::RoF2),
ClientComponents(Version::TOB),
}
};
template<>
const std::unique_ptr<ClientPatch::IBuff>& GetComponent(Version version)
{
return s_patches.at(static_cast<uint32_t>(version)).buffComponent;
}
template<>
const std::unique_ptr<ClientPatch::IMessage>& GetComponent(Version version)
{
return s_patches.at(static_cast<uint32_t>(version)).messageComponent;
}
uint32_t ClientPatch::IBuff::ServerToPatchBuffSlot(uint32_t slot) const
{
// we're a disc
if (slot >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return slot - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
m_maxLongBuffs + m_maxShortBuffs;
// we're a song
if (slot >= EQ::spells::LONG_BUFFS)
return slot - EQ::spells::LONG_BUFFS + m_maxLongBuffs;
// we're a normal buff
return slot; // as long as we guard against bad slots server side, we should be fine
}
+38
View File
@@ -0,0 +1,38 @@
/* EQEmu: EQEmulator
Copyright (C) 2001-2026 EQEmu Development Team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "common/emu_versions.h"
#include <memory>
namespace ClientPatch {
class IBuff;
class IMessage;
}
// store all static functions for the different patches here
// store all static functions for the different patches here, this can return nullptr for unsupported patches
template <typename Component>
const std::unique_ptr<Component>& GetComponent(EQ::versions::ClientVersion version);
template <>
const std::unique_ptr<ClientPatch::IBuff>& GetComponent(EQ::versions::ClientVersion version);
template <>
const std::unique_ptr<ClientPatch::IMessage>& GetComponent(EQ::versions::ClientVersion version);
+1 -1
View File
@@ -353,7 +353,7 @@
0x05ea, 0x05ea,
0x1b6f, 0x1b6f,
0x198e, 0x198e,
0x7bd6, OP_Buff 0x7bd6, OP_BuffDefinition
0x3501, 0x3501,
0x47ab, 0x47ab,
0x7a9e, OP_World_Client_CRC1 0x7a9e, OP_World_Client_CRC1
+3
View File
@@ -21,6 +21,7 @@
#include "common/patches/rof2.h" #include "common/patches/rof2.h"
#include "common/patches/sod.h" #include "common/patches/sod.h"
#include "common/patches/sof.h" #include "common/patches/sof.h"
#include "common/patches/tob.h"
#include "common/patches/titanium.h" #include "common/patches/titanium.h"
#include "common/patches/uf.h" #include "common/patches/uf.h"
@@ -33,6 +34,7 @@ void RegisterAllPatches(EQStreamIdentifier &into)
UF::Register(into); UF::Register(into);
RoF::Register(into); RoF::Register(into);
RoF2::Register(into); RoF2::Register(into);
TOB::Register(into);
} }
void ReloadAllPatches() void ReloadAllPatches()
@@ -43,4 +45,5 @@ void ReloadAllPatches()
UF::Reload(); UF::Reload();
RoF::Reload(); RoF::Reload();
RoF2::Reload(); RoF2::Reload();
TOB::Reload();
} }
+5 -102
View File
@@ -67,7 +67,6 @@ namespace RoF
static inline spells::CastingSlot ServerToRoFCastingSlot(EQ::spells::CastingSlot slot); static inline spells::CastingSlot ServerToRoFCastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot RoFToServerCastingSlot(spells::CastingSlot slot); static inline EQ::spells::CastingSlot RoFToServerCastingSlot(spells::CastingSlot slot);
static inline int ServerToRoFBuffSlot(int index);
static inline int RoFToServerBuffSlot(int index); static inline int RoFToServerBuffSlot(int index);
void Register(EQStreamIdentifier &into) void Register(EQStreamIdentifier &into)
@@ -402,7 +401,7 @@ namespace RoF
FINISH_ENCODE(); FINISH_ENCODE();
} }
ENCODE(OP_Buff) ENCODE(OP_BuffDefinition)
{ {
ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct); ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct);
SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct);
@@ -410,8 +409,7 @@ namespace RoF
OUT(entityid); OUT(entityid);
OUT(buff.effect_type); OUT(buff.effect_type);
OUT(buff.level); OUT(buff.level);
// just so we're 100% sure we get a 1.0f ... OUT(buff.bard_modifier);
eq->buff.bard_modifier = emu->buff.bard_modifier == 10 ? 1.0f : emu->buff.bard_modifier / 10.0f;
OUT(buff.spellid); OUT(buff.spellid);
OUT(buff.duration); OUT(buff.duration);
OUT(buff.player_id); OUT(buff.player_id);
@@ -420,59 +418,13 @@ namespace RoF
OUT(buff.x); OUT(buff.x);
OUT(buff.z); OUT(buff.z);
// TODO: implement slot_data stuff // TODO: implement slot_data stuff
eq->slotid = ServerToRoFBuffSlot(emu->slotid); OUT(slotid);
if (emu->bufffade == 1) if (emu->bufffade == 1)
eq->bufffade = 1; eq->bufffade = 1;
else else
eq->bufffade = 2; eq->bufffade = 2;
// Bit of a hack. OP_Buff appears to add/remove the buff while OP_BuffCreate adds/removes the actual buff icon
EQApplicationPacket *outapp = nullptr;
if (eq->bufffade == 1)
{
outapp = new EQApplicationPacket(OP_BuffCreate, 29);
outapp->WriteUInt32(emu->entityid);
outapp->WriteUInt32(0); // tic timer
outapp->WriteUInt8(0); // Type of OP_BuffCreate packet ?
outapp->WriteUInt16(1); // 1 buff in this packet
outapp->WriteUInt32(eq->slotid);
outapp->WriteUInt32(0xffffffff); // SpellID (0xffff to remove)
outapp->WriteUInt32(0); // Duration
outapp->WriteUInt32(0); // numhits
outapp->WriteUInt8(0); // Caster name
outapp->WriteUInt8(0); // Type
}
FINISH_ENCODE();
if (outapp)
dest->FastQueuePacket(&outapp); // Send the OP_BuffCreate to remove the buff
}
ENCODE(OP_BuffCreate)
{
SETUP_VAR_ENCODE(BuffIcon_Struct);
uint32 sz = 12 + (17 * emu->count) + emu->name_lengths; // 17 includes nullterm
__packet->size = sz;
__packet->pBuffer = new unsigned char[sz];
memset(__packet->pBuffer, 0, sz);
__packet->WriteUInt32(emu->entity_id);
__packet->WriteUInt32(emu->tic_timer);
__packet->WriteUInt8(emu->all_buffs); // 1 indicates all buffs on the player (0 to add or remove a single buff)
__packet->WriteUInt16(emu->count);
for (int i = 0; i < emu->count; ++i)
{
__packet->WriteUInt32(emu->type == 0 ? ServerToRoFBuffSlot(emu->entries[i].buff_slot) : emu->entries[i].buff_slot);
__packet->WriteUInt32(emu->entries[i].spell_id);
__packet->WriteUInt32(emu->entries[i].tics_remaining);
__packet->WriteUInt32(emu->entries[i].num_hits); // Unknown
__packet->WriteString(emu->entries[i].caster);
}
__packet->WriteUInt8(emu->type); // Unknown
FINISH_ENCODE(); FINISH_ENCODE();
} }
@@ -1858,38 +1810,6 @@ namespace RoF
FINISH_ENCODE(); FINISH_ENCODE();
} }
ENCODE(OP_PetBuffWindow)
{
// The format of the RoF packet is identical to the OP_BuffCreate packet.
SETUP_VAR_ENCODE(PetBuff_Struct);
uint32 sz = 12 + (17 * emu->buffcount);
__packet->size = sz;
__packet->pBuffer = new unsigned char[sz];
memset(__packet->pBuffer, 0, sz);
__packet->WriteUInt32(emu->petid);
__packet->WriteUInt32(0); // PlayerID ?
__packet->WriteUInt8(1); // 1 indicates all buffs on the pet (0 to add or remove a single buff)
__packet->WriteUInt16(emu->buffcount);
for (uint16 i = 0; i < PET_BUFF_COUNT; ++i)
{
if (emu->spellid[i])
{
__packet->WriteUInt32(i);
__packet->WriteUInt32(emu->spellid[i]);
__packet->WriteUInt32(emu->ticsremaining[i]);
__packet->WriteUInt32(0); // numhits
__packet->WriteString("");
}
}
__packet->WriteUInt8(0); // some sort of type
FINISH_ENCODE();
}
ENCODE(OP_PlayerProfile) ENCODE(OP_PlayerProfile)
{ {
EQApplicationPacket *in = *p; EQApplicationPacket *in = *p;
@@ -2179,7 +2099,7 @@ namespace RoF
outapp->WriteUInt32(emu->buffs[r].counters); outapp->WriteUInt32(emu->buffs[r].counters);
outapp->WriteUInt32(emu->buffs[r].duration); outapp->WriteUInt32(emu->buffs[r].duration);
outapp->WriteUInt8(emu->buffs[r].level); outapp->WriteUInt8(emu->buffs[r].level);
outapp->WriteUInt32(emu->buffs[r].spellid); outapp->WriteSInt32 (emu->buffs[r].spellid);
outapp->WriteUInt8(effect_type); // Only ever seen 2 outapp->WriteUInt8(effect_type); // Only ever seen 2
outapp->WriteUInt32(emu->buffs[r].num_hits); outapp->WriteUInt32(emu->buffs[r].num_hits);
outapp->WriteUInt32(0); outapp->WriteUInt32(0);
@@ -3239,8 +3159,6 @@ namespace RoF
FINISH_ENCODE(); FINISH_ENCODE();
} }
ENCODE(OP_TargetBuffs) { ENCODE_FORWARD(OP_BuffCreate); }
ENCODE(OP_TaskDescription) ENCODE(OP_TaskDescription)
{ {
EQApplicationPacket *in = *p; EQApplicationPacket *in = *p;
@@ -4196,7 +4114,7 @@ namespace RoF
FINISH_DIRECT_DECODE(); FINISH_DIRECT_DECODE();
} }
DECODE(OP_Buff) DECODE(OP_BuffDefinition)
{ {
DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct); DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct);
SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct);
@@ -6263,21 +6181,6 @@ namespace RoF
} }
} }
// these should be optimized out for RoF since they should all boil down to return index :P
// but lets leave it here for future proofing
static inline int ServerToRoFBuffSlot(int index)
{
// we're a disc
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
static inline int RoFToServerBuffSlot(int index) static inline int RoFToServerBuffSlot(int index)
{ {
// we're a disc // we're a disc
+16 -22
View File
@@ -18,33 +18,27 @@
#pragma once #pragma once
#include "common/struct_strategy.h" #include "common/struct_strategy.h"
#include "common/patches/uf.h"
class EQStreamIdentifier; class EQStreamIdentifier;
namespace RoF namespace RoF {
extern void Register(EQStreamIdentifier& into);
extern void Reload();
class Strategy : public StructStrategy
{ {
public:
Strategy();
//these are the only public member of this namespace. protected:
extern void Register(EQStreamIdentifier &into); virtual std::string Describe() const;
extern void Reload(); virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
//you should not directly access anything below.. #include "rof_ops.h"
//I just dont feel like making a seperate header for it. };
class Strategy : public StructStrategy {
public:
Strategy();
protected:
virtual std::string Describe() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
#include "rof_ops.h"
};
} /*RoF*/ } /*RoF*/
+4 -100
View File
@@ -69,7 +69,6 @@ namespace RoF2
static inline spells::CastingSlot ServerToRoF2CastingSlot(EQ::spells::CastingSlot slot); static inline spells::CastingSlot ServerToRoF2CastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot RoF2ToServerCastingSlot(spells::CastingSlot slot); static inline EQ::spells::CastingSlot RoF2ToServerCastingSlot(spells::CastingSlot slot);
static inline int ServerToRoF2BuffSlot(int index);
static inline int RoF2ToServerBuffSlot(int index); static inline int RoF2ToServerBuffSlot(int index);
void Register(EQStreamIdentifier &into) void Register(EQStreamIdentifier &into)
@@ -661,7 +660,7 @@ namespace RoF2
FINISH_ENCODE(); FINISH_ENCODE();
} }
ENCODE(OP_Buff) ENCODE(OP_BuffDefinition)
{ {
ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct); ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct);
SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct);
@@ -678,59 +677,13 @@ namespace RoF2
OUT(buff.y); OUT(buff.y);
OUT(buff.x); OUT(buff.x);
OUT(buff.z); OUT(buff.z);
eq->slotid = ServerToRoF2BuffSlot(emu->slotid); OUT(slotid);
// TODO: implement slot_data stuff // TODO: implement slot_data stuff
if (emu->bufffade == 1) if (emu->bufffade == 1)
eq->bufffade = 1; eq->bufffade = 1;
else else
eq->bufffade = 2; eq->bufffade = 2;
// Bit of a hack. OP_Buff appears to add/remove the buff while OP_BuffCreate adds/removes the actual buff icon
EQApplicationPacket *outapp = nullptr;
if (eq->bufffade == 1)
{
outapp = new EQApplicationPacket(OP_BuffCreate, 29u);
outapp->WriteUInt32(emu->entityid);
outapp->WriteUInt32(0); // tic timer
outapp->WriteUInt8(0); // Type of OP_BuffCreate packet ?
outapp->WriteUInt16(1); // 1 buff in this packet
outapp->WriteUInt32(eq->slotid);
outapp->WriteUInt32(0xffffffff); // SpellID (0xffff to remove)
outapp->WriteUInt32(0); // Duration
outapp->WriteUInt32(0); // numhits
outapp->WriteUInt8(0); // Caster name
outapp->WriteUInt8(0); // Type
}
FINISH_ENCODE();
if (outapp)
dest->FastQueuePacket(&outapp); // Send the OP_BuffCreate to remove the buff
}
ENCODE(OP_BuffCreate)
{
SETUP_VAR_ENCODE(BuffIcon_Struct);
uint32 sz = 12 + (17 * emu->count) + emu->name_lengths; // 17 includes nullterm
__packet->size = sz;
__packet->pBuffer = new unsigned char[sz];
memset(__packet->pBuffer, 0, sz);
__packet->WriteUInt32(emu->entity_id);
__packet->WriteUInt32(emu->tic_timer);
__packet->WriteUInt8(emu->all_buffs); // 1 indicates all buffs on the player (0 to add or remove a single buff)
__packet->WriteUInt16(emu->count);
for (int i = 0; i < emu->count; ++i)
{
__packet->WriteUInt32(emu->type == 0 ? ServerToRoF2BuffSlot(emu->entries[i].buff_slot) : emu->entries[i].buff_slot);
__packet->WriteUInt32(emu->entries[i].spell_id);
__packet->WriteUInt32(emu->entries[i].tics_remaining);
__packet->WriteUInt32(emu->entries[i].num_hits); // Unknown
__packet->WriteString(emu->entries[i].caster);
}
__packet->WriteUInt8(emu->type); // Unknown
FINISH_ENCODE(); FINISH_ENCODE();
} }
@@ -2464,38 +2417,6 @@ namespace RoF2
FINISH_ENCODE(); FINISH_ENCODE();
} }
ENCODE(OP_PetBuffWindow)
{
// The format of the RoF2 packet is identical to the OP_BuffCreate packet.
SETUP_VAR_ENCODE(PetBuff_Struct);
uint32 sz = 12 + (17 * emu->buffcount);
__packet->size = sz;
__packet->pBuffer = new unsigned char[sz];
memset(__packet->pBuffer, 0, sz);
__packet->WriteUInt32(emu->petid);
__packet->WriteUInt32(0); // PlayerID ?
__packet->WriteUInt8(1); // 1 indicates all buffs on the pet (0 to add or remove a single buff)
__packet->WriteUInt16(emu->buffcount);
for (uint16 i = 0; i < PET_BUFF_COUNT; ++i)
{
if (emu->spellid[i])
{
__packet->WriteUInt32(i);
__packet->WriteUInt32(emu->spellid[i]);
__packet->WriteUInt32(emu->ticsremaining[i]);
__packet->WriteUInt32(0); // num hits
__packet->WriteString("");
}
}
__packet->WriteUInt8(0); // some sort of type
FINISH_ENCODE();
}
ENCODE(OP_PlayerProfile) ENCODE(OP_PlayerProfile)
{ {
EQApplicationPacket *in = *p; EQApplicationPacket *in = *p;
@@ -2786,7 +2707,7 @@ namespace RoF2
outapp->WriteUInt32(emu->buffs[r].counters); outapp->WriteUInt32(emu->buffs[r].counters);
outapp->WriteUInt32(emu->buffs[r].duration); outapp->WriteUInt32(emu->buffs[r].duration);
outapp->WriteUInt8(emu->buffs[r].level); outapp->WriteUInt8(emu->buffs[r].level);
outapp->WriteUInt32(emu->buffs[r].spellid); outapp->WriteSInt32 (emu->buffs[r].spellid);
outapp->WriteUInt8(effect_type); // Only ever seen 2 outapp->WriteUInt8(effect_type); // Only ever seen 2
outapp->WriteUInt32(emu->buffs[r].num_hits); outapp->WriteUInt32(emu->buffs[r].num_hits);
outapp->WriteUInt32(0); outapp->WriteUInt32(0);
@@ -3841,8 +3762,6 @@ namespace RoF2
FINISH_ENCODE(); FINISH_ENCODE();
} }
ENCODE(OP_TargetBuffs) { ENCODE_FORWARD(OP_BuffCreate); }
ENCODE(OP_TaskDescription) ENCODE(OP_TaskDescription)
{ {
EQApplicationPacket *in = *p; EQApplicationPacket *in = *p;
@@ -5145,7 +5064,7 @@ namespace RoF2
FINISH_DIRECT_DECODE(); FINISH_DIRECT_DECODE();
} }
DECODE(OP_Buff) DECODE(OP_BuffDefinition)
{ {
DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct); DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct);
SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct);
@@ -7495,21 +7414,6 @@ namespace RoF2
} }
} }
// these should be optimized out for RoF2 since they should all boil down to return index :P
// but lets leave it here for future proofing
static inline int ServerToRoF2BuffSlot(int index)
{
// we're a disc
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
static inline int RoF2ToServerBuffSlot(int index) static inline int RoF2ToServerBuffSlot(int index)
{ {
// we're a disc // we're a disc
+16 -22
View File
@@ -18,33 +18,27 @@
#pragma once #pragma once
#include "common/struct_strategy.h" #include "common/struct_strategy.h"
#include "common/patches/rof.h"
class EQStreamIdentifier; class EQStreamIdentifier;
namespace RoF2 namespace RoF2 {
extern void Register(EQStreamIdentifier& into);
extern void Reload();
class Strategy : public StructStrategy
{ {
public:
Strategy();
//these are the only public member of this namespace. protected:
extern void Register(EQStreamIdentifier &into); virtual std::string Describe() const;
extern void Reload(); virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
//you should not directly access anything below.. #include "rof2_ops.h"
//I just dont feel like making a seperate header for it. };
class Strategy : public StructStrategy {
public:
Strategy();
protected:
virtual std::string Describe() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
#include "rof2_ops.h"
};
}; /*RoF2*/ }; /*RoF2*/
+2 -5
View File
@@ -43,8 +43,7 @@ E(OP_BazaarSearch)
E(OP_BecomeTrader) E(OP_BecomeTrader)
E(OP_BeginCast) E(OP_BeginCast)
E(OP_BlockedBuffs) E(OP_BlockedBuffs)
E(OP_Buff) E(OP_BuffDefinition)
E(OP_BuffCreate)
E(OP_BuyerItems) E(OP_BuyerItems)
E(OP_CancelTrade) E(OP_CancelTrade)
E(OP_CastSpell) E(OP_CastSpell)
@@ -100,7 +99,6 @@ E(OP_MoveItem)
E(OP_NewSpawn) E(OP_NewSpawn)
E(OP_NewZone) E(OP_NewZone)
E(OP_OnLevelMessage) E(OP_OnLevelMessage)
E(OP_PetBuffWindow)
E(OP_PlayerProfile) E(OP_PlayerProfile)
E(OP_RaidJoin) E(OP_RaidJoin)
E(OP_RaidUpdate) E(OP_RaidUpdate)
@@ -123,7 +121,6 @@ E(OP_SpawnAppearance)
E(OP_SpawnDoor) E(OP_SpawnDoor)
E(OP_SpecialMesg) E(OP_SpecialMesg)
E(OP_Stun) E(OP_Stun)
E(OP_TargetBuffs)
E(OP_TaskDescription) E(OP_TaskDescription)
E(OP_TaskHistoryReply) E(OP_TaskHistoryReply)
E(OP_Track) E(OP_Track)
@@ -153,7 +150,7 @@ D(OP_Barter)
D(OP_BazaarSearch) D(OP_BazaarSearch)
D(OP_BlockedBuffs) D(OP_BlockedBuffs)
D(OP_BookButton) D(OP_BookButton)
D(OP_Buff) D(OP_BuffDefinition)
D(OP_BuffRemoveRequest) D(OP_BuffRemoveRequest)
D(OP_BuyerItems) D(OP_BuyerItems)
D(OP_CastSpell) D(OP_CastSpell)
+11 -11
View File
@@ -668,7 +668,7 @@ struct NewZone_Struct {
*/ */
struct MemorizeSpell_Struct { struct MemorizeSpell_Struct {
uint32 slot; // Spot in the spell book/memorized slot uint32 slot; // Spot in the spell book/memorized slot
uint32 spell_id; // Spell id (200 or c8 is minor healing, etc) int32 spell_id; // Spell id (200 or c8 is minor healing, etc)
uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming
uint32 reduction; // lowers reuse uint32 reduction; // lowers reuse
}; };
@@ -705,7 +705,7 @@ struct ManaChange_Struct
{ {
/*00*/ uint32 new_mana; // New Mana AMount /*00*/ uint32 new_mana; // New Mana AMount
/*04*/ uint32 stamina; /*04*/ uint32 stamina;
/*08*/ uint32 spell_id; /*08*/ int32 spell_id;
/*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting? /*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting?
/*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like /*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like
/*16*/ int32 slot; // -1 for normal usage slot for when we want silent interrupt? I think it does timer stuff or something. Linked Spell Reuse interrupt uses it /*16*/ int32 slot; // -1 for normal usage slot for when we want silent interrupt? I think it does timer stuff or something. Linked Spell Reuse interrupt uses it
@@ -719,7 +719,7 @@ struct SwapSpell_Struct
struct BeginCast_Struct struct BeginCast_Struct
{ {
/*000*/ uint32 spell_id; /*000*/ int32 spell_id;
/*004*/ uint16 caster_id; /*004*/ uint16 caster_id;
/*006*/ uint32 cast_time; // in miliseconds /*006*/ uint32 cast_time; // in miliseconds
/*010*/ /*010*/
@@ -728,7 +728,7 @@ struct BeginCast_Struct
struct CastSpell_Struct struct CastSpell_Struct
{ {
/*00*/ uint32 slot; /*00*/ uint32 slot;
/*04*/ uint32 spell_id; /*04*/ int32 spell_id;
/*08*/ InventorySlot_Struct inventory_slot; // slot for clicky item, Seen unknown of 131 = normal cast /*08*/ InventorySlot_Struct inventory_slot; // slot for clicky item, Seen unknown of 131 = normal cast
/*20*/ uint32 target_id; /*20*/ uint32 target_id;
/*24*/ uint32 cs_unknown[2]; /*24*/ uint32 cs_unknown[2];
@@ -760,7 +760,7 @@ struct SpellBuff_Struct
/*002*/ uint8 unknown002; //pretty sure padding now /*002*/ uint8 unknown002; //pretty sure padding now
/*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking? /*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking?
/*004*/ float bard_modifier; /*004*/ float bard_modifier;
/*008*/ uint32 spellid; /*008*/ int32 spellid;
/*012*/ uint32 duration; /*012*/ uint32 duration;
/*016*/ uint32 player_id; // caster ID, pretty sure just zone ID /*016*/ uint32 player_id; // caster ID, pretty sure just zone ID
/*020*/ uint32 num_hits; /*020*/ uint32 num_hits;
@@ -791,7 +791,7 @@ struct BuffRemoveRequest_Struct
// not in use // not in use
struct BuffIconEntry_Struct { struct BuffIconEntry_Struct {
/*000*/ uint32 buff_slot; /*000*/ uint32 buff_slot;
/*004*/ uint32 spell_id; /*004*/ int32 spell_id;
/*008*/ uint32 tics_remaining; /*008*/ uint32 tics_remaining;
/*012*/ uint32 num_hits; /*012*/ uint32 num_hits;
// char name[0]; caster name is also here sometimes // char name[0]; caster name is also here sometimes
@@ -1513,7 +1513,7 @@ struct CombatDamage_Struct
/* 00 */ uint16 target; /* 00 */ uint16 target;
/* 02 */ uint16 source; /* 02 */ uint16 source;
/* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells /* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells
/* 05 */ uint32 spellid; /* 05 */ int32 spellid;
/* 09 */ int32 damage; /* 09 */ int32 damage;
/* 13 */ float force; // cd cc cc 3d /* 13 */ float force; // cd cc cc 3d
/* 17 */ float hit_heading; // see above notes in Action_Struct /* 17 */ float hit_heading; // see above notes in Action_Struct
@@ -1549,7 +1549,7 @@ struct Death_Struct
/*004*/ uint32 killer_id; /*004*/ uint32 killer_id;
/*008*/ uint32 corpseid; // was corpseid /*008*/ uint32 corpseid; // was corpseid
/*012*/ uint32 attack_skill; // was type /*012*/ uint32 attack_skill; // was type
/*016*/ uint32 spell_id; /*016*/ int32 spell_id;
/*020*/ uint32 bindzoneid; //bindzoneid? /*020*/ uint32 bindzoneid; //bindzoneid?
/*024*/ uint32 damage; /*024*/ uint32 damage;
/*028*/ uint32 unknown028; /*028*/ uint32 unknown028;
@@ -2658,7 +2658,7 @@ struct GroupFollow_Struct { // Live Follow Struct
}; };
struct InspectBuffs_Struct { struct InspectBuffs_Struct {
/*000*/ uint32 spell_id[BUFF_COUNT]; /*000*/ int32 spell_id[BUFF_COUNT];
/*168*/ int32 tics_remaining[BUFF_COUNT]; /*168*/ int32 tics_remaining[BUFF_COUNT];
}; };
@@ -3077,7 +3077,7 @@ struct Resurrect_Struct
/*024*/ char your_name[64]; /*024*/ char your_name[64];
/*088*/ uint32 unknown088; /*088*/ uint32 unknown088;
/*092*/ char rezzer_name[64]; /*092*/ char rezzer_name[64];
/*156*/ uint32 spellid; /*156*/ int32 spellid;
/*160*/ char corpse_name[64]; /*160*/ char corpse_name[64];
/*224*/ uint32 action; /*224*/ uint32 action;
/*228*/ uint32 unknown228; /*228*/ uint32 unknown228;
@@ -4581,7 +4581,7 @@ struct SendAA_Struct {
/*0045*/ uint32 prereq_minpoints_count; // mutliple prereqs at least 1, even no prereqs /*0045*/ uint32 prereq_minpoints_count; // mutliple prereqs at least 1, even no prereqs
/*0049*/ uint32 prereq_minpoints; //min points in the prereq /*0049*/ uint32 prereq_minpoints; //min points in the prereq
/*0053*/ uint32 type; /*0053*/ uint32 type;
/*0057*/ uint32 spellid; /*0057*/ int32 spellid;
/*0061*/ uint32 unknown057; // Introduced during HoT - Seen 1 - Maybe account status or enable/disable AA? /*0061*/ uint32 unknown057; // Introduced during HoT - Seen 1 - Maybe account status or enable/disable AA?
/*0065*/ uint32 spell_type; /*0065*/ uint32 spell_type;
/*0069*/ uint32 spell_refresh; /*0069*/ uint32 spell_refresh;
+2 -5
View File
@@ -27,8 +27,7 @@ E(OP_Barter)
E(OP_BazaarSearch) E(OP_BazaarSearch)
E(OP_BeginCast) E(OP_BeginCast)
E(OP_BlockedBuffs) E(OP_BlockedBuffs)
E(OP_Buff) E(OP_BuffDefinition)
E(OP_BuffCreate)
E(OP_CancelTrade) E(OP_CancelTrade)
E(OP_CastSpell) E(OP_CastSpell)
E(OP_ChannelMessage) E(OP_ChannelMessage)
@@ -81,7 +80,6 @@ E(OP_MoveItem)
E(OP_NewSpawn) E(OP_NewSpawn)
E(OP_NewZone) E(OP_NewZone)
E(OP_OnLevelMessage) E(OP_OnLevelMessage)
E(OP_PetBuffWindow)
E(OP_PlayerProfile) E(OP_PlayerProfile)
E(OP_RaidJoin) E(OP_RaidJoin)
E(OP_RaidUpdate) E(OP_RaidUpdate)
@@ -104,7 +102,6 @@ E(OP_SpawnAppearance)
E(OP_SpawnDoor) E(OP_SpawnDoor)
E(OP_SpecialMesg) E(OP_SpecialMesg)
E(OP_Stun) E(OP_Stun)
E(OP_TargetBuffs)
E(OP_TaskDescription) E(OP_TaskDescription)
E(OP_TaskHistoryReply) E(OP_TaskHistoryReply)
E(OP_Track) E(OP_Track)
@@ -131,7 +128,7 @@ D(OP_AugmentInfo)
D(OP_AugmentItem) D(OP_AugmentItem)
D(OP_BazaarSearch) D(OP_BazaarSearch)
D(OP_BlockedBuffs) D(OP_BlockedBuffs)
D(OP_Buff) D(OP_BuffDefinition)
D(OP_BuffRemoveRequest) D(OP_BuffRemoveRequest)
D(OP_CastSpell) D(OP_CastSpell)
D(OP_ChannelMessage) D(OP_ChannelMessage)
+11 -11
View File
@@ -614,7 +614,7 @@ struct NewZone_Struct {
*/ */
struct MemorizeSpell_Struct { struct MemorizeSpell_Struct {
uint32 slot; // Spot in the spell book/memorized slot uint32 slot; // Spot in the spell book/memorized slot
uint32 spell_id; // Spell id (200 or c8 is minor healing, etc) int32 spell_id; // Spell id (200 or c8 is minor healing, etc)
uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming
uint32 reduction; // lowers reuse uint32 reduction; // lowers reuse
}; };
@@ -651,7 +651,7 @@ struct ManaChange_Struct
{ {
/*00*/ uint32 new_mana; // New Mana AMount /*00*/ uint32 new_mana; // New Mana AMount
/*04*/ uint32 stamina; /*04*/ uint32 stamina;
/*08*/ uint32 spell_id; /*08*/ int32 spell_id;
/*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting? /*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting?
/*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like /*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like
/*16*/ int32 slot; // -1 for normal usage slot for when we want silent interrupt? I think it does timer stuff or something. Linked Spell Reuse interrupt uses it /*16*/ int32 slot; // -1 for normal usage slot for when we want silent interrupt? I think it does timer stuff or something. Linked Spell Reuse interrupt uses it
@@ -665,7 +665,7 @@ struct SwapSpell_Struct
struct BeginCast_Struct struct BeginCast_Struct
{ {
/*000*/ uint32 spell_id; /*000*/ int32 spell_id;
/*004*/ uint16 caster_id; /*004*/ uint16 caster_id;
/*006*/ uint32 cast_time; // in miliseconds /*006*/ uint32 cast_time; // in miliseconds
/*010*/ /*010*/
@@ -674,7 +674,7 @@ struct BeginCast_Struct
struct CastSpell_Struct struct CastSpell_Struct
{ {
/*00*/ uint32 slot; /*00*/ uint32 slot;
/*04*/ uint32 spell_id; /*04*/ int32 spell_id;
/*08*/ InventorySlot_Struct inventory_slot; // slot for clicky item, Seen unknown of 131 = normal cast /*08*/ InventorySlot_Struct inventory_slot; // slot for clicky item, Seen unknown of 131 = normal cast
/*20*/ uint32 target_id; /*20*/ uint32 target_id;
/*24*/ uint32 cs_unknown[2]; /*24*/ uint32 cs_unknown[2];
@@ -706,7 +706,7 @@ struct SpellBuff_Struct
/*002*/ uint8 unknown002; //pretty sure padding now /*002*/ uint8 unknown002; //pretty sure padding now
/*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking? /*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking?
/*004*/ float bard_modifier; /*004*/ float bard_modifier;
/*008*/ uint32 spellid; /*008*/ int32 spellid;
/*012*/ uint32 duration; /*012*/ uint32 duration;
/*016*/ uint32 player_id; // caster ID, pretty sure just zone ID /*016*/ uint32 player_id; // caster ID, pretty sure just zone ID
/*020*/ uint32 num_hits; /*020*/ uint32 num_hits;
@@ -737,7 +737,7 @@ struct BuffRemoveRequest_Struct
// not in use // not in use
struct BuffIconEntry_Struct { struct BuffIconEntry_Struct {
/*000*/ uint32 buff_slot; /*000*/ uint32 buff_slot;
/*004*/ uint32 spell_id; /*004*/ int32 spell_id;
/*008*/ uint32 tics_remaining; /*008*/ uint32 tics_remaining;
/*012*/ uint32 num_hits; /*012*/ uint32 num_hits;
// char name[0]; caster name is also here sometimes // char name[0]; caster name is also here sometimes
@@ -1500,7 +1500,7 @@ struct CombatDamage_Struct
/* 00 */ uint16 target; /* 00 */ uint16 target;
/* 02 */ uint16 source; /* 02 */ uint16 source;
/* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells /* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells
/* 05 */ uint32 spellid; /* 05 */ int32 spellid;
/* 09 */ int32 damage; /* 09 */ int32 damage;
/* 13 */ float force; // cd cc cc 3d /* 13 */ float force; // cd cc cc 3d
/* 17 */ float hit_heading; // see above notes in Action_Struct /* 17 */ float hit_heading; // see above notes in Action_Struct
@@ -1536,7 +1536,7 @@ struct Death_Struct
/*004*/ uint32 killer_id; /*004*/ uint32 killer_id;
/*008*/ uint32 corpseid; // was corpseid /*008*/ uint32 corpseid; // was corpseid
/*012*/ uint32 attack_skill; // was type /*012*/ uint32 attack_skill; // was type
/*016*/ uint32 spell_id; /*016*/ int32 spell_id;
/*020*/ uint32 bindzoneid; //bindzoneid? /*020*/ uint32 bindzoneid; //bindzoneid?
/*024*/ uint32 damage; /*024*/ uint32 damage;
/*028*/ uint32 unknown028; /*028*/ uint32 unknown028;
@@ -2603,7 +2603,7 @@ struct GroupFollow_Struct { // Live Follow Struct
}; };
struct InspectBuffs_Struct { struct InspectBuffs_Struct {
/*000*/ uint32 spell_id[BUFF_COUNT]; /*000*/ int32 spell_id[BUFF_COUNT];
/*168*/ int32 tics_remaining[BUFF_COUNT]; /*168*/ int32 tics_remaining[BUFF_COUNT];
}; };
@@ -3013,7 +3013,7 @@ struct Resurrect_Struct
/*024*/ char your_name[64]; /*024*/ char your_name[64];
/*088*/ uint32 unknown088; /*088*/ uint32 unknown088;
/*092*/ char rezzer_name[64]; /*092*/ char rezzer_name[64];
/*156*/ uint32 spellid; /*156*/ int32 spellid;
/*160*/ char corpse_name[64]; /*160*/ char corpse_name[64];
/*224*/ uint32 action; /*224*/ uint32 action;
/*228*/ uint32 unknown228; /*228*/ uint32 unknown228;
@@ -4333,7 +4333,7 @@ struct SendAA_Struct {
/*0045*/ uint32 prereq_minpoints_count; // mutliple prereqs at least 1, even no prereqs /*0045*/ uint32 prereq_minpoints_count; // mutliple prereqs at least 1, even no prereqs
/*0049*/ uint32 prereq_minpoints; //min points in the prereq /*0049*/ uint32 prereq_minpoints; //min points in the prereq
/*0053*/ uint32 type; /*0053*/ uint32 type;
/*0057*/ uint32 spellid; /*0057*/ int32 spellid;
/*0061*/ uint32 unknown057; // Introduced during HoT - Seen 1 - Maybe account status or enable/disable AA? /*0061*/ uint32 unknown057; // Introduced during HoT - Seen 1 - Maybe account status or enable/disable AA?
/*0065*/ uint32 spell_type; /*0065*/ uint32 spell_type;
/*0069*/ uint32 spell_refresh; /*0069*/ uint32 spell_refresh;
+56 -78
View File
@@ -31,6 +31,8 @@
#include "common/raid.h" #include "common/raid.h"
#include "common/rulesys.h" #include "common/rulesys.h"
#include "common/strings.h" #include "common/strings.h"
#include "zone/client.h"
#include "zone/mob.h"
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
@@ -61,7 +63,6 @@ namespace SoD
static inline spells::CastingSlot ServerToSoDCastingSlot(EQ::spells::CastingSlot slot); static inline spells::CastingSlot ServerToSoDCastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot); static inline EQ::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot);
static inline int ServerToSoDBuffSlot(int index);
static inline int SoDToServerBuffSlot(int index); static inline int SoDToServerBuffSlot(int index);
void Register(EQStreamIdentifier &into) void Register(EQStreamIdentifier &into)
@@ -293,7 +294,7 @@ namespace SoD
dest->FastQueuePacket(&in, ack_req); dest->FastQueuePacket(&in, ack_req);
} }
ENCODE(OP_Buff) ENCODE(OP_BuffDefinition)
{ {
ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct); ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct);
SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct);
@@ -306,7 +307,7 @@ namespace SoD
OUT(buff.duration); OUT(buff.duration);
OUT(buff.counters); OUT(buff.counters);
OUT(buff.player_id); OUT(buff.player_id);
eq->slotid = ServerToSoDBuffSlot(emu->slotid); OUT(slotid);
OUT(bufffade); OUT(bufffade);
FINISH_ENCODE(); FINISH_ENCODE();
@@ -1375,38 +1376,6 @@ namespace SoD
FINISH_ENCODE(); FINISH_ENCODE();
} }
ENCODE(OP_PetBuffWindow)
{
EQApplicationPacket *in = *p;
*p = nullptr;
unsigned char *__emu_buffer = in->pBuffer;
PetBuff_Struct *emu = (PetBuff_Struct *)__emu_buffer;
int PacketSize = 7 + (emu->buffcount * 13);
in->size = PacketSize;
in->pBuffer = new unsigned char[in->size];
char *Buffer = (char *)in->pBuffer;
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->petid);
VARSTRUCT_ENCODE_TYPE(uint16, Buffer, emu->buffcount);
for (unsigned int i = 0; i < PET_BUFF_COUNT; ++i)
{
if (emu->spellid[i])
{
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, i);
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->spellid[i]);
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->ticsremaining[i]);
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0); // This is a string. Name of the caster of the buff.
}
}
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->buffcount); // I think this is actually some sort of type
delete[] __emu_buffer;
dest->FastQueuePacket(&in, ack_req);
}
ENCODE(OP_PlayerProfile) ENCODE(OP_PlayerProfile)
{ {
SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct); SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct);
@@ -2145,35 +2114,6 @@ namespace SoD
FINISH_ENCODE(); FINISH_ENCODE();
} }
ENCODE(OP_TargetBuffs)
{
SETUP_VAR_ENCODE(BuffIcon_Struct);
uint32 sz = 7 + (13 * emu->count);
__packet->size = sz;
__packet->pBuffer = new unsigned char[sz];
memset(__packet->pBuffer, 0, sz);
uchar *ptr = __packet->pBuffer;
*((uint32*)ptr) = emu->entity_id;
ptr += sizeof(uint32);
*((uint16*)ptr) = emu->count;
ptr += sizeof(uint16);
for (uint16 i = 0; i < emu->count; ++i)
{
*((uint32*)ptr) = emu->entries[i].buff_slot;
ptr += sizeof(uint32);
*((uint32*)ptr) = emu->entries[i].spell_id;
ptr += sizeof(uint32);
*((uint32*)ptr) = emu->entries[i].tics_remaining;
ptr += sizeof(uint32);
ptr += 1;
}
FINISH_ENCODE();
}
ENCODE(OP_TaskDescription) ENCODE(OP_TaskDescription)
{ {
EQApplicationPacket *in = *p; EQApplicationPacket *in = *p;
@@ -2877,7 +2817,7 @@ namespace SoD
FINISH_DIRECT_DECODE(); FINISH_DIRECT_DECODE();
} }
DECODE(OP_Buff) DECODE(OP_BuffDefinition)
{ {
DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct); DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct);
SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct);
@@ -4259,19 +4199,6 @@ namespace SoD
} }
} }
static inline int ServerToSoDBuffSlot(int index)
{
// we're a disc
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
static inline int SoDToServerBuffSlot(int index) static inline int SoDToServerBuffSlot(int index)
{ {
// we're a disc // we're a disc
@@ -4284,4 +4211,55 @@ namespace SoD
// we're a normal buff // we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine return index; // as long as we guard against bad slots server side, we should be fine
} }
std::unique_ptr<EQApplicationPacket> BuffComponent::RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove,
bool buff_timers_suspended, const std::vector<uint32_t>& slots) const
{
if (opcode == OP_RefreshPetBuffs || opcode == OP_RefreshTargetBuffs) {
Buffs_Struct* buffs = mob->GetBuffs();
size_t buffer_size = 7; // 7 bytes outside the list
std::vector<uint32_t> send_slots;
if (slots.empty()) {
for (uint32_t slot = 0; slot < mob->GetMaxTotalSlots(); ++slot)
if (buffs[slot].spellid > 1) {
buffer_size += 13 + strlen(buffs[slot].caster_name); // 13 includes the null terminator
send_slots.push_back(slot);
}
} else {
for (uint32_t slot : slots)
if (slot < mob->GetMaxTotalSlots() && buffs[slot].spellid > 1) {
buffer_size += 13 + strlen(buffs[slot].caster_name);
send_slots.push_back(slot);
}
}
// SoD only supports target and pet refresh, not self refresh packets
SerializeBuffer buffer(buffer_size);
buffer.WriteUInt32(mob->GetID());
buffer.WriteUInt16(send_slots.size());
for (uint32_t slot : send_slots) {
buffer.WriteUInt32(ServerToPatchBuffSlot(slot));
buffer.WriteInt32(remove ? -1 : buffs[slot].spellid);
buffer.WriteInt32(buffs[slot].ticsremaining);
buffer.WriteString(buffs[slot].caster_name);
}
buffer.WriteUInt8(opcode == OP_RefreshPetBuffs ? 2 : 0);
return std::make_unique<EQApplicationPacket>(opcode, std::move(buffer));
}
return nullptr;
}
// 0 = self buff window, 1 = self target window, 2 = pet buff or target window, 4 = group, 5 = PC, 7 = NPC
void BuffComponent::SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, uint8_t refresh_type) const
{
if (packet)
packet->pBuffer[packet->size - 1] = refresh_type;
}
} /*SoD*/ } /*SoD*/
+26 -20
View File
@@ -18,33 +18,39 @@
#pragma once #pragma once
#include "common/struct_strategy.h" #include "common/struct_strategy.h"
#include "common/patches/sof.h"
class EQStreamIdentifier; class EQStreamIdentifier;
namespace SoD namespace SoD {
extern void Register(EQStreamIdentifier& into);
extern void Reload();
class Strategy : public StructStrategy
{ {
public:
Strategy();
//these are the only public member of this namespace. protected:
extern void Register(EQStreamIdentifier &into); virtual std::string Describe() const;
extern void Reload(); virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
#include "sod_ops.h"
};
class BuffComponent : public Titanium::BuffComponent
{
public:
BuffComponent(uint32_t maxLongBuffs, uint32_t maxShortBuffs) : Titanium::BuffComponent(maxLongBuffs, maxShortBuffs) {}
BuffComponent() = delete;
~BuffComponent() override = default;
//you should not directly access anything below.. std::unique_ptr<EQApplicationPacket> RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove,
//I just dont feel like making a seperate header for it. bool buff_timers_suspended, const std::vector<uint32_t>& slots) const override;
void SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, uint8_t refresh_type) const override;
class Strategy : public StructStrategy { };
public:
Strategy();
protected:
virtual std::string Describe() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
#include "sod_ops.h"
};
} /*SoD*/ } /*SoD*/
+2 -4
View File
@@ -23,7 +23,7 @@ E(OP_ApplyPoison)
E(OP_AugmentInfo) E(OP_AugmentInfo)
E(OP_Barter) E(OP_Barter)
E(OP_BazaarSearch) E(OP_BazaarSearch)
E(OP_Buff) E(OP_BuffDefinition)
E(OP_CancelTrade) E(OP_CancelTrade)
E(OP_ChannelMessage) E(OP_ChannelMessage)
E(OP_CharInventory) E(OP_CharInventory)
@@ -65,7 +65,6 @@ E(OP_MoveItem)
E(OP_NewSpawn) E(OP_NewSpawn)
E(OP_NewZone) E(OP_NewZone)
E(OP_OnLevelMessage) E(OP_OnLevelMessage)
E(OP_PetBuffWindow)
E(OP_PlayerProfile) E(OP_PlayerProfile)
E(OP_RaidJoin) E(OP_RaidJoin)
E(OP_RaidUpdate) E(OP_RaidUpdate)
@@ -80,7 +79,6 @@ E(OP_SomeItemPacketMaybe)
E(OP_SpawnDoor) E(OP_SpawnDoor)
E(OP_SpecialMesg) E(OP_SpecialMesg)
E(OP_Stun) E(OP_Stun)
E(OP_TargetBuffs)
E(OP_TaskDescription) E(OP_TaskDescription)
E(OP_Track) E(OP_Track)
E(OP_Trader) E(OP_Trader)
@@ -102,7 +100,7 @@ D(OP_AugmentInfo)
D(OP_AugmentItem) D(OP_AugmentItem)
D(OP_BazaarSearch) D(OP_BazaarSearch)
D(OP_BookButton) D(OP_BookButton)
D(OP_Buff) D(OP_BuffDefinition)
D(OP_CastSpell) D(OP_CastSpell)
D(OP_ChannelMessage) D(OP_ChannelMessage)
D(OP_CharacterCreate) D(OP_CharacterCreate)
+9 -9
View File
@@ -480,7 +480,7 @@ struct NewZone_Struct {
*/ */
struct MemorizeSpell_Struct { struct MemorizeSpell_Struct {
uint32 slot; // Spot in the spell book/memorized slot uint32 slot; // Spot in the spell book/memorized slot
uint32 spell_id; // Spell id (200 or c8 is minor healing, etc) int32 spell_id; // Spell id (200 or c8 is minor healing, etc)
uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming
uint32 reduction; // lowers reuse uint32 reduction; // lowers reuse
}; };
@@ -517,7 +517,7 @@ struct ManaChange_Struct
{ {
/*00*/ uint32 new_mana; // New Mana AMount /*00*/ uint32 new_mana; // New Mana AMount
/*04*/ uint32 stamina; /*04*/ uint32 stamina;
/*08*/ uint32 spell_id; /*08*/ int32 spell_id;
/*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting? /*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting?
/*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like /*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like
/*16*/ int32 slot; // -1 for normal usage slot for when we want silent interrupt? I think it does timer stuff or something. Linked Spell Reuse interrupt uses it /*16*/ int32 slot; // -1 for normal usage slot for when we want silent interrupt? I think it does timer stuff or something. Linked Spell Reuse interrupt uses it
@@ -535,14 +535,14 @@ struct BeginCast_Struct
{ {
// len = 8 // len = 8
/*004*/ uint16 caster_id; /*004*/ uint16 caster_id;
/*006*/ uint16 spell_id; /*006*/ int16 spell_id;
/*016*/ uint32 cast_time; // in miliseconds /*016*/ uint32 cast_time; // in miliseconds
}; };
struct CastSpell_Struct struct CastSpell_Struct
{ {
uint32 slot; uint32 slot;
uint32 spell_id; int32 spell_id;
uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast
uint32 target_id; uint32 target_id;
uint8 cs_unknown[4]; uint8 cs_unknown[4];
@@ -571,7 +571,7 @@ struct SpellBuff_Struct
/*001*/ uint8 level; // Seen 1 for no buff /*001*/ uint8 level; // Seen 1 for no buff
/*002*/ uint8 bard_modifier; /*002*/ uint8 bard_modifier;
/*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking? /*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking?
/*004*/ uint32 spellid; /*004*/ int32 spellid;
/*008*/ uint32 duration; /*008*/ uint32 duration;
/*012*/ uint32 counters; /*012*/ uint32 counters;
/*016*/ uint32 unknown016; /*016*/ uint32 unknown016;
@@ -1266,7 +1266,7 @@ struct CombatDamage_Struct
/* 00 */ uint16 target; /* 00 */ uint16 target;
/* 02 */ uint16 source; /* 02 */ uint16 source;
/* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells /* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells
/* 05 */ uint16 spellid; /* 05 */ int16 spellid;
/* 07 */ int32 damage; /* 07 */ int32 damage;
/* 11 */ float force; // cd cc cc 3d /* 11 */ float force; // cd cc cc 3d
/* 15 */ float hit_heading; // see above notes in Action_Struct /* 15 */ float hit_heading; // see above notes in Action_Struct
@@ -1301,7 +1301,7 @@ struct Death_Struct
/*004*/ uint32 killer_id; /*004*/ uint32 killer_id;
/*008*/ uint32 corpseid; // was corpseid /*008*/ uint32 corpseid; // was corpseid
/*012*/ uint32 attack_skill; // was type /*012*/ uint32 attack_skill; // was type
/*016*/ uint32 spell_id; /*016*/ int32 spell_id;
/*020*/ uint32 bindzoneid; //bindzoneid? /*020*/ uint32 bindzoneid; //bindzoneid?
/*024*/ uint32 damage; /*024*/ uint32 damage;
/*028*/ uint32 unknown028; /*028*/ uint32 unknown028;
@@ -2534,7 +2534,7 @@ struct Resurrect_Struct {
char your_name[64]; char your_name[64];
uint32 unknown88; uint32 unknown88;
char rezzer_name[64]; char rezzer_name[64];
uint32 spellid; int32 spellid;
char corpse_name[64]; char corpse_name[64];
uint32 action; uint32 action;
/* 228 */ /* 228 */
@@ -3787,7 +3787,7 @@ struct SendAA_Struct {
/*0037*/ uint32 prereq_skill; //is < 0, abs() is category # /*0037*/ uint32 prereq_skill; //is < 0, abs() is category #
/*0041*/ uint32 prereq_minpoints; //min points in the prereq /*0041*/ uint32 prereq_minpoints; //min points in the prereq
/*0045*/ uint32 type; /*0045*/ uint32 type;
/*0049*/ uint32 spellid; /*0049*/ int32 spellid;
/*0053*/ uint32 spell_type; /*0053*/ uint32 spell_type;
/*0057*/ uint32 spell_refresh; /*0057*/ uint32 spell_refresh;
/*0061*/ uint32 classes; /*0061*/ uint32 classes;
+4 -39
View File
@@ -60,7 +60,6 @@ namespace SoF
static inline spells::CastingSlot ServerToSoFCastingSlot(EQ::spells::CastingSlot slot); static inline spells::CastingSlot ServerToSoFCastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot SoFToServerCastingSlot(spells::CastingSlot slot, uint32 item_location); static inline EQ::spells::CastingSlot SoFToServerCastingSlot(spells::CastingSlot slot, uint32 item_location);
static inline int ServerToSoFBuffSlot(int index);
static inline int SoFToServerBuffSlot(int index); static inline int SoFToServerBuffSlot(int index);
void Register(EQStreamIdentifier &into) void Register(EQStreamIdentifier &into)
@@ -272,7 +271,7 @@ namespace SoF
FINISH_ENCODE(); FINISH_ENCODE();
} }
ENCODE(OP_Buff) ENCODE(OP_BuffDefinition)
{ {
ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct); ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct);
SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct);
@@ -285,7 +284,7 @@ namespace SoF
OUT(buff.duration); OUT(buff.duration);
OUT(buff.counters); OUT(buff.counters);
OUT(buff.player_id); OUT(buff.player_id);
eq->slotid = ServerToSoFBuffSlot(emu->slotid); eq->slotid = SoFToServerBuffSlot(emu->slotid);
OUT(bufffade); OUT(bufffade);
FINISH_ENCODE(); FINISH_ENCODE();
@@ -1049,28 +1048,6 @@ namespace SoF
FINISH_ENCODE(); FINISH_ENCODE();
} }
ENCODE(OP_PetBuffWindow)
{
ENCODE_LENGTH_EXACT(PetBuff_Struct);
SETUP_DIRECT_ENCODE(PetBuff_Struct, PetBuff_Struct);
OUT(petid);
OUT(buffcount);
int EQBuffSlot = 0; // do we really want to shuffle them around like this?
for (uint32 EmuBuffSlot = 0; EmuBuffSlot < PET_BUFF_COUNT; ++EmuBuffSlot)
{
if (emu->spellid[EmuBuffSlot])
{
eq->spellid[EQBuffSlot] = emu->spellid[EmuBuffSlot];
eq->ticsremaining[EQBuffSlot++] = emu->ticsremaining[EmuBuffSlot];
}
}
FINISH_ENCODE();
}
ENCODE(OP_PlayerProfile) ENCODE(OP_PlayerProfile)
{ {
SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct); SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct);
@@ -2321,7 +2298,7 @@ namespace SoF
FINISH_DIRECT_DECODE(); FINISH_DIRECT_DECODE();
} }
DECODE(OP_Buff) DECODE(OP_BuffDefinition)
{ {
DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct); DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct);
SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct);
@@ -2334,7 +2311,7 @@ namespace SoF
IN(buff.duration); IN(buff.duration);
IN(buff.counters); IN(buff.counters);
IN(buff.player_id); IN(buff.player_id);
emu->slotid = SoFToServerBuffSlot(eq->slotid); IN(slotid);
IN(bufffade); IN(bufffade);
FINISH_DIRECT_DECODE(); FINISH_DIRECT_DECODE();
@@ -3657,18 +3634,6 @@ namespace SoF
} }
} }
static inline int ServerToSoFBuffSlot(int index) {
// we're a disc
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
static inline int SoFToServerBuffSlot(int index) static inline int SoFToServerBuffSlot(int index)
{ {
// we're a disc // we're a disc
+16 -22
View File
@@ -18,33 +18,27 @@
#pragma once #pragma once
#include "common/struct_strategy.h" #include "common/struct_strategy.h"
#include "common/patches/titanium.h"
class EQStreamIdentifier; class EQStreamIdentifier;
namespace SoF namespace SoF {
extern void Register(EQStreamIdentifier& into);
extern void Reload();
class Strategy : public StructStrategy
{ {
public:
Strategy();
//these are the only public member of this namespace. protected:
extern void Register(EQStreamIdentifier &into); virtual std::string Describe() const;
extern void Reload(); virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
//you should not directly access anything below.. #include "sof_ops.h"
//I just dont feel like making a seperate header for it. };
class Strategy : public StructStrategy {
public:
Strategy();
protected:
virtual std::string Describe() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
#include "sof_ops.h"
};
} /*SoF*/ } /*SoF*/
+2 -3
View File
@@ -23,7 +23,7 @@ E(OP_ApplyPoison)
E(OP_AugmentInfo) E(OP_AugmentInfo)
E(OP_BazaarSearch) E(OP_BazaarSearch)
E(OP_BecomeTrader) E(OP_BecomeTrader)
E(OP_Buff) E(OP_BuffDefinition)
E(OP_CancelTrade) E(OP_CancelTrade)
E(OP_ChannelMessage) E(OP_ChannelMessage)
E(OP_CharInventory) E(OP_CharInventory)
@@ -60,7 +60,6 @@ E(OP_MoveItem)
E(OP_NewSpawn) E(OP_NewSpawn)
E(OP_NewZone) E(OP_NewZone)
E(OP_OnLevelMessage) E(OP_OnLevelMessage)
E(OP_PetBuffWindow)
E(OP_PlayerProfile) E(OP_PlayerProfile)
E(OP_RaidJoin) E(OP_RaidJoin)
E(OP_RaidUpdate) E(OP_RaidUpdate)
@@ -93,7 +92,7 @@ D(OP_ApplyPoison)
D(OP_AugmentInfo) D(OP_AugmentInfo)
D(OP_AugmentItem) D(OP_AugmentItem)
D(OP_BookButton) D(OP_BookButton)
D(OP_Buff) D(OP_BuffDefinition)
D(OP_Bug) D(OP_Bug)
D(OP_CastSpell) D(OP_CastSpell)
D(OP_ChannelMessage) D(OP_ChannelMessage)
+9 -9
View File
@@ -480,7 +480,7 @@ struct NewZone_Struct {
*/ */
struct MemorizeSpell_Struct { struct MemorizeSpell_Struct {
uint32 slot; // Spot in the spell book/memorized slot uint32 slot; // Spot in the spell book/memorized slot
uint32 spell_id; // Spell id (200 or c8 is minor healing, etc) int32 spell_id; // Spell id (200 or c8 is minor healing, etc)
uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming
uint32 reduction; // lowers reuse uint32 reduction; // lowers reuse
}; };
@@ -517,7 +517,7 @@ struct ManaChange_Struct
{ {
/*00*/ uint32 new_mana; // New Mana AMount /*00*/ uint32 new_mana; // New Mana AMount
/*04*/ uint32 stamina; /*04*/ uint32 stamina;
/*08*/ uint32 spell_id; /*08*/ int32 spell_id;
/*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting? /*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting?
/*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like /*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like
/*16*/ int32 slot; // -1 for normal usage slot for when we want silent interrupt? I think it does timer stuff or something. Linked Spell Reuse interrupt uses it /*16*/ int32 slot; // -1 for normal usage slot for when we want silent interrupt? I think it does timer stuff or something. Linked Spell Reuse interrupt uses it
@@ -535,14 +535,14 @@ struct BeginCast_Struct
{ {
// len = 8 // len = 8
/*004*/ uint16 caster_id; /*004*/ uint16 caster_id;
/*006*/ uint16 spell_id; /*006*/ int16 spell_id;
/*016*/ uint32 cast_time; // in miliseconds /*016*/ uint32 cast_time; // in miliseconds
}; };
struct CastSpell_Struct struct CastSpell_Struct
{ {
uint32 slot; uint32 slot;
uint32 spell_id; int32 spell_id;
uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast
uint32 target_id; uint32 target_id;
uint8 cs_unknown[4]; uint8 cs_unknown[4];
@@ -571,7 +571,7 @@ struct SpellBuff_Struct
/*001*/ uint8 level; // Seen 1 for no buff /*001*/ uint8 level; // Seen 1 for no buff
/*002*/ uint8 bard_modifier; /*002*/ uint8 bard_modifier;
/*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking? /*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking?
/*004*/ uint32 spellid; /*004*/ int32 spellid;
/*008*/ uint32 duration; /*008*/ uint32 duration;
/*012*/ uint32 counters; /*012*/ uint32 counters;
/*016*/ uint32 unknown016; /*016*/ uint32 unknown016;
@@ -1266,7 +1266,7 @@ struct CombatDamage_Struct
/* 00 */ uint16 target; /* 00 */ uint16 target;
/* 02 */ uint16 source; /* 02 */ uint16 source;
/* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells /* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells
/* 05 */ uint16 spellid; /* 05 */ int16 spellid;
/* 07 */ int32 damage; /* 07 */ int32 damage;
/* 11 */ float force; // cd cc cc 3d /* 11 */ float force; // cd cc cc 3d
/* 15 */ float hit_heading; // see above notes in Action_Struct /* 15 */ float hit_heading; // see above notes in Action_Struct
@@ -1301,7 +1301,7 @@ struct Death_Struct
/*004*/ uint32 killer_id; /*004*/ uint32 killer_id;
/*008*/ uint32 corpseid; // was corpseid /*008*/ uint32 corpseid; // was corpseid
/*012*/ uint32 attack_skill; // was type /*012*/ uint32 attack_skill; // was type
/*016*/ uint32 spell_id; /*016*/ int32 spell_id;
/*020*/ uint32 bindzoneid; //bindzoneid? /*020*/ uint32 bindzoneid; //bindzoneid?
/*024*/ uint32 damage; /*024*/ uint32 damage;
/*028*/ uint32 unknown028; /*028*/ uint32 unknown028;
@@ -2504,7 +2504,7 @@ struct Resurrect_Struct {
char your_name[64]; char your_name[64];
uint32 unknown88; uint32 unknown88;
char rezzer_name[64]; char rezzer_name[64];
uint32 spellid; int32 spellid;
char corpse_name[64]; char corpse_name[64];
uint32 action; uint32 action;
/* 228 */ /* 228 */
@@ -3711,7 +3711,7 @@ struct SendAA_Struct {
/*0037*/ uint32 prereq_skill; //is < 0, abs() is category # /*0037*/ uint32 prereq_skill; //is < 0, abs() is category #
/*0041*/ uint32 prereq_minpoints; //min points in the prereq /*0041*/ uint32 prereq_minpoints; //min points in the prereq
/*0045*/ uint32 type; /*0045*/ uint32 type;
/*0049*/ uint32 spellid; /*0049*/ int32 spellid;
/*0053*/ uint32 spell_type; /*0053*/ uint32 spell_type;
/*0057*/ uint32 spell_refresh; /*0057*/ uint32 spell_refresh;
/*0061*/ uint32 classes; /*0061*/ uint32 classes;
+13 -20
View File
@@ -23,27 +23,20 @@ class EQStreamIdentifier;
namespace TEMPLATE { namespace TEMPLATE {
//these are the only public member of this namespace. extern void Register(EQStreamIdentifier& into);
extern void Register(EQStreamIdentifier &into); extern void Reload();
extern void Reload();
class Strategy : public StructStrategy
{
public:
Strategy();
protected:
//you should not directly access anything below.. virtual std::string Describe() const;
//I just dont feel like making a seperate header for it. virtual const EQClientVersion ClientVersion() const;
//magic macro to declare our opcodes
class Strategy : public StructStrategy { #include "ss_declare.h"
public: #include "TEMPLATE_ops.h"
Strategy(); };
protected:
virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
//magic macro to declare our opcodes
#include "ss_declare.h"
#include "TEMPLATE_ops.h"
};
}; };
+179 -39
View File
@@ -32,6 +32,8 @@
#include "common/raid.h" #include "common/raid.h"
#include "common/rulesys.h" #include "common/rulesys.h"
#include "common/strings.h" #include "common/strings.h"
#include "zone/mob.h"
#include "zone/string_ids.h"
#include <sstream> #include <sstream>
@@ -61,7 +63,6 @@ namespace Titanium
static inline spells::CastingSlot ServerToTitaniumCastingSlot(EQ::spells::CastingSlot slot); static inline spells::CastingSlot ServerToTitaniumCastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot TitaniumToServerCastingSlot(spells::CastingSlot slot, uint32 item_location); static inline EQ::spells::CastingSlot TitaniumToServerCastingSlot(spells::CastingSlot slot, uint32 item_location);
static inline int ServerToTitaniumBuffSlot(int index);
static inline int TitaniumToServerBuffSlot(int index); static inline int TitaniumToServerBuffSlot(int index);
void Register(EQStreamIdentifier &into) void Register(EQStreamIdentifier &into)
@@ -325,7 +326,7 @@ namespace Titanium
} }
} }
ENCODE(OP_Buff) ENCODE(OP_BuffDefinition)
{ {
ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct); ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct);
SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct);
@@ -338,7 +339,7 @@ namespace Titanium
OUT(buff.duration); OUT(buff.duration);
OUT(buff.counters); OUT(buff.counters);
OUT(buff.player_id); OUT(buff.player_id);
eq->slotid = ServerToTitaniumBuffSlot(emu->slotid); OUT(slotid);
OUT(bufffade); OUT(bufffade);
FINISH_ENCODE(); FINISH_ENCODE();
@@ -1306,28 +1307,6 @@ namespace Titanium
FINISH_ENCODE(); FINISH_ENCODE();
} }
ENCODE(OP_PetBuffWindow)
{
ENCODE_LENGTH_EXACT(PetBuff_Struct);
SETUP_DIRECT_ENCODE(PetBuff_Struct, PetBuff_Struct);
OUT(petid);
OUT(buffcount);
int EQBuffSlot = 0; // do we really want to shuffle them around like this?
for (uint32 EmuBuffSlot = 0; EmuBuffSlot < PET_BUFF_COUNT; ++EmuBuffSlot)
{
if (emu->spellid[EmuBuffSlot])
{
eq->spellid[EQBuffSlot] = emu->spellid[EmuBuffSlot];
eq->ticsremaining[EQBuffSlot++] = emu->ticsremaining[EmuBuffSlot];
}
}
FINISH_ENCODE();
}
ENCODE(OP_PlayerProfile) ENCODE(OP_PlayerProfile)
{ {
SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct); SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct);
@@ -2539,7 +2518,7 @@ namespace Titanium
} }
} }
DECODE(OP_Buff) DECODE(OP_BuffDefinition)
{ {
DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct); DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct);
SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct);
@@ -3893,19 +3872,6 @@ namespace Titanium
} }
} }
static inline int ServerToTitaniumBuffSlot(int index)
{
// we're a disc
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
static inline int TitaniumToServerBuffSlot(int index) static inline int TitaniumToServerBuffSlot(int index)
{ {
// we're a disc // we're a disc
@@ -3918,4 +3884,178 @@ namespace Titanium
// we're a normal buff // we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine return index; // as long as we guard against bad slots server side, we should be fine
} }
std::unique_ptr<EQApplicationPacket> MessageComponent::Simple(uint32_t color, uint32_t id) const
{
uint32_t string_id = ResolveID(id);
if (string_id > 0) {
auto outapp = std::make_unique<EQApplicationPacket>(OP_SimpleMessage, sizeof(SimpleMessage_Struct));
auto* sms = reinterpret_cast<SimpleMessage_Struct*>(outapp->pBuffer);
sms->string_id = string_id;
sms->color = color;
sms->unknown8 = 0;
return outapp;
}
return nullptr;
}
std::unique_ptr<EQApplicationPacket> MessageComponent::Formatted(uint32_t color, uint32_t id,
const FormattedArgs& args) const
{
uint32_t string_id = ResolveID(id);
if (string_id > 0) {
std::array<const char*, 9> resolved_args = args;
ResolveArguments(id, resolved_args);
if (!resolved_args[0])
return Simple(color, id);
SerializeBuffer buf(20);
buf.WriteUInt32(0);
buf.WriteUInt32(string_id);
buf.WriteUInt32(color);
for (const auto* a : resolved_args) {
if (a != nullptr)
buf.WriteString(a);
}
buf.WriteUInt8(0);
return std::make_unique<EQApplicationPacket>(OP_FormattedMessage, std::move(buf));
}
return nullptr;
}
std::unique_ptr<EQApplicationPacket> MessageComponent::InterruptSpell(uint32_t message, uint32_t spawn_id,
const char* spell_link) const
{
auto outapp = std::make_unique<EQApplicationPacket>(OP_InterruptCast, sizeof(InterruptCast_Struct));
auto ic = reinterpret_cast<InterruptCast_Struct*>(outapp->pBuffer);
ic->messageid = ResolveID(message);
ic->spawnid = spawn_id;
outapp->priority = 5;
return outapp;
}
std::unique_ptr<EQApplicationPacket> MessageComponent::InterruptSpellOther(Mob* sender, uint32_t message, uint32_t spawn_id,
const char* name, const char* spell_link) const
{
auto outapp = std::make_unique<EQApplicationPacket>(OP_InterruptCast, sizeof(InterruptCast_Struct) + strlen(name) + 1);
auto ic = reinterpret_cast<InterruptCast_Struct*>(outapp->pBuffer);
ic->messageid = ResolveID(message);
ic->spawnid = spawn_id;
strcpy(ic->message, spell_link);
return outapp;
}
// A value of 0 means that the string isn't mapped in this client, valid string ids start at 1
uint32_t MessageComponent::ResolveID(uint32_t id) const
{
// passthrough — string IDs are defined at the base client level;
// override in patches where IDs need remapping
return id;
}
void MessageComponent::ResolveArguments(uint32_t id, std::array<const char*, 9>& args) const
{
switch (id) {
case SPELL_FIZZLE:
case MISS_NOTE:
args[0] = nullptr; // the 0th (and only) argument here is the spell link, not supported before TOB
break;
case SPELL_FIZZLE_OTHER:
case MISSED_NOTE_OTHER:
args[1] = nullptr; // the 1st argument here is the spell link, not supported before TOB
break;
default:
break;
}
}
std::unique_ptr<EQApplicationPacket> BuffComponent::BuffDefinition(Mob* mob, const Buffs_Struct& buff, uint32_t slot,
bool fade) const
{
auto outapp = std::make_unique<EQApplicationPacket>(OP_BuffDefinition, sizeof(SpellBuffPacket_Struct));
auto sbf = reinterpret_cast<SpellBuffPacket_Struct*>(outapp->pBuffer);
sbf->entityid = mob->GetID();
sbf->buff.effect_type = 2;
sbf->buff.level = buff.casterlevel > 0 ? buff.casterlevel : mob->GetLevel();
sbf->buff.bard_modifier = buff.instrument_mod;
sbf->buff.spellid = buff.spellid;
sbf->buff.duration = buff.ticsremaining;
if (buff.dot_rune)
sbf->buff.counters = buff.dot_rune;
else if (buff.magic_rune)
sbf->buff.counters = buff.magic_rune;
else if (buff.melee_rune)
sbf->buff.counters = buff.melee_rune;
else if (buff.counters)
sbf->buff.counters = buff.counters;
sbf->buff.player_id = buff.casterid;
sbf->buff.num_hits = buff.hit_number;
sbf->buff.y = buff.caston_y;
sbf->buff.x = buff.caston_x;
sbf->buff.z = buff.caston_z;
sbf->slotid = ServerToPatchBuffSlot(slot);
sbf->bufffade = fade;
return outapp;
}
std::unique_ptr<EQApplicationPacket> BuffComponent::RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove,
bool buff_timers_suspended, const std::vector<uint32_t>& slots) const
{
// titanium only sends refresh for pet buffs
if (opcode == OP_RefreshPetBuffs) {
Buffs_Struct* buffs = mob->GetBuffs();
std::vector<uint32_t> send_slots;
if (slots.empty()) {
for (uint32_t slot = 0; slot < mob->GetMaxTotalSlots(); ++slot)
if (buffs[slot].spellid > 1)
send_slots.push_back(slot);
} else {
for (uint32_t slot : slots)
if (slot < mob->GetMaxTotalSlots() && buffs[slot].spellid > 1)
send_slots.push_back(slot);
}
auto outapp = std::make_unique<EQApplicationPacket>(OP_RefreshPetBuffs, sizeof(PetBuff_Struct));
auto pbs = reinterpret_cast<PetBuff_Struct*>(outapp->pBuffer);
memset(outapp->pBuffer, 0, outapp->size);
pbs->petid = mob->GetID();
int MaxSlots = mob->GetMaxTotalSlots();
if (MaxSlots > PET_BUFF_COUNT)
MaxSlots = PET_BUFF_COUNT;
int count = 0;
for (uint32_t slot : send_slots) {
if (slot < MaxSlots) {
pbs->spellid[slot] = buffs[slot].spellid;
pbs->ticsremaining[slot] = buffs[slot].ticsremaining;
++count;
}
}
pbs->buffcount = count;
return outapp;
}
return nullptr;
}
bool BuffComponent::NeedsWearMessage() const { return true; }
void BuffComponent::SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, uint8_t refresh_type) const {}
} /*Titanium*/ } /*Titanium*/
+48 -16
View File
@@ -18,33 +18,65 @@
#pragma once #pragma once
#include "common/struct_strategy.h" #include "common/struct_strategy.h"
#include "common/patches/IBuff.h"
#include "common/patches/IMessage.h"
class EQStreamIdentifier; class EQStreamIdentifier;
namespace Titanium namespace Titanium {
extern void Register(EQStreamIdentifier& into);
extern void Reload();
class Strategy : public StructStrategy
{ {
public:
Strategy();
//these are the only public member of this namespace. protected:
extern void Register(EQStreamIdentifier &into); virtual std::string Describe() const;
extern void Reload(); virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
#include "titanium_ops.h"
};
class MessageComponent : public ClientPatch::IMessage
{
public:
MessageComponent() = default;
~MessageComponent() override = default;
//you should not directly access anything below.. std::unique_ptr<EQApplicationPacket> Simple(uint32_t color, uint32_t id) const override;
//I just dont feel like making a seperate header for it. std::unique_ptr<EQApplicationPacket> Formatted(uint32_t color, uint32_t id,
const FormattedArgs& args) const override;
class Strategy : public StructStrategy { std::unique_ptr<EQApplicationPacket> InterruptSpell(uint32_t message, uint32_t spawn_id,
public: const char* spell_link) const override;
Strategy(); std::unique_ptr<EQApplicationPacket> InterruptSpellOther(Mob* sender, uint32_t message, uint32_t spawn_id,
const char* name,
const char* spell_link) const override;
protected: protected:
[[nodiscard]] virtual uint32_t ResolveID(uint32_t id) const;
virtual void ResolveArguments(uint32_t id, std::array<const char*, 9>& args) const;
};
virtual std::string Describe() const; class BuffComponent : public ClientPatch::IBuff
virtual const EQ::versions::ClientVersion ClientVersion() const; {
public:
BuffComponent(uint32_t maxLongBuffs, uint32_t maxShortBuffs) : IBuff(maxLongBuffs, maxShortBuffs) {}
BuffComponent() = delete;
~BuffComponent() override = default;
//magic macro to declare our opcode processors std::unique_ptr<EQApplicationPacket> BuffDefinition(Mob* mob, const Buffs_Struct& buff, uint32_t slot,
#include "ss_declare.h" bool fade) const override;
#include "titanium_ops.h" std::unique_ptr<EQApplicationPacket> RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove,
}; bool buff_timers_suspended, const std::vector<uint32_t>& slots) const override;
bool NeedsWearMessage() const override;
void SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, uint8_t refresh_type) const override;
};
} /*Titanium*/ } /*Titanium*/
+2 -3
View File
@@ -21,7 +21,7 @@ E(OP_AdventureMerchantSell)
E(OP_ApplyPoison) E(OP_ApplyPoison)
E(OP_BazaarSearch) E(OP_BazaarSearch)
E(OP_BecomeTrader) E(OP_BecomeTrader)
E(OP_Buff) E(OP_BuffDefinition)
E(OP_ChannelMessage) E(OP_ChannelMessage)
E(OP_CharInventory) E(OP_CharInventory)
E(OP_ClientUpdate) E(OP_ClientUpdate)
@@ -61,7 +61,6 @@ E(OP_ManaChange)
E(OP_MemorizeSpell) E(OP_MemorizeSpell)
E(OP_MoveItem) E(OP_MoveItem)
E(OP_OnLevelMessage) E(OP_OnLevelMessage)
E(OP_PetBuffWindow)
E(OP_PlayerProfile) E(OP_PlayerProfile)
E(OP_NewSpawn) E(OP_NewSpawn)
E(OP_MarkRaidNPC) E(OP_MarkRaidNPC)
@@ -91,7 +90,7 @@ D(OP_AdventureMerchantSell)
D(OP_ApplyPoison) D(OP_ApplyPoison)
D(OP_AugmentItem) D(OP_AugmentItem)
D(OP_BazaarSearch) D(OP_BazaarSearch)
D(OP_Buff) D(OP_BuffDefinition)
D(OP_Bug) D(OP_Bug)
D(OP_CastSpell) D(OP_CastSpell)
D(OP_ChannelMessage) D(OP_ChannelMessage)
+9 -9
View File
@@ -406,7 +406,7 @@ struct NewZone_Struct {
*/ */
struct MemorizeSpell_Struct { struct MemorizeSpell_Struct {
uint32 slot; // Spot in the spell book/memorized slot uint32 slot; // Spot in the spell book/memorized slot
uint32 spell_id; // Spell id (200 or c8 is minor healing, etc) int32 spell_id; // Spell id (200 or c8 is minor healing, etc)
uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming
uint32 reduction; // lowers reuse uint32 reduction; // lowers reuse
}; };
@@ -442,7 +442,7 @@ struct ManaChange_Struct
{ {
/*00*/ uint32 new_mana; // New Mana AMount /*00*/ uint32 new_mana; // New Mana AMount
/*04*/ uint32 stamina; /*04*/ uint32 stamina;
/*08*/ uint32 spell_id; /*08*/ int32 spell_id;
/*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting? /*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting?
/*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like /*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like
}; };
@@ -459,14 +459,14 @@ struct BeginCast_Struct
{ {
// len = 8 // len = 8
/*000*/ uint16 caster_id; /*000*/ uint16 caster_id;
/*002*/ uint16 spell_id; /*002*/ int16 spell_id;
/*004*/ uint32 cast_time; // in miliseconds /*004*/ uint32 cast_time; // in miliseconds
}; };
struct CastSpell_Struct struct CastSpell_Struct
{ {
uint32 slot; uint32 slot;
uint32 spell_id; int32 spell_id;
uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast
uint32 target_id; uint32 target_id;
uint8 cs_unknown[4]; uint8 cs_unknown[4];
@@ -495,7 +495,7 @@ struct SpellBuff_Struct
/*001*/ uint8 level; /*001*/ uint8 level;
/*002*/ uint8 bard_modifier; /*002*/ uint8 bard_modifier;
/*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking? /*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking?
/*004*/ uint32 spellid; /*004*/ int32 spellid;
/*008*/ int32 duration; /*008*/ int32 duration;
/*012*/ uint32 counters; // single book keeping value (counters, rune/vie) /*012*/ uint32 counters; // single book keeping value (counters, rune/vie)
/*016*/ uint32 player_id; // caster ID, pretty sure just zone ID /*016*/ uint32 player_id; // caster ID, pretty sure just zone ID
@@ -1142,7 +1142,7 @@ struct CombatDamage_Struct
/* 00 */ uint16 target; /* 00 */ uint16 target;
/* 02 */ uint16 source; /* 02 */ uint16 source;
/* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells, skill /* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells, skill
/* 05 */ uint16 spellid; /* 05 */ int16 spellid;
/* 07 */ uint32 damage; /* 07 */ uint32 damage;
/* 11 */ float force; /* 11 */ float force;
/* 15 */ float hit_heading; // see above notes in Action_Struct /* 15 */ float hit_heading; // see above notes in Action_Struct
@@ -1177,7 +1177,7 @@ struct Death_Struct
/*004*/ uint32 killer_id; /*004*/ uint32 killer_id;
/*008*/ uint32 corpseid; // was corpseid /*008*/ uint32 corpseid; // was corpseid
/*012*/ uint32 attack_skill; // was type /*012*/ uint32 attack_skill; // was type
/*016*/ uint32 spell_id; /*016*/ int32 spell_id;
/*020*/ uint32 bindzoneid; //bindzoneid? /*020*/ uint32 bindzoneid; //bindzoneid?
/*024*/ uint32 damage; /*024*/ uint32 damage;
/*028*/ uint32 unknown028; /*028*/ uint32 unknown028;
@@ -2233,7 +2233,7 @@ struct Resurrect_Struct {
char your_name[64]; char your_name[64];
uint32 unknown88; uint32 unknown88;
char rezzer_name[64]; char rezzer_name[64];
uint32 spellid; int32 spellid;
char corpse_name[64]; char corpse_name[64];
uint32 action; uint32 action;
/* 228 */ /* 228 */
@@ -3247,7 +3247,7 @@ struct SendAA_Struct {
/*0040*/ uint32 prereq_skill; //is < 0, abs() is category # /*0040*/ uint32 prereq_skill; //is < 0, abs() is category #
/*0044*/ uint32 prereq_minpoints; //min points in the prereq /*0044*/ uint32 prereq_minpoints; //min points in the prereq
/*0048*/ uint32 type; /*0048*/ uint32 type;
/*0052*/ uint32 spellid; /*0052*/ int32 spellid;
/*0056*/ uint32 spell_type; /*0056*/ uint32 spell_type;
/*0060*/ uint32 spell_refresh; /*0060*/ uint32 spell_refresh;
/*0064*/ uint32 classes; /*0064*/ uint32 classes;
File diff suppressed because it is too large Load Diff
+79
View File
@@ -0,0 +1,79 @@
/* EQEmu: EQEmulator
Copyright (C) 2001-2026 EQEmu Development Team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "common/struct_strategy.h"
#include "common/patches/rof2.h"
class EQStreamIdentifier;
namespace TOB {
extern void Register(EQStreamIdentifier& into);
extern void Reload();
class Strategy : public StructStrategy
{
public:
Strategy();
protected:
virtual std::string Describe() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
#include "tob_ops.h"
};
class MessageComponent : public Titanium::MessageComponent
{
public:
MessageComponent() = default;
~MessageComponent() override = default;
std::unique_ptr<EQApplicationPacket> Formatted(uint32_t color, uint32_t id,
const FormattedArgs& args) const override;
std::unique_ptr<EQApplicationPacket> InterruptSpell(uint32_t message, uint32_t spawn_id,
const char* spell_link) const override;
std::unique_ptr<EQApplicationPacket> InterruptSpellOther(Mob* sender, uint32_t message, uint32_t spawn_id,
const char* name, const char* spell_link) const override;
protected:
[[nodiscard]] uint32_t ResolveID(uint32_t id) const override;
void ResolveArguments(uint32_t id, std::array<const char*, 9>& args) const override;
};
class BuffComponent : public UF::BuffComponent
{
public:
BuffComponent(uint32_t maxLongBuffs, uint32_t maxShortBuffs) : UF::BuffComponent(maxLongBuffs, maxShortBuffs) {}
BuffComponent() = delete;
~BuffComponent() override = default;
std::unique_ptr<EQApplicationPacket>
BuffDefinition(Mob* mob, const Buffs_Struct& buff, uint32_t slot, bool fade) const override;
std::unique_ptr<EQApplicationPacket> RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove,
bool buff_timers_suspended, const std::vector<uint32_t>& slots) const override;
bool NeedsWearMessage() const override;
void SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, uint8_t refresh_type) const override;
};
}; /*TOB*/
+265
View File
@@ -0,0 +1,265 @@
#include "tob_limits.h"
#include "../strings.h"
int16 TOB::invtype::GetInvTypeSize(int16 inv_type)
{
switch (inv_type) {
case invtype::typePossessions:
return invtype::POSSESSIONS_SIZE;
case invtype::typeBank:
return invtype::BANK_SIZE;
case invtype::typeSharedBank:
return invtype::SHARED_BANK_SIZE;
case invtype::typeTrade:
return invtype::TRADE_SIZE;
case invtype::typeWorld:
return invtype::WORLD_SIZE;
case invtype::typeLimbo:
return invtype::LIMBO_SIZE;
case invtype::typeTribute:
return invtype::TRIBUTE_SIZE;
case invtype::typeTrophyTribute:
return invtype::TROPHY_TRIBUTE_SIZE;
case invtype::typeGuildTribute:
return invtype::GUILD_TRIBUTE_SIZE;
case invtype::typeMerchant:
return invtype::MERCHANT_SIZE;
case invtype::typeDeleted:
return invtype::DELETED_SIZE;
case invtype::typeCorpse:
return invtype::CORPSE_SIZE;
case invtype::typeBazaar:
return invtype::BAZAAR_SIZE;
case invtype::typeInspect:
return invtype::INSPECT_SIZE;
case invtype::typeRealEstate:
return invtype::REAL_ESTATE_SIZE;
case invtype::typeViewMODPC:
return invtype::VIEW_MOD_PC_SIZE;
case invtype::typeViewMODBank:
return invtype::VIEW_MOD_BANK_SIZE;
case invtype::typeViewMODSharedBank:
return invtype::VIEW_MOD_SHARED_BANK_SIZE;
case invtype::typeViewMODLimbo:
return invtype::VIEW_MOD_LIMBO_SIZE;
case invtype::typeAltStorage:
return invtype::ALT_STORAGE_SIZE;
case invtype::typeArchived:
return invtype::ARCHIVED_SIZE;
case invtype::typeMail:
return invtype::MAIL_SIZE;
case invtype::typeGuildTrophyTribute:
return invtype::GUILD_TROPHY_TRIBUTE_SIZE;
case invtype::typeKrono:
return invtype::KRONO_SIZE;
case invtype::typeOther:
return invtype::OTHER_SIZE;
default:
return INULL;
}
}
const char* TOB::invtype::GetInvTypeName(int16 inv_type)
{
switch (inv_type) {
case invtype::TYPE_INVALID:
return "Invalid Type";
case invtype::typePossessions:
return "Possessions";
case invtype::typeBank:
return "Bank";
case invtype::typeSharedBank:
return "Shared Bank";
case invtype::typeTrade:
return "Trade";
case invtype::typeWorld:
return "World";
case invtype::typeLimbo:
return "Limbo";
case invtype::typeTribute:
return "Tribute";
case invtype::typeTrophyTribute:
return "Trophy Tribute";
case invtype::typeGuildTribute:
return "Guild Tribute";
case invtype::typeMerchant:
return "Merchant";
case invtype::typeDeleted:
return "Deleted";
case invtype::typeCorpse:
return "Corpse";
case invtype::typeBazaar:
return "Bazaar";
case invtype::typeInspect:
return "Inspect";
case invtype::typeRealEstate:
return "Real Estate";
case invtype::typeViewMODPC:
return "View MOD PC";
case invtype::typeViewMODBank:
return "View MOD Bank";
case invtype::typeViewMODSharedBank:
return "View MOD Shared Bank";
case invtype::typeViewMODLimbo:
return "View MOD Limbo";
case invtype::typeAltStorage:
return "Alt Storage";
case invtype::typeArchived:
return "Archived";
case invtype::typeMail:
return "Mail";
case invtype::typeGuildTrophyTribute:
return "Guild Trophy Tribute";
case invtype::typeKrono:
return "Krono";
case invtype::typeOther:
return "Other";
default:
return "Unknown Type";
}
}
bool TOB::invtype::IsInvTypePersistent(int16 inv_type)
{
switch (inv_type) {
case invtype::typePossessions:
case invtype::typeBank:
case invtype::typeSharedBank:
case invtype::typeTrade:
case invtype::typeWorld:
case invtype::typeLimbo:
case invtype::typeTribute:
case invtype::typeTrophyTribute:
case invtype::typeGuildTribute:
return true;
default:
return false;
}
}
const char* TOB::invslot::GetInvPossessionsSlotName(int16 inv_slot)
{
switch (inv_slot) {
case invslot::SLOT_INVALID:
return "Invalid Slot";
case invslot::slotCharm:
return "Charm";
case invslot::slotEar1:
return "Ear 1";
case invslot::slotHead:
return "Head";
case invslot::slotFace:
return "Face";
case invslot::slotEar2:
return "Ear 2";
case invslot::slotNeck:
return "Neck";
case invslot::slotShoulders:
return "Shoulders";
case invslot::slotArms:
return "Arms";
case invslot::slotBack:
return "Back";
case invslot::slotWrist1:
return "Wrist 1";
case invslot::slotWrist2:
return "Wrist 2";
case invslot::slotRange:
return "Range";
case invslot::slotHands:
return "Hands";
case invslot::slotPrimary:
return "Primary";
case invslot::slotSecondary:
return "Secondary";
case invslot::slotFinger1:
return "Finger 1";
case invslot::slotFinger2:
return "Finger 2";
case invslot::slotChest:
return "Chest";
case invslot::slotLegs:
return "Legs";
case invslot::slotFeet:
return "Feet";
case invslot::slotWaist:
return "Waist";
case invslot::slotPowerSource:
return "Power Source";
case invslot::slotAmmo:
return "Ammo";
case invslot::slotGeneral1:
return "General 1";
case invslot::slotGeneral2:
return "General 2";
case invslot::slotGeneral3:
return "General 3";
case invslot::slotGeneral4:
return "General 4";
case invslot::slotGeneral5:
return "General 5";
case invslot::slotGeneral6:
return "General 6";
case invslot::slotGeneral7:
return "General 7";
case invslot::slotGeneral8:
return "General 8";
case invslot::slotGeneral9:
return "General 9";
case invslot::slotGeneral10:
return "General 10";
case invslot::slotCursor:
return "Cursor";
default:
return "Unknown Slot";
}
}
const char* TOB::invslot::GetInvSlotName(int16 inv_type, int16 inv_slot)
{
if (inv_type == invtype::typePossessions)
return invslot::GetInvPossessionsSlotName(inv_slot);
int16 type_size = invtype::GetInvTypeSize(inv_type);
if (!type_size || inv_slot == invslot::SLOT_INVALID)
return "Invalid Slot";
if ((inv_slot + 1) >= type_size)
return "Unknown Slot";
static std::string ret_str;
ret_str = StringFormat("Slot %i", (inv_slot + 1));
return ret_str.c_str();
}
const char* TOB::invbag::GetInvBagIndexName(int16 bag_index)
{
if (bag_index == invbag::SLOT_INVALID)
return "Invalid Bag";
if (bag_index >= invbag::SLOT_COUNT)
return "Unknown Bag";
static std::string ret_str;
ret_str = StringFormat("Bag %i", (bag_index + 1));
return ret_str.c_str();
}
const char* TOB::invaug::GetInvAugIndexName(int16 aug_index)
{
if (aug_index == invaug::SOCKET_INVALID)
return "Invalid Augment";
if (aug_index >= invaug::SOCKET_COUNT)
return "Unknown Augment";
static std::string ret_str;
ret_str = StringFormat("Augment %i", (aug_index + 1));
return ret_str.c_str();
}
+337
View File
@@ -0,0 +1,337 @@
#ifndef COMMON_LAURION_LIMITS_H
#define COMMON_LAURION_LIMITS_H
#include "common/types.h"
#include "common/emu_versions.h"
#include "common/skills.h"
namespace TOB
{
const int16 IINVALID = -1;
const int16 INULL = 0;
namespace inventory {
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::TOB; }
const bool ConcatenateInvTypeLimbo = false;
const bool AllowOverLevelEquipment = true;
const bool AllowEmptyBagInBag = true;
const bool AllowClickCastFromBag = true;
} /*inventory*/
namespace invtype {
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::TOB; }
namespace enum_ {
enum InventoryTypes : int16 {
typePossessions = INULL,
typeBank,
typeSharedBank,
typeTrade,
typeWorld,
typeLimbo,
typeTribute,
typeTrophyTribute,
typeGuildTribute,
typeMerchant,
typeDeleted,
typeCorpse,
typeBazaar,
typeInspect,
typeRealEstate,
typeViewMODPC,
typeViewMODBank,
typeViewMODSharedBank,
typeViewMODLimbo,
typeAltStorage,
typeArchived,
typeMail,
typeGuildTrophyTribute,
typeKrono,
typeOther,
typeMercenaryItems,
typeViewModMercenaryItems,
typeMountKeyRingItems,
typeViewModMountKeyRingItems,
typeIllusionKeyRingItems,
typeViewModIllusionKeyRingItems,
typeFamiliarKeyRingItems,
typeViewModFamiliarKeyRingItems,
typeHeroForgeKeyRingItems,
typeViewModHeroForgeKeyRingItems,
typeTeleportationKeyRingItems,
typeViewModTeleportationKeyRingItems,
typeOverflow,
typeDragonHoard,
typeTradeskillDepot,
typeGuildTradeskillDepot
};
} // namespace enum_
using namespace enum_;
const int16 POSSESSIONS_SIZE = 34;
const int16 BANK_SIZE = 24;
const int16 SHARED_BANK_SIZE = 2;
const int16 TRADE_SIZE = 8;
const int16 WORLD_SIZE = 10;
const int16 LIMBO_SIZE = 36;
const int16 TRIBUTE_SIZE = 5;
const int16 TROPHY_TRIBUTE_SIZE = 0;//unknown
const int16 GUILD_TRIBUTE_SIZE = 2;//unverified
const int16 MERCHANT_SIZE = 200;
const int16 DELETED_SIZE = 0;//unknown - "Recovery Tab"
const int16 CORPSE_SIZE = POSSESSIONS_SIZE;
const int16 BAZAAR_SIZE = 200;
const int16 INSPECT_SIZE = 23;
const int16 REAL_ESTATE_SIZE = 0;//unknown
const int16 VIEW_MOD_PC_SIZE = POSSESSIONS_SIZE;
const int16 VIEW_MOD_BANK_SIZE = BANK_SIZE;
const int16 VIEW_MOD_SHARED_BANK_SIZE = SHARED_BANK_SIZE;
const int16 VIEW_MOD_LIMBO_SIZE = LIMBO_SIZE;
const int16 ALT_STORAGE_SIZE = 0;//unknown - "Shroud Bank"
const int16 ARCHIVED_SIZE = 0;//unknown
const int16 MAIL_SIZE = 0;//unknown
const int16 GUILD_TROPHY_TRIBUTE_SIZE = 0;//unknown
const int16 KRONO_SIZE = 0;//unknown
const int16 OTHER_SIZE = 0;//unknown
const int16 TRADE_NPC_SIZE = 4; // defined by implication
const int16 TYPE_INVALID = IINVALID;
const int16 TYPE_BEGIN = typePossessions;
const int16 TYPE_END = typeOther;
const int16 TYPE_COUNT = (TYPE_END - TYPE_BEGIN) + 1;
int16 GetInvTypeSize(int16 inv_type);
const char* GetInvTypeName(int16 inv_type);
bool IsInvTypePersistent(int16 inv_type);
} /*invtype*/
namespace invslot {
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::TOB; }
namespace enum_ {
enum InventorySlots : int16 {
slotCharm = INULL,
slotEar1,
slotHead,
slotFace,
slotEar2,
slotNeck,
slotShoulders,
slotArms,
slotBack,
slotWrist1,
slotWrist2,
slotRange,
slotHands,
slotPrimary,
slotSecondary,
slotFinger1,
slotFinger2,
slotChest,
slotLegs,
slotFeet,
slotWaist,
slotPowerSource,
slotAmmo,
slotGeneral1,
slotGeneral2,
slotGeneral3,
slotGeneral4,
slotGeneral5,
slotGeneral6,
slotGeneral7,
slotGeneral8,
slotGeneral9,
slotGeneral10,
slotGeneral11,
slotGeneral12,
slotCursor
};
constexpr int16 format_as(InventorySlots slot) { return static_cast<int16>(slot); }
} // namespace enum_
using namespace enum_;
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
const int16 POSSESSIONS_BEGIN = slotCharm;
const int16 POSSESSIONS_END = slotCursor;
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;
const int16 EQUIPMENT_BEGIN = slotCharm;
const int16 EQUIPMENT_END = slotAmmo;
const int16 EQUIPMENT_COUNT = (EQUIPMENT_END - EQUIPMENT_BEGIN) + 1;
//We support more if enabled but for now lets leave it at the 10 slots
const int16 GENERAL_BEGIN = slotGeneral1;
const int16 GENERAL_END = slotGeneral10;
const int16 GENERAL_COUNT = (GENERAL_END - GENERAL_BEGIN) + 1;
const int16 BONUS_BEGIN = invslot::slotCharm;
const int16 BONUS_STAT_END = invslot::slotPowerSource;
const int16 BONUS_SKILL_END = invslot::slotAmmo;
const int16 CORPSE_BEGIN = invslot::slotGeneral1;
const int16 CORPSE_END = invslot::slotGeneral1 + invslot::slotCursor;
const uint64 EQUIPMENT_BITMASK = 0x00000000007FFFFF;
const uint64 GENERAL_BITMASK = 0x00000007FF800000;
const uint64 CURSOR_BITMASK = 0x0000000800000000;
const uint64 POSSESSIONS_BITMASK = (EQUIPMENT_BITMASK | GENERAL_BITMASK | CURSOR_BITMASK); // based on 36-slot count (TOB+)
const uint64 CORPSE_BITMASK = (GENERAL_BITMASK | CURSOR_BITMASK | (EQUIPMENT_BITMASK << 36)); // based on 36-slot count (TOB+)
const char* GetInvPossessionsSlotName(int16 inv_slot);
const char* GetInvSlotName(int16 inv_type, int16 inv_slot);
} /*invslot*/
namespace invbag {
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::TOB; }
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
const int16 SLOT_END = 199;
const int16 SLOT_COUNT = 200; // server Size will be 200..unsure what actual client is (test)
const char* GetInvBagIndexName(int16 bag_index);
} /*invbag*/
namespace invaug {
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::TOB; }
const int16 SOCKET_INVALID = IINVALID;
const int16 SOCKET_BEGIN = INULL;
const int16 SOCKET_END = 5;
const int16 SOCKET_COUNT = 6;
const char* GetInvAugIndexName(int16 aug_index);
} /*invaug*/
namespace item {
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::TOB; }
//enum Unknown : int { // looks like item class..but, RoF has it too - nothing in UF-
// Unknown1 = 0,
// Unknown2 = 1,
// Unknown3 = 2,
// Unknown4 = 5 // krono?
//};
enum ItemPacketType : int {
ItemPacketMerchant = 0x64,
ItemPacketTradeView = 0x65,
ItemPacketLoot = 0x66,
ItemPacketTrade = 0x67,
//looks like they added something at 0x68 that didn't exist before and shifted everything after it up by 1
ItemPacketUnknown068 = 0x68, //Not sure but it seems to deal with the cursor somehow.
ItemPacketCharInventory = 0x6A, //Rof 0x69 -> Larion 0x6a (requires translation)
ItemPacketLimbo = 0x6B, //0x6A -> 0x6B
ItemPacketWorldContainer = 0x6C,
ItemPacketTributeItem = 0x6D,
ItemPacketGuildTribute = 0x6E,
ItemPacketCharmUpdate = 0x6f,
ItemPacketRecovery = 0x72,
ItemPacketParcel = 0x74,
ItemPacketUnknown075 = 0x75, //Not sure but uses a lot of the same logic as the trade and char inventory types
ItemPacketOverflow = 0x76,
ItemPacketDragonHoard = 0x77,
ItemPacketTradeskill = 0x78,
ItemPacketTradeskillDepot = 0x79,
ItemPacketInvalid = 0xFF
};
} /*item*/
namespace profile {
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::TOB; }
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
const int16 POTION_BELT_SIZE = 5;
const int16 SKILL_ARRAY_SIZE = 100;
} /*profile*/
namespace constants {
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::TOB; }
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::LS;
const uint32 EXPANSION_BIT = EQ::expansions::bitLS;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskLS;
const size_t CHARACTER_CREATION_LIMIT = 12;
const size_t SAY_LINK_BODY_SIZE = 56;
const uint32 MAX_GUILD_ID = 50000;
const uint32 MAX_BAZAAR_TRADERS = 600;
} /*constants*/
namespace behavior {
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::TOB; }
const bool CoinHasWeight = false;
} /*behavior*/
namespace skills {
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::TOB; }
const size_t LastUsableSkill = EQ::skills::Skill2HPiercing;
} /*skills*/
namespace spells {
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::TOB; }
enum class CastingSlot : uint32 {
Gem1 = 0,
Gem2 = 1,
Gem3 = 2,
Gem4 = 3,
Gem5 = 4,
Gem6 = 5,
Gem7 = 6,
Gem8 = 7,
Gem9 = 8,
Gem10 = 9,
Gem11 = 10,
Gem12 = 11,
MaxGems = 18, // fallacy..only 12 slot are useable...
Item = 12,
Discipline = 13,
AltAbility = 0xFF
};
const int SPELL_ID_MAX = 71999;
const int SPELLBOOK_SIZE = 1120;
const int SPELL_GEM_COUNT = static_cast<uint32>(CastingSlot::MaxGems);
const int SPELL_GEM_RECAST_TIMER = 15;
const int LONG_BUFFS = 42;
const int SHORT_BUFFS = 30;
const int DISC_BUFFS = 1;
const int TOTAL_BUFFS = LONG_BUFFS + SHORT_BUFFS + DISC_BUFFS;
const int NPC_BUFFS = 400;
const int PET_BUFFS = NPC_BUFFS;
const int MERC_BUFFS = LONG_BUFFS;
} /*spells*/
}; /* TOB */
#endif /*COMMON_LAURION_LIMITS_H*/
+132
View File
@@ -0,0 +1,132 @@
//list of packets we need to encode on the way out:
E(OP_AAExpUpdate)
E(OP_Action)
E(OP_Animation)
E(OP_ApplyPoison)
E(OP_AugmentInfo)
E(OP_Begging)
E(OP_BeginCast)
E(OP_BlockedBuffs)
E(OP_CancelTrade)
E(OP_CastSpell)
E(OP_ChannelMessage)
E(OP_CharacterCreateRequest)
E(OP_CharInventory)
E(OP_Charm)
E(OP_ClickObjectAction)
E(OP_ClientUpdate)
E(OP_CompletedTasks)
E(OP_Consider)
E(OP_Damage)
E(OP_Death)
E(OP_DeleteCharge)
E(OP_DeleteItem)
E(OP_DeleteSpawn)
E(OP_DisciplineTimer)
E(OP_DisciplineUpdate)
E(OP_ExpansionInfo)
E(OP_ExpUpdate)
E(OP_Fling)
E(OP_GMTraining)
E(OP_GMTrainSkillConfirm)
E(OP_GroundSpawn)
E(OP_GroupInvite)
E(OP_HPUpdate)
E(OP_Illusion)
E(OP_IncreaseStats)
E(OP_ItemPacket)
E(OP_ItemRecastDelay)
E(OP_ItemVerifyReply)
E(OP_LinkedReuse)
E(OP_LogServer)
E(OP_LootItem)
E(OP_ManaChange)
E(OP_MemorizeSpell)
E(OP_MobHealth)
E(OP_MoneyOnCorpse)
E(OP_MoveItem)
E(OP_NewSpawn)
E(OP_NewZone)
E(OP_OnLevelMessage)
E(OP_PickPocket)
E(OP_PlayerProfile)
E(OP_ReadBook)
E(OP_RemoveBlockedBuffs)
E(OP_RespondAA)
E(OP_RequestClientZoneChange)
E(OP_RecipeAutoCombine)
E(OP_SendAATable)
E(OP_SendCharInfo)
E(OP_SendMaxCharacters)
E(OP_SendMembership)
E(OP_SendMembershipDetails)
E(OP_SendZonepoints)
E(OP_SharedTaskSelectWindow)
E(OP_ShopPlayerBuy)
E(OP_ShopPlayerSell)
E(OP_ShopRequest)
E(OP_SkillUpdate)
E(OP_SpecialMesg)
E(OP_SpawnAppearance)
E(OP_SpawnDoor)
E(OP_Stun)
E(OP_TaskActivity)
E(OP_TaskDescription)
E(OP_TaskHistoryReply)
E(OP_TaskSelectWindow)
E(OP_Track)
E(OP_WearChange)
E(OP_Weather)
E(OP_WhoAllResponse)
E(OP_ZoneChange)
E(OP_ZoneEntry)
E(OP_ZonePlayerToBind)
E(OP_ZoneSpawns)
//list of packets we need to decode on the way in:
D(OP_Animation)
D(OP_ApplyPoison)
D(OP_ApproveName)
D(OP_AugmentInfo)
D(OP_AugmentItem)
D(OP_BlockedBuffs)
D(OP_BookButton)
D(OP_BuffDefinition)
D(OP_BuffRemoveRequest)
D(OP_CastSpell)
D(OP_ChannelMessage)
D(OP_CharacterCreate)
D(OP_ClientUpdate)
D(OP_ClickDoor)
D(OP_Consider)
D(OP_ConsiderCorpse)
D(OP_Consume)
D(OP_CorpseDrag)
D(OP_Damage)
D(OP_DeleteItem)
D(OP_EnterWorld)
D(OP_EnvDamage)
D(OP_GMTraining)
D(OP_GroupDisband)
D(OP_GroupInvite)
D(OP_GroupInvite2)
D(OP_ItemVerifyRequest)
D(OP_LootItem)
D(OP_MemorizeSpell)
D(OP_MoveItem)
D(OP_PickPocket)
D(OP_ReadBook)
D(OP_RecipeAutoCombine)
D(OP_RemoveBlockedBuffs)
D(OP_SetServerFilter)
D(OP_ShopPlayerBuy)
D(OP_ShopPlayerSell)
D(OP_ShopRequest)
D(OP_SpawnAppearance)
D(OP_TradeSkillCombine)
D(OP_WearChange)
D(OP_WhoAllRequest)
D(OP_ZoneEntry)
D(OP_ZoneChange)
#undef E
#undef D
File diff suppressed because it is too large Load Diff
+49 -113
View File
@@ -33,6 +33,7 @@
#include "common/raid.h" #include "common/raid.h"
#include "common/rulesys.h" #include "common/rulesys.h"
#include "common/strings.h" #include "common/strings.h"
#include "zone/mob.h"
#include "cereal/types/vector.hpp" #include "cereal/types/vector.hpp"
#include <iostream> #include <iostream>
@@ -64,7 +65,6 @@ namespace UF
static inline spells::CastingSlot ServerToUFCastingSlot(EQ::spells::CastingSlot slot); static inline spells::CastingSlot ServerToUFCastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot); static inline EQ::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot);
static inline int ServerToUFBuffSlot(int index);
static inline int UFToServerBuffSlot(int index); static inline int UFToServerBuffSlot(int index);
void Register(EQStreamIdentifier &into) void Register(EQStreamIdentifier &into)
@@ -434,7 +434,7 @@ namespace UF
} }
} }
ENCODE(OP_Buff) ENCODE(OP_BuffDefinition)
{ {
ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct); ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct);
SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct);
@@ -442,72 +442,17 @@ namespace UF
OUT(entityid); OUT(entityid);
OUT(buff.effect_type); OUT(buff.effect_type);
OUT(buff.level); OUT(buff.level);
// just so we're 100% sure we get a 1.0f ... OUT(buff.bard_modifier);
eq->buff.bard_modifier = emu->buff.bard_modifier == 10 ? 1.0f : emu->buff.bard_modifier / 10.0f;
OUT(buff.spellid); OUT(buff.spellid);
OUT(buff.duration); OUT(buff.duration);
OUT(buff.num_hits); OUT(buff.num_hits);
// TODO: implement slot_data stuff // TODO: implement slot_data stuff
eq->slotid = ServerToUFBuffSlot(emu->slotid); OUT(slotid);
OUT(bufffade); // Live (October 2011) sends a 2 rather than 0 when a buff is created, but it doesn't seem to matter. OUT(bufffade); // Live (October 2011) sends a 2 rather than 0 when a buff is created, but it doesn't seem to matter.
FINISH_ENCODE(); FINISH_ENCODE();
} }
ENCODE(OP_BuffCreate)
{
SETUP_VAR_ENCODE(BuffIcon_Struct);
uint32 sz = 12 + (17 * emu->count) + emu->name_lengths; // 17 includes nullterm
__packet->size = sz;
__packet->pBuffer = new unsigned char[sz];
memset(__packet->pBuffer, 0, sz);
__packet->WriteUInt32(emu->entity_id);
__packet->WriteUInt32(emu->tic_timer);
__packet->WriteUInt8(emu->all_buffs); // 1 = all buffs, 0 = 1 buff
__packet->WriteUInt16(emu->count);
for (int i = 0; i < emu->count; ++i)
{
__packet->WriteUInt32(emu->type == 0 ? ServerToUFBuffSlot(emu->entries[i].buff_slot) : emu->entries[i].buff_slot);
__packet->WriteUInt32(emu->entries[i].spell_id);
__packet->WriteUInt32(emu->entries[i].tics_remaining);
__packet->WriteUInt32(emu->entries[i].num_hits);
__packet->WriteString(emu->entries[i].caster);
}
__packet->WriteUInt8(emu->type);
FINISH_ENCODE();
/*
uint32 write_var32 = 60;
uint8 write_var8 = 1;
ss.write((const char*)&emu->entity_id, sizeof(uint32));
ss.write((const char*)&write_var32, sizeof(uint32));
ss.write((const char*)&write_var8, sizeof(uint8));
ss.write((const char*)&emu->count, sizeof(uint16));
write_var32 = 0;
write_var8 = 0;
for(uint16 i = 0; i < emu->count; ++i)
{
if(emu->entries[i].buff_slot >= 25 && emu->entries[i].buff_slot < 37)
{
emu->entries[i].buff_slot += 5;
}
else if(emu->entries[i].buff_slot >= 37)
{
emu->entries[i].buff_slot += 14;
}
ss.write((const char*)&emu->entries[i].buff_slot, sizeof(uint32));
ss.write((const char*)&emu->entries[i].spell_id, sizeof(uint32));
ss.write((const char*)&emu->entries[i].tics_remaining, sizeof(uint32));
ss.write((const char*)&write_var32, sizeof(uint32));
ss.write((const char*)&write_var8, sizeof(uint8));
}
ss.write((const char*)&write_var8, sizeof(uint8));
*/
}
ENCODE(OP_CancelTrade) ENCODE(OP_CancelTrade)
{ {
ENCODE_LENGTH_EXACT(CancelTrade_Struct); ENCODE_LENGTH_EXACT(CancelTrade_Struct);
@@ -1800,44 +1745,6 @@ namespace UF
FINISH_ENCODE(); FINISH_ENCODE();
} }
ENCODE(OP_PetBuffWindow)
{
EQApplicationPacket *in = *p;
*p = nullptr;
unsigned char *__emu_buffer = in->pBuffer;
PetBuff_Struct *emu = (PetBuff_Struct *)__emu_buffer;
int PacketSize = 12 + (emu->buffcount * 17);
in->size = PacketSize;
in->pBuffer = new unsigned char[in->size];
char *Buffer = (char *)in->pBuffer;
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->petid);
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0);
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 1);
VARSTRUCT_ENCODE_TYPE(uint16, Buffer, emu->buffcount);
for (unsigned int i = 0; i < PET_BUFF_COUNT; ++i)
{
if (emu->spellid[i])
{
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, i);
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->spellid[i]);
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->ticsremaining[i]);
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // numhits
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0); // This is a string. Name of the caster of the buff.
}
}
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->buffcount); /// I think this is actually some sort of type
delete[] __emu_buffer;
dest->FastQueuePacket(&in, ack_req);
}
ENCODE(OP_PlayerProfile) ENCODE(OP_PlayerProfile)
{ {
SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct); SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct);
@@ -2729,8 +2636,6 @@ namespace UF
FINISH_ENCODE(); FINISH_ENCODE();
} }
ENCODE(OP_TargetBuffs) { ENCODE_FORWARD(OP_BuffCreate); }
ENCODE(OP_TaskDescription) ENCODE(OP_TaskDescription)
{ {
EQApplicationPacket *in = *p; EQApplicationPacket *in = *p;
@@ -3638,7 +3543,7 @@ namespace UF
FINISH_DIRECT_DECODE(); FINISH_DIRECT_DECODE();
} }
DECODE(OP_Buff) DECODE(OP_BuffDefinition)
{ {
DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct); DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct);
SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct);
@@ -5208,19 +5113,6 @@ namespace UF
} }
} }
static inline int ServerToUFBuffSlot(int index)
{
// we're a disc
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
static inline int UFToServerBuffSlot(int index) static inline int UFToServerBuffSlot(int index)
{ {
// we're a disc // we're a disc
@@ -5233,4 +5125,48 @@ namespace UF
// we're a normal buff // we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine return index; // as long as we guard against bad slots server side, we should be fine
} }
std::unique_ptr<EQApplicationPacket> BuffComponent::RefreshBuffs(EmuOpcode opcode, Mob* mob,
bool remove,
bool buff_timers_suspended, const std::vector<uint32_t>& slots) const
{
// UF introduced the self refresh buff packet
Buffs_Struct* buffs = mob->GetBuffs();
size_t buffer_size = 12; // 12 bytes outside the list
std::vector<uint32_t> send_slots;
if (slots.empty()) {
for (uint32_t slot = 0; slot < mob->GetMaxTotalSlots(); ++slot)
if (buffs[slot].spellid > 1) {
buffer_size += 17 + strlen(buffs[slot].caster_name); // 17 includes the null terminator
send_slots.push_back(slot);
}
} else {
for (uint32_t slot : slots)
if (slot < mob->GetMaxTotalSlots() && buffs[slot].spellid > 1) {
buffer_size += 17 + strlen(buffs[slot].caster_name);
send_slots.push_back(slot);
}
}
SerializeBuffer buffer(buffer_size);
buffer.WriteUInt32(mob->GetID());
buffer.WriteUInt32(mob->GetRemainingTicTime());
buffer.WriteUInt8(slots.empty() ? 1 : 0);
buffer.WriteUInt16(send_slots.size());
for (uint32_t slot : send_slots) {
buffer.WriteUInt32(ServerToPatchBuffSlot(slot));
buffer.WriteInt32(remove ? -1 : buffs[slot].spellid);
buffer.WriteInt32(buffs[slot].ticsremaining);
buffer.WriteUInt32(buffs[slot].hit_number);
buffer.WriteString(buffs[slot].caster_name);
}
buffer.WriteUInt8(opcode == OP_RefreshPetBuffs ? 2 : 0);
return std::make_unique<EQApplicationPacket>(opcode, std::move(buffer));
}
} /*UF*/ } /*UF*/
+25 -20
View File
@@ -18,33 +18,38 @@
#pragma once #pragma once
#include "common/struct_strategy.h" #include "common/struct_strategy.h"
#include "common/patches/sod.h"
class EQStreamIdentifier; class EQStreamIdentifier;
namespace UF namespace UF {
extern void Register(EQStreamIdentifier& into);
extern void Reload();
class Strategy : public StructStrategy
{ {
public:
Strategy();
//these are the only public member of this namespace. protected:
extern void Register(EQStreamIdentifier &into); virtual std::string Describe() const;
extern void Reload(); virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
#include "uf_ops.h"
};
class BuffComponent : public SoD::BuffComponent
{
public:
BuffComponent(uint32_t maxLongBuffs, uint32_t maxShortBuffs) : SoD::BuffComponent(maxLongBuffs, maxShortBuffs) {}
BuffComponent() = delete;
~BuffComponent() override = default;
//you should not directly access anything below.. std::unique_ptr<EQApplicationPacket> RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove,
//I just dont feel like making a seperate header for it. bool buff_timers_suspended, const std::vector<uint32_t>& slots) const override;
};
class Strategy : public StructStrategy {
public:
Strategy();
protected:
virtual std::string Describe() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
#include "uf_ops.h"
};
}; /*UF*/ }; /*UF*/
+2 -5
View File
@@ -25,8 +25,7 @@ E(OP_AugmentInfo)
E(OP_Barter) E(OP_Barter)
E(OP_BazaarSearch) E(OP_BazaarSearch)
E(OP_BecomeTrader) E(OP_BecomeTrader)
E(OP_Buff) E(OP_BuffDefinition)
E(OP_BuffCreate)
E(OP_CancelTrade) E(OP_CancelTrade)
E(OP_ChannelMessage) E(OP_ChannelMessage)
E(OP_CharInventory) E(OP_CharInventory)
@@ -75,7 +74,6 @@ E(OP_MoveItem)
E(OP_NewSpawn) E(OP_NewSpawn)
E(OP_NewZone) E(OP_NewZone)
E(OP_OnLevelMessage) E(OP_OnLevelMessage)
E(OP_PetBuffWindow)
E(OP_PlayerProfile) E(OP_PlayerProfile)
E(OP_RaidJoin) E(OP_RaidJoin)
E(OP_RaidUpdate) E(OP_RaidUpdate)
@@ -93,7 +91,6 @@ E(OP_SpawnAppearance)
E(OP_SpawnDoor) E(OP_SpawnDoor)
E(OP_SpecialMesg) E(OP_SpecialMesg)
E(OP_Stun) E(OP_Stun)
E(OP_TargetBuffs)
E(OP_TaskDescription) E(OP_TaskDescription)
E(OP_Track) E(OP_Track)
E(OP_Trader) E(OP_Trader)
@@ -116,7 +113,7 @@ D(OP_AugmentInfo)
D(OP_AugmentItem) D(OP_AugmentItem)
D(OP_BazaarSearch) D(OP_BazaarSearch)
D(OP_BookButton) D(OP_BookButton)
D(OP_Buff) D(OP_BuffDefinition)
D(OP_BuffRemoveRequest) D(OP_BuffRemoveRequest)
D(OP_CastSpell) D(OP_CastSpell)
D(OP_ChannelMessage) D(OP_ChannelMessage)
+11 -11
View File
@@ -480,7 +480,7 @@ struct NewZone_Struct {
*/ */
struct MemorizeSpell_Struct { struct MemorizeSpell_Struct {
uint32 slot; // Spot in the spell book/memorized slot uint32 slot; // Spot in the spell book/memorized slot
uint32 spell_id; // Spell id (200 or c8 is minor healing, etc) int32 spell_id; // Spell id (200 or c8 is minor healing, etc)
uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming
uint32 reduction; // lowers reuse uint32 reduction; // lowers reuse
}; };
@@ -517,7 +517,7 @@ struct ManaChange_Struct
{ {
/*00*/ uint32 new_mana; // New Mana AMount /*00*/ uint32 new_mana; // New Mana AMount
/*04*/ uint32 stamina; /*04*/ uint32 stamina;
/*08*/ uint32 spell_id; /*08*/ int32 spell_id;
/*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting? /*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting?
/*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like /*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like
/*16*/ int32 slot; // -1 for normal usage slot for when we want silent interrupt? I think it does timer stuff or something. Linked Spell Reuse interrupt uses it /*16*/ int32 slot; // -1 for normal usage slot for when we want silent interrupt? I think it does timer stuff or something. Linked Spell Reuse interrupt uses it
@@ -535,14 +535,14 @@ struct BeginCast_Struct
{ {
// len = 8 // len = 8
/*004*/ uint16 caster_id; /*004*/ uint16 caster_id;
/*006*/ uint16 spell_id; /*006*/ int16 spell_id;
/*016*/ uint32 cast_time; // in miliseconds /*016*/ uint32 cast_time; // in miliseconds
}; };
struct CastSpell_Struct struct CastSpell_Struct
{ {
uint32 slot; uint32 slot;
uint32 spell_id; int32 spell_id;
uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast
uint32 target_id; uint32 target_id;
uint32 cs_unknown1; uint32 cs_unknown1;
@@ -575,7 +575,7 @@ struct SpellBuff_Struct
/*002*/ uint8 unknown002; //pretty sure padding now /*002*/ uint8 unknown002; //pretty sure padding now
/*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking? /*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking?
/*004*/ float bard_modifier; /*004*/ float bard_modifier;
/*008*/ uint32 spellid; /*008*/ int32 spellid;
/*012*/ uint32 duration; /*012*/ uint32 duration;
/*016*/ uint32 num_hits; /*016*/ uint32 num_hits;
/*020*/ uint32 player_id; // caster ID, pretty sure just zone ID /*020*/ uint32 player_id; // caster ID, pretty sure just zone ID
@@ -595,7 +595,7 @@ struct SpellBuffPacket_Struct {
#if 0 #if 0
struct BuffIconEntry_Struct { struct BuffIconEntry_Struct {
/*000*/ uint32 buff_slot; /*000*/ uint32 buff_slot;
/*004*/ uint32 spell_id; /*004*/ int32 spell_id;
/*008*/ uint32 tics_remaining; /*008*/ uint32 tics_remaining;
/*012*/ uint32 num_hits; /*012*/ uint32 num_hits;
// char name[0]; caster name is also here sometimes // char name[0]; caster name is also here sometimes
@@ -1306,7 +1306,7 @@ struct CombatDamage_Struct
/* 00 */ uint16 target; /* 00 */ uint16 target;
/* 02 */ uint16 source; /* 02 */ uint16 source;
/* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells /* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells
/* 05 */ uint16 spellid; /* 05 */ int16 spellid;
/* 07 */ int32 damage; /* 07 */ int32 damage;
/* 11 */ float force; // cd cc cc 3d /* 11 */ float force; // cd cc cc 3d
/* 15 */ float hit_heading; // see above notes in Action_Struct /* 15 */ float hit_heading; // see above notes in Action_Struct
@@ -1342,7 +1342,7 @@ struct Death_Struct
/*004*/ uint32 killer_id; /*004*/ uint32 killer_id;
/*008*/ uint32 corpseid; // was corpseid /*008*/ uint32 corpseid; // was corpseid
/*012*/ uint32 attack_skill; // was type /*012*/ uint32 attack_skill; // was type
/*016*/ uint32 spell_id; /*016*/ int32 spell_id;
/*020*/ uint32 bindzoneid; //bindzoneid? /*020*/ uint32 bindzoneid; //bindzoneid?
/*024*/ uint32 damage; /*024*/ uint32 damage;
/*028*/ uint32 unknown028; /*028*/ uint32 unknown028;
@@ -2194,7 +2194,7 @@ struct GroupFollow_Struct { // Underfoot Follow Struct
}; };
struct InspectBuffs_Struct { struct InspectBuffs_Struct {
/*000*/ uint32 spell_id[BUFF_COUNT]; /*000*/ int32 spell_id[BUFF_COUNT];
/*120*/ int32 tics_remaining[BUFF_COUNT]; /*120*/ int32 tics_remaining[BUFF_COUNT];
}; };
@@ -2610,7 +2610,7 @@ struct Resurrect_Struct {
char your_name[64]; char your_name[64];
uint32 unknown88; uint32 unknown88;
char rezzer_name[64]; char rezzer_name[64];
uint32 spellid; int32 spellid;
char corpse_name[64]; char corpse_name[64];
uint32 action; uint32 action;
/* 228 */ /* 228 */
@@ -3896,7 +3896,7 @@ struct SendAA_Struct {
/*0037*/ uint32 prereq_skill; //is < 0, abs() is category # /*0037*/ uint32 prereq_skill; //is < 0, abs() is category #
/*0041*/ uint32 prereq_minpoints; //min points in the prereq /*0041*/ uint32 prereq_minpoints; //min points in the prereq
/*0045*/ uint32 type; /*0045*/ uint32 type;
/*0049*/ uint32 spellid; /*0049*/ int32 spellid;
/*0053*/ uint32 spell_type; /*0053*/ uint32 spell_type;
/*0057*/ uint32 spell_refresh; /*0057*/ uint32 spell_refresh;
/*0061*/ uint32 classes; /*0061*/ uint32 classes;
@@ -23,7 +23,7 @@
* Any modifications to base repositories are to be made by the generator only * Any modifications to base repositories are to be made by the generator only
* *
* @generator ./utils/scripts/generators/repository-generator.pl * @generator ./utils/scripts/generators/repository-generator.pl
* @docs https://docs.eqemu.io/developer/repositories * @docs https://docs.eqemu.dev/developer/repositories
*/ */
#pragma once #pragma once
@@ -68,7 +68,7 @@ public:
float graveyard_x; float graveyard_x;
float graveyard_y; float graveyard_y;
float graveyard_z; float graveyard_z;
std::string graveyard_radius; float graveyard_radius;
}; };
static std::string PrimaryKey() static std::string PrimaryKey()
@@ -292,6 +292,7 @@ public:
e.graveyard_x = row[29] ? strtof(row[29], nullptr) : 0; e.graveyard_x = row[29] ? strtof(row[29], nullptr) : 0;
e.graveyard_y = row[30] ? strtof(row[30], nullptr) : 0; e.graveyard_y = row[30] ? strtof(row[30], nullptr) : 0;
e.graveyard_z = row[31] ? strtof(row[31], nullptr) : 0; e.graveyard_z = row[31] ? strtof(row[31], nullptr) : 0;
e.graveyard_radius = row[32] ? (strtof(row[32], nullptr) > 0.0f ? strtof(row[32], nullptr) : 0) : 0;
return e; return e;
} }
@@ -539,6 +540,7 @@ public:
e.graveyard_x = row[29] ? strtof(row[29], nullptr) : 0; e.graveyard_x = row[29] ? strtof(row[29], nullptr) : 0;
e.graveyard_y = row[30] ? strtof(row[30], nullptr) : 0; e.graveyard_y = row[30] ? strtof(row[30], nullptr) : 0;
e.graveyard_z = row[31] ? strtof(row[31], nullptr) : 0; e.graveyard_z = row[31] ? strtof(row[31], nullptr) : 0;
e.graveyard_radius = row[32] ? (strtof(row[32], nullptr) > 0.0f ? strtof(row[32], nullptr) : 0) : 0;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -595,6 +597,7 @@ public:
e.graveyard_x = row[29] ? strtof(row[29], nullptr) : 0; e.graveyard_x = row[29] ? strtof(row[29], nullptr) : 0;
e.graveyard_y = row[30] ? strtof(row[30], nullptr) : 0; e.graveyard_y = row[30] ? strtof(row[30], nullptr) : 0;
e.graveyard_z = row[31] ? strtof(row[31], nullptr) : 0; e.graveyard_z = row[31] ? strtof(row[31], nullptr) : 0;
e.graveyard_radius = row[32] ? (strtof(row[32], nullptr) > 0.0f ? strtof(row[32], nullptr) : 0) : 0;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -37,7 +37,7 @@ class BaseBlockedSpellsRepository {
public: public:
struct BlockedSpells { struct BlockedSpells {
int32_t id; int32_t id;
uint32_t spellid; int32_t spellid;
int8_t type; int8_t type;
int32_t zoneid; int32_t zoneid;
float x; float x;
@@ -193,7 +193,7 @@ public:
BlockedSpells e{}; BlockedSpells e{};
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0; e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.spellid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.spellid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.type = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0; e.type = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
e.zoneid = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0; e.zoneid = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.x = row[4] ? strtof(row[4], nullptr) : 0; e.x = row[4] ? strtof(row[4], nullptr) : 0;
@@ -372,7 +372,7 @@ public:
BlockedSpells e{}; BlockedSpells e{};
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0; e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.spellid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.spellid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.type = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0; e.type = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
e.zoneid = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0; e.zoneid = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.x = row[4] ? strtof(row[4], nullptr) : 0; e.x = row[4] ? strtof(row[4], nullptr) : 0;
@@ -412,7 +412,7 @@ public:
BlockedSpells e{}; BlockedSpells e{};
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0; e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.spellid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.spellid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.type = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0; e.type = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
e.zoneid = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0; e.zoneid = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.x = row[4] ? strtof(row[4], nullptr) : 0; e.x = row[4] ? strtof(row[4], nullptr) : 0;
@@ -37,7 +37,7 @@ class BaseBotBlockedBuffsRepository {
public: public:
struct BotBlockedBuffs { struct BotBlockedBuffs {
uint32_t bot_id; uint32_t bot_id;
uint32_t spell_id; int32_t spell_id;
uint8_t blocked; uint8_t blocked;
uint8_t blocked_pet; uint8_t blocked_pet;
}; };
@@ -144,10 +144,10 @@ public:
if (results.RowCount() == 1) { if (results.RowCount() == 1) {
BotBlockedBuffs e{}; BotBlockedBuffs e{};
e.bot_id = row[0] ? static_cast<uint32_t>(atoi(row[0])) : 0; e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.spell_id = row[1] ? static_cast<uint32_t>(atoi(row[1])) : 0; e.spell_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.blocked = row[2] ? static_cast<uint8_t>(atoi(row[2])) : 0; e.blocked = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.blocked_pet = row[3] ? static_cast<uint8_t>(atoi(row[3])) : 0; e.blocked_pet = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
return e; return e;
} }
@@ -276,10 +276,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
BotBlockedBuffs e{}; BotBlockedBuffs e{};
e.bot_id = row[0] ? static_cast<uint32_t>(atoi(row[0])) : 0; e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.spell_id = row[1] ? static_cast<uint32_t>(atoi(row[1])) : 0; e.spell_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.blocked = row[2] ? static_cast<uint8_t>(atoi(row[2])) : 0; e.blocked = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.blocked_pet = row[3] ? static_cast<uint8_t>(atoi(row[3])) : 0; e.blocked_pet = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -304,10 +304,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
BotBlockedBuffs e{}; BotBlockedBuffs e{};
e.bot_id = row[0] ? static_cast<uint32_t>(atoi(row[0])) : 0; e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.spell_id = row[1] ? static_cast<uint32_t>(atoi(row[1])) : 0; e.spell_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.blocked = row[2] ? static_cast<uint8_t>(atoi(row[2])) : 0; e.blocked = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.blocked_pet = row[3] ? static_cast<uint8_t>(atoi(row[3])) : 0; e.blocked_pet = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -36,26 +36,28 @@
class BaseBotBuffsRepository { class BaseBotBuffsRepository {
public: public:
struct BotBuffs { struct BotBuffs {
uint32_t buffs_index; uint32_t buffs_index;
uint32_t bot_id; uint32_t bot_id;
uint32_t spell_id; int32_t spell_id;
uint8_t caster_level; uint8_t caster_level;
uint32_t duration_formula; std::string caster_name;
uint32_t tics_remaining; uint32_t duration_formula;
uint32_t poison_counters; uint32_t tics_remaining;
uint32_t disease_counters; int32_t initial_duration;
uint32_t curse_counters; uint32_t poison_counters;
uint32_t corruption_counters; uint32_t disease_counters;
uint32_t numhits; uint32_t curse_counters;
uint32_t melee_rune; uint32_t corruption_counters;
uint32_t magic_rune; uint32_t numhits;
uint32_t dot_rune; uint32_t melee_rune;
int8_t persistent; uint32_t magic_rune;
int32_t caston_x; uint32_t dot_rune;
int32_t caston_y; int8_t persistent;
int32_t caston_z; int32_t caston_x;
uint32_t extra_di_chance; int32_t caston_y;
int32_t instrument_mod; int32_t caston_z;
uint32_t extra_di_chance;
int32_t instrument_mod;
}; };
static std::string PrimaryKey() static std::string PrimaryKey()
@@ -70,8 +72,10 @@ public:
"bot_id", "bot_id",
"spell_id", "spell_id",
"caster_level", "caster_level",
"caster_name",
"duration_formula", "duration_formula",
"tics_remaining", "tics_remaining",
"initial_duration",
"poison_counters", "poison_counters",
"disease_counters", "disease_counters",
"curse_counters", "curse_counters",
@@ -96,8 +100,10 @@ public:
"bot_id", "bot_id",
"spell_id", "spell_id",
"caster_level", "caster_level",
"caster_name",
"duration_formula", "duration_formula",
"tics_remaining", "tics_remaining",
"initial_duration",
"poison_counters", "poison_counters",
"disease_counters", "disease_counters",
"curse_counters", "curse_counters",
@@ -156,8 +162,10 @@ public:
e.bot_id = 0; e.bot_id = 0;
e.spell_id = 0; e.spell_id = 0;
e.caster_level = 0; e.caster_level = 0;
e.caster_name = "";
e.duration_formula = 0; e.duration_formula = 0;
e.tics_remaining = 0; e.tics_remaining = 0;
e.initial_duration = 0;
e.poison_counters = 0; e.poison_counters = 0;
e.disease_counters = 0; e.disease_counters = 0;
e.curse_counters = 0; e.curse_counters = 0;
@@ -210,24 +218,26 @@ public:
e.buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.spell_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0; e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
e.duration_formula = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0; e.caster_name = row[4] ? row[4] : "";
e.tics_remaining = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0; e.duration_formula = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.poison_counters = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0; e.tics_remaining = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
e.disease_counters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0; e.initial_duration = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.curse_counters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0; e.poison_counters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.corruption_counters = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0; e.disease_counters = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.numhits = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0; e.curse_counters = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.melee_rune = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0; e.corruption_counters = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
e.magic_rune = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0; e.numhits = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
e.dot_rune = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0; e.melee_rune = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.persistent = row[14] ? static_cast<int8_t>(atoi(row[14])) : 0; e.magic_rune = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
e.caston_x = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0; e.dot_rune = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
e.caston_y = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0; e.persistent = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
e.caston_z = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0; e.caston_x = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
e.extra_di_chance = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 0; e.caston_y = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0;
e.instrument_mod = row[19] ? static_cast<int32_t>(atoi(row[19])) : 10; e.caston_z = row[19] ? static_cast<int32_t>(atoi(row[19])) : 0;
e.extra_di_chance = row[20] ? static_cast<uint32_t>(strtoul(row[20], nullptr, 10)) : 0;
e.instrument_mod = row[21] ? static_cast<int32_t>(atoi(row[21])) : 10;
return e; return e;
} }
@@ -264,22 +274,24 @@ public:
v.push_back(columns[1] + " = " + std::to_string(e.bot_id)); v.push_back(columns[1] + " = " + std::to_string(e.bot_id));
v.push_back(columns[2] + " = " + std::to_string(e.spell_id)); v.push_back(columns[2] + " = " + std::to_string(e.spell_id));
v.push_back(columns[3] + " = " + std::to_string(e.caster_level)); v.push_back(columns[3] + " = " + std::to_string(e.caster_level));
v.push_back(columns[4] + " = " + std::to_string(e.duration_formula)); v.push_back(columns[4] + " = '" + Strings::Escape(e.caster_name) + "'");
v.push_back(columns[5] + " = " + std::to_string(e.tics_remaining)); v.push_back(columns[5] + " = " + std::to_string(e.duration_formula));
v.push_back(columns[6] + " = " + std::to_string(e.poison_counters)); v.push_back(columns[6] + " = " + std::to_string(e.tics_remaining));
v.push_back(columns[7] + " = " + std::to_string(e.disease_counters)); v.push_back(columns[7] + " = " + std::to_string(e.initial_duration));
v.push_back(columns[8] + " = " + std::to_string(e.curse_counters)); v.push_back(columns[8] + " = " + std::to_string(e.poison_counters));
v.push_back(columns[9] + " = " + std::to_string(e.corruption_counters)); v.push_back(columns[9] + " = " + std::to_string(e.disease_counters));
v.push_back(columns[10] + " = " + std::to_string(e.numhits)); v.push_back(columns[10] + " = " + std::to_string(e.curse_counters));
v.push_back(columns[11] + " = " + std::to_string(e.melee_rune)); v.push_back(columns[11] + " = " + std::to_string(e.corruption_counters));
v.push_back(columns[12] + " = " + std::to_string(e.magic_rune)); v.push_back(columns[12] + " = " + std::to_string(e.numhits));
v.push_back(columns[13] + " = " + std::to_string(e.dot_rune)); v.push_back(columns[13] + " = " + std::to_string(e.melee_rune));
v.push_back(columns[14] + " = " + std::to_string(e.persistent)); v.push_back(columns[14] + " = " + std::to_string(e.magic_rune));
v.push_back(columns[15] + " = " + std::to_string(e.caston_x)); v.push_back(columns[15] + " = " + std::to_string(e.dot_rune));
v.push_back(columns[16] + " = " + std::to_string(e.caston_y)); v.push_back(columns[16] + " = " + std::to_string(e.persistent));
v.push_back(columns[17] + " = " + std::to_string(e.caston_z)); v.push_back(columns[17] + " = " + std::to_string(e.caston_x));
v.push_back(columns[18] + " = " + std::to_string(e.extra_di_chance)); v.push_back(columns[18] + " = " + std::to_string(e.caston_y));
v.push_back(columns[19] + " = " + std::to_string(e.instrument_mod)); v.push_back(columns[19] + " = " + std::to_string(e.caston_z));
v.push_back(columns[20] + " = " + std::to_string(e.extra_di_chance));
v.push_back(columns[21] + " = " + std::to_string(e.instrument_mod));
auto results = db.QueryDatabase( auto results = db.QueryDatabase(
fmt::format( fmt::format(
@@ -305,8 +317,10 @@ public:
v.push_back(std::to_string(e.bot_id)); v.push_back(std::to_string(e.bot_id));
v.push_back(std::to_string(e.spell_id)); v.push_back(std::to_string(e.spell_id));
v.push_back(std::to_string(e.caster_level)); v.push_back(std::to_string(e.caster_level));
v.push_back("'" + Strings::Escape(e.caster_name) + "'");
v.push_back(std::to_string(e.duration_formula)); v.push_back(std::to_string(e.duration_formula));
v.push_back(std::to_string(e.tics_remaining)); v.push_back(std::to_string(e.tics_remaining));
v.push_back(std::to_string(e.initial_duration));
v.push_back(std::to_string(e.poison_counters)); v.push_back(std::to_string(e.poison_counters));
v.push_back(std::to_string(e.disease_counters)); v.push_back(std::to_string(e.disease_counters));
v.push_back(std::to_string(e.curse_counters)); v.push_back(std::to_string(e.curse_counters));
@@ -354,8 +368,10 @@ public:
v.push_back(std::to_string(e.bot_id)); v.push_back(std::to_string(e.bot_id));
v.push_back(std::to_string(e.spell_id)); v.push_back(std::to_string(e.spell_id));
v.push_back(std::to_string(e.caster_level)); v.push_back(std::to_string(e.caster_level));
v.push_back("'" + Strings::Escape(e.caster_name) + "'");
v.push_back(std::to_string(e.duration_formula)); v.push_back(std::to_string(e.duration_formula));
v.push_back(std::to_string(e.tics_remaining)); v.push_back(std::to_string(e.tics_remaining));
v.push_back(std::to_string(e.initial_duration));
v.push_back(std::to_string(e.poison_counters)); v.push_back(std::to_string(e.poison_counters));
v.push_back(std::to_string(e.disease_counters)); v.push_back(std::to_string(e.disease_counters));
v.push_back(std::to_string(e.curse_counters)); v.push_back(std::to_string(e.curse_counters));
@@ -405,24 +421,26 @@ public:
e.buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.spell_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0; e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
e.duration_formula = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0; e.caster_name = row[4] ? row[4] : "";
e.tics_remaining = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0; e.duration_formula = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.poison_counters = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0; e.tics_remaining = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
e.disease_counters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0; e.initial_duration = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.curse_counters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0; e.poison_counters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.corruption_counters = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0; e.disease_counters = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.numhits = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0; e.curse_counters = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.melee_rune = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0; e.corruption_counters = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
e.magic_rune = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0; e.numhits = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
e.dot_rune = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0; e.melee_rune = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.persistent = row[14] ? static_cast<int8_t>(atoi(row[14])) : 0; e.magic_rune = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
e.caston_x = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0; e.dot_rune = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
e.caston_y = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0; e.persistent = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
e.caston_z = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0; e.caston_x = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
e.extra_di_chance = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 0; e.caston_y = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0;
e.instrument_mod = row[19] ? static_cast<int32_t>(atoi(row[19])) : 10; e.caston_z = row[19] ? static_cast<int32_t>(atoi(row[19])) : 0;
e.extra_di_chance = row[20] ? static_cast<uint32_t>(strtoul(row[20], nullptr, 10)) : 0;
e.instrument_mod = row[21] ? static_cast<int32_t>(atoi(row[21])) : 10;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -449,24 +467,26 @@ public:
e.buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.spell_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0; e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
e.duration_formula = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0; e.caster_name = row[4] ? row[4] : "";
e.tics_remaining = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0; e.duration_formula = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.poison_counters = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0; e.tics_remaining = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
e.disease_counters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0; e.initial_duration = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.curse_counters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0; e.poison_counters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.corruption_counters = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0; e.disease_counters = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.numhits = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0; e.curse_counters = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.melee_rune = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0; e.corruption_counters = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
e.magic_rune = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0; e.numhits = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
e.dot_rune = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0; e.melee_rune = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.persistent = row[14] ? static_cast<int8_t>(atoi(row[14])) : 0; e.magic_rune = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
e.caston_x = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0; e.dot_rune = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
e.caston_y = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0; e.persistent = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
e.caston_z = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0; e.caston_x = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
e.extra_di_chance = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 0; e.caston_y = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0;
e.instrument_mod = row[19] ? static_cast<int32_t>(atoi(row[19])) : 10; e.caston_z = row[19] ? static_cast<int32_t>(atoi(row[19])) : 0;
e.extra_di_chance = row[20] ? static_cast<uint32_t>(strtoul(row[20], nullptr, 10)) : 0;
e.instrument_mod = row[21] ? static_cast<int32_t>(atoi(row[21])) : 10;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -545,8 +565,10 @@ public:
v.push_back(std::to_string(e.bot_id)); v.push_back(std::to_string(e.bot_id));
v.push_back(std::to_string(e.spell_id)); v.push_back(std::to_string(e.spell_id));
v.push_back(std::to_string(e.caster_level)); v.push_back(std::to_string(e.caster_level));
v.push_back("'" + Strings::Escape(e.caster_name) + "'");
v.push_back(std::to_string(e.duration_formula)); v.push_back(std::to_string(e.duration_formula));
v.push_back(std::to_string(e.tics_remaining)); v.push_back(std::to_string(e.tics_remaining));
v.push_back(std::to_string(e.initial_duration));
v.push_back(std::to_string(e.poison_counters)); v.push_back(std::to_string(e.poison_counters));
v.push_back(std::to_string(e.disease_counters)); v.push_back(std::to_string(e.disease_counters));
v.push_back(std::to_string(e.curse_counters)); v.push_back(std::to_string(e.curse_counters));
@@ -587,8 +609,10 @@ public:
v.push_back(std::to_string(e.bot_id)); v.push_back(std::to_string(e.bot_id));
v.push_back(std::to_string(e.spell_id)); v.push_back(std::to_string(e.spell_id));
v.push_back(std::to_string(e.caster_level)); v.push_back(std::to_string(e.caster_level));
v.push_back("'" + Strings::Escape(e.caster_name) + "'");
v.push_back(std::to_string(e.duration_formula)); v.push_back(std::to_string(e.duration_formula));
v.push_back(std::to_string(e.tics_remaining)); v.push_back(std::to_string(e.tics_remaining));
v.push_back(std::to_string(e.initial_duration));
v.push_back(std::to_string(e.poison_counters)); v.push_back(std::to_string(e.poison_counters));
v.push_back(std::to_string(e.disease_counters)); v.push_back(std::to_string(e.disease_counters));
v.push_back(std::to_string(e.curse_counters)); v.push_back(std::to_string(e.curse_counters));
@@ -32,6 +32,7 @@
#include "common/strings.h" #include "common/strings.h"
#include <ctime> #include <ctime>
class BaseBotCreateCombinationsRepository { class BaseBotCreateCombinationsRepository {
public: public:
struct BotCreateCombinations { struct BotCreateCombinations {
@@ -198,6 +198,16 @@ public:
e.fast_heals = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.fast_heals = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.adaptive_targeting = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0; e.adaptive_targeting = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.casting_override = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0; e.casting_override = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.safe_hp_base = row[6] ? (strtof(row[6], nullptr) > 0.0f ? strtof(row[6], nullptr) : 0) : 0;
e.safe_hp_cloth = row[7] ? (strtof(row[7], nullptr) > 0.0f ? strtof(row[7], nullptr) : 0) : 0;
e.safe_hp_leather = row[8] ? (strtof(row[8], nullptr) > 0.0f ? strtof(row[8], nullptr) : 0) : 0;
e.safe_hp_chain = row[9] ? (strtof(row[9], nullptr) > 0.0f ? strtof(row[9], nullptr) : 0) : 0;
e.safe_hp_plate = row[10] ? (strtof(row[10], nullptr) > 0.0f ? strtof(row[10], nullptr) : 0) : 0;
e.critical_hp_base = row[11] ? (strtof(row[11], nullptr) > 0.0f ? strtof(row[11], nullptr) : 0) : 0;
e.critical_hp_cloth = row[12] ? (strtof(row[12], nullptr) > 0.0f ? strtof(row[12], nullptr) : 0) : 0;
e.critical_hp_leather = row[13] ? (strtof(row[13], nullptr) > 0.0f ? strtof(row[13], nullptr) : 0) : 0;
e.critical_hp_chain = row[14] ? (strtof(row[14], nullptr) > 0.0f ? strtof(row[14], nullptr) : 0) : 0;
e.critical_hp_plate = row[15] ? (strtof(row[15], nullptr) > 0.0f ? strtof(row[15], nullptr) : 0) : 0;
return e; return e;
} }
@@ -367,6 +377,16 @@ public:
e.fast_heals = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.fast_heals = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.adaptive_targeting = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0; e.adaptive_targeting = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.casting_override = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0; e.casting_override = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.safe_hp_base = row[6] ? (strtof(row[6], nullptr) > 0.0f ? strtof(row[6], nullptr) : 0) : 0;
e.safe_hp_cloth = row[7] ? (strtof(row[7], nullptr) > 0.0f ? strtof(row[7], nullptr) : 0) : 0;
e.safe_hp_leather = row[8] ? (strtof(row[8], nullptr) > 0.0f ? strtof(row[8], nullptr) : 0) : 0;
e.safe_hp_chain = row[9] ? (strtof(row[9], nullptr) > 0.0f ? strtof(row[9], nullptr) : 0) : 0;
e.safe_hp_plate = row[10] ? (strtof(row[10], nullptr) > 0.0f ? strtof(row[10], nullptr) : 0) : 0;
e.critical_hp_base = row[11] ? (strtof(row[11], nullptr) > 0.0f ? strtof(row[11], nullptr) : 0) : 0;
e.critical_hp_cloth = row[12] ? (strtof(row[12], nullptr) > 0.0f ? strtof(row[12], nullptr) : 0) : 0;
e.critical_hp_leather = row[13] ? (strtof(row[13], nullptr) > 0.0f ? strtof(row[13], nullptr) : 0) : 0;
e.critical_hp_chain = row[14] ? (strtof(row[14], nullptr) > 0.0f ? strtof(row[14], nullptr) : 0) : 0;
e.critical_hp_plate = row[15] ? (strtof(row[15], nullptr) > 0.0f ? strtof(row[15], nullptr) : 0) : 0;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -397,6 +417,16 @@ public:
e.fast_heals = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.fast_heals = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.adaptive_targeting = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0; e.adaptive_targeting = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.casting_override = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0; e.casting_override = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.safe_hp_base = row[6] ? (strtof(row[6], nullptr) > 0.0f ? strtof(row[6], nullptr) : 0) : 0;
e.safe_hp_cloth = row[7] ? (strtof(row[7], nullptr) > 0.0f ? strtof(row[7], nullptr) : 0) : 0;
e.safe_hp_leather = row[8] ? (strtof(row[8], nullptr) > 0.0f ? strtof(row[8], nullptr) : 0) : 0;
e.safe_hp_chain = row[9] ? (strtof(row[9], nullptr) > 0.0f ? strtof(row[9], nullptr) : 0) : 0;
e.safe_hp_plate = row[10] ? (strtof(row[10], nullptr) > 0.0f ? strtof(row[10], nullptr) : 0) : 0;
e.critical_hp_base = row[11] ? (strtof(row[11], nullptr) > 0.0f ? strtof(row[11], nullptr) : 0) : 0;
e.critical_hp_cloth = row[12] ? (strtof(row[12], nullptr) > 0.0f ? strtof(row[12], nullptr) : 0) : 0;
e.critical_hp_leather = row[13] ? (strtof(row[13], nullptr) > 0.0f ? strtof(row[13], nullptr) : 0) : 0;
e.critical_hp_chain = row[14] ? (strtof(row[14], nullptr) > 0.0f ? strtof(row[14], nullptr) : 0) : 0;
e.critical_hp_plate = row[15] ? (strtof(row[15], nullptr) > 0.0f ? strtof(row[15], nullptr) : 0) : 0;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -32,6 +32,7 @@
#include "common/strings.h" #include "common/strings.h"
#include <ctime> #include <ctime>
class BaseBotInspectMessagesRepository { class BaseBotInspectMessagesRepository {
public: public:
struct BotInspectMessages { struct BotInspectMessages {
@@ -36,11 +36,24 @@
class BaseBotPetBuffsRepository { class BaseBotPetBuffsRepository {
public: public:
struct BotPetBuffs { struct BotPetBuffs {
uint32_t pet_buffs_index; uint32_t pet_buffs_index;
uint32_t pets_index; uint32_t pets_index;
uint32_t spell_id; int32_t spell_id;
uint32_t caster_level; uint32_t caster_level;
uint32_t duration; std::string caster_name;
int32_t tics_remaining;
int32_t initial_duration;
uint32_t counters;
uint32_t numhits;
uint32_t melee_rune;
uint32_t magic_rune;
uint32_t dot_rune;
uint8_t persistent;
int32_t caston_x;
int32_t caston_y;
int32_t caston_z;
int32_t extra_di_chance;
uint32_t instrument_mod;
}; };
static std::string PrimaryKey() static std::string PrimaryKey()
@@ -55,7 +68,20 @@ public:
"pets_index", "pets_index",
"spell_id", "spell_id",
"caster_level", "caster_level",
"duration", "caster_name",
"tics_remaining",
"initial_duration",
"counters",
"numhits",
"melee_rune",
"magic_rune",
"dot_rune",
"persistent",
"caston_x",
"caston_y",
"caston_z",
"extra_di_chance",
"instrument_mod",
}; };
} }
@@ -66,7 +92,20 @@ public:
"pets_index", "pets_index",
"spell_id", "spell_id",
"caster_level", "caster_level",
"duration", "caster_name",
"tics_remaining",
"initial_duration",
"counters",
"numhits",
"melee_rune",
"magic_rune",
"dot_rune",
"persistent",
"caston_x",
"caston_y",
"caston_z",
"extra_di_chance",
"instrument_mod",
}; };
} }
@@ -107,11 +146,24 @@ public:
{ {
BotPetBuffs e{}; BotPetBuffs e{};
e.pet_buffs_index = 0; e.pet_buffs_index = 0;
e.pets_index = 0; e.pets_index = 0;
e.spell_id = 0; e.spell_id = 0;
e.caster_level = 0; e.caster_level = 0;
e.duration = 0; e.caster_name = "";
e.tics_remaining = 0;
e.initial_duration = 0;
e.counters = 0;
e.numhits = 0;
e.melee_rune = 0;
e.magic_rune = 0;
e.dot_rune = 0;
e.persistent = 0;
e.caston_x = 0;
e.caston_y = 0;
e.caston_z = 0;
e.extra_di_chance = 0;
e.instrument_mod = 10;
return e; return e;
} }
@@ -148,11 +200,24 @@ public:
if (results.RowCount() == 1) { if (results.RowCount() == 1) {
BotPetBuffs e{}; BotPetBuffs e{};
e.pet_buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.pet_buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.pets_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.pets_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.spell_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.caster_level = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.caster_level = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.duration = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0; e.caster_name = row[4] ? row[4] : "";
e.tics_remaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.initial_duration = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.counters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.numhits = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.melee_rune = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.magic_rune = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.dot_rune = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
e.persistent = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
e.caston_x = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
e.caston_y = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
e.caston_z = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.extra_di_chance = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
e.instrument_mod = row[17] ? static_cast<uint32_t>(strtoul(row[17], nullptr, 10)) : 10;
return e; return e;
} }
@@ -189,7 +254,20 @@ public:
v.push_back(columns[1] + " = " + std::to_string(e.pets_index)); v.push_back(columns[1] + " = " + std::to_string(e.pets_index));
v.push_back(columns[2] + " = " + std::to_string(e.spell_id)); v.push_back(columns[2] + " = " + std::to_string(e.spell_id));
v.push_back(columns[3] + " = " + std::to_string(e.caster_level)); v.push_back(columns[3] + " = " + std::to_string(e.caster_level));
v.push_back(columns[4] + " = " + std::to_string(e.duration)); v.push_back(columns[4] + " = '" + Strings::Escape(e.caster_name) + "'");
v.push_back(columns[5] + " = " + std::to_string(e.tics_remaining));
v.push_back(columns[6] + " = " + std::to_string(e.initial_duration));
v.push_back(columns[7] + " = " + std::to_string(e.counters));
v.push_back(columns[8] + " = " + std::to_string(e.numhits));
v.push_back(columns[9] + " = " + std::to_string(e.melee_rune));
v.push_back(columns[10] + " = " + std::to_string(e.magic_rune));
v.push_back(columns[11] + " = " + std::to_string(e.dot_rune));
v.push_back(columns[12] + " = " + std::to_string(e.persistent));
v.push_back(columns[13] + " = " + std::to_string(e.caston_x));
v.push_back(columns[14] + " = " + std::to_string(e.caston_y));
v.push_back(columns[15] + " = " + std::to_string(e.caston_z));
v.push_back(columns[16] + " = " + std::to_string(e.extra_di_chance));
v.push_back(columns[17] + " = " + std::to_string(e.instrument_mod));
auto results = db.QueryDatabase( auto results = db.QueryDatabase(
fmt::format( fmt::format(
@@ -215,7 +293,20 @@ public:
v.push_back(std::to_string(e.pets_index)); v.push_back(std::to_string(e.pets_index));
v.push_back(std::to_string(e.spell_id)); v.push_back(std::to_string(e.spell_id));
v.push_back(std::to_string(e.caster_level)); v.push_back(std::to_string(e.caster_level));
v.push_back(std::to_string(e.duration)); v.push_back("'" + Strings::Escape(e.caster_name) + "'");
v.push_back(std::to_string(e.tics_remaining));
v.push_back(std::to_string(e.initial_duration));
v.push_back(std::to_string(e.counters));
v.push_back(std::to_string(e.numhits));
v.push_back(std::to_string(e.melee_rune));
v.push_back(std::to_string(e.magic_rune));
v.push_back(std::to_string(e.dot_rune));
v.push_back(std::to_string(e.persistent));
v.push_back(std::to_string(e.caston_x));
v.push_back(std::to_string(e.caston_y));
v.push_back(std::to_string(e.caston_z));
v.push_back(std::to_string(e.extra_di_chance));
v.push_back(std::to_string(e.instrument_mod));
auto results = db.QueryDatabase( auto results = db.QueryDatabase(
fmt::format( fmt::format(
@@ -249,7 +340,20 @@ public:
v.push_back(std::to_string(e.pets_index)); v.push_back(std::to_string(e.pets_index));
v.push_back(std::to_string(e.spell_id)); v.push_back(std::to_string(e.spell_id));
v.push_back(std::to_string(e.caster_level)); v.push_back(std::to_string(e.caster_level));
v.push_back(std::to_string(e.duration)); v.push_back("'" + Strings::Escape(e.caster_name) + "'");
v.push_back(std::to_string(e.tics_remaining));
v.push_back(std::to_string(e.initial_duration));
v.push_back(std::to_string(e.counters));
v.push_back(std::to_string(e.numhits));
v.push_back(std::to_string(e.melee_rune));
v.push_back(std::to_string(e.magic_rune));
v.push_back(std::to_string(e.dot_rune));
v.push_back(std::to_string(e.persistent));
v.push_back(std::to_string(e.caston_x));
v.push_back(std::to_string(e.caston_y));
v.push_back(std::to_string(e.caston_z));
v.push_back(std::to_string(e.extra_di_chance));
v.push_back(std::to_string(e.instrument_mod));
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")"); insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
} }
@@ -283,11 +387,24 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
BotPetBuffs e{}; BotPetBuffs e{};
e.pet_buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.pet_buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.pets_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.pets_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.spell_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.caster_level = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.caster_level = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.duration = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0; e.caster_name = row[4] ? row[4] : "";
e.tics_remaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.initial_duration = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.counters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.numhits = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.melee_rune = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.magic_rune = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.dot_rune = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
e.persistent = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
e.caston_x = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
e.caston_y = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
e.caston_z = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.extra_di_chance = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
e.instrument_mod = row[17] ? static_cast<uint32_t>(strtoul(row[17], nullptr, 10)) : 10;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -312,11 +429,24 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
BotPetBuffs e{}; BotPetBuffs e{};
e.pet_buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.pet_buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.pets_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.pets_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.spell_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.caster_level = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.caster_level = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.duration = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0; e.caster_name = row[4] ? row[4] : "";
e.tics_remaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.initial_duration = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.counters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.numhits = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.melee_rune = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.magic_rune = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.dot_rune = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
e.persistent = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
e.caston_x = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
e.caston_y = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
e.caston_z = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.extra_di_chance = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
e.instrument_mod = row[17] ? static_cast<uint32_t>(strtoul(row[17], nullptr, 10)) : 10;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -395,7 +525,20 @@ public:
v.push_back(std::to_string(e.pets_index)); v.push_back(std::to_string(e.pets_index));
v.push_back(std::to_string(e.spell_id)); v.push_back(std::to_string(e.spell_id));
v.push_back(std::to_string(e.caster_level)); v.push_back(std::to_string(e.caster_level));
v.push_back(std::to_string(e.duration)); v.push_back("'" + Strings::Escape(e.caster_name) + "'");
v.push_back(std::to_string(e.tics_remaining));
v.push_back(std::to_string(e.initial_duration));
v.push_back(std::to_string(e.counters));
v.push_back(std::to_string(e.numhits));
v.push_back(std::to_string(e.melee_rune));
v.push_back(std::to_string(e.magic_rune));
v.push_back(std::to_string(e.dot_rune));
v.push_back(std::to_string(e.persistent));
v.push_back(std::to_string(e.caston_x));
v.push_back(std::to_string(e.caston_y));
v.push_back(std::to_string(e.caston_z));
v.push_back(std::to_string(e.extra_di_chance));
v.push_back(std::to_string(e.instrument_mod));
auto results = db.QueryDatabase( auto results = db.QueryDatabase(
fmt::format( fmt::format(
@@ -422,7 +565,20 @@ public:
v.push_back(std::to_string(e.pets_index)); v.push_back(std::to_string(e.pets_index));
v.push_back(std::to_string(e.spell_id)); v.push_back(std::to_string(e.spell_id));
v.push_back(std::to_string(e.caster_level)); v.push_back(std::to_string(e.caster_level));
v.push_back(std::to_string(e.duration)); v.push_back("'" + Strings::Escape(e.caster_name) + "'");
v.push_back(std::to_string(e.tics_remaining));
v.push_back(std::to_string(e.initial_duration));
v.push_back(std::to_string(e.counters));
v.push_back(std::to_string(e.numhits));
v.push_back(std::to_string(e.melee_rune));
v.push_back(std::to_string(e.magic_rune));
v.push_back(std::to_string(e.dot_rune));
v.push_back(std::to_string(e.persistent));
v.push_back(std::to_string(e.caston_x));
v.push_back(std::to_string(e.caston_y));
v.push_back(std::to_string(e.caston_z));
v.push_back(std::to_string(e.extra_di_chance));
v.push_back(std::to_string(e.instrument_mod));
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")"); insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
} }
@@ -37,7 +37,7 @@ class BaseBotPetsRepository {
public: public:
struct BotPets { struct BotPets {
uint32_t pets_index; uint32_t pets_index;
uint32_t spell_id; int32_t spell_id;
uint32_t bot_id; uint32_t bot_id;
std::string name; std::string name;
int32_t mana; int32_t mana;
@@ -153,7 +153,7 @@ public:
BotPets e{}; BotPets e{};
e.pets_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.pets_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.spell_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.spell_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.bot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0; e.bot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.name = row[3] ? row[3] : ""; e.name = row[3] ? row[3] : "";
e.mana = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0; e.mana = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
@@ -292,7 +292,7 @@ public:
BotPets e{}; BotPets e{};
e.pets_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.pets_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.spell_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.spell_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.bot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0; e.bot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.name = row[3] ? row[3] : ""; e.name = row[3] ? row[3] : "";
e.mana = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0; e.mana = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
@@ -322,7 +322,7 @@ public:
BotPets e{}; BotPets e{};
e.pets_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.pets_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.spell_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.spell_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.bot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0; e.bot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.name = row[3] ? row[3] : ""; e.name = row[3] ? row[3] : "";
e.mana = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0; e.mana = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
@@ -41,7 +41,7 @@ public:
uint8_t stance; uint8_t stance;
uint16_t setting_id; uint16_t setting_id;
uint8_t setting_type; uint8_t setting_type;
int32_t value; int64_t value;
std::string category_name; std::string category_name;
std::string setting_name; std::string setting_name;
}; };
@@ -116,7 +116,7 @@ public:
{ {
BotSettings e{}; BotSettings e{};
e.character_id = 0; e.character_id = 0;
e.bot_id = 0; e.bot_id = 0;
e.stance = 0; e.stance = 0;
e.setting_id = 0; e.setting_id = 0;
@@ -160,12 +160,12 @@ public:
if (results.RowCount() == 1) { if (results.RowCount() == 1) {
BotSettings e{}; BotSettings e{};
e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.stance = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0; e.stance = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.setting_id = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0; e.setting_id = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0;
e.setting_type = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0; e.setting_type = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
e.value = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0; e.value = row[5] ? strtoll(row[5], nullptr, 10) : 0;
e.category_name = row[6] ? row[6] : ""; e.category_name = row[6] ? row[6] : "";
e.setting_name = row[7] ? row[7] : ""; e.setting_name = row[7] ? row[7] : "";
@@ -308,12 +308,12 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
BotSettings e{}; BotSettings e{};
e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.stance = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0; e.stance = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.setting_id = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0; e.setting_id = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0;
e.setting_type = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0; e.setting_type = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
e.value = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0; e.value = row[5] ? strtoll(row[5], nullptr, 10) : 0;
e.category_name = row[6] ? row[6] : ""; e.category_name = row[6] ? row[6] : "";
e.setting_name = row[7] ? row[7] : ""; e.setting_name = row[7] ? row[7] : "";
@@ -340,12 +340,12 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
BotSettings e{}; BotSettings e{};
e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.stance = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0; e.stance = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.setting_id = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0; e.setting_id = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0;
e.setting_type = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0; e.setting_type = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
e.value = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0; e.value = row[5] ? strtoll(row[5], nullptr, 10) : 0;
e.category_name = row[6] ? row[6] : ""; e.category_name = row[6] ? row[6] : "";
e.setting_name = row[7] ? row[7] : ""; e.setting_name = row[7] ? row[7] : "";
@@ -38,7 +38,7 @@ public:
struct BotSpellSettings { struct BotSpellSettings {
uint32_t id; uint32_t id;
int32_t bot_id; int32_t bot_id;
int16_t spell_id; int32_t spell_id;
int16_t priority; int16_t priority;
int16_t min_hp; int16_t min_hp;
int16_t max_hp; int16_t max_hp;
@@ -158,7 +158,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.bot_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0; e.bot_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.spell_id = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.priority = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0; e.priority = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.min_hp = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0; e.min_hp = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0;
e.max_hp = row[5] ? static_cast<int16_t>(atoi(row[5])) : 0; e.max_hp = row[5] ? static_cast<int16_t>(atoi(row[5])) : 0;
@@ -301,7 +301,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.bot_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0; e.bot_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.spell_id = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.priority = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0; e.priority = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.min_hp = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0; e.min_hp = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0;
e.max_hp = row[5] ? static_cast<int16_t>(atoi(row[5])) : 0; e.max_hp = row[5] ? static_cast<int16_t>(atoi(row[5])) : 0;
@@ -332,7 +332,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.bot_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0; e.bot_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.spell_id = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.priority = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0; e.priority = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.min_hp = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0; e.min_hp = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0;
e.max_hp = row[5] ? static_cast<int16_t>(atoi(row[5])) : 0; e.max_hp = row[5] ? static_cast<int16_t>(atoi(row[5])) : 0;
@@ -38,7 +38,7 @@ public:
struct BotSpellsEntries { struct BotSpellsEntries {
uint32_t id; uint32_t id;
int32_t npc_spells_id; int32_t npc_spells_id;
uint16_t spell_id; int32_t spell_id;
uint32_t type; uint32_t type;
uint8_t minlevel; uint8_t minlevel;
uint8_t maxlevel; uint8_t maxlevel;
@@ -190,7 +190,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0; e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0; e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255; e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255;
@@ -365,7 +365,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0; e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0; e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255; e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255;
@@ -404,7 +404,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0; e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0; e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255; e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255;
@@ -42,7 +42,7 @@ public:
uint32_t recast_time; uint32_t recast_time;
uint8_t is_spell; uint8_t is_spell;
uint8_t is_disc; uint8_t is_disc;
uint32_t spell_id; int32_t spell_id;
uint8_t is_item; uint8_t is_item;
uint32_t item_id; uint32_t item_id;
}; };
@@ -170,7 +170,7 @@ public:
e.recast_time = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.recast_time = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.is_spell = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0; e.is_spell = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
e.is_disc = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0; e.is_disc = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
e.spell_id = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0; e.spell_id = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.is_item = row[7] ? static_cast<uint8_t>(strtoul(row[7], nullptr, 10)) : 0; e.is_item = row[7] ? static_cast<uint8_t>(strtoul(row[7], nullptr, 10)) : 0;
e.item_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0; e.item_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
@@ -322,7 +322,7 @@ public:
e.recast_time = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.recast_time = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.is_spell = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0; e.is_spell = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
e.is_disc = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0; e.is_disc = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
e.spell_id = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0; e.spell_id = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.is_item = row[7] ? static_cast<uint8_t>(strtoul(row[7], nullptr, 10)) : 0; e.is_item = row[7] ? static_cast<uint8_t>(strtoul(row[7], nullptr, 10)) : 0;
e.item_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0; e.item_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
@@ -355,7 +355,7 @@ public:
e.recast_time = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.recast_time = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.is_spell = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0; e.is_spell = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
e.is_disc = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0; e.is_disc = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
e.spell_id = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0; e.spell_id = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.is_item = row[7] ? static_cast<uint8_t>(strtoul(row[7], nullptr, 10)) : 0; e.is_item = row[7] ? static_cast<uint8_t>(strtoul(row[7], nullptr, 10)) : 0;
e.item_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0; e.item_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
@@ -38,16 +38,17 @@ public:
struct CharacterBuffs { struct CharacterBuffs {
uint32_t character_id; uint32_t character_id;
uint8_t slot_id; uint8_t slot_id;
uint16_t spell_id; int32_t spell_id;
uint8_t caster_level; uint8_t caster_level;
std::string caster_name; std::string caster_name;
int32_t ticsremaining; int32_t ticsremaining;
int32_t initialduration;
uint32_t counters; uint32_t counters;
uint32_t numhits; uint32_t numhits;
uint32_t melee_rune; uint32_t melee_rune;
uint32_t magic_rune; uint32_t magic_rune;
uint8_t persistent; uint8_t persistent;
int32_t dot_rune; uint32_t dot_rune;
int32_t caston_x; int32_t caston_x;
int32_t caston_y; int32_t caston_y;
int32_t caston_z; int32_t caston_z;
@@ -69,6 +70,7 @@ public:
"caster_level", "caster_level",
"caster_name", "caster_name",
"ticsremaining", "ticsremaining",
"initialduration",
"counters", "counters",
"numhits", "numhits",
"melee_rune", "melee_rune",
@@ -92,6 +94,7 @@ public:
"caster_level", "caster_level",
"caster_name", "caster_name",
"ticsremaining", "ticsremaining",
"initialduration",
"counters", "counters",
"numhits", "numhits",
"melee_rune", "melee_rune",
@@ -143,23 +146,24 @@ public:
{ {
CharacterBuffs e{}; CharacterBuffs e{};
e.character_id = 0; e.character_id = 0;
e.slot_id = 0; e.slot_id = 0;
e.spell_id = 0; e.spell_id = 0;
e.caster_level = 0; e.caster_level = 0;
e.caster_name = ""; e.caster_name = "";
e.ticsremaining = 0; e.ticsremaining = 0;
e.counters = 0; e.initialduration = 0;
e.numhits = 0; e.counters = 0;
e.melee_rune = 0; e.numhits = 0;
e.magic_rune = 0; e.melee_rune = 0;
e.persistent = 0; e.magic_rune = 0;
e.dot_rune = 0; e.persistent = 0;
e.caston_x = 0; e.dot_rune = 0;
e.caston_y = 0; e.caston_x = 0;
e.caston_z = 0; e.caston_y = 0;
e.ExtraDIChance = 0; e.caston_z = 0;
e.instrument_mod = 10; e.ExtraDIChance = 0;
e.instrument_mod = 10;
return e; return e;
} }
@@ -196,23 +200,24 @@ public:
if (results.RowCount() == 1) { if (results.RowCount() == 1) {
CharacterBuffs e{}; CharacterBuffs e{};
e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.slot_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0; e.slot_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0; e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
e.caster_name = row[4] ? row[4] : ""; e.caster_name = row[4] ? row[4] : "";
e.ticsremaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0; e.ticsremaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.counters = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0; e.initialduration = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.numhits = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0; e.counters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.melee_rune = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0; e.numhits = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.magic_rune = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0; e.melee_rune = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.persistent = row[10] ? static_cast<uint8_t>(strtoul(row[10], nullptr, 10)) : 0; e.magic_rune = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.dot_rune = row[11] ? static_cast<int32_t>(atoi(row[11])) : 0; e.persistent = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
e.caston_x = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0; e.dot_rune = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
e.caston_y = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0; e.caston_x = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
e.caston_z = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0; e.caston_y = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
e.ExtraDIChance = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0; e.caston_z = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.instrument_mod = row[16] ? static_cast<int32_t>(atoi(row[16])) : 10; e.ExtraDIChance = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
e.instrument_mod = row[17] ? static_cast<int32_t>(atoi(row[17])) : 10;
return e; return e;
} }
@@ -252,17 +257,18 @@ public:
v.push_back(columns[3] + " = " + std::to_string(e.caster_level)); v.push_back(columns[3] + " = " + std::to_string(e.caster_level));
v.push_back(columns[4] + " = '" + Strings::Escape(e.caster_name) + "'"); v.push_back(columns[4] + " = '" + Strings::Escape(e.caster_name) + "'");
v.push_back(columns[5] + " = " + std::to_string(e.ticsremaining)); v.push_back(columns[5] + " = " + std::to_string(e.ticsremaining));
v.push_back(columns[6] + " = " + std::to_string(e.counters)); v.push_back(columns[6] + " = " + std::to_string(e.initialduration));
v.push_back(columns[7] + " = " + std::to_string(e.numhits)); v.push_back(columns[7] + " = " + std::to_string(e.counters));
v.push_back(columns[8] + " = " + std::to_string(e.melee_rune)); v.push_back(columns[8] + " = " + std::to_string(e.numhits));
v.push_back(columns[9] + " = " + std::to_string(e.magic_rune)); v.push_back(columns[9] + " = " + std::to_string(e.melee_rune));
v.push_back(columns[10] + " = " + std::to_string(e.persistent)); v.push_back(columns[10] + " = " + std::to_string(e.magic_rune));
v.push_back(columns[11] + " = " + std::to_string(e.dot_rune)); v.push_back(columns[11] + " = " + std::to_string(e.persistent));
v.push_back(columns[12] + " = " + std::to_string(e.caston_x)); v.push_back(columns[12] + " = " + std::to_string(e.dot_rune));
v.push_back(columns[13] + " = " + std::to_string(e.caston_y)); v.push_back(columns[13] + " = " + std::to_string(e.caston_x));
v.push_back(columns[14] + " = " + std::to_string(e.caston_z)); v.push_back(columns[14] + " = " + std::to_string(e.caston_y));
v.push_back(columns[15] + " = " + std::to_string(e.ExtraDIChance)); v.push_back(columns[15] + " = " + std::to_string(e.caston_z));
v.push_back(columns[16] + " = " + std::to_string(e.instrument_mod)); v.push_back(columns[16] + " = " + std::to_string(e.ExtraDIChance));
v.push_back(columns[17] + " = " + std::to_string(e.instrument_mod));
auto results = db.QueryDatabase( auto results = db.QueryDatabase(
fmt::format( fmt::format(
@@ -290,6 +296,7 @@ public:
v.push_back(std::to_string(e.caster_level)); v.push_back(std::to_string(e.caster_level));
v.push_back("'" + Strings::Escape(e.caster_name) + "'"); v.push_back("'" + Strings::Escape(e.caster_name) + "'");
v.push_back(std::to_string(e.ticsremaining)); v.push_back(std::to_string(e.ticsremaining));
v.push_back(std::to_string(e.initialduration));
v.push_back(std::to_string(e.counters)); v.push_back(std::to_string(e.counters));
v.push_back(std::to_string(e.numhits)); v.push_back(std::to_string(e.numhits));
v.push_back(std::to_string(e.melee_rune)); v.push_back(std::to_string(e.melee_rune));
@@ -336,6 +343,7 @@ public:
v.push_back(std::to_string(e.caster_level)); v.push_back(std::to_string(e.caster_level));
v.push_back("'" + Strings::Escape(e.caster_name) + "'"); v.push_back("'" + Strings::Escape(e.caster_name) + "'");
v.push_back(std::to_string(e.ticsremaining)); v.push_back(std::to_string(e.ticsremaining));
v.push_back(std::to_string(e.initialduration));
v.push_back(std::to_string(e.counters)); v.push_back(std::to_string(e.counters));
v.push_back(std::to_string(e.numhits)); v.push_back(std::to_string(e.numhits));
v.push_back(std::to_string(e.melee_rune)); v.push_back(std::to_string(e.melee_rune));
@@ -380,23 +388,24 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
CharacterBuffs e{}; CharacterBuffs e{};
e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.slot_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0; e.slot_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0; e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
e.caster_name = row[4] ? row[4] : ""; e.caster_name = row[4] ? row[4] : "";
e.ticsremaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0; e.ticsremaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.counters = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0; e.initialduration = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.numhits = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0; e.counters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.melee_rune = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0; e.numhits = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.magic_rune = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0; e.melee_rune = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.persistent = row[10] ? static_cast<uint8_t>(strtoul(row[10], nullptr, 10)) : 0; e.magic_rune = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.dot_rune = row[11] ? static_cast<int32_t>(atoi(row[11])) : 0; e.persistent = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
e.caston_x = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0; e.dot_rune = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
e.caston_y = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0; e.caston_x = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
e.caston_z = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0; e.caston_y = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
e.ExtraDIChance = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0; e.caston_z = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.instrument_mod = row[16] ? static_cast<int32_t>(atoi(row[16])) : 10; e.ExtraDIChance = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
e.instrument_mod = row[17] ? static_cast<int32_t>(atoi(row[17])) : 10;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -421,23 +430,24 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
CharacterBuffs e{}; CharacterBuffs e{};
e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.slot_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0; e.slot_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0; e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
e.caster_name = row[4] ? row[4] : ""; e.caster_name = row[4] ? row[4] : "";
e.ticsremaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0; e.ticsremaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.counters = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0; e.initialduration = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.numhits = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0; e.counters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.melee_rune = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0; e.numhits = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.magic_rune = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0; e.melee_rune = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.persistent = row[10] ? static_cast<uint8_t>(strtoul(row[10], nullptr, 10)) : 0; e.magic_rune = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.dot_rune = row[11] ? static_cast<int32_t>(atoi(row[11])) : 0; e.persistent = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
e.caston_x = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0; e.dot_rune = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
e.caston_y = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0; e.caston_x = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
e.caston_z = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0; e.caston_y = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
e.ExtraDIChance = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0; e.caston_z = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.instrument_mod = row[16] ? static_cast<int32_t>(atoi(row[16])) : 10; e.ExtraDIChance = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
e.instrument_mod = row[17] ? static_cast<int32_t>(atoi(row[17])) : 10;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -518,6 +528,7 @@ public:
v.push_back(std::to_string(e.caster_level)); v.push_back(std::to_string(e.caster_level));
v.push_back("'" + Strings::Escape(e.caster_name) + "'"); v.push_back("'" + Strings::Escape(e.caster_name) + "'");
v.push_back(std::to_string(e.ticsremaining)); v.push_back(std::to_string(e.ticsremaining));
v.push_back(std::to_string(e.initialduration));
v.push_back(std::to_string(e.counters)); v.push_back(std::to_string(e.counters));
v.push_back(std::to_string(e.numhits)); v.push_back(std::to_string(e.numhits));
v.push_back(std::to_string(e.melee_rune)); v.push_back(std::to_string(e.melee_rune));
@@ -557,6 +568,7 @@ public:
v.push_back(std::to_string(e.caster_level)); v.push_back(std::to_string(e.caster_level));
v.push_back("'" + Strings::Escape(e.caster_name) + "'"); v.push_back("'" + Strings::Escape(e.caster_name) + "'");
v.push_back(std::to_string(e.ticsremaining)); v.push_back(std::to_string(e.ticsremaining));
v.push_back(std::to_string(e.initialduration));
v.push_back(std::to_string(e.counters)); v.push_back(std::to_string(e.counters));
v.push_back(std::to_string(e.numhits)); v.push_back(std::to_string(e.numhits));
v.push_back(std::to_string(e.melee_rune)); v.push_back(std::to_string(e.melee_rune));
@@ -132,8 +132,8 @@ public:
uint8_t lfg; uint8_t lfg;
std::string mailkey; std::string mailkey;
uint8_t xtargets; uint8_t xtargets;
uint8_t ingame;
uint32_t first_login; uint32_t first_login;
uint8_t ingame;
uint32_t e_aa_effects; uint32_t e_aa_effects;
uint32_t e_percent_to_aa; uint32_t e_percent_to_aa;
uint32_t e_expended_aa_spent; uint32_t e_expended_aa_spent;
@@ -248,8 +248,8 @@ public:
"lfg", "lfg",
"mailkey", "mailkey",
"xtargets", "xtargets",
"ingame",
"first_login", "first_login",
"ingame",
"e_aa_effects", "e_aa_effects",
"e_percent_to_aa", "e_percent_to_aa",
"e_expended_aa_spent", "e_expended_aa_spent",
@@ -360,8 +360,8 @@ public:
"lfg", "lfg",
"mailkey", "mailkey",
"xtargets", "xtargets",
"ingame",
"first_login", "first_login",
"ingame",
"e_aa_effects", "e_aa_effects",
"e_percent_to_aa", "e_percent_to_aa",
"e_expended_aa_spent", "e_expended_aa_spent",
@@ -506,8 +506,8 @@ public:
e.lfg = 0; e.lfg = 0;
e.mailkey = ""; e.mailkey = "";
e.xtargets = 5; e.xtargets = 5;
e.ingame = 0;
e.first_login = 0; e.first_login = 0;
e.ingame = 0;
e.e_aa_effects = 0; e.e_aa_effects = 0;
e.e_percent_to_aa = 0; e.e_percent_to_aa = 0;
e.e_expended_aa_spent = 0; e.e_expended_aa_spent = 0;
@@ -648,8 +648,8 @@ public:
e.lfg = row[93] ? static_cast<uint8_t>(strtoul(row[93], nullptr, 10)) : 0; e.lfg = row[93] ? static_cast<uint8_t>(strtoul(row[93], nullptr, 10)) : 0;
e.mailkey = row[94] ? row[94] : ""; e.mailkey = row[94] ? row[94] : "";
e.xtargets = row[95] ? static_cast<uint8_t>(strtoul(row[95], nullptr, 10)) : 5; e.xtargets = row[95] ? static_cast<uint8_t>(strtoul(row[95], nullptr, 10)) : 5;
e.ingame = row[96] ? static_cast<uint8_t>(strtoul(row[96], nullptr, 10)) : 0; e.first_login = row[96] ? static_cast<uint32_t>(strtoul(row[96], nullptr, 10)) : 0;
e.first_login = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 0; e.ingame = row[97] ? static_cast<uint8_t>(strtoul(row[97], nullptr, 10)) : 0;
e.e_aa_effects = row[98] ? static_cast<uint32_t>(strtoul(row[98], nullptr, 10)) : 0; e.e_aa_effects = row[98] ? static_cast<uint32_t>(strtoul(row[98], nullptr, 10)) : 0;
e.e_percent_to_aa = row[99] ? static_cast<uint32_t>(strtoul(row[99], nullptr, 10)) : 0; e.e_percent_to_aa = row[99] ? static_cast<uint32_t>(strtoul(row[99], nullptr, 10)) : 0;
e.e_expended_aa_spent = row[100] ? static_cast<uint32_t>(strtoul(row[100], nullptr, 10)) : 0; e.e_expended_aa_spent = row[100] ? static_cast<uint32_t>(strtoul(row[100], nullptr, 10)) : 0;
@@ -786,8 +786,8 @@ public:
v.push_back(columns[93] + " = " + std::to_string(e.lfg)); v.push_back(columns[93] + " = " + std::to_string(e.lfg));
v.push_back(columns[94] + " = '" + Strings::Escape(e.mailkey) + "'"); v.push_back(columns[94] + " = '" + Strings::Escape(e.mailkey) + "'");
v.push_back(columns[95] + " = " + std::to_string(e.xtargets)); v.push_back(columns[95] + " = " + std::to_string(e.xtargets));
v.push_back(columns[96] + " = " + std::to_string(e.ingame)); v.push_back(columns[96] + " = " + std::to_string(e.first_login));
v.push_back(columns[97] + " = " + std::to_string(e.first_login)); v.push_back(columns[97] + " = " + std::to_string(e.ingame));
v.push_back(columns[98] + " = " + std::to_string(e.e_aa_effects)); v.push_back(columns[98] + " = " + std::to_string(e.e_aa_effects));
v.push_back(columns[99] + " = " + std::to_string(e.e_percent_to_aa)); v.push_back(columns[99] + " = " + std::to_string(e.e_percent_to_aa));
v.push_back(columns[100] + " = " + std::to_string(e.e_expended_aa_spent)); v.push_back(columns[100] + " = " + std::to_string(e.e_expended_aa_spent));
@@ -913,8 +913,8 @@ public:
v.push_back(std::to_string(e.lfg)); v.push_back(std::to_string(e.lfg));
v.push_back("'" + Strings::Escape(e.mailkey) + "'"); v.push_back("'" + Strings::Escape(e.mailkey) + "'");
v.push_back(std::to_string(e.xtargets)); v.push_back(std::to_string(e.xtargets));
v.push_back(std::to_string(e.ingame));
v.push_back(std::to_string(e.first_login)); v.push_back(std::to_string(e.first_login));
v.push_back(std::to_string(e.ingame));
v.push_back(std::to_string(e.e_aa_effects)); v.push_back(std::to_string(e.e_aa_effects));
v.push_back(std::to_string(e.e_percent_to_aa)); v.push_back(std::to_string(e.e_percent_to_aa));
v.push_back(std::to_string(e.e_expended_aa_spent)); v.push_back(std::to_string(e.e_expended_aa_spent));
@@ -1048,8 +1048,8 @@ public:
v.push_back(std::to_string(e.lfg)); v.push_back(std::to_string(e.lfg));
v.push_back("'" + Strings::Escape(e.mailkey) + "'"); v.push_back("'" + Strings::Escape(e.mailkey) + "'");
v.push_back(std::to_string(e.xtargets)); v.push_back(std::to_string(e.xtargets));
v.push_back(std::to_string(e.ingame));
v.push_back(std::to_string(e.first_login)); v.push_back(std::to_string(e.first_login));
v.push_back(std::to_string(e.ingame));
v.push_back(std::to_string(e.e_aa_effects)); v.push_back(std::to_string(e.e_aa_effects));
v.push_back(std::to_string(e.e_percent_to_aa)); v.push_back(std::to_string(e.e_percent_to_aa));
v.push_back(std::to_string(e.e_expended_aa_spent)); v.push_back(std::to_string(e.e_expended_aa_spent));
@@ -1187,8 +1187,8 @@ public:
e.lfg = row[93] ? static_cast<uint8_t>(strtoul(row[93], nullptr, 10)) : 0; e.lfg = row[93] ? static_cast<uint8_t>(strtoul(row[93], nullptr, 10)) : 0;
e.mailkey = row[94] ? row[94] : ""; e.mailkey = row[94] ? row[94] : "";
e.xtargets = row[95] ? static_cast<uint8_t>(strtoul(row[95], nullptr, 10)) : 5; e.xtargets = row[95] ? static_cast<uint8_t>(strtoul(row[95], nullptr, 10)) : 5;
e.ingame = row[96] ? static_cast<uint8_t>(strtoul(row[96], nullptr, 10)) : 0; e.first_login = row[96] ? static_cast<uint32_t>(strtoul(row[96], nullptr, 10)) : 0;
e.first_login = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 0; e.ingame = row[97] ? static_cast<uint8_t>(strtoul(row[97], nullptr, 10)) : 0;
e.e_aa_effects = row[98] ? static_cast<uint32_t>(strtoul(row[98], nullptr, 10)) : 0; e.e_aa_effects = row[98] ? static_cast<uint32_t>(strtoul(row[98], nullptr, 10)) : 0;
e.e_percent_to_aa = row[99] ? static_cast<uint32_t>(strtoul(row[99], nullptr, 10)) : 0; e.e_percent_to_aa = row[99] ? static_cast<uint32_t>(strtoul(row[99], nullptr, 10)) : 0;
e.e_expended_aa_spent = row[100] ? static_cast<uint32_t>(strtoul(row[100], nullptr, 10)) : 0; e.e_expended_aa_spent = row[100] ? static_cast<uint32_t>(strtoul(row[100], nullptr, 10)) : 0;
@@ -1317,8 +1317,8 @@ public:
e.lfg = row[93] ? static_cast<uint8_t>(strtoul(row[93], nullptr, 10)) : 0; e.lfg = row[93] ? static_cast<uint8_t>(strtoul(row[93], nullptr, 10)) : 0;
e.mailkey = row[94] ? row[94] : ""; e.mailkey = row[94] ? row[94] : "";
e.xtargets = row[95] ? static_cast<uint8_t>(strtoul(row[95], nullptr, 10)) : 5; e.xtargets = row[95] ? static_cast<uint8_t>(strtoul(row[95], nullptr, 10)) : 5;
e.ingame = row[96] ? static_cast<uint8_t>(strtoul(row[96], nullptr, 10)) : 0; e.first_login = row[96] ? static_cast<uint32_t>(strtoul(row[96], nullptr, 10)) : 0;
e.first_login = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 0; e.ingame = row[97] ? static_cast<uint8_t>(strtoul(row[97], nullptr, 10)) : 0;
e.e_aa_effects = row[98] ? static_cast<uint32_t>(strtoul(row[98], nullptr, 10)) : 0; e.e_aa_effects = row[98] ? static_cast<uint32_t>(strtoul(row[98], nullptr, 10)) : 0;
e.e_percent_to_aa = row[99] ? static_cast<uint32_t>(strtoul(row[99], nullptr, 10)) : 0; e.e_percent_to_aa = row[99] ? static_cast<uint32_t>(strtoul(row[99], nullptr, 10)) : 0;
e.e_expended_aa_spent = row[100] ? static_cast<uint32_t>(strtoul(row[100], nullptr, 10)) : 0; e.e_expended_aa_spent = row[100] ? static_cast<uint32_t>(strtoul(row[100], nullptr, 10)) : 0;
@@ -1497,8 +1497,8 @@ public:
v.push_back(std::to_string(e.lfg)); v.push_back(std::to_string(e.lfg));
v.push_back("'" + Strings::Escape(e.mailkey) + "'"); v.push_back("'" + Strings::Escape(e.mailkey) + "'");
v.push_back(std::to_string(e.xtargets)); v.push_back(std::to_string(e.xtargets));
v.push_back(std::to_string(e.ingame));
v.push_back(std::to_string(e.first_login)); v.push_back(std::to_string(e.first_login));
v.push_back(std::to_string(e.ingame));
v.push_back(std::to_string(e.e_aa_effects)); v.push_back(std::to_string(e.e_aa_effects));
v.push_back(std::to_string(e.e_percent_to_aa)); v.push_back(std::to_string(e.e_percent_to_aa));
v.push_back(std::to_string(e.e_expended_aa_spent)); v.push_back(std::to_string(e.e_expended_aa_spent));
@@ -1625,8 +1625,8 @@ public:
v.push_back(std::to_string(e.lfg)); v.push_back(std::to_string(e.lfg));
v.push_back("'" + Strings::Escape(e.mailkey) + "'"); v.push_back("'" + Strings::Escape(e.mailkey) + "'");
v.push_back(std::to_string(e.xtargets)); v.push_back(std::to_string(e.xtargets));
v.push_back(std::to_string(e.ingame));
v.push_back(std::to_string(e.first_login)); v.push_back(std::to_string(e.first_login));
v.push_back(std::to_string(e.ingame));
v.push_back(std::to_string(e.e_aa_effects)); v.push_back(std::to_string(e.e_aa_effects));
v.push_back(std::to_string(e.e_percent_to_aa)); v.push_back(std::to_string(e.e_percent_to_aa));
v.push_back(std::to_string(e.e_expended_aa_spent)); v.push_back(std::to_string(e.e_expended_aa_spent));
@@ -110,8 +110,8 @@ public:
e.character_id = 0; e.character_id = 0;
e.zone_id = 0; e.zone_id = 0;
e.instance_version = -1; e.instance_version = -1;
e.aa_modifier = 0; e.aa_modifier = 1;
e.exp_modifier = 0; e.exp_modifier = 1;
return e; return e;
} }
@@ -151,8 +151,8 @@ public:
e.character_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0; e.character_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0; e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.instance_version = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1; e.instance_version = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
e.aa_modifier = row[3] ? strtof(row[3], nullptr) : 0; e.aa_modifier = row[3] ? strtof(row[3], nullptr) : 1;
e.exp_modifier = row[4] ? strtof(row[4], nullptr) : 0; e.exp_modifier = row[4] ? strtof(row[4], nullptr) : 1;
return e; return e;
} }
@@ -287,8 +287,8 @@ public:
e.character_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0; e.character_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0; e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.instance_version = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1; e.instance_version = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
e.aa_modifier = row[3] ? strtof(row[3], nullptr) : 0; e.aa_modifier = row[3] ? strtof(row[3], nullptr) : 1;
e.exp_modifier = row[4] ? strtof(row[4], nullptr) : 0; e.exp_modifier = row[4] ? strtof(row[4], nullptr) : 1;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -316,8 +316,8 @@ public:
e.character_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0; e.character_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0; e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.instance_version = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1; e.instance_version = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
e.aa_modifier = row[3] ? strtof(row[3], nullptr) : 0; e.aa_modifier = row[3] ? strtof(row[3], nullptr) : 1;
e.exp_modifier = row[4] ? strtof(row[4], nullptr) : 0; e.exp_modifier = row[4] ? strtof(row[4], nullptr) : 1;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -38,7 +38,7 @@ public:
struct CharacterMemmedSpells { struct CharacterMemmedSpells {
uint32_t id; uint32_t id;
uint16_t slot_id; uint16_t slot_id;
uint16_t spell_id; int32_t spell_id;
}; };
static std::string PrimaryKey() static std::string PrimaryKey()
@@ -142,7 +142,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.slot_id = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0; e.slot_id = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
return e; return e;
} }
@@ -270,7 +270,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.slot_id = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0; e.slot_id = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -297,7 +297,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.slot_id = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0; e.slot_id = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -36,37 +36,53 @@
class BaseCharacterPetBuffsRepository { class BaseCharacterPetBuffsRepository {
public: public:
struct CharacterPetBuffs { struct CharacterPetBuffs {
int32_t char_id; uint32_t character_id;
int32_t pet; int32_t pet;
int32_t slot; uint8_t slot_id;
int32_t spell_id; int32_t spell_id;
int8_t caster_level; uint8_t caster_level;
std::string castername; std::string caster_name;
int32_t ticsremaining; int32_t ticsremaining;
int32_t counters; int32_t initialduration;
int32_t numhits; uint32_t counters;
int32_t rune; uint32_t numhits;
uint8_t instrument_mod; uint32_t melee_rune;
uint32_t magic_rune;
uint8_t persistent;
uint32_t dot_rune;
int32_t caston_x;
int32_t caston_y;
int32_t caston_z;
int32_t ExtraDIChance;
uint32_t instrument_mod;
}; };
static std::string PrimaryKey() static std::string PrimaryKey()
{ {
return std::string("char_id"); return std::string("character_id");
} }
static std::vector<std::string> Columns() static std::vector<std::string> Columns()
{ {
return { return {
"char_id", "character_id",
"pet", "pet",
"slot", "slot_id",
"spell_id", "spell_id",
"caster_level", "caster_level",
"castername", "caster_name",
"ticsremaining", "ticsremaining",
"initialduration",
"counters", "counters",
"numhits", "numhits",
"rune", "melee_rune",
"magic_rune",
"persistent",
"dot_rune",
"caston_x",
"caston_y",
"caston_z",
"ExtraDIChance",
"instrument_mod", "instrument_mod",
}; };
} }
@@ -74,16 +90,24 @@ public:
static std::vector<std::string> SelectColumns() static std::vector<std::string> SelectColumns()
{ {
return { return {
"char_id", "character_id",
"pet", "pet",
"slot", "slot_id",
"spell_id", "spell_id",
"caster_level", "caster_level",
"castername", "caster_name",
"ticsremaining", "ticsremaining",
"initialduration",
"counters", "counters",
"numhits", "numhits",
"rune", "melee_rune",
"magic_rune",
"persistent",
"dot_rune",
"caston_x",
"caston_y",
"caston_z",
"ExtraDIChance",
"instrument_mod", "instrument_mod",
}; };
} }
@@ -125,17 +149,25 @@ public:
{ {
CharacterPetBuffs e{}; CharacterPetBuffs e{};
e.char_id = 0; e.character_id = 0;
e.pet = 0; e.pet = 0;
e.slot = 0; e.slot_id = 0;
e.spell_id = 0; e.spell_id = 0;
e.caster_level = 0; e.caster_level = 0;
e.castername = ""; e.caster_name = "";
e.ticsremaining = 0; e.ticsremaining = 0;
e.counters = 0; e.initialduration = 0;
e.numhits = 0; e.counters = 0;
e.rune = 0; e.numhits = 0;
e.instrument_mod = 10; e.melee_rune = 0;
e.magic_rune = 0;
e.persistent = 0;
e.dot_rune = 0;
e.caston_x = 0;
e.caston_y = 0;
e.caston_z = 0;
e.ExtraDIChance = 0;
e.instrument_mod = 10;
return e; return e;
} }
@@ -146,7 +178,7 @@ public:
) )
{ {
for (auto &character_pet_buffs : character_pet_buffss) { for (auto &character_pet_buffs : character_pet_buffss) {
if (character_pet_buffs.char_id == character_pet_buffs_id) { if (character_pet_buffs.character_id == character_pet_buffs_id) {
return character_pet_buffs; return character_pet_buffs;
} }
} }
@@ -172,17 +204,25 @@ public:
if (results.RowCount() == 1) { if (results.RowCount() == 1) {
CharacterPetBuffs e{}; CharacterPetBuffs e{};
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0; e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.pet = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0; e.pet = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.slot = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0; e.slot_id = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.spell_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0; e.spell_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.caster_level = row[4] ? static_cast<int8_t>(atoi(row[4])) : 0; e.caster_level = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
e.castername = row[5] ? row[5] : ""; e.caster_name = row[5] ? row[5] : "";
e.ticsremaining = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0; e.ticsremaining = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.counters = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0; e.initialduration = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.numhits = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0; e.counters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.rune = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0; e.numhits = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.instrument_mod = row[10] ? static_cast<uint8_t>(strtoul(row[10], nullptr, 10)) : 10; e.melee_rune = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.magic_rune = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
e.persistent = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
e.dot_rune = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.caston_x = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
e.caston_y = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.caston_z = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
e.ExtraDIChance = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
e.instrument_mod = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 10;
return e; return e;
} }
@@ -216,17 +256,25 @@ public:
auto columns = Columns(); auto columns = Columns();
v.push_back(columns[0] + " = " + std::to_string(e.char_id)); v.push_back(columns[0] + " = " + std::to_string(e.character_id));
v.push_back(columns[1] + " = " + std::to_string(e.pet)); v.push_back(columns[1] + " = " + std::to_string(e.pet));
v.push_back(columns[2] + " = " + std::to_string(e.slot)); v.push_back(columns[2] + " = " + std::to_string(e.slot_id));
v.push_back(columns[3] + " = " + std::to_string(e.spell_id)); v.push_back(columns[3] + " = " + std::to_string(e.spell_id));
v.push_back(columns[4] + " = " + std::to_string(e.caster_level)); v.push_back(columns[4] + " = " + std::to_string(e.caster_level));
v.push_back(columns[5] + " = '" + Strings::Escape(e.castername) + "'"); v.push_back(columns[5] + " = '" + Strings::Escape(e.caster_name) + "'");
v.push_back(columns[6] + " = " + std::to_string(e.ticsremaining)); v.push_back(columns[6] + " = " + std::to_string(e.ticsremaining));
v.push_back(columns[7] + " = " + std::to_string(e.counters)); v.push_back(columns[7] + " = " + std::to_string(e.initialduration));
v.push_back(columns[8] + " = " + std::to_string(e.numhits)); v.push_back(columns[8] + " = " + std::to_string(e.counters));
v.push_back(columns[9] + " = " + std::to_string(e.rune)); v.push_back(columns[9] + " = " + std::to_string(e.numhits));
v.push_back(columns[10] + " = " + std::to_string(e.instrument_mod)); v.push_back(columns[10] + " = " + std::to_string(e.melee_rune));
v.push_back(columns[11] + " = " + std::to_string(e.magic_rune));
v.push_back(columns[12] + " = " + std::to_string(e.persistent));
v.push_back(columns[13] + " = " + std::to_string(e.dot_rune));
v.push_back(columns[14] + " = " + std::to_string(e.caston_x));
v.push_back(columns[15] + " = " + std::to_string(e.caston_y));
v.push_back(columns[16] + " = " + std::to_string(e.caston_z));
v.push_back(columns[17] + " = " + std::to_string(e.ExtraDIChance));
v.push_back(columns[18] + " = " + std::to_string(e.instrument_mod));
auto results = db.QueryDatabase( auto results = db.QueryDatabase(
fmt::format( fmt::format(
@@ -234,7 +282,7 @@ public:
TableName(), TableName(),
Strings::Implode(", ", v), Strings::Implode(", ", v),
PrimaryKey(), PrimaryKey(),
e.char_id e.character_id
) )
); );
@@ -248,16 +296,24 @@ public:
{ {
std::vector<std::string> v; std::vector<std::string> v;
v.push_back(std::to_string(e.char_id)); v.push_back(std::to_string(e.character_id));
v.push_back(std::to_string(e.pet)); v.push_back(std::to_string(e.pet));
v.push_back(std::to_string(e.slot)); v.push_back(std::to_string(e.slot_id));
v.push_back(std::to_string(e.spell_id)); v.push_back(std::to_string(e.spell_id));
v.push_back(std::to_string(e.caster_level)); v.push_back(std::to_string(e.caster_level));
v.push_back("'" + Strings::Escape(e.castername) + "'"); v.push_back("'" + Strings::Escape(e.caster_name) + "'");
v.push_back(std::to_string(e.ticsremaining)); v.push_back(std::to_string(e.ticsremaining));
v.push_back(std::to_string(e.initialduration));
v.push_back(std::to_string(e.counters)); v.push_back(std::to_string(e.counters));
v.push_back(std::to_string(e.numhits)); v.push_back(std::to_string(e.numhits));
v.push_back(std::to_string(e.rune)); v.push_back(std::to_string(e.melee_rune));
v.push_back(std::to_string(e.magic_rune));
v.push_back(std::to_string(e.persistent));
v.push_back(std::to_string(e.dot_rune));
v.push_back(std::to_string(e.caston_x));
v.push_back(std::to_string(e.caston_y));
v.push_back(std::to_string(e.caston_z));
v.push_back(std::to_string(e.ExtraDIChance));
v.push_back(std::to_string(e.instrument_mod)); v.push_back(std::to_string(e.instrument_mod));
auto results = db.QueryDatabase( auto results = db.QueryDatabase(
@@ -269,7 +325,7 @@ public:
); );
if (results.Success()) { if (results.Success()) {
e.char_id = results.LastInsertedID(); e.character_id = results.LastInsertedID();
return e; return e;
} }
@@ -288,16 +344,24 @@ public:
for (auto &e: entries) { for (auto &e: entries) {
std::vector<std::string> v; std::vector<std::string> v;
v.push_back(std::to_string(e.char_id)); v.push_back(std::to_string(e.character_id));
v.push_back(std::to_string(e.pet)); v.push_back(std::to_string(e.pet));
v.push_back(std::to_string(e.slot)); v.push_back(std::to_string(e.slot_id));
v.push_back(std::to_string(e.spell_id)); v.push_back(std::to_string(e.spell_id));
v.push_back(std::to_string(e.caster_level)); v.push_back(std::to_string(e.caster_level));
v.push_back("'" + Strings::Escape(e.castername) + "'"); v.push_back("'" + Strings::Escape(e.caster_name) + "'");
v.push_back(std::to_string(e.ticsremaining)); v.push_back(std::to_string(e.ticsremaining));
v.push_back(std::to_string(e.initialduration));
v.push_back(std::to_string(e.counters)); v.push_back(std::to_string(e.counters));
v.push_back(std::to_string(e.numhits)); v.push_back(std::to_string(e.numhits));
v.push_back(std::to_string(e.rune)); v.push_back(std::to_string(e.melee_rune));
v.push_back(std::to_string(e.magic_rune));
v.push_back(std::to_string(e.persistent));
v.push_back(std::to_string(e.dot_rune));
v.push_back(std::to_string(e.caston_x));
v.push_back(std::to_string(e.caston_y));
v.push_back(std::to_string(e.caston_z));
v.push_back(std::to_string(e.ExtraDIChance));
v.push_back(std::to_string(e.instrument_mod)); v.push_back(std::to_string(e.instrument_mod));
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")"); insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
@@ -332,17 +396,25 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
CharacterPetBuffs e{}; CharacterPetBuffs e{};
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0; e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.pet = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0; e.pet = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.slot = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0; e.slot_id = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.spell_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0; e.spell_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.caster_level = row[4] ? static_cast<int8_t>(atoi(row[4])) : 0; e.caster_level = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
e.castername = row[5] ? row[5] : ""; e.caster_name = row[5] ? row[5] : "";
e.ticsremaining = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0; e.ticsremaining = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.counters = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0; e.initialduration = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.numhits = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0; e.counters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.rune = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0; e.numhits = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.instrument_mod = row[10] ? static_cast<uint8_t>(strtoul(row[10], nullptr, 10)) : 10; e.melee_rune = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.magic_rune = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
e.persistent = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
e.dot_rune = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.caston_x = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
e.caston_y = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.caston_z = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
e.ExtraDIChance = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
e.instrument_mod = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 10;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -367,17 +439,25 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
CharacterPetBuffs e{}; CharacterPetBuffs e{};
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0; e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.pet = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0; e.pet = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.slot = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0; e.slot_id = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.spell_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0; e.spell_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.caster_level = row[4] ? static_cast<int8_t>(atoi(row[4])) : 0; e.caster_level = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
e.castername = row[5] ? row[5] : ""; e.caster_name = row[5] ? row[5] : "";
e.ticsremaining = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0; e.ticsremaining = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.counters = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0; e.initialduration = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.numhits = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0; e.counters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.rune = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0; e.numhits = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.instrument_mod = row[10] ? static_cast<uint8_t>(strtoul(row[10], nullptr, 10)) : 10; e.melee_rune = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.magic_rune = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
e.persistent = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
e.dot_rune = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.caston_x = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
e.caston_y = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.caston_z = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
e.ExtraDIChance = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
e.instrument_mod = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 10;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -452,16 +532,24 @@ public:
{ {
std::vector<std::string> v; std::vector<std::string> v;
v.push_back(std::to_string(e.char_id)); v.push_back(std::to_string(e.character_id));
v.push_back(std::to_string(e.pet)); v.push_back(std::to_string(e.pet));
v.push_back(std::to_string(e.slot)); v.push_back(std::to_string(e.slot_id));
v.push_back(std::to_string(e.spell_id)); v.push_back(std::to_string(e.spell_id));
v.push_back(std::to_string(e.caster_level)); v.push_back(std::to_string(e.caster_level));
v.push_back("'" + Strings::Escape(e.castername) + "'"); v.push_back("'" + Strings::Escape(e.caster_name) + "'");
v.push_back(std::to_string(e.ticsremaining)); v.push_back(std::to_string(e.ticsremaining));
v.push_back(std::to_string(e.initialduration));
v.push_back(std::to_string(e.counters)); v.push_back(std::to_string(e.counters));
v.push_back(std::to_string(e.numhits)); v.push_back(std::to_string(e.numhits));
v.push_back(std::to_string(e.rune)); v.push_back(std::to_string(e.melee_rune));
v.push_back(std::to_string(e.magic_rune));
v.push_back(std::to_string(e.persistent));
v.push_back(std::to_string(e.dot_rune));
v.push_back(std::to_string(e.caston_x));
v.push_back(std::to_string(e.caston_y));
v.push_back(std::to_string(e.caston_z));
v.push_back(std::to_string(e.ExtraDIChance));
v.push_back(std::to_string(e.instrument_mod)); v.push_back(std::to_string(e.instrument_mod));
auto results = db.QueryDatabase( auto results = db.QueryDatabase(
@@ -485,16 +573,24 @@ public:
for (auto &e: entries) { for (auto &e: entries) {
std::vector<std::string> v; std::vector<std::string> v;
v.push_back(std::to_string(e.char_id)); v.push_back(std::to_string(e.character_id));
v.push_back(std::to_string(e.pet)); v.push_back(std::to_string(e.pet));
v.push_back(std::to_string(e.slot)); v.push_back(std::to_string(e.slot_id));
v.push_back(std::to_string(e.spell_id)); v.push_back(std::to_string(e.spell_id));
v.push_back(std::to_string(e.caster_level)); v.push_back(std::to_string(e.caster_level));
v.push_back("'" + Strings::Escape(e.castername) + "'"); v.push_back("'" + Strings::Escape(e.caster_name) + "'");
v.push_back(std::to_string(e.ticsremaining)); v.push_back(std::to_string(e.ticsremaining));
v.push_back(std::to_string(e.initialduration));
v.push_back(std::to_string(e.counters)); v.push_back(std::to_string(e.counters));
v.push_back(std::to_string(e.numhits)); v.push_back(std::to_string(e.numhits));
v.push_back(std::to_string(e.rune)); v.push_back(std::to_string(e.melee_rune));
v.push_back(std::to_string(e.magic_rune));
v.push_back(std::to_string(e.persistent));
v.push_back(std::to_string(e.dot_rune));
v.push_back(std::to_string(e.caston_x));
v.push_back(std::to_string(e.caston_y));
v.push_back(std::to_string(e.caston_z));
v.push_back(std::to_string(e.ExtraDIChance));
v.push_back(std::to_string(e.instrument_mod)); v.push_back(std::to_string(e.instrument_mod));
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")"); insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
@@ -38,7 +38,7 @@ public:
struct CharacterSpells { struct CharacterSpells {
uint32_t id; uint32_t id;
uint16_t slot_id; uint16_t slot_id;
uint16_t spell_id; int32_t spell_id;
}; };
static std::string PrimaryKey() static std::string PrimaryKey()
@@ -142,7 +142,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.slot_id = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0; e.slot_id = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
return e; return e;
} }
@@ -269,7 +269,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.slot_id = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0; e.slot_id = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -296,7 +296,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.slot_id = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0; e.slot_id = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -36,8 +36,8 @@
class BaseDamageshieldtypesRepository { class BaseDamageshieldtypesRepository {
public: public:
struct Damageshieldtypes { struct Damageshieldtypes {
uint32_t spellid; int32_t spellid;
uint8_t type; uint8_t type;
}; };
static std::string PrimaryKey() static std::string PrimaryKey()
@@ -136,7 +136,7 @@ public:
if (results.RowCount() == 1) { if (results.RowCount() == 1) {
Damageshieldtypes e{}; Damageshieldtypes e{};
e.spellid = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.spellid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.type = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0; e.type = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
return e; return e;
@@ -260,7 +260,7 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
Damageshieldtypes e{}; Damageshieldtypes e{};
e.spellid = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.spellid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.type = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0; e.type = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
all_entries.push_back(e); all_entries.push_back(e);
@@ -286,7 +286,7 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
Damageshieldtypes e{}; Damageshieldtypes e{};
e.spellid = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.spellid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.type = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0; e.type = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
all_entries.push_back(e); all_entries.push_back(e);
@@ -31,8 +31,9 @@
#include "common/database.h" #include "common/database.h"
#include "common/strings.h" #include "common/strings.h"
#include "cereal/cereal.hpp"
#include <ctime> #include <ctime>
#include <cereal/cereal.hpp>
class BaseDataBucketsRepository { class BaseDataBucketsRepository {
public: public:
struct DataBuckets { struct DataBuckets {
@@ -67,7 +67,7 @@ public:
float buffer; float buffer;
uint32_t client_version_mask; uint32_t client_version_mask;
int16_t is_ldon_door; int16_t is_ldon_door;
int16_t close_timer_ms; uint16_t close_timer_ms;
int32_t dz_switch_id; int32_t dz_switch_id;
int8_t min_expansion; int8_t min_expansion;
int8_t max_expansion; int8_t max_expansion;
@@ -307,7 +307,7 @@ public:
e.buffer = row[28] ? strtof(row[28], nullptr) : 0; e.buffer = row[28] ? strtof(row[28], nullptr) : 0;
e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295; e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295;
e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0; e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0;
e.close_timer_ms = row[31] ? static_cast<int16_t>(atoi(row[31])) : 5000; e.close_timer_ms = row[31] ? static_cast<uint16_t>(strtoul(row[31], nullptr, 10)) : 5000;
e.dz_switch_id = row[32] ? static_cast<int32_t>(atoi(row[32])) : 0; e.dz_switch_id = row[32] ? static_cast<int32_t>(atoi(row[32])) : 0;
e.min_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1; e.min_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1;
e.max_expansion = row[34] ? static_cast<int8_t>(atoi(row[34])) : -1; e.max_expansion = row[34] ? static_cast<int8_t>(atoi(row[34])) : -1;
@@ -570,7 +570,7 @@ public:
e.buffer = row[28] ? strtof(row[28], nullptr) : 0; e.buffer = row[28] ? strtof(row[28], nullptr) : 0;
e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295; e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295;
e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0; e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0;
e.close_timer_ms = row[31] ? static_cast<int16_t>(atoi(row[31])) : 5000; e.close_timer_ms = row[31] ? static_cast<uint16_t>(strtoul(row[31], nullptr, 10)) : 5000;
e.dz_switch_id = row[32] ? static_cast<int32_t>(atoi(row[32])) : 0; e.dz_switch_id = row[32] ? static_cast<int32_t>(atoi(row[32])) : 0;
e.min_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1; e.min_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1;
e.max_expansion = row[34] ? static_cast<int8_t>(atoi(row[34])) : -1; e.max_expansion = row[34] ? static_cast<int8_t>(atoi(row[34])) : -1;
@@ -631,7 +631,7 @@ public:
e.buffer = row[28] ? strtof(row[28], nullptr) : 0; e.buffer = row[28] ? strtof(row[28], nullptr) : 0;
e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295; e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295;
e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0; e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0;
e.close_timer_ms = row[31] ? static_cast<int16_t>(atoi(row[31])) : 5000; e.close_timer_ms = row[31] ? static_cast<uint16_t>(strtoul(row[31], nullptr, 10)) : 5000;
e.dz_switch_id = row[32] ? static_cast<int32_t>(atoi(row[32])) : 0; e.dz_switch_id = row[32] ? static_cast<int32_t>(atoi(row[32])) : 0;
e.min_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1; e.min_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1;
e.max_expansion = row[34] ? static_cast<int8_t>(atoi(row[34])) : -1; e.max_expansion = row[34] ? static_cast<int8_t>(atoi(row[34])) : -1;
@@ -33,7 +33,6 @@
#include <ctime> #include <ctime>
class BaseGuildPermissionsRepository { class BaseGuildPermissionsRepository {
public: public:
struct GuildPermissions { struct GuildPermissions {
@@ -145,10 +144,10 @@ public:
if (results.RowCount() == 1) { if (results.RowCount() == 1) {
GuildPermissions e{}; GuildPermissions e{};
e.id = static_cast<int32_t>(atoi(row[0])); e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.perm_id = static_cast<int32_t>(atoi(row[1])); e.perm_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.guild_id = static_cast<int32_t>(atoi(row[2])); e.guild_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.permission = static_cast<int32_t>(atoi(row[3])); e.permission = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
return e; return e;
} }
@@ -276,10 +275,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
GuildPermissions e{}; GuildPermissions e{};
e.id = static_cast<int32_t>(atoi(row[0])); e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.perm_id = static_cast<int32_t>(atoi(row[1])); e.perm_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.guild_id = static_cast<int32_t>(atoi(row[2])); e.guild_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.permission = static_cast<int32_t>(atoi(row[3])); e.permission = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -304,10 +303,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
GuildPermissions e{}; GuildPermissions e{};
e.id = static_cast<int32_t>(atoi(row[0])); e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.perm_id = static_cast<int32_t>(atoi(row[1])); e.perm_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.guild_id = static_cast<int32_t>(atoi(row[2])); e.guild_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.permission = static_cast<int32_t>(atoi(row[3])); e.permission = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -33,7 +33,6 @@
#include <ctime> #include <ctime>
class BaseGuildTributesRepository { class BaseGuildTributesRepository {
public: public:
struct GuildTributes { struct GuildTributes {
@@ -157,13 +156,13 @@ public:
if (results.RowCount() == 1) { if (results.RowCount() == 1) {
GuildTributes e{}; GuildTributes e{};
e.guild_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10)); e.guild_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.tribute_id_1 = static_cast<uint32_t>(strtoul(row[1], nullptr, 10)); e.tribute_id_1 = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.tribute_id_1_tier = static_cast<uint32_t>(strtoul(row[2], nullptr, 10)); e.tribute_id_1_tier = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.tribute_id_2 = static_cast<uint32_t>(strtoul(row[3], nullptr, 10)); e.tribute_id_2 = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.tribute_id_2_tier = static_cast<uint32_t>(strtoul(row[4], nullptr, 10)); e.tribute_id_2_tier = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.time_remaining = static_cast<uint32_t>(strtoul(row[5], nullptr, 10)); e.time_remaining = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.enabled = static_cast<uint32_t>(strtoul(row[6], nullptr, 10)); e.enabled = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
return e; return e;
} }
@@ -301,13 +300,13 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
GuildTributes e{}; GuildTributes e{};
e.guild_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10)); e.guild_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.tribute_id_1 = static_cast<uint32_t>(strtoul(row[1], nullptr, 10)); e.tribute_id_1 = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.tribute_id_1_tier = static_cast<uint32_t>(strtoul(row[2], nullptr, 10)); e.tribute_id_1_tier = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.tribute_id_2 = static_cast<uint32_t>(strtoul(row[3], nullptr, 10)); e.tribute_id_2 = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.tribute_id_2_tier = static_cast<uint32_t>(strtoul(row[4], nullptr, 10)); e.tribute_id_2_tier = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.time_remaining = static_cast<uint32_t>(strtoul(row[5], nullptr, 10)); e.time_remaining = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.enabled = static_cast<uint32_t>(strtoul(row[6], nullptr, 10)); e.enabled = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -332,13 +331,13 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
GuildTributes e{}; GuildTributes e{};
e.guild_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10)); e.guild_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.tribute_id_1 = static_cast<uint32_t>(strtoul(row[1], nullptr, 10)); e.tribute_id_1 = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.tribute_id_1_tier = static_cast<uint32_t>(strtoul(row[2], nullptr, 10)); e.tribute_id_1_tier = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.tribute_id_2 = static_cast<uint32_t>(strtoul(row[3], nullptr, 10)); e.tribute_id_2 = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.tribute_id_2_tier = static_cast<uint32_t>(strtoul(row[4], nullptr, 10)); e.tribute_id_2_tier = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.time_remaining = static_cast<uint32_t>(strtoul(row[5], nullptr, 10)); e.time_remaining = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.enabled = static_cast<uint32_t>(strtoul(row[6], nullptr, 10)); e.enabled = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -33,7 +33,6 @@
#include <ctime> #include <ctime>
class BaseGuildsRepository { class BaseGuildsRepository {
public: public:
struct Guilds { struct Guilds {
@@ -38,7 +38,7 @@ public:
struct LdonTrapTemplates { struct LdonTrapTemplates {
uint32_t id; uint32_t id;
uint8_t type; uint8_t type;
uint16_t spell_id; int32_t spell_id;
uint16_t skill; uint16_t skill;
uint8_t locked; uint8_t locked;
}; };
@@ -150,7 +150,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.type = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 1; e.type = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 1;
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.skill = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0; e.skill = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0;
e.locked = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0; e.locked = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
@@ -286,7 +286,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.type = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 1; e.type = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 1;
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.skill = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0; e.skill = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0;
e.locked = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0; e.locked = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
@@ -315,7 +315,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.type = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 1; e.type = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 1;
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.skill = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0; e.skill = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0;
e.locked = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0; e.locked = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
@@ -38,10 +38,11 @@ public:
struct MercBuffs { struct MercBuffs {
uint32_t MercBuffId; uint32_t MercBuffId;
uint32_t MercId; uint32_t MercId;
uint32_t SpellId; int32_t SpellId;
uint32_t CasterLevel; uint32_t CasterLevel;
uint32_t DurationFormula; uint32_t DurationFormula;
int32_t TicsRemaining; int32_t TicsRemaining;
int32_t InitialDuration;
uint32_t PoisonCounters; uint32_t PoisonCounters;
uint32_t DiseaseCounters; uint32_t DiseaseCounters;
uint32_t CurseCounters; uint32_t CurseCounters;
@@ -49,12 +50,13 @@ public:
uint32_t HitCount; uint32_t HitCount;
uint32_t MeleeRune; uint32_t MeleeRune;
uint32_t MagicRune; uint32_t MagicRune;
int32_t dot_rune; uint32_t dot_rune;
int32_t caston_x; int32_t caston_x;
int8_t Persistent; int8_t Persistent;
int32_t caston_y; int32_t caston_y;
int32_t caston_z; int32_t caston_z;
int32_t ExtraDIChance; int32_t ExtraDIChance;
uint32_t instrument_mod;
}; };
static std::string PrimaryKey() static std::string PrimaryKey()
@@ -71,6 +73,7 @@ public:
"CasterLevel", "CasterLevel",
"DurationFormula", "DurationFormula",
"TicsRemaining", "TicsRemaining",
"InitialDuration",
"PoisonCounters", "PoisonCounters",
"DiseaseCounters", "DiseaseCounters",
"CurseCounters", "CurseCounters",
@@ -84,6 +87,7 @@ public:
"caston_y", "caston_y",
"caston_z", "caston_z",
"ExtraDIChance", "ExtraDIChance",
"instrument_mod",
}; };
} }
@@ -96,6 +100,7 @@ public:
"CasterLevel", "CasterLevel",
"DurationFormula", "DurationFormula",
"TicsRemaining", "TicsRemaining",
"InitialDuration",
"PoisonCounters", "PoisonCounters",
"DiseaseCounters", "DiseaseCounters",
"CurseCounters", "CurseCounters",
@@ -109,6 +114,7 @@ public:
"caston_y", "caston_y",
"caston_z", "caston_z",
"ExtraDIChance", "ExtraDIChance",
"instrument_mod",
}; };
} }
@@ -155,6 +161,7 @@ public:
e.CasterLevel = 0; e.CasterLevel = 0;
e.DurationFormula = 0; e.DurationFormula = 0;
e.TicsRemaining = 0; e.TicsRemaining = 0;
e.InitialDuration = 0;
e.PoisonCounters = 0; e.PoisonCounters = 0;
e.DiseaseCounters = 0; e.DiseaseCounters = 0;
e.CurseCounters = 0; e.CurseCounters = 0;
@@ -168,6 +175,7 @@ public:
e.caston_y = 0; e.caston_y = 0;
e.caston_z = 0; e.caston_z = 0;
e.ExtraDIChance = 0; e.ExtraDIChance = 0;
e.instrument_mod = 10;
return e; return e;
} }
@@ -206,23 +214,25 @@ public:
e.MercBuffId = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.MercBuffId = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.MercId = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.MercId = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.SpellId = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0; e.SpellId = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.CasterLevel = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.CasterLevel = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.DurationFormula = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0; e.DurationFormula = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.TicsRemaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0; e.TicsRemaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.PoisonCounters = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0; e.InitialDuration = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.DiseaseCounters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0; e.PoisonCounters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.CurseCounters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0; e.DiseaseCounters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.CorruptionCounters = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0; e.CurseCounters = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.HitCount = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0; e.CorruptionCounters = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.MeleeRune = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0; e.HitCount = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
e.MagicRune = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0; e.MeleeRune = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
e.dot_rune = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0; e.MagicRune = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.caston_x = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0; e.dot_rune = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
e.Persistent = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0; e.caston_x = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.caston_y = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0; e.Persistent = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
e.caston_z = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0; e.caston_y = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
e.ExtraDIChance = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0; e.caston_z = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0;
e.ExtraDIChance = row[19] ? static_cast<int32_t>(atoi(row[19])) : 0;
e.instrument_mod = row[20] ? static_cast<uint32_t>(strtoul(row[20], nullptr, 10)) : 10;
return e; return e;
} }
@@ -261,19 +271,21 @@ public:
v.push_back(columns[3] + " = " + std::to_string(e.CasterLevel)); v.push_back(columns[3] + " = " + std::to_string(e.CasterLevel));
v.push_back(columns[4] + " = " + std::to_string(e.DurationFormula)); v.push_back(columns[4] + " = " + std::to_string(e.DurationFormula));
v.push_back(columns[5] + " = " + std::to_string(e.TicsRemaining)); v.push_back(columns[5] + " = " + std::to_string(e.TicsRemaining));
v.push_back(columns[6] + " = " + std::to_string(e.PoisonCounters)); v.push_back(columns[6] + " = " + std::to_string(e.InitialDuration));
v.push_back(columns[7] + " = " + std::to_string(e.DiseaseCounters)); v.push_back(columns[7] + " = " + std::to_string(e.PoisonCounters));
v.push_back(columns[8] + " = " + std::to_string(e.CurseCounters)); v.push_back(columns[8] + " = " + std::to_string(e.DiseaseCounters));
v.push_back(columns[9] + " = " + std::to_string(e.CorruptionCounters)); v.push_back(columns[9] + " = " + std::to_string(e.CurseCounters));
v.push_back(columns[10] + " = " + std::to_string(e.HitCount)); v.push_back(columns[10] + " = " + std::to_string(e.CorruptionCounters));
v.push_back(columns[11] + " = " + std::to_string(e.MeleeRune)); v.push_back(columns[11] + " = " + std::to_string(e.HitCount));
v.push_back(columns[12] + " = " + std::to_string(e.MagicRune)); v.push_back(columns[12] + " = " + std::to_string(e.MeleeRune));
v.push_back(columns[13] + " = " + std::to_string(e.dot_rune)); v.push_back(columns[13] + " = " + std::to_string(e.MagicRune));
v.push_back(columns[14] + " = " + std::to_string(e.caston_x)); v.push_back(columns[14] + " = " + std::to_string(e.dot_rune));
v.push_back(columns[15] + " = " + std::to_string(e.Persistent)); v.push_back(columns[15] + " = " + std::to_string(e.caston_x));
v.push_back(columns[16] + " = " + std::to_string(e.caston_y)); v.push_back(columns[16] + " = " + std::to_string(e.Persistent));
v.push_back(columns[17] + " = " + std::to_string(e.caston_z)); v.push_back(columns[17] + " = " + std::to_string(e.caston_y));
v.push_back(columns[18] + " = " + std::to_string(e.ExtraDIChance)); v.push_back(columns[18] + " = " + std::to_string(e.caston_z));
v.push_back(columns[19] + " = " + std::to_string(e.ExtraDIChance));
v.push_back(columns[20] + " = " + std::to_string(e.instrument_mod));
auto results = db.QueryDatabase( auto results = db.QueryDatabase(
fmt::format( fmt::format(
@@ -301,6 +313,7 @@ public:
v.push_back(std::to_string(e.CasterLevel)); v.push_back(std::to_string(e.CasterLevel));
v.push_back(std::to_string(e.DurationFormula)); v.push_back(std::to_string(e.DurationFormula));
v.push_back(std::to_string(e.TicsRemaining)); v.push_back(std::to_string(e.TicsRemaining));
v.push_back(std::to_string(e.InitialDuration));
v.push_back(std::to_string(e.PoisonCounters)); v.push_back(std::to_string(e.PoisonCounters));
v.push_back(std::to_string(e.DiseaseCounters)); v.push_back(std::to_string(e.DiseaseCounters));
v.push_back(std::to_string(e.CurseCounters)); v.push_back(std::to_string(e.CurseCounters));
@@ -314,6 +327,7 @@ public:
v.push_back(std::to_string(e.caston_y)); v.push_back(std::to_string(e.caston_y));
v.push_back(std::to_string(e.caston_z)); v.push_back(std::to_string(e.caston_z));
v.push_back(std::to_string(e.ExtraDIChance)); v.push_back(std::to_string(e.ExtraDIChance));
v.push_back(std::to_string(e.instrument_mod));
auto results = db.QueryDatabase( auto results = db.QueryDatabase(
fmt::format( fmt::format(
@@ -349,6 +363,7 @@ public:
v.push_back(std::to_string(e.CasterLevel)); v.push_back(std::to_string(e.CasterLevel));
v.push_back(std::to_string(e.DurationFormula)); v.push_back(std::to_string(e.DurationFormula));
v.push_back(std::to_string(e.TicsRemaining)); v.push_back(std::to_string(e.TicsRemaining));
v.push_back(std::to_string(e.InitialDuration));
v.push_back(std::to_string(e.PoisonCounters)); v.push_back(std::to_string(e.PoisonCounters));
v.push_back(std::to_string(e.DiseaseCounters)); v.push_back(std::to_string(e.DiseaseCounters));
v.push_back(std::to_string(e.CurseCounters)); v.push_back(std::to_string(e.CurseCounters));
@@ -362,6 +377,7 @@ public:
v.push_back(std::to_string(e.caston_y)); v.push_back(std::to_string(e.caston_y));
v.push_back(std::to_string(e.caston_z)); v.push_back(std::to_string(e.caston_z));
v.push_back(std::to_string(e.ExtraDIChance)); v.push_back(std::to_string(e.ExtraDIChance));
v.push_back(std::to_string(e.instrument_mod));
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")"); insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
} }
@@ -397,23 +413,25 @@ public:
e.MercBuffId = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.MercBuffId = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.MercId = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.MercId = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.SpellId = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0; e.SpellId = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.CasterLevel = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.CasterLevel = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.DurationFormula = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0; e.DurationFormula = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.TicsRemaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0; e.TicsRemaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.PoisonCounters = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0; e.InitialDuration = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.DiseaseCounters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0; e.PoisonCounters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.CurseCounters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0; e.DiseaseCounters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.CorruptionCounters = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0; e.CurseCounters = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.HitCount = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0; e.CorruptionCounters = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.MeleeRune = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0; e.HitCount = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
e.MagicRune = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0; e.MeleeRune = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
e.dot_rune = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0; e.MagicRune = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.caston_x = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0; e.dot_rune = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
e.Persistent = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0; e.caston_x = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.caston_y = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0; e.Persistent = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
e.caston_z = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0; e.caston_y = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
e.ExtraDIChance = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0; e.caston_z = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0;
e.ExtraDIChance = row[19] ? static_cast<int32_t>(atoi(row[19])) : 0;
e.instrument_mod = row[20] ? static_cast<uint32_t>(strtoul(row[20], nullptr, 10)) : 10;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -440,23 +458,25 @@ public:
e.MercBuffId = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.MercBuffId = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.MercId = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0; e.MercId = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.SpellId = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0; e.SpellId = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.CasterLevel = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.CasterLevel = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.DurationFormula = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0; e.DurationFormula = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.TicsRemaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0; e.TicsRemaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.PoisonCounters = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0; e.InitialDuration = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.DiseaseCounters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0; e.PoisonCounters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.CurseCounters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0; e.DiseaseCounters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.CorruptionCounters = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0; e.CurseCounters = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.HitCount = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0; e.CorruptionCounters = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.MeleeRune = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0; e.HitCount = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
e.MagicRune = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0; e.MeleeRune = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
e.dot_rune = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0; e.MagicRune = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.caston_x = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0; e.dot_rune = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
e.Persistent = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0; e.caston_x = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.caston_y = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0; e.Persistent = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
e.caston_z = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0; e.caston_y = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
e.ExtraDIChance = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0; e.caston_z = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0;
e.ExtraDIChance = row[19] ? static_cast<int32_t>(atoi(row[19])) : 0;
e.instrument_mod = row[20] ? static_cast<uint32_t>(strtoul(row[20], nullptr, 10)) : 10;
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -537,6 +557,7 @@ public:
v.push_back(std::to_string(e.CasterLevel)); v.push_back(std::to_string(e.CasterLevel));
v.push_back(std::to_string(e.DurationFormula)); v.push_back(std::to_string(e.DurationFormula));
v.push_back(std::to_string(e.TicsRemaining)); v.push_back(std::to_string(e.TicsRemaining));
v.push_back(std::to_string(e.InitialDuration));
v.push_back(std::to_string(e.PoisonCounters)); v.push_back(std::to_string(e.PoisonCounters));
v.push_back(std::to_string(e.DiseaseCounters)); v.push_back(std::to_string(e.DiseaseCounters));
v.push_back(std::to_string(e.CurseCounters)); v.push_back(std::to_string(e.CurseCounters));
@@ -550,6 +571,7 @@ public:
v.push_back(std::to_string(e.caston_y)); v.push_back(std::to_string(e.caston_y));
v.push_back(std::to_string(e.caston_z)); v.push_back(std::to_string(e.caston_z));
v.push_back(std::to_string(e.ExtraDIChance)); v.push_back(std::to_string(e.ExtraDIChance));
v.push_back(std::to_string(e.instrument_mod));
auto results = db.QueryDatabase( auto results = db.QueryDatabase(
fmt::format( fmt::format(
@@ -578,6 +600,7 @@ public:
v.push_back(std::to_string(e.CasterLevel)); v.push_back(std::to_string(e.CasterLevel));
v.push_back(std::to_string(e.DurationFormula)); v.push_back(std::to_string(e.DurationFormula));
v.push_back(std::to_string(e.TicsRemaining)); v.push_back(std::to_string(e.TicsRemaining));
v.push_back(std::to_string(e.InitialDuration));
v.push_back(std::to_string(e.PoisonCounters)); v.push_back(std::to_string(e.PoisonCounters));
v.push_back(std::to_string(e.DiseaseCounters)); v.push_back(std::to_string(e.DiseaseCounters));
v.push_back(std::to_string(e.CurseCounters)); v.push_back(std::to_string(e.CurseCounters));
@@ -591,6 +614,7 @@ public:
v.push_back(std::to_string(e.caston_y)); v.push_back(std::to_string(e.caston_y));
v.push_back(std::to_string(e.caston_z)); v.push_back(std::to_string(e.caston_z));
v.push_back(std::to_string(e.ExtraDIChance)); v.push_back(std::to_string(e.ExtraDIChance));
v.push_back(std::to_string(e.instrument_mod));
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")"); insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
} }
@@ -39,7 +39,7 @@ public:
struct MercSpellListEntries { struct MercSpellListEntries {
uint32_t merc_spell_list_entry_id; uint32_t merc_spell_list_entry_id;
uint32_t merc_spell_list_id; uint32_t merc_spell_list_id;
uint32_t spell_id; int32_t spell_id;
uint32_t spell_type; uint32_t spell_type;
uint8_t stance_id; uint8_t stance_id;
uint8_t minlevel; uint8_t minlevel;
@@ -38,7 +38,7 @@ public:
struct NpcSpellsEntries { struct NpcSpellsEntries {
uint32_t id; uint32_t id;
int32_t npc_spells_id; int32_t npc_spells_id;
uint16_t spellid; int32_t spellid;
uint32_t type; uint32_t type;
uint8_t minlevel; uint8_t minlevel;
uint8_t maxlevel; uint8_t maxlevel;
@@ -194,7 +194,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0; e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.spellid = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spellid = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0; e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255; e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255;
@@ -373,7 +373,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0; e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.spellid = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spellid = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0; e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255; e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255;
@@ -413,7 +413,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0; e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.spellid = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0; e.spellid = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0; e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0; e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255; e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255;
@@ -31,8 +31,9 @@
#include "common/database.h" #include "common/database.h"
#include "common/strings.h" #include "common/strings.h"
#include "cereal/cereal.hpp"
#include <ctime> #include <ctime>
#include <cereal/cereal.hpp>
class BasePlayerEventLogSettingsRepository { class BasePlayerEventLogSettingsRepository {
public: public:
struct PlayerEventLogSettings { struct PlayerEventLogSettings {
@@ -31,8 +31,9 @@
#include "common/database.h" #include "common/database.h"
#include "common/strings.h" #include "common/strings.h"
#include "cereal/cereal.hpp"
#include <ctime> #include <ctime>
#include <cereal/cereal.hpp>
class BasePlayerEventLogsRepository { class BasePlayerEventLogsRepository {
public: public:
struct PlayerEventLogs { struct PlayerEventLogs {
@@ -49,6 +49,7 @@ public:
uint32_t augment_4_id; uint32_t augment_4_id;
uint32_t augment_5_id; uint32_t augment_5_id;
uint32_t augment_6_id; uint32_t augment_6_id;
time_t created_at;
}; };
static std::string PrimaryKey() static std::string PrimaryKey()
@@ -72,6 +73,7 @@ public:
"augment_4_id", "augment_4_id",
"augment_5_id", "augment_5_id",
"augment_6_id", "augment_6_id",
"created_at",
}; };
} }
@@ -91,6 +93,7 @@ public:
"augment_4_id", "augment_4_id",
"augment_5_id", "augment_5_id",
"augment_6_id", "augment_6_id",
"UNIX_TIMESTAMP(created_at)",
}; };
} }
@@ -144,6 +147,7 @@ public:
e.augment_4_id = 0; e.augment_4_id = 0;
e.augment_5_id = 0; e.augment_5_id = 0;
e.augment_6_id = 0; e.augment_6_id = 0;
e.created_at = 0;
return e; return e;
} }
@@ -193,6 +197,7 @@ public:
e.augment_4_id = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0; e.augment_4_id = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.augment_5_id = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0; e.augment_5_id = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
e.augment_6_id = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0; e.augment_6_id = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
e.created_at = strtoll(row[13] ? row[13] : "-1", nullptr, 10);
return e; return e;
} }
@@ -238,6 +243,7 @@ public:
v.push_back(columns[10] + " = " + std::to_string(e.augment_4_id)); v.push_back(columns[10] + " = " + std::to_string(e.augment_4_id));
v.push_back(columns[11] + " = " + std::to_string(e.augment_5_id)); v.push_back(columns[11] + " = " + std::to_string(e.augment_5_id));
v.push_back(columns[12] + " = " + std::to_string(e.augment_6_id)); v.push_back(columns[12] + " = " + std::to_string(e.augment_6_id));
v.push_back(columns[13] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
auto results = db.QueryDatabase( auto results = db.QueryDatabase(
fmt::format( fmt::format(
@@ -272,6 +278,7 @@ public:
v.push_back(std::to_string(e.augment_4_id)); v.push_back(std::to_string(e.augment_4_id));
v.push_back(std::to_string(e.augment_5_id)); v.push_back(std::to_string(e.augment_5_id));
v.push_back(std::to_string(e.augment_6_id)); v.push_back(std::to_string(e.augment_6_id));
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
auto results = db.QueryDatabase( auto results = db.QueryDatabase(
fmt::format( fmt::format(
@@ -314,6 +321,7 @@ public:
v.push_back(std::to_string(e.augment_4_id)); v.push_back(std::to_string(e.augment_4_id));
v.push_back(std::to_string(e.augment_5_id)); v.push_back(std::to_string(e.augment_5_id));
v.push_back(std::to_string(e.augment_6_id)); v.push_back(std::to_string(e.augment_6_id));
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")"); insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
} }
@@ -360,6 +368,7 @@ public:
e.augment_4_id = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0; e.augment_4_id = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.augment_5_id = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0; e.augment_5_id = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
e.augment_6_id = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0; e.augment_6_id = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
e.created_at = strtoll(row[13] ? row[13] : "-1", nullptr, 10);
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -397,6 +406,7 @@ public:
e.augment_4_id = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0; e.augment_4_id = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.augment_5_id = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0; e.augment_5_id = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
e.augment_6_id = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0; e.augment_6_id = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
e.created_at = strtoll(row[13] ? row[13] : "-1", nullptr, 10);
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -484,6 +494,7 @@ public:
v.push_back(std::to_string(e.augment_4_id)); v.push_back(std::to_string(e.augment_4_id));
v.push_back(std::to_string(e.augment_5_id)); v.push_back(std::to_string(e.augment_5_id));
v.push_back(std::to_string(e.augment_6_id)); v.push_back(std::to_string(e.augment_6_id));
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
auto results = db.QueryDatabase( auto results = db.QueryDatabase(
fmt::format( fmt::format(
@@ -519,6 +530,7 @@ public:
v.push_back(std::to_string(e.augment_4_id)); v.push_back(std::to_string(e.augment_4_id));
v.push_back(std::to_string(e.augment_5_id)); v.push_back(std::to_string(e.augment_5_id));
v.push_back(std::to_string(e.augment_6_id)); v.push_back(std::to_string(e.augment_6_id));
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")"); insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
} }
@@ -36,7 +36,7 @@
class BaseSpellBucketsRepository { class BaseSpellBucketsRepository {
public: public:
struct SpellBuckets { struct SpellBuckets {
uint32_t spell_id; int32_t spell_id;
std::string bucket_name; std::string bucket_name;
std::string bucket_value; std::string bucket_value;
uint8_t bucket_comparison; uint8_t bucket_comparison;
@@ -144,7 +144,7 @@ public:
if (results.RowCount() == 1) { if (results.RowCount() == 1) {
SpellBuckets e{}; SpellBuckets e{};
e.spell_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.spell_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.bucket_name = row[1] ? row[1] : ""; e.bucket_name = row[1] ? row[1] : "";
e.bucket_value = row[2] ? row[2] : ""; e.bucket_value = row[2] ? row[2] : "";
e.bucket_comparison = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0; e.bucket_comparison = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
@@ -276,7 +276,7 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
SpellBuckets e{}; SpellBuckets e{};
e.spell_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.spell_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.bucket_name = row[1] ? row[1] : ""; e.bucket_name = row[1] ? row[1] : "";
e.bucket_value = row[2] ? row[2] : ""; e.bucket_value = row[2] ? row[2] : "";
e.bucket_comparison = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0; e.bucket_comparison = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
@@ -304,7 +304,7 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
SpellBuckets e{}; SpellBuckets e{};
e.spell_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0; e.spell_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.bucket_name = row[1] ? row[1] : ""; e.bucket_name = row[1] ? row[1] : "";
e.bucket_value = row[2] ? row[2] : ""; e.bucket_value = row[2] ? row[2] : "";
e.bucket_comparison = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0; e.bucket_comparison = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
@@ -128,7 +128,7 @@ public:
int32_t fast_regen_mana; int32_t fast_regen_mana;
int32_t fast_regen_endurance; int32_t fast_regen_endurance;
int32_t npc_max_aggro_dist; int32_t npc_max_aggro_dist;
uint32_t client_update_range; int32_t client_update_range;
int32_t underworld_teleport_index; int32_t underworld_teleport_index;
int32_t lava_damage; int32_t lava_damage;
int32_t min_lava_damage; int32_t min_lava_damage;
@@ -616,7 +616,7 @@ public:
e.fast_regen_mana = row[89] ? static_cast<int32_t>(atoi(row[89])) : 180; e.fast_regen_mana = row[89] ? static_cast<int32_t>(atoi(row[89])) : 180;
e.fast_regen_endurance = row[90] ? static_cast<int32_t>(atoi(row[90])) : 180; e.fast_regen_endurance = row[90] ? static_cast<int32_t>(atoi(row[90])) : 180;
e.npc_max_aggro_dist = row[91] ? static_cast<int32_t>(atoi(row[91])) : 600; e.npc_max_aggro_dist = row[91] ? static_cast<int32_t>(atoi(row[91])) : 600;
e.client_update_range = row[92] ? static_cast<uint32_t>(strtoul(row[92], nullptr, 10)) : 600; e.client_update_range = row[92] ? static_cast<int32_t>(atoi(row[92])) : 600;
e.underworld_teleport_index = row[93] ? static_cast<int32_t>(atoi(row[93])) : 0; e.underworld_teleport_index = row[93] ? static_cast<int32_t>(atoi(row[93])) : 0;
e.lava_damage = row[94] ? static_cast<int32_t>(atoi(row[94])) : 50; e.lava_damage = row[94] ? static_cast<int32_t>(atoi(row[94])) : 50;
e.min_lava_damage = row[95] ? static_cast<int32_t>(atoi(row[95])) : 10; e.min_lava_damage = row[95] ? static_cast<int32_t>(atoi(row[95])) : 10;
@@ -1127,7 +1127,7 @@ public:
e.fast_regen_mana = row[89] ? static_cast<int32_t>(atoi(row[89])) : 180; e.fast_regen_mana = row[89] ? static_cast<int32_t>(atoi(row[89])) : 180;
e.fast_regen_endurance = row[90] ? static_cast<int32_t>(atoi(row[90])) : 180; e.fast_regen_endurance = row[90] ? static_cast<int32_t>(atoi(row[90])) : 180;
e.npc_max_aggro_dist = row[91] ? static_cast<int32_t>(atoi(row[91])) : 600; e.npc_max_aggro_dist = row[91] ? static_cast<int32_t>(atoi(row[91])) : 600;
e.client_update_range = row[92] ? static_cast<uint32_t>(strtoul(row[92], nullptr, 10)) : 600; e.client_update_range = row[92] ? static_cast<int32_t>(atoi(row[92])) : 600;
e.underworld_teleport_index = row[93] ? static_cast<int32_t>(atoi(row[93])) : 0; e.underworld_teleport_index = row[93] ? static_cast<int32_t>(atoi(row[93])) : 0;
e.lava_damage = row[94] ? static_cast<int32_t>(atoi(row[94])) : 50; e.lava_damage = row[94] ? static_cast<int32_t>(atoi(row[94])) : 50;
e.min_lava_damage = row[95] ? static_cast<int32_t>(atoi(row[95])) : 10; e.min_lava_damage = row[95] ? static_cast<int32_t>(atoi(row[95])) : 10;
@@ -1250,7 +1250,7 @@ public:
e.fast_regen_mana = row[89] ? static_cast<int32_t>(atoi(row[89])) : 180; e.fast_regen_mana = row[89] ? static_cast<int32_t>(atoi(row[89])) : 180;
e.fast_regen_endurance = row[90] ? static_cast<int32_t>(atoi(row[90])) : 180; e.fast_regen_endurance = row[90] ? static_cast<int32_t>(atoi(row[90])) : 180;
e.npc_max_aggro_dist = row[91] ? static_cast<int32_t>(atoi(row[91])) : 600; e.npc_max_aggro_dist = row[91] ? static_cast<int32_t>(atoi(row[91])) : 600;
e.client_update_range = row[92] ? static_cast<uint32_t>(strtoul(row[92], nullptr, 10)) : 600; e.client_update_range = row[92] ? static_cast<int32_t>(atoi(row[92])) : 600;
e.underworld_teleport_index = row[93] ? static_cast<int32_t>(atoi(row[93])) : 0; e.underworld_teleport_index = row[93] ? static_cast<int32_t>(atoi(row[93])) : 0;
e.lava_damage = row[94] ? static_cast<int32_t>(atoi(row[94])) : 50; e.lava_damage = row[94] ? static_cast<int32_t>(atoi(row[94])) : 50;
e.min_lava_damage = row[95] ? static_cast<int32_t>(atoi(row[95])) : 10; e.min_lava_damage = row[95] ? static_cast<int32_t>(atoi(row[95])) : 10;
@@ -1,3 +1,20 @@
/* EQEmu: EQEmulator
Copyright (C) 2001-2026 EQEmu Development Team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** /**
* DO NOT MODIFY THIS FILE * DO NOT MODIFY THIS FILE
* *
+2 -1
View File
@@ -350,11 +350,12 @@ RULE_STRING(World, MOTD, "", "Server MOTD sent on login, change from empty to ha
RULE_STRING(World, Rules, "", "Server Rules, change from empty to have this be used instead of variables table 'rules' value, lines are pipe (|) separated, example: A|B|C") RULE_STRING(World, Rules, "", "Server Rules, change from empty to have this be used instead of variables table 'rules' value, lines are pipe (|) separated, example: A|B|C")
RULE_BOOL(World, EnableAutoLogin, false, "Enables or disables auto login of characters, allowing people to log characters in directly from loginserver to ingame") RULE_BOOL(World, EnableAutoLogin, false, "Enables or disables auto login of characters, allowing people to log characters in directly from loginserver to ingame")
RULE_BOOL(World, EnablePVPRegions, true, "Enables or disables PVP Regions automatically setting your PVP flag") RULE_BOOL(World, EnablePVPRegions, true, "Enables or disables PVP Regions automatically setting your PVP flag")
RULE_STRING(World, SupportedClients, "RoF2", "Comma-delimited list of clients to restrict to. Supported values are Titanium | SoF | SoD | UF | RoF | RoF2. Example: Titanium,RoF2") RULE_STRING(World, SupportedClients, "RoF2,TOB", "Comma-delimited list of clients to restrict to. Supported values are Titanium | SoF | SoD | UF | RoF | RoF2 | TOB. Example: Titanium,RoF2,TOB")
RULE_STRING(World, CustomFilesKey, "", "Enable if the server requires custom files and sends a key to validate. Empty string to disable. Example: eqcustom_v1") RULE_STRING(World, CustomFilesKey, "", "Enable if the server requires custom files and sends a key to validate. Empty string to disable. Example: eqcustom_v1")
RULE_STRING(World, CustomFilesUrl, "github.com/knervous/eqnexus/releases", "URL to display at character select if client is missing custom files") RULE_STRING(World, CustomFilesUrl, "github.com/knervous/eqnexus/releases", "URL to display at character select if client is missing custom files")
RULE_INT(World, CustomFilesAdminLevel, 20, "Admin level at which custom file key is not required when CustomFilesKey is specified") RULE_INT(World, CustomFilesAdminLevel, 20, "Admin level at which custom file key is not required when CustomFilesKey is specified")
RULE_BOOL(World, RealTimeCalculateGuilds, false, "(Temp feature flag) If true, guilds will be calculated in real time instead of at zone boot. This is a performance hit but allows for more dynamic guilds.") RULE_BOOL(World, RealTimeCalculateGuilds, false, "(Temp feature flag) If true, guilds will be calculated in real time instead of at zone boot. This is a performance hit but allows for more dynamic guilds.")
RULE_INT(World, Id, 100, "Used by later clients to create GUIDs, expected to be Unique to the world but ultimately not that important")
RULE_CATEGORY_END() RULE_CATEGORY_END()
RULE_CATEGORY(Zone) RULE_CATEGORY(Zone)
+2 -2
View File
@@ -1425,7 +1425,7 @@ struct CZSpell_Struct {
uint8 update_type; // 0 - Character, 1 - Group, 2 - Raid, 3 - Guild, 4 - Expedition, 5 - Character Name uint8 update_type; // 0 - Character, 1 - Group, 2 - Raid, 3 - Guild, 4 - Expedition, 5 - Character Name
uint8 update_subtype; // 0 - Cast Spell, 1 - Remove Spell uint8 update_subtype; // 0 - Cast Spell, 1 - Remove Spell
int update_identifier; // Character ID, Group ID, Raid ID, Guild ID, or Expedition ID based on update type, 0 for Character Name int update_identifier; // Character ID, Group ID, Raid ID, Guild ID, or Expedition ID based on update type, 0 for Character Name
uint32 spell_id; int32 spell_id;
char client_name[64]; // Only used by Character Name Type, else empty char client_name[64]; // Only used by Character Name Type, else empty
}; };
@@ -1498,7 +1498,7 @@ struct WWSignal_Struct {
struct WWSpell_Struct { struct WWSpell_Struct {
uint8 update_type; // 0 - Cast Spell, 1 - Remove Spell uint8 update_type; // 0 - Cast Spell, 1 - Remove Spell
uint32 spell_id; int32 spell_id;
uint8 min_status; uint8 min_status;
uint8 max_status; uint8 max_status;
}; };

Some files were not shown because too many files have changed in this diff Show More