Compare commits

...

44 Commits

Author SHA1 Message Date
Kinglykrab 35aaf05173 Update mob.cpp 2025-08-30 16:59:01 -04:00
Kinglykrab 8746c1845d Consolidate 2025-08-30 16:56:38 -04:00
Kinglykrab 0ae1a2883d Update database_update_manifest_bots.cpp 2025-08-30 16:41:16 -04:00
Kinglykrab 36f8c3a89f Push 2025-08-30 16:41:16 -04:00
Kinglykrab aba58172f4 [Feature] Add Bot/Client Specific Stat Caps 2025-08-30 16:41:16 -04:00
Alex King 1eb89edbbd [Repositories] Convert Item Loading to Repositories (#4998) 2025-08-30 16:39:23 -04:00
Alex King e015d0d67e [Repositories] Convert Damage Shield Types to Repositories (#4995)
* [Repositories] Convert Damage Shield Types to Repositories

* Remove max spell ID
2025-08-30 16:23:33 -04:00
Alex King ba78394ce9 [Repositories] Convert Spell Loading to Repositories (#4996) 2025-08-30 15:42:04 -04:00
Alex King 060f6e377d [Constants] Convert SE Defines to SpellEffect Namespace (#4999) 2025-08-30 15:33:19 -04:00
Alex King 92c8b0e585 [Constants] Change Race Changes to Race Namespace (#5000) 2025-08-30 15:33:11 -04:00
Alex King 33df8ea665 [Repositories] Convert Character Inspect Messages to Repositories (#4997) 2025-08-30 14:42:40 -04:00
Alex King 9668074d94 [Bug Fix] Fix Recipe Inspect Bug (#4994) 2025-08-30 13:56:14 -04:00
Alex King 822a5dcac4 [Cleanup] Cleanup #show ip_lookup Message (#5005)
* [Cleanup] Cleanup #show ip_lookup Message

* Test

* Update clientlist.cpp
2025-08-30 13:05:18 -04:00
Alex King 0c65a4febe [Cleanup] Fix #set race 0 Message (#5004) 2025-08-29 20:08:03 -04:00
Alex King 02f66de679 [Cleanup] Remove Unused errorname Variable (#5001) 2025-08-29 12:02:11 -04:00
Alex King 145111f11e [Bug Fix] Fix Task Reloading (#5002) 2025-08-29 06:52:51 -04:00
Alex King a4e47d9180 [Pets] Add Pet Constants and Methods (#4987)
* [Pets] Add Pet Constants and Methods

* Remove GetID

* GetPetTypeName()

* Cleanup
2025-08-17 01:00:31 -04:00
Alex King 207ee2daa0 [Database] Add heal_amount to character_stats_record (#4986)
* [Database] Add heal_amount to character_stats_record

* Update version.h
2025-08-16 21:35:55 -04:00
Alex King 1fe5d9fa4f [Commands] Add #task complete Saylink to #task show (#4985) 2025-08-16 21:35:38 -04:00
Alex King ed3f6c2a40 [Cleanup] Fix Issues with Strings::Commify and Mob::SendStatsWindow (#4984) 2025-08-16 21:35:13 -04:00
Alex King adb3196ca5 [Cleanup] Add #npcedit npc_tint_id Help Message (#4982)
* [Cleanup] Add #npcedit npc_tint_id Help Message

* Update npcedit.cpp

* Update npcedit.cpp
2025-08-16 21:34:55 -04:00
Alex King e13b133ac8 [Quest API] Add GetNPCTintIndex() to Perl/Lua (#4983) 2025-08-16 21:34:39 -04:00
Alex King d475428157 [Quest API] Add GetKeyRing() to Perl/Lua (#4980) 2025-08-16 21:34:28 -04:00
Alex King 00b66ce432 [Commands] Add #find account Subcommand (#4981)
Credit goes to https://github.com/The-Heroes-Journey-EQEMU/Server/pull/281
2025-08-16 21:34:16 -04:00
Alex 4d12dd5c43 [Code] Remove Attributions (#4988) 2025-08-15 23:36:35 -05:00
regneq c4f408bffc [Bug Fix] Fix Race 474 for Titanium (#4979) 2025-08-11 16:49:59 -04:00
Alex King d876c6df2a [Bug Fix] Fix #show recipe uint16 Cap (#4978) 2025-08-11 14:06:13 -04:00
Alex King d142e1ca81 [Hotfix] Fix Quest Ownership Edge Case (#4977)
* [Hotfix] Fix Quest Ownership Edge Case

* Push
2025-08-02 22:09:30 -05:00
Chris Miles d9f4d49ef4 [Release] 23.9.0 (#4976) 2025-08-02 20:11:29 -05:00
Alex King 0a1df5bbb6 [Quest API] Add GetTimers() and GetPausedTimers() to Perl/Lua (#4965)
* [Quest API] Add GetTimers() and GetPausedTimers() to Perl/Lua

* Push
2025-08-02 19:17:56 -05:00
dependabot[bot] 41f3d7ff31 Bump golang.org/x/oauth2 in /utils/scripts/build/should-release (#4967)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.0.0-20180821212333-d2e6202438be to 0.27.0.
- [Commits](https://github.com/golang/oauth2/commits/v0.27.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-version: 0.27.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-02 19:16:57 -05:00
solar 0afef19d26 [Loginserver] Fix Legacy World When Using Local DB (#4970)
Co-authored-by: solar <solar@heliacal.net>
2025-08-02 19:16:35 -05:00
Alex King e9be2d76c3 [Commands] Add #show keyring Subcommand (#4973) 2025-08-02 19:15:44 -05:00
solar ffa813b92c [Build] Fix Linking with GCC (#4969)
Co-authored-by: solar <solar@heliacal.net>
2025-08-02 19:15:11 -05:00
solar 909de47acd fix player movement deltas (jumping, turning) (#4975)
Co-authored-by: solar <solar@heliacal.net>
2025-08-02 10:32:30 -04:00
regneq 73a5f11e17 [Bug Fix] [Bug Fix] Show player count on the server list status. (#4971) 2025-07-30 19:39:55 -04:00
Alex King 9544e100c3 [Bug Fix] Fix Hero's Forge Ingame and Character Select (#4966) 2025-07-30 19:39:29 -04:00
Chris Miles f3232cdc3a [Database] Add Indexes to NPC's Spawns Loot (#4972) 2025-07-30 09:37:23 -04:00
Bemvaras b8884d6572 [Quest API] Add GetMemberRole() to Perl/Lua (#4963)
* Add group member role retrieval

* Expose group member role to Lua

* Cleanup

* Cleanup

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
2025-07-10 15:09:04 -04:00
Alex King 323a0c0b27 [Feature] Zone Scripting (#4908)
* [Feature] Add Zone Scripting Capabilities

* Push

* Update zone.cpp

* Fix crashes

* Lua

* Add other events, finish Lua

* Add EVENT_ENTER_ZONE

* Final

* Push

* Push

* [Feature] Add Zone Scripting Capabilities

* Push

* Update zone.cpp

* Fix crashes

* Add EVENT_ENTER_ZONE

* Remove duplicates

* Update embparser.cpp
2025-07-10 15:08:08 -04:00
regneq ab45d4358d [Bug Fix] Add a missing Froglok starting area for Titanium Startzone. (#4962)
* Add a missing Froglok starting area for Titanium Startzone.

* fix formatting.

* add a missing break.
2025-07-04 12:53:45 -04:00
nytmyr f7775c7a75 [Bots] Fix FinishBuffing rule (#4961) 2025-06-30 19:54:04 -05:00
Chris Miles 659a960401 [Performance] Clear Wearchange Deduplication Cache (#4960)
* [Performance] Clear Wearchange Deduplication Cache

* Move timers to process loops
2025-06-30 13:57:43 -05:00
Chris Miles 07d484597d [Build] More Build Speed Improvements (#4959) 2025-06-30 13:09:23 -05:00
150 changed files with 12246 additions and 8626 deletions
+49
View File
@@ -1,3 +1,52 @@
## [23.9.1] 8/2/2025
### Hotfix
* Fix Quest Ownership Edge Case ([#4977](https://github.com/EQEmu/Server/pull/4977)) @Kinglykrab 2025-08-02
## [23.9.0] 8/2/2025
### Bots
* Fix FinishBuffing rule ([#4961](https://github.com/EQEmu/Server/pull/4961)) @nytmyr 2025-07-01
* Fix ^cast resurrects ([#4958](https://github.com/EQEmu/Server/pull/4958)) @nytmyr 2025-06-29
### Build
* Fix Linking with GCC ([#4969](https://github.com/EQEmu/Server/pull/4969)) @solar984 2025-08-03
* More Build Speed Improvements ([#4959](https://github.com/EQEmu/Server/pull/4959)) @Akkadius 2025-06-30
### Commands
* Add #show keyring Subcommand ([#4973](https://github.com/EQEmu/Server/pull/4973)) @Kinglykrab 2025-08-03
### Database
* Add Indexes to NPC's Spawns Loot ([#4972](https://github.com/EQEmu/Server/pull/4972)) @Akkadius 2025-07-30
### Feature
* Zone Scripting ([#4908](https://github.com/EQEmu/Server/pull/4908)) @Kinglykrab 2025-07-10
### Fixes
* Add a missing Froglok starting area for Titanium Startzone. ([#4962](https://github.com/EQEmu/Server/pull/4962)) @regneq 2025-07-04
* Fix Hero's Forge Ingame and Character Select ([#4966](https://github.com/EQEmu/Server/pull/4966)) @Kinglykrab 2025-07-30
* Show player count on the server list status. ([#4971](https://github.com/EQEmu/Server/pull/4971)) @regneq 2025-07-30
### Loginserver
* Fix Legacy World When Using Local DB ([#4970](https://github.com/EQEmu/Server/pull/4970)) @solar984 2025-08-03
### Performance
* Clear Wearchange Deduplication Cache ([#4960](https://github.com/EQEmu/Server/pull/4960)) @Akkadius 2025-06-30
### Quest API
* Add GetMemberRole() to Perl/Lua ([#4963](https://github.com/EQEmu/Server/pull/4963)) @Barathos 2025-07-10
* Add GetTimers() and GetPausedTimers() to Perl/Lua ([#4965](https://github.com/EQEmu/Server/pull/4965)) @Kinglykrab 2025-08-03
## [23.8.1] 6/28/2025 ## [23.8.1] 6/28/2025
### Crash Fix ### Crash Fix
+2
View File
@@ -363,6 +363,8 @@ MESSAGE(STATUS "**************************************************")
#setup server libs and headers #setup server libs and headers
SET(SERVER_LIBS common ${DATABASE_LIBRARY_LIBS} ${ZLIB_LIBRARY_LIBS} ${Boost_LIBRARIES} uv_a fmt RecastNavigation::Detour) SET(SERVER_LIBS common ${DATABASE_LIBRARY_LIBS} ${ZLIB_LIBRARY_LIBS} ${Boost_LIBRARIES} uv_a fmt RecastNavigation::Detour)
set(FMT_HEADER_ONLY OFF)
INCLUDE_DIRECTORIES(SYSTEM "${DATABASE_LIBRARY_INCLUDE}") INCLUDE_DIRECTORIES(SYSTEM "${DATABASE_LIBRARY_INCLUDE}")
INCLUDE_DIRECTORIES(SYSTEM "${ZLIB_LIBRARY_INCLUDE}") INCLUDE_DIRECTORIES(SYSTEM "${ZLIB_LIBRARY_INCLUDE}")
INCLUDE_DIRECTORIES(SYSTEM "${Boost_INCLUDE_DIRS}") INCLUDE_DIRECTORIES(SYSTEM "${Boost_INCLUDE_DIRS}")
+9 -10
View File
@@ -104,9 +104,9 @@ SET(common_sources
net/console_server.cpp net/console_server.cpp
net/console_server_connection.cpp net/console_server_connection.cpp
net/crc32.cpp net/crc32.cpp
net/daybreak_connection.cpp
net/eqstream.cpp net/eqstream.cpp
net/packet.cpp net/packet.cpp
net/reliable_stream_connection.cpp
net/servertalk_client_connection.cpp net/servertalk_client_connection.cpp
net/servertalk_legacy_client_connection.cpp net/servertalk_legacy_client_connection.cpp
net/servertalk_server.cpp net/servertalk_server.cpp
@@ -603,7 +603,6 @@ SET(common_headers
ipc_mutex.h ipc_mutex.h
ip_util.h ip_util.h
item_data.h item_data.h
item_fieldlist.h
item_instance.h item_instance.h
json_config.h json_config.h
light_source.h light_source.h
@@ -671,13 +670,13 @@ SET(common_headers
net/console_server.h net/console_server.h
net/console_server_connection.h net/console_server_connection.h
net/crc32.h net/crc32.h
net/daybreak_connection.h
net/daybreak_pooling.h
net/daybreak_structs.h
net/dns.h net/dns.h
net/endian.h net/endian.h
net/eqstream.h net/eqstream.h
net/packet.h net/packet.h
net/reliable_stream_connection.h
net/reliable_stream_pooling.h
net/reliable_stream_structs.h
net/servertalk_client_connection.h net/servertalk_client_connection.h
net/servertalk_legacy_client_connection.h net/servertalk_legacy_client_connection.h
net/servertalk_common.h net/servertalk_common.h
@@ -743,10 +742,6 @@ SOURCE_GROUP(Net FILES
net/console_server_connection.h net/console_server_connection.h
net/crc32.cpp net/crc32.cpp
net/crc32.h net/crc32.h
net/daybreak_connection.cpp
net/daybreak_connection.h
net/daybreak_pooling.h
net/daybreak_structs.h
net/dns.h net/dns.h
net/endian.h net/endian.h
net/eqmq.cpp net/eqmq.cpp
@@ -755,6 +750,10 @@ SOURCE_GROUP(Net FILES
net/eqstream.h net/eqstream.h
net/packet.cpp net/packet.cpp
net/packet.h net/packet.h
net/reliable_stream_connection.cpp
net/reliable_stream_connection.h
net/reliable_stream_pooling.h
net/reliable_stream_structs.h
net/servertalk_client_connection.cpp net/servertalk_client_connection.cpp
net/servertalk_client_connection.h net/servertalk_client_connection.h
net/servertalk_legacy_client_connection.cpp net/servertalk_legacy_client_connection.cpp
@@ -841,7 +840,7 @@ IF (UNIX)
SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/uf.cpp" PROPERTIES COMPILE_FLAGS -O0) SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/uf.cpp" PROPERTIES COMPILE_FLAGS -O0)
ENDIF (UNIX) ENDIF (UNIX)
IF (WIN32 AND EQEMU_BUILD_PCH) IF (EQEMU_BUILD_PCH)
TARGET_PRECOMPILE_HEADERS(common PRIVATE pch/std-pch.h) TARGET_PRECOMPILE_HEADERS(common PRIVATE pch/std-pch.h)
ENDIF () ENDIF ()
@@ -7136,6 +7136,76 @@ ADD COLUMN `entity_variables` TEXT DEFAULT NULL AFTER `rezzable`;
)", )",
.content_schema_update = false .content_schema_update = false
}, },
ManifestEntry{
.version = 9326,
.description = "2025_07_27_add_indexes_npc_spawns_loot.sql",
.check = "SHOW INDEX FROM npc_types",
.condition = "missing",
.match = "idx_npc_types_loottable_id",
.sql = R"(
ALTER TABLE npc_types
ADD INDEX idx_npc_types_loottable_id (loottable_id);
ALTER TABLE spawnentry
ADD INDEX idx_spawnentry_spawngroup_id (spawngroupID),
ADD INDEX idx_spawnentry_npc_id (npcID);
ALTER TABLE lootdrop_entries
ADD INDEX idx_lootdrop_entries_lootdrop_id (lootdrop_id),
ADD INDEX idx_lootdrop_entries_item_id (item_id);
ALTER TABLE loottable_entries
ADD INDEX idx_loottable_entries_lootdrop_id (lootdrop_id),
ADD INDEX idx_loottable_entries_loottable_id (loottable_id);
)",
.content_schema_update = true
},
ManifestEntry{
.version = 9327,
.description = "2025_08_13_character_stats_record_heal_amount.sql",
.check = "SHOW COLUMNS FROM `character_stats_record` LIKE 'heal_amount'",
.condition = "empty",
.match = "",
.sql = R"(
ALTER TABLE `character_stats_record`
ADD COLUMN `heal_amount` int(11) NULL DEFAULT 0 AFTER `spell_damage`;
)"
},
ManifestEntry{
.version = 9328,
.description = "2025_08_27_spells_new_column_names.sql",
.check = "SHOW COLUMNS FROM `spells_new` LIKE 'feedbackable'",
.condition = "empty",
.match = "",
.sql = R"(
ALTER TABLE `spells_new`
CHANGE COLUMN `field160` `feedbackable` int(11) NOT NULL DEFAULT 0 AFTER `npc_no_los`,
CHANGE COLUMN `field198` `no_detrimental_spell_aggro` int(11) NOT NULL DEFAULT 0 AFTER `not_extendable`,
CHANGE COLUMN `field209` `no_resist` int(11) NULL DEFAULT 0 AFTER `rank`,
CHANGE COLUMN `field217` `override_crit_chance` int(11) NULL DEFAULT 0 AFTER `field216`,
CHANGE COLUMN `field220` `no_heal_damage_item_mod` int(11) NULL DEFAULT 0 AFTER `maxtargets`,
CHANGE COLUMN `field221` `caster_requirement_id` int(11) NULL DEFAULT 0 AFTER `no_heal_damage_item_mod`,
CHANGE COLUMN `field222` `spell_class` int(11) NULL DEFAULT 0 AFTER `caster_requirement_id`,
CHANGE COLUMN `field223` `spell_subclass` int(11) NULL DEFAULT 0 AFTER `spell_class`,
CHANGE COLUMN `field232` `no_remove` int(11) NOT NULL DEFAULT 0 AFTER `min_range`;
)"
},
ManifestEntry{
.version = 9329,
.description = "2025_08_20_character_stat_caps.sql",
.check = "SHOW TABLES LIKE 'character_stat_caps'",
.condition = "empty",
.match = "",
.sql = R"(
CREATE TABLE `character_stat_caps` (
`character_id` int(11) UNSIGNED NOT NULL,
`stat_id` tinyint(3) UNSIGNED NULL,
`stat_cap` int(11) NOT NULL DEFAULT -1,
PRIMARY KEY (`character_id`, `stat_id`)
)
)"
}
// -- 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,
@@ -2122,7 +2122,22 @@ WHERE NOT EXISTS
FROM spells_new FROM spells_new
WHERE bot_spells_entries.spell_id = spells_new.id); WHERE bot_spells_entries.spell_id = spells_new.id);
)", )",
} },
ManifestEntry{
.version = 9055,
.description = "08_20_2025_bot_stat_caps.sql",
.check = "SHOW TABLES LIKE 'bot_stat_caps'",
.condition = "empty",
.match = "",
.sql = R"(
CREATE TABLE `bot_stat_caps` (
`bot_id` int(11) UNSIGNED NOT NULL,
`stat_id` tinyint(3) UNSIGNED NULL,
`stat_cap` int(11) NOT NULL DEFAULT -1,
PRIMARY KEY (`bot_id`, `stat_id`)
)
)"
},
// -- 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,
+3
View File
@@ -69,6 +69,7 @@ namespace DatabaseSchema {
{"character_potionbelt", "id"}, {"character_potionbelt", "id"},
{"character_skills", "id"}, {"character_skills", "id"},
{"character_spells", "id"}, {"character_spells", "id"},
{"character_stat_caps", "character_id"},
{"character_stats_record", "character_id"}, {"character_stats_record", "character_id"},
{"character_task_timers", "character_id"}, {"character_task_timers", "character_id"},
{"character_tasks", "charid"}, {"character_tasks", "charid"},
@@ -144,6 +145,7 @@ namespace DatabaseSchema {
"character_potionbelt", "character_potionbelt",
"character_skills", "character_skills",
"character_spells", "character_spells",
"character_stat_caps",
"character_stats_record", "character_stats_record",
"character_task_timers", "character_task_timers",
"character_tasks", "character_tasks",
@@ -412,6 +414,7 @@ namespace DatabaseSchema {
"bot_spell_settings", "bot_spell_settings",
"bot_spells_entries", "bot_spells_entries",
"bot_stances", "bot_stances",
"bot_stat_caps",
"bot_timers" "bot_timers"
}; };
} }
+30
View File
@@ -451,3 +451,33 @@ bool LDoNTheme::IsValid(uint32 theme_id)
{ {
return ldon_theme_names.find(theme_id) != ldon_theme_names.end(); return ldon_theme_names.find(theme_id) != ldon_theme_names.end();
} }
std::string PetCommand::GetName(uint8 pet_command)
{
return IsValid(pet_command) ? pet_commands[pet_command] : "UNKNOWN PET COMMAND";
}
bool PetCommand::IsValid(uint8 pet_command)
{
return pet_commands.find(pet_command) != pet_commands.end();
}
std::string PetType::GetName(uint8 pet_type)
{
return IsValid(pet_type) ? pet_types[pet_type] : "UNKNOWN PET TYPE";
}
bool PetType::IsValid(uint8 pet_type)
{
return pet_types.find(pet_type) != pet_types.end();
}
std::string StatCap::GetName(uint8 stat_id)
{
return IsValid(stat_id) ? stat_caps[stat_id] : "UNKNOWN STAT CAP";
}
bool StatCap::IsValid(uint8 stat_id)
{
return stat_caps.find(stat_id) != stat_caps.end();
}
+180
View File
@@ -792,4 +792,184 @@ namespace BookType {
constexpr uint8 ItemInfo = 2; constexpr uint8 ItemInfo = 2;
} }
namespace PetButton {
constexpr uint8 Sit = 0;
constexpr uint8 Stop = 1;
constexpr uint8 Regroup = 2;
constexpr uint8 Follow = 3;
constexpr uint8 Guard = 4;
constexpr uint8 Taunt = 5;
constexpr uint8 Hold = 6;
constexpr uint8 GreaterHold = 7;
constexpr uint8 Focus = 8;
constexpr uint8 SpellHold = 9;
}
namespace PetButtonState {
constexpr uint8 Off = 0;
constexpr uint8 On = 1;
}
namespace PetCommand {
constexpr uint8 HealthReport = 0; // /pet health or Pet Window
constexpr uint8 Leader = 1; // /pet leader or Pet Window
constexpr uint8 Attack = 2; // /pet attack or Pet Window
constexpr uint8 QAttack = 3; // /pet qattack or Pet Window
constexpr uint8 FollowMe = 4; // /pet follow or Pet Window
constexpr uint8 GuardHere = 5; // /pet guard or Pet Window
constexpr uint8 Sit = 6; // /pet sit or Pet Window
constexpr uint8 SitDown = 7; // /pet sit on
constexpr uint8 StandUp = 8; // /pet sit off
constexpr uint8 Stop = 9; // /pet stop or Pet Window - Not implemented
constexpr uint8 StopOn = 10; // /pet stop on - Not implemented
constexpr uint8 StopOff = 11; // /pet stop off - Not implemented
constexpr uint8 Taunt = 12; // /pet taunt or Pet Window
constexpr uint8 TauntOn = 13; // /pet taunt on
constexpr uint8 TauntOff = 14; // /pet taunt off
constexpr uint8 Hold = 15; // /pet hold or Pet Window, won't add to hate list unless attacking
constexpr uint8 HoldOn = 16; // /pet hold on
constexpr uint8 HoldOff = 17; // /pet hold off
constexpr uint8 GreaterHold = 18; // /pet ghold, will never add to hate list unless told to
constexpr uint8 GreaterHoldOn = 19; // /pet ghold on
constexpr uint8 GreaterHoldOff = 20; // /pet ghold off
constexpr uint8 SpellHold = 21; // /pet no cast or /pet spellhold or Pet Window
constexpr uint8 SpellHoldOn = 22; // /pet spellhold on
constexpr uint8 SpellHoldOff = 23; // /pet spellhold off
constexpr uint8 Focus = 24; // /pet focus or Pet Window
constexpr uint8 FocusOn = 25; // /pet focus on
constexpr uint8 FocusOff = 26; // /pet focus off
constexpr uint8 Feign = 27; // /pet feign
constexpr uint8 BackOff = 28; // /pet back off
constexpr uint8 GetLost = 29; // /pet get lost
constexpr uint8 GuardMe = 30; // Same as /pet follow, but different message in older clients
constexpr uint8 Regroup = 31; // /pet regroup, acts like classic hold
constexpr uint8 RegroupOn = 32; // /pet regroup on
constexpr uint8 RegroupOff = 33; // /pet regroup off
constexpr uint8 Max = 34;
static std::map<uint8, std::string> pet_commands = {
{ PetCommand::HealthReport, "Health Report" },
{ PetCommand::Leader, "Leader" },
{ PetCommand::Attack, "Attack" },
{ PetCommand::QAttack, "QAttack" },
{ PetCommand::FollowMe, "Follow Me" },
{ PetCommand::GuardHere, "Guard Here" },
{ PetCommand::Sit, "Sit" },
{ PetCommand::SitDown, "Sit Down" },
{ PetCommand::StandUp, "Stand Up" },
{ PetCommand::Stop, "Stop" },
{ PetCommand::StopOn, "Stop On" },
{ PetCommand::StopOff, "Stop Off" },
{ PetCommand::Taunt, "Taunt" },
{ PetCommand::TauntOn, "Taunt On" },
{ PetCommand::TauntOff, "Taunt Off" },
{ PetCommand::Hold, "Hold" },
{ PetCommand::HoldOn, "Hold On" },
{ PetCommand::HoldOff, "Hold Off" },
{ PetCommand::GreaterHold, "Greater Hold" },
{ PetCommand::GreaterHoldOn, "Greater Hold On" },
{ PetCommand::GreaterHoldOff, "Greater Hold Off" },
{ PetCommand::SpellHold, "Spell Hold" },
{ PetCommand::SpellHoldOn, "Spell Hold On" },
{ PetCommand::SpellHoldOff, "Spell Hold Off" },
{ PetCommand::Focus, "Focus" },
{ PetCommand::FocusOn, "Focus On" },
{ PetCommand::FocusOff, "Focus Off" },
{ PetCommand::Feign, "Feign" },
{ PetCommand::BackOff, "Back Off" },
{ PetCommand::GetLost, "Get Lost" },
{ PetCommand::GuardMe, "Guard Me" },
{ PetCommand::Regroup, "Regroup" },
{ PetCommand::RegroupOn, "Regroup On" },
{ PetCommand::RegroupOff, "Regroup Off" },
{ PetCommand::Max, "Max" }
};
std::string GetName(uint8 pet_command);
bool IsValid(uint8 pet_command);
}
namespace PetOrder {
constexpr uint8 Follow = 0;
constexpr uint8 Sit = 1;
constexpr uint8 Guard = 2;
constexpr uint8 Feign = 3;
}
namespace PetType {
constexpr uint8 Familiar = 0;
constexpr uint8 Animation = 1;
constexpr uint8 Normal = 2;
constexpr uint8 Charmed = 3;
constexpr uint8 Follow = 4;
constexpr uint8 TargetLock = 5;
constexpr uint8 None = 255;
static std::map<uint8, std::string> pet_types = {
{ PetType::Familiar, "Familiar" },
{ PetType::Animation, "Animation" },
{ PetType::Normal, "Normal" },
{ PetType::Charmed, "Charmed" },
{ PetType::Follow, "Follow" },
{ PetType::TargetLock, "Target Lock" },
{ PetType::None, "None" }
};
std::string GetName(uint8 pet_type);
bool IsValid(uint8 pet_type);
}
namespace StatCap {
constexpr uint8 Accuracy = 0;
constexpr uint8 Attack = 1;
constexpr uint8 Avoidance = 2;
constexpr uint8 Clairvoyance = 3;
constexpr uint8 CombatEffects = 4;
constexpr uint8 DamageShield = 5;
constexpr uint8 DOTShielding = 6;
constexpr uint8 DSMitigation = 7;
constexpr uint8 EnduranceRegen = 8;
constexpr uint8 ExtraDamage = 9;
constexpr uint8 Haste = 10;
constexpr uint8 HasteV3 = 11;
constexpr uint8 HealAmount = 12;
constexpr uint8 HealthRegen = 13;
constexpr uint8 ManaRegen = 14;
constexpr uint8 QuiverHaste = 15;
constexpr uint8 Shielding = 16;
constexpr uint8 SpellDamage = 17;
constexpr uint8 SpellShielding = 18;
constexpr uint8 Stat = 19;
constexpr uint8 Strikethrough = 20;
constexpr uint8 StunResist = 21;
static std::map<uint8, std::string> stat_caps = {
{ Accuracy, "Accuracy" },
{ Attack, "Attack" },
{ Avoidance, "Avoidance" },
{ Clairvoyance, "Clairvoyance" },
{ CombatEffects, "Combat Effects" },
{ DamageShield, "Damage Shield" },
{ DOTShielding, "Damage Over Time Shielding" },
{ DSMitigation, "Damage Shield Mitigation" },
{ EnduranceRegen, "Endurance Regen" },
{ ExtraDamage, "Extra Damage" },
{ Haste, "Haste" },
{ HasteV3, "Haste V3" },
{ HealAmount, "Heal Amount" },
{ HealthRegen, "Health Regen" },
{ ManaRegen, "Mana Regen" },
{ QuiverHaste, "Quiver Haste" },
{ Shielding, "Shielding" },
{ SpellDamage, "Spell Damage" },
{ SpellShielding, "Spell Shielding" },
{ Stat, "Stat" },
{ Strikethrough, "Strikethrough" },
{ StunResist, "Stun Resist" }
};
std::string GetName(uint8 stat_id);
bool IsValid(uint8 stat_id);
}
#endif /*COMMON_EMU_CONSTANTS_H*/ #endif /*COMMON_EMU_CONSTANTS_H*/
+2 -1
View File
@@ -988,7 +988,8 @@ enum StartZoneIndex {
Felwithe, Felwithe,
Akanon, Akanon,
Cabilis, Cabilis,
SharVahl SharVahl,
RatheMtn
}; };
enum FVNoDropFlagRule enum FVNoDropFlagRule
+6 -6
View File
@@ -6,7 +6,7 @@
#include <string> #include <string>
#include "emu_versions.h" #include "emu_versions.h"
#include "eq_packet.h" #include "eq_packet.h"
#include "net/daybreak_connection.h" #include "net/reliable_stream_connection.h"
typedef enum { typedef enum {
ESTABLISHED, ESTABLISHED,
@@ -33,18 +33,18 @@ struct EQStreamManagerInterfaceOptions
//Login I had trouble getting to recognize compression at all //Login I had trouble getting to recognize compression at all
//but that might be because it was still a bit buggy when i was testing that. //but that might be because it was still a bit buggy when i was testing that.
if (compressed) { if (compressed) {
daybreak_options.encode_passes[0] = EQ::Net::EncodeCompression; reliable_stream_options.encode_passes[0] = EQ::Net::EncodeCompression;
} }
else if (encoded) { else if (encoded) {
daybreak_options.encode_passes[0] = EQ::Net::EncodeXOR; reliable_stream_options.encode_passes[0] = EQ::Net::EncodeXOR;
} }
daybreak_options.port = port; reliable_stream_options.port = port;
} }
int opcode_size; int opcode_size;
bool track_opcode_stats; bool track_opcode_stats;
EQ::Net::DaybreakConnectionManagerOptions daybreak_options; EQ::Net::ReliableStreamConnectionManagerOptions reliable_stream_options;
}; };
class EQStreamManagerInterface class EQStreamManagerInterface
@@ -80,7 +80,7 @@ public:
struct Stats struct Stats
{ {
EQ::Net::DaybreakConnectionStats DaybreakStats; EQ::Net::ReliableStreamConnectionStats ReliableStreamStats;
int RecvCount[_maxEmuOpcode]; int RecvCount[_maxEmuOpcode];
int SentCount[_maxEmuOpcode]; int SentCount[_maxEmuOpcode];
}; };
+29 -29
View File
@@ -95,12 +95,12 @@ bool IsOfEqualRace(int r1, int r2)
} }
// TODO: add more values // TODO: add more values
switch (r1) { switch (r1) {
case DARK_ELF: case Race::DarkElf:
if (r2 == Race::NeriakCitizen) { if (r2 == Race::NeriakCitizen) {
return true; return true;
} }
break; break;
case BARBARIAN: case Race::Barbarian:
if (r2 == Race::HalasCitizen) { if (r2 == Race::HalasCitizen) {
return true; return true;
} }
@@ -116,49 +116,49 @@ bool IsOfIndiffRace(int r1, int r2)
} }
// TODO: add more values // TODO: add more values
switch (r1) { switch (r1) {
case DARK_ELF: case Race::DarkElf:
case OGRE: case Race::Ogre:
case TROLL: case Race::Troll:
if (r2 == OGRE || r2 == TROLL || r2 == DARK_ELF) { if (r2 == Race::Ogre || r2 == Race::Troll || r2 == Race::DarkElf) {
return true; return true;
} }
break; break;
case HUMAN: case Race::Human:
case BARBARIAN: case Race::Barbarian:
case HALF_ELF: case Race::HalfElf:
case GNOME: case Race::Gnome:
case HALFLING: case Race::Halfling:
case WOOD_ELF: case Race::WoodElf:
if (r2 == HUMAN || if (r2 == Race::Human ||
r2 == BARBARIAN || r2 == Race::Barbarian ||
r2 == ERUDITE || r2 == Race::Erudite ||
r2 == HALF_ELF || r2 == Race::HalfElf ||
r2 == GNOME || r2 == Race::Gnome ||
r2 == HALFLING || r2 == Race::Halfling ||
r2 == DWARF || r2 == Race::Dwarf ||
r2 == HIGH_ELF || r2 == Race::HighElf ||
r2 == WOOD_ELF) { r2 == Race::WoodElf) {
return true; return true;
} }
break; break;
case ERUDITE: case Race::Erudite:
if (r2 == HUMAN || r2 == HALF_ELF) { if (r2 == Race::Human || r2 == Race::HalfElf) {
return true; return true;
} }
break; break;
case DWARF: case Race::Dwarf:
if (r2 == HALFLING || r2 == GNOME) { if (r2 == Race::Halfling || r2 == Race::Gnome) {
return true; return true;
} }
break; break;
case HIGH_ELF: case Race::HighElf:
if (r2 == WOOD_ELF) { if (r2 == Race::WoodElf) {
return true; return true;
} }
break; break;
case VAHSHIR: case Race::VahShir:
return true; return true;
case IKSAR: case Race::Iksar:
return false; return false;
} }
return false; return false;
+1 -1
View File
@@ -438,7 +438,7 @@ namespace EQ
//uint32 Unk054 {}; //uint32 Unk054 {};
int16 MaxCharges {}; // Maximum charges items can hold: -1 if not a chargeable item int16 MaxCharges {}; // Maximum charges items can hold: -1 if not a chargeable item
uint8 ItemType {}; // Item Type/Skill (itemClass* from above) uint8 ItemType {}; // Item Type/Skill (itemClass* from above)
int32 SubType {}; // Some items have sub types that can be used for other things (unbreakable fishing poles, SE_FFItemClass) int32 SubType {}; // Some items have sub types that can be used for other things (unbreakable fishing poles, SpellEffect::FFItemClass)
uint8 Material {}; // Item material type uint8 Material {}; // Item material type
uint32 HerosForgeModel {};// Hero's Forge Armor Model Type (2-13?) uint32 HerosForgeModel {};// Hero's Forge Armor Model Type (2-13?)
float SellRate {}; // Sell rate float SellRate {}; // Sell rate
-206
View File
@@ -1,206 +0,0 @@
/*
These fields must be in the order of how they are serialized!
*/
F(itemclass)
F(name)
F(lore)
F(idfile)
F(id)
F(weight)
F(norent)
F(nodrop)
F(size)
F(slots)
F(price)
F(icon)
F(UNK012)
F(UNK013)
F(benefitflag)
F(tradeskills)
F(cr)
F(dr)
F(pr)
F(mr)
F(fr)
F(astr)
F(asta)
F(aagi)
F(adex)
F(acha)
F(aint)
F(awis)
F(hp)
F(mana)
F(ac)
F(deity)
F(skillmodvalue)
F(UNK033)
F(skillmodmax)
F(skillmodtype)
F(banedmgrace)
F(banedmgamt)
F(banedmgbody)
F(magic)
F(casttime_)
F(reqlevel)
F(bardtype)
F(bardvalue)
F(light)
F(delay)
F(reclevel)
F(recskill)
F(elemdmgtype)
F(elemdmgamt)
F(range)
F(damage)
F(color)
F(classes)
F(races)
F(UNK054)
F(maxcharges)
F(itemtype)
F(material)
F(herosforgemodel)
F(sellrate)
F(UNK059)
F(casttime)
F(elitematerial)
F(procrate)
F(combateffects)
F(shielding)
F(stunresist)
F(strikethrough)
F(extradmgskill)
F(extradmgamt)
F(spellshield)
F(avoidance)
F(accuracy)
F(charmfileid)
F(factionmod1)
F(factionmod2)
F(factionmod3)
F(factionmod4)
F(factionamt1)
F(factionamt2)
F(factionamt3)
F(factionamt4)
F(charmfile)
F(augtype)
F(augslot1type)
F(augslot1visible)
F(augslot2type)
F(augslot2visible)
F(augslot3type)
F(augslot3visible)
F(augslot4type)
F(augslot4visible)
F(augslot5type)
F(augslot5visible)
F(augslot6type)
F(augslot6visible)
F(ldontheme)
F(ldonprice)
F(ldonsold)
F(bagtype)
F(bagslots)
F(bagsize)
F(bagwr)
F(book)
F(booktype)
F(filename)
F(banedmgraceamt)
F(augrestrict)
F(loregroup)
F(pendingloreflag)
F(artifactflag)
F(summonedflag)
F(favor)
F(fvnodrop)
F(endur)
F(dotshielding)
F(attack)
F(regen)
F(manaregen)
F(enduranceregen)
F(haste)
F(damageshield)
F(recastdelay)
F(recasttype)
F(guildfavor)
F(augdistiller)
F(UNK123)
F(UNK124)
F(attuneable)
F(nopet)
F(UNK127)
F(pointtype)
F(potionbelt)
F(potionbeltslots)
F(stacksize)
F(notransfer)
F(stackable)
F(UNK134)
F(clickeffect)
F(clicktype)
F(clicklevel)
F(clicklevel2)
F(proceffect)
F(proctype)
F(proclevel)
F(proclevel2)
F(worneffect)
F(worntype)
F(wornlevel)
F(wornlevel2)
F(focuseffect)
F(focustype)
F(focuslevel)
F(focuslevel2)
F(scrolleffect)
F(scrolltype)
F(scrolllevel)
F(scrolllevel2)
F(bardeffect)
F(bardeffecttype)
F(bardlevel2)
F(bardlevel)
F(questitemflag)
F(svcorruption)
F(purity)
F(evoitem)
F(evoid)
F(evolvinglevel)
F(evomax)
F(backstabdmg)
F(dsmitigation)
F(heroic_str)
F(heroic_int)
F(heroic_wis)
F(heroic_agi)
F(heroic_dex)
F(heroic_sta)
F(heroic_cha)
F(heroic_mr)
F(heroic_fr)
F(heroic_cr)
F(heroic_dr)
F(heroic_pr)
F(heroic_svcorrup)
F(healamt)
F(spelldmg)
F(ldonsellbackrate)
F(scriptfileid)
F(expendablearrow)
F(clairvoyance)
F(clickname)
F(procname)
F(wornname)
F(focusname)
F(scrollname)
F(subtype)
+11 -11
View File
@@ -1,11 +1,11 @@
#include "eqstream.h" #include "eqstream.h"
#include "../eqemu_logsys.h" #include "../eqemu_logsys.h"
EQ::Net::EQStreamManager::EQStreamManager(const EQStreamManagerInterfaceOptions &options) : EQStreamManagerInterface(options), m_daybreak(options.daybreak_options) EQ::Net::EQStreamManager::EQStreamManager(const EQStreamManagerInterfaceOptions &options) : EQStreamManagerInterface(options), m_reliable_stream(options.reliable_stream_options)
{ {
m_daybreak.OnNewConnection(std::bind(&EQStreamManager::DaybreakNewConnection, this, std::placeholders::_1)); m_reliable_stream.OnNewConnection(std::bind(&EQStreamManager::ReliableStreamNewConnection, this, std::placeholders::_1));
m_daybreak.OnConnectionStateChange(std::bind(&EQStreamManager::DaybreakConnectionStateChange, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); m_reliable_stream.OnConnectionStateChange(std::bind(&EQStreamManager::ReliableStreamConnectionStateChange, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
m_daybreak.OnPacketRecv(std::bind(&EQStreamManager::DaybreakPacketRecv, this, std::placeholders::_1, std::placeholders::_2)); m_reliable_stream.OnPacketRecv(std::bind(&EQStreamManager::ReliableStreamPacketRecv, this, std::placeholders::_1, std::placeholders::_2));
} }
EQ::Net::EQStreamManager::~EQStreamManager() EQ::Net::EQStreamManager::~EQStreamManager()
@@ -15,11 +15,11 @@ EQ::Net::EQStreamManager::~EQStreamManager()
void EQ::Net::EQStreamManager::SetOptions(const EQStreamManagerInterfaceOptions &options) void EQ::Net::EQStreamManager::SetOptions(const EQStreamManagerInterfaceOptions &options)
{ {
m_options = options; m_options = options;
auto &opts = m_daybreak.GetOptions(); auto &opts = m_reliable_stream.GetOptions();
opts = options.daybreak_options; opts = options.reliable_stream_options;
} }
void EQ::Net::EQStreamManager::DaybreakNewConnection(std::shared_ptr<DaybreakConnection> connection) void EQ::Net::EQStreamManager::ReliableStreamNewConnection(std::shared_ptr<ReliableStreamConnection> connection)
{ {
std::shared_ptr<EQStream> stream(new EQStream(this, connection)); std::shared_ptr<EQStream> stream(new EQStream(this, connection));
m_streams.emplace(std::make_pair(connection, stream)); m_streams.emplace(std::make_pair(connection, stream));
@@ -28,7 +28,7 @@ void EQ::Net::EQStreamManager::DaybreakNewConnection(std::shared_ptr<DaybreakCon
} }
} }
void EQ::Net::EQStreamManager::DaybreakConnectionStateChange(std::shared_ptr<DaybreakConnection> connection, DbProtocolStatus from, DbProtocolStatus to) void EQ::Net::EQStreamManager::ReliableStreamConnectionStateChange(std::shared_ptr<ReliableStreamConnection> connection, DbProtocolStatus from, DbProtocolStatus to)
{ {
auto iter = m_streams.find(connection); auto iter = m_streams.find(connection);
if (iter != m_streams.end()) { if (iter != m_streams.end()) {
@@ -42,7 +42,7 @@ void EQ::Net::EQStreamManager::DaybreakConnectionStateChange(std::shared_ptr<Day
} }
} }
void EQ::Net::EQStreamManager::DaybreakPacketRecv(std::shared_ptr<DaybreakConnection> connection, const Packet &p) void EQ::Net::EQStreamManager::ReliableStreamPacketRecv(std::shared_ptr<ReliableStreamConnection> connection, const Packet &p)
{ {
auto iter = m_streams.find(connection); auto iter = m_streams.find(connection);
if (iter != m_streams.end()) { if (iter != m_streams.end()) {
@@ -53,7 +53,7 @@ void EQ::Net::EQStreamManager::DaybreakPacketRecv(std::shared_ptr<DaybreakConnec
} }
} }
EQ::Net::EQStream::EQStream(EQStreamManagerInterface *owner, std::shared_ptr<DaybreakConnection> connection) EQ::Net::EQStream::EQStream(EQStreamManagerInterface *owner, std::shared_ptr<ReliableStreamConnection> connection)
{ {
m_owner = owner; m_owner = owner;
m_connection = connection; m_connection = connection;
@@ -235,7 +235,7 @@ EQStreamState EQ::Net::EQStream::GetState() {
EQ::Net::EQStream::Stats EQ::Net::EQStream::GetStats() const EQ::Net::EQStream::Stats EQ::Net::EQStream::GetStats() const
{ {
Stats ret; Stats ret;
ret.DaybreakStats = m_connection->GetStats(); ret.ReliableStreamStats = m_connection->GetStats();
for (int i = 0; i < _maxEmuOpcode; ++i) { for (int i = 0; i < _maxEmuOpcode; ++i) {
ret.RecvCount[i] = 0; ret.RecvCount[i] = 0;
+8 -8
View File
@@ -3,7 +3,7 @@
#include "../eq_packet.h" #include "../eq_packet.h"
#include "../eq_stream_intf.h" #include "../eq_stream_intf.h"
#include "../opcodemgr.h" #include "../opcodemgr.h"
#include "daybreak_connection.h" #include "reliable_stream_connection.h"
#include <vector> #include <vector>
#include <deque> #include <deque>
#include <unordered_map> #include <unordered_map>
@@ -23,21 +23,21 @@ namespace EQ
void OnNewConnection(std::function<void(std::shared_ptr<EQStream>)> func) { m_on_new_connection = func; } void OnNewConnection(std::function<void(std::shared_ptr<EQStream>)> func) { m_on_new_connection = func; }
void OnConnectionStateChange(std::function<void(std::shared_ptr<EQStream>, DbProtocolStatus, DbProtocolStatus)> func) { m_on_connection_state_change = func; } void OnConnectionStateChange(std::function<void(std::shared_ptr<EQStream>, DbProtocolStatus, DbProtocolStatus)> func) { m_on_connection_state_change = func; }
private: private:
DaybreakConnectionManager m_daybreak; ReliableStreamConnectionManager m_reliable_stream;
std::function<void(std::shared_ptr<EQStream>)> m_on_new_connection; std::function<void(std::shared_ptr<EQStream>)> m_on_new_connection;
std::function<void(std::shared_ptr<EQStream>, DbProtocolStatus, DbProtocolStatus)> m_on_connection_state_change; std::function<void(std::shared_ptr<EQStream>, DbProtocolStatus, DbProtocolStatus)> m_on_connection_state_change;
std::map<std::shared_ptr<DaybreakConnection>, std::shared_ptr<EQStream>> m_streams; std::map<std::shared_ptr<ReliableStreamConnection>, std::shared_ptr<EQStream>> m_streams;
void DaybreakNewConnection(std::shared_ptr<DaybreakConnection> connection); void ReliableStreamNewConnection(std::shared_ptr<ReliableStreamConnection> connection);
void DaybreakConnectionStateChange(std::shared_ptr<DaybreakConnection> connection, DbProtocolStatus from, DbProtocolStatus to); void ReliableStreamConnectionStateChange(std::shared_ptr<ReliableStreamConnection> connection, DbProtocolStatus from, DbProtocolStatus to);
void DaybreakPacketRecv(std::shared_ptr<DaybreakConnection> connection, const Packet &p); void ReliableStreamPacketRecv(std::shared_ptr<ReliableStreamConnection> connection, const Packet &p);
friend class EQStream; friend class EQStream;
}; };
class EQStream : public EQStreamInterface class EQStream : public EQStreamInterface
{ {
public: public:
EQStream(EQStreamManagerInterface *parent, std::shared_ptr<DaybreakConnection> connection); EQStream(EQStreamManagerInterface *parent, std::shared_ptr<ReliableStreamConnection> connection);
~EQStream(); ~EQStream();
virtual void QueuePacket(const EQApplicationPacket *p, bool ack_req = true); virtual void QueuePacket(const EQApplicationPacket *p, bool ack_req = true);
@@ -67,7 +67,7 @@ namespace EQ
virtual EQStreamManagerInterface* GetManager() const; virtual EQStreamManagerInterface* GetManager() const;
private: private:
EQStreamManagerInterface *m_owner; EQStreamManagerInterface *m_owner;
std::shared_ptr<DaybreakConnection> m_connection; std::shared_ptr<ReliableStreamConnection> m_connection;
OpcodeManager **m_opcode_manager; OpcodeManager **m_opcode_manager;
std::deque<std::unique_ptr<EQ::Net::Packet>> m_packet_queue; std::deque<std::unique_ptr<EQ::Net::Packet>> m_packet_queue;
std::unordered_map<int, int> m_packet_recv_count; std::unordered_map<int, int> m_packet_recv_count;
@@ -1,4 +1,4 @@
#include "daybreak_connection.h" #include "reliable_stream_connection.h"
#include "../event/event_loop.h" #include "../event/event_loop.h"
#include "../data_verification.h" #include "../data_verification.h"
#include "crc32.h" #include "crc32.h"
@@ -12,7 +12,7 @@ constexpr size_t MAX_CLIENT_RECV_BYTES_PER_WINDOW = 140 * 1024;
// buffer pools // buffer pools
SendBufferPool send_buffer_pool; SendBufferPool send_buffer_pool;
EQ::Net::DaybreakConnectionManager::DaybreakConnectionManager() EQ::Net::ReliableStreamConnectionManager::ReliableStreamConnectionManager()
{ {
m_attached = nullptr; m_attached = nullptr;
memset(&m_timer, 0, sizeof(uv_timer_t)); memset(&m_timer, 0, sizeof(uv_timer_t));
@@ -21,7 +21,7 @@ EQ::Net::DaybreakConnectionManager::DaybreakConnectionManager()
Attach(EQ::EventLoop::Get().Handle()); Attach(EQ::EventLoop::Get().Handle());
} }
EQ::Net::DaybreakConnectionManager::DaybreakConnectionManager(const DaybreakConnectionManagerOptions &opts) EQ::Net::ReliableStreamConnectionManager::ReliableStreamConnectionManager(const ReliableStreamConnectionManagerOptions &opts)
{ {
m_attached = nullptr; m_attached = nullptr;
m_options = opts; m_options = opts;
@@ -31,12 +31,12 @@ EQ::Net::DaybreakConnectionManager::DaybreakConnectionManager(const DaybreakConn
Attach(EQ::EventLoop::Get().Handle()); Attach(EQ::EventLoop::Get().Handle());
} }
EQ::Net::DaybreakConnectionManager::~DaybreakConnectionManager() EQ::Net::ReliableStreamConnectionManager::~ReliableStreamConnectionManager()
{ {
Detach(); Detach();
} }
void EQ::Net::DaybreakConnectionManager::Attach(uv_loop_t *loop) void EQ::Net::ReliableStreamConnectionManager::Attach(uv_loop_t *loop)
{ {
if (!m_attached) { if (!m_attached) {
uv_timer_init(loop, &m_timer); uv_timer_init(loop, &m_timer);
@@ -45,7 +45,7 @@ void EQ::Net::DaybreakConnectionManager::Attach(uv_loop_t *loop)
auto update_rate = (uint64_t)(1000.0 / m_options.tic_rate_hertz); auto update_rate = (uint64_t)(1000.0 / m_options.tic_rate_hertz);
uv_timer_start(&m_timer, [](uv_timer_t *handle) { uv_timer_start(&m_timer, [](uv_timer_t *handle) {
DaybreakConnectionManager *c = (DaybreakConnectionManager*)handle->data; ReliableStreamConnectionManager *c = (ReliableStreamConnectionManager*)handle->data;
c->UpdateDataBudget(); c->UpdateDataBudget();
c->Process(); c->Process();
c->ProcessResend(); c->ProcessResend();
@@ -71,7 +71,7 @@ void EQ::Net::DaybreakConnectionManager::Attach(uv_loop_t *loop)
buf->len = 65536; buf->len = 65536;
}, },
[](uv_udp_t* handle, ssize_t nread, const uv_buf_t* buf, const struct sockaddr* addr, unsigned flags) { [](uv_udp_t* handle, ssize_t nread, const uv_buf_t* buf, const struct sockaddr* addr, unsigned flags) {
DaybreakConnectionManager *c = (DaybreakConnectionManager*)handle->data; ReliableStreamConnectionManager *c = (ReliableStreamConnectionManager*)handle->data;
if (nread < 0 || addr == nullptr) { if (nread < 0 || addr == nullptr) {
return; return;
} }
@@ -90,7 +90,7 @@ void EQ::Net::DaybreakConnectionManager::Attach(uv_loop_t *loop)
} }
} }
void EQ::Net::DaybreakConnectionManager::Detach() void EQ::Net::ReliableStreamConnectionManager::Detach()
{ {
if (m_attached) { if (m_attached) {
uv_udp_recv_stop(&m_socket); uv_udp_recv_stop(&m_socket);
@@ -99,11 +99,11 @@ void EQ::Net::DaybreakConnectionManager::Detach()
} }
} }
void EQ::Net::DaybreakConnectionManager::Connect(const std::string &addr, int port) void EQ::Net::ReliableStreamConnectionManager::Connect(const std::string &addr, int port)
{ {
//todo dns resolution //todo dns resolution
auto connection = std::shared_ptr<DaybreakConnection>(new DaybreakConnection(this, addr, port)); auto connection = std::shared_ptr<ReliableStreamConnection>(new ReliableStreamConnection(this, addr, port));
connection->m_self = connection; connection->m_self = connection;
if (m_on_new_connection) { if (m_on_new_connection) {
@@ -113,7 +113,7 @@ void EQ::Net::DaybreakConnectionManager::Connect(const std::string &addr, int po
m_connections.emplace(std::make_pair(std::make_pair(addr, port), connection)); m_connections.emplace(std::make_pair(std::make_pair(addr, port), connection));
} }
void EQ::Net::DaybreakConnectionManager::Process() void EQ::Net::ReliableStreamConnectionManager::Process()
{ {
auto now = Clock::now(); auto now = Clock::now();
auto iter = m_connections.begin(); auto iter = m_connections.begin();
@@ -177,7 +177,7 @@ void EQ::Net::DaybreakConnectionManager::Process()
} }
} }
void EQ::Net::DaybreakConnectionManager::UpdateDataBudget() void EQ::Net::ReliableStreamConnectionManager::UpdateDataBudget()
{ {
auto outgoing_data_rate = m_options.outgoing_data_rate; auto outgoing_data_rate = m_options.outgoing_data_rate;
if (outgoing_data_rate <= 0.0) { if (outgoing_data_rate <= 0.0) {
@@ -196,7 +196,7 @@ void EQ::Net::DaybreakConnectionManager::UpdateDataBudget()
} }
} }
void EQ::Net::DaybreakConnectionManager::ProcessResend() void EQ::Net::ReliableStreamConnectionManager::ProcessResend()
{ {
auto iter = m_connections.begin(); auto iter = m_connections.begin();
while (iter != m_connections.end()) { while (iter != m_connections.end()) {
@@ -217,15 +217,15 @@ void EQ::Net::DaybreakConnectionManager::ProcessResend()
} }
} }
void EQ::Net::DaybreakConnectionManager::ProcessPacket(const std::string &endpoint, int port, const char *data, size_t size) void EQ::Net::ReliableStreamConnectionManager::ProcessPacket(const std::string &endpoint, int port, const char *data, size_t size)
{ {
if (m_options.simulated_in_packet_loss && m_options.simulated_in_packet_loss >= m_rand.Int(0, 100)) { if (m_options.simulated_in_packet_loss && m_options.simulated_in_packet_loss >= m_rand.Int(0, 100)) {
return; return;
} }
if (size < DaybreakHeader::size()) { if (size < ReliableStreamHeader::size()) {
if (m_on_error_message) { if (m_on_error_message) {
m_on_error_message(fmt::format("Packet of size {0} which is less than {1}", size, DaybreakHeader::size())); m_on_error_message(fmt::format("Packet of size {0} which is less than {1}", size, ReliableStreamHeader::size()));
} }
return; return;
} }
@@ -239,9 +239,9 @@ void EQ::Net::DaybreakConnectionManager::ProcessPacket(const std::string &endpoi
else { else {
if (data[0] == 0 && data[1] == OP_SessionRequest) { if (data[0] == 0 && data[1] == OP_SessionRequest) {
StaticPacket p((void*)data, size); StaticPacket p((void*)data, size);
auto request = p.GetSerialize<DaybreakConnect>(0); auto request = p.GetSerialize<ReliableStreamConnect>(0);
connection = std::shared_ptr<DaybreakConnection>(new DaybreakConnection(this, request, endpoint, port)); connection = std::shared_ptr<ReliableStreamConnection>(new ReliableStreamConnection(this, request, endpoint, port));
connection->m_self = connection; connection->m_self = connection;
if (m_on_new_connection) { if (m_on_new_connection) {
@@ -262,7 +262,7 @@ void EQ::Net::DaybreakConnectionManager::ProcessPacket(const std::string &endpoi
} }
} }
std::shared_ptr<EQ::Net::DaybreakConnection> EQ::Net::DaybreakConnectionManager::FindConnectionByEndpoint(std::string addr, int port) std::shared_ptr<EQ::Net::ReliableStreamConnection> EQ::Net::ReliableStreamConnectionManager::FindConnectionByEndpoint(std::string addr, int port)
{ {
auto p = std::make_pair(addr, port); auto p = std::make_pair(addr, port);
auto iter = m_connections.find(p); auto iter = m_connections.find(p);
@@ -273,9 +273,9 @@ std::shared_ptr<EQ::Net::DaybreakConnection> EQ::Net::DaybreakConnectionManager:
return nullptr; return nullptr;
} }
void EQ::Net::DaybreakConnectionManager::SendDisconnect(const std::string &addr, int port) void EQ::Net::ReliableStreamConnectionManager::SendDisconnect(const std::string &addr, int port)
{ {
DaybreakDisconnect header; ReliableStreamDisconnect header;
header.zero = 0; header.zero = 0;
header.opcode = OP_OutOfSession; header.opcode = OP_OutOfSession;
header.connect_code = 0; header.connect_code = 0;
@@ -300,7 +300,7 @@ void EQ::Net::DaybreakConnectionManager::SendDisconnect(const std::string &addr,
} }
//new connection made as server //new connection made as server
EQ::Net::DaybreakConnection::DaybreakConnection(DaybreakConnectionManager *owner, const DaybreakConnect &connect, const std::string &endpoint, int port) EQ::Net::ReliableStreamConnection::ReliableStreamConnection(ReliableStreamConnectionManager *owner, const ReliableStreamConnect &connect, const std::string &endpoint, int port)
{ {
m_owner = owner; m_owner = owner;
m_last_send = Clock::now(); m_last_send = Clock::now();
@@ -327,7 +327,7 @@ EQ::Net::DaybreakConnection::DaybreakConnection(DaybreakConnectionManager *owner
} }
//new connection made as client //new connection made as client
EQ::Net::DaybreakConnection::DaybreakConnection(DaybreakConnectionManager *owner, const std::string &endpoint, int port) EQ::Net::ReliableStreamConnection::ReliableStreamConnection(ReliableStreamConnectionManager *owner, const std::string &endpoint, int port)
{ {
m_owner = owner; m_owner = owner;
m_last_send = Clock::now(); m_last_send = Clock::now();
@@ -349,11 +349,11 @@ EQ::Net::DaybreakConnection::DaybreakConnection(DaybreakConnectionManager *owner
m_outgoing_budget = owner->m_options.outgoing_data_rate; m_outgoing_budget = owner->m_options.outgoing_data_rate;
} }
EQ::Net::DaybreakConnection::~DaybreakConnection() EQ::Net::ReliableStreamConnection::~ReliableStreamConnection()
{ {
} }
void EQ::Net::DaybreakConnection::Close() void EQ::Net::ReliableStreamConnection::Close()
{ {
if (m_status != StatusDisconnected && m_status != StatusDisconnecting) { if (m_status != StatusDisconnected && m_status != StatusDisconnecting) {
FlushBuffer(); FlushBuffer();
@@ -367,17 +367,17 @@ void EQ::Net::DaybreakConnection::Close()
ChangeStatus(StatusDisconnecting); ChangeStatus(StatusDisconnecting);
} }
void EQ::Net::DaybreakConnection::QueuePacket(Packet &p) void EQ::Net::ReliableStreamConnection::QueuePacket(Packet &p)
{ {
QueuePacket(p, 0, true); QueuePacket(p, 0, true);
} }
void EQ::Net::DaybreakConnection::QueuePacket(Packet &p, int stream) void EQ::Net::ReliableStreamConnection::QueuePacket(Packet &p, int stream)
{ {
QueuePacket(p, stream, true); QueuePacket(p, stream, true);
} }
void EQ::Net::DaybreakConnection::QueuePacket(Packet &p, int stream, bool reliable) void EQ::Net::ReliableStreamConnection::QueuePacket(Packet &p, int stream, bool reliable)
{ {
if (*(char*)p.Data() == 0) { if (*(char*)p.Data() == 0) {
DynamicPacket packet; DynamicPacket packet;
@@ -390,21 +390,21 @@ void EQ::Net::DaybreakConnection::QueuePacket(Packet &p, int stream, bool reliab
InternalQueuePacket(p, stream, reliable); InternalQueuePacket(p, stream, reliable);
} }
EQ::Net::DaybreakConnectionStats EQ::Net::DaybreakConnection::GetStats() EQ::Net::ReliableStreamConnectionStats EQ::Net::ReliableStreamConnection::GetStats()
{ {
EQ::Net::DaybreakConnectionStats ret = m_stats; EQ::Net::ReliableStreamConnectionStats ret = m_stats;
ret.datarate_remaining = m_outgoing_budget; ret.datarate_remaining = m_outgoing_budget;
ret.avg_ping = m_rolling_ping; ret.avg_ping = m_rolling_ping;
return ret; return ret;
} }
void EQ::Net::DaybreakConnection::ResetStats() void EQ::Net::ReliableStreamConnection::ResetStats()
{ {
m_stats.Reset(); m_stats.Reset();
} }
void EQ::Net::DaybreakConnection::Process() void EQ::Net::ReliableStreamConnection::Process()
{ {
try { try {
auto now = Clock::now(); auto now = Clock::now();
@@ -422,7 +422,7 @@ void EQ::Net::DaybreakConnection::Process()
} }
} }
void EQ::Net::DaybreakConnection::ProcessPacket(Packet &p) void EQ::Net::ReliableStreamConnection::ProcessPacket(Packet &p)
{ {
m_last_recv = Clock::now(); m_last_recv = Clock::now();
m_stats.recv_packets++; m_stats.recv_packets++;
@@ -458,13 +458,13 @@ void EQ::Net::DaybreakConnection::ProcessPacket(Packet &p)
switch (m_encode_passes[i]) { switch (m_encode_passes[i]) {
case EncodeCompression: case EncodeCompression:
if(temp.GetInt8(0) == 0) if(temp.GetInt8(0) == 0)
Decompress(temp, DaybreakHeader::size(), temp.Length() - DaybreakHeader::size()); Decompress(temp, ReliableStreamHeader::size(), temp.Length() - ReliableStreamHeader::size());
else else
Decompress(temp, 1, temp.Length() - 1); Decompress(temp, 1, temp.Length() - 1);
break; break;
case EncodeXOR: case EncodeXOR:
if (temp.GetInt8(0) == 0) if (temp.GetInt8(0) == 0)
Decode(temp, DaybreakHeader::size(), temp.Length() - DaybreakHeader::size()); Decode(temp, ReliableStreamHeader::size(), temp.Length() - ReliableStreamHeader::size());
else else
Decode(temp, 1, temp.Length() - 1); Decode(temp, 1, temp.Length() - 1);
break; break;
@@ -483,7 +483,7 @@ void EQ::Net::DaybreakConnection::ProcessPacket(Packet &p)
switch (m_encode_passes[i]) { switch (m_encode_passes[i]) {
case EncodeXOR: case EncodeXOR:
if (temp.GetInt8(0) == 0) if (temp.GetInt8(0) == 0)
Decode(temp, DaybreakHeader::size(), temp.Length() - DaybreakHeader::size()); Decode(temp, ReliableStreamHeader::size(), temp.Length() - ReliableStreamHeader::size());
else else
Decode(temp, 1, temp.Length() - 1); Decode(temp, 1, temp.Length() - 1);
break; break;
@@ -502,7 +502,7 @@ void EQ::Net::DaybreakConnection::ProcessPacket(Packet &p)
} }
} }
void EQ::Net::DaybreakConnection::ProcessQueue() void EQ::Net::ReliableStreamConnection::ProcessQueue()
{ {
for (int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
auto stream = &m_streams[i]; auto stream = &m_streams[i];
@@ -521,7 +521,7 @@ void EQ::Net::DaybreakConnection::ProcessQueue()
} }
} }
void EQ::Net::DaybreakConnection::RemoveFromQueue(int stream, uint16_t seq) void EQ::Net::ReliableStreamConnection::RemoveFromQueue(int stream, uint16_t seq)
{ {
auto s = &m_streams[stream]; auto s = &m_streams[stream];
auto iter = s->packet_queue.find(seq); auto iter = s->packet_queue.find(seq);
@@ -532,7 +532,7 @@ void EQ::Net::DaybreakConnection::RemoveFromQueue(int stream, uint16_t seq)
} }
} }
void EQ::Net::DaybreakConnection::AddToQueue(int stream, uint16_t seq, const Packet &p) void EQ::Net::ReliableStreamConnection::AddToQueue(int stream, uint16_t seq, const Packet &p)
{ {
auto s = &m_streams[stream]; auto s = &m_streams[stream];
auto iter = s->packet_queue.find(seq); auto iter = s->packet_queue.find(seq);
@@ -544,7 +544,7 @@ void EQ::Net::DaybreakConnection::AddToQueue(int stream, uint16_t seq, const Pac
} }
} }
void EQ::Net::DaybreakConnection::ProcessDecodedPacket(const Packet &p) void EQ::Net::ReliableStreamConnection::ProcessDecodedPacket(const Packet &p)
{ {
if (p.GetInt8(0) == 0) { if (p.GetInt8(0) == 0) {
if (p.Length() < 2) { if (p.Length() < 2) {
@@ -628,13 +628,13 @@ void EQ::Net::DaybreakConnection::ProcessDecodedPacket(const Packet &p)
case OP_SessionRequest: case OP_SessionRequest:
{ {
if (m_status == StatusConnected) { if (m_status == StatusConnected) {
auto request = p.GetSerialize<DaybreakConnect>(0); auto request = p.GetSerialize<ReliableStreamConnect>(0);
if (NetworkToHost(request.connect_code) != m_connect_code) { if (NetworkToHost(request.connect_code) != m_connect_code) {
return; return;
} }
DaybreakConnectReply reply; ReliableStreamConnectReply reply;
reply.zero = 0; reply.zero = 0;
reply.opcode = OP_SessionResponse; reply.opcode = OP_SessionResponse;
reply.connect_code = HostToNetwork(m_connect_code); reply.connect_code = HostToNetwork(m_connect_code);
@@ -656,13 +656,13 @@ void EQ::Net::DaybreakConnection::ProcessDecodedPacket(const Packet &p)
case OP_SessionResponse: case OP_SessionResponse:
{ {
if (m_status == StatusConnecting) { if (m_status == StatusConnecting) {
auto reply = p.GetSerialize<DaybreakConnectReply>(0); auto reply = p.GetSerialize<ReliableStreamConnectReply>(0);
if (m_connect_code == reply.connect_code) { if (m_connect_code == reply.connect_code) {
m_encode_key = reply.encode_key; m_encode_key = reply.encode_key;
m_crc_bytes = reply.crc_bytes; m_crc_bytes = reply.crc_bytes;
m_encode_passes[0] = (DaybreakEncodeType)reply.encode_pass1; m_encode_passes[0] = (ReliableStreamEncodeType)reply.encode_pass1;
m_encode_passes[1] = (DaybreakEncodeType)reply.encode_pass2; m_encode_passes[1] = (ReliableStreamEncodeType)reply.encode_pass2;
m_max_packet_size = reply.max_packet_size; m_max_packet_size = reply.max_packet_size;
ChangeStatus(StatusConnected); ChangeStatus(StatusConnected);
@@ -686,7 +686,7 @@ void EQ::Net::DaybreakConnection::ProcessDecodedPacket(const Packet &p)
return; return;
} }
auto header = p.GetSerialize<DaybreakReliableHeader>(0); auto header = p.GetSerialize<ReliableStreamReliableHeader>(0);
auto sequence = NetworkToHost(header.sequence); auto sequence = NetworkToHost(header.sequence);
auto stream_id = header.opcode - OP_Packet; auto stream_id = header.opcode - OP_Packet;
auto stream = &m_streams[stream_id]; auto stream = &m_streams[stream_id];
@@ -703,7 +703,7 @@ void EQ::Net::DaybreakConnection::ProcessDecodedPacket(const Packet &p)
RemoveFromQueue(stream_id, sequence); RemoveFromQueue(stream_id, sequence);
SendAck(stream_id, stream->sequence_in); SendAck(stream_id, stream->sequence_in);
stream->sequence_in++; stream->sequence_in++;
StaticPacket next((char*)p.Data() + DaybreakReliableHeader::size(), p.Length() - DaybreakReliableHeader::size()); StaticPacket next((char*)p.Data() + ReliableStreamReliableHeader::size(), p.Length() - ReliableStreamReliableHeader::size());
ProcessDecodedPacket(next); ProcessDecodedPacket(next);
} }
@@ -715,7 +715,7 @@ void EQ::Net::DaybreakConnection::ProcessDecodedPacket(const Packet &p)
case OP_Fragment3: case OP_Fragment3:
case OP_Fragment4: case OP_Fragment4:
{ {
auto header = p.GetSerialize<DaybreakReliableHeader>(0); auto header = p.GetSerialize<ReliableStreamReliableHeader>(0);
auto sequence = NetworkToHost(header.sequence); auto sequence = NetworkToHost(header.sequence);
auto stream_id = header.opcode - OP_Fragment; auto stream_id = header.opcode - OP_Fragment;
auto stream = &m_streams[stream_id]; auto stream = &m_streams[stream_id];
@@ -735,22 +735,22 @@ void EQ::Net::DaybreakConnection::ProcessDecodedPacket(const Packet &p)
stream->sequence_in++; stream->sequence_in++;
if (stream->fragment_total_bytes == 0) { if (stream->fragment_total_bytes == 0) {
auto fragheader = p.GetSerialize<DaybreakReliableFragmentHeader>(0); auto fragheader = p.GetSerialize<ReliableStreamReliableFragmentHeader>(0);
stream->fragment_total_bytes = NetworkToHost(fragheader.total_size); stream->fragment_total_bytes = NetworkToHost(fragheader.total_size);
stream->fragment_current_bytes = 0; stream->fragment_current_bytes = 0;
stream->fragment_packet.Reserve(stream->fragment_total_bytes); stream->fragment_packet.Reserve(stream->fragment_total_bytes);
stream->fragment_packet.PutData( stream->fragment_packet.PutData(
stream->fragment_current_bytes, stream->fragment_current_bytes,
(char*)p.Data() + DaybreakReliableFragmentHeader::size(), p.Length() - DaybreakReliableFragmentHeader::size()); (char*)p.Data() + ReliableStreamReliableFragmentHeader::size(), p.Length() - ReliableStreamReliableFragmentHeader::size());
stream->fragment_current_bytes += (uint32_t)(p.Length() - DaybreakReliableFragmentHeader::size()); stream->fragment_current_bytes += (uint32_t)(p.Length() - ReliableStreamReliableFragmentHeader::size());
} }
else { else {
stream->fragment_packet.PutData( stream->fragment_packet.PutData(
stream->fragment_current_bytes, stream->fragment_current_bytes,
(char*)p.Data() + DaybreakReliableHeader::size(), p.Length() - DaybreakReliableHeader::size()); (char*)p.Data() + ReliableStreamReliableHeader::size(), p.Length() - ReliableStreamReliableHeader::size());
stream->fragment_current_bytes += (uint32_t)(p.Length() - DaybreakReliableHeader::size()); stream->fragment_current_bytes += (uint32_t)(p.Length() - ReliableStreamReliableHeader::size());
if (stream->fragment_current_bytes >= stream->fragment_total_bytes) { if (stream->fragment_current_bytes >= stream->fragment_total_bytes) {
ProcessDecodedPacket(stream->fragment_packet); ProcessDecodedPacket(stream->fragment_packet);
@@ -769,7 +769,7 @@ void EQ::Net::DaybreakConnection::ProcessDecodedPacket(const Packet &p)
case OP_Ack3: case OP_Ack3:
case OP_Ack4: case OP_Ack4:
{ {
auto header = p.GetSerialize<DaybreakReliableHeader>(0); auto header = p.GetSerialize<ReliableStreamReliableHeader>(0);
auto sequence = NetworkToHost(header.sequence); auto sequence = NetworkToHost(header.sequence);
auto stream_id = header.opcode - OP_Ack; auto stream_id = header.opcode - OP_Ack;
Ack(stream_id, sequence); Ack(stream_id, sequence);
@@ -781,7 +781,7 @@ void EQ::Net::DaybreakConnection::ProcessDecodedPacket(const Packet &p)
case OP_OutOfOrderAck3: case OP_OutOfOrderAck3:
case OP_OutOfOrderAck4: case OP_OutOfOrderAck4:
{ {
auto header = p.GetSerialize<DaybreakReliableHeader>(0); auto header = p.GetSerialize<ReliableStreamReliableHeader>(0);
auto sequence = NetworkToHost(header.sequence); auto sequence = NetworkToHost(header.sequence);
auto stream_id = header.opcode - OP_OutOfOrderAck; auto stream_id = header.opcode - OP_OutOfOrderAck;
OutOfOrderAck(stream_id, sequence); OutOfOrderAck(stream_id, sequence);
@@ -815,13 +815,13 @@ void EQ::Net::DaybreakConnection::ProcessDecodedPacket(const Packet &p)
} }
case OP_SessionStatRequest: case OP_SessionStatRequest:
{ {
auto request = p.GetSerialize<DaybreakSessionStatRequest>(0); auto request = p.GetSerialize<ReliableStreamSessionStatRequest>(0);
m_stats.sync_remote_sent_packets = EQ::Net::NetworkToHost(request.packets_sent); m_stats.sync_remote_sent_packets = EQ::Net::NetworkToHost(request.packets_sent);
m_stats.sync_remote_recv_packets = EQ::Net::NetworkToHost(request.packets_recv); m_stats.sync_remote_recv_packets = EQ::Net::NetworkToHost(request.packets_recv);
m_stats.sync_sent_packets = m_stats.sent_packets; m_stats.sync_sent_packets = m_stats.sent_packets;
m_stats.sync_recv_packets = m_stats.recv_packets; m_stats.sync_recv_packets = m_stats.recv_packets;
DaybreakSessionStatResponse response; ReliableStreamSessionStatResponse response;
response.zero = 0; response.zero = 0;
response.opcode = OP_SessionStatResponse; response.opcode = OP_SessionStatResponse;
response.timestamp = request.timestamp; response.timestamp = request.timestamp;
@@ -836,7 +836,7 @@ void EQ::Net::DaybreakConnection::ProcessDecodedPacket(const Packet &p)
break; break;
} }
case OP_SessionStatResponse: { case OP_SessionStatResponse: {
auto response = p.GetSerialize<DaybreakSessionStatResponse>(0); auto response = p.GetSerialize<ReliableStreamSessionStatResponse>(0);
m_stats.sync_remote_sent_packets = EQ::Net::NetworkToHost(response.server_sent); m_stats.sync_remote_sent_packets = EQ::Net::NetworkToHost(response.server_sent);
m_stats.sync_remote_recv_packets = EQ::Net::NetworkToHost(response.server_recv); m_stats.sync_remote_recv_packets = EQ::Net::NetworkToHost(response.server_recv);
m_stats.sync_sent_packets = m_stats.sent_packets; m_stats.sync_sent_packets = m_stats.sent_packets;
@@ -858,7 +858,7 @@ void EQ::Net::DaybreakConnection::ProcessDecodedPacket(const Packet &p)
} }
} }
bool EQ::Net::DaybreakConnection::ValidateCRC(Packet &p) bool EQ::Net::ReliableStreamConnection::ValidateCRC(Packet &p)
{ {
if (m_crc_bytes == 0U) { if (m_crc_bytes == 0U) {
return true; return true;
@@ -892,7 +892,7 @@ bool EQ::Net::DaybreakConnection::ValidateCRC(Packet &p)
return false; return false;
} }
void EQ::Net::DaybreakConnection::AppendCRC(Packet &p) void EQ::Net::ReliableStreamConnection::AppendCRC(Packet &p)
{ {
if (m_crc_bytes == 0U) { if (m_crc_bytes == 0U) {
return; return;
@@ -911,7 +911,7 @@ void EQ::Net::DaybreakConnection::AppendCRC(Packet &p)
} }
} }
void EQ::Net::DaybreakConnection::ChangeStatus(DbProtocolStatus new_status) void EQ::Net::ReliableStreamConnection::ChangeStatus(DbProtocolStatus new_status)
{ {
if (m_owner->m_on_connection_state_change) { if (m_owner->m_on_connection_state_change) {
if (auto self = m_self.lock()) { if (auto self = m_self.lock()) {
@@ -922,7 +922,7 @@ void EQ::Net::DaybreakConnection::ChangeStatus(DbProtocolStatus new_status)
m_status = new_status; m_status = new_status;
} }
bool EQ::Net::DaybreakConnection::PacketCanBeEncoded(Packet &p) const bool EQ::Net::ReliableStreamConnection::PacketCanBeEncoded(Packet &p) const
{ {
if (p.Length() < 2) { if (p.Length() < 2) {
return false; return false;
@@ -941,7 +941,7 @@ bool EQ::Net::DaybreakConnection::PacketCanBeEncoded(Packet &p) const
return true; return true;
} }
void EQ::Net::DaybreakConnection::Decode(Packet &p, size_t offset, size_t length) void EQ::Net::ReliableStreamConnection::Decode(Packet &p, size_t offset, size_t length)
{ {
int key = m_encode_key; int key = m_encode_key;
char *buffer = (char*)p.Data() + offset; char *buffer = (char*)p.Data() + offset;
@@ -961,7 +961,7 @@ void EQ::Net::DaybreakConnection::Decode(Packet &p, size_t offset, size_t length
} }
} }
void EQ::Net::DaybreakConnection::Encode(Packet &p, size_t offset, size_t length) void EQ::Net::ReliableStreamConnection::Encode(Packet &p, size_t offset, size_t length)
{ {
int key = m_encode_key; int key = m_encode_key;
char *buffer = (char*)p.Data() + offset; char *buffer = (char*)p.Data() + offset;
@@ -1050,7 +1050,7 @@ uint32_t Deflate(const uint8_t* in, uint32_t in_len, uint8_t* out, uint32_t out_
} }
} }
void EQ::Net::DaybreakConnection::Decompress(Packet &p, size_t offset, size_t length) void EQ::Net::ReliableStreamConnection::Decompress(Packet &p, size_t offset, size_t length)
{ {
if (length < 2) { if (length < 2) {
return; return;
@@ -1075,7 +1075,7 @@ void EQ::Net::DaybreakConnection::Decompress(Packet &p, size_t offset, size_t le
p.PutData(offset, new_buffer, new_length); p.PutData(offset, new_buffer, new_length);
} }
void EQ::Net::DaybreakConnection::Compress(Packet &p, size_t offset, size_t length) void EQ::Net::ReliableStreamConnection::Compress(Packet &p, size_t offset, size_t length)
{ {
static thread_local uint8_t new_buffer[2048] = { 0 }; static thread_local uint8_t new_buffer[2048] = { 0 };
uint8_t *buffer = (uint8_t*)p.Data() + offset; uint8_t *buffer = (uint8_t*)p.Data() + offset;
@@ -1097,14 +1097,14 @@ void EQ::Net::DaybreakConnection::Compress(Packet &p, size_t offset, size_t leng
p.PutData(offset, new_buffer, new_length); p.PutData(offset, new_buffer, new_length);
} }
void EQ::Net::DaybreakConnection::ProcessResend() void EQ::Net::ReliableStreamConnection::ProcessResend()
{ {
for (int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
ProcessResend(i); ProcessResend(i);
} }
} }
void EQ::Net::DaybreakConnection::ProcessResend(int stream) void EQ::Net::ReliableStreamConnection::ProcessResend(int stream)
{ {
if (m_status == DbProtocolStatus::StatusDisconnected) { if (m_status == DbProtocolStatus::StatusDisconnected) {
return; return;
@@ -1201,7 +1201,7 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
auto &sp = e.second; auto &sp = e.second;
auto &p = sp.packet; auto &p = sp.packet;
if (p.Length() >= DaybreakHeader::size()) { if (p.Length() >= ReliableStreamHeader::size()) {
if (p.GetInt8(0) == 0 && p.GetInt8(1) >= OP_Fragment && p.GetInt8(1) <= OP_Fragment4) { if (p.GetInt8(0) == 0 && p.GetInt8(1) >= OP_Fragment && p.GetInt8(1) <= OP_Fragment4) {
m_stats.resent_fragments++; m_stats.resent_fragments++;
} }
@@ -1232,7 +1232,7 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
m_last_ack = now; m_last_ack = now;
} }
void EQ::Net::DaybreakConnection::Ack(int stream, uint16_t seq) void EQ::Net::ReliableStreamConnection::Ack(int stream, uint16_t seq)
{ {
auto now = Clock::now(); auto now = Clock::now();
auto s = &m_streams[stream]; auto s = &m_streams[stream];
@@ -1259,7 +1259,7 @@ void EQ::Net::DaybreakConnection::Ack(int stream, uint16_t seq)
m_last_ack = now; m_last_ack = now;
} }
void EQ::Net::DaybreakConnection::OutOfOrderAck(int stream, uint16_t seq) void EQ::Net::ReliableStreamConnection::OutOfOrderAck(int stream, uint16_t seq)
{ {
auto now = Clock::now(); auto now = Clock::now();
auto s = &m_streams[stream]; auto s = &m_streams[stream];
@@ -1279,15 +1279,15 @@ void EQ::Net::DaybreakConnection::OutOfOrderAck(int stream, uint16_t seq)
m_last_ack = now; m_last_ack = now;
} }
void EQ::Net::DaybreakConnection::UpdateDataBudget(double budget_add) void EQ::Net::ReliableStreamConnection::UpdateDataBudget(double budget_add)
{ {
auto outgoing_data_rate = m_owner->m_options.outgoing_data_rate; auto outgoing_data_rate = m_owner->m_options.outgoing_data_rate;
m_outgoing_budget = EQ::ClampUpper(m_outgoing_budget + budget_add, outgoing_data_rate); m_outgoing_budget = EQ::ClampUpper(m_outgoing_budget + budget_add, outgoing_data_rate);
} }
void EQ::Net::DaybreakConnection::SendAck(int stream_id, uint16_t seq) void EQ::Net::ReliableStreamConnection::SendAck(int stream_id, uint16_t seq)
{ {
DaybreakReliableHeader ack; ReliableStreamReliableHeader ack;
ack.zero = 0; ack.zero = 0;
ack.opcode = OP_Ack + stream_id; ack.opcode = OP_Ack + stream_id;
ack.sequence = HostToNetwork(seq); ack.sequence = HostToNetwork(seq);
@@ -1298,9 +1298,9 @@ void EQ::Net::DaybreakConnection::SendAck(int stream_id, uint16_t seq)
InternalBufferedSend(p); InternalBufferedSend(p);
} }
void EQ::Net::DaybreakConnection::SendOutOfOrderAck(int stream_id, uint16_t seq) void EQ::Net::ReliableStreamConnection::SendOutOfOrderAck(int stream_id, uint16_t seq)
{ {
DaybreakReliableHeader ack; ReliableStreamReliableHeader ack;
ack.zero = 0; ack.zero = 0;
ack.opcode = OP_OutOfOrderAck + stream_id; ack.opcode = OP_OutOfOrderAck + stream_id;
ack.sequence = HostToNetwork(seq); ack.sequence = HostToNetwork(seq);
@@ -1311,9 +1311,9 @@ void EQ::Net::DaybreakConnection::SendOutOfOrderAck(int stream_id, uint16_t seq)
InternalBufferedSend(p); InternalBufferedSend(p);
} }
void EQ::Net::DaybreakConnection::SendDisconnect() void EQ::Net::ReliableStreamConnection::SendDisconnect()
{ {
DaybreakDisconnect disconnect; ReliableStreamDisconnect disconnect;
disconnect.zero = 0; disconnect.zero = 0;
disconnect.opcode = OP_SessionDisconnect; disconnect.opcode = OP_SessionDisconnect;
disconnect.connect_code = HostToNetwork(m_connect_code); disconnect.connect_code = HostToNetwork(m_connect_code);
@@ -1322,7 +1322,7 @@ void EQ::Net::DaybreakConnection::SendDisconnect()
InternalSend(out); InternalSend(out);
} }
void EQ::Net::DaybreakConnection::InternalBufferedSend(Packet &p) void EQ::Net::ReliableStreamConnection::InternalBufferedSend(Packet &p)
{ {
if (p.Length() > 0xFFU) { if (p.Length() > 0xFFU) {
FlushBuffer(); FlushBuffer();
@@ -1331,7 +1331,7 @@ void EQ::Net::DaybreakConnection::InternalBufferedSend(Packet &p)
} }
//we could add this packet to a combined //we could add this packet to a combined
size_t raw_size = DaybreakHeader::size() + (size_t)m_crc_bytes + m_buffered_packets_length + m_buffered_packets.size() + 1 + p.Length(); size_t raw_size = ReliableStreamHeader::size() + (size_t)m_crc_bytes + m_buffered_packets_length + m_buffered_packets.size() + 1 + p.Length();
if (raw_size > m_max_packet_size) { if (raw_size > m_max_packet_size) {
FlushBuffer(); FlushBuffer();
} }
@@ -1346,9 +1346,9 @@ void EQ::Net::DaybreakConnection::InternalBufferedSend(Packet &p)
} }
} }
void EQ::Net::DaybreakConnection::SendConnect() void EQ::Net::ReliableStreamConnection::SendConnect()
{ {
DaybreakConnect connect; ReliableStreamConnect connect;
connect.zero = 0; connect.zero = 0;
connect.opcode = OP_SessionRequest; connect.opcode = OP_SessionRequest;
connect.protocol_version = HostToNetwork(3U); connect.protocol_version = HostToNetwork(3U);
@@ -1361,9 +1361,9 @@ void EQ::Net::DaybreakConnection::SendConnect()
InternalSend(p); InternalSend(p);
} }
void EQ::Net::DaybreakConnection::SendKeepAlive() void EQ::Net::ReliableStreamConnection::SendKeepAlive()
{ {
DaybreakHeader keep_alive; ReliableStreamHeader keep_alive;
keep_alive.zero = 0; keep_alive.zero = 0;
keep_alive.opcode = OP_KeepAlive; keep_alive.opcode = OP_KeepAlive;
@@ -1373,7 +1373,7 @@ void EQ::Net::DaybreakConnection::SendKeepAlive()
InternalSend(p); InternalSend(p);
} }
void EQ::Net::DaybreakConnection::InternalSend(Packet &p) { void EQ::Net::ReliableStreamConnection::InternalSend(Packet &p) {
if (m_owner->m_options.outgoing_data_rate > 0.0) { if (m_owner->m_options.outgoing_data_rate > 0.0) {
auto new_budget = m_outgoing_budget - (p.Length() / 1024.0); auto new_budget = m_outgoing_budget - (p.Length() / 1024.0);
if (new_budget <= 0.0) { if (new_budget <= 0.0) {
@@ -1409,14 +1409,14 @@ void EQ::Net::DaybreakConnection::InternalSend(Packet &p) {
switch (m_encode_passe) { switch (m_encode_passe) {
case EncodeCompression: case EncodeCompression:
if (out.GetInt8(0) == 0) { if (out.GetInt8(0) == 0) {
Compress(out, DaybreakHeader::size(), out.Length() - DaybreakHeader::size()); Compress(out, ReliableStreamHeader::size(), out.Length() - ReliableStreamHeader::size());
} else { } else {
Compress(out, 1, out.Length() - 1); Compress(out, 1, out.Length() - 1);
} }
break; break;
case EncodeXOR: case EncodeXOR:
if (out.GetInt8(0) == 0) { if (out.GetInt8(0) == 0) {
Encode(out, DaybreakHeader::size(), out.Length() - DaybreakHeader::size()); Encode(out, ReliableStreamHeader::size(), out.Length() - ReliableStreamHeader::size());
} else { } else {
Encode(out, 1, out.Length() - 1); Encode(out, 1, out.Length() - 1);
} }
@@ -1466,7 +1466,7 @@ void EQ::Net::DaybreakConnection::InternalSend(Packet &p) {
} }
} }
void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id, bool reliable) void EQ::Net::ReliableStreamConnection::InternalQueuePacket(Packet &p, int stream_id, bool reliable)
{ {
if (!reliable) { if (!reliable) {
auto max_raw_size = 0xFFU - m_crc_bytes; auto max_raw_size = 0xFFU - m_crc_bytes;
@@ -1480,23 +1480,23 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
} }
auto stream = &m_streams[stream_id]; auto stream = &m_streams[stream_id];
auto max_raw_size = m_max_packet_size - m_crc_bytes - DaybreakReliableHeader::size() - 1; // -1 for compress flag auto max_raw_size = m_max_packet_size - m_crc_bytes - ReliableStreamReliableHeader::size() - 1; // -1 for compress flag
size_t length = p.Length(); size_t length = p.Length();
if (length > max_raw_size) { if (length > max_raw_size) {
DaybreakReliableFragmentHeader first_header; ReliableStreamReliableFragmentHeader first_header;
first_header.reliable.zero = 0; first_header.reliable.zero = 0;
first_header.reliable.opcode = OP_Fragment + stream_id; first_header.reliable.opcode = OP_Fragment + stream_id;
first_header.reliable.sequence = HostToNetwork(stream->sequence_out); first_header.reliable.sequence = HostToNetwork(stream->sequence_out);
first_header.total_size = (uint32_t)HostToNetwork((uint32_t)length); first_header.total_size = (uint32_t)HostToNetwork((uint32_t)length);
size_t used = 0; size_t used = 0;
size_t sublen = m_max_packet_size - m_crc_bytes - DaybreakReliableFragmentHeader::size() - 1; // -1 for compress flag size_t sublen = m_max_packet_size - m_crc_bytes - ReliableStreamReliableFragmentHeader::size() - 1; // -1 for compress flag
DynamicPacket first_packet; DynamicPacket first_packet;
first_packet.PutSerialize(0, first_header); first_packet.PutSerialize(0, first_header);
first_packet.PutData(DaybreakReliableFragmentHeader::size(), (char*)p.Data() + used, sublen); first_packet.PutData(ReliableStreamReliableFragmentHeader::size(), (char*)p.Data() + used, sublen);
used += sublen; used += sublen;
DaybreakSentPacket sent; ReliableStreamSentPacket sent;
sent.packet.PutPacket(0, first_packet); sent.packet.PutPacket(0, first_packet);
sent.last_sent = Clock::now(); sent.last_sent = Clock::now();
sent.first_sent = Clock::now(); sent.first_sent = Clock::now();
@@ -1513,22 +1513,22 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
while (used < length) { while (used < length) {
auto left = length - used; auto left = length - used;
DynamicPacket packet; DynamicPacket packet;
DaybreakReliableHeader header; ReliableStreamReliableHeader header;
header.zero = 0; header.zero = 0;
header.opcode = OP_Fragment + stream_id; header.opcode = OP_Fragment + stream_id;
header.sequence = HostToNetwork(stream->sequence_out); header.sequence = HostToNetwork(stream->sequence_out);
packet.PutSerialize(0, header); packet.PutSerialize(0, header);
if (left > max_raw_size) { if (left > max_raw_size) {
packet.PutData(DaybreakReliableHeader::size(), (char*)p.Data() + used, max_raw_size); packet.PutData(ReliableStreamReliableHeader::size(), (char*)p.Data() + used, max_raw_size);
used += max_raw_size; used += max_raw_size;
} }
else { else {
packet.PutData(DaybreakReliableHeader::size(), (char*)p.Data() + used, left); packet.PutData(ReliableStreamReliableHeader::size(), (char*)p.Data() + used, left);
used += left; used += left;
} }
DaybreakSentPacket sent; ReliableStreamSentPacket sent;
sent.packet.PutPacket(0, packet); sent.packet.PutPacket(0, packet);
sent.last_sent = Clock::now(); sent.last_sent = Clock::now();
sent.first_sent = Clock::now(); sent.first_sent = Clock::now();
@@ -1545,14 +1545,14 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
} }
else { else {
DynamicPacket packet; DynamicPacket packet;
DaybreakReliableHeader header; ReliableStreamReliableHeader header;
header.zero = 0; header.zero = 0;
header.opcode = OP_Packet + stream_id; header.opcode = OP_Packet + stream_id;
header.sequence = HostToNetwork(stream->sequence_out); header.sequence = HostToNetwork(stream->sequence_out);
packet.PutSerialize(0, header); packet.PutSerialize(0, header);
packet.PutPacket(DaybreakReliableHeader::size(), p); packet.PutPacket(ReliableStreamReliableHeader::size(), p);
DaybreakSentPacket sent; ReliableStreamSentPacket sent;
sent.packet.PutPacket(0, packet); sent.packet.PutPacket(0, packet);
sent.last_sent = Clock::now(); sent.last_sent = Clock::now();
sent.first_sent = Clock::now(); sent.first_sent = Clock::now();
@@ -1568,7 +1568,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
} }
} }
void EQ::Net::DaybreakConnection::FlushBuffer() void EQ::Net::ReliableStreamConnection::FlushBuffer()
{ {
if (m_buffered_packets.empty()) { if (m_buffered_packets.empty()) {
return; return;
@@ -1595,7 +1595,7 @@ void EQ::Net::DaybreakConnection::FlushBuffer()
m_buffered_packets_length = 0; m_buffered_packets_length = 0;
} }
EQ::Net::SequenceOrder EQ::Net::DaybreakConnection::CompareSequence(uint16_t expected, uint16_t actual) const EQ::Net::SequenceOrder EQ::Net::ReliableStreamConnection::CompareSequence(uint16_t expected, uint16_t actual) const
{ {
int diff = (int)actual - (int)expected; int diff = (int)actual - (int)expected;
@@ -2,8 +2,8 @@
#include "../random.h" #include "../random.h"
#include "packet.h" #include "packet.h"
#include "daybreak_structs.h" #include "reliable_stream_structs.h"
#include "daybreak_pooling.h" #include "reliable_stream_pooling.h"
#include <uv.h> #include <uv.h>
#include <chrono> #include <chrono>
#include <functional> #include <functional>
@@ -16,7 +16,7 @@ namespace EQ
{ {
namespace Net namespace Net
{ {
enum DaybreakProtocolOpcode enum ReliableStreamProtocolOpcode
{ {
OP_Padding = 0x00, OP_Padding = 0x00,
OP_SessionRequest = 0x01, OP_SessionRequest = 0x01,
@@ -55,7 +55,7 @@ namespace EQ
StatusDisconnected StatusDisconnected
}; };
enum DaybreakEncodeType enum ReliableStreamEncodeType
{ {
EncodeNone = 0, EncodeNone = 0,
EncodeCompression = 1, EncodeCompression = 1,
@@ -72,9 +72,9 @@ namespace EQ
typedef std::chrono::steady_clock::time_point Timestamp; typedef std::chrono::steady_clock::time_point Timestamp;
typedef std::chrono::steady_clock Clock; typedef std::chrono::steady_clock Clock;
struct DaybreakConnectionStats struct ReliableStreamConnectionStats
{ {
DaybreakConnectionStats() { ReliableStreamConnectionStats() {
recv_bytes = 0; recv_bytes = 0;
sent_bytes = 0; sent_bytes = 0;
recv_packets = 0; recv_packets = 0;
@@ -134,14 +134,14 @@ namespace EQ
uint64_t bytes_before_encode; uint64_t bytes_before_encode;
}; };
class DaybreakConnectionManager; class ReliableStreamConnectionManager;
class DaybreakConnection; class ReliableStreamConnection;
class DaybreakConnection class ReliableStreamConnection
{ {
public: public:
DaybreakConnection(DaybreakConnectionManager *owner, const DaybreakConnect &connect, const std::string &endpoint, int port); ReliableStreamConnection(ReliableStreamConnectionManager *owner, const ReliableStreamConnect &connect, const std::string &endpoint, int port);
DaybreakConnection(DaybreakConnectionManager *owner, const std::string &endpoint, int port); ReliableStreamConnection(ReliableStreamConnectionManager *owner, const std::string &endpoint, int port);
~DaybreakConnection(); ~ReliableStreamConnection();
const std::string& RemoteEndpoint() const { return m_endpoint; } const std::string& RemoteEndpoint() const { return m_endpoint; }
int RemotePort() const { return m_port; } int RemotePort() const { return m_port; }
@@ -151,23 +151,23 @@ namespace EQ
void QueuePacket(Packet &p, int stream); void QueuePacket(Packet &p, int stream);
void QueuePacket(Packet &p, int stream, bool reliable); void QueuePacket(Packet &p, int stream, bool reliable);
DaybreakConnectionStats GetStats(); ReliableStreamConnectionStats GetStats();
void ResetStats(); void ResetStats();
size_t GetRollingPing() const { return m_rolling_ping; } size_t GetRollingPing() const { return m_rolling_ping; }
DbProtocolStatus GetStatus() const { return m_status; } DbProtocolStatus GetStatus() const { return m_status; }
const DaybreakEncodeType* GetEncodePasses() const { return m_encode_passes; } const ReliableStreamEncodeType* GetEncodePasses() const { return m_encode_passes; }
const DaybreakConnectionManager* GetManager() const { return m_owner; } const ReliableStreamConnectionManager* GetManager() const { return m_owner; }
DaybreakConnectionManager* GetManager() { return m_owner; } ReliableStreamConnectionManager* GetManager() { return m_owner; }
private: private:
DaybreakConnectionManager *m_owner; ReliableStreamConnectionManager *m_owner;
std::string m_endpoint; std::string m_endpoint;
int m_port; int m_port;
uint32_t m_connect_code; uint32_t m_connect_code;
uint32_t m_encode_key; uint32_t m_encode_key;
uint32_t m_max_packet_size; uint32_t m_max_packet_size;
uint32_t m_crc_bytes; uint32_t m_crc_bytes;
DaybreakEncodeType m_encode_passes[2]; ReliableStreamEncodeType m_encode_passes[2];
Timestamp m_last_send; Timestamp m_last_send;
Timestamp m_last_recv; Timestamp m_last_recv;
@@ -176,7 +176,7 @@ namespace EQ
std::list<DynamicPacket> m_buffered_packets; std::list<DynamicPacket> m_buffered_packets;
size_t m_buffered_packets_length; size_t m_buffered_packets_length;
std::unique_ptr<char[]> m_combined; std::unique_ptr<char[]> m_combined;
DaybreakConnectionStats m_stats; ReliableStreamConnectionStats m_stats;
Timestamp m_last_session_stats; Timestamp m_last_session_stats;
size_t m_rolling_ping; size_t m_rolling_ping;
Timestamp m_close_time; Timestamp m_close_time;
@@ -188,7 +188,7 @@ namespace EQ
bool m_acked_since_last_resend = false; bool m_acked_since_last_resend = false;
Timestamp m_last_ack; Timestamp m_last_ack;
struct DaybreakSentPacket struct ReliableStreamSentPacket
{ {
DynamicPacket packet; DynamicPacket packet;
Timestamp last_sent; Timestamp last_sent;
@@ -197,9 +197,9 @@ namespace EQ
size_t resend_delay; size_t resend_delay;
}; };
struct DaybreakStream struct ReliableStream
{ {
DaybreakStream() { ReliableStream() {
sequence_in = 0; sequence_in = 0;
sequence_out = 0; sequence_out = 0;
fragment_current_bytes = 0; fragment_current_bytes = 0;
@@ -214,11 +214,11 @@ namespace EQ
uint32_t fragment_current_bytes; uint32_t fragment_current_bytes;
uint32_t fragment_total_bytes; uint32_t fragment_total_bytes;
std::map<uint16_t, DaybreakSentPacket> sent_packets; std::map<uint16_t, ReliableStreamSentPacket> sent_packets;
}; };
DaybreakStream m_streams[4]; ReliableStream m_streams[4];
std::weak_ptr<DaybreakConnection> m_self; std::weak_ptr<ReliableStreamConnection> m_self;
void Process(); void Process();
void ProcessPacket(Packet &p); void ProcessPacket(Packet &p);
@@ -251,12 +251,12 @@ namespace EQ
void FlushBuffer(); void FlushBuffer();
SequenceOrder CompareSequence(uint16_t expected, uint16_t actual) const; SequenceOrder CompareSequence(uint16_t expected, uint16_t actual) const;
friend class DaybreakConnectionManager; friend class ReliableStreamConnectionManager;
}; };
struct DaybreakConnectionManagerOptions struct ReliableStreamConnectionManagerOptions
{ {
DaybreakConnectionManagerOptions() { ReliableStreamConnectionManagerOptions() {
max_connection_count = 0; max_connection_count = 0;
keepalive_delay_ms = 9000; keepalive_delay_ms = 9000;
resend_delay_ms = 30; resend_delay_ms = 30;
@@ -268,8 +268,8 @@ namespace EQ
connect_stale_ms = 5000; connect_stale_ms = 5000;
crc_length = 2; crc_length = 2;
max_packet_size = 512; max_packet_size = 512;
encode_passes[0] = DaybreakEncodeType::EncodeNone; encode_passes[0] = ReliableStreamEncodeType::EncodeNone;
encode_passes[1] = DaybreakEncodeType::EncodeNone; encode_passes[1] = ReliableStreamEncodeType::EncodeNone;
port = 0; port = 0;
hold_size = 512; hold_size = 512;
hold_length_ms = 50; hold_length_ms = 50;
@@ -299,28 +299,28 @@ namespace EQ
double tic_rate_hertz; double tic_rate_hertz;
size_t resend_timeout; size_t resend_timeout;
size_t connection_close_time; size_t connection_close_time;
DaybreakEncodeType encode_passes[2]; ReliableStreamEncodeType encode_passes[2];
int port; int port;
double outgoing_data_rate; double outgoing_data_rate;
}; };
class DaybreakConnectionManager class ReliableStreamConnectionManager
{ {
public: public:
DaybreakConnectionManager(); ReliableStreamConnectionManager();
DaybreakConnectionManager(const DaybreakConnectionManagerOptions &opts); ReliableStreamConnectionManager(const ReliableStreamConnectionManagerOptions &opts);
~DaybreakConnectionManager(); ~ReliableStreamConnectionManager();
void Connect(const std::string &addr, int port); void Connect(const std::string &addr, int port);
void Process(); void Process();
void UpdateDataBudget(); void UpdateDataBudget();
void ProcessResend(); void ProcessResend();
void OnNewConnection(std::function<void(std::shared_ptr<DaybreakConnection>)> func) { m_on_new_connection = func; } void OnNewConnection(std::function<void(std::shared_ptr<ReliableStreamConnection>)> func) { m_on_new_connection = func; }
void OnConnectionStateChange(std::function<void(std::shared_ptr<DaybreakConnection>, DbProtocolStatus, DbProtocolStatus)> func) { m_on_connection_state_change = func; } void OnConnectionStateChange(std::function<void(std::shared_ptr<ReliableStreamConnection>, DbProtocolStatus, DbProtocolStatus)> func) { m_on_connection_state_change = func; }
void OnPacketRecv(std::function<void(std::shared_ptr<DaybreakConnection>, const Packet &)> func) { m_on_packet_recv = func; } void OnPacketRecv(std::function<void(std::shared_ptr<ReliableStreamConnection>, const Packet &)> func) { m_on_packet_recv = func; }
void OnErrorMessage(std::function<void(const std::string&)> func) { m_on_error_message = func; } void OnErrorMessage(std::function<void(const std::string&)> func) { m_on_error_message = func; }
DaybreakConnectionManagerOptions& GetOptions() { return m_options; } ReliableStreamConnectionManagerOptions& GetOptions() { return m_options; }
private: private:
void Attach(uv_loop_t *loop); void Attach(uv_loop_t *loop);
void Detach(); void Detach();
@@ -329,18 +329,18 @@ namespace EQ
uv_timer_t m_timer; uv_timer_t m_timer;
uv_udp_t m_socket; uv_udp_t m_socket;
uv_loop_t *m_attached; uv_loop_t *m_attached;
DaybreakConnectionManagerOptions m_options; ReliableStreamConnectionManagerOptions m_options;
std::function<void(std::shared_ptr<DaybreakConnection>)> m_on_new_connection; std::function<void(std::shared_ptr<ReliableStreamConnection>)> m_on_new_connection;
std::function<void(std::shared_ptr<DaybreakConnection>, DbProtocolStatus, DbProtocolStatus)> m_on_connection_state_change; std::function<void(std::shared_ptr<ReliableStreamConnection>, DbProtocolStatus, DbProtocolStatus)> m_on_connection_state_change;
std::function<void(std::shared_ptr<DaybreakConnection>, const Packet&)> m_on_packet_recv; std::function<void(std::shared_ptr<ReliableStreamConnection>, const Packet&)> m_on_packet_recv;
std::function<void(const std::string&)> m_on_error_message; std::function<void(const std::string&)> m_on_error_message;
std::map<std::pair<std::string, int>, std::shared_ptr<DaybreakConnection>> m_connections; std::map<std::pair<std::string, int>, std::shared_ptr<ReliableStreamConnection>> m_connections;
void ProcessPacket(const std::string &endpoint, int port, const char *data, size_t size); void ProcessPacket(const std::string &endpoint, int port, const char *data, size_t size);
std::shared_ptr<DaybreakConnection> FindConnectionByEndpoint(std::string addr, int port); std::shared_ptr<ReliableStreamConnection> FindConnectionByEndpoint(std::string addr, int port);
void SendDisconnect(const std::string &addr, int port); void SendDisconnect(const std::string &addr, int port);
friend class DaybreakConnection; friend class ReliableStreamConnection;
}; };
} }
} }
@@ -8,7 +8,7 @@ namespace EQ
{ {
namespace Net namespace Net
{ {
struct DaybreakHeader struct ReliableStreamHeader
{ {
static size_t size() { return 2; } static size_t size() { return 2; }
uint8_t zero; uint8_t zero;
@@ -22,7 +22,7 @@ namespace EQ
} }
}; };
struct DaybreakConnect struct ReliableStreamConnect
{ {
static size_t size() { return 14; } static size_t size() { return 14; }
uint8_t zero; uint8_t zero;
@@ -42,7 +42,7 @@ namespace EQ
} }
}; };
struct DaybreakConnectReply struct ReliableStreamConnectReply
{ {
static size_t size() { return 17; } static size_t size() { return 17; }
uint8_t zero; uint8_t zero;
@@ -68,7 +68,7 @@ namespace EQ
} }
}; };
struct DaybreakDisconnect struct ReliableStreamDisconnect
{ {
static size_t size() { return 8; } static size_t size() { return 8; }
uint8_t zero; uint8_t zero;
@@ -84,7 +84,7 @@ namespace EQ
} }
}; };
struct DaybreakReliableHeader struct ReliableStreamReliableHeader
{ {
static size_t size() { return 4; } static size_t size() { return 4; }
uint8_t zero; uint8_t zero;
@@ -100,10 +100,10 @@ namespace EQ
} }
}; };
struct DaybreakReliableFragmentHeader struct ReliableStreamReliableFragmentHeader
{ {
static size_t size() { return 4 + DaybreakReliableHeader::size(); } static size_t size() { return 4 + ReliableStreamReliableHeader::size(); }
DaybreakReliableHeader reliable; ReliableStreamReliableHeader reliable;
uint32_t total_size; uint32_t total_size;
template <class Archive> template <class Archive>
@@ -114,7 +114,7 @@ namespace EQ
} }
}; };
struct DaybreakSessionStatRequest struct ReliableStreamSessionStatRequest
{ {
static size_t size() { return 40; } static size_t size() { return 40; }
uint8_t zero; uint8_t zero;
@@ -144,7 +144,7 @@ namespace EQ
} }
}; };
struct DaybreakSessionStatResponse struct ReliableStreamSessionStatResponse
{ {
static size_t size() { return 40; } static size_t size() { return 40; }
uint8_t zero; uint8_t zero;
+3 -3
View File
@@ -1059,7 +1059,7 @@ namespace Titanium
OUT(spawnid); OUT(spawnid);
OUT_str(charname); OUT_str(charname);
if (emu->race > 473) if (emu->race > 474)
eq->race = 1; eq->race = 1;
else else
OUT(race); OUT(race);
@@ -1840,7 +1840,7 @@ namespace Titanium
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr; emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
eq->Race[char_index] = emu_cse->Race; eq->Race[char_index] = emu_cse->Race;
if (eq->Race[char_index] > 473) if (eq->Race[char_index] > 474)
eq->Race[char_index] = 1; eq->Race[char_index] = 1;
for (int index = 0; index < EQ::textures::materialCount; ++index) { for (int index = 0; index < EQ::textures::materialCount; ++index) {
@@ -2421,7 +2421,7 @@ namespace Titanium
strcpy(eq->title, emu->title); strcpy(eq->title, emu->title);
// eq->unknown0274 = emu->unknown0274; // eq->unknown0274 = emu->unknown0274;
eq->helm = emu->helm; eq->helm = emu->helm;
if (emu->race > 473) if (emu->race > 474)
eq->race = 1; eq->race = 1;
else else
eq->race = emu->race; eq->race = emu->race;
+7 -27
View File
@@ -1,34 +1,14 @@
// types #pragma once
#include <limits>
#include <string>
#include <cctype>
#include <sstream>
// containers // Lightweight, widely used
#include <iterator> #include <string>
#include <set> #include <vector>
#include <unordered_set>
#include <map> #include <map>
#include <unordered_map> #include <unordered_map>
#include <list>
#include <vector>
// utilities
#include <iostream>
#include <cassert>
#include <cmath>
#include <memory> #include <memory>
#include <functional> #include <limits>
#include <algorithm> #include <cstdint>
#include <utility> #include <cassert>
#include <tuple>
#include <fstream>
#include <cstdio>
// fmt // fmt
#include <fmt/format.h> #include <fmt/format.h>
// lua
#include "lua.hpp"
#include <luabind/luabind.hpp>
#include <luabind/object.hpp>
+413 -658
View File
File diff suppressed because it is too large Load Diff
+89 -113
View File
@@ -21,103 +21,7 @@
#include "../common/types.h" #include "../common/types.h"
#include <string> #include <string>
namespace Gender {
constexpr uint8 Male = 0;
constexpr uint8 Female = 1;
constexpr uint8 Neuter = 2;
}
//theres a big list straight from the client below.
#define HUMAN 1
#define BARBARIAN 2
#define ERUDITE 3
#define WOOD_ELF 4
#define HIGH_ELF 5
#define DARK_ELF 6
#define HALF_ELF 7
#define DWARF 8
#define TROLL 9
#define OGRE 10
#define HALFLING 11
#define GNOME 12
#define WEREWOLF 14
#define WOLF 42
#define BEAR 43
#define SKELETON 60
#define TIGER 63
#define ELEMENTAL 75
#define ALLIGATOR 91
#define OGGOK_CITIZEN 93
#define EYE_OF_ZOMM 108
#define WOLF_ELEMENTAL 120
#define INVISIBLE_MAN 127
#define IKSAR 128
#define VAHSHIR 130
#define CONTROLLED_BOAT 141
#define MINOR_ILL_OBJ 142
#define TREE 143
#define IKSAR_SKELETON 161
#define FROGLOK 330
// TODO: check all clients for (BYTE) usage of '/who all' class and remove FROGLOK2, if possible (330 - 74 = 256 .. WORD->BYTE conversion loss...)
#define FROGLOK2 74 // Not sure why /who all reports race as 74 for frogloks
#define FAIRY 473
#define DRAKKIN 522 // 32768
#define EMU_RACE_NPC 131069 // was 65533
#define EMU_RACE_PET 131070 // was 65534
#define EMU_RACE_UNKNOWN 131071 // was 65535
// player race values
#define PLAYER_RACE_UNKNOWN 0
#define PLAYER_RACE_HUMAN 1
#define PLAYER_RACE_BARBARIAN 2
#define PLAYER_RACE_ERUDITE 3
#define PLAYER_RACE_WOOD_ELF 4
#define PLAYER_RACE_HIGH_ELF 5
#define PLAYER_RACE_DARK_ELF 6
#define PLAYER_RACE_HALF_ELF 7
#define PLAYER_RACE_DWARF 8
#define PLAYER_RACE_TROLL 9
#define PLAYER_RACE_OGRE 10
#define PLAYER_RACE_HALFLING 11
#define PLAYER_RACE_GNOME 12
#define PLAYER_RACE_IKSAR 13
#define PLAYER_RACE_VAHSHIR 14
#define PLAYER_RACE_FROGLOK 15
#define PLAYER_RACE_DRAKKIN 16
#define PLAYER_RACE_COUNT 16
#define PLAYER_RACE_EMU_NPC 17
#define PLAYER_RACE_EMU_PET 18
#define PLAYER_RACE_EMU_COUNT 19
// player race bits
#define PLAYER_RACE_UNKNOWN_BIT 0
#define PLAYER_RACE_HUMAN_BIT 1
#define PLAYER_RACE_BARBARIAN_BIT 2
#define PLAYER_RACE_ERUDITE_BIT 4
#define PLAYER_RACE_WOOD_ELF_BIT 8
#define PLAYER_RACE_HIGH_ELF_BIT 16
#define PLAYER_RACE_DARK_ELF_BIT 32
#define PLAYER_RACE_HALF_ELF_BIT 64
#define PLAYER_RACE_DWARF_BIT 128
#define PLAYER_RACE_TROLL_BIT 256
#define PLAYER_RACE_OGRE_BIT 512
#define PLAYER_RACE_HALFLING_BIT 1024
#define PLAYER_RACE_GNOME_BIT 2048
#define PLAYER_RACE_IKSAR_BIT 4096
#define PLAYER_RACE_VAHSHIR_BIT 8192
#define PLAYER_RACE_FROGLOK_BIT 16384
#define PLAYER_RACE_DRAKKIN_BIT 32768
#define PLAYER_RACE_ALL_MASK 65535
const char* GetRaceIDName(uint16 race_id); const char* GetRaceIDName(uint16 race_id);
const char* GetPlayerRaceName(uint32 player_race_value);
const char* GetGenderName(uint32 gender_id); const char* GetGenderName(uint32 gender_id);
bool IsPlayerRace(uint16 race_id); bool IsPlayerRace(uint16 race_id);
@@ -127,25 +31,13 @@ uint32 GetPlayerRaceValue(uint16 race_id);
uint16 GetPlayerRaceBit(uint16 race_id); uint16 GetPlayerRaceBit(uint16 race_id);
uint16 GetRaceIDFromPlayerRaceValue(uint32 player_race_value); uint16 GetRaceIDFromPlayerRaceValue(uint32 player_race_value);
uint16 GetRaceIDFromPlayerRaceBit(uint32 player_race_bit);
float GetRaceGenderDefaultHeight(int race, int gender); float GetRaceGenderDefaultHeight(int race, int gender);
// player race-/gender-based model feature validators namespace Gender {
namespace PlayerAppearance constexpr uint8 Male = 0;
{ constexpr uint8 Female = 1;
bool IsValidBeard(uint16 race_id, uint8 gender_id, uint8 beard_value, bool use_luclin = true); constexpr uint8 Neuter = 2;
bool IsValidBeardColor(uint16 race_id, uint8 gender_id, uint8 beard_color_value, bool use_luclin = true);
bool IsValidDetail(uint16 race_id, uint8 gender_id, uint32 detail_value, bool use_luclin = true);
bool IsValidEyeColor(uint16 race_id, uint8 gender_id, uint8 eye_color_value, bool use_luclin = true);
bool IsValidFace(uint16 race_id, uint8 gender_id, uint8 face_value, bool use_luclin = true);
bool IsValidHair(uint16 race_id, uint8 gender_id, uint8 hair_value, bool use_luclin = true);
bool IsValidHairColor(uint16 race_id, uint8 gender_id, uint8 hair_color_value, bool use_luclin = true);
bool IsValidHead(uint16 race_id, uint8 gender_id, uint8 head_value, bool use_luclin = true);
bool IsValidHeritage(uint16 race_id, uint8 gender_id, uint32 heritage_value, bool use_luclin = true);
bool IsValidTattoo(uint16 race_id, uint8 gender_id, uint32 tattoo_value, bool use_luclin = true);
bool IsValidTexture(uint16 race_id, uint8 gender_id, uint8 texture_value, bool use_luclin = true);
bool IsValidWoad(uint16 race_id, uint8 gender_id, uint8 woad_value, bool use_luclin = true);
} }
namespace Race { namespace Race {
@@ -884,8 +776,92 @@ namespace Race {
constexpr uint16 Pegasus3 = 732; constexpr uint16 Pegasus3 = 732;
constexpr uint16 InteractiveObject = 2250; constexpr uint16 InteractiveObject = 2250;
constexpr uint16 Node = 2254; constexpr uint16 Node = 2254;
}
constexpr uint16 ALL_RACES_BITMASK = 65535; namespace RaceBitmask {
constexpr uint16 Unknown = 0;
constexpr uint16 Human = 1;
constexpr uint16 Barbarian = 2;
constexpr uint16 Erudite = 4;
constexpr uint16 WoodElf = 8;
constexpr uint16 HighElf = 16;
constexpr uint16 DarkElf = 32;
constexpr uint16 HalfElf = 64;
constexpr uint16 Dwarf = 128;
constexpr uint16 Troll = 256;
constexpr uint16 Ogre = 512;
constexpr uint16 Halfling = 1024;
constexpr uint16 Gnome = 2048;
constexpr uint16 Iksar = 4096;
constexpr uint16 VahShir = 8192;
constexpr uint16 Froglok = 16384;
constexpr uint16 Drakkin = 32768;
constexpr uint16 All = 65535;
}
namespace RaceIndex {
constexpr uint16 Human = 1;
constexpr uint16 Barbarian = 2;
constexpr uint16 Erudite = 3;
constexpr uint16 WoodElf = 4;
constexpr uint16 HighElf = 5;
constexpr uint16 DarkElf = 6;
constexpr uint16 HalfElf = 7;
constexpr uint16 Dwarf = 8;
constexpr uint16 Troll = 9;
constexpr uint16 Ogre = 10;
constexpr uint16 Halfling = 11;
constexpr uint16 Gnome = 12;
constexpr uint16 Iksar = 13;
constexpr uint16 VahShir = 14;
constexpr uint16 Froglok = 15;
constexpr uint16 Drakkin = 16;
}
namespace RaceAppearance {
bool IsValidBeard(uint16 race_id, uint8 gender_id, uint8 beard_value, bool use_luclin = true);
bool IsValidBeardColor(uint16 race_id, uint8 gender_id, uint8 beard_color_value, bool use_luclin = true);
bool IsValidDetail(uint16 race_id, uint8 gender_id, uint32 detail_value, bool use_luclin = true);
bool IsValidEyeColor(uint16 race_id, uint8 gender_id, uint8 eye_color_value, bool use_luclin = true);
bool IsValidFace(uint16 race_id, uint8 gender_id, uint8 face_value, bool use_luclin = true);
bool IsValidHair(uint16 race_id, uint8 gender_id, uint8 hair_value, bool use_luclin = true);
bool IsValidHairColor(uint16 race_id, uint8 gender_id, uint8 hair_color_value, bool use_luclin = true);
bool IsValidHeritage(uint16 race_id, uint8 gender_id, uint32 heritage_value, bool use_luclin = true);
bool IsValidTattoo(uint16 race_id, uint8 gender_id, uint32 tattoo_value, bool use_luclin = true);
bool IsValidWoad(uint16 race_id, uint8 gender_id, uint8 woad_value, bool use_luclin = true);
constexpr int HumanMale = (Race::Human << 8) | Gender::Male;
constexpr int HumanFemale = (Race::Human << 8) | Gender::Female;
constexpr int BarbarianMale = (Race::Barbarian << 8) | Gender::Male;
constexpr int BarbarianFemale = (Race::Barbarian << 8) | Gender::Female;
constexpr int EruditeMale = (Race::Erudite << 8) | Gender::Male;
constexpr int EruditeFemale = (Race::Erudite << 8) | Gender::Female;
constexpr int WoodElfMale = (Race::WoodElf << 8) | Gender::Male;
constexpr int WoodElfFemale = (Race::WoodElf << 8) | Gender::Female;
constexpr int HighElfMale = (Race::HighElf << 8) | Gender::Male;
constexpr int HighElfFemale = (Race::HighElf << 8) | Gender::Female;
constexpr int DarkElfMale = (Race::DarkElf << 8) | Gender::Male;
constexpr int DarkElfFemale = (Race::DarkElf << 8) | Gender::Female;
constexpr int HalfElfMale = (Race::HalfElf << 8) | Gender::Male;
constexpr int HalfElfFemale = (Race::HalfElf << 8) | Gender::Female;
constexpr int DwarfMale = (Race::Dwarf << 8) | Gender::Male;
constexpr int DwarfFemale = (Race::Dwarf << 8) | Gender::Female;
constexpr int TrollMale = (Race::Troll << 8) | Gender::Male;
constexpr int TrollFemale = (Race::Troll << 8) | Gender::Female;
constexpr int OgreMale = (Race::Ogre << 8) | Gender::Male;
constexpr int OgreFemale = (Race::Ogre << 8) | Gender::Female;
constexpr int HalflingMale = (Race::Halfling << 8) | Gender::Male;
constexpr int HalflingFemale = (Race::Halfling << 8) | Gender::Female;
constexpr int GnomeMale = (Race::Gnome << 8) | Gender::Male;
constexpr int GnomeFemale = (Race::Gnome << 8) | Gender::Female;
constexpr int IksarMale = (Race::Iksar << 8) | Gender::Male;
constexpr int IksarFemale = (Race::Iksar << 8) | Gender::Female;
constexpr int VahShirMale = (Race::VahShir << 8) | Gender::Male;
constexpr int VahShirFemale = (Race::VahShir << 8) | Gender::Female;
constexpr int FroglokMale = (Race::Froglok2 << 8) | Gender::Male;
constexpr int FroglokFemale = (Race::Froglok2 << 8) | Gender::Female;
constexpr int DrakkinMale = (Race::Drakkin << 8) | Gender::Male;
constexpr int DrakkinFemale = (Race::Drakkin << 8) | Gender::Female;
} }
#endif #endif
@@ -0,0 +1,404 @@
/**
* DO NOT MODIFY THIS FILE
*
* This repository was automatically generated and is NOT to be modified directly.
* Any repository modifications are meant to be made to the repository extending the base.
* Any modifications to base repositories are to be made by the generator only
*
* @generator ./utils/scripts/generators/repository-generator.pl
* @docs https://docs.eqemu.io/developer/repositories
*/
#ifndef EQEMU_BASE_BOT_STAT_CAPS_REPOSITORY_H
#define EQEMU_BASE_BOT_STAT_CAPS_REPOSITORY_H
#include "../../database.h"
#include "../../strings.h"
#include <ctime>
class BaseBotStatCapsRepository {
public:
struct BotStatCaps {
uint32_t bot_id;
uint8_t stat_id;
int32_t stat_cap;
};
static std::string PrimaryKey()
{
return std::string("bot_id");
}
static std::vector<std::string> Columns()
{
return {
"bot_id",
"stat_id",
"stat_cap",
};
}
static std::vector<std::string> SelectColumns()
{
return {
"bot_id",
"stat_id",
"stat_cap",
};
}
static std::string ColumnsRaw()
{
return std::string(Strings::Implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(Strings::Implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("bot_stat_caps");
}
static std::string BaseSelect()
{
return fmt::format(
"SELECT {} FROM {}",
SelectColumnsRaw(),
TableName()
);
}
static std::string BaseInsert()
{
return fmt::format(
"INSERT INTO {} ({}) ",
TableName(),
ColumnsRaw()
);
}
static BotStatCaps NewEntity()
{
BotStatCaps e{};
e.bot_id = 0;
e.stat_id = 0;
e.stat_cap = -1;
return e;
}
static BotStatCaps GetBotStatCaps(
const std::vector<BotStatCaps> &bot_stat_capss,
int bot_stat_caps_id
)
{
for (auto &bot_stat_caps : bot_stat_capss) {
if (bot_stat_caps.bot_id == bot_stat_caps_id) {
return bot_stat_caps;
}
}
return NewEntity();
}
static BotStatCaps FindOne(
Database& db,
int bot_stat_caps_id
)
{
auto results = db.QueryDatabase(
fmt::format(
"{} WHERE {} = {} LIMIT 1",
BaseSelect(),
PrimaryKey(),
bot_stat_caps_id
)
);
auto row = results.begin();
if (results.RowCount() == 1) {
BotStatCaps e{};
e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.stat_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
e.stat_cap = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
return e;
}
return NewEntity();
}
static int DeleteOne(
Database& db,
int bot_stat_caps_id
)
{
auto results = db.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {} = {}",
TableName(),
PrimaryKey(),
bot_stat_caps_id
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static int UpdateOne(
Database& db,
const BotStatCaps &e
)
{
std::vector<std::string> v;
auto columns = Columns();
v.push_back(columns[0] + " = " + std::to_string(e.bot_id));
v.push_back(columns[1] + " = " + std::to_string(e.stat_id));
v.push_back(columns[2] + " = " + std::to_string(e.stat_cap));
auto results = db.QueryDatabase(
fmt::format(
"UPDATE {} SET {} WHERE {} = {}",
TableName(),
Strings::Implode(", ", v),
PrimaryKey(),
e.bot_id
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static BotStatCaps InsertOne(
Database& db,
BotStatCaps e
)
{
std::vector<std::string> v;
v.push_back(std::to_string(e.bot_id));
v.push_back(std::to_string(e.stat_id));
v.push_back(std::to_string(e.stat_cap));
auto results = db.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseInsert(),
Strings::Implode(",", v)
)
);
if (results.Success()) {
e.bot_id = results.LastInsertedID();
return e;
}
e = NewEntity();
return e;
}
static int InsertMany(
Database& db,
const std::vector<BotStatCaps> &entries
)
{
std::vector<std::string> insert_chunks;
for (auto &e: entries) {
std::vector<std::string> v;
v.push_back(std::to_string(e.bot_id));
v.push_back(std::to_string(e.stat_id));
v.push_back(std::to_string(e.stat_cap));
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
}
std::vector<std::string> v;
auto results = db.QueryDatabase(
fmt::format(
"{} VALUES {}",
BaseInsert(),
Strings::Implode(",", insert_chunks)
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static std::vector<BotStatCaps> All(Database& db)
{
std::vector<BotStatCaps> all_entries;
auto results = db.QueryDatabase(
fmt::format(
"{}",
BaseSelect()
)
);
all_entries.reserve(results.RowCount());
for (auto row = results.begin(); row != results.end(); ++row) {
BotStatCaps e{};
e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.stat_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
e.stat_cap = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
all_entries.push_back(e);
}
return all_entries;
}
static std::vector<BotStatCaps> GetWhere(Database& db, const std::string &where_filter)
{
std::vector<BotStatCaps> all_entries;
auto results = db.QueryDatabase(
fmt::format(
"{} WHERE {}",
BaseSelect(),
where_filter
)
);
all_entries.reserve(results.RowCount());
for (auto row = results.begin(); row != results.end(); ++row) {
BotStatCaps e{};
e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.stat_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
e.stat_cap = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
all_entries.push_back(e);
}
return all_entries;
}
static int DeleteWhere(Database& db, const std::string &where_filter)
{
auto results = db.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {}",
TableName(),
where_filter
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static int Truncate(Database& db)
{
auto results = db.QueryDatabase(
fmt::format(
"TRUNCATE TABLE {}",
TableName()
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static int64 GetMaxId(Database& db)
{
auto results = db.QueryDatabase(
fmt::format(
"SELECT COALESCE(MAX({}), 0) FROM {}",
PrimaryKey(),
TableName()
)
);
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
}
static int64 Count(Database& db, const std::string &where_filter = "")
{
auto results = db.QueryDatabase(
fmt::format(
"SELECT COUNT(*) FROM {} {}",
TableName(),
(where_filter.empty() ? "" : "WHERE " + where_filter)
)
);
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
}
static std::string BaseReplace()
{
return fmt::format(
"REPLACE INTO {} ({}) ",
TableName(),
ColumnsRaw()
);
}
static int ReplaceOne(
Database& db,
const BotStatCaps &e
)
{
std::vector<std::string> v;
v.push_back(std::to_string(e.bot_id));
v.push_back(std::to_string(e.stat_id));
v.push_back(std::to_string(e.stat_cap));
auto results = db.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseReplace(),
Strings::Implode(",", v)
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static int ReplaceMany(
Database& db,
const std::vector<BotStatCaps> &entries
)
{
std::vector<std::string> insert_chunks;
for (auto &e: entries) {
std::vector<std::string> v;
v.push_back(std::to_string(e.bot_id));
v.push_back(std::to_string(e.stat_id));
v.push_back(std::to_string(e.stat_cap));
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
}
std::vector<std::string> v;
auto results = db.QueryDatabase(
fmt::format(
"{} VALUES {}",
BaseReplace(),
Strings::Implode(",", insert_chunks)
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
};
#endif //EQEMU_BASE_BOT_STAT_CAPS_REPOSITORY_H
@@ -0,0 +1,404 @@
/**
* DO NOT MODIFY THIS FILE
*
* This repository was automatically generated and is NOT to be modified directly.
* Any repository modifications are meant to be made to the repository extending the base.
* Any modifications to base repositories are to be made by the generator only
*
* @generator ./utils/scripts/generators/repository-generator.pl
* @docs https://docs.eqemu.io/developer/repositories
*/
#ifndef EQEMU_BASE_CHARACTER_STAT_CAPS_REPOSITORY_H
#define EQEMU_BASE_CHARACTER_STAT_CAPS_REPOSITORY_H
#include "../../database.h"
#include "../../strings.h"
#include <ctime>
class BaseCharacterStatCapsRepository {
public:
struct CharacterStatCaps {
uint32_t character_id;
uint8_t stat_id;
int32_t stat_cap;
};
static std::string PrimaryKey()
{
return std::string("character_id");
}
static std::vector<std::string> Columns()
{
return {
"character_id",
"stat_id",
"stat_cap",
};
}
static std::vector<std::string> SelectColumns()
{
return {
"character_id",
"stat_id",
"stat_cap",
};
}
static std::string ColumnsRaw()
{
return std::string(Strings::Implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(Strings::Implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_stat_caps");
}
static std::string BaseSelect()
{
return fmt::format(
"SELECT {} FROM {}",
SelectColumnsRaw(),
TableName()
);
}
static std::string BaseInsert()
{
return fmt::format(
"INSERT INTO {} ({}) ",
TableName(),
ColumnsRaw()
);
}
static CharacterStatCaps NewEntity()
{
CharacterStatCaps e{};
e.character_id = 0;
e.stat_id = 0;
e.stat_cap = -1;
return e;
}
static CharacterStatCaps GetCharacterStatCaps(
const std::vector<CharacterStatCaps> &character_stat_capss,
int character_stat_caps_id
)
{
for (auto &character_stat_caps : character_stat_capss) {
if (character_stat_caps.character_id == character_stat_caps_id) {
return character_stat_caps;
}
}
return NewEntity();
}
static CharacterStatCaps FindOne(
Database& db,
int character_stat_caps_id
)
{
auto results = db.QueryDatabase(
fmt::format(
"{} WHERE {} = {} LIMIT 1",
BaseSelect(),
PrimaryKey(),
character_stat_caps_id
)
);
auto row = results.begin();
if (results.RowCount() == 1) {
CharacterStatCaps e{};
e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.stat_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
e.stat_cap = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
return e;
}
return NewEntity();
}
static int DeleteOne(
Database& db,
int character_stat_caps_id
)
{
auto results = db.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {} = {}",
TableName(),
PrimaryKey(),
character_stat_caps_id
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static int UpdateOne(
Database& db,
const CharacterStatCaps &e
)
{
std::vector<std::string> v;
auto columns = Columns();
v.push_back(columns[0] + " = " + std::to_string(e.character_id));
v.push_back(columns[1] + " = " + std::to_string(e.stat_id));
v.push_back(columns[2] + " = " + std::to_string(e.stat_cap));
auto results = db.QueryDatabase(
fmt::format(
"UPDATE {} SET {} WHERE {} = {}",
TableName(),
Strings::Implode(", ", v),
PrimaryKey(),
e.character_id
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static CharacterStatCaps InsertOne(
Database& db,
CharacterStatCaps e
)
{
std::vector<std::string> v;
v.push_back(std::to_string(e.character_id));
v.push_back(std::to_string(e.stat_id));
v.push_back(std::to_string(e.stat_cap));
auto results = db.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseInsert(),
Strings::Implode(",", v)
)
);
if (results.Success()) {
e.character_id = results.LastInsertedID();
return e;
}
e = NewEntity();
return e;
}
static int InsertMany(
Database& db,
const std::vector<CharacterStatCaps> &entries
)
{
std::vector<std::string> insert_chunks;
for (auto &e: entries) {
std::vector<std::string> v;
v.push_back(std::to_string(e.character_id));
v.push_back(std::to_string(e.stat_id));
v.push_back(std::to_string(e.stat_cap));
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
}
std::vector<std::string> v;
auto results = db.QueryDatabase(
fmt::format(
"{} VALUES {}",
BaseInsert(),
Strings::Implode(",", insert_chunks)
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static std::vector<CharacterStatCaps> All(Database& db)
{
std::vector<CharacterStatCaps> all_entries;
auto results = db.QueryDatabase(
fmt::format(
"{}",
BaseSelect()
)
);
all_entries.reserve(results.RowCount());
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterStatCaps e{};
e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.stat_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
e.stat_cap = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
all_entries.push_back(e);
}
return all_entries;
}
static std::vector<CharacterStatCaps> GetWhere(Database& db, const std::string &where_filter)
{
std::vector<CharacterStatCaps> all_entries;
auto results = db.QueryDatabase(
fmt::format(
"{} WHERE {}",
BaseSelect(),
where_filter
)
);
all_entries.reserve(results.RowCount());
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterStatCaps e{};
e.character_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.stat_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
e.stat_cap = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
all_entries.push_back(e);
}
return all_entries;
}
static int DeleteWhere(Database& db, const std::string &where_filter)
{
auto results = db.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {}",
TableName(),
where_filter
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static int Truncate(Database& db)
{
auto results = db.QueryDatabase(
fmt::format(
"TRUNCATE TABLE {}",
TableName()
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static int64 GetMaxId(Database& db)
{
auto results = db.QueryDatabase(
fmt::format(
"SELECT COALESCE(MAX({}), 0) FROM {}",
PrimaryKey(),
TableName()
)
);
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
}
static int64 Count(Database& db, const std::string &where_filter = "")
{
auto results = db.QueryDatabase(
fmt::format(
"SELECT COUNT(*) FROM {} {}",
TableName(),
(where_filter.empty() ? "" : "WHERE " + where_filter)
)
);
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
}
static std::string BaseReplace()
{
return fmt::format(
"REPLACE INTO {} ({}) ",
TableName(),
ColumnsRaw()
);
}
static int ReplaceOne(
Database& db,
const CharacterStatCaps &e
)
{
std::vector<std::string> v;
v.push_back(std::to_string(e.character_id));
v.push_back(std::to_string(e.stat_id));
v.push_back(std::to_string(e.stat_cap));
auto results = db.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseReplace(),
Strings::Implode(",", v)
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static int ReplaceMany(
Database& db,
const std::vector<CharacterStatCaps> &entries
)
{
std::vector<std::string> insert_chunks;
for (auto &e: entries) {
std::vector<std::string> v;
v.push_back(std::to_string(e.character_id));
v.push_back(std::to_string(e.stat_id));
v.push_back(std::to_string(e.stat_cap));
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
}
std::vector<std::string> v;
auto results = db.QueryDatabase(
fmt::format(
"{} VALUES {}",
BaseReplace(),
Strings::Implode(",", insert_chunks)
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
};
#endif //EQEMU_BASE_CHARACTER_STAT_CAPS_REPOSITORY_H
@@ -70,6 +70,7 @@ public:
int32_t endurance_regen; int32_t endurance_regen;
int32_t shielding; int32_t shielding;
int32_t spell_damage; int32_t spell_damage;
int32_t heal_amount;
int32_t spell_shielding; int32_t spell_shielding;
int32_t strikethrough; int32_t strikethrough;
int32_t stun_resist; int32_t stun_resist;
@@ -154,6 +155,7 @@ public:
"endurance_regen", "endurance_regen",
"shielding", "shielding",
"spell_damage", "spell_damage",
"heal_amount",
"spell_shielding", "spell_shielding",
"strikethrough", "strikethrough",
"stun_resist", "stun_resist",
@@ -234,6 +236,7 @@ public:
"endurance_regen", "endurance_regen",
"shielding", "shielding",
"spell_damage", "spell_damage",
"heal_amount",
"spell_shielding", "spell_shielding",
"strikethrough", "strikethrough",
"stun_resist", "stun_resist",
@@ -348,6 +351,7 @@ public:
e.endurance_regen = 0; e.endurance_regen = 0;
e.shielding = 0; e.shielding = 0;
e.spell_damage = 0; e.spell_damage = 0;
e.heal_amount = 0;
e.spell_shielding = 0; e.spell_shielding = 0;
e.strikethrough = 0; e.strikethrough = 0;
e.stun_resist = 0; e.stun_resist = 0;
@@ -458,29 +462,30 @@ public:
e.endurance_regen = row[48] ? static_cast<int32_t>(atoi(row[48])) : 0; e.endurance_regen = row[48] ? static_cast<int32_t>(atoi(row[48])) : 0;
e.shielding = row[49] ? static_cast<int32_t>(atoi(row[49])) : 0; e.shielding = row[49] ? static_cast<int32_t>(atoi(row[49])) : 0;
e.spell_damage = row[50] ? static_cast<int32_t>(atoi(row[50])) : 0; e.spell_damage = row[50] ? static_cast<int32_t>(atoi(row[50])) : 0;
e.spell_shielding = row[51] ? static_cast<int32_t>(atoi(row[51])) : 0; e.heal_amount = row[51] ? static_cast<int32_t>(atoi(row[51])) : 0;
e.strikethrough = row[52] ? static_cast<int32_t>(atoi(row[52])) : 0; e.spell_shielding = row[52] ? static_cast<int32_t>(atoi(row[52])) : 0;
e.stun_resist = row[53] ? static_cast<int32_t>(atoi(row[53])) : 0; e.strikethrough = row[53] ? static_cast<int32_t>(atoi(row[53])) : 0;
e.backstab = row[54] ? static_cast<int32_t>(atoi(row[54])) : 0; e.stun_resist = row[54] ? static_cast<int32_t>(atoi(row[54])) : 0;
e.wind = row[55] ? static_cast<int32_t>(atoi(row[55])) : 0; e.backstab = row[55] ? static_cast<int32_t>(atoi(row[55])) : 0;
e.brass = row[56] ? static_cast<int32_t>(atoi(row[56])) : 0; e.wind = row[56] ? static_cast<int32_t>(atoi(row[56])) : 0;
e.string = row[57] ? static_cast<int32_t>(atoi(row[57])) : 0; e.brass = row[57] ? static_cast<int32_t>(atoi(row[57])) : 0;
e.percussion = row[58] ? static_cast<int32_t>(atoi(row[58])) : 0; e.string = row[58] ? static_cast<int32_t>(atoi(row[58])) : 0;
e.singing = row[59] ? static_cast<int32_t>(atoi(row[59])) : 0; e.percussion = row[59] ? static_cast<int32_t>(atoi(row[59])) : 0;
e.baking = row[60] ? static_cast<int32_t>(atoi(row[60])) : 0; e.singing = row[60] ? static_cast<int32_t>(atoi(row[60])) : 0;
e.alchemy = row[61] ? static_cast<int32_t>(atoi(row[61])) : 0; e.baking = row[61] ? static_cast<int32_t>(atoi(row[61])) : 0;
e.tailoring = row[62] ? static_cast<int32_t>(atoi(row[62])) : 0; e.alchemy = row[62] ? static_cast<int32_t>(atoi(row[62])) : 0;
e.blacksmithing = row[63] ? static_cast<int32_t>(atoi(row[63])) : 0; e.tailoring = row[63] ? static_cast<int32_t>(atoi(row[63])) : 0;
e.fletching = row[64] ? static_cast<int32_t>(atoi(row[64])) : 0; e.blacksmithing = row[64] ? static_cast<int32_t>(atoi(row[64])) : 0;
e.brewing = row[65] ? static_cast<int32_t>(atoi(row[65])) : 0; e.fletching = row[65] ? static_cast<int32_t>(atoi(row[65])) : 0;
e.jewelry = row[66] ? static_cast<int32_t>(atoi(row[66])) : 0; e.brewing = row[66] ? static_cast<int32_t>(atoi(row[66])) : 0;
e.pottery = row[67] ? static_cast<int32_t>(atoi(row[67])) : 0; e.jewelry = row[67] ? static_cast<int32_t>(atoi(row[67])) : 0;
e.research = row[68] ? static_cast<int32_t>(atoi(row[68])) : 0; e.pottery = row[68] ? static_cast<int32_t>(atoi(row[68])) : 0;
e.alcohol = row[69] ? static_cast<int32_t>(atoi(row[69])) : 0; e.research = row[69] ? static_cast<int32_t>(atoi(row[69])) : 0;
e.fishing = row[70] ? static_cast<int32_t>(atoi(row[70])) : 0; e.alcohol = row[70] ? static_cast<int32_t>(atoi(row[70])) : 0;
e.tinkering = row[71] ? static_cast<int32_t>(atoi(row[71])) : 0; e.fishing = row[71] ? static_cast<int32_t>(atoi(row[71])) : 0;
e.created_at = strtoll(row[72] ? row[72] : "-1", nullptr, 10); e.tinkering = row[72] ? static_cast<int32_t>(atoi(row[72])) : 0;
e.updated_at = strtoll(row[73] ? row[73] : "-1", nullptr, 10); e.created_at = strtoll(row[73] ? row[73] : "-1", nullptr, 10);
e.updated_at = strtoll(row[74] ? row[74] : "-1", nullptr, 10);
return e; return e;
} }
@@ -565,29 +570,30 @@ public:
v.push_back(columns[48] + " = " + std::to_string(e.endurance_regen)); v.push_back(columns[48] + " = " + std::to_string(e.endurance_regen));
v.push_back(columns[49] + " = " + std::to_string(e.shielding)); v.push_back(columns[49] + " = " + std::to_string(e.shielding));
v.push_back(columns[50] + " = " + std::to_string(e.spell_damage)); v.push_back(columns[50] + " = " + std::to_string(e.spell_damage));
v.push_back(columns[51] + " = " + std::to_string(e.spell_shielding)); v.push_back(columns[51] + " = " + std::to_string(e.heal_amount));
v.push_back(columns[52] + " = " + std::to_string(e.strikethrough)); v.push_back(columns[52] + " = " + std::to_string(e.spell_shielding));
v.push_back(columns[53] + " = " + std::to_string(e.stun_resist)); v.push_back(columns[53] + " = " + std::to_string(e.strikethrough));
v.push_back(columns[54] + " = " + std::to_string(e.backstab)); v.push_back(columns[54] + " = " + std::to_string(e.stun_resist));
v.push_back(columns[55] + " = " + std::to_string(e.wind)); v.push_back(columns[55] + " = " + std::to_string(e.backstab));
v.push_back(columns[56] + " = " + std::to_string(e.brass)); v.push_back(columns[56] + " = " + std::to_string(e.wind));
v.push_back(columns[57] + " = " + std::to_string(e.string)); v.push_back(columns[57] + " = " + std::to_string(e.brass));
v.push_back(columns[58] + " = " + std::to_string(e.percussion)); v.push_back(columns[58] + " = " + std::to_string(e.string));
v.push_back(columns[59] + " = " + std::to_string(e.singing)); v.push_back(columns[59] + " = " + std::to_string(e.percussion));
v.push_back(columns[60] + " = " + std::to_string(e.baking)); v.push_back(columns[60] + " = " + std::to_string(e.singing));
v.push_back(columns[61] + " = " + std::to_string(e.alchemy)); v.push_back(columns[61] + " = " + std::to_string(e.baking));
v.push_back(columns[62] + " = " + std::to_string(e.tailoring)); v.push_back(columns[62] + " = " + std::to_string(e.alchemy));
v.push_back(columns[63] + " = " + std::to_string(e.blacksmithing)); v.push_back(columns[63] + " = " + std::to_string(e.tailoring));
v.push_back(columns[64] + " = " + std::to_string(e.fletching)); v.push_back(columns[64] + " = " + std::to_string(e.blacksmithing));
v.push_back(columns[65] + " = " + std::to_string(e.brewing)); v.push_back(columns[65] + " = " + std::to_string(e.fletching));
v.push_back(columns[66] + " = " + std::to_string(e.jewelry)); v.push_back(columns[66] + " = " + std::to_string(e.brewing));
v.push_back(columns[67] + " = " + std::to_string(e.pottery)); v.push_back(columns[67] + " = " + std::to_string(e.jewelry));
v.push_back(columns[68] + " = " + std::to_string(e.research)); v.push_back(columns[68] + " = " + std::to_string(e.pottery));
v.push_back(columns[69] + " = " + std::to_string(e.alcohol)); v.push_back(columns[69] + " = " + std::to_string(e.research));
v.push_back(columns[70] + " = " + std::to_string(e.fishing)); v.push_back(columns[70] + " = " + std::to_string(e.alcohol));
v.push_back(columns[71] + " = " + std::to_string(e.tinkering)); v.push_back(columns[71] + " = " + std::to_string(e.fishing));
v.push_back(columns[72] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")"); v.push_back(columns[72] + " = " + std::to_string(e.tinkering));
v.push_back(columns[73] + " = FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")"); v.push_back(columns[73] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
v.push_back(columns[74] + " = FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");
auto results = db.QueryDatabase( auto results = db.QueryDatabase(
fmt::format( fmt::format(
@@ -660,6 +666,7 @@ public:
v.push_back(std::to_string(e.endurance_regen)); v.push_back(std::to_string(e.endurance_regen));
v.push_back(std::to_string(e.shielding)); v.push_back(std::to_string(e.shielding));
v.push_back(std::to_string(e.spell_damage)); v.push_back(std::to_string(e.spell_damage));
v.push_back(std::to_string(e.heal_amount));
v.push_back(std::to_string(e.spell_shielding)); v.push_back(std::to_string(e.spell_shielding));
v.push_back(std::to_string(e.strikethrough)); v.push_back(std::to_string(e.strikethrough));
v.push_back(std::to_string(e.stun_resist)); v.push_back(std::to_string(e.stun_resist));
@@ -763,6 +770,7 @@ public:
v.push_back(std::to_string(e.endurance_regen)); v.push_back(std::to_string(e.endurance_regen));
v.push_back(std::to_string(e.shielding)); v.push_back(std::to_string(e.shielding));
v.push_back(std::to_string(e.spell_damage)); v.push_back(std::to_string(e.spell_damage));
v.push_back(std::to_string(e.heal_amount));
v.push_back(std::to_string(e.spell_shielding)); v.push_back(std::to_string(e.spell_shielding));
v.push_back(std::to_string(e.strikethrough)); v.push_back(std::to_string(e.strikethrough));
v.push_back(std::to_string(e.stun_resist)); v.push_back(std::to_string(e.stun_resist));
@@ -870,29 +878,30 @@ public:
e.endurance_regen = row[48] ? static_cast<int32_t>(atoi(row[48])) : 0; e.endurance_regen = row[48] ? static_cast<int32_t>(atoi(row[48])) : 0;
e.shielding = row[49] ? static_cast<int32_t>(atoi(row[49])) : 0; e.shielding = row[49] ? static_cast<int32_t>(atoi(row[49])) : 0;
e.spell_damage = row[50] ? static_cast<int32_t>(atoi(row[50])) : 0; e.spell_damage = row[50] ? static_cast<int32_t>(atoi(row[50])) : 0;
e.spell_shielding = row[51] ? static_cast<int32_t>(atoi(row[51])) : 0; e.heal_amount = row[51] ? static_cast<int32_t>(atoi(row[51])) : 0;
e.strikethrough = row[52] ? static_cast<int32_t>(atoi(row[52])) : 0; e.spell_shielding = row[52] ? static_cast<int32_t>(atoi(row[52])) : 0;
e.stun_resist = row[53] ? static_cast<int32_t>(atoi(row[53])) : 0; e.strikethrough = row[53] ? static_cast<int32_t>(atoi(row[53])) : 0;
e.backstab = row[54] ? static_cast<int32_t>(atoi(row[54])) : 0; e.stun_resist = row[54] ? static_cast<int32_t>(atoi(row[54])) : 0;
e.wind = row[55] ? static_cast<int32_t>(atoi(row[55])) : 0; e.backstab = row[55] ? static_cast<int32_t>(atoi(row[55])) : 0;
e.brass = row[56] ? static_cast<int32_t>(atoi(row[56])) : 0; e.wind = row[56] ? static_cast<int32_t>(atoi(row[56])) : 0;
e.string = row[57] ? static_cast<int32_t>(atoi(row[57])) : 0; e.brass = row[57] ? static_cast<int32_t>(atoi(row[57])) : 0;
e.percussion = row[58] ? static_cast<int32_t>(atoi(row[58])) : 0; e.string = row[58] ? static_cast<int32_t>(atoi(row[58])) : 0;
e.singing = row[59] ? static_cast<int32_t>(atoi(row[59])) : 0; e.percussion = row[59] ? static_cast<int32_t>(atoi(row[59])) : 0;
e.baking = row[60] ? static_cast<int32_t>(atoi(row[60])) : 0; e.singing = row[60] ? static_cast<int32_t>(atoi(row[60])) : 0;
e.alchemy = row[61] ? static_cast<int32_t>(atoi(row[61])) : 0; e.baking = row[61] ? static_cast<int32_t>(atoi(row[61])) : 0;
e.tailoring = row[62] ? static_cast<int32_t>(atoi(row[62])) : 0; e.alchemy = row[62] ? static_cast<int32_t>(atoi(row[62])) : 0;
e.blacksmithing = row[63] ? static_cast<int32_t>(atoi(row[63])) : 0; e.tailoring = row[63] ? static_cast<int32_t>(atoi(row[63])) : 0;
e.fletching = row[64] ? static_cast<int32_t>(atoi(row[64])) : 0; e.blacksmithing = row[64] ? static_cast<int32_t>(atoi(row[64])) : 0;
e.brewing = row[65] ? static_cast<int32_t>(atoi(row[65])) : 0; e.fletching = row[65] ? static_cast<int32_t>(atoi(row[65])) : 0;
e.jewelry = row[66] ? static_cast<int32_t>(atoi(row[66])) : 0; e.brewing = row[66] ? static_cast<int32_t>(atoi(row[66])) : 0;
e.pottery = row[67] ? static_cast<int32_t>(atoi(row[67])) : 0; e.jewelry = row[67] ? static_cast<int32_t>(atoi(row[67])) : 0;
e.research = row[68] ? static_cast<int32_t>(atoi(row[68])) : 0; e.pottery = row[68] ? static_cast<int32_t>(atoi(row[68])) : 0;
e.alcohol = row[69] ? static_cast<int32_t>(atoi(row[69])) : 0; e.research = row[69] ? static_cast<int32_t>(atoi(row[69])) : 0;
e.fishing = row[70] ? static_cast<int32_t>(atoi(row[70])) : 0; e.alcohol = row[70] ? static_cast<int32_t>(atoi(row[70])) : 0;
e.tinkering = row[71] ? static_cast<int32_t>(atoi(row[71])) : 0; e.fishing = row[71] ? static_cast<int32_t>(atoi(row[71])) : 0;
e.created_at = strtoll(row[72] ? row[72] : "-1", nullptr, 10); e.tinkering = row[72] ? static_cast<int32_t>(atoi(row[72])) : 0;
e.updated_at = strtoll(row[73] ? row[73] : "-1", nullptr, 10); e.created_at = strtoll(row[73] ? row[73] : "-1", nullptr, 10);
e.updated_at = strtoll(row[74] ? row[74] : "-1", nullptr, 10);
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -968,29 +977,30 @@ public:
e.endurance_regen = row[48] ? static_cast<int32_t>(atoi(row[48])) : 0; e.endurance_regen = row[48] ? static_cast<int32_t>(atoi(row[48])) : 0;
e.shielding = row[49] ? static_cast<int32_t>(atoi(row[49])) : 0; e.shielding = row[49] ? static_cast<int32_t>(atoi(row[49])) : 0;
e.spell_damage = row[50] ? static_cast<int32_t>(atoi(row[50])) : 0; e.spell_damage = row[50] ? static_cast<int32_t>(atoi(row[50])) : 0;
e.spell_shielding = row[51] ? static_cast<int32_t>(atoi(row[51])) : 0; e.heal_amount = row[51] ? static_cast<int32_t>(atoi(row[51])) : 0;
e.strikethrough = row[52] ? static_cast<int32_t>(atoi(row[52])) : 0; e.spell_shielding = row[52] ? static_cast<int32_t>(atoi(row[52])) : 0;
e.stun_resist = row[53] ? static_cast<int32_t>(atoi(row[53])) : 0; e.strikethrough = row[53] ? static_cast<int32_t>(atoi(row[53])) : 0;
e.backstab = row[54] ? static_cast<int32_t>(atoi(row[54])) : 0; e.stun_resist = row[54] ? static_cast<int32_t>(atoi(row[54])) : 0;
e.wind = row[55] ? static_cast<int32_t>(atoi(row[55])) : 0; e.backstab = row[55] ? static_cast<int32_t>(atoi(row[55])) : 0;
e.brass = row[56] ? static_cast<int32_t>(atoi(row[56])) : 0; e.wind = row[56] ? static_cast<int32_t>(atoi(row[56])) : 0;
e.string = row[57] ? static_cast<int32_t>(atoi(row[57])) : 0; e.brass = row[57] ? static_cast<int32_t>(atoi(row[57])) : 0;
e.percussion = row[58] ? static_cast<int32_t>(atoi(row[58])) : 0; e.string = row[58] ? static_cast<int32_t>(atoi(row[58])) : 0;
e.singing = row[59] ? static_cast<int32_t>(atoi(row[59])) : 0; e.percussion = row[59] ? static_cast<int32_t>(atoi(row[59])) : 0;
e.baking = row[60] ? static_cast<int32_t>(atoi(row[60])) : 0; e.singing = row[60] ? static_cast<int32_t>(atoi(row[60])) : 0;
e.alchemy = row[61] ? static_cast<int32_t>(atoi(row[61])) : 0; e.baking = row[61] ? static_cast<int32_t>(atoi(row[61])) : 0;
e.tailoring = row[62] ? static_cast<int32_t>(atoi(row[62])) : 0; e.alchemy = row[62] ? static_cast<int32_t>(atoi(row[62])) : 0;
e.blacksmithing = row[63] ? static_cast<int32_t>(atoi(row[63])) : 0; e.tailoring = row[63] ? static_cast<int32_t>(atoi(row[63])) : 0;
e.fletching = row[64] ? static_cast<int32_t>(atoi(row[64])) : 0; e.blacksmithing = row[64] ? static_cast<int32_t>(atoi(row[64])) : 0;
e.brewing = row[65] ? static_cast<int32_t>(atoi(row[65])) : 0; e.fletching = row[65] ? static_cast<int32_t>(atoi(row[65])) : 0;
e.jewelry = row[66] ? static_cast<int32_t>(atoi(row[66])) : 0; e.brewing = row[66] ? static_cast<int32_t>(atoi(row[66])) : 0;
e.pottery = row[67] ? static_cast<int32_t>(atoi(row[67])) : 0; e.jewelry = row[67] ? static_cast<int32_t>(atoi(row[67])) : 0;
e.research = row[68] ? static_cast<int32_t>(atoi(row[68])) : 0; e.pottery = row[68] ? static_cast<int32_t>(atoi(row[68])) : 0;
e.alcohol = row[69] ? static_cast<int32_t>(atoi(row[69])) : 0; e.research = row[69] ? static_cast<int32_t>(atoi(row[69])) : 0;
e.fishing = row[70] ? static_cast<int32_t>(atoi(row[70])) : 0; e.alcohol = row[70] ? static_cast<int32_t>(atoi(row[70])) : 0;
e.tinkering = row[71] ? static_cast<int32_t>(atoi(row[71])) : 0; e.fishing = row[71] ? static_cast<int32_t>(atoi(row[71])) : 0;
e.created_at = strtoll(row[72] ? row[72] : "-1", nullptr, 10); e.tinkering = row[72] ? static_cast<int32_t>(atoi(row[72])) : 0;
e.updated_at = strtoll(row[73] ? row[73] : "-1", nullptr, 10); e.created_at = strtoll(row[73] ? row[73] : "-1", nullptr, 10);
e.updated_at = strtoll(row[74] ? row[74] : "-1", nullptr, 10);
all_entries.push_back(e); all_entries.push_back(e);
} }
@@ -1116,6 +1126,7 @@ public:
v.push_back(std::to_string(e.endurance_regen)); v.push_back(std::to_string(e.endurance_regen));
v.push_back(std::to_string(e.shielding)); v.push_back(std::to_string(e.shielding));
v.push_back(std::to_string(e.spell_damage)); v.push_back(std::to_string(e.spell_damage));
v.push_back(std::to_string(e.heal_amount));
v.push_back(std::to_string(e.spell_shielding)); v.push_back(std::to_string(e.spell_shielding));
v.push_back(std::to_string(e.strikethrough)); v.push_back(std::to_string(e.strikethrough));
v.push_back(std::to_string(e.stun_resist)); v.push_back(std::to_string(e.stun_resist));
@@ -1212,6 +1223,7 @@ public:
v.push_back(std::to_string(e.endurance_regen)); v.push_back(std::to_string(e.endurance_regen));
v.push_back(std::to_string(e.shielding)); v.push_back(std::to_string(e.shielding));
v.push_back(std::to_string(e.spell_damage)); v.push_back(std::to_string(e.spell_damage));
v.push_back(std::to_string(e.heal_amount));
v.push_back(std::to_string(e.spell_shielding)); v.push_back(std::to_string(e.spell_shielding));
v.push_back(std::to_string(e.strikethrough)); v.push_back(std::to_string(e.strikethrough));
v.push_back(std::to_string(e.stun_resist)); v.push_back(std::to_string(e.stun_resist));
@@ -179,7 +179,7 @@ public:
int32_t effectdescnum; int32_t effectdescnum;
int32_t effectdescnum2; int32_t effectdescnum2;
int32_t npc_no_los; int32_t npc_no_los;
int32_t field160; int32_t feedbackable;
int32_t reflectable; int32_t reflectable;
int32_t bonushate; int32_t bonushate;
int32_t field163; int32_t field163;
@@ -217,7 +217,7 @@ public:
int32_t ConeStopAngle; int32_t ConeStopAngle;
int32_t sneaking; int32_t sneaking;
int32_t not_extendable; int32_t not_extendable;
int32_t field198; int32_t no_detrimental_spell_aggro;
int32_t field199; int32_t field199;
int32_t suspendable; int32_t suspendable;
int32_t viral_range; int32_t viral_range;
@@ -228,7 +228,7 @@ public:
int32_t field206; int32_t field206;
int32_t spellgroup; int32_t spellgroup;
int32_t rank_; int32_t rank_;
int32_t field209; int32_t no_resist;
int32_t field210; int32_t field210;
int32_t CastRestriction; int32_t CastRestriction;
int32_t allowrest; int32_t allowrest;
@@ -236,13 +236,13 @@ public:
int32_t OutofCombat; int32_t OutofCombat;
int32_t field215; int32_t field215;
int32_t field216; int32_t field216;
int32_t field217; int32_t override_crit_chance;
int32_t aemaxtargets; int32_t aemaxtargets;
int32_t maxtargets; int32_t maxtargets;
int32_t field220; int32_t no_heal_damage_item_mod;
int32_t field221; int32_t caster_requirement_id;
int32_t field222; int32_t spell_class;
int32_t field223; int32_t spell_subclass;
int32_t persistdeath; int32_t persistdeath;
int32_t field225; int32_t field225;
int32_t field226; int32_t field226;
@@ -251,7 +251,7 @@ public:
float max_dist; float max_dist;
float max_dist_mod; float max_dist_mod;
int32_t min_range; int32_t min_range;
int32_t field232; int32_t no_remove;
int32_t field233; int32_t field233;
int32_t field234; int32_t field234;
int32_t field235; int32_t field235;
@@ -426,7 +426,7 @@ public:
"effectdescnum", "effectdescnum",
"effectdescnum2", "effectdescnum2",
"npc_no_los", "npc_no_los",
"field160", "feedbackable",
"reflectable", "reflectable",
"bonushate", "bonushate",
"field163", "field163",
@@ -464,7 +464,7 @@ public:
"ConeStopAngle", "ConeStopAngle",
"sneaking", "sneaking",
"not_extendable", "not_extendable",
"field198", "no_detrimental_spell_aggro",
"field199", "field199",
"suspendable", "suspendable",
"viral_range", "viral_range",
@@ -475,7 +475,7 @@ public:
"field206", "field206",
"spellgroup", "spellgroup",
"`rank`", "`rank`",
"field209", "no_resist",
"field210", "field210",
"CastRestriction", "CastRestriction",
"allowrest", "allowrest",
@@ -483,13 +483,13 @@ public:
"OutofCombat", "OutofCombat",
"field215", "field215",
"field216", "field216",
"field217", "override_crit_chance",
"aemaxtargets", "aemaxtargets",
"maxtargets", "maxtargets",
"field220", "no_heal_damage_item_mod",
"field221", "caster_requirement_id",
"field222", "spell_class",
"field223", "spell_subclass",
"persistdeath", "persistdeath",
"field225", "field225",
"field226", "field226",
@@ -498,7 +498,7 @@ public:
"max_dist", "max_dist",
"max_dist_mod", "max_dist_mod",
"min_range", "min_range",
"field232", "no_remove",
"field233", "field233",
"field234", "field234",
"field235", "field235",
@@ -669,7 +669,7 @@ public:
"effectdescnum", "effectdescnum",
"effectdescnum2", "effectdescnum2",
"npc_no_los", "npc_no_los",
"field160", "feedbackable",
"reflectable", "reflectable",
"bonushate", "bonushate",
"field163", "field163",
@@ -707,7 +707,7 @@ public:
"ConeStopAngle", "ConeStopAngle",
"sneaking", "sneaking",
"not_extendable", "not_extendable",
"field198", "no_detrimental_spell_aggro",
"field199", "field199",
"suspendable", "suspendable",
"viral_range", "viral_range",
@@ -718,7 +718,7 @@ public:
"field206", "field206",
"spellgroup", "spellgroup",
"`rank`", "`rank`",
"field209", "no_resist",
"field210", "field210",
"CastRestriction", "CastRestriction",
"allowrest", "allowrest",
@@ -726,13 +726,13 @@ public:
"OutofCombat", "OutofCombat",
"field215", "field215",
"field216", "field216",
"field217", "override_crit_chance",
"aemaxtargets", "aemaxtargets",
"maxtargets", "maxtargets",
"field220", "no_heal_damage_item_mod",
"field221", "caster_requirement_id",
"field222", "spell_class",
"field223", "spell_subclass",
"persistdeath", "persistdeath",
"field225", "field225",
"field226", "field226",
@@ -741,7 +741,7 @@ public:
"max_dist", "max_dist",
"max_dist_mod", "max_dist_mod",
"min_range", "min_range",
"field232", "no_remove",
"field233", "field233",
"field234", "field234",
"field235", "field235",
@@ -946,7 +946,7 @@ public:
e.effectdescnum = 0; e.effectdescnum = 0;
e.effectdescnum2 = 0; e.effectdescnum2 = 0;
e.npc_no_los = 0; e.npc_no_los = 0;
e.field160 = 0; e.feedbackable = 0;
e.reflectable = 0; e.reflectable = 0;
e.bonushate = 0; e.bonushate = 0;
e.field163 = 100; e.field163 = 100;
@@ -984,7 +984,7 @@ public:
e.ConeStopAngle = 0; e.ConeStopAngle = 0;
e.sneaking = 0; e.sneaking = 0;
e.not_extendable = 0; e.not_extendable = 0;
e.field198 = 0; e.no_detrimental_spell_aggro = 0;
e.field199 = 1; e.field199 = 1;
e.suspendable = 0; e.suspendable = 0;
e.viral_range = 0; e.viral_range = 0;
@@ -995,7 +995,7 @@ public:
e.field206 = -1; e.field206 = -1;
e.spellgroup = 0; e.spellgroup = 0;
e.rank_ = 0; e.rank_ = 0;
e.field209 = 0; e.no_resist = 0;
e.field210 = 1; e.field210 = 1;
e.CastRestriction = 0; e.CastRestriction = 0;
e.allowrest = 0; e.allowrest = 0;
@@ -1003,13 +1003,13 @@ public:
e.OutofCombat = 0; e.OutofCombat = 0;
e.field215 = 0; e.field215 = 0;
e.field216 = 0; e.field216 = 0;
e.field217 = 0; e.override_crit_chance = 0;
e.aemaxtargets = 0; e.aemaxtargets = 0;
e.maxtargets = 0; e.maxtargets = 0;
e.field220 = 0; e.no_heal_damage_item_mod = 0;
e.field221 = 0; e.caster_requirement_id = 0;
e.field222 = 0; e.spell_class = 0;
e.field223 = 0; e.spell_subclass = 0;
e.persistdeath = 0; e.persistdeath = 0;
e.field225 = 0; e.field225 = 0;
e.field226 = 0; e.field226 = 0;
@@ -1018,7 +1018,7 @@ public:
e.max_dist = 0; e.max_dist = 0;
e.max_dist_mod = 0; e.max_dist_mod = 0;
e.min_range = 0; e.min_range = 0;
e.field232 = 0; e.no_remove = 0;
e.field233 = 0; e.field233 = 0;
e.field234 = 0; e.field234 = 0;
e.field235 = 0; e.field235 = 0;
@@ -1219,7 +1219,7 @@ public:
e.effectdescnum = row[157] ? static_cast<int32_t>(atoi(row[157])) : 0; e.effectdescnum = row[157] ? static_cast<int32_t>(atoi(row[157])) : 0;
e.effectdescnum2 = row[158] ? static_cast<int32_t>(atoi(row[158])) : 0; e.effectdescnum2 = row[158] ? static_cast<int32_t>(atoi(row[158])) : 0;
e.npc_no_los = row[159] ? static_cast<int32_t>(atoi(row[159])) : 0; e.npc_no_los = row[159] ? static_cast<int32_t>(atoi(row[159])) : 0;
e.field160 = row[160] ? static_cast<int32_t>(atoi(row[160])) : 0; e.feedbackable = row[160] ? static_cast<int32_t>(atoi(row[160])) : 0;
e.reflectable = row[161] ? static_cast<int32_t>(atoi(row[161])) : 0; e.reflectable = row[161] ? static_cast<int32_t>(atoi(row[161])) : 0;
e.bonushate = row[162] ? static_cast<int32_t>(atoi(row[162])) : 0; e.bonushate = row[162] ? static_cast<int32_t>(atoi(row[162])) : 0;
e.field163 = row[163] ? static_cast<int32_t>(atoi(row[163])) : 100; e.field163 = row[163] ? static_cast<int32_t>(atoi(row[163])) : 100;
@@ -1257,7 +1257,7 @@ public:
e.ConeStopAngle = row[195] ? static_cast<int32_t>(atoi(row[195])) : 0; e.ConeStopAngle = row[195] ? static_cast<int32_t>(atoi(row[195])) : 0;
e.sneaking = row[196] ? static_cast<int32_t>(atoi(row[196])) : 0; e.sneaking = row[196] ? static_cast<int32_t>(atoi(row[196])) : 0;
e.not_extendable = row[197] ? static_cast<int32_t>(atoi(row[197])) : 0; e.not_extendable = row[197] ? static_cast<int32_t>(atoi(row[197])) : 0;
e.field198 = row[198] ? static_cast<int32_t>(atoi(row[198])) : 0; e.no_detrimental_spell_aggro = row[198] ? static_cast<int32_t>(atoi(row[198])) : 0;
e.field199 = row[199] ? static_cast<int32_t>(atoi(row[199])) : 1; e.field199 = row[199] ? static_cast<int32_t>(atoi(row[199])) : 1;
e.suspendable = row[200] ? static_cast<int32_t>(atoi(row[200])) : 0; e.suspendable = row[200] ? static_cast<int32_t>(atoi(row[200])) : 0;
e.viral_range = row[201] ? static_cast<int32_t>(atoi(row[201])) : 0; e.viral_range = row[201] ? static_cast<int32_t>(atoi(row[201])) : 0;
@@ -1268,7 +1268,7 @@ public:
e.field206 = row[206] ? static_cast<int32_t>(atoi(row[206])) : -1; e.field206 = row[206] ? static_cast<int32_t>(atoi(row[206])) : -1;
e.spellgroup = row[207] ? static_cast<int32_t>(atoi(row[207])) : 0; e.spellgroup = row[207] ? static_cast<int32_t>(atoi(row[207])) : 0;
e.rank_ = row[208] ? static_cast<int32_t>(atoi(row[208])) : 0; e.rank_ = row[208] ? static_cast<int32_t>(atoi(row[208])) : 0;
e.field209 = row[209] ? static_cast<int32_t>(atoi(row[209])) : 0; e.no_resist = row[209] ? static_cast<int32_t>(atoi(row[209])) : 0;
e.field210 = row[210] ? static_cast<int32_t>(atoi(row[210])) : 1; e.field210 = row[210] ? static_cast<int32_t>(atoi(row[210])) : 1;
e.CastRestriction = row[211] ? static_cast<int32_t>(atoi(row[211])) : 0; e.CastRestriction = row[211] ? static_cast<int32_t>(atoi(row[211])) : 0;
e.allowrest = row[212] ? static_cast<int32_t>(atoi(row[212])) : 0; e.allowrest = row[212] ? static_cast<int32_t>(atoi(row[212])) : 0;
@@ -1276,13 +1276,13 @@ public:
e.OutofCombat = row[214] ? static_cast<int32_t>(atoi(row[214])) : 0; e.OutofCombat = row[214] ? static_cast<int32_t>(atoi(row[214])) : 0;
e.field215 = row[215] ? static_cast<int32_t>(atoi(row[215])) : 0; e.field215 = row[215] ? static_cast<int32_t>(atoi(row[215])) : 0;
e.field216 = row[216] ? static_cast<int32_t>(atoi(row[216])) : 0; e.field216 = row[216] ? static_cast<int32_t>(atoi(row[216])) : 0;
e.field217 = row[217] ? static_cast<int32_t>(atoi(row[217])) : 0; e.override_crit_chance = row[217] ? static_cast<int32_t>(atoi(row[217])) : 0;
e.aemaxtargets = row[218] ? static_cast<int32_t>(atoi(row[218])) : 0; e.aemaxtargets = row[218] ? static_cast<int32_t>(atoi(row[218])) : 0;
e.maxtargets = row[219] ? static_cast<int32_t>(atoi(row[219])) : 0; e.maxtargets = row[219] ? static_cast<int32_t>(atoi(row[219])) : 0;
e.field220 = row[220] ? static_cast<int32_t>(atoi(row[220])) : 0; e.no_heal_damage_item_mod = row[220] ? static_cast<int32_t>(atoi(row[220])) : 0;
e.field221 = row[221] ? static_cast<int32_t>(atoi(row[221])) : 0; e.caster_requirement_id = row[221] ? static_cast<int32_t>(atoi(row[221])) : 0;
e.field222 = row[222] ? static_cast<int32_t>(atoi(row[222])) : 0; e.spell_class = row[222] ? static_cast<int32_t>(atoi(row[222])) : 0;
e.field223 = row[223] ? static_cast<int32_t>(atoi(row[223])) : 0; e.spell_subclass = row[223] ? static_cast<int32_t>(atoi(row[223])) : 0;
e.persistdeath = row[224] ? static_cast<int32_t>(atoi(row[224])) : 0; e.persistdeath = row[224] ? static_cast<int32_t>(atoi(row[224])) : 0;
e.field225 = row[225] ? static_cast<int32_t>(atoi(row[225])) : 0; e.field225 = row[225] ? static_cast<int32_t>(atoi(row[225])) : 0;
e.field226 = row[226] ? static_cast<int32_t>(atoi(row[226])) : 0; e.field226 = row[226] ? static_cast<int32_t>(atoi(row[226])) : 0;
@@ -1291,7 +1291,7 @@ public:
e.max_dist = row[229] ? strtof(row[229], nullptr) : 0; e.max_dist = row[229] ? strtof(row[229], nullptr) : 0;
e.max_dist_mod = row[230] ? strtof(row[230], nullptr) : 0; e.max_dist_mod = row[230] ? strtof(row[230], nullptr) : 0;
e.min_range = row[231] ? static_cast<int32_t>(atoi(row[231])) : 0; e.min_range = row[231] ? static_cast<int32_t>(atoi(row[231])) : 0;
e.field232 = row[232] ? static_cast<int32_t>(atoi(row[232])) : 0; e.no_remove = row[232] ? static_cast<int32_t>(atoi(row[232])) : 0;
e.field233 = row[233] ? static_cast<int32_t>(atoi(row[233])) : 0; e.field233 = row[233] ? static_cast<int32_t>(atoi(row[233])) : 0;
e.field234 = row[234] ? static_cast<int32_t>(atoi(row[234])) : 0; e.field234 = row[234] ? static_cast<int32_t>(atoi(row[234])) : 0;
e.field235 = row[235] ? static_cast<int32_t>(atoi(row[235])) : 0; e.field235 = row[235] ? static_cast<int32_t>(atoi(row[235])) : 0;
@@ -1489,7 +1489,7 @@ public:
v.push_back(columns[157] + " = " + std::to_string(e.effectdescnum)); v.push_back(columns[157] + " = " + std::to_string(e.effectdescnum));
v.push_back(columns[158] + " = " + std::to_string(e.effectdescnum2)); v.push_back(columns[158] + " = " + std::to_string(e.effectdescnum2));
v.push_back(columns[159] + " = " + std::to_string(e.npc_no_los)); v.push_back(columns[159] + " = " + std::to_string(e.npc_no_los));
v.push_back(columns[160] + " = " + std::to_string(e.field160)); v.push_back(columns[160] + " = " + std::to_string(e.feedbackable));
v.push_back(columns[161] + " = " + std::to_string(e.reflectable)); v.push_back(columns[161] + " = " + std::to_string(e.reflectable));
v.push_back(columns[162] + " = " + std::to_string(e.bonushate)); v.push_back(columns[162] + " = " + std::to_string(e.bonushate));
v.push_back(columns[163] + " = " + std::to_string(e.field163)); v.push_back(columns[163] + " = " + std::to_string(e.field163));
@@ -1527,7 +1527,7 @@ public:
v.push_back(columns[195] + " = " + std::to_string(e.ConeStopAngle)); v.push_back(columns[195] + " = " + std::to_string(e.ConeStopAngle));
v.push_back(columns[196] + " = " + std::to_string(e.sneaking)); v.push_back(columns[196] + " = " + std::to_string(e.sneaking));
v.push_back(columns[197] + " = " + std::to_string(e.not_extendable)); v.push_back(columns[197] + " = " + std::to_string(e.not_extendable));
v.push_back(columns[198] + " = " + std::to_string(e.field198)); v.push_back(columns[198] + " = " + std::to_string(e.no_detrimental_spell_aggro));
v.push_back(columns[199] + " = " + std::to_string(e.field199)); v.push_back(columns[199] + " = " + std::to_string(e.field199));
v.push_back(columns[200] + " = " + std::to_string(e.suspendable)); v.push_back(columns[200] + " = " + std::to_string(e.suspendable));
v.push_back(columns[201] + " = " + std::to_string(e.viral_range)); v.push_back(columns[201] + " = " + std::to_string(e.viral_range));
@@ -1538,7 +1538,7 @@ public:
v.push_back(columns[206] + " = " + std::to_string(e.field206)); v.push_back(columns[206] + " = " + std::to_string(e.field206));
v.push_back(columns[207] + " = " + std::to_string(e.spellgroup)); v.push_back(columns[207] + " = " + std::to_string(e.spellgroup));
v.push_back(columns[208] + " = " + std::to_string(e.rank_)); v.push_back(columns[208] + " = " + std::to_string(e.rank_));
v.push_back(columns[209] + " = " + std::to_string(e.field209)); v.push_back(columns[209] + " = " + std::to_string(e.no_resist));
v.push_back(columns[210] + " = " + std::to_string(e.field210)); v.push_back(columns[210] + " = " + std::to_string(e.field210));
v.push_back(columns[211] + " = " + std::to_string(e.CastRestriction)); v.push_back(columns[211] + " = " + std::to_string(e.CastRestriction));
v.push_back(columns[212] + " = " + std::to_string(e.allowrest)); v.push_back(columns[212] + " = " + std::to_string(e.allowrest));
@@ -1546,13 +1546,13 @@ public:
v.push_back(columns[214] + " = " + std::to_string(e.OutofCombat)); v.push_back(columns[214] + " = " + std::to_string(e.OutofCombat));
v.push_back(columns[215] + " = " + std::to_string(e.field215)); v.push_back(columns[215] + " = " + std::to_string(e.field215));
v.push_back(columns[216] + " = " + std::to_string(e.field216)); v.push_back(columns[216] + " = " + std::to_string(e.field216));
v.push_back(columns[217] + " = " + std::to_string(e.field217)); v.push_back(columns[217] + " = " + std::to_string(e.override_crit_chance));
v.push_back(columns[218] + " = " + std::to_string(e.aemaxtargets)); v.push_back(columns[218] + " = " + std::to_string(e.aemaxtargets));
v.push_back(columns[219] + " = " + std::to_string(e.maxtargets)); v.push_back(columns[219] + " = " + std::to_string(e.maxtargets));
v.push_back(columns[220] + " = " + std::to_string(e.field220)); v.push_back(columns[220] + " = " + std::to_string(e.no_heal_damage_item_mod));
v.push_back(columns[221] + " = " + std::to_string(e.field221)); v.push_back(columns[221] + " = " + std::to_string(e.caster_requirement_id));
v.push_back(columns[222] + " = " + std::to_string(e.field222)); v.push_back(columns[222] + " = " + std::to_string(e.spell_class));
v.push_back(columns[223] + " = " + std::to_string(e.field223)); v.push_back(columns[223] + " = " + std::to_string(e.spell_subclass));
v.push_back(columns[224] + " = " + std::to_string(e.persistdeath)); v.push_back(columns[224] + " = " + std::to_string(e.persistdeath));
v.push_back(columns[225] + " = " + std::to_string(e.field225)); v.push_back(columns[225] + " = " + std::to_string(e.field225));
v.push_back(columns[226] + " = " + std::to_string(e.field226)); v.push_back(columns[226] + " = " + std::to_string(e.field226));
@@ -1561,7 +1561,7 @@ public:
v.push_back(columns[229] + " = " + std::to_string(e.max_dist)); v.push_back(columns[229] + " = " + std::to_string(e.max_dist));
v.push_back(columns[230] + " = " + std::to_string(e.max_dist_mod)); v.push_back(columns[230] + " = " + std::to_string(e.max_dist_mod));
v.push_back(columns[231] + " = " + std::to_string(e.min_range)); v.push_back(columns[231] + " = " + std::to_string(e.min_range));
v.push_back(columns[232] + " = " + std::to_string(e.field232)); v.push_back(columns[232] + " = " + std::to_string(e.no_remove));
v.push_back(columns[233] + " = " + std::to_string(e.field233)); v.push_back(columns[233] + " = " + std::to_string(e.field233));
v.push_back(columns[234] + " = " + std::to_string(e.field234)); v.push_back(columns[234] + " = " + std::to_string(e.field234));
v.push_back(columns[235] + " = " + std::to_string(e.field235)); v.push_back(columns[235] + " = " + std::to_string(e.field235));
@@ -1747,7 +1747,7 @@ public:
v.push_back(std::to_string(e.effectdescnum)); v.push_back(std::to_string(e.effectdescnum));
v.push_back(std::to_string(e.effectdescnum2)); v.push_back(std::to_string(e.effectdescnum2));
v.push_back(std::to_string(e.npc_no_los)); v.push_back(std::to_string(e.npc_no_los));
v.push_back(std::to_string(e.field160)); v.push_back(std::to_string(e.feedbackable));
v.push_back(std::to_string(e.reflectable)); v.push_back(std::to_string(e.reflectable));
v.push_back(std::to_string(e.bonushate)); v.push_back(std::to_string(e.bonushate));
v.push_back(std::to_string(e.field163)); v.push_back(std::to_string(e.field163));
@@ -1785,7 +1785,7 @@ public:
v.push_back(std::to_string(e.ConeStopAngle)); v.push_back(std::to_string(e.ConeStopAngle));
v.push_back(std::to_string(e.sneaking)); v.push_back(std::to_string(e.sneaking));
v.push_back(std::to_string(e.not_extendable)); v.push_back(std::to_string(e.not_extendable));
v.push_back(std::to_string(e.field198)); v.push_back(std::to_string(e.no_detrimental_spell_aggro));
v.push_back(std::to_string(e.field199)); v.push_back(std::to_string(e.field199));
v.push_back(std::to_string(e.suspendable)); v.push_back(std::to_string(e.suspendable));
v.push_back(std::to_string(e.viral_range)); v.push_back(std::to_string(e.viral_range));
@@ -1796,7 +1796,7 @@ public:
v.push_back(std::to_string(e.field206)); v.push_back(std::to_string(e.field206));
v.push_back(std::to_string(e.spellgroup)); v.push_back(std::to_string(e.spellgroup));
v.push_back(std::to_string(e.rank_)); v.push_back(std::to_string(e.rank_));
v.push_back(std::to_string(e.field209)); v.push_back(std::to_string(e.no_resist));
v.push_back(std::to_string(e.field210)); v.push_back(std::to_string(e.field210));
v.push_back(std::to_string(e.CastRestriction)); v.push_back(std::to_string(e.CastRestriction));
v.push_back(std::to_string(e.allowrest)); v.push_back(std::to_string(e.allowrest));
@@ -1804,13 +1804,13 @@ public:
v.push_back(std::to_string(e.OutofCombat)); v.push_back(std::to_string(e.OutofCombat));
v.push_back(std::to_string(e.field215)); v.push_back(std::to_string(e.field215));
v.push_back(std::to_string(e.field216)); v.push_back(std::to_string(e.field216));
v.push_back(std::to_string(e.field217)); v.push_back(std::to_string(e.override_crit_chance));
v.push_back(std::to_string(e.aemaxtargets)); v.push_back(std::to_string(e.aemaxtargets));
v.push_back(std::to_string(e.maxtargets)); v.push_back(std::to_string(e.maxtargets));
v.push_back(std::to_string(e.field220)); v.push_back(std::to_string(e.no_heal_damage_item_mod));
v.push_back(std::to_string(e.field221)); v.push_back(std::to_string(e.caster_requirement_id));
v.push_back(std::to_string(e.field222)); v.push_back(std::to_string(e.spell_class));
v.push_back(std::to_string(e.field223)); v.push_back(std::to_string(e.spell_subclass));
v.push_back(std::to_string(e.persistdeath)); v.push_back(std::to_string(e.persistdeath));
v.push_back(std::to_string(e.field225)); v.push_back(std::to_string(e.field225));
v.push_back(std::to_string(e.field226)); v.push_back(std::to_string(e.field226));
@@ -1819,7 +1819,7 @@ public:
v.push_back(std::to_string(e.max_dist)); v.push_back(std::to_string(e.max_dist));
v.push_back(std::to_string(e.max_dist_mod)); v.push_back(std::to_string(e.max_dist_mod));
v.push_back(std::to_string(e.min_range)); v.push_back(std::to_string(e.min_range));
v.push_back(std::to_string(e.field232)); v.push_back(std::to_string(e.no_remove));
v.push_back(std::to_string(e.field233)); v.push_back(std::to_string(e.field233));
v.push_back(std::to_string(e.field234)); v.push_back(std::to_string(e.field234));
v.push_back(std::to_string(e.field235)); v.push_back(std::to_string(e.field235));
@@ -2013,7 +2013,7 @@ public:
v.push_back(std::to_string(e.effectdescnum)); v.push_back(std::to_string(e.effectdescnum));
v.push_back(std::to_string(e.effectdescnum2)); v.push_back(std::to_string(e.effectdescnum2));
v.push_back(std::to_string(e.npc_no_los)); v.push_back(std::to_string(e.npc_no_los));
v.push_back(std::to_string(e.field160)); v.push_back(std::to_string(e.feedbackable));
v.push_back(std::to_string(e.reflectable)); v.push_back(std::to_string(e.reflectable));
v.push_back(std::to_string(e.bonushate)); v.push_back(std::to_string(e.bonushate));
v.push_back(std::to_string(e.field163)); v.push_back(std::to_string(e.field163));
@@ -2051,7 +2051,7 @@ public:
v.push_back(std::to_string(e.ConeStopAngle)); v.push_back(std::to_string(e.ConeStopAngle));
v.push_back(std::to_string(e.sneaking)); v.push_back(std::to_string(e.sneaking));
v.push_back(std::to_string(e.not_extendable)); v.push_back(std::to_string(e.not_extendable));
v.push_back(std::to_string(e.field198)); v.push_back(std::to_string(e.no_detrimental_spell_aggro));
v.push_back(std::to_string(e.field199)); v.push_back(std::to_string(e.field199));
v.push_back(std::to_string(e.suspendable)); v.push_back(std::to_string(e.suspendable));
v.push_back(std::to_string(e.viral_range)); v.push_back(std::to_string(e.viral_range));
@@ -2062,7 +2062,7 @@ public:
v.push_back(std::to_string(e.field206)); v.push_back(std::to_string(e.field206));
v.push_back(std::to_string(e.spellgroup)); v.push_back(std::to_string(e.spellgroup));
v.push_back(std::to_string(e.rank_)); v.push_back(std::to_string(e.rank_));
v.push_back(std::to_string(e.field209)); v.push_back(std::to_string(e.no_resist));
v.push_back(std::to_string(e.field210)); v.push_back(std::to_string(e.field210));
v.push_back(std::to_string(e.CastRestriction)); v.push_back(std::to_string(e.CastRestriction));
v.push_back(std::to_string(e.allowrest)); v.push_back(std::to_string(e.allowrest));
@@ -2070,13 +2070,13 @@ public:
v.push_back(std::to_string(e.OutofCombat)); v.push_back(std::to_string(e.OutofCombat));
v.push_back(std::to_string(e.field215)); v.push_back(std::to_string(e.field215));
v.push_back(std::to_string(e.field216)); v.push_back(std::to_string(e.field216));
v.push_back(std::to_string(e.field217)); v.push_back(std::to_string(e.override_crit_chance));
v.push_back(std::to_string(e.aemaxtargets)); v.push_back(std::to_string(e.aemaxtargets));
v.push_back(std::to_string(e.maxtargets)); v.push_back(std::to_string(e.maxtargets));
v.push_back(std::to_string(e.field220)); v.push_back(std::to_string(e.no_heal_damage_item_mod));
v.push_back(std::to_string(e.field221)); v.push_back(std::to_string(e.caster_requirement_id));
v.push_back(std::to_string(e.field222)); v.push_back(std::to_string(e.spell_class));
v.push_back(std::to_string(e.field223)); v.push_back(std::to_string(e.spell_subclass));
v.push_back(std::to_string(e.persistdeath)); v.push_back(std::to_string(e.persistdeath));
v.push_back(std::to_string(e.field225)); v.push_back(std::to_string(e.field225));
v.push_back(std::to_string(e.field226)); v.push_back(std::to_string(e.field226));
@@ -2085,7 +2085,7 @@ public:
v.push_back(std::to_string(e.max_dist)); v.push_back(std::to_string(e.max_dist));
v.push_back(std::to_string(e.max_dist_mod)); v.push_back(std::to_string(e.max_dist_mod));
v.push_back(std::to_string(e.min_range)); v.push_back(std::to_string(e.min_range));
v.push_back(std::to_string(e.field232)); v.push_back(std::to_string(e.no_remove));
v.push_back(std::to_string(e.field233)); v.push_back(std::to_string(e.field233));
v.push_back(std::to_string(e.field234)); v.push_back(std::to_string(e.field234));
v.push_back(std::to_string(e.field235)); v.push_back(std::to_string(e.field235));
@@ -2283,7 +2283,7 @@ public:
e.effectdescnum = row[157] ? static_cast<int32_t>(atoi(row[157])) : 0; e.effectdescnum = row[157] ? static_cast<int32_t>(atoi(row[157])) : 0;
e.effectdescnum2 = row[158] ? static_cast<int32_t>(atoi(row[158])) : 0; e.effectdescnum2 = row[158] ? static_cast<int32_t>(atoi(row[158])) : 0;
e.npc_no_los = row[159] ? static_cast<int32_t>(atoi(row[159])) : 0; e.npc_no_los = row[159] ? static_cast<int32_t>(atoi(row[159])) : 0;
e.field160 = row[160] ? static_cast<int32_t>(atoi(row[160])) : 0; e.feedbackable = row[160] ? static_cast<int32_t>(atoi(row[160])) : 0;
e.reflectable = row[161] ? static_cast<int32_t>(atoi(row[161])) : 0; e.reflectable = row[161] ? static_cast<int32_t>(atoi(row[161])) : 0;
e.bonushate = row[162] ? static_cast<int32_t>(atoi(row[162])) : 0; e.bonushate = row[162] ? static_cast<int32_t>(atoi(row[162])) : 0;
e.field163 = row[163] ? static_cast<int32_t>(atoi(row[163])) : 100; e.field163 = row[163] ? static_cast<int32_t>(atoi(row[163])) : 100;
@@ -2321,7 +2321,7 @@ public:
e.ConeStopAngle = row[195] ? static_cast<int32_t>(atoi(row[195])) : 0; e.ConeStopAngle = row[195] ? static_cast<int32_t>(atoi(row[195])) : 0;
e.sneaking = row[196] ? static_cast<int32_t>(atoi(row[196])) : 0; e.sneaking = row[196] ? static_cast<int32_t>(atoi(row[196])) : 0;
e.not_extendable = row[197] ? static_cast<int32_t>(atoi(row[197])) : 0; e.not_extendable = row[197] ? static_cast<int32_t>(atoi(row[197])) : 0;
e.field198 = row[198] ? static_cast<int32_t>(atoi(row[198])) : 0; e.no_detrimental_spell_aggro = row[198] ? static_cast<int32_t>(atoi(row[198])) : 0;
e.field199 = row[199] ? static_cast<int32_t>(atoi(row[199])) : 1; e.field199 = row[199] ? static_cast<int32_t>(atoi(row[199])) : 1;
e.suspendable = row[200] ? static_cast<int32_t>(atoi(row[200])) : 0; e.suspendable = row[200] ? static_cast<int32_t>(atoi(row[200])) : 0;
e.viral_range = row[201] ? static_cast<int32_t>(atoi(row[201])) : 0; e.viral_range = row[201] ? static_cast<int32_t>(atoi(row[201])) : 0;
@@ -2332,7 +2332,7 @@ public:
e.field206 = row[206] ? static_cast<int32_t>(atoi(row[206])) : -1; e.field206 = row[206] ? static_cast<int32_t>(atoi(row[206])) : -1;
e.spellgroup = row[207] ? static_cast<int32_t>(atoi(row[207])) : 0; e.spellgroup = row[207] ? static_cast<int32_t>(atoi(row[207])) : 0;
e.rank_ = row[208] ? static_cast<int32_t>(atoi(row[208])) : 0; e.rank_ = row[208] ? static_cast<int32_t>(atoi(row[208])) : 0;
e.field209 = row[209] ? static_cast<int32_t>(atoi(row[209])) : 0; e.no_resist = row[209] ? static_cast<int32_t>(atoi(row[209])) : 0;
e.field210 = row[210] ? static_cast<int32_t>(atoi(row[210])) : 1; e.field210 = row[210] ? static_cast<int32_t>(atoi(row[210])) : 1;
e.CastRestriction = row[211] ? static_cast<int32_t>(atoi(row[211])) : 0; e.CastRestriction = row[211] ? static_cast<int32_t>(atoi(row[211])) : 0;
e.allowrest = row[212] ? static_cast<int32_t>(atoi(row[212])) : 0; e.allowrest = row[212] ? static_cast<int32_t>(atoi(row[212])) : 0;
@@ -2340,13 +2340,13 @@ public:
e.OutofCombat = row[214] ? static_cast<int32_t>(atoi(row[214])) : 0; e.OutofCombat = row[214] ? static_cast<int32_t>(atoi(row[214])) : 0;
e.field215 = row[215] ? static_cast<int32_t>(atoi(row[215])) : 0; e.field215 = row[215] ? static_cast<int32_t>(atoi(row[215])) : 0;
e.field216 = row[216] ? static_cast<int32_t>(atoi(row[216])) : 0; e.field216 = row[216] ? static_cast<int32_t>(atoi(row[216])) : 0;
e.field217 = row[217] ? static_cast<int32_t>(atoi(row[217])) : 0; e.override_crit_chance = row[217] ? static_cast<int32_t>(atoi(row[217])) : 0;
e.aemaxtargets = row[218] ? static_cast<int32_t>(atoi(row[218])) : 0; e.aemaxtargets = row[218] ? static_cast<int32_t>(atoi(row[218])) : 0;
e.maxtargets = row[219] ? static_cast<int32_t>(atoi(row[219])) : 0; e.maxtargets = row[219] ? static_cast<int32_t>(atoi(row[219])) : 0;
e.field220 = row[220] ? static_cast<int32_t>(atoi(row[220])) : 0; e.no_heal_damage_item_mod = row[220] ? static_cast<int32_t>(atoi(row[220])) : 0;
e.field221 = row[221] ? static_cast<int32_t>(atoi(row[221])) : 0; e.caster_requirement_id = row[221] ? static_cast<int32_t>(atoi(row[221])) : 0;
e.field222 = row[222] ? static_cast<int32_t>(atoi(row[222])) : 0; e.spell_class = row[222] ? static_cast<int32_t>(atoi(row[222])) : 0;
e.field223 = row[223] ? static_cast<int32_t>(atoi(row[223])) : 0; e.spell_subclass = row[223] ? static_cast<int32_t>(atoi(row[223])) : 0;
e.persistdeath = row[224] ? static_cast<int32_t>(atoi(row[224])) : 0; e.persistdeath = row[224] ? static_cast<int32_t>(atoi(row[224])) : 0;
e.field225 = row[225] ? static_cast<int32_t>(atoi(row[225])) : 0; e.field225 = row[225] ? static_cast<int32_t>(atoi(row[225])) : 0;
e.field226 = row[226] ? static_cast<int32_t>(atoi(row[226])) : 0; e.field226 = row[226] ? static_cast<int32_t>(atoi(row[226])) : 0;
@@ -2355,7 +2355,7 @@ public:
e.max_dist = row[229] ? strtof(row[229], nullptr) : 0; e.max_dist = row[229] ? strtof(row[229], nullptr) : 0;
e.max_dist_mod = row[230] ? strtof(row[230], nullptr) : 0; e.max_dist_mod = row[230] ? strtof(row[230], nullptr) : 0;
e.min_range = row[231] ? static_cast<int32_t>(atoi(row[231])) : 0; e.min_range = row[231] ? static_cast<int32_t>(atoi(row[231])) : 0;
e.field232 = row[232] ? static_cast<int32_t>(atoi(row[232])) : 0; e.no_remove = row[232] ? static_cast<int32_t>(atoi(row[232])) : 0;
e.field233 = row[233] ? static_cast<int32_t>(atoi(row[233])) : 0; e.field233 = row[233] ? static_cast<int32_t>(atoi(row[233])) : 0;
e.field234 = row[234] ? static_cast<int32_t>(atoi(row[234])) : 0; e.field234 = row[234] ? static_cast<int32_t>(atoi(row[234])) : 0;
e.field235 = row[235] ? static_cast<int32_t>(atoi(row[235])) : 0; e.field235 = row[235] ? static_cast<int32_t>(atoi(row[235])) : 0;
@@ -2544,7 +2544,7 @@ public:
e.effectdescnum = row[157] ? static_cast<int32_t>(atoi(row[157])) : 0; e.effectdescnum = row[157] ? static_cast<int32_t>(atoi(row[157])) : 0;
e.effectdescnum2 = row[158] ? static_cast<int32_t>(atoi(row[158])) : 0; e.effectdescnum2 = row[158] ? static_cast<int32_t>(atoi(row[158])) : 0;
e.npc_no_los = row[159] ? static_cast<int32_t>(atoi(row[159])) : 0; e.npc_no_los = row[159] ? static_cast<int32_t>(atoi(row[159])) : 0;
e.field160 = row[160] ? static_cast<int32_t>(atoi(row[160])) : 0; e.feedbackable = row[160] ? static_cast<int32_t>(atoi(row[160])) : 0;
e.reflectable = row[161] ? static_cast<int32_t>(atoi(row[161])) : 0; e.reflectable = row[161] ? static_cast<int32_t>(atoi(row[161])) : 0;
e.bonushate = row[162] ? static_cast<int32_t>(atoi(row[162])) : 0; e.bonushate = row[162] ? static_cast<int32_t>(atoi(row[162])) : 0;
e.field163 = row[163] ? static_cast<int32_t>(atoi(row[163])) : 100; e.field163 = row[163] ? static_cast<int32_t>(atoi(row[163])) : 100;
@@ -2582,7 +2582,7 @@ public:
e.ConeStopAngle = row[195] ? static_cast<int32_t>(atoi(row[195])) : 0; e.ConeStopAngle = row[195] ? static_cast<int32_t>(atoi(row[195])) : 0;
e.sneaking = row[196] ? static_cast<int32_t>(atoi(row[196])) : 0; e.sneaking = row[196] ? static_cast<int32_t>(atoi(row[196])) : 0;
e.not_extendable = row[197] ? static_cast<int32_t>(atoi(row[197])) : 0; e.not_extendable = row[197] ? static_cast<int32_t>(atoi(row[197])) : 0;
e.field198 = row[198] ? static_cast<int32_t>(atoi(row[198])) : 0; e.no_detrimental_spell_aggro = row[198] ? static_cast<int32_t>(atoi(row[198])) : 0;
e.field199 = row[199] ? static_cast<int32_t>(atoi(row[199])) : 1; e.field199 = row[199] ? static_cast<int32_t>(atoi(row[199])) : 1;
e.suspendable = row[200] ? static_cast<int32_t>(atoi(row[200])) : 0; e.suspendable = row[200] ? static_cast<int32_t>(atoi(row[200])) : 0;
e.viral_range = row[201] ? static_cast<int32_t>(atoi(row[201])) : 0; e.viral_range = row[201] ? static_cast<int32_t>(atoi(row[201])) : 0;
@@ -2593,7 +2593,7 @@ public:
e.field206 = row[206] ? static_cast<int32_t>(atoi(row[206])) : -1; e.field206 = row[206] ? static_cast<int32_t>(atoi(row[206])) : -1;
e.spellgroup = row[207] ? static_cast<int32_t>(atoi(row[207])) : 0; e.spellgroup = row[207] ? static_cast<int32_t>(atoi(row[207])) : 0;
e.rank_ = row[208] ? static_cast<int32_t>(atoi(row[208])) : 0; e.rank_ = row[208] ? static_cast<int32_t>(atoi(row[208])) : 0;
e.field209 = row[209] ? static_cast<int32_t>(atoi(row[209])) : 0; e.no_resist = row[209] ? static_cast<int32_t>(atoi(row[209])) : 0;
e.field210 = row[210] ? static_cast<int32_t>(atoi(row[210])) : 1; e.field210 = row[210] ? static_cast<int32_t>(atoi(row[210])) : 1;
e.CastRestriction = row[211] ? static_cast<int32_t>(atoi(row[211])) : 0; e.CastRestriction = row[211] ? static_cast<int32_t>(atoi(row[211])) : 0;
e.allowrest = row[212] ? static_cast<int32_t>(atoi(row[212])) : 0; e.allowrest = row[212] ? static_cast<int32_t>(atoi(row[212])) : 0;
@@ -2601,13 +2601,13 @@ public:
e.OutofCombat = row[214] ? static_cast<int32_t>(atoi(row[214])) : 0; e.OutofCombat = row[214] ? static_cast<int32_t>(atoi(row[214])) : 0;
e.field215 = row[215] ? static_cast<int32_t>(atoi(row[215])) : 0; e.field215 = row[215] ? static_cast<int32_t>(atoi(row[215])) : 0;
e.field216 = row[216] ? static_cast<int32_t>(atoi(row[216])) : 0; e.field216 = row[216] ? static_cast<int32_t>(atoi(row[216])) : 0;
e.field217 = row[217] ? static_cast<int32_t>(atoi(row[217])) : 0; e.override_crit_chance = row[217] ? static_cast<int32_t>(atoi(row[217])) : 0;
e.aemaxtargets = row[218] ? static_cast<int32_t>(atoi(row[218])) : 0; e.aemaxtargets = row[218] ? static_cast<int32_t>(atoi(row[218])) : 0;
e.maxtargets = row[219] ? static_cast<int32_t>(atoi(row[219])) : 0; e.maxtargets = row[219] ? static_cast<int32_t>(atoi(row[219])) : 0;
e.field220 = row[220] ? static_cast<int32_t>(atoi(row[220])) : 0; e.no_heal_damage_item_mod = row[220] ? static_cast<int32_t>(atoi(row[220])) : 0;
e.field221 = row[221] ? static_cast<int32_t>(atoi(row[221])) : 0; e.caster_requirement_id = row[221] ? static_cast<int32_t>(atoi(row[221])) : 0;
e.field222 = row[222] ? static_cast<int32_t>(atoi(row[222])) : 0; e.spell_class = row[222] ? static_cast<int32_t>(atoi(row[222])) : 0;
e.field223 = row[223] ? static_cast<int32_t>(atoi(row[223])) : 0; e.spell_subclass = row[223] ? static_cast<int32_t>(atoi(row[223])) : 0;
e.persistdeath = row[224] ? static_cast<int32_t>(atoi(row[224])) : 0; e.persistdeath = row[224] ? static_cast<int32_t>(atoi(row[224])) : 0;
e.field225 = row[225] ? static_cast<int32_t>(atoi(row[225])) : 0; e.field225 = row[225] ? static_cast<int32_t>(atoi(row[225])) : 0;
e.field226 = row[226] ? static_cast<int32_t>(atoi(row[226])) : 0; e.field226 = row[226] ? static_cast<int32_t>(atoi(row[226])) : 0;
@@ -2616,7 +2616,7 @@ public:
e.max_dist = row[229] ? strtof(row[229], nullptr) : 0; e.max_dist = row[229] ? strtof(row[229], nullptr) : 0;
e.max_dist_mod = row[230] ? strtof(row[230], nullptr) : 0; e.max_dist_mod = row[230] ? strtof(row[230], nullptr) : 0;
e.min_range = row[231] ? static_cast<int32_t>(atoi(row[231])) : 0; e.min_range = row[231] ? static_cast<int32_t>(atoi(row[231])) : 0;
e.field232 = row[232] ? static_cast<int32_t>(atoi(row[232])) : 0; e.no_remove = row[232] ? static_cast<int32_t>(atoi(row[232])) : 0;
e.field233 = row[233] ? static_cast<int32_t>(atoi(row[233])) : 0; e.field233 = row[233] ? static_cast<int32_t>(atoi(row[233])) : 0;
e.field234 = row[234] ? static_cast<int32_t>(atoi(row[234])) : 0; e.field234 = row[234] ? static_cast<int32_t>(atoi(row[234])) : 0;
e.field235 = row[235] ? static_cast<int32_t>(atoi(row[235])) : 0; e.field235 = row[235] ? static_cast<int32_t>(atoi(row[235])) : 0;
@@ -2855,7 +2855,7 @@ public:
v.push_back(std::to_string(e.effectdescnum)); v.push_back(std::to_string(e.effectdescnum));
v.push_back(std::to_string(e.effectdescnum2)); v.push_back(std::to_string(e.effectdescnum2));
v.push_back(std::to_string(e.npc_no_los)); v.push_back(std::to_string(e.npc_no_los));
v.push_back(std::to_string(e.field160)); v.push_back(std::to_string(e.feedbackable));
v.push_back(std::to_string(e.reflectable)); v.push_back(std::to_string(e.reflectable));
v.push_back(std::to_string(e.bonushate)); v.push_back(std::to_string(e.bonushate));
v.push_back(std::to_string(e.field163)); v.push_back(std::to_string(e.field163));
@@ -2893,7 +2893,7 @@ public:
v.push_back(std::to_string(e.ConeStopAngle)); v.push_back(std::to_string(e.ConeStopAngle));
v.push_back(std::to_string(e.sneaking)); v.push_back(std::to_string(e.sneaking));
v.push_back(std::to_string(e.not_extendable)); v.push_back(std::to_string(e.not_extendable));
v.push_back(std::to_string(e.field198)); v.push_back(std::to_string(e.no_detrimental_spell_aggro));
v.push_back(std::to_string(e.field199)); v.push_back(std::to_string(e.field199));
v.push_back(std::to_string(e.suspendable)); v.push_back(std::to_string(e.suspendable));
v.push_back(std::to_string(e.viral_range)); v.push_back(std::to_string(e.viral_range));
@@ -2904,7 +2904,7 @@ public:
v.push_back(std::to_string(e.field206)); v.push_back(std::to_string(e.field206));
v.push_back(std::to_string(e.spellgroup)); v.push_back(std::to_string(e.spellgroup));
v.push_back(std::to_string(e.rank_)); v.push_back(std::to_string(e.rank_));
v.push_back(std::to_string(e.field209)); v.push_back(std::to_string(e.no_resist));
v.push_back(std::to_string(e.field210)); v.push_back(std::to_string(e.field210));
v.push_back(std::to_string(e.CastRestriction)); v.push_back(std::to_string(e.CastRestriction));
v.push_back(std::to_string(e.allowrest)); v.push_back(std::to_string(e.allowrest));
@@ -2912,13 +2912,13 @@ public:
v.push_back(std::to_string(e.OutofCombat)); v.push_back(std::to_string(e.OutofCombat));
v.push_back(std::to_string(e.field215)); v.push_back(std::to_string(e.field215));
v.push_back(std::to_string(e.field216)); v.push_back(std::to_string(e.field216));
v.push_back(std::to_string(e.field217)); v.push_back(std::to_string(e.override_crit_chance));
v.push_back(std::to_string(e.aemaxtargets)); v.push_back(std::to_string(e.aemaxtargets));
v.push_back(std::to_string(e.maxtargets)); v.push_back(std::to_string(e.maxtargets));
v.push_back(std::to_string(e.field220)); v.push_back(std::to_string(e.no_heal_damage_item_mod));
v.push_back(std::to_string(e.field221)); v.push_back(std::to_string(e.caster_requirement_id));
v.push_back(std::to_string(e.field222)); v.push_back(std::to_string(e.spell_class));
v.push_back(std::to_string(e.field223)); v.push_back(std::to_string(e.spell_subclass));
v.push_back(std::to_string(e.persistdeath)); v.push_back(std::to_string(e.persistdeath));
v.push_back(std::to_string(e.field225)); v.push_back(std::to_string(e.field225));
v.push_back(std::to_string(e.field226)); v.push_back(std::to_string(e.field226));
@@ -2927,7 +2927,7 @@ public:
v.push_back(std::to_string(e.max_dist)); v.push_back(std::to_string(e.max_dist));
v.push_back(std::to_string(e.max_dist_mod)); v.push_back(std::to_string(e.max_dist_mod));
v.push_back(std::to_string(e.min_range)); v.push_back(std::to_string(e.min_range));
v.push_back(std::to_string(e.field232)); v.push_back(std::to_string(e.no_remove));
v.push_back(std::to_string(e.field233)); v.push_back(std::to_string(e.field233));
v.push_back(std::to_string(e.field234)); v.push_back(std::to_string(e.field234));
v.push_back(std::to_string(e.field235)); v.push_back(std::to_string(e.field235));
@@ -3114,7 +3114,7 @@ public:
v.push_back(std::to_string(e.effectdescnum)); v.push_back(std::to_string(e.effectdescnum));
v.push_back(std::to_string(e.effectdescnum2)); v.push_back(std::to_string(e.effectdescnum2));
v.push_back(std::to_string(e.npc_no_los)); v.push_back(std::to_string(e.npc_no_los));
v.push_back(std::to_string(e.field160)); v.push_back(std::to_string(e.feedbackable));
v.push_back(std::to_string(e.reflectable)); v.push_back(std::to_string(e.reflectable));
v.push_back(std::to_string(e.bonushate)); v.push_back(std::to_string(e.bonushate));
v.push_back(std::to_string(e.field163)); v.push_back(std::to_string(e.field163));
@@ -3152,7 +3152,7 @@ public:
v.push_back(std::to_string(e.ConeStopAngle)); v.push_back(std::to_string(e.ConeStopAngle));
v.push_back(std::to_string(e.sneaking)); v.push_back(std::to_string(e.sneaking));
v.push_back(std::to_string(e.not_extendable)); v.push_back(std::to_string(e.not_extendable));
v.push_back(std::to_string(e.field198)); v.push_back(std::to_string(e.no_detrimental_spell_aggro));
v.push_back(std::to_string(e.field199)); v.push_back(std::to_string(e.field199));
v.push_back(std::to_string(e.suspendable)); v.push_back(std::to_string(e.suspendable));
v.push_back(std::to_string(e.viral_range)); v.push_back(std::to_string(e.viral_range));
@@ -3163,7 +3163,7 @@ public:
v.push_back(std::to_string(e.field206)); v.push_back(std::to_string(e.field206));
v.push_back(std::to_string(e.spellgroup)); v.push_back(std::to_string(e.spellgroup));
v.push_back(std::to_string(e.rank_)); v.push_back(std::to_string(e.rank_));
v.push_back(std::to_string(e.field209)); v.push_back(std::to_string(e.no_resist));
v.push_back(std::to_string(e.field210)); v.push_back(std::to_string(e.field210));
v.push_back(std::to_string(e.CastRestriction)); v.push_back(std::to_string(e.CastRestriction));
v.push_back(std::to_string(e.allowrest)); v.push_back(std::to_string(e.allowrest));
@@ -3171,13 +3171,13 @@ public:
v.push_back(std::to_string(e.OutofCombat)); v.push_back(std::to_string(e.OutofCombat));
v.push_back(std::to_string(e.field215)); v.push_back(std::to_string(e.field215));
v.push_back(std::to_string(e.field216)); v.push_back(std::to_string(e.field216));
v.push_back(std::to_string(e.field217)); v.push_back(std::to_string(e.override_crit_chance));
v.push_back(std::to_string(e.aemaxtargets)); v.push_back(std::to_string(e.aemaxtargets));
v.push_back(std::to_string(e.maxtargets)); v.push_back(std::to_string(e.maxtargets));
v.push_back(std::to_string(e.field220)); v.push_back(std::to_string(e.no_heal_damage_item_mod));
v.push_back(std::to_string(e.field221)); v.push_back(std::to_string(e.caster_requirement_id));
v.push_back(std::to_string(e.field222)); v.push_back(std::to_string(e.spell_class));
v.push_back(std::to_string(e.field223)); v.push_back(std::to_string(e.spell_subclass));
v.push_back(std::to_string(e.persistdeath)); v.push_back(std::to_string(e.persistdeath));
v.push_back(std::to_string(e.field225)); v.push_back(std::to_string(e.field225));
v.push_back(std::to_string(e.field226)); v.push_back(std::to_string(e.field226));
@@ -3186,7 +3186,7 @@ public:
v.push_back(std::to_string(e.max_dist)); v.push_back(std::to_string(e.max_dist));
v.push_back(std::to_string(e.max_dist_mod)); v.push_back(std::to_string(e.max_dist_mod));
v.push_back(std::to_string(e.min_range)); v.push_back(std::to_string(e.min_range));
v.push_back(std::to_string(e.field232)); v.push_back(std::to_string(e.no_remove));
v.push_back(std::to_string(e.field233)); v.push_back(std::to_string(e.field233));
v.push_back(std::to_string(e.field234)); v.push_back(std::to_string(e.field234));
v.push_back(std::to_string(e.field235)); v.push_back(std::to_string(e.field235));
@@ -0,0 +1,50 @@
#ifndef EQEMU_BOT_STAT_CAPS_REPOSITORY_H
#define EQEMU_BOT_STAT_CAPS_REPOSITORY_H
#include "../database.h"
#include "../strings.h"
#include "base/base_bot_stat_caps_repository.h"
class BotStatCapsRepository: public BaseBotStatCapsRepository {
public:
/**
* This file was auto generated and can be modified and extended upon
*
* Base repository methods are automatically
* generated in the "base" version of this repository. The base repository
* is immutable and to be left untouched, while methods in this class
* are used as extension methods for more specific persistence-layer
* accessors or mutators.
*
* Base Methods (Subject to be expanded upon in time)
*
* Note: Not all tables are designed appropriately to fit functionality with all base methods
*
* InsertOne
* UpdateOne
* DeleteOne
* FindOne
* GetWhere(std::string where_filter)
* DeleteWhere(std::string where_filter)
* InsertMany
* All
*
* Example custom methods in a repository
*
* BotStatCapsRepository::GetByZoneAndVersion(int zone_id, int zone_version)
* BotStatCapsRepository::GetWhereNeverExpires()
* BotStatCapsRepository::GetWhereXAndY()
* BotStatCapsRepository::DeleteWhereXAndY()
*
* Most of the above could be covered by base methods, but if you as a developer
* find yourself re-using logic for other parts of the code, its best to just make a
* method that can be re-used easily elsewhere especially if it can use a base repository
* method and encapsulate filters there
*/
// Custom extended repository methods here
};
#endif //EQEMU_BOT_STAT_CAPS_REPOSITORY_H
@@ -0,0 +1,50 @@
#ifndef EQEMU_CHARACTER_STAT_CAPS_REPOSITORY_H
#define EQEMU_CHARACTER_STAT_CAPS_REPOSITORY_H
#include "../database.h"
#include "../strings.h"
#include "base/base_character_stat_caps_repository.h"
class CharacterStatCapsRepository: public BaseCharacterStatCapsRepository {
public:
/**
* This file was auto generated and can be modified and extended upon
*
* Base repository methods are automatically
* generated in the "base" version of this repository. The base repository
* is immutable and to be left untouched, while methods in this class
* are used as extension methods for more specific persistence-layer
* accessors or mutators.
*
* Base Methods (Subject to be expanded upon in time)
*
* Note: Not all tables are designed appropriately to fit functionality with all base methods
*
* InsertOne
* UpdateOne
* DeleteOne
* FindOne
* GetWhere(std::string where_filter)
* DeleteWhere(std::string where_filter)
* InsertMany
* All
*
* Example custom methods in a repository
*
* CharacterStatCapsRepository::GetByZoneAndVersion(int zone_id, int zone_version)
* CharacterStatCapsRepository::GetWhereNeverExpires()
* CharacterStatCapsRepository::GetWhereXAndY()
* CharacterStatCapsRepository::DeleteWhereXAndY()
*
* Most of the above could be covered by base methods, but if you as a developer
* find yourself re-using logic for other parts of the code, its best to just make a
* method that can be re-used easily elsewhere especially if it can use a base repository
* method and encapsulate filters there
*/
// Custom extended repository methods here
};
#endif //EQEMU_CHARACTER_STAT_CAPS_REPOSITORY_H
@@ -49,6 +49,7 @@ public:
// these are the base definitions for command_subsettings and can be over-ridden by the database // these are the base definitions for command_subsettings and can be over-ridden by the database
std::vector<CommandSubsettingsRepository::CommandSubsettings> static_records = { std::vector<CommandSubsettingsRepository::CommandSubsettings> static_records = {
{.parent_command = "find", .sub_command = "aa", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "findaa"}, {.parent_command = "find", .sub_command = "aa", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "findaa"},
{.parent_command = "find", .sub_command = "account", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "findaccount"},
{.parent_command = "find", .sub_command = "body_type", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "findbodytype"}, {.parent_command = "find", .sub_command = "body_type", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "findbodytype"},
{.parent_command = "find", .sub_command = "bug_category", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "findbugcategory"}, {.parent_command = "find", .sub_command = "bug_category", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "findbugcategory"},
{.parent_command = "find", .sub_command = "character", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "findcharacter"}, {.parent_command = "find", .sub_command = "character", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "findcharacter"},
@@ -142,6 +143,7 @@ public:
{.parent_command = "show", .sub_command = "hatelist", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "hatelist"}, {.parent_command = "show", .sub_command = "hatelist", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "hatelist"},
{.parent_command = "show", .sub_command = "inventory", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "peekinv"}, {.parent_command = "show", .sub_command = "inventory", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "peekinv"},
{.parent_command = "show", .sub_command = "ip_lookup", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "iplookup"}, {.parent_command = "show", .sub_command = "ip_lookup", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "iplookup"},
{.parent_command = "show", .sub_command = "keyring", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showkeyring"},
{.parent_command = "show", .sub_command = "line_of_sight", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "checklos"}, {.parent_command = "show", .sub_command = "line_of_sight", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "checklos"},
{.parent_command = "show", .sub_command = "network", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "network"}, {.parent_command = "show", .sub_command = "network", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "network"},
{.parent_command = "show", .sub_command = "network_stats", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "netstats"}, {.parent_command = "show", .sub_command = "network_stats", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "netstats"},
+1 -1
View File
@@ -619,7 +619,7 @@ RULE_INT(Combat, SneakPullAssistRange, 400, "Modified range of assist for sneak
RULE_BOOL(Combat, Classic2HBAnimation, false, "2HB will use the 2 hand piercing animation instead of the overhead slashing animation") RULE_BOOL(Combat, Classic2HBAnimation, false, "2HB will use the 2 hand piercing animation instead of the overhead slashing animation")
RULE_BOOL(Combat, ArcheryConsumesAmmo, true, "Set to false to disable Archery Ammo Consumption") RULE_BOOL(Combat, ArcheryConsumesAmmo, true, "Set to false to disable Archery Ammo Consumption")
RULE_BOOL(Combat, ThrowingConsumesAmmo, true, "Set to false to disable Throwing Ammo Consumption") RULE_BOOL(Combat, ThrowingConsumesAmmo, true, "Set to false to disable Throwing Ammo Consumption")
RULE_BOOL(Combat, UseLiveRiposteMechanics, false, "Set to true to disable SPA 173 SE_RiposteChance from making those with the effect on them immune to enrage, can longer riposte from a riposte.") RULE_BOOL(Combat, UseLiveRiposteMechanics, false, "Set to true to disable SPA 173 SpellEffect::RiposteChance from making those with the effect on them immune to enrage, can longer riposte from a riposte.")
RULE_INT(Combat, FrontalStunImmunityClasses, 0, "Bitmask for Classes than have frontal stun immunity, No Races (0) by default.") RULE_INT(Combat, FrontalStunImmunityClasses, 0, "Bitmask for Classes than have frontal stun immunity, No Races (0) by default.")
RULE_BOOL(Combat, NPCsUseFrontalStunImmunityClasses, false, "Enable or disable NPCs using frontal stun immunity Classes from Combat:FrontalStunImmunityClasses, false by default.") RULE_BOOL(Combat, NPCsUseFrontalStunImmunityClasses, false, "Enable or disable NPCs using frontal stun immunity Classes from Combat:FrontalStunImmunityClasses, false by default.")
RULE_INT(Combat, FrontalStunImmunityRaces, 512, "Bitmask for Races than have frontal stun immunity, Ogre (512) only by default.") RULE_INT(Combat, FrontalStunImmunityRaces, 512, "Bitmask for Races than have frontal stun immunity, Ogre (512) only by default.")
+450 -425
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -76,8 +76,8 @@ public:
uint8 GetGMSpeed(uint32 account_id); uint8 GetGMSpeed(uint32 account_id);
bool SetHideMe(uint32 account_id, uint8 hideme); bool SetHideMe(uint32 account_id, uint8 hideme);
int DeleteStalePlayerCorpses(); int DeleteStalePlayerCorpses();
void LoadCharacterInspectMessage(uint32 character_id, InspectMessage_Struct *message); void LoadCharacterInspectMessage(uint32 character_id, InspectMessage_Struct* s);
void SaveCharacterInspectMessage(uint32 character_id, const InspectMessage_Struct *message); void SaveCharacterInspectMessage(uint32 character_id, const InspectMessage_Struct* s);
bool GetCommandSettings(std::map<std::string, std::pair<uint8, std::vector<std::string>>> &command_settings); bool GetCommandSettings(std::map<std::string, std::pair<uint8, std::vector<std::string>>> &command_settings);
bool UpdateInjectedCommandSettings(const std::vector<std::pair<std::string, uint8>> &injected); bool UpdateInjectedCommandSettings(const std::vector<std::pair<std::string, uint8>> &injected);
bool UpdateOrphanedCommandSettings(const std::vector<std::string> &orphaned); bool UpdateOrphanedCommandSettings(const std::vector<std::string> &orphaned);
@@ -158,7 +158,7 @@ public:
); );
EQ::ItemInstance *CreateBaseItem(const EQ::ItemData *item, int16 charges = 0); EQ::ItemInstance *CreateBaseItem(const EQ::ItemData *item, int16 charges = 0);
void GetItemsCount(int32 &item_count, uint32 &max_id); void GetItemsCount(int32& item_count, uint32& max_id);
void LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id); void LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id);
bool LoadItems(const std::string &prefix); bool LoadItems(const std::string &prefix);
const EQ::ItemData *IterateItems(uint32 *id) const; const EQ::ItemData *IterateItems(uint32 *id) const;
@@ -173,7 +173,7 @@ public:
int GetMaxSpellID(); int GetMaxSpellID();
bool LoadSpells(const std::string &prefix, int32 *records, const SPDat_Spell_Struct **sp); bool LoadSpells(const std::string &prefix, int32 *records, const SPDat_Spell_Struct **sp);
void LoadSpells(void *data, int max_spells); void LoadSpells(void *data, int max_spells);
void LoadDamageShieldTypes(SPDat_Spell_Struct *sp, int32 iMaxSpellID); void LoadDamageShieldTypes(SPDat_Spell_Struct* s);
uint32 GetSharedSpellsCount() { return m_shared_spells_count; } uint32 GetSharedSpellsCount() { return m_shared_spells_count; }
uint32 GetSpellsCount(); uint32 GetSpellsCount();
+415 -415
View File
File diff suppressed because it is too large Load Diff
+531 -533
View File
File diff suppressed because it is too large Load Diff
+6
View File
@@ -313,6 +313,12 @@ std::string Strings::Commify(const std::string &number)
auto string_length = static_cast<int>(number.length()); auto string_length = static_cast<int>(number.length());
if (string_length == 3) {
return number;
} else if (string_length == 4 && number.starts_with("-")) {
return number;
}
int i = 0; int i = 0;
for (i = string_length - 3; i >= 0; i -= 3) { for (i = string_length - 3; i >= 0; i -= 3) {
if (i > 0) { if (i > 0) {
+3 -3
View File
@@ -25,7 +25,7 @@
// Build variables // Build variables
// these get injected during the build pipeline // these get injected during the build pipeline
#define CURRENT_VERSION "23.8.1-dev" // always append -dev to the current version for custom-builds #define CURRENT_VERSION "23.9.1-dev" // always append -dev to the current version for custom-builds
#define LOGIN_VERSION "0.8.0" #define LOGIN_VERSION "0.8.0"
#define COMPILE_DATE __DATE__ #define COMPILE_DATE __DATE__
#define COMPILE_TIME __TIME__ #define COMPILE_TIME __TIME__
@@ -42,8 +42,8 @@
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt * Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
*/ */
#define CURRENT_BINARY_DATABASE_VERSION 9325 #define CURRENT_BINARY_DATABASE_VERSION 9329
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9054 #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9055
#define CUSTOM_BINARY_DATABASE_VERSION 0 #define CUSTOM_BINARY_DATABASE_VERSION 0
#endif #endif
+10 -10
View File
@@ -33,7 +33,7 @@ EverQuest::EverQuest(const std::string &host, int port, const std::string &user,
} }
else { else {
m_host = addr; m_host = addr;
m_login_connection_manager.reset(new EQ::Net::DaybreakConnectionManager()); m_login_connection_manager.reset(new EQ::Net::ReliableStreamConnectionManager());
m_login_connection_manager->OnNewConnection(std::bind(&EverQuest::LoginOnNewConnection, this, std::placeholders::_1)); m_login_connection_manager->OnNewConnection(std::bind(&EverQuest::LoginOnNewConnection, this, std::placeholders::_1));
m_login_connection_manager->OnConnectionStateChange(std::bind(&EverQuest::LoginOnStatusChangeReconnectEnabled, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); m_login_connection_manager->OnConnectionStateChange(std::bind(&EverQuest::LoginOnStatusChangeReconnectEnabled, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
@@ -48,13 +48,13 @@ EverQuest::~EverQuest()
{ {
} }
void EverQuest::LoginOnNewConnection(std::shared_ptr<EQ::Net::DaybreakConnection> connection) void EverQuest::LoginOnNewConnection(std::shared_ptr<EQ::Net::ReliableStreamConnection> connection)
{ {
m_login_connection = connection; m_login_connection = connection;
Log.OutF(Logs::General, Logs::Headless_Client, "Connecting..."); Log.OutF(Logs::General, Logs::Headless_Client, "Connecting...");
} }
void EverQuest::LoginOnStatusChangeReconnectEnabled(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to) void EverQuest::LoginOnStatusChangeReconnectEnabled(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to)
{ {
if (to == EQ::Net::StatusConnected) { if (to == EQ::Net::StatusConnected) {
Log.OutF(Logs::General, Logs::Headless_Client, "Login connected."); Log.OutF(Logs::General, Logs::Headless_Client, "Login connected.");
@@ -70,14 +70,14 @@ void EverQuest::LoginOnStatusChangeReconnectEnabled(std::shared_ptr<EQ::Net::Day
} }
} }
void EverQuest::LoginOnStatusChangeReconnectDisabled(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to) void EverQuest::LoginOnStatusChangeReconnectDisabled(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to)
{ {
if (to == EQ::Net::StatusDisconnected) { if (to == EQ::Net::StatusDisconnected) {
m_login_connection.reset(); m_login_connection.reset();
} }
} }
void EverQuest::LoginOnPacketRecv(std::shared_ptr<EQ::Net::DaybreakConnection> conn, const EQ::Net::Packet & p) void EverQuest::LoginOnPacketRecv(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, const EQ::Net::Packet & p)
{ {
auto opcode = p.GetUInt16(0); auto opcode = p.GetUInt16(0);
switch (opcode) { switch (opcode) {
@@ -251,20 +251,20 @@ void EverQuest::LoginDisableReconnect()
void EverQuest::ConnectToWorld() void EverQuest::ConnectToWorld()
{ {
m_world_connection_manager.reset(new EQ::Net::DaybreakConnectionManager()); m_world_connection_manager.reset(new EQ::Net::ReliableStreamConnectionManager());
m_world_connection_manager->OnNewConnection(std::bind(&EverQuest::WorldOnNewConnection, this, std::placeholders::_1)); m_world_connection_manager->OnNewConnection(std::bind(&EverQuest::WorldOnNewConnection, this, std::placeholders::_1));
m_world_connection_manager->OnConnectionStateChange(std::bind(&EverQuest::WorldOnStatusChangeReconnectEnabled, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); m_world_connection_manager->OnConnectionStateChange(std::bind(&EverQuest::WorldOnStatusChangeReconnectEnabled, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
m_world_connection_manager->OnPacketRecv(std::bind(&EverQuest::WorldOnPacketRecv, this, std::placeholders::_1, std::placeholders::_2)); m_world_connection_manager->OnPacketRecv(std::bind(&EverQuest::WorldOnPacketRecv, this, std::placeholders::_1, std::placeholders::_2));
m_world_connection_manager->Connect(m_host, 9000); m_world_connection_manager->Connect(m_host, 9000);
} }
void EverQuest::WorldOnNewConnection(std::shared_ptr<EQ::Net::DaybreakConnection> connection) void EverQuest::WorldOnNewConnection(std::shared_ptr<EQ::Net::ReliableStreamConnection> connection)
{ {
m_world_connection = connection; m_world_connection = connection;
Log.OutF(Logs::General, Logs::Headless_Client, "Connecting to world..."); Log.OutF(Logs::General, Logs::Headless_Client, "Connecting to world...");
} }
void EverQuest::WorldOnStatusChangeReconnectEnabled(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to) void EverQuest::WorldOnStatusChangeReconnectEnabled(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to)
{ {
if (to == EQ::Net::StatusConnected) { if (to == EQ::Net::StatusConnected) {
Log.OutF(Logs::General, Logs::Headless_Client, "World connected."); Log.OutF(Logs::General, Logs::Headless_Client, "World connected.");
@@ -278,14 +278,14 @@ void EverQuest::WorldOnStatusChangeReconnectEnabled(std::shared_ptr<EQ::Net::Day
} }
} }
void EverQuest::WorldOnStatusChangeReconnectDisabled(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to) void EverQuest::WorldOnStatusChangeReconnectDisabled(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to)
{ {
if (to == EQ::Net::StatusDisconnected) { if (to == EQ::Net::StatusDisconnected) {
m_world_connection.reset(); m_world_connection.reset();
} }
} }
void EverQuest::WorldOnPacketRecv(std::shared_ptr<EQ::Net::DaybreakConnection> conn, const EQ::Net::Packet & p) void EverQuest::WorldOnPacketRecv(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, const EQ::Net::Packet & p)
{ {
auto opcode = p.GetUInt16(0); auto opcode = p.GetUInt16(0);
switch (opcode) { switch (opcode) {
+13 -13
View File
@@ -1,7 +1,7 @@
#pragma once #pragma once
#include "../common/eqemu_logsys.h" #include "../common/eqemu_logsys.h"
#include "../common/net/daybreak_connection.h" #include "../common/net/reliable_stream_connection.h"
#include "../common/event/timer.h" #include "../common/event/timer.h"
#include <openssl/des.h> #include <openssl/des.h>
#include <string> #include <string>
@@ -26,10 +26,10 @@ public:
private: private:
//Login //Login
void LoginOnNewConnection(std::shared_ptr<EQ::Net::DaybreakConnection> connection); void LoginOnNewConnection(std::shared_ptr<EQ::Net::ReliableStreamConnection> connection);
void LoginOnStatusChangeReconnectEnabled(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to); void LoginOnStatusChangeReconnectEnabled(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to);
void LoginOnStatusChangeReconnectDisabled(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to); void LoginOnStatusChangeReconnectDisabled(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to);
void LoginOnPacketRecv(std::shared_ptr<EQ::Net::DaybreakConnection> conn, const EQ::Net::Packet &p); void LoginOnPacketRecv(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, const EQ::Net::Packet &p);
void LoginSendSessionReady(); void LoginSendSessionReady();
void LoginSendLogin(); void LoginSendLogin();
@@ -41,25 +41,25 @@ private:
void LoginDisableReconnect(); void LoginDisableReconnect();
std::unique_ptr<EQ::Net::DaybreakConnectionManager> m_login_connection_manager; std::unique_ptr<EQ::Net::ReliableStreamConnectionManager> m_login_connection_manager;
std::shared_ptr<EQ::Net::DaybreakConnection> m_login_connection; std::shared_ptr<EQ::Net::ReliableStreamConnection> m_login_connection;
std::map<uint32_t, WorldServer> m_world_servers; std::map<uint32_t, WorldServer> m_world_servers;
//World //World
void ConnectToWorld(); void ConnectToWorld();
void WorldOnNewConnection(std::shared_ptr<EQ::Net::DaybreakConnection> connection); void WorldOnNewConnection(std::shared_ptr<EQ::Net::ReliableStreamConnection> connection);
void WorldOnStatusChangeReconnectEnabled(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to); void WorldOnStatusChangeReconnectEnabled(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to);
void WorldOnStatusChangeReconnectDisabled(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to); void WorldOnStatusChangeReconnectDisabled(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to);
void WorldOnPacketRecv(std::shared_ptr<EQ::Net::DaybreakConnection> conn, const EQ::Net::Packet &p); void WorldOnPacketRecv(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, const EQ::Net::Packet &p);
void WorldSendClientAuth(); void WorldSendClientAuth();
void WorldSendEnterWorld(const std::string &character); void WorldSendEnterWorld(const std::string &character);
void WorldProcessCharacterSelect(const EQ::Net::Packet &p); void WorldProcessCharacterSelect(const EQ::Net::Packet &p);
std::unique_ptr<EQ::Net::DaybreakConnectionManager> m_world_connection_manager; std::unique_ptr<EQ::Net::ReliableStreamConnectionManager> m_world_connection_manager;
std::shared_ptr<EQ::Net::DaybreakConnection> m_world_connection; std::shared_ptr<EQ::Net::ReliableStreamConnection> m_world_connection;
//Variables //Variables
std::string m_host; std::string m_host;
+5 -5
View File
@@ -26,7 +26,7 @@ LoginConnection::LoginConnection(const std::string &username, const std::string
m_host_port = host_port; m_host_port = host_port;
m_server = server; m_server = server;
m_connection_manager.reset(new EQ::Net::DaybreakConnectionManager()); m_connection_manager.reset(new EQ::Net::ReliableStreamConnectionManager());
m_connection_manager->OnNewConnection(std::bind(&LoginConnection::OnNewConnection, this, std::placeholders::_1)); m_connection_manager->OnNewConnection(std::bind(&LoginConnection::OnNewConnection, this, std::placeholders::_1));
m_connection_manager->OnConnectionStateChange(std::bind(&LoginConnection::OnStatusChangeActive, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); m_connection_manager->OnConnectionStateChange(std::bind(&LoginConnection::OnStatusChangeActive, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
@@ -39,13 +39,13 @@ LoginConnection::~LoginConnection()
{ {
} }
void LoginConnection::OnNewConnection(std::shared_ptr<EQ::Net::DaybreakConnection> connection) void LoginConnection::OnNewConnection(std::shared_ptr<EQ::Net::ReliableStreamConnection> connection)
{ {
m_connection = connection; m_connection = connection;
Log.OutF(Logs::General, Logs::Headless_Client, "Connecting..."); Log.OutF(Logs::General, Logs::Headless_Client, "Connecting...");
} }
void LoginConnection::OnStatusChangeActive(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to) void LoginConnection::OnStatusChangeActive(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to)
{ {
if (to == EQ::Net::StatusConnected) { if (to == EQ::Net::StatusConnected) {
Log.OutF(Logs::General, Logs::Headless_Client, "Login connected."); Log.OutF(Logs::General, Logs::Headless_Client, "Login connected.");
@@ -61,7 +61,7 @@ void LoginConnection::OnStatusChangeActive(std::shared_ptr<EQ::Net::DaybreakConn
} }
} }
void LoginConnection::OnStatusChangeInactive(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to) void LoginConnection::OnStatusChangeInactive(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to)
{ {
if (to == EQ::Net::StatusDisconnected) { if (to == EQ::Net::StatusDisconnected) {
m_key.clear(); m_key.clear();
@@ -70,7 +70,7 @@ void LoginConnection::OnStatusChangeInactive(std::shared_ptr<EQ::Net::DaybreakCo
} }
} }
void LoginConnection::OnPacketRecv(std::shared_ptr<EQ::Net::DaybreakConnection> conn, const EQ::Net::Packet &p) void LoginConnection::OnPacketRecv(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, const EQ::Net::Packet &p)
{ {
auto opcode = p.GetUInt16(0); auto opcode = p.GetUInt16(0);
switch (opcode) { switch (opcode) {
+7 -7
View File
@@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../common/net/daybreak_connection.h" #include "../common/net/reliable_stream_connection.h"
#include "../common/event/timer.h" #include "../common/event/timer.h"
#include <map> #include <map>
@@ -23,10 +23,10 @@ public:
~LoginConnection(); ~LoginConnection();
private: private:
void OnNewConnection(std::shared_ptr<EQ::Net::DaybreakConnection> connection); void OnNewConnection(std::shared_ptr<EQ::Net::ReliableStreamConnection> connection);
void OnStatusChangeActive(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to); void OnStatusChangeActive(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to);
void OnStatusChangeInactive(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to); void OnStatusChangeInactive(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to);
void OnPacketRecv(std::shared_ptr<EQ::Net::DaybreakConnection> conn, const EQ::Net::Packet &p); void OnPacketRecv(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, const EQ::Net::Packet &p);
void Kill(); void Kill();
void Start(); void Start();
@@ -38,8 +38,8 @@ private:
void ProcessServerPacketList(const EQ::Net::Packet &p); void ProcessServerPacketList(const EQ::Net::Packet &p);
void ProcessServerPlayResponse(const EQ::Net::Packet &p); void ProcessServerPlayResponse(const EQ::Net::Packet &p);
std::unique_ptr<EQ::Net::DaybreakConnectionManager> m_connection_manager; std::unique_ptr<EQ::Net::ReliableStreamConnectionManager> m_connection_manager;
std::shared_ptr<EQ::Net::DaybreakConnection> m_connection; std::shared_ptr<EQ::Net::ReliableStreamConnection> m_connection;
bool m_connecting; bool m_connecting;
std::unique_ptr<EQ::Timer> m_connect_timer; std::unique_ptr<EQ::Timer> m_connect_timer;
+5 -5
View File
@@ -8,7 +8,7 @@ WorldConnection::WorldConnection(const std::string &key, uint32_t dbid, const st
m_key = key; m_key = key;
m_dbid = dbid; m_dbid = dbid;
m_connection_manager.reset(new EQ::Net::DaybreakConnectionManager()); m_connection_manager.reset(new EQ::Net::ReliableStreamConnectionManager());
m_connection_manager->OnNewConnection(std::bind(&WorldConnection::OnNewConnection, this, std::placeholders::_1)); m_connection_manager->OnNewConnection(std::bind(&WorldConnection::OnNewConnection, this, std::placeholders::_1));
m_connection_manager->OnConnectionStateChange(std::bind(&WorldConnection::OnStatusChangeActive, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); m_connection_manager->OnConnectionStateChange(std::bind(&WorldConnection::OnStatusChangeActive, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
m_connection_manager->OnPacketRecv(std::bind(&WorldConnection::OnPacketRecv, this, std::placeholders::_1, std::placeholders::_2)); m_connection_manager->OnPacketRecv(std::bind(&WorldConnection::OnPacketRecv, this, std::placeholders::_1, std::placeholders::_2));
@@ -18,13 +18,13 @@ WorldConnection::WorldConnection(const std::string &key, uint32_t dbid, const st
WorldConnection::~WorldConnection() { WorldConnection::~WorldConnection() {
} }
void WorldConnection::OnNewConnection(std::shared_ptr<EQ::Net::DaybreakConnection> connection) void WorldConnection::OnNewConnection(std::shared_ptr<EQ::Net::ReliableStreamConnection> connection)
{ {
m_connection = connection; m_connection = connection;
Log.OutF(Logs::General, Logs::Headless_Client, "Connecting to world..."); Log.OutF(Logs::General, Logs::Headless_Client, "Connecting to world...");
} }
void WorldConnection::OnStatusChangeActive(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to) void WorldConnection::OnStatusChangeActive(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to)
{ {
if (to == EQ::Net::StatusConnected) { if (to == EQ::Net::StatusConnected) {
Log.OutF(Logs::General, Logs::Headless_Client, "World connected."); Log.OutF(Logs::General, Logs::Headless_Client, "World connected.");
@@ -38,14 +38,14 @@ void WorldConnection::OnStatusChangeActive(std::shared_ptr<EQ::Net::DaybreakConn
} }
} }
void WorldConnection::OnStatusChangeInactive(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to) void WorldConnection::OnStatusChangeInactive(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to)
{ {
if (to == EQ::Net::StatusDisconnected) { if (to == EQ::Net::StatusDisconnected) {
m_connection.reset(); m_connection.reset();
} }
} }
void WorldConnection::OnPacketRecv(std::shared_ptr<EQ::Net::DaybreakConnection> conn, const EQ::Net::Packet &p) void WorldConnection::OnPacketRecv(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, const EQ::Net::Packet &p)
{ {
auto opcode = p.GetUInt16(0); auto opcode = p.GetUInt16(0);
Log.OutF(Logs::General, Logs::Headless_Client, "Packet in:\n{0}", p.ToString()); Log.OutF(Logs::General, Logs::Headless_Client, "Packet in:\n{0}", p.ToString());
+7 -7
View File
@@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../common/net/daybreak_connection.h" #include "../common/net/reliable_stream_connection.h"
#include "../common/event/timer.h" #include "../common/event/timer.h"
#include <map> #include <map>
@@ -10,17 +10,17 @@ public:
WorldConnection(const std::string &key, uint32_t dbid, const std::string &host); WorldConnection(const std::string &key, uint32_t dbid, const std::string &host);
~WorldConnection(); ~WorldConnection();
private: private:
void OnNewConnection(std::shared_ptr<EQ::Net::DaybreakConnection> connection); void OnNewConnection(std::shared_ptr<EQ::Net::ReliableStreamConnection> connection);
void OnStatusChangeActive(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to); void OnStatusChangeActive(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to);
void OnStatusChangeInactive(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to); void OnStatusChangeInactive(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to);
void OnPacketRecv(std::shared_ptr<EQ::Net::DaybreakConnection> conn, const EQ::Net::Packet &p); void OnPacketRecv(std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, const EQ::Net::Packet &p);
void Kill(); void Kill();
void Start(); void Start();
void SendClientAuth(); void SendClientAuth();
std::unique_ptr<EQ::Net::DaybreakConnectionManager> m_connection_manager; std::unique_ptr<EQ::Net::ReliableStreamConnectionManager> m_connection_manager;
std::shared_ptr<EQ::Net::DaybreakConnection> m_connection; std::shared_ptr<EQ::Net::ReliableStreamConnection> m_connection;
bool m_connecting; bool m_connecting;
std::unique_ptr<EQ::Timer> m_connect_timer; std::unique_ptr<EQ::Timer> m_connect_timer;
+10 -10
View File
@@ -124,18 +124,18 @@ uint64 AccountManagement::CheckExternalLoginserverUserCredentials(LoginAccountCo
bool running = true; bool running = true;
uint32 ret = 0; uint32 ret = 0;
EQ::Net::DaybreakConnectionManager mgr; EQ::Net::ReliableStreamConnectionManager mgr;
std::shared_ptr<EQ::Net::DaybreakConnection> conn; std::shared_ptr<EQ::Net::ReliableStreamConnection> conn;
mgr.OnNewConnection( mgr.OnNewConnection(
[&](std::shared_ptr<EQ::Net::DaybreakConnection> connection) { [&](std::shared_ptr<EQ::Net::ReliableStreamConnection> connection) {
conn = connection; conn = connection;
} }
); );
mgr.OnConnectionStateChange( mgr.OnConnectionStateChange(
[&]( [&](
std::shared_ptr<EQ::Net::DaybreakConnection> conn, std::shared_ptr<EQ::Net::ReliableStreamConnection> conn,
EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus from,
EQ::Net::DbProtocolStatus to EQ::Net::DbProtocolStatus to
) { ) {
@@ -152,7 +152,7 @@ uint64 AccountManagement::CheckExternalLoginserverUserCredentials(LoginAccountCo
); );
mgr.OnPacketRecv( mgr.OnPacketRecv(
[&](std::shared_ptr<EQ::Net::DaybreakConnection> conn, const EQ::Net::Packet &p) { [&](std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, const EQ::Net::Packet &p) {
auto opcode = p.GetUInt16(0); auto opcode = p.GetUInt16(0);
switch (opcode) { switch (opcode) {
case 0x0017: //OP_ChatMessage case 0x0017: //OP_ChatMessage
@@ -250,18 +250,18 @@ uint64 AccountManagement::HealthCheckUserLogin()
bool running = true; bool running = true;
uint64 ret = 0; uint64 ret = 0;
EQ::Net::DaybreakConnectionManager mgr; EQ::Net::ReliableStreamConnectionManager mgr;
std::shared_ptr<EQ::Net::DaybreakConnection> c; std::shared_ptr<EQ::Net::ReliableStreamConnection> c;
mgr.OnNewConnection( mgr.OnNewConnection(
[&](std::shared_ptr<EQ::Net::DaybreakConnection> connection) { [&](std::shared_ptr<EQ::Net::ReliableStreamConnection> connection) {
c = connection; c = connection;
} }
); );
mgr.OnConnectionStateChange( mgr.OnConnectionStateChange(
[&]( [&](
std::shared_ptr<EQ::Net::DaybreakConnection> conn, std::shared_ptr<EQ::Net::ReliableStreamConnection> conn,
EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus from,
EQ::Net::DbProtocolStatus to EQ::Net::DbProtocolStatus to
) { ) {
@@ -278,7 +278,7 @@ uint64 AccountManagement::HealthCheckUserLogin()
); );
mgr.OnPacketRecv( mgr.OnPacketRecv(
[&](std::shared_ptr<EQ::Net::DaybreakConnection> conn, const EQ::Net::Packet &p) { [&](std::shared_ptr<EQ::Net::ReliableStreamConnection> conn, const EQ::Net::Packet &p) {
auto opcode = p.GetUInt16(0); auto opcode = p.GetUInt16(0);
switch (opcode) { switch (opcode) {
case 0x0017: //OP_ChatMessage case 0x0017: //OP_ChatMessage
+3 -3
View File
@@ -6,7 +6,7 @@
#include "../common/random.h" #include "../common/random.h"
#include "../common/eq_stream_intf.h" #include "../common/eq_stream_intf.h"
#include "../common/net/dns.h" #include "../common/net/dns.h"
#include "../common/net/daybreak_connection.h" #include "../common/net/reliable_stream_connection.h"
#include "login_types.h" #include "login_types.h"
#include "../common/repositories/login_accounts_repository.h" #include "../common/repositories/login_accounts_repository.h"
#include <memory> #include <memory>
@@ -54,8 +54,8 @@ private:
unsigned int m_selected_play_server_id; unsigned int m_selected_play_server_id;
unsigned int m_play_sequence_id; unsigned int m_play_sequence_id;
std::string m_key; std::string m_key;
std::unique_ptr<EQ::Net::DaybreakConnectionManager> m_login_connection_manager; std::unique_ptr<EQ::Net::ReliableStreamConnectionManager> m_login_connection_manager;
std::shared_ptr<EQ::Net::DaybreakConnection> m_login_connection; std::shared_ptr<EQ::Net::ReliableStreamConnection> m_login_connection;
LoginBaseMessage m_login_base_message; LoginBaseMessage m_login_base_message;
std::string m_stored_username; std::string m_stored_username;
std::string m_stored_password; std::string m_stored_password;
+1 -1
View File
@@ -31,7 +31,7 @@ public:
inline void DefaultLoginServerName(const std::string &v) { m_default_loginserver_name = v; } inline void DefaultLoginServerName(const std::string &v) { m_default_loginserver_name = v; }
inline std::string GetDefaultLoginServerName() const { return m_default_loginserver_name; } inline std::string GetDefaultLoginServerName() const { return m_default_loginserver_name; }
inline bool IsShowPlayerCountEnabled() const { return m_show_player_count; } inline bool IsShowPlayerCountEnabled() const { return m_show_player_count; }
inline void SetShowPlayerCount(bool show_player_count) { show_player_count = show_player_count; } inline void SetShowPlayerCount(bool show_player_count) { m_show_player_count = show_player_count; }
inline bool IsWorldDevTestServersListBottom() const { return m_world_dev_list_bottom; } inline bool IsWorldDevTestServersListBottom() const { return m_world_dev_list_bottom; }
inline void SetWorldDevTestServersListBottom(bool list_bottom) { m_world_dev_list_bottom = list_bottom; } inline void SetWorldDevTestServersListBottom(bool list_bottom) { m_world_dev_list_bottom = list_bottom; }
inline bool IsWorldSpecialCharacterStartListBottom() const { return m_special_char_list_bottom; } inline bool IsWorldSpecialCharacterStartListBottom() const { return m_special_char_list_bottom; }
+5 -1
View File
@@ -155,7 +155,11 @@ void WorldServer::ProcessUserToWorldResponseLegacy(uint16_t opcode, const EQ::Ne
auto *res = (UsertoWorldResponseLegacy *) packet.Data(); auto *res = (UsertoWorldResponseLegacy *) packet.Data();
LogDebug("Trying to find client with user id of [{}]", res->lsaccountid); LogDebug("Trying to find client with user id of [{}]", res->lsaccountid);
Client *c = server.client_manager->GetClient(res->lsaccountid, "eqemu"); std::string db_loginserver = "local";
if (std::getenv("LSPX")) {
db_loginserver = "eqemu";
}
Client *c = server.client_manager->GetClient(res->lsaccountid, db_loginserver);
if (c) { if (c) {
LogDebug( LogDebug(
"Found client with user id of [{}] and account name of [{}]", "Found client with user id of [{}] and account name of [{}]",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "eqemu-server", "name": "eqemu-server",
"version": "23.8.1", "version": "23.9.1",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/EQEmu/Server.git" "url": "https://github.com/EQEmu/Server.git"
+5 -5
View File
@@ -469,11 +469,11 @@ static void ProcessCommandIgnore(Client *c, std::string Ignoree) {
Clientlist::Clientlist(int ChatPort) { Clientlist::Clientlist(int ChatPort) {
EQStreamManagerInterfaceOptions chat_opts(ChatPort, false, false); EQStreamManagerInterfaceOptions chat_opts(ChatPort, false, false);
chat_opts.opcode_size = 1; chat_opts.opcode_size = 1;
chat_opts.daybreak_options.stale_connection_ms = 600000; chat_opts.reliable_stream_options.stale_connection_ms = 600000;
chat_opts.daybreak_options.resend_delay_ms = RuleI(Network, ResendDelayBaseMS); chat_opts.reliable_stream_options.resend_delay_ms = RuleI(Network, ResendDelayBaseMS);
chat_opts.daybreak_options.resend_delay_factor = RuleR(Network, ResendDelayFactor); chat_opts.reliable_stream_options.resend_delay_factor = RuleR(Network, ResendDelayFactor);
chat_opts.daybreak_options.resend_delay_min = RuleI(Network, ResendDelayMinMS); chat_opts.reliable_stream_options.resend_delay_min = RuleI(Network, ResendDelayMinMS);
chat_opts.daybreak_options.resend_delay_max = RuleI(Network, ResendDelayMaxMS); chat_opts.reliable_stream_options.resend_delay_max = RuleI(Network, ResendDelayMaxMS);
chatsf = new EQ::Net::EQStreamManager(chat_opts); chatsf = new EQ::Net::EQStreamManager(chat_opts);
+3 -3
View File
@@ -14,15 +14,15 @@ perl utils/scripts/build/tag-version.pl
mkdir -p build && cd build && \ mkdir -p build && cd build && \
cmake -DEQEMU_BUILD_TESTS=ON \ cmake -DEQEMU_BUILD_TESTS=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DEQEMU_BUILD_STATIC=ON \ -DEQEMU_BUILD_STATIC=ON \
-DEQEMU_BUILD_LOGIN=ON \ -DEQEMU_BUILD_LOGIN=ON \
-DEQEMU_BUILD_LUA=ON \ -DEQEMU_BUILD_LUA=ON \
-DEQEMU_BUILD_PERL=ON \ -DEQEMU_BUILD_PERL=ON \
-DCMAKE_CXX_FLAGS:STRING="-O1 -g -Wno-everything" \ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-g -Wno-everything" \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-O1 -g -Wno-everything" \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-G 'Unix Makefiles' \ -G 'Unix Makefiles' \
.. && make -j$((`nproc`-12)) .. && make -j$((`nproc`-2))
curl https://raw.githubusercontent.com/Akkadius/eqemu-install-v2/master/eqemu_config.json --output eqemu_config.json curl https://raw.githubusercontent.com/Akkadius/eqemu-install-v2/master/eqemu_config.json --output eqemu_config.json
./bin/tests ./bin/tests
+1 -4
View File
@@ -6,13 +6,10 @@ toolchain go1.23.5
require ( require (
github.com/google/go-github/v41 v41.0.0 github.com/google/go-github/v41 v41.0.0
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be golang.org/x/oauth2 v0.27.0
) )
require ( require (
github.com/golang/protobuf v1.3.2 // indirect
github.com/google/go-querystring v1.1.0 // indirect github.com/google/go-querystring v1.1.0 // indirect
golang.org/x/crypto v0.36.0 // indirect golang.org/x/crypto v0.36.0 // indirect
golang.org/x/net v0.38.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
) )
+4 -6
View File
@@ -1,9 +1,9 @@
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg=
github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
@@ -14,10 +14,9 @@ golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M=
golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -27,5 +26,4 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
+20 -20
View File
@@ -2076,10 +2076,10 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc)
classtemp = cc->class_ - 1; classtemp = cc->class_ - 1;
racetemp = cc->race - 1; racetemp = cc->race - 1;
// these have non sequential race numbers so they need to be mapped // these have non sequential race numbers so they need to be mapped
if (cc->race == FROGLOK) racetemp = 14; if (cc->race == Race::Froglok2) racetemp = 14;
if (cc->race == VAHSHIR) racetemp = 13; if (cc->race == Race::VahShir) racetemp = 13;
if (cc->race == IKSAR) racetemp = 12; if (cc->race == Race::Iksar) racetemp = 12;
if (cc->race == DRAKKIN) racetemp = 15; if (cc->race == Race::Drakkin) racetemp = 15;
// if out of range looking it up in the table would crash stuff // if out of range looking it up in the table would crash stuff
// so we return from these // so we return from these
@@ -2186,43 +2186,43 @@ void Client::SetRaceStartingSkills( PlayerProfile_Struct *pp )
{ {
switch( pp->race ) switch( pp->race )
{ {
case BARBARIAN: case Race::Barbarian:
case DWARF: case Race::Dwarf:
case ERUDITE: case Race::Erudite:
case HALF_ELF: case Race::HalfElf:
case HIGH_ELF: case Race::HighElf:
case HUMAN: case Race::Human:
case OGRE: case Race::Ogre:
case TROLL: case Race::Troll:
case DRAKKIN: //Drakkin are supposed to get a starting AA Skill case Race::Drakkin: //Drakkin are supposed to get a starting AA Skill
{ {
// No Race Specific Skills // No Race Specific Skills
break; break;
} }
case DARK_ELF: case Race::DarkElf:
{ {
pp->skills[EQ::skills::SkillHide] = 50; pp->skills[EQ::skills::SkillHide] = 50;
break; break;
} }
case FROGLOK: case Race::Froglok2:
{ {
if (RuleI(Skills, SwimmingStartValue) < 125) { if (RuleI(Skills, SwimmingStartValue) < 125) {
pp->skills[EQ::skills::SkillSwimming] = 125; pp->skills[EQ::skills::SkillSwimming] = 125;
} }
break; break;
} }
case GNOME: case Race::Gnome:
{ {
pp->skills[EQ::skills::SkillTinkering] = 50; pp->skills[EQ::skills::SkillTinkering] = 50;
break; break;
} }
case HALFLING: case Race::Halfling:
{ {
pp->skills[EQ::skills::SkillHide] = 50; pp->skills[EQ::skills::SkillHide] = 50;
pp->skills[EQ::skills::SkillSneak] = 50; pp->skills[EQ::skills::SkillSneak] = 50;
break; break;
} }
case IKSAR: case Race::Iksar:
{ {
pp->skills[EQ::skills::SkillForage] = 50; pp->skills[EQ::skills::SkillForage] = 50;
if (RuleI(Skills, SwimmingStartValue) < 100) { if (RuleI(Skills, SwimmingStartValue) < 100) {
@@ -2230,13 +2230,13 @@ void Client::SetRaceStartingSkills( PlayerProfile_Struct *pp )
} }
break; break;
} }
case WOOD_ELF: case Race::WoodElf:
{ {
pp->skills[EQ::skills::SkillForage] = 50; pp->skills[EQ::skills::SkillForage] = 50;
pp->skills[EQ::skills::SkillHide] = 50; pp->skills[EQ::skills::SkillHide] = 50;
break; break;
} }
case VAHSHIR: case Race::VahShir:
{ {
pp->skills[EQ::skills::SkillSafeFall] = 50; pp->skills[EQ::skills::SkillSafeFall] = 50;
pp->skills[EQ::skills::SkillSneak] = 50; pp->skills[EQ::skills::SkillSneak] = 50;
+85 -40
View File
@@ -281,62 +281,107 @@ ClientListEntry* ClientList::FindCLEByCharacterID(uint32 iCharID) {
return nullptr; return nullptr;
} }
void ClientList::SendCLEList(const int16& admin, const char* to, WorldTCPConnection* connection, const char* iName) { void ClientList::SendCLEList(const int16& admin, const char* to, WorldTCPConnection* connection, const char* search_criteria)
{
LinkedListIterator<ClientListEntry*> iterator(clientlist); LinkedListIterator<ClientListEntry*> iterator(clientlist);
int x = 0, y = 0;
int namestrlen = iName == 0 ? 0 : strlen(iName);
bool addnewline = false;
char newline[3];
if (connection->IsConsole())
strcpy(newline, "\r\n");
else
strcpy(newline, "^");
auto out = fmt::memory_buffer(); int found_count = 0;
int total_count = 0;
int name_length = search_criteria ? strlen(search_criteria) : 0;
const char* new_line = connection->IsConsole() ? "\r\n" : "^";
bool add_new_line = false;
std::string message;
iterator.Reset(); iterator.Reset();
while(iterator.MoreElements()) {
while (iterator.MoreElements()) {
ClientListEntry* cle = iterator.GetData(); ClientListEntry* cle = iterator.GetData();
if (admin >= cle->Admin() && (iName == 0 || namestrlen == 0 || strncasecmp(cle->name(), iName, namestrlen) == 0 || strncasecmp(cle->AccountName(), iName, namestrlen) == 0 || strncasecmp(cle->LSName(), iName, namestrlen) == 0)) {
struct in_addr in; struct in_addr in;
in.s_addr = cle->GetIP(); in.s_addr = cle->GetIP();
if (addnewline) {
fmt::format_to(std::back_inserter(out), fmt::runtime(newline)); if (
admin >= cle->Admin() &&
(
!search_criteria ||
Strings::Contains(std::string(inet_ntoa(in)), search_criteria) ||
Strings::Contains(cle->name(), search_criteria) == 0 ||
Strings::Contains(cle->AccountName(), search_criteria) == 0 ||
Strings::Contains(cle->LSName(), search_criteria) == 0
)
) {
if (add_new_line) {
message += new_line;
} }
fmt::format_to(std::back_inserter(out), "ID: {} Acc# {} AccName: {} IP: {}", cle->GetID(), cle->AccountID(), cle->AccountName(), inet_ntoa(in));
fmt::format_to(std::back_inserter(out), "{} Stale: {} Online: {} Admin: {}", newline, cle->GetStaleCounter(), static_cast<int>(cle->Online()), cle->Admin()); message += fmt::format(
if (cle->LSID()) "Account: {} ({}) | IP: {} | Admin: {}",
fmt::format_to(std::back_inserter(out), "{} LSID: {} LSName: {} WorldAdmin: {}", newline, cle->LSID(), cle->LSName(), cle->WorldAdmin()); cle->AccountName(),
if (cle->CharID()) cle->AccountID(),
fmt::format_to(std::back_inserter(out), "{} CharID: {} CharName: {} Zone: {} ({})", newline, cle->CharID(), cle->name(), ZoneName(cle->zone()), cle->zone()); inet_ntoa(in),
if (out.size() >= 3072) { cle->Admin()
connection->SendEmoteMessageRaw( );
to,
0, if (cle->CharID()) {
AccountStatus::Player, message += fmt::format(
Chat::NPCQuestSay, "{}Character: {} ({}) | Zone: {} ({})",
out.data() new_line,
cle->name(),
cle->CharID(),
ZoneLongName(cle->zone()),
cle->zone()
); );
addnewline = false;
out.clear();
} else {
addnewline = true;
} }
y++;
} if (message.size() >= 3072) {
iterator.Advance();
x++;
}
fmt::format_to(std::back_inserter(out), "{}{} CLEs in memory. {} CLEs listed. numplayers = {}.", newline, x, y, numplayers);
connection->SendEmoteMessageRaw( connection->SendEmoteMessageRaw(
to, to,
0, 0,
AccountStatus::Player, AccountStatus::Player,
Chat::NPCQuestSay, Chat::NPCQuestSay,
out.data() message.c_str()
);
message.clear();
add_new_line = false;
} else {
add_new_line = true;
}
found_count++;
}
iterator.Advance();
total_count++;
}
message += fmt::format(
"{}{}Player Count: {}",
new_line,
(
found_count != total_count ?
fmt::format(
"Total: {} CLE{} | Found: {} CLE{} | ",
total_count,
(total_count != 1 ? "s" : ""),
found_count,
(found_count != 1 ? "s" : "")
) :
""
),
numplayers
);
connection->SendEmoteMessageRaw(
to,
0,
AccountStatus::Player,
Chat::NPCQuestSay,
message.c_str()
); );
} }
void ClientList::CLEAdd( void ClientList::CLEAdd(
uint32 login_server_id, uint32 login_server_id,
const char *login_server_name, const char *login_server_name,
@@ -598,7 +643,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S
whomlen = strlen(whom->whom); whomlen = strlen(whom->whom);
if (whom->wrace == 0x001A) { // 0x001A is the old Froglok race number and is sent by the client for /who all froglok if (whom->wrace == 0x001A) { // 0x001A is the old Froglok race number and is sent by the client for /who all froglok
whom->wrace = FROGLOK; // This is what EQEmu uses for the Froglok Race number. whom->wrace = Race::Froglok2; // This is what EQEmu uses for the Froglok Race number.
} }
} }
+1 -1
View File
@@ -45,7 +45,7 @@ public:
void SendClientVersionSummary(const char *Name); void SendClientVersionSummary(const char *Name);
void SendLFGMatches(ServerLFGMatchesRequest_Struct *LFGMatchesRequest); void SendLFGMatches(ServerLFGMatchesRequest_Struct *LFGMatchesRequest);
void ConsoleSendWhoAll(const char* to, int16 admin, Who_All_Struct* whom, WorldTCPConnection* connection); void ConsoleSendWhoAll(const char* to, int16 admin, Who_All_Struct* whom, WorldTCPConnection* connection);
void SendCLEList(const int16& admin, const char* to, WorldTCPConnection* connection, const char* iName = 0); void SendCLEList(const int16& admin, const char* to, WorldTCPConnection* connection, const char* search_criteria = 0);
bool SendPacket(const char* to, ServerPacket* pack); bool SendPacket(const char* to, ServerPacket* pack);
+5 -5
View File
@@ -333,11 +333,11 @@ int main(int argc, char **argv)
WorldBoot::CheckForPossibleConfigurationIssues(); WorldBoot::CheckForPossibleConfigurationIssues();
EQStreamManagerInterfaceOptions opts(9000, false, false); EQStreamManagerInterfaceOptions opts(9000, false, false);
opts.daybreak_options.resend_delay_ms = RuleI(Network, ResendDelayBaseMS); opts.reliable_stream_options.resend_delay_ms = RuleI(Network, ResendDelayBaseMS);
opts.daybreak_options.resend_delay_factor = RuleR(Network, ResendDelayFactor); opts.reliable_stream_options.resend_delay_factor = RuleR(Network, ResendDelayFactor);
opts.daybreak_options.resend_delay_min = RuleI(Network, ResendDelayMinMS); opts.reliable_stream_options.resend_delay_min = RuleI(Network, ResendDelayMinMS);
opts.daybreak_options.resend_delay_max = RuleI(Network, ResendDelayMaxMS); opts.reliable_stream_options.resend_delay_max = RuleI(Network, ResendDelayMaxMS);
opts.daybreak_options.outgoing_data_rate = RuleR(Network, ClientDataRate); opts.reliable_stream_options.outgoing_data_rate = RuleR(Network, ClientDataRate);
EQ::Net::EQStreamManager eqsm(opts); EQ::Net::EQStreamManager eqsm(opts);
+10
View File
@@ -732,6 +732,12 @@ void WorldDatabase::SetTitaniumDefaultStartZone(PlayerProfile_Struct* in_pp, Cha
in_pp->binds[0].zone_id = Zones::SHARVAHL; // sharvahl in_pp->binds[0].zone_id = Zones::SHARVAHL; // sharvahl
break; break;
} }
case StartZoneIndex::RatheMtn:
{
in_pp->zone_id = Zones::RATHEMTN; // rathemtn
in_pp->binds[0].zone_id = Zones::RATHEMTN; // rathemtn
break;
}
} }
} }
} }
@@ -895,9 +901,13 @@ bool WorldDatabase::GetCharSelInventory(
inst->SetCustomDataString(e.custom_data); inst->SetCustomDataString(e.custom_data);
} }
if (e.ornament_icon != 0 || e.ornament_idfile != 0 || e.ornament_hero_model != 0) {
inst->SetOrnamentIcon(e.ornament_icon); inst->SetOrnamentIcon(e.ornament_icon);
inst->SetOrnamentationIDFile(e.ornament_idfile); inst->SetOrnamentationIDFile(e.ornament_idfile);
inst->SetOrnamentHeroModel(e.ornament_hero_model); inst->SetOrnamentHeroModel(e.ornament_hero_model);
} else if (item->HerosForgeModel > 0) {
inst->SetOrnamentHeroModel(item->HerosForgeModel);
}
inv->PutItem(e.slot_id, *inst); inv->PutItem(e.slot_id, *inst);
+2 -1
View File
@@ -483,6 +483,7 @@ INSTALL(TARGETS zone RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
# precompiled headers # precompiled headers
IF (EQEMU_BUILD_PCH) IF (EQEMU_BUILD_PCH)
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ../common/pch/app-pch.h) TARGET_PRECOMPILE_HEADERS(zone PRIVATE ../common/pch/app-pch.h)
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ../common/pch/std-pch.h)
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ./pch/pch.h) TARGET_PRECOMPILE_HEADERS(zone PRIVATE ./pch/pch.h)
ENDIF() ENDIF()
@@ -501,7 +502,7 @@ if (EQEMU_BUILD_STATIC AND PERL_LIBRARY)
endif() endif()
# link zone against common libraries # link zone against common libraries
target_link_libraries(zone PRIVATE ${ZONE_LIBS} lua_zone perl_zone gm_commands_zone) target_link_libraries(zone PRIVATE lua_zone perl_zone gm_commands_zone ${ZONE_LIBS})
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+11 -11
View File
@@ -82,7 +82,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u
for (int x = 0; x < MAX_SWARM_PETS; x++) for (int x = 0; x < MAX_SWARM_PETS; x++)
{ {
if (spells[spell_id].effect_id[x] == SE_TemporaryPets) if (spells[spell_id].effect_id[x] == SpellEffect::TemporaryPets)
{ {
pet.count = spells[spell_id].base_value[x]; pet.count = spells[spell_id].base_value[x];
pet.duration = spells[spell_id].max_value[x]; pet.duration = spells[spell_id].max_value[x];
@@ -1376,7 +1376,7 @@ int Mob::GetAlternateAdvancementCooldownReduction(AA::Rank *rank_in) {
} }
for(auto &effect : rank->effects) { for(auto &effect : rank->effects) {
if(effect.effect_id == SE_HastenedAASkill && effect.limit_value == ability_in->id) { if(effect.effect_id == SpellEffect::HastenedAASkill && effect.limit_value == ability_in->id) {
total_reduction += effect.base_value; total_reduction += effect.base_value;
} }
} }
@@ -1619,7 +1619,7 @@ bool Mob::CanUseAlternateAdvancementRank(AA::Rank *rank)
auto race = GetPlayerRaceValue(GetBaseRace()); auto race = GetPlayerRaceValue(GetBaseRace());
race = race > PLAYER_RACE_COUNT ? Race::Human : race; race = race > RaceIndex::Drakkin ? Race::Human : race;
if (!(a->races & (1 << (race - 1)))) { if (!(a->races & (1 << (race - 1)))) {
return false; return false;
@@ -1949,7 +1949,7 @@ void Client::TogglePassiveAlternativeAdvancement(const AA::Rank &rank, uint32 ab
Instructions for how to make the AA - assuming a basic level of knowledge of how AA's work. Instructions for how to make the AA - assuming a basic level of knowledge of how AA's work.
- aa_abilities table : Create new ability with a hotkey, type 3, zero charges - aa_abilities table : Create new ability with a hotkey, type 3, zero charges
- aa_ranks table : [Disabled rank] First rank, should have a cost > 0 (this is what you buy), Set hotkeys, MUST SET A SPELL CONTAINING EFFECT SE_Buy_AA_Rank(SPA 472), set a short recast timer. - aa_ranks table : [Disabled rank] First rank, should have a cost > 0 (this is what you buy), Set hotkeys, MUST SET A SPELL CONTAINING EFFECT SpellEffect::Buy_AA_Rank(SPA 472), set a short recast timer.
[Enabled rank] Second rank, should have a cost = 0, Set hotkeys, Set any valid spell ID you want (it has to exist but does nothing), set a short recast timer. [Enabled rank] Second rank, should have a cost = 0, Set hotkeys, Set any valid spell ID you want (it has to exist but does nothing), set a short recast timer.
*Recommend if doing custom, just make the hotkey titled 'Toggle <Ability Name>' and use for both. *Recommend if doing custom, just make the hotkey titled 'Toggle <Ability Name>' and use for both.
@@ -1969,7 +1969,7 @@ void Client::TogglePassiveAlternativeAdvancement(const AA::Rank &rank, uint32 ab
*/ */
bool enable_next_rank = IsEffectInSpell(rank.spell, SE_Buy_AA_Rank); bool enable_next_rank = IsEffectInSpell(rank.spell, SpellEffect::Buy_AA_Rank);
if (enable_next_rank) { if (enable_next_rank) {
@@ -1980,7 +1980,7 @@ void Client::TogglePassiveAlternativeAdvancement(const AA::Rank &rank, uint32 ab
AA::Rank *rank_next = zone->GetAlternateAdvancementRank(rank.next_id); AA::Rank *rank_next = zone->GetAlternateAdvancementRank(rank.next_id);
//Add checks for any special cases for toggle. //Add checks for any special cases for toggle.
if (rank_next && IsEffectinAlternateAdvancementRankEffects(*rank_next, SE_Weapon_Stance)) { if (rank_next && IsEffectinAlternateAdvancementRankEffects(*rank_next, SpellEffect::Weapon_Stance)) {
weaponstance.aabonus_enabled = true; weaponstance.aabonus_enabled = true;
ApplyWeaponsStance(); ApplyWeaponsStance();
} }
@@ -1994,7 +1994,7 @@ void Client::TogglePassiveAlternativeAdvancement(const AA::Rank &rank, uint32 ab
Message(Chat::Spells, "You disable an ability."); //Message live gives you. Should come from spell. Message(Chat::Spells, "You disable an ability."); //Message live gives you. Should come from spell.
//Add checks for any special cases for toggle. //Add checks for any special cases for toggle.
if (IsEffectinAlternateAdvancementRankEffects(rank, SE_Weapon_Stance)) { if (IsEffectinAlternateAdvancementRankEffects(rank, SpellEffect::Weapon_Stance)) {
weaponstance.aabonus_enabled = false; weaponstance.aabonus_enabled = false;
BuffFadeBySpellID(weaponstance.aabonus_buff_spell_id); BuffFadeBySpellID(weaponstance.aabonus_buff_spell_id);
} }
@@ -2005,8 +2005,8 @@ void Client::TogglePassiveAlternativeAdvancement(const AA::Rank &rank, uint32 ab
bool Client::UseTogglePassiveHotkey(const AA::Rank &rank) { bool Client::UseTogglePassiveHotkey(const AA::Rank &rank) {
/* /*
Disabled rank needs a rank spell containing the SE_Buy_AA_Rank effect to return true. Disabled rank needs a rank spell containing the SpellEffect::Buy_AA_Rank effect to return true.
Enabled rank checks to see if the prior rank contains a rank spell with SE_Buy_AA_Rank, if so true. Enabled rank checks to see if the prior rank contains a rank spell with SpellEffect::Buy_AA_Rank, if so true.
Note: On live the enabled rank is Expendable with Charge 1. Note: On live the enabled rank is Expendable with Charge 1.
@@ -2014,13 +2014,13 @@ bool Client::UseTogglePassiveHotkey(const AA::Rank &rank) {
*/ */
if (IsEffectInSpell(rank.spell, SE_Buy_AA_Rank)) {//Checked when is Disabled. if (IsEffectInSpell(rank.spell, SpellEffect::Buy_AA_Rank)) {//Checked when is Disabled.
return true; return true;
} }
else if (rank.prev_id != -1) {//Check when effect is Enabled. else if (rank.prev_id != -1) {//Check when effect is Enabled.
AA::Rank *rank_prev = zone->GetAlternateAdvancementRank(rank.prev_id); AA::Rank *rank_prev = zone->GetAlternateAdvancementRank(rank.prev_id);
if (rank_prev && IsEffectInSpell(rank_prev->spell, SE_Buy_AA_Rank)) { if (rank_prev && IsEffectInSpell(rank_prev->spell, SpellEffect::Buy_AA_Rank)) {
return true; return true;
} }
} }
+67 -67
View File
@@ -1377,132 +1377,132 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool is_proc)
for (int o = 0; o < EFFECT_COUNT; o++) { for (int o = 0; o < EFFECT_COUNT; o++) {
switch (spells[spell_id].effect_id[o]) { switch (spells[spell_id].effect_id[o]) {
case SE_CurrentHPOnce: case SpellEffect::CurrentHPOnce:
case SE_CurrentHP: { case SpellEffect::CurrentHP: {
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id); int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id);
if(val < 0) { if(val < 0) {
aggro_amount -= val; aggro_amount -= val;
} }
break; break;
} }
case SE_MovementSpeed: { case SpellEffect::MovementSpeed: {
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id); int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id);
if (val < 0) { if (val < 0) {
aggro_amount += default_aggro; aggro_amount += default_aggro;
} }
break; break;
} }
case SE_AttackSpeed: case SpellEffect::AttackSpeed:
case SE_AttackSpeed2: case SpellEffect::AttackSpeed2:
case SE_AttackSpeed3: { case SpellEffect::AttackSpeed3: {
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id); int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id);
if (val < 100) { if (val < 100) {
aggro_amount += default_aggro; aggro_amount += default_aggro;
} }
break; break;
} }
case SE_Stun: case SpellEffect::Stun:
case SE_Blind: case SpellEffect::Blind:
case SE_Mez: case SpellEffect::Mez:
case SE_Charm: case SpellEffect::Charm:
case SE_Fear: case SpellEffect::Fear:
case SE_Fearstun: case SpellEffect::Fearstun:
aggro_amount += default_aggro; aggro_amount += default_aggro;
break; break;
case SE_Root: case SpellEffect::Root:
aggro_amount += 10; aggro_amount += 10;
break; break;
case SE_ACv2: case SpellEffect::ACv2:
case SE_ArmorClass: { case SpellEffect::ArmorClass: {
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id); int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id);
if (val < 0) { if (val < 0) {
aggro_amount += default_aggro; aggro_amount += default_aggro;
} }
break; break;
} }
case SE_ATK: case SpellEffect::ATK:
case SE_ResistMagic: case SpellEffect::ResistMagic:
case SE_ResistFire: case SpellEffect::ResistFire:
case SE_ResistCold: case SpellEffect::ResistCold:
case SE_ResistPoison: case SpellEffect::ResistPoison:
case SE_ResistDisease: case SpellEffect::ResistDisease:
case SE_STR: case SpellEffect::STR:
case SE_STA: case SpellEffect::STA:
case SE_DEX: case SpellEffect::DEX:
case SE_AGI: case SpellEffect::AGI:
case SE_INT: case SpellEffect::INT:
case SE_WIS: case SpellEffect::WIS:
case SE_CHA: { case SpellEffect::CHA: {
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id); int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id);
if (val < 0) { if (val < 0) {
aggro_amount += 10; aggro_amount += 10;
} }
break; break;
} }
case SE_ResistAll: { case SpellEffect::ResistAll: {
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id); int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id);
if (val < 0) { if (val < 0) {
aggro_amount += 50; aggro_amount += 50;
} }
break; break;
} }
case SE_AllStats: { case SpellEffect::AllStats: {
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id); int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id);
if (val < 0) { if (val < 0) {
aggro_amount += 70; aggro_amount += 70;
} }
break; break;
} }
case SE_BardAEDot: case SpellEffect::BardAEDot:
aggro_amount += 10; aggro_amount += 10;
break; break;
case SE_SpinTarget: case SpellEffect::SpinTarget:
case SE_Amnesia: case SpellEffect::Amnesia:
case SE_Silence: case SpellEffect::Silence:
case SE_Destroy: case SpellEffect::Destroy:
aggro_amount += default_aggro; aggro_amount += default_aggro;
break; break;
// unsure -- leave them this for now // unsure -- leave them this for now
case SE_Harmony: case SpellEffect::Harmony:
case SE_CastingLevel: case SpellEffect::CastingLevel:
case SE_MeleeMitigation: case SpellEffect::MeleeMitigation:
case SE_CriticalHitChance: case SpellEffect::CriticalHitChance:
case SE_AvoidMeleeChance: case SpellEffect::AvoidMeleeChance:
case SE_RiposteChance: case SpellEffect::RiposteChance:
case SE_DodgeChance: case SpellEffect::DodgeChance:
case SE_ParryChance: case SpellEffect::ParryChance:
case SE_DualWieldChance: case SpellEffect::DualWieldChance:
case SE_DoubleAttackChance: case SpellEffect::DoubleAttackChance:
case SE_MeleeSkillCheck: case SpellEffect::MeleeSkillCheck:
case SE_HitChance: case SpellEffect::HitChance:
case SE_DamageModifier: case SpellEffect::DamageModifier:
case SE_MinDamageModifier: case SpellEffect::MinDamageModifier:
case SE_IncreaseBlockChance: case SpellEffect::IncreaseBlockChance:
case SE_Accuracy: case SpellEffect::Accuracy:
case SE_DamageShield: case SpellEffect::DamageShield:
case SE_SpellDamageShield: case SpellEffect::SpellDamageShield:
case SE_ReverseDS: { case SpellEffect::ReverseDS: {
aggro_amount += mob_level * 2; aggro_amount += mob_level * 2;
break; break;
} }
// unsure -- leave them this for now // unsure -- leave them this for now
case SE_CurrentMana: case SpellEffect::CurrentMana:
case SE_ManaRegen_v2: case SpellEffect::ManaRegen_v2:
case SE_ManaPool: case SpellEffect::ManaPool:
case SE_CurrentEndurance: { case SpellEffect::CurrentEndurance: {
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id); int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id);
if (val < 0) { if (val < 0) {
aggro_amount -= val * 2; aggro_amount -= val * 2;
} }
break; break;
} }
case SE_CancelMagic: case SpellEffect::CancelMagic:
case SE_DispelDetrimental: case SpellEffect::DispelDetrimental:
case SE_DispelBeneficial: case SpellEffect::DispelBeneficial:
dispel = true; dispel = true;
break; break;
case SE_ReduceHate: case SpellEffect::ReduceHate:
case SE_InstantHate: case SpellEffect::InstantHate:
non_modified_aggro = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id); non_modified_aggro = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], mob_level, spell_id);
break; break;
} }
@@ -1549,8 +1549,8 @@ int32 Mob::CheckHealAggroAmount(uint16 spell_id, Mob *target, uint32 heal_possib
for (int o = 0; o < EFFECT_COUNT; o++) { for (int o = 0; o < EFFECT_COUNT; o++) {
switch (spells[spell_id].effect_id[o]) { switch (spells[spell_id].effect_id[o]) {
case SE_CurrentHP: case SpellEffect::CurrentHP:
case SE_PercentalHeal: case SpellEffect::PercentalHeal:
{ {
if (heal_possible == 0) { if (heal_possible == 0) {
AggroAmount += 1; AggroAmount += 1;
@@ -1572,12 +1572,12 @@ int32 Mob::CheckHealAggroAmount(uint16 spell_id, Mob *target, uint32 heal_possib
AggroAmount += std::max(val, (int64)1); AggroAmount += std::max(val, (int64)1);
break; break;
} }
case SE_Rune: case SpellEffect::Rune:
AggroAmount += CalcSpellEffectValue_formula(spells[spell_id].formula[o], AggroAmount += CalcSpellEffectValue_formula(spells[spell_id].formula[o],
spells[spell_id].base_value[o], spells[spell_id].max_value[o], GetLevel(), spell_id) * 2; spells[spell_id].base_value[o], spells[spell_id].max_value[o], GetLevel(), spell_id) * 2;
ignore_default_buff = true; ignore_default_buff = true;
break; break;
case SE_HealOverTime: case SpellEffect::HealOverTime:
AggroAmount += 10; AggroAmount += 10;
ignore_default_buff = true; ignore_default_buff = true;
break; break;
+1 -1
View File
@@ -82,7 +82,7 @@ Json::Value ApiGetPacketStatistics(EQ::Net::WebsocketServerConnection *connectio
auto connection = client->Connection(); auto connection = client->Connection();
auto opts = connection->GetManager()->GetOptions(); auto opts = connection->GetManager()->GetOptions();
auto eqs_stats = connection->GetStats(); auto eqs_stats = connection->GetStats();
auto &stats = eqs_stats.DaybreakStats; auto &stats = eqs_stats.ReliableStreamStats;
auto now = EQ::Net::Clock::now(); auto now = EQ::Net::Clock::now();
auto sec_since_stats_reset = std::chrono::duration_cast<std::chrono::duration<double>>( auto sec_since_stats_reset = std::chrono::duration_cast<std::chrono::duration<double>>(
now - stats.created now - stats.created
+59 -40
View File
@@ -179,7 +179,7 @@ int Mob::compute_tohit(EQ::skills::SkillType skillinuse)
//SYNC WITH: tune.cpp, mob.h TuneGetTotalToHit //SYNC WITH: tune.cpp, mob.h TuneGetTotalToHit
int Mob::GetTotalToHit(EQ::skills::SkillType skill, int chance_mod) int Mob::GetTotalToHit(EQ::skills::SkillType skill, int chance_mod)
{ {
if (chance_mod >= 10000) // override for stuff like SE_SkillAttack if (chance_mod >= 10000) // override for stuff like SpellEffect::SkillAttack
return -1; return -1;
// calculate attacker's accuracy // calculate attacker's accuracy
@@ -209,7 +209,7 @@ int Mob::GetTotalToHit(EQ::skills::SkillType skill, int chance_mod)
if (atkhit_bonus) if (atkhit_bonus)
accuracy += round(static_cast<double>(accuracy) * static_cast<double>(atkhit_bonus) * 0.0001); accuracy += round(static_cast<double>(accuracy) * static_cast<double>(atkhit_bonus) * 0.0001);
// 216 Melee Accuracy Amt aka SE_Accuracy -- flat bonus // 216 Melee Accuracy Amt aka SpellEffect::Accuracy -- flat bonus
accuracy += itembonuses.Accuracy[EQ::skills::HIGHEST_SKILL + 1] + accuracy += itembonuses.Accuracy[EQ::skills::HIGHEST_SKILL + 1] +
aabonuses.Accuracy[EQ::skills::HIGHEST_SKILL + 1] + aabonuses.Accuracy[EQ::skills::HIGHEST_SKILL + 1] +
spellbonuses.Accuracy[EQ::skills::HIGHEST_SKILL + 1] + spellbonuses.Accuracy[EQ::skills::HIGHEST_SKILL + 1] +
@@ -224,7 +224,7 @@ int Mob::GetTotalToHit(EQ::skills::SkillType skill, int chance_mod)
if (spellbonuses.HitChanceEffect[EQ::skills::HIGHEST_SKILL + 1] >= 10000) if (spellbonuses.HitChanceEffect[EQ::skills::HIGHEST_SKILL + 1] >= 10000)
return -1; return -1;
// 184 Accuracy % aka SE_HitChance -- percentage increase // 184 Accuracy % aka SpellEffect::HitChance -- percentage increase
auto hit_bonus = itembonuses.HitChanceEffect[EQ::skills::HIGHEST_SKILL + 1] + auto hit_bonus = itembonuses.HitChanceEffect[EQ::skills::HIGHEST_SKILL + 1] +
aabonuses.HitChanceEffect[EQ::skills::HIGHEST_SKILL + 1] + aabonuses.HitChanceEffect[EQ::skills::HIGHEST_SKILL + 1] +
spellbonuses.HitChanceEffect[EQ::skills::HIGHEST_SKILL + 1] + spellbonuses.HitChanceEffect[EQ::skills::HIGHEST_SKILL + 1] +
@@ -285,7 +285,7 @@ int Mob::compute_defense()
} }
//516 SE_AC_Mitigation_Max_Percent //516 SpellEffect::AC_Mitigation_Max_Percent
auto ac_bonus = itembonuses.AC_Mitigation_Max_Percent + aabonuses.AC_Mitigation_Max_Percent + spellbonuses.AC_Mitigation_Max_Percent; auto ac_bonus = itembonuses.AC_Mitigation_Max_Percent + aabonuses.AC_Mitigation_Max_Percent + spellbonuses.AC_Mitigation_Max_Percent;
if (ac_bonus) { if (ac_bonus) {
defense += round(static_cast<double>(defense) * static_cast<double>(ac_bonus) * 0.0001); defense += round(static_cast<double>(defense) * static_cast<double>(ac_bonus) * 0.0001);
@@ -315,15 +315,15 @@ int Mob::GetTotalDefense()
if (evasion_bonus >= 10000) if (evasion_bonus >= 10000)
return -1; return -1;
// 515 SE_AC_Avoidance_Max_Percent // 515 SpellEffect::AC_Avoidance_Max_Percent
auto ac_aviodance_bonus = itembonuses.AC_Avoidance_Max_Percent + aabonuses.AC_Avoidance_Max_Percent + spellbonuses.AC_Avoidance_Max_Percent; auto ac_aviodance_bonus = itembonuses.AC_Avoidance_Max_Percent + aabonuses.AC_Avoidance_Max_Percent + spellbonuses.AC_Avoidance_Max_Percent;
if (ac_aviodance_bonus) if (ac_aviodance_bonus)
avoidance += round(static_cast<double>(avoidance) * static_cast<double>(ac_aviodance_bonus) * 0.0001); avoidance += round(static_cast<double>(avoidance) * static_cast<double>(ac_aviodance_bonus) * 0.0001);
// 172 Evasion aka SE_AvoidMeleeChance // 172 Evasion aka SpellEffect::AvoidMeleeChance
evasion_bonus += itembonuses.AvoidMeleeChanceEffect + aabonuses.AvoidMeleeChanceEffect; // item bonus here isn't mod2 avoidance evasion_bonus += itembonuses.AvoidMeleeChanceEffect + aabonuses.AvoidMeleeChanceEffect; // item bonus here isn't mod2 avoidance
// 215 Pet Avoidance % aka SE_PetAvoidance // 215 Pet Avoidance % aka SpellEffect::PetAvoidance
evasion_bonus += GetPetAvoidanceBonusFromOwner(); evasion_bonus += GetPetAvoidanceBonusFromOwner();
// Evasion is a percentage bonus according to AA descriptions // Evasion is a percentage bonus according to AA descriptions
@@ -401,8 +401,8 @@ bool Mob::AvoidDamage(Mob *other, DamageHitInfo &hit)
*/ */
/* Order according to current (SoF+?) dev quotes: /* Order according to current (SoF+?) dev quotes:
* https://forums.daybreakgames.com/eq/index.php?threads/test-update-06-10-15.223510/page-2#post-3261772 * https://web.archive.org/web/20250816014133/https://forums.everquest.com/index.php?threads/test-update-06-10-15.223510/page-2#post-3261772
* https://forums.daybreakgames.com/eq/index.php?threads/test-update-06-10-15.223510/page-2#post-3268227 * https://web.archive.org/web/20250816014133/https://forums.everquest.com/index.php?threads/test-update-06-10-15.223510/page-2#post-3268227
* Riposte 50, hDEX, must have weapon/fists, doesn't work on archery/throwing * Riposte 50, hDEX, must have weapon/fists, doesn't work on archery/throwing
* Block 25, hDEX, works on archery/throwing, behind block done here if back to attacker base1 is chance * Block 25, hDEX, works on archery/throwing, behind block done here if back to attacker base1 is chance
* Parry 45, hDEX, doesn't work on throwing/archery, must be facing target * Parry 45, hDEX, doesn't work on throwing/archery, must be facing target
@@ -461,7 +461,7 @@ bool Mob::AvoidDamage(Mob *other, DamageHitInfo &hit)
} }
/* Heroic Strikethrough Implementation per Dev Quotes (2018): /* Heroic Strikethrough Implementation per Dev Quotes (2018):
* https://forums.daybreakgames.com/eq/index.php?threads/illusions-benefit-neza-10-dodge.246757/#post-3622670 * https://web.archive.org/web/20250816014810/https://forums.everquest.com/index.php?threads/illusions-benefit-neza-10-dodge.246757/#post-3622670
* Step1 = HeroicStrikethrough(NPC) * Step1 = HeroicStrikethrough(NPC)
* Step2 = HeroicAgility / 25 * Step2 = HeroicAgility / 25
* Step3 = MIN( Step1, Step2 ) * Step3 = MIN( Step1, Step2 )
@@ -896,7 +896,7 @@ int Mob::GetClassRaceACBonus()
ac_bonus = 16; ac_bonus = 16;
} }
if (GetRace() == IKSAR) if (GetRace() == Race::Iksar)
ac_bonus += EQ::Clamp(static_cast<int>(level), 10, 35); ac_bonus += EQ::Clamp(static_cast<int>(level), 10, 35);
return ac_bonus; return ac_bonus;
@@ -1917,7 +1917,7 @@ bool Client::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::Skil
dead = true; dead = true;
if (m_pet && m_pet->IsCharmed()) { if (m_pet && m_pet->IsCharmed()) {
m_pet->BuffFadeByEffect(SE_Charm); m_pet->BuffFadeByEffect(SpellEffect::Charm);
} }
if (GetMerc()) { if (GetMerc()) {
@@ -3039,6 +3039,25 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
DispatchZoneControllerEvent(EVENT_DEATH_ZONE, owner_or_self, export_string, 0, &args); DispatchZoneControllerEvent(EVENT_DEATH_ZONE, owner_or_self, export_string, 0, &args);
} }
if (parse->ZoneHasQuestSub(EVENT_DEATH_ZONE)) {
const auto& export_string = fmt::format(
"{} {} {} {} {} {} {} {} {}",
killer_mob ? killer_mob->GetID() : 0,
damage,
spell,
static_cast<int>(attack_skill),
entity_id,
m_combat_record.GetStartTime(),
m_combat_record.GetEndTime(),
m_combat_record.GetDamageReceived(),
m_combat_record.GetHealingReceived()
);
std::vector<std::any> args = { corpse, this, owner_or_self };
parse->EventZone(EVENT_DEATH_ZONE, zone, export_string, 0, &args);
}
return true; return true;
} }
@@ -3395,7 +3414,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) {
uint8 Mob::GetWeaponDamageBonus(const EQ::ItemData *weapon, bool offhand) uint8 Mob::GetWeaponDamageBonus(const EQ::ItemData *weapon, bool offhand)
{ {
// dev quote with old and new formulas // dev quote with old and new formulas
// https://forums.daybreakgames.com/eq/index.php?threads/test-update-09-17-15.226618/page-5#post-3326194 // https://web.archive.org/web/20250816013618/https://forums.everquest.com/index.php?threads/test-update-09-17-15.226618/page-5#post-3326194
// //
// We assume that the level check is done before calling this function and sinister strikes is checked before // We assume that the level check is done before calling this function and sinister strikes is checked before
// calling for offhand DB // calling for offhand DB
@@ -3526,7 +3545,7 @@ int Mob::GetHandToHandDelay(void)
int iksar = 0; int iksar = 0;
if (IsClient() && CastToClient()->GetItemIDAt(12) == 10652 && GetLevel() > 46) if (IsClient() && CastToClient()->GetItemIDAt(12) == 10652 && GetLevel() > 46)
epic = 280; epic = 280;
else if (GetRace() == IKSAR) else if (GetRace() == Race::Iksar)
iksar = 1; iksar = 1;
// the delay bonus from the monk epic scales up to a skill of 280 // the delay bonus from the monk epic scales up to a skill of 280
if (epic >= skill) if (epic >= skill)
@@ -3567,8 +3586,8 @@ int Mob::GetHandToHandDelay(void)
return 16; return 16;
int level = GetLevel(); int level = GetLevel();
if (level > 62) if (level > 62)
return GetRace() == IKSAR ? 21 : 20; return GetRace() == Race::Iksar ? 21 : 20;
return GetRace() == IKSAR ? mnk_iks_delay[level] : mnk_hum_delay[level]; return GetRace() == Race::Iksar ? mnk_iks_delay[level] : mnk_hum_delay[level];
} }
else if (GetClass() == Class::Beastlord) { else if (GetClass() == Class::Beastlord) {
int level = GetLevel(); int level = GetLevel();
@@ -3659,7 +3678,7 @@ int64 Mob::ReduceDamage(int64 damage)
return DMG_RUNE; return DMG_RUNE;
if (spellbonuses.MeleeRune[SBIndex::RUNE_AMOUNT] && spellbonuses.MeleeRune[SBIndex::RUNE_BUFFSLOT] >= 0) if (spellbonuses.MeleeRune[SBIndex::RUNE_AMOUNT] && spellbonuses.MeleeRune[SBIndex::RUNE_BUFFSLOT] >= 0)
damage = RuneAbsorb(damage, SE_Rune); damage = RuneAbsorb(damage, SpellEffect::Rune);
if (damage < 1) if (damage < 1)
return DMG_RUNE; return DMG_RUNE;
@@ -3786,10 +3805,10 @@ int64 Mob::AffectMagicalDamage(int64 damage, uint16 spell_id, const bool iBuffTi
//Regular runes absorb spell damage (except dots) - Confirmed on live. //Regular runes absorb spell damage (except dots) - Confirmed on live.
if (spellbonuses.MeleeRune[SBIndex::RUNE_AMOUNT] && spellbonuses.MeleeRune[SBIndex::RUNE_BUFFSLOT] >= 0) if (spellbonuses.MeleeRune[SBIndex::RUNE_AMOUNT] && spellbonuses.MeleeRune[SBIndex::RUNE_BUFFSLOT] >= 0)
damage = RuneAbsorb(damage, SE_Rune); damage = RuneAbsorb(damage, SpellEffect::Rune);
if (spellbonuses.AbsorbMagicAtt[SBIndex::RUNE_AMOUNT] && spellbonuses.AbsorbMagicAtt[SBIndex::RUNE_BUFFSLOT] >= 0) if (spellbonuses.AbsorbMagicAtt[SBIndex::RUNE_AMOUNT] && spellbonuses.AbsorbMagicAtt[SBIndex::RUNE_BUFFSLOT] >= 0)
damage = RuneAbsorb(damage, SE_AbsorbMagicAtt); damage = RuneAbsorb(damage, SpellEffect::AbsorbMagicAtt);
if (damage < 1) if (damage < 1)
return 0; return 0;
@@ -4094,11 +4113,11 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
if (IsPet()) { if (IsPet()) {
Mob *owner = GetOwner(); Mob *owner = GetOwner();
if (owner && owner->IsClient()) { if (owner && owner->IsClient()) {
if (GetPetOrder() == SPO_Sit) { if (GetPetOrder() == PetOrder::Sit) {
SetPetOrder(GetPreviousPetOrder()); SetPetOrder(GetPreviousPetOrder());
} }
// fix GUI sit button to be unpressed and stop sitting regen // fix GUI sit button to be unpressed and stop sitting regen
owner->CastToClient()->SetPetCommandState(PET_BUTTON_SIT, 0); owner->CastToClient()->SetPetCommandState(PetButton::Sit, PetButtonState::Off);
SetAppearance(eaStanding); SetAppearance(eaStanding);
} }
} }
@@ -4128,12 +4147,12 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
if (IsClient() && !pet->IsPetStop()) { if (IsClient() && !pet->IsPetStop()) {
// if pet was sitting his new mode is previous setting of // if pet was sitting his new mode is previous setting of
// follow or guard after the battle (live verified) // follow or guard after the battle (live verified)
if (pet->GetPetOrder() == SPO_Sit) { if (pet->GetPetOrder() == PetOrder::Sit) {
pet->SetPetOrder(pet->GetPreviousPetOrder()); pet->SetPetOrder(pet->GetPreviousPetOrder());
} }
// fix GUI sit button to be unpressed and stop sitting regen // fix GUI sit button to be unpressed and stop sitting regen
CastToClient()->SetPetCommandState(PET_BUTTON_SIT, 0); CastToClient()->SetPetCommandState(PetButton::Sit, PetButtonState::Off);
pet->SetAppearance(eaStanding); pet->SetAppearance(eaStanding);
} }
@@ -4155,7 +4174,7 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
damage = ReduceDamage(damage); damage = ReduceDamage(damage);
LogCombat("Melee Damage reduced to [{}]", damage); LogCombat("Melee Damage reduced to [{}]", damage);
damage = ReduceAllDamage(damage); damage = ReduceAllDamage(damage);
TryTriggerThreshHold(damage, SE_TriggerMeleeThreshold, attacker); TryTriggerThreshHold(damage, SpellEffect::TriggerMeleeThreshold, attacker);
CheckNumHitsRemaining(NumHit::IncomingHitSuccess); CheckNumHitsRemaining(NumHit::IncomingHitSuccess);
} }
@@ -4180,7 +4199,7 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
Message(263, "%s tries to cast on YOU, but YOUR magical skin absorbs the spell.", attacker->GetCleanName()); Message(263, "%s tries to cast on YOU, but YOUR magical skin absorbs the spell.", attacker->GetCleanName());
} }
damage = ReduceAllDamage(damage); damage = ReduceAllDamage(damage);
TryTriggerThreshHold(damage, SE_TriggerSpellThreshold, attacker); TryTriggerThreshHold(damage, SpellEffect::TriggerSpellThreshold, attacker);
} }
if (IsClient() && CastToClient()->sneaking) { if (IsClient() && CastToClient()->sneaking) {
@@ -4295,7 +4314,7 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
GetCleanName(), /* Message1 */ GetCleanName(), /* Message1 */
attacker->GetCleanName() /* Message2 */ attacker->GetCleanName() /* Message2 */
); );
BuffFadeByEffect(SE_Mez); BuffFadeByEffect(SpellEffect::Mez);
} }
// broken up for readability // broken up for readability
@@ -4380,12 +4399,12 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
int bashsave_roll = zone->random.Int(0, 100); int bashsave_roll = zone->random.Int(0, 100);
if (bashsave_roll > 98 || bashsave_roll > (55 - stunbash_chance)) { if (bashsave_roll > 98 || bashsave_roll > (55 - stunbash_chance)) {
// did stun -- roll other resists // did stun -- roll other resists
// SE_FrontalStunResist description says any angle now a days // SpellEffect::FrontalStunResist description says any angle now a days
int stun_resist2 = spellbonuses.FrontalStunResist + itembonuses.FrontalStunResist + int stun_resist2 = spellbonuses.FrontalStunResist + itembonuses.FrontalStunResist +
aabonuses.FrontalStunResist; aabonuses.FrontalStunResist;
if (zone->random.Int(1, 100) > stun_resist2) { if (zone->random.Int(1, 100) > stun_resist2) {
// stun resist 2 failed // stun resist 2 failed
// time to check SE_StunResist and mod2 stun resist // time to check SpellEffect::StunResist and mod2 stun resist
int stun_resist = int stun_resist =
spellbonuses.StunResist + itembonuses.StunResist + aabonuses.StunResist; spellbonuses.StunResist + itembonuses.StunResist + aabonuses.StunResist;
if (zone->random.Int(0, 100) >= stun_resist) { if (zone->random.Int(0, 100) >= stun_resist) {
@@ -5649,7 +5668,7 @@ void Mob::DoRiposte(Mob *defender)
defender->itembonuses.DoubleRiposte; defender->itembonuses.DoubleRiposte;
if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) { if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
LogCombat("Preforming a double riposted from SE_DoubleRiposte ([{}] percent chance)", DoubleRipChance); LogCombat("Preforming a double riposted from SpellEffect::DoubleRiposte ([{}] percent chance)", DoubleRipChance);
defender->Attack(this, EQ::invslot::slotPrimary, true); defender->Attack(this, EQ::invslot::slotPrimary, true);
if (HasDied()) if (HasDied())
return; return;
@@ -5660,7 +5679,7 @@ void Mob::DoRiposte(Mob *defender)
// Live AA - Double Riposte // Live AA - Double Riposte
if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) { if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
LogCombat("Preforming a double riposted from SE_GiveDoubleRiposte base1 == 0 ([{}] percent chance)", DoubleRipChance); LogCombat("Preforming a double riposted from SpellEffect::GiveDoubleRiposte base1 == 0 ([{}] percent chance)", DoubleRipChance);
defender->Attack(this, EQ::invslot::slotPrimary, true); defender->Attack(this, EQ::invslot::slotPrimary, true);
if (HasDied()) if (HasDied())
return; return;
@@ -6008,12 +6027,12 @@ void Mob::TrySkillProc(Mob *on, EQ::skills::SkillType skill, uint16 ReuseTime, b
for (int i = 0; i < EFFECT_COUNT; i++) { for (int i = 0; i < EFFECT_COUNT; i++) {
if (spells[base_spell_id].effect_id[i] == SE_SkillProcAttempt || spells[base_spell_id].effect_id[i] == SE_SkillProcSuccess) { if (spells[base_spell_id].effect_id[i] == SpellEffect::SkillProcAttempt || spells[base_spell_id].effect_id[i] == SpellEffect::SkillProcSuccess) {
proc_spell_id = spells[base_spell_id].base_value[i]; proc_spell_id = spells[base_spell_id].base_value[i];
ProcMod = static_cast<float>(spells[base_spell_id].limit_value[i]); ProcMod = static_cast<float>(spells[base_spell_id].limit_value[i]);
} }
else if (spells[base_spell_id].effect_id[i] == SE_LimitToSkill && spells[base_spell_id].base_value[i] <= EQ::skills::HIGHEST_SKILL) { else if (spells[base_spell_id].effect_id[i] == SpellEffect::LimitToSkill && spells[base_spell_id].base_value[i] <= EQ::skills::HIGHEST_SKILL) {
if (CanProc && spells[base_spell_id].base_value[i] == skill && IsValidSpell(proc_spell_id)) { if (CanProc && spells[base_spell_id].base_value[i] == skill && IsValidSpell(proc_spell_id)) {
float final_chance = chance * (ProcMod / 100.0f); float final_chance = chance * (ProcMod / 100.0f);
if (zone->random.Roll(final_chance)) { if (zone->random.Roll(final_chance)) {
@@ -6052,12 +6071,12 @@ void Mob::TrySkillProc(Mob *on, EQ::skills::SkillType skill, uint16 ReuseTime, b
ProcMod = 0; ProcMod = 0;
for (int i = 0; i < EFFECT_COUNT; i++) { for (int i = 0; i < EFFECT_COUNT; i++) {
if (spells[base_spell_id].effect_id[i] == SE_SkillProcAttempt || spells[base_spell_id].effect_id[i] == SE_SkillProcSuccess) { if (spells[base_spell_id].effect_id[i] == SpellEffect::SkillProcAttempt || spells[base_spell_id].effect_id[i] == SpellEffect::SkillProcSuccess) {
proc_spell_id = spells[base_spell_id].base_value[i]; proc_spell_id = spells[base_spell_id].base_value[i];
ProcMod = static_cast<float>(spells[base_spell_id].limit_value[i]); ProcMod = static_cast<float>(spells[base_spell_id].limit_value[i]);
} }
else if (spells[base_spell_id].effect_id[i] == SE_LimitToSkill && spells[base_spell_id].base_value[i] <= EQ::skills::HIGHEST_SKILL) { else if (spells[base_spell_id].effect_id[i] == SpellEffect::LimitToSkill && spells[base_spell_id].base_value[i] <= EQ::skills::HIGHEST_SKILL) {
if (CanProc && spells[base_spell_id].base_value[i] == skill && IsValidSpell(proc_spell_id)) { if (CanProc && spells[base_spell_id].base_value[i] == skill && IsValidSpell(proc_spell_id)) {
float final_chance = chance * (ProcMod / 100.0f); float final_chance = chance * (ProcMod / 100.0f);
@@ -6114,11 +6133,11 @@ void Mob::TrySkillProc(Mob *on, EQ::skills::SkillType skill, uint16 ReuseTime, b
limit_value = effect.limit_value; limit_value = effect.limit_value;
slot = effect.slot; slot = effect.slot;
if (effect_id == SE_SkillProcAttempt || effect_id == SE_SkillProcSuccess) { if (effect_id == SpellEffect::SkillProcAttempt || effect_id == SpellEffect::SkillProcSuccess) {
proc_spell_id = base_value; proc_spell_id = base_value;
ProcMod = static_cast<float>(limit_value); ProcMod = static_cast<float>(limit_value);
} }
else if (effect_id == SE_LimitToSkill && base_value <= EQ::skills::HIGHEST_SKILL) { else if (effect_id == SpellEffect::LimitToSkill && base_value <= EQ::skills::HIGHEST_SKILL) {
if (CanProc && base_value == skill && IsValidSpell(proc_spell_id)) { if (CanProc && base_value == skill && IsValidSpell(proc_spell_id)) {
float final_chance = chance * (ProcMod / 100.0f); float final_chance = chance * (ProcMod / 100.0f);
@@ -6281,7 +6300,7 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) {
int32 Mob::RuneAbsorb(int64 damage, uint16 type) int32 Mob::RuneAbsorb(int64 damage, uint16 type)
{ {
uint32 buff_max = GetMaxTotalSlots(); uint32 buff_max = GetMaxTotalSlots();
if (type == SE_Rune) { if (type == SpellEffect::Rune) {
for (uint32 slot = 0; slot < buff_max; slot++) { for (uint32 slot = 0; slot < buff_max; slot++) {
if (slot == spellbonuses.MeleeRune[SBIndex::RUNE_BUFFSLOT] && spellbonuses.MeleeRune[SBIndex::RUNE_AMOUNT] && buffs[slot].melee_rune && IsValidSpell(buffs[slot].spellid)) { if (slot == spellbonuses.MeleeRune[SBIndex::RUNE_BUFFSLOT] && spellbonuses.MeleeRune[SBIndex::RUNE_AMOUNT] && buffs[slot].melee_rune && IsValidSpell(buffs[slot].spellid)) {
int melee_rune_left = buffs[slot].melee_rune; int melee_rune_left = buffs[slot].melee_rune;
@@ -6525,7 +6544,7 @@ void Mob::DoShieldDamageOnShielderSpellEffect(Mob* shield_target, int64 hit_dama
return; return;
} }
/* /*
SPA 463 SE_SHIELD_TARGET SPA 463 SpellEffect::SHIELD_TARGET
Live description: "Shields your target, taking a percentage of their damage". Live description: "Shields your target, taking a percentage of their damage".
Only example spell on live is an NPC who uses it during a raid event "Laurion's Song" expansion. SPA 54492 'Guardian Stance' Described as 100% Melee Shielding Only example spell on live is an NPC who uses it during a raid event "Laurion's Song" expansion. SPA 54492 'Guardian Stance' Described as 100% Melee Shielding
@@ -6577,7 +6596,7 @@ void Mob::CommonBreakInvisibleFromCombat()
CancelSneakHide(); CancelSneakHide();
if (spellbonuses.NegateIfCombat) { if (spellbonuses.NegateIfCombat) {
BuffFadeByEffect(SE_NegateIfCombat); BuffFadeByEffect(SpellEffect::NegateIfCombat);
} }
hidden = false; hidden = false;
@@ -6682,7 +6701,7 @@ void Client::SetAttackTimer()
if (ItemToUse && ItemToUse->ItemType == EQ::item::ItemTypeBow) { if (ItemToUse && ItemToUse->ItemType == EQ::item::ItemTypeBow) {
// Live actually had a bug here where they would return the non-modified attack speed // Live actually had a bug here where they would return the non-modified attack speed
// rather than the cap ... // rather than the cap ...
speed = std::max(speed - GetQuiverHaste(speed), RuleI(Combat, QuiverHasteCap)); speed = std::max(speed - GetQuiverHaste(speed), GetStatCap(StatCap::QuiverHaste));
} }
else { else {
if (RuleB(Spells, Jun182014HundredHandsRevamp)) if (RuleB(Spells, Jun182014HundredHandsRevamp))
+763 -738
View File
File diff suppressed because it is too large Load Diff
+149 -151
View File
@@ -99,7 +99,7 @@ Bot::Bot(NPCType *npcTypeData, Client* botOwner) : NPC(npcTypeData, nullptr, glm
SetPullingFlag(false); SetPullingFlag(false);
SetReturningFlag(false); SetReturningFlag(false);
SetIsUsingItemClick(false); SetIsUsingItemClick(false);
m_previous_pet_order = SPO_Guard; m_previous_pet_order = PetOrder::Guard;
rest_timer.Disable(); rest_timer.Disable();
m_ping_timer.Disable(); m_ping_timer.Disable();
@@ -232,7 +232,7 @@ Bot::Bot(
SetPullingFlag(false); SetPullingFlag(false);
SetReturningFlag(false); SetReturningFlag(false);
SetIsUsingItemClick(false); SetIsUsingItemClick(false);
m_previous_pet_order = SPO_Guard; m_previous_pet_order = PetOrder::Guard;
rest_timer.Disable(); rest_timer.Disable();
m_ping_timer.Disable(); m_ping_timer.Disable();
@@ -268,6 +268,8 @@ Bot::Bot(
LoadDefaultBotSettings(); LoadDefaultBotSettings();
database.botdb.LoadBotSettings(this); database.botdb.LoadBotSettings(this);
database.LoadStatCaps(this);
if (RuleB(Bots, AllowBotBlockedBuffs)) { if (RuleB(Bots, AllowBotBlockedBuffs)) {
bot_blocked_buffs.clear(); bot_blocked_buffs.clear();
database.botdb.LoadBotBlockedBuffs(this); database.botdb.LoadBotBlockedBuffs(this);
@@ -296,8 +298,8 @@ Bot::Bot(
for (int x1 = 0; x1 < EFFECT_COUNT; x1++) { for (int x1 = 0; x1 < EFFECT_COUNT; x1++) {
switch (spell.effect_id[x1]) { switch (spell.effect_id[x1]) {
case SE_IllusionCopy: case SpellEffect::IllusionCopy:
case SE_Illusion: { case SpellEffect::Illusion: {
if (GetIllusionBlock()) { if (GetIllusionBlock()) {
break; break;
} }
@@ -317,7 +319,7 @@ Bot::Bot(
); );
} else if (spell.base_value[x1] == -2) // WTF IS THIS } else if (spell.base_value[x1] == -2) // WTF IS THIS
{ {
if (GetRace() == IKSAR || GetRace() == VAHSHIR || GetRace() <= GNOME) { if (GetRace() == Race::Iksar || GetRace() == Race::VahShir || GetRace() <= Race::Gnome) {
SendIllusionPacket( SendIllusionPacket(
AppearanceStruct{ AppearanceStruct{
.gender_id = GetGender(), .gender_id = GetGender(),
@@ -346,27 +348,27 @@ Bot::Bot(
} }
switch (spell.base_value[x1]) { switch (spell.base_value[x1]) {
case OGRE: case Race::Ogre:
SendAppearancePacket(AppearanceType::Size, 9); SendAppearancePacket(AppearanceType::Size, 9);
break; break;
case TROLL: case Race::Troll:
SendAppearancePacket(AppearanceType::Size, 8); SendAppearancePacket(AppearanceType::Size, 8);
break; break;
case VAHSHIR: case Race::VahShir:
case BARBARIAN: case Race::Barbarian:
SendAppearancePacket(AppearanceType::Size, 7); SendAppearancePacket(AppearanceType::Size, 7);
break; break;
case HALF_ELF: case Race::HalfElf:
case WOOD_ELF: case Race::WoodElf:
case DARK_ELF: case Race::DarkElf:
case FROGLOK: case Race::Froglok2:
SendAppearancePacket(AppearanceType::Size, 5); SendAppearancePacket(AppearanceType::Size, 5);
break; break;
case DWARF: case Race::Dwarf:
SendAppearancePacket(AppearanceType::Size, 4); SendAppearancePacket(AppearanceType::Size, 4);
break; break;
case HALFLING: case Race::Halfling:
case GNOME: case Race::Gnome:
SendAppearancePacket(AppearanceType::Size, 3); SendAppearancePacket(AppearanceType::Size, 3);
break; break;
default: default:
@@ -375,63 +377,63 @@ Bot::Bot(
} }
break; break;
} }
case SE_Silence: case SpellEffect::Silence:
{ {
Silence(true); Silence(true);
break; break;
} }
case SE_Amnesia: case SpellEffect::Amnesia:
{ {
Amnesia(true); Amnesia(true);
break; break;
} }
case SE_DivineAura: case SpellEffect::DivineAura:
{ {
invulnerable = true; invulnerable = true;
break; break;
} }
case SE_Invisibility2: case SpellEffect::Invisibility2:
case SE_Invisibility: case SpellEffect::Invisibility:
{ {
invisible = true; invisible = true;
SendAppearancePacket(AppearanceType::Invisibility, 1); SendAppearancePacket(AppearanceType::Invisibility, 1);
break; break;
} }
case SE_Levitate: case SpellEffect::Levitate:
{ {
if (!zone->CanLevitate()) if (!zone->CanLevitate())
{ {
SendAppearancePacket(AppearanceType::FlyMode, 0); SendAppearancePacket(AppearanceType::FlyMode, 0);
BuffFadeByEffect(SE_Levitate); BuffFadeByEffect(SpellEffect::Levitate);
} }
else { else {
SendAppearancePacket(AppearanceType::FlyMode, 2); SendAppearancePacket(AppearanceType::FlyMode, 2);
} }
break; break;
} }
case SE_InvisVsUndead2: case SpellEffect::InvisVsUndead2:
case SE_InvisVsUndead: case SpellEffect::InvisVsUndead:
{ {
invisible_undead = true; invisible_undead = true;
break; break;
} }
case SE_InvisVsAnimals: case SpellEffect::InvisVsAnimals:
{ {
invisible_animals = true; invisible_animals = true;
break; break;
} }
case SE_AddMeleeProc: case SpellEffect::AddMeleeProc:
case SE_WeaponProc: case SpellEffect::WeaponProc:
{ {
AddProcToWeapon(GetProcID(buffs[j1].spellid, x1), false, 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid, buffs[j1].casterlevel); AddProcToWeapon(GetProcID(buffs[j1].spellid, x1), false, 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid, buffs[j1].casterlevel);
break; break;
} }
case SE_DefensiveProc: case SpellEffect::DefensiveProc:
{ {
AddDefensiveProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid); AddDefensiveProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid);
break; break;
} }
case SE_RangedProc: case SpellEffect::RangedProc:
{ {
AddRangedProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid); AddRangedProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid);
break; break;
@@ -457,10 +459,10 @@ Bot::Bot(
int resurrection_sickness_spell_id = ( int resurrection_sickness_spell_id = (
RuleB(Bots, OldRaceRezEffects) && RuleB(Bots, OldRaceRezEffects) &&
( (
GetRace() == BARBARIAN || GetRace() == Race::Barbarian ||
GetRace() == DWARF || GetRace() == Race::Dwarf ||
GetRace() == TROLL || GetRace() == Race::Troll ||
GetRace() == OGRE GetRace() == Race::Ogre
) ? ) ?
RuleI(Bots, OldResurrectionSicknessSpell) : RuleI(Bots, OldResurrectionSicknessSpell) :
RuleI(Bots, ResurrectionSicknessSpell) RuleI(Bots, ResurrectionSicknessSpell)
@@ -955,9 +957,9 @@ void Bot::GenerateBaseStats()
float BotSize = GetSize(); float BotSize = GetSize();
switch(GetRace()) { switch(GetRace()) {
case HUMAN: // Humans have no race bonus case Race::Human: // Humans have no race bonus
break; break;
case BARBARIAN: case Race::Barbarian:
Strength += 28; Strength += 28;
Stamina += 20; Stamina += 20;
Agility += 7; Agility += 7;
@@ -968,7 +970,7 @@ void Bot::GenerateBaseStats()
BotSize = 7.0; BotSize = 7.0;
ColdResist += 10; ColdResist += 10;
break; break;
case ERUDITE: case Race::Erudite:
Strength -= 15; Strength -= 15;
Stamina -= 5; Stamina -= 5;
Agility -= 5; Agility -= 5;
@@ -979,7 +981,7 @@ void Bot::GenerateBaseStats()
MagicResist += 5; MagicResist += 5;
DiseaseResist -= 5; DiseaseResist -= 5;
break; break;
case WOOD_ELF: case Race::WoodElf:
Strength -= 10; Strength -= 10;
Stamina -= 10; Stamina -= 10;
Agility += 20; Agility += 20;
@@ -987,7 +989,7 @@ void Bot::GenerateBaseStats()
Wisdom += 5; Wisdom += 5;
BotSize = 5.0; BotSize = 5.0;
break; break;
case HIGH_ELF: case Race::HighElf:
Strength -= 20; Strength -= 20;
Stamina -= 10; Stamina -= 10;
Agility += 10; Agility += 10;
@@ -996,7 +998,7 @@ void Bot::GenerateBaseStats()
Intelligence += 12; Intelligence += 12;
Charisma += 5; Charisma += 5;
break; break;
case DARK_ELF: case Race::DarkElf:
Strength -= 15; Strength -= 15;
Stamina -= 10; Stamina -= 10;
Agility += 15; Agility += 15;
@@ -1005,7 +1007,7 @@ void Bot::GenerateBaseStats()
Charisma -= 15; Charisma -= 15;
BotSize = 5.0; BotSize = 5.0;
break; break;
case HALF_ELF: case Race::HalfElf:
Strength -= 5; Strength -= 5;
Stamina -= 5; Stamina -= 5;
Agility += 15; Agility += 15;
@@ -1013,7 +1015,7 @@ void Bot::GenerateBaseStats()
Wisdom -= 15; Wisdom -= 15;
BotSize = 5.5; BotSize = 5.5;
break; break;
case DWARF: case Race::Dwarf:
Strength += 15; Strength += 15;
Stamina += 15; Stamina += 15;
Agility -= 5; Agility -= 5;
@@ -1025,7 +1027,7 @@ void Bot::GenerateBaseStats()
MagicResist -= 5; MagicResist -= 5;
PoisonResist += 5; PoisonResist += 5;
break; break;
case TROLL: case Race::Troll:
Strength += 33; Strength += 33;
Stamina += 34; Stamina += 34;
Agility += 8; Agility += 8;
@@ -1035,7 +1037,7 @@ void Bot::GenerateBaseStats()
BotSize = 8.0; BotSize = 8.0;
FireResist -= 20; FireResist -= 20;
break; break;
case OGRE: case Race::Ogre:
Strength += 55; Strength += 55;
Stamina += 77; Stamina += 77;
Agility -= 5; Agility -= 5;
@@ -1045,7 +1047,7 @@ void Bot::GenerateBaseStats()
Charisma -= 38; Charisma -= 38;
BotSize = 9.0; BotSize = 9.0;
break; break;
case HALFLING: case Race::Halfling:
Strength -= 5; Strength -= 5;
Agility += 20; Agility += 20;
Dexterity += 15; Dexterity += 15;
@@ -1056,7 +1058,7 @@ void Bot::GenerateBaseStats()
PoisonResist += 5; PoisonResist += 5;
DiseaseResist += 5; DiseaseResist += 5;
break; break;
case GNOME: case Race::Gnome:
Strength -= 15; Strength -= 15;
Stamina -= 5; Stamina -= 5;
Agility += 10; Agility += 10;
@@ -1066,7 +1068,7 @@ void Bot::GenerateBaseStats()
Charisma -= 15; Charisma -= 15;
BotSize = 3.0; BotSize = 3.0;
break; break;
case IKSAR: case Race::Iksar:
Strength -= 5; Strength -= 5;
Stamina -= 5; Stamina -= 5;
Agility += 15; Agility += 15;
@@ -1076,7 +1078,7 @@ void Bot::GenerateBaseStats()
MagicResist -= 5; MagicResist -= 5;
FireResist -= 5; FireResist -= 5;
break; break;
case VAHSHIR: case Race::VahShir:
Strength += 15; Strength += 15;
Agility += 15; Agility += 15;
Dexterity -= 5; Dexterity -= 5;
@@ -1087,7 +1089,7 @@ void Bot::GenerateBaseStats()
MagicResist -= 5; MagicResist -= 5;
FireResist -= 5; FireResist -= 5;
break; break;
case FROGLOK: case Race::Froglok2:
Strength -= 5; Strength -= 5;
Stamina += 5; Stamina += 5;
Agility += 25; Agility += 25;
@@ -1097,7 +1099,7 @@ void Bot::GenerateBaseStats()
MagicResist -= 5; MagicResist -= 5;
FireResist -= 5; FireResist -= 5;
break; break;
case DRAKKIN: case Race::Drakkin:
Strength -= 5; Strength -= 5;
Stamina += 5; Stamina += 5;
Agility += 10; Agility += 10;
@@ -1140,7 +1142,7 @@ void Bot::GenerateBaseStats()
void Bot::GenerateAppearance() { void Bot::GenerateAppearance() {
// Randomize facial appearance // Randomize facial appearance
int iFace = 0; int iFace = 0;
if (GetRace() == BARBARIAN) // Barbarian w/Tatoo if (GetRace() == Race::Barbarian) // Barbarian w/Tatoo
{ {
iFace = zone->random.Int(0, 79); iFace = zone->random.Int(0, 79);
} }
@@ -1152,13 +1154,13 @@ void Bot::GenerateAppearance() {
int iHair = 0; int iHair = 0;
int iBeard = 0; int iBeard = 0;
int iBeardColor = 1; int iBeardColor = 1;
if (GetRace() == DRAKKIN) { if (GetRace() == Race::Drakkin) {
iHair = zone->random.Int(0, 8); iHair = zone->random.Int(0, 8);
iBeard = zone->random.Int(0, 11); iBeard = zone->random.Int(0, 11);
iBeardColor = zone->random.Int(0, 3); iBeardColor = zone->random.Int(0, 3);
} else if (GetGender()) { } else if (GetGender()) {
iHair = zone->random.Int(0, 2); iHair = zone->random.Int(0, 2);
if (GetRace() == DWARF && zone->random.Int(1, 100) < 50) { if (GetRace() == Race::Dwarf && zone->random.Int(1, 100) < 50) {
iFace += 10; iFace += 10;
} }
} else { } else {
@@ -1168,7 +1170,7 @@ void Bot::GenerateAppearance() {
} }
int iHairColor = 0; int iHairColor = 0;
if (GetRace() == DRAKKIN) { if (GetRace() == Race::Drakkin) {
iHairColor = zone->random.Int(0, 3); iHairColor = zone->random.Int(0, 3);
} else { } else {
iHairColor = zone->random.Int(0, 19); iHairColor = zone->random.Int(0, 19);
@@ -1176,7 +1178,7 @@ void Bot::GenerateAppearance() {
auto iEyeColor1 = (uint8)zone->random.Int(0, 9); auto iEyeColor1 = (uint8)zone->random.Int(0, 9);
uint8 iEyeColor2 = 0; uint8 iEyeColor2 = 0;
if (GetRace() == DRAKKIN) { if (GetRace() == Race::Drakkin) {
iEyeColor1 = iEyeColor2 = (uint8)zone->random.Int(0, 11); iEyeColor1 = iEyeColor2 = (uint8)zone->random.Int(0, 11);
} else if (zone->random.Int(1, 100) > 96) { } else if (zone->random.Int(1, 100) > 96) {
iEyeColor2 = zone->random.Int(0, 9); iEyeColor2 = zone->random.Int(0, 9);
@@ -1187,7 +1189,7 @@ void Bot::GenerateAppearance() {
int iHeritage = 0; int iHeritage = 0;
int iTattoo = 0; int iTattoo = 0;
int iDetails = 0; int iDetails = 0;
if (GetRace() == DRAKKIN) { if (GetRace() == Race::Drakkin) {
iHeritage = zone->random.Int(0, 6); iHeritage = zone->random.Int(0, 6);
iTattoo = zone->random.Int(0, 7); iTattoo = zone->random.Int(0, 7);
iDetails = zone->random.Int(0, 7); iDetails = zone->random.Int(0, 7);
@@ -1420,6 +1422,7 @@ bool Bot::Save()
database.botdb.SaveTimers(this); database.botdb.SaveTimers(this);
database.botdb.SaveStance(this); database.botdb.SaveStance(this);
database.botdb.SaveBotSettings(this); database.botdb.SaveBotSettings(this);
database.SaveStatCaps(this);
if (RuleB(Bots, AllowBotBlockedBuffs)) { if (RuleB(Bots, AllowBotBlockedBuffs)) {
database.botdb.SaveBotBlockedBuffs(this); database.botdb.SaveBotBlockedBuffs(this);
@@ -1527,7 +1530,7 @@ bool Bot::LoadPet()
auto my_buffs = GetBuffs(); auto my_buffs = GetBuffs();
if (buffs_max && my_buffs) { if (buffs_max && my_buffs) {
for (int index = 0; index < buffs_max; ++index) { for (int index = 0; index < buffs_max; ++index) {
if (IsEffectInSpell(my_buffs[index].spellid, SE_Familiar)) { if (IsEffectInSpell(my_buffs[index].spellid, SpellEffect::Familiar)) {
MakePet(my_buffs[index].spellid, spells[my_buffs[index].spellid].teleport_zone); MakePet(my_buffs[index].spellid, spells[my_buffs[index].spellid].teleport_zone);
return true; return true;
} }
@@ -2313,7 +2316,7 @@ void Bot::AI_Process()
bot_owner->SetBotPulling(false); bot_owner->SetBotPulling(false);
if (GetPet()) { if (GetPet()) {
GetPet()->SetPetOrder(SPO_Follow); GetPet()->SetPetOrder(PetOrder::Follow);
GetPet()->CastToNPC()->SaveGuardSpot(true); GetPet()->CastToNPC()->SaveGuardSpot(true);
} }
@@ -2569,7 +2572,7 @@ void Bot::DoOutOfCombatChecks(Client* bot_owner, Mob* follow_mob, float leash_di
bot_owner->SetBotPulling(false); bot_owner->SetBotPulling(false);
if (GetPet()) { if (GetPet()) {
GetPet()->SetPetOrder(SPO_Follow); GetPet()->SetPetOrder(PetOrder::Follow);
GetPet()->CastToNPC()->SaveGuardSpot(true); GetPet()->CastToNPC()->SaveGuardSpot(true);
} }
} }
@@ -3198,7 +3201,7 @@ bool Bot::IsValidTarget(
bot_owner->SetBotPulling(false); bot_owner->SetBotPulling(false);
if (GetPet()) { if (GetPet()) {
GetPet()->SetPetOrder(SPO_Follow); GetPet()->SetPetOrder(PetOrder::Follow);
GetPet()->CastToNPC()->SaveGuardSpot(true); GetPet()->CastToNPC()->SaveGuardSpot(true);
} }
} }
@@ -3233,7 +3236,7 @@ Mob* Bot::GetBotTarget(Client* bot_owner)
bot_owner->SetBotPulling(false); bot_owner->SetBotPulling(false);
if (GetPet()) { if (GetPet()) {
GetPet()->SetPetOrder(SPO_Follow); GetPet()->SetPetOrder(PetOrder::Follow);
GetPet()->CastToNPC()->SaveGuardSpot(true); GetPet()->CastToNPC()->SaveGuardSpot(true);
} }
} }
@@ -3269,7 +3272,7 @@ bool Bot::ReturningFlagChecks(Client* bot_owner, Mob* leash_owner, float fm_dist
bot_owner->SetBotPulling(false); bot_owner->SetBotPulling(false);
if (GetPet()) { if (GetPet()) {
GetPet()->SetPetOrder(SPO_Follow); GetPet()->SetPetOrder(PetOrder::Follow);
GetPet()->CastToNPC()->SaveGuardSpot(true); GetPet()->CastToNPC()->SaveGuardSpot(true);
if (HasControllablePet(BotAnimEmpathy::BackOff)) { if (HasControllablePet(BotAnimEmpathy::BackOff)) {
@@ -3313,7 +3316,7 @@ bool Bot::PullingFlagChecks(Client* bot_owner) {
bot_owner->SetBotPulling(false); bot_owner->SetBotPulling(false);
if (GetPet()) { if (GetPet()) {
GetPet()->SetPetOrder(SPO_Follow); GetPet()->SetPetOrder(PetOrder::Follow);
GetPet()->CastToNPC()->SaveGuardSpot(true); GetPet()->CastToNPC()->SaveGuardSpot(true);
} }
@@ -3494,7 +3497,7 @@ Client* Bot::SetLeashOwner(Client* bot_owner, Group* bot_group, Raid* raid, uint
void Bot::SetOwnerTarget(Client* bot_owner) { void Bot::SetOwnerTarget(Client* bot_owner) {
if (GetPet() && (PULLING_BOT || RETURNING_BOT)) { if (GetPet() && (PULLING_BOT || RETURNING_BOT)) {
GetPet()->SetPetOrder(SPO_Follow); GetPet()->SetPetOrder(PetOrder::Follow);
} }
SetAttackFlag(false); SetAttackFlag(false);
@@ -3533,7 +3536,7 @@ void Bot::BotPullerProcess(Client* bot_owner, Raid* raid) {
bot_owner->SetBotPulling(false); bot_owner->SetBotPulling(false);
if (GetPet()) { if (GetPet()) {
GetPet()->SetPetOrder(SPO_Follow); GetPet()->SetPetOrder(PetOrder::Follow);
GetPet()->CastToNPC()->SaveGuardSpot(true); GetPet()->CastToNPC()->SaveGuardSpot(true);
} }
@@ -3562,7 +3565,7 @@ void Bot::BotPullerProcess(Client* bot_owner, Raid* raid) {
if (HasControllablePet(BotAnimEmpathy::Guard)) { if (HasControllablePet(BotAnimEmpathy::Guard)) {
m_previous_pet_order = GetPet()->GetPetOrder(); m_previous_pet_order = GetPet()->GetPetOrder();
GetPet()->CastToNPC()->SaveGuardSpot(GetPosition()); GetPet()->CastToNPC()->SaveGuardSpot(GetPosition());
GetPet()->SetPetOrder(SPO_Guard); GetPet()->SetPetOrder(PetOrder::Guard);
} }
} }
} }
@@ -3578,7 +3581,7 @@ void Bot::Depop() {
if (bot_pet) { if (bot_pet) {
if (bot_pet->Charmed()) { if (bot_pet->Charmed()) {
bot_pet->BuffFadeByEffect(SE_Charm); bot_pet->BuffFadeByEffect(SpellEffect::Charm);
} }
else { else {
bot_pet->Depop(); bot_pet->Depop();
@@ -5404,9 +5407,9 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
case Class::Paladin: case Class::Paladin:
{ {
bool is_large_race = ( bool is_large_race = (
GetBaseRace() == OGRE || GetBaseRace() == Race::Ogre ||
GetBaseRace() == TROLL || GetBaseRace() == Race::Troll ||
GetBaseRace() == BARBARIAN GetBaseRace() == Race::Barbarian
); );
bool has_bash_skill = GetSkill(EQ::skills::SkillBash) > 0; bool has_bash_skill = GetSkill(EQ::skills::SkillBash) > 0;
bool has_shield_in_secondary = bool has_shield_in_secondary =
@@ -5974,7 +5977,7 @@ bool Bot::SpellOnTarget(
if (spelltar->IsPet()) { if (spelltar->IsPet()) {
for (int i = 0; i < EFFECT_COUNT; ++i) { for (int i = 0; i < EFFECT_COUNT; ++i) {
if (spells[spell_id].effect_id[i] == SE_Illusion) { if (spells[spell_id].effect_id[i] == SpellEffect::Illusion) {
return false; return false;
} }
} }
@@ -6214,7 +6217,7 @@ bool Bot::DoFinishedSpellSingleTarget(uint16 spell_id, Mob* spellTarget, EQ::spe
if (!noGroupSpell) { if (!noGroupSpell) {
for (Mob* m : GetBuffTargets(spellTarget)) { for (Mob* m : GetBuffTargets(spellTarget)) {
if (IsEffectInSpell(thespell, SE_AbsorbMagicAtt) || IsEffectInSpell(thespell, SE_Rune)) { if (IsEffectInSpell(thespell, SpellEffect::AbsorbMagicAtt) || IsEffectInSpell(thespell, SpellEffect::Rune)) {
for (int i = 0; i < m->GetMaxTotalSlots(); i++) { for (int i = 0; i < m->GetMaxTotalSlots(); i++) {
uint32 buff_count = m->GetMaxTotalSlots(); uint32 buff_count = m->GetMaxTotalSlots();
@@ -7831,7 +7834,7 @@ bool Bot::GetNeedsCured(Mob *tar) {
bool need_cured = false; bool need_cured = false;
if (tar) { if (tar) {
if (tar->FindType(SE_PoisonCounter) || tar->FindType(SE_DiseaseCounter) || tar->FindType(SE_CurseCounter) || tar->FindType(SE_CorruptionCounter)) { if (tar->FindType(SpellEffect::PoisonCounter) || tar->FindType(SpellEffect::DiseaseCounter) || tar->FindType(SpellEffect::CurseCounter) || tar->FindType(SpellEffect::CorruptionCounter)) {
uint32 buff_count = tar->GetMaxTotalSlots(); uint32 buff_count = tar->GetMaxTotalSlots();
for (unsigned int j = 0; j < buff_count; j++) { for (unsigned int j = 0; j < buff_count; j++) {
@@ -8616,7 +8619,7 @@ void Bot::Escape()
} }
void Bot::Fling(float value, float target_x, float target_y, float target_z, bool ignore_los, bool clip_through_walls, bool calculate_speed) { void Bot::Fling(float value, float target_x, float target_y, float target_z, bool ignore_los, bool clip_through_walls, bool calculate_speed) {
BuffFadeByEffect(SE_Levitate); BuffFadeByEffect(SpellEffect::Levitate);
if (CheckLosFN(target_x, target_y, target_z, 6.0f) || ignore_los) { if (CheckLosFN(target_x, target_y, target_z, 6.0f) || ignore_los) {
auto p = new EQApplicationPacket(OP_Fling, sizeof(fling_struct)); auto p = new EQApplicationPacket(OP_Fling, sizeof(fling_struct));
auto* f = (fling_struct*) p->pBuffer; auto* f = (fling_struct*) p->pBuffer;
@@ -9553,9 +9556,9 @@ bool Bot::CastChecks(uint16 spell_id, Mob* tar, uint16 spell_type, bool precheck
if (spells[spell_id].target_type == ST_Self && tar != this) { if (spells[spell_id].target_type == ST_Self && tar != this) {
if ( if (
!IsEffectInSpell(spell_id, SE_SummonCorpse) || !IsEffectInSpell(spell_id, SpellEffect::SummonCorpse) ||
( (
IsEffectInSpell(spell_id, SE_SummonCorpse) && IsEffectInSpell(spell_id, SpellEffect::SummonCorpse) &&
!RuleB(Bots, AllowCommandedSummonCorpse) !RuleB(Bots, AllowCommandedSummonCorpse)
) )
) { ) {
@@ -9610,14 +9613,9 @@ bool Bot::CastChecks(uint16 spell_id, Mob* tar, uint16 spell_type, bool precheck
return false; return false;
} }
if ( bool is_mana_exempt = RuleB(Bots, FinishBuffing) && !IsEngaged() && IsBotBuffSpellType(spell_type);
!BotHasEnoughMana(spell_id) &&
( if (!BotHasEnoughMana(spell_id) && !is_mana_exempt) {
!RuleB(Bots, FinishBuffing) ||
IsEngaged() ||
IsBotBuffSpellType(spell_type)
)
) {
LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} due to !BotHasEnoughMana.'", GetCleanName(), GetSpellName(spell_id)); LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} due to !BotHasEnoughMana.'", GetCleanName(), GetSpellName(spell_id));
return false; return false;
} }
@@ -9672,7 +9670,7 @@ bool Bot::CastChecks(uint16 spell_id, Mob* tar, uint16 spell_type, bool precheck
if ( if (
!zone->CanLevitate() && !zone->CanLevitate() &&
IsEffectInSpell(spell_id, SE_Levitate) IsEffectInSpell(spell_id, SpellEffect::Levitate)
) { ) {
LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} due to !CanLevitate.'", GetCleanName(), GetSpellName(spell_id)); LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} due to !CanLevitate.'", GetCleanName(), GetSpellName(spell_id));
return false; return false;
@@ -9912,8 +9910,8 @@ bool Bot::CanCastSpellType(uint16 spell_type, uint16 spell_id, Mob* tar) {
spell_type != BotSpellTypes::Succor spell_type != BotSpellTypes::Succor
) && ) &&
( (
IsEffectInSpell(spell_id, SE_Teleport) || IsEffectInSpell(spell_id, SpellEffect::Teleport) ||
IsEffectInSpell(spell_id, SE_Succor) IsEffectInSpell(spell_id, SpellEffect::Succor)
) )
) { ) {
LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} on {} due to Teleport.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} on {} due to Teleport.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName());
@@ -9923,7 +9921,7 @@ bool Bot::CanCastSpellType(uint16 spell_type, uint16 spell_id, Mob* tar) {
if ( if (
tar->IsPet() && tar->IsPet() &&
!RuleB(Bots, CanCastIllusionsOnPets) && !RuleB(Bots, CanCastIllusionsOnPets) &&
IsEffectInSpell(spell_id, SE_Illusion) IsEffectInSpell(spell_id, SpellEffect::Illusion)
) { ) {
LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} on {} due to PetSE_Illusion.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} on {} due to PetSE_Illusion.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName());
return false; return false;
@@ -9967,13 +9965,13 @@ bool Bot::CanCastSpellType(uint16 spell_type, uint16 spell_id, Mob* tar) {
tar->IsBot() && tar->IsBot() &&
(tar->GetLevel() >= tar->CastToBot()->GetStopMeleeLevel()) && (tar->GetLevel() >= tar->CastToBot()->GetStopMeleeLevel()) &&
( (
IsEffectInSpell(spell_id, SE_AttackSpeed) || IsEffectInSpell(spell_id, SpellEffect::AttackSpeed) ||
IsEffectInSpell(spell_id, SE_ReverseDS) IsEffectInSpell(spell_id, SpellEffect::ReverseDS)
) || ) ||
( (
SpellEffectsCount(spell_id) == 1 && SpellEffectsCount(spell_id) == 1 &&
( (
IsEffectInSpell(spell_id, SE_ATK) || IsEffectInSpell(spell_id, SE_STR) IsEffectInSpell(spell_id, SpellEffect::ATK) || IsEffectInSpell(spell_id, SpellEffect::STR)
) )
) )
) { ) {
@@ -9983,11 +9981,11 @@ bool Bot::CanCastSpellType(uint16 spell_type, uint16 spell_id, Mob* tar) {
break; break;
case Archetype::Melee: case Archetype::Melee:
if ( if (
IsEffectInSpell(spell_id, SE_IncreaseSpellHaste) || IsEffectInSpell(spell_id, SpellEffect::IncreaseSpellHaste) ||
IsEffectInSpell(spell_id, SE_ManaPool) || IsEffectInSpell(spell_id, SpellEffect::ManaPool) ||
IsEffectInSpell(spell_id, SE_CastingLevel) || IsEffectInSpell(spell_id, SpellEffect::CastingLevel) ||
IsEffectInSpell(spell_id, SE_ManaRegen_v2) || IsEffectInSpell(spell_id, SpellEffect::ManaRegen_v2) ||
IsEffectInSpell(spell_id, SE_CurrentMana) IsEffectInSpell(spell_id, SpellEffect::CurrentMana)
) { ) {
LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} on {} due to Archetype::Melee.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} on {} due to Archetype::Melee.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName());
return false; return false;
@@ -10002,8 +10000,8 @@ bool Bot::CanCastSpellType(uint16 spell_type, uint16 spell_id, Mob* tar) {
// Differences for each type // Differences for each type
if (spell_type != BotSpellTypes::InCombatBuff) { if (spell_type != BotSpellTypes::InCombatBuff) {
if ( if (
IsEffectInSpell(spell_id, SE_AbsorbMagicAtt) || IsEffectInSpell(spell_id, SpellEffect::AbsorbMagicAtt) ||
IsEffectInSpell(spell_id, SE_Rune) IsEffectInSpell(spell_id, SpellEffect::Rune)
) { ) {
for (int i = 0; i < tar->GetMaxTotalSlots(); i++) { for (int i = 0; i < tar->GetMaxTotalSlots(); i++) {
uint32 buff_count = tar->GetMaxTotalSlots(); uint32 buff_count = tar->GetMaxTotalSlots();
@@ -10031,14 +10029,14 @@ bool Bot::CanCastSpellType(uint16 spell_type, uint16 spell_id, Mob* tar) {
tar->IsBot() && tar->IsBot() &&
(tar->GetLevel() >= tar->CastToBot()->GetStopMeleeLevel()) && (tar->GetLevel() >= tar->CastToBot()->GetStopMeleeLevel()) &&
( (
IsEffectInSpell(spell_id, SE_AttackSpeed) || IsEffectInSpell(spell_id, SpellEffect::AttackSpeed) ||
IsEffectInSpell(spell_id, SE_ReverseDS) IsEffectInSpell(spell_id, SpellEffect::ReverseDS)
) || ) ||
( (
SpellEffectsCount(spell_id) == 1 && SpellEffectsCount(spell_id) == 1 &&
( (
IsEffectInSpell(spell_id, SE_ATK) || IsEffectInSpell(spell_id, SpellEffect::ATK) ||
IsEffectInSpell(spell_id, SE_STR) IsEffectInSpell(spell_id, SpellEffect::STR)
) )
) )
) { ) {
@@ -10048,11 +10046,11 @@ bool Bot::CanCastSpellType(uint16 spell_type, uint16 spell_id, Mob* tar) {
break; break;
case Archetype::Melee: case Archetype::Melee:
if ( if (
IsEffectInSpell(spell_id, SE_IncreaseSpellHaste) || IsEffectInSpell(spell_id, SpellEffect::IncreaseSpellHaste) ||
IsEffectInSpell(spell_id, SE_ManaPool) || IsEffectInSpell(spell_id, SpellEffect::ManaPool) ||
IsEffectInSpell(spell_id, SE_CastingLevel) || IsEffectInSpell(spell_id, SpellEffect::CastingLevel) ||
IsEffectInSpell(spell_id, SE_ManaRegen_v2) || IsEffectInSpell(spell_id, SpellEffect::ManaRegen_v2) ||
IsEffectInSpell(spell_id, SE_CurrentMana) IsEffectInSpell(spell_id, SpellEffect::CurrentMana)
) { ) {
LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} on {} due to Archetype::Melee.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} on {} due to Archetype::Melee.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName());
return false; return false;
@@ -10334,7 +10332,7 @@ bool Bot::IsValidMezTarget(Mob* owner, Mob* npc, uint16 spell_id) {
auto npc_buffs = npc->GetBuffs(); auto npc_buffs = npc->GetBuffs();
for (int i = 0; i < buff_count; i++) { for (int i = 0; i < buff_count; i++) {
if (IsDetrimentalSpell(npc_buffs[i].spellid) && IsEffectInSpell(npc_buffs[i].spellid, SE_CurrentHP)) { if (IsDetrimentalSpell(npc_buffs[i].spellid) && IsEffectInSpell(npc_buffs[i].spellid, SpellEffect::CurrentHP)) {
return false; return false;
} }
} }
@@ -11689,7 +11687,7 @@ bool Bot::IsValidSpellTypeBySpellID(uint16 spell_type, uint16 spell_id) {
return false; return false;
case BotSpellTypes::Root: case BotSpellTypes::Root:
case BotSpellTypes::AERoot: case BotSpellTypes::AERoot:
if (IsDetrimentalSpell(spell_id) && IsEffectInSpell(spell_id, SE_Root)) { if (IsDetrimentalSpell(spell_id) && IsEffectInSpell(spell_id, SpellEffect::Root)) {
return true; return true;
} }
@@ -11723,7 +11721,7 @@ bool Bot::IsValidSpellTypeBySpellID(uint16 spell_type, uint16 spell_id) {
return false; return false;
case BotSpellTypes::Pet: case BotSpellTypes::Pet:
if (IsSummonPetSpell(spell_id) || IsEffectInSpell(spell_id, SE_TemporaryPets)) { if (IsSummonPetSpell(spell_id) || IsEffectInSpell(spell_id, SpellEffect::TemporaryPets)) {
return true; return true;
} }
@@ -11737,7 +11735,7 @@ bool Bot::IsValidSpellTypeBySpellID(uint16 spell_type, uint16 spell_id) {
return false; return false;
case BotSpellTypes::Snare: case BotSpellTypes::Snare:
case BotSpellTypes::AESnare: case BotSpellTypes::AESnare:
if (IsDetrimentalSpell(spell_id) && IsEffectInSpell(spell_id, SE_MovementSpeed)) { if (IsDetrimentalSpell(spell_id) && IsEffectInSpell(spell_id, SpellEffect::MovementSpeed)) {
return true; return true;
} }
@@ -11811,7 +11809,7 @@ bool Bot::IsValidSpellTypeBySpellID(uint16 spell_type, uint16 spell_id) {
return false; return false;
case BotSpellTypes::Resurrect: case BotSpellTypes::Resurrect:
if (IsEffectInSpell(spell_id, SE_Revive)) { if (IsEffectInSpell(spell_id, SpellEffect::Revive)) {
return true; return true;
} }
@@ -11916,14 +11914,14 @@ bool Bot::IsValidSpellTypeBySpellID(uint16 spell_type, uint16 spell_id) {
return false; return false;
case BotSpellTypes::ResistBuffs: case BotSpellTypes::ResistBuffs:
case BotSpellTypes::PetResistBuffs: case BotSpellTypes::PetResistBuffs:
if (IsResistanceBuffSpell(spell_id) && !IsEffectInSpell(spell_id, SE_DamageShield)) { if (IsResistanceBuffSpell(spell_id) && !IsEffectInSpell(spell_id, SpellEffect::DamageShield)) {
return true; return true;
} }
return false; return false;
case BotSpellTypes::DamageShields: case BotSpellTypes::DamageShields:
case BotSpellTypes::PetDamageShields: case BotSpellTypes::PetDamageShields:
if (IsBeneficialSpell(spell_id) && IsEffectInSpell(spell_id, SE_DamageShield)) { if (IsBeneficialSpell(spell_id) && IsEffectInSpell(spell_id, SpellEffect::DamageShield)) {
return true; return true;
} }
@@ -11931,7 +11929,7 @@ bool Bot::IsValidSpellTypeBySpellID(uint16 spell_type, uint16 spell_id) {
case BotSpellTypes::Teleport: case BotSpellTypes::Teleport:
if ( if (
IsBeneficialSpell(spell_id) && IsBeneficialSpell(spell_id) &&
(IsEffectInSpell(spell_id, SE_Teleport) || IsEffectInSpell(spell_id, SE_Translocate)) (IsEffectInSpell(spell_id, SpellEffect::Teleport) || IsEffectInSpell(spell_id, SpellEffect::Translocate))
) { ) {
return true; return true;
} }
@@ -11947,40 +11945,40 @@ bool Bot::IsValidSpellTypeBySpellID(uint16 spell_type, uint16 spell_id) {
case BotSpellTypes::Succor: case BotSpellTypes::Succor:
if ( if (
IsBeneficialSpell(spell_id) && IsBeneficialSpell(spell_id) &&
IsEffectInSpell(spell_id, SE_Succor) IsEffectInSpell(spell_id, SpellEffect::Succor)
) { ) {
return true; return true;
} }
return false; return false;
case BotSpellTypes::BindAffinity: case BotSpellTypes::BindAffinity:
if (IsEffectInSpell(spell_id, SE_BindAffinity)) { if (IsEffectInSpell(spell_id, SpellEffect::BindAffinity)) {
return true; return true;
} }
return false; return false;
case BotSpellTypes::Identify: case BotSpellTypes::Identify:
if (IsEffectInSpell(spell_id, SE_Identify)) { if (IsEffectInSpell(spell_id, SpellEffect::Identify)) {
return true; return true;
} }
return false; return false;
case BotSpellTypes::Levitate: case BotSpellTypes::Levitate:
if (IsBeneficialSpell(spell_id) && IsEffectInSpell(spell_id, SE_Levitate)) { if (IsBeneficialSpell(spell_id) && IsEffectInSpell(spell_id, SpellEffect::Levitate)) {
return true; return true;
} }
return false; return false;
case BotSpellTypes::Rune: case BotSpellTypes::Rune:
if (IsBeneficialSpell(spell_id) && if (IsBeneficialSpell(spell_id) &&
(IsEffectInSpell(spell_id, SE_AbsorbMagicAtt) || IsEffectInSpell(spell_id, SE_Rune)) (IsEffectInSpell(spell_id, SpellEffect::AbsorbMagicAtt) || IsEffectInSpell(spell_id, SpellEffect::Rune))
) { ) {
return true; return true;
} }
return false; return false;
case BotSpellTypes::WaterBreathing: case BotSpellTypes::WaterBreathing:
if (IsBeneficialSpell(spell_id) && IsEffectInSpell(spell_id, SE_WaterBreathing)) { if (IsBeneficialSpell(spell_id) && IsEffectInSpell(spell_id, SpellEffect::WaterBreathing)) {
return true; return true;
} }
@@ -11988,7 +11986,7 @@ bool Bot::IsValidSpellTypeBySpellID(uint16 spell_type, uint16 spell_id) {
case BotSpellTypes::Size: case BotSpellTypes::Size:
if ( if (
IsBeneficialSpell(spell_id) && IsBeneficialSpell(spell_id) &&
(IsEffectInSpell(spell_id, SE_ModelSize) || IsEffectInSpell(spell_id, SE_ChangeHeight)) (IsEffectInSpell(spell_id, SpellEffect::ModelSize) || IsEffectInSpell(spell_id, SpellEffect::ChangeHeight))
) { ) {
return true; return true;
} }
@@ -11996,14 +11994,14 @@ bool Bot::IsValidSpellTypeBySpellID(uint16 spell_type, uint16 spell_id) {
return false; return false;
case BotSpellTypes::Invisibility: case BotSpellTypes::Invisibility:
if (IsBeneficialSpell(spell_id) && if (IsBeneficialSpell(spell_id) &&
(IsEffectInSpell(spell_id, SE_SeeInvis) ||IsInvisibleSpell(spell_id)) (IsEffectInSpell(spell_id, SpellEffect::SeeInvis) ||IsInvisibleSpell(spell_id))
) { ) {
return true; return true;
} }
return false; return false;
case BotSpellTypes::MovementSpeed: case BotSpellTypes::MovementSpeed:
if (IsBeneficialSpell(spell_id) && IsEffectInSpell(spell_id, SE_MovementSpeed)) { if (IsBeneficialSpell(spell_id) && IsEffectInSpell(spell_id, SpellEffect::MovementSpeed)) {
return true; return true;
} }
@@ -12012,10 +12010,10 @@ bool Bot::IsValidSpellTypeBySpellID(uint16 spell_type, uint16 spell_id) {
if ( if (
IsBeneficialSpell(spell_id) && IsBeneficialSpell(spell_id) &&
( (
IsEffectInSpell(spell_id, SE_GateToHomeCity) || IsEffectInSpell(spell_id, SpellEffect::GateToHomeCity) ||
( (
teleport_zone.compare("") && teleport_zone.compare("") &&
(IsEffectInSpell(spell_id, SE_Teleport) || IsEffectInSpell(spell_id, SE_Translocate)) (IsEffectInSpell(spell_id, SpellEffect::Teleport) || IsEffectInSpell(spell_id, SpellEffect::Translocate))
) )
) )
) { ) {
@@ -12024,7 +12022,7 @@ bool Bot::IsValidSpellTypeBySpellID(uint16 spell_type, uint16 spell_id) {
return false; return false;
case BotSpellTypes::SummonCorpse: case BotSpellTypes::SummonCorpse:
if (IsEffectInSpell(spell_id, SE_SummonCorpse)) { if (IsEffectInSpell(spell_id, SpellEffect::SummonCorpse)) {
return true; return true;
} }
@@ -12515,15 +12513,15 @@ bool Bot::IsValidSpellTypeSubType(uint16 spell_type, uint16 sub_type, uint16 spe
break; break;
case CommandedSubTypes::SeeInvis: case CommandedSubTypes::SeeInvis:
if (IsEffectInSpell(spell_id, SE_SeeInvis)) { if (IsEffectInSpell(spell_id, SpellEffect::SeeInvis)) {
return true; return true;
} }
break; break;
case CommandedSubTypes::Invis: case CommandedSubTypes::Invis:
if ( if (
IsEffectInSpell(spell_id, SE_Invisibility) || IsEffectInSpell(spell_id, SpellEffect::Invisibility) ||
IsEffectInSpell(spell_id, SE_Invisibility2) IsEffectInSpell(spell_id, SpellEffect::Invisibility2)
) { ) {
return true; return true;
} }
@@ -12531,8 +12529,8 @@ bool Bot::IsValidSpellTypeSubType(uint16 spell_type, uint16 sub_type, uint16 spe
break; break;
case CommandedSubTypes::InvisUndead: case CommandedSubTypes::InvisUndead:
if ( if (
IsEffectInSpell(spell_id, SE_InvisVsUndead) || IsEffectInSpell(spell_id, SpellEffect::InvisVsUndead) ||
IsEffectInSpell(spell_id, SE_InvisVsUndead2) IsEffectInSpell(spell_id, SpellEffect::InvisVsUndead2)
) { ) {
return true; return true;
} }
@@ -12540,8 +12538,8 @@ bool Bot::IsValidSpellTypeSubType(uint16 spell_type, uint16 sub_type, uint16 spe
break; break;
case CommandedSubTypes::InvisAnimals: case CommandedSubTypes::InvisAnimals:
if ( if (
IsEffectInSpell(spell_id, SE_InvisVsAnimals) || IsEffectInSpell(spell_id, SpellEffect::InvisVsAnimals) ||
IsEffectInSpell(spell_id, SE_ImprovedInvisAnimals) IsEffectInSpell(spell_id, SpellEffect::ImprovedInvisAnimals)
) { ) {
return true; return true;
} }
@@ -12550,13 +12548,13 @@ bool Bot::IsValidSpellTypeSubType(uint16 spell_type, uint16 sub_type, uint16 spe
case CommandedSubTypes::Shrink: case CommandedSubTypes::Shrink:
if ( if (
( (
IsEffectInSpell(spell_id, SE_ModelSize) && IsEffectInSpell(spell_id, SpellEffect::ModelSize) &&
CalcSpellEffectValue(spell_id, GetSpellEffectIndex(spell_id, SE_ModelSize), GetLevel()) < 100 CalcSpellEffectValue(spell_id, GetSpellEffectIndex(spell_id, SpellEffect::ModelSize), GetLevel()) < 100
) )
|| ||
( (
IsEffectInSpell(spell_id, SE_ChangeHeight) && IsEffectInSpell(spell_id, SpellEffect::ChangeHeight) &&
CalcSpellEffectValue(spell_id, GetSpellEffectIndex(spell_id, SE_ChangeHeight), GetLevel()) < 100 CalcSpellEffectValue(spell_id, GetSpellEffectIndex(spell_id, SpellEffect::ChangeHeight), GetLevel()) < 100
) )
) { ) {
return true; return true;
@@ -12566,13 +12564,13 @@ bool Bot::IsValidSpellTypeSubType(uint16 spell_type, uint16 sub_type, uint16 spe
case CommandedSubTypes::Grow: case CommandedSubTypes::Grow:
if ( if (
( (
IsEffectInSpell(spell_id, SE_ModelSize) && IsEffectInSpell(spell_id, SpellEffect::ModelSize) &&
CalcSpellEffectValue(spell_id, GetSpellEffectIndex(spell_id, SE_ModelSize), GetLevel()) > 100 CalcSpellEffectValue(spell_id, GetSpellEffectIndex(spell_id, SpellEffect::ModelSize), GetLevel()) > 100
) )
|| ||
( (
IsEffectInSpell(spell_id, SE_ChangeHeight) && IsEffectInSpell(spell_id, SpellEffect::ChangeHeight) &&
CalcSpellEffectValue(spell_id, GetSpellEffectIndex(spell_id, SE_ChangeHeight), GetLevel()) > 100 CalcSpellEffectValue(spell_id, GetSpellEffectIndex(spell_id, SpellEffect::ChangeHeight), GetLevel()) > 100
) )
) { ) {
return true; return true;
@@ -12582,7 +12580,7 @@ bool Bot::IsValidSpellTypeSubType(uint16 spell_type, uint16 sub_type, uint16 spe
case CommandedSubTypes::Selo: case CommandedSubTypes::Selo:
if ( if (
IsBeneficialSpell(spell_id) && IsBeneficialSpell(spell_id) &&
IsEffectInSpell(spell_id, SE_MovementSpeed) && IsEffectInSpell(spell_id, SpellEffect::MovementSpeed) &&
IsBardSong(spell_id) IsBardSong(spell_id)
) { ) {
return true; return true;
@@ -13352,7 +13350,7 @@ bool Bot::IsImmuneToBotSpell(uint16 spell_id, Mob* caster) {
if (!GetSpecialAbility(SpecialAbility::MesmerizeImmunity) && IsMesmerizeSpell(spell_id)) { if (!GetSpecialAbility(SpecialAbility::MesmerizeImmunity) && IsMesmerizeSpell(spell_id)) {
// check max level for spell // check max level for spell
effect_index = GetSpellEffectIndex(spell_id, SE_Mez); effect_index = GetSpellEffectIndex(spell_id, SpellEffect::Mez);
assert(effect_index >= 0); assert(effect_index >= 0);
// NPCs get to ignore the max level // NPCs get to ignore the max level
if ( if (
@@ -13364,13 +13362,13 @@ bool Bot::IsImmuneToBotSpell(uint16 spell_id, Mob* caster) {
} }
// slow and haste spells // slow and haste spells
if (GetSpecialAbility(SpecialAbility::SlowImmunity) && IsEffectInSpell(spell_id, SE_AttackSpeed)) { if (GetSpecialAbility(SpecialAbility::SlowImmunity) && IsEffectInSpell(spell_id, SpellEffect::AttackSpeed)) {
return true; return true;
} }
// client vs client fear // client vs client fear
if (!GetSpecialAbility(SpecialAbility::FearImmunity) && IsEffectInSpell(spell_id, SE_Fear)) { if (!GetSpecialAbility(SpecialAbility::FearImmunity) && IsEffectInSpell(spell_id, SpellEffect::Fear)) {
effect_index = GetSpellEffectIndex(spell_id, SE_Fear); effect_index = GetSpellEffectIndex(spell_id, SpellEffect::Fear);
if (IsClient() && caster->IsClient() && (caster->CastToClient()->GetGM() == false)) { if (IsClient() && caster->IsClient() && (caster->CastToClient()->GetGM() == false)) {
LogSpells("Clients cannot fear eachother!"); LogSpells("Clients cannot fear eachother!");
@@ -13394,7 +13392,7 @@ bool Bot::IsImmuneToBotSpell(uint16 spell_id, Mob* caster) {
//let npcs cast whatever charm on anyone //let npcs cast whatever charm on anyone
if (!caster->IsNPC()) { if (!caster->IsNPC()) {
// check level limit of charm spell // check level limit of charm spell
effect_index = GetSpellEffectIndex(spell_id, SE_Charm); effect_index = GetSpellEffectIndex(spell_id, SpellEffect::Charm);
assert(effect_index >= 0); assert(effect_index >= 0);
if (GetLevel() > spells[spell_id].max_value[effect_index] && spells[spell_id].max_value[effect_index] != 0) { if (GetLevel() > spells[spell_id].max_value[effect_index] && spells[spell_id].max_value[effect_index] != 0) {
return true; return true;
@@ -13405,8 +13403,8 @@ bool Bot::IsImmuneToBotSpell(uint16 spell_id, Mob* caster) {
if ( if (
GetSpecialAbility(SpecialAbility::SnareImmunity) && GetSpecialAbility(SpecialAbility::SnareImmunity) &&
( (
IsEffectInSpell(spell_id, SE_Root) || IsEffectInSpell(spell_id, SpellEffect::Root) ||
IsEffectInSpell(spell_id, SE_MovementSpeed) IsEffectInSpell(spell_id, SpellEffect::MovementSpeed)
) )
) { ) {
return true; return true;
@@ -13461,6 +13459,6 @@ bool Bot::HasControllablePet(uint8 ranks_required) {
} }
return GetClass() != Class::Enchanter || return GetClass() != Class::Enchanter ||
GetPet()->GetPetType() != petAnimation || GetPet()->GetPetType() != PetType::Animation ||
GetAA(aaAnimationEmpathy) >= ranks_required; GetAA(aaAnimationEmpathy) >= ranks_required;
} }
-1
View File
@@ -1210,7 +1210,6 @@ private:
bool _hasLoS; bool _hasLoS;
bool _commandedSpell; bool _commandedSpell;
bool _pullingSpell; bool _pullingSpell;
bool _illusionBlock; bool _illusionBlock;
std::vector<BotSpellSettings> m_bot_spell_settings; std::vector<BotSpellSettings> m_bot_spell_settings;
std::vector<Mob*> _spell_target_list; std::vector<Mob*> _spell_target_list;
+17 -17
View File
@@ -46,9 +46,9 @@ void bot_command_beard_color(Client *c, const Seperator *sep)
uint8 uvalue = Strings::ToInt(sep->arg[1]); uint8 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None; auto fail_type = AFT_None;
if (my_bot->GetGender() != Gender::Male && my_bot->GetRace() != DWARF) if (my_bot->GetGender() != Gender::Male && my_bot->GetRace() != Race::Dwarf)
fail_type = AFT_GenderRace; fail_type = AFT_GenderRace;
else if (!PlayerAppearance::IsValidBeardColor(my_bot->GetRace(), my_bot->GetGender(), uvalue)) else if (!RaceAppearance::IsValidBeardColor(my_bot->GetRace(), my_bot->GetGender(), uvalue))
fail_type = AFT_Value; fail_type = AFT_Value;
else else
my_bot->SetBeardColor(uvalue); my_bot->SetBeardColor(uvalue);
@@ -83,9 +83,9 @@ void bot_command_beard_style(Client *c, const Seperator *sep)
uint8 uvalue = Strings::ToInt(sep->arg[1]); uint8 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None; auto fail_type = AFT_None;
if (my_bot->GetGender() != Gender::Male && my_bot->GetRace() != DWARF) if (my_bot->GetGender() != Gender::Male && my_bot->GetRace() != Race::Dwarf)
fail_type = AFT_GenderRace; fail_type = AFT_GenderRace;
else if (!PlayerAppearance::IsValidBeard(my_bot->GetRace(), my_bot->GetGender(), uvalue)) else if (!RaceAppearance::IsValidBeard(my_bot->GetRace(), my_bot->GetGender(), uvalue))
fail_type = AFT_Value; fail_type = AFT_Value;
else else
my_bot->SetBeard(uvalue); my_bot->SetBeard(uvalue);
@@ -122,9 +122,9 @@ void bot_command_details(Client *c, const Seperator *sep)
uint32 uvalue = Strings::ToInt(sep->arg[1]); uint32 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None; auto fail_type = AFT_None;
if (my_bot->GetRace() != DRAKKIN) if (my_bot->GetRace() != Race::Drakkin)
fail_type = AFT_Race; fail_type = AFT_Race;
else if (!PlayerAppearance::IsValidDetail(my_bot->GetRace(), my_bot->GetGender(), uvalue)) else if (!RaceAppearance::IsValidDetail(my_bot->GetRace(), my_bot->GetGender(), uvalue))
fail_type = AFT_Value; fail_type = AFT_Value;
else else
my_bot->SetDrakkinDetails(uvalue); my_bot->SetDrakkinDetails(uvalue);
@@ -281,7 +281,7 @@ void bot_command_eyes(Client *c, const Seperator *sep)
// eye_bias = 2; // eye_bias = 2;
auto fail_type = AFT_None; auto fail_type = AFT_None;
if (!PlayerAppearance::IsValidEyeColor(my_bot->GetRace(), my_bot->GetGender(), uvalue)) { if (!RaceAppearance::IsValidEyeColor(my_bot->GetRace(), my_bot->GetGender(), uvalue)) {
fail_type = AFT_Value; fail_type = AFT_Value;
} }
else { else {
@@ -328,12 +328,12 @@ void bot_command_face(Client *c, const Seperator *sep)
uint8 uvalue = Strings::ToInt(sep->arg[1]); uint8 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None; auto fail_type = AFT_None;
if (!PlayerAppearance::IsValidFace(my_bot->GetRace(), my_bot->GetGender(), uvalue)) { if (!RaceAppearance::IsValidFace(my_bot->GetRace(), my_bot->GetGender(), uvalue)) {
fail_type = AFT_Value; fail_type = AFT_Value;
} }
else { else {
uint8 old_woad = 0; uint8 old_woad = 0;
if (my_bot->GetRace() == BARBARIAN) if (my_bot->GetRace() == Race::Barbarian)
old_woad = ((my_bot->GetLuclinFace() / 10) * 10); old_woad = ((my_bot->GetLuclinFace() / 10) * 10);
my_bot->SetLuclinFace((old_woad + uvalue)); my_bot->SetLuclinFace((old_woad + uvalue));
} }
@@ -368,7 +368,7 @@ void bot_command_hair_color(Client *c, const Seperator *sep)
uint8 uvalue = Strings::ToInt(sep->arg[1]); uint8 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None; auto fail_type = AFT_None;
if (!PlayerAppearance::IsValidHairColor(my_bot->GetRace(), my_bot->GetGender(), uvalue)) if (!RaceAppearance::IsValidHairColor(my_bot->GetRace(), my_bot->GetGender(), uvalue))
fail_type = AFT_Value; fail_type = AFT_Value;
else else
my_bot->SetHairColor(uvalue); my_bot->SetHairColor(uvalue);
@@ -403,7 +403,7 @@ void bot_command_hairstyle(Client *c, const Seperator *sep)
uint8 uvalue = Strings::ToInt(sep->arg[1]); uint8 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None; auto fail_type = AFT_None;
if (!PlayerAppearance::IsValidHair(my_bot->GetRace(), my_bot->GetGender(), uvalue)) if (!RaceAppearance::IsValidHair(my_bot->GetRace(), my_bot->GetGender(), uvalue))
fail_type = AFT_Value; fail_type = AFT_Value;
else else
my_bot->SetHairStyle(uvalue); my_bot->SetHairStyle(uvalue);
@@ -440,9 +440,9 @@ void bot_command_heritage(Client *c, const Seperator *sep)
uint32 uvalue = Strings::ToInt(sep->arg[1]); uint32 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None; auto fail_type = AFT_None;
if (my_bot->GetRace() != DRAKKIN) if (my_bot->GetRace() != Race::Drakkin)
fail_type = AFT_Race; fail_type = AFT_Race;
else if (!PlayerAppearance::IsValidHeritage(my_bot->GetRace(), my_bot->GetGender(), uvalue)) else if (!RaceAppearance::IsValidHeritage(my_bot->GetRace(), my_bot->GetGender(), uvalue))
fail_type = AFT_Value; fail_type = AFT_Value;
else else
my_bot->SetDrakkinHeritage(uvalue); my_bot->SetDrakkinHeritage(uvalue);
@@ -479,9 +479,9 @@ void bot_command_tattoo(Client *c, const Seperator *sep)
uint32 uvalue = Strings::ToInt(sep->arg[1]); uint32 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None; auto fail_type = AFT_None;
if (my_bot->GetRace() != DRAKKIN) if (my_bot->GetRace() != Race::Drakkin)
fail_type = AFT_Race; fail_type = AFT_Race;
else if (!PlayerAppearance::IsValidTattoo(my_bot->GetRace(), my_bot->GetGender(), uvalue)) else if (!RaceAppearance::IsValidTattoo(my_bot->GetRace(), my_bot->GetGender(), uvalue))
fail_type = AFT_Value; fail_type = AFT_Value;
else else
my_bot->SetDrakkinTattoo(uvalue); my_bot->SetDrakkinTattoo(uvalue);
@@ -516,10 +516,10 @@ void bot_command_woad(Client *c, const Seperator *sep)
uint8 uvalue = Strings::ToInt(sep->arg[1]); uint8 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None; auto fail_type = AFT_None;
if (my_bot->GetRace() != BARBARIAN) { if (my_bot->GetRace() != Race::Barbarian) {
fail_type = AFT_Race; fail_type = AFT_Race;
} }
else if (!PlayerAppearance::IsValidWoad(my_bot->GetRace(), my_bot->GetGender(), uvalue)) { else if (!RaceAppearance::IsValidWoad(my_bot->GetRace(), my_bot->GetGender(), uvalue)) {
fail_type = AFT_Value; fail_type = AFT_Value;
} }
else { else {
+1 -1
View File
@@ -313,7 +313,7 @@ void bot_command_pet_set_type(Client *c, const Seperator *sep)
continue; continue;
} }
if (!IsEffectInSpell(s.SpellId, SE_SummonPet)) { if (!IsEffectInSpell(s.SpellId, SpellEffect::SummonPet)) {
continue; continue;
} }
+34 -34
View File
@@ -384,7 +384,7 @@ bool Bot::BotCastPet(Mob* tar, uint8 bot_class, BotSpell& bot_spell, uint16 spel
int familiar_buff_slot = -1; int familiar_buff_slot = -1;
if (buffs_max && my_buffs) { if (buffs_max && my_buffs) {
for (int index = 0; index < buffs_max; ++index) { for (int index = 0; index < buffs_max; ++index) {
if (IsEffectInSpell(my_buffs[index].spellid, SE_Familiar)) { if (IsEffectInSpell(my_buffs[index].spellid, SpellEffect::Familiar)) {
MakePet(my_buffs[index].spellid, spells[my_buffs[index].spellid].teleport_zone); MakePet(my_buffs[index].spellid, spells[my_buffs[index].spellid].teleport_zone);
familiar_buff_slot = index; familiar_buff_slot = index;
break; break;
@@ -1173,7 +1173,7 @@ BotSpell Bot::GetBestBotSpellForVeryFastHeal(Bot* caster, Mob* tar, uint16 spell
result.ManaCost = 0; result.ManaCost = 0;
if (caster) { if (caster) {
std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SE_CurrentHP); std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SpellEffect::CurrentHP);
for (auto bot_spell_list_itr : bot_spell_list) { for (auto bot_spell_list_itr : bot_spell_list) {
if ( if (
@@ -1198,7 +1198,7 @@ BotSpell Bot::GetBestBotSpellForFastHeal(Bot* caster, Mob* tar, uint16 spell_typ
result.ManaCost = 0; result.ManaCost = 0;
if (caster) { if (caster) {
std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SE_CurrentHP); std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SpellEffect::CurrentHP);
for (auto bot_spell_list_itr : bot_spell_list) { for (auto bot_spell_list_itr : bot_spell_list) {
if (IsFastHealSpell(bot_spell_list_itr.SpellId) && caster->CastChecks(bot_spell_list_itr.SpellId, tar, spell_type)) { if (IsFastHealSpell(bot_spell_list_itr.SpellId) && caster->CastChecks(bot_spell_list_itr.SpellId, tar, spell_type)) {
@@ -1222,7 +1222,7 @@ BotSpell Bot::GetBestBotSpellForHealOverTime(Bot* caster, Mob* tar, uint16 spell
result.ManaCost = 0; result.ManaCost = 0;
if (caster) { if (caster) {
std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SE_HealOverTime); std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SpellEffect::HealOverTime);
for (auto bot_spell_list_itr : bot_spell_list) { for (auto bot_spell_list_itr : bot_spell_list) {
if (IsHealOverTimeSpell(bot_spell_list_itr.SpellId) && caster->CastChecks(bot_spell_list_itr.SpellId, tar, spell_type)) { if (IsHealOverTimeSpell(bot_spell_list_itr.SpellId) && caster->CastChecks(bot_spell_list_itr.SpellId, tar, spell_type)) {
@@ -1278,7 +1278,7 @@ BotSpell Bot::GetBestBotSpellForRegularSingleTargetHeal(Bot* caster, Mob* tar, u
result.ManaCost = 0; result.ManaCost = 0;
if (caster) { if (caster) {
std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SE_CurrentHP); std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SpellEffect::CurrentHP);
for (std::list<BotSpell>::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) { for (std::list<BotSpell>::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) {
if (IsRegularSingleTargetHealSpell(bot_spell_list_itr->SpellId) && caster->CastChecks(bot_spell_list_itr->SpellId, tar, spell_type)) { if (IsRegularSingleTargetHealSpell(bot_spell_list_itr->SpellId) && caster->CastChecks(bot_spell_list_itr->SpellId, tar, spell_type)) {
@@ -1302,7 +1302,7 @@ BotSpell Bot::GetFirstBotSpellForSingleTargetHeal(Bot* caster, Mob* tar, uint16
result.ManaCost = 0; result.ManaCost = 0;
if (caster) { if (caster) {
std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SE_CurrentHP); std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SpellEffect::CurrentHP);
for (std::list<BotSpell>::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) { for (std::list<BotSpell>::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) {
if (IsRegularSingleTargetHealSpell(bot_spell_list_itr->SpellId) && caster->CastChecks(bot_spell_list_itr->SpellId, tar, spell_type)) { if (IsRegularSingleTargetHealSpell(bot_spell_list_itr->SpellId) && caster->CastChecks(bot_spell_list_itr->SpellId, tar, spell_type)) {
@@ -1329,7 +1329,7 @@ BotSpell Bot::GetBestBotSpellForGroupHeal(Bot* caster, Mob* tar, uint16 spell_ty
return result; return result;
} }
std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SE_CurrentHP); std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SpellEffect::CurrentHP);
int target_count = 0; int target_count = 0;
int required_count = caster->GetSpellTypeAEOrGroupTargetCount(spell_type); int required_count = caster->GetSpellTypeAEOrGroupTargetCount(spell_type);
@@ -1367,7 +1367,7 @@ BotSpell Bot::GetBestBotSpellForGroupHealOverTime(Bot* caster, Mob* tar, uint16
return result; return result;
} }
std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SE_HealOverTime); std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SpellEffect::HealOverTime);
int target_count = 0; int target_count = 0;
int required_count = caster->GetSpellTypeAEOrGroupTargetCount(spell_type); int required_count = caster->GetSpellTypeAEOrGroupTargetCount(spell_type);
@@ -1405,7 +1405,7 @@ BotSpell Bot::GetBestBotSpellForGroupCompleteHeal(Bot* caster, Mob* tar, uint16
return result; return result;
} }
std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SE_CompleteHeal); std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SpellEffect::CompleteHeal);
int target_count = 0; int target_count = 0;
int required_count = caster->GetSpellTypeAEOrGroupTargetCount(spell_type); int required_count = caster->GetSpellTypeAEOrGroupTargetCount(spell_type);
@@ -1440,7 +1440,7 @@ BotSpell Bot::GetBestBotSpellForMez(Bot* caster, uint16 spell_type) {
result.ManaCost = 0; result.ManaCost = 0;
if (caster) { if (caster) {
std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SE_Mez); std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SpellEffect::Mez);
for (std::list<BotSpell>::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) { for (std::list<BotSpell>::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) {
if ( if (
@@ -1548,7 +1548,7 @@ BotSpell Bot::GetBestBotMagicianPetSpell(Bot* caster, uint16 spell_type) {
result.ManaCost = 0; result.ManaCost = 0;
if (caster) { if (caster) {
std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SE_SummonPet); std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SpellEffect::SummonPet);
std::string pet_type = GetBotMagicianPetType(caster); std::string pet_type = GetBotMagicianPetType(caster);
for(std::list<BotSpell>::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) { for(std::list<BotSpell>::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) {
@@ -1638,7 +1638,7 @@ std::string Bot::GetBotMagicianPetType(Bot* caster) {
continue; continue;
} }
if (!IsEffectInSpell(s.SpellId, SE_SummonPet)) { if (!IsEffectInSpell(s.SpellId, SpellEffect::SummonPet)) {
continue; continue;
} }
@@ -1730,7 +1730,7 @@ BotSpell Bot::GetBestBotSpellForNukeByTargetType(Bot* caster, SpellTargetType ta
} }
if (caster) { if (caster) {
std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffectAndTargetType(caster, spell_type, SE_CurrentHP, target_type); std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffectAndTargetType(caster, spell_type, SpellEffect::CurrentHP, target_type);
for(std::list<BotSpell>::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) { for(std::list<BotSpell>::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) {
if (IsPureNukeSpell(bot_spell_list_itr->SpellId) || IsDamageSpell(bot_spell_list_itr->SpellId)) { if (IsPureNukeSpell(bot_spell_list_itr->SpellId) || IsDamageSpell(bot_spell_list_itr->SpellId)) {
@@ -1777,7 +1777,7 @@ BotSpell Bot::GetBestBotSpellForStunByTargetType(Bot* caster, SpellTargetType ta
if (caster) if (caster)
{ {
std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffectAndTargetType(caster, spell_type, SE_Stun, target_type); std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffectAndTargetType(caster, spell_type, SpellEffect::Stun, target_type);
for(std::list<BotSpell>::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) for(std::list<BotSpell>::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr)
{ {
@@ -1835,7 +1835,7 @@ BotSpell Bot::GetBestBotWizardNukeSpellByTargetResists(Bot* caster, Mob* target,
} }
std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffectAndTargetType(caster, spell_type, SE_CurrentHP, ST_Target); std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffectAndTargetType(caster, spell_type, SpellEffect::CurrentHP, ST_Target);
BotSpell first_wizard_magic_nuke_spell_found; BotSpell first_wizard_magic_nuke_spell_found;
first_wizard_magic_nuke_spell_found.SpellId = 0; first_wizard_magic_nuke_spell_found.SpellId = 0;
@@ -1998,11 +1998,11 @@ BotSpell Bot::GetBestBotSpellForResistDebuff(Bot* caster, Mob *tar, uint16 spell
if ( if (
(bot_spell_list[i].type == BotSpellTypes::Debuff || IsResistDebuffSpell(bot_spell_list[i].spellid)) && (bot_spell_list[i].type == BotSpellTypes::Debuff || IsResistDebuffSpell(bot_spell_list[i].spellid)) &&
( (
(needs_magic_resist_debuff && (IsEffectInSpell(bot_spell_list[i].spellid, SE_ResistMagic) || IsEffectInSpell(bot_spell_list[i].spellid, SE_ResistAll))) || (needs_magic_resist_debuff && (IsEffectInSpell(bot_spell_list[i].spellid, SpellEffect::ResistMagic) || IsEffectInSpell(bot_spell_list[i].spellid, SpellEffect::ResistAll))) ||
(needs_cold_resist_debuff && (IsEffectInSpell(bot_spell_list[i].spellid, SE_ResistCold) || IsEffectInSpell(bot_spell_list[i].spellid, SE_ResistAll))) || (needs_cold_resist_debuff && (IsEffectInSpell(bot_spell_list[i].spellid, SpellEffect::ResistCold) || IsEffectInSpell(bot_spell_list[i].spellid, SpellEffect::ResistAll))) ||
(needs_fire_resist_debuff && (IsEffectInSpell(bot_spell_list[i].spellid, SE_ResistFire) || IsEffectInSpell(bot_spell_list[i].spellid, SE_ResistAll))) || (needs_fire_resist_debuff && (IsEffectInSpell(bot_spell_list[i].spellid, SpellEffect::ResistFire) || IsEffectInSpell(bot_spell_list[i].spellid, SpellEffect::ResistAll))) ||
(needs_poison_resist_debuff && (IsEffectInSpell(bot_spell_list[i].spellid, SE_ResistPoison) || IsEffectInSpell(bot_spell_list[i].spellid, SE_ResistAll))) || (needs_poison_resist_debuff && (IsEffectInSpell(bot_spell_list[i].spellid, SpellEffect::ResistPoison) || IsEffectInSpell(bot_spell_list[i].spellid, SpellEffect::ResistAll))) ||
(needs_disease_resist_debuff && (IsEffectInSpell(bot_spell_list[i].spellid, SE_ResistDisease) || IsEffectInSpell(bot_spell_list[i].spellid, SE_ResistAll))) (needs_disease_resist_debuff && (IsEffectInSpell(bot_spell_list[i].spellid, SpellEffect::ResistDisease) || IsEffectInSpell(bot_spell_list[i].spellid, SpellEffect::ResistAll)))
) && ) &&
!tar->IsImmuneToSpell(bot_spell_list[i].spellid, caster) && !tar->IsImmuneToSpell(bot_spell_list[i].spellid, caster) &&
tar->CanBuffStack(bot_spell_list[i].spellid, caster->GetLevel(), true) >= 0 && tar->CanBuffStack(bot_spell_list[i].spellid, caster->GetLevel(), true) >= 0 &&
@@ -2049,16 +2049,16 @@ BotSpell Bot::GetBestBotSpellForCure(Bot* caster, Mob* tar, uint16 spell_type) {
for (Mob* m : (IsGroupBotSpellType(spell_type) ? caster->GetSpellTargetList() : caster->GetSpellTargetList(true))) { for (Mob* m : (IsGroupBotSpellType(spell_type) ? caster->GetSpellTargetList() : caster->GetSpellTargetList(true))) {
if (caster->GetNeedsCured(m)) { if (caster->GetNeedsCured(m)) {
if (caster->CastChecks(itr->SpellId, m, spell_type, true, IsGroupBotSpellType(spell_type))) { if (caster->CastChecks(itr->SpellId, m, spell_type, true, IsGroupBotSpellType(spell_type))) {
if (m->FindType(SE_PoisonCounter)) { if (m->FindType(SpellEffect::PoisonCounter)) {
++count_poisoned; ++count_poisoned;
} }
if (m->FindType(SE_DiseaseCounter)) { if (m->FindType(SpellEffect::DiseaseCounter)) {
++count_diseased; ++count_diseased;
} }
if (m->FindType(SE_CurseCounter)) { if (m->FindType(SpellEffect::CurseCounter)) {
++count_cursed; ++count_cursed;
} }
if (m->FindType(SE_CorruptionCounter)) { if (m->FindType(SpellEffect::CorruptionCounter)) {
++count_corrupted; ++count_corrupted;
} }
} }
@@ -2066,10 +2066,10 @@ BotSpell Bot::GetBestBotSpellForCure(Bot* caster, Mob* tar, uint16 spell_type) {
} }
if ( if (
(count_poisoned >= caster->GetSpellTypeAEOrGroupTargetCount(spell_type) && IsEffectInSpell(itr->SpellId, SE_PoisonCounter)) || (count_poisoned >= caster->GetSpellTypeAEOrGroupTargetCount(spell_type) && IsEffectInSpell(itr->SpellId, SpellEffect::PoisonCounter)) ||
(count_diseased >= caster->GetSpellTypeAEOrGroupTargetCount(spell_type) && IsEffectInSpell(itr->SpellId, SE_DiseaseCounter)) || (count_diseased >= caster->GetSpellTypeAEOrGroupTargetCount(spell_type) && IsEffectInSpell(itr->SpellId, SpellEffect::DiseaseCounter)) ||
(count_cursed >= caster->GetSpellTypeAEOrGroupTargetCount(spell_type) && IsEffectInSpell(itr->SpellId, SE_CurseCounter)) || (count_cursed >= caster->GetSpellTypeAEOrGroupTargetCount(spell_type) && IsEffectInSpell(itr->SpellId, SpellEffect::CurseCounter)) ||
(count_corrupted >= caster->GetSpellTypeAEOrGroupTargetCount(spell_type) && IsEffectInSpell(itr->SpellId, SE_CorruptionCounter)) (count_corrupted >= caster->GetSpellTypeAEOrGroupTargetCount(spell_type) && IsEffectInSpell(itr->SpellId, SpellEffect::CorruptionCounter))
) { ) {
result.SpellId = itr->SpellId; result.SpellId = itr->SpellId;
result.SpellIndex = itr->SpellIndex; result.SpellIndex = itr->SpellIndex;
@@ -2086,10 +2086,10 @@ BotSpell Bot::GetBestBotSpellForCure(Bot* caster, Mob* tar, uint16 spell_type) {
} }
if ( if (
tar->FindType(SE_PoisonCounter) && IsEffectInSpell(itr->SpellId, SE_PoisonCounter) || tar->FindType(SpellEffect::PoisonCounter) && IsEffectInSpell(itr->SpellId, SpellEffect::PoisonCounter) ||
tar->FindType(SE_DiseaseCounter) && IsEffectInSpell(itr->SpellId, SE_DiseaseCounter) || tar->FindType(SpellEffect::DiseaseCounter) && IsEffectInSpell(itr->SpellId, SpellEffect::DiseaseCounter) ||
tar->FindType(SE_CurseCounter) && IsEffectInSpell(itr->SpellId, SE_CurseCounter) || tar->FindType(SpellEffect::CurseCounter) && IsEffectInSpell(itr->SpellId, SpellEffect::CurseCounter) ||
tar->FindType(SE_CorruptionCounter) && IsEffectInSpell(itr->SpellId, SE_CorruptionCounter) tar->FindType(SpellEffect::CorruptionCounter) && IsEffectInSpell(itr->SpellId, SpellEffect::CorruptionCounter)
) { ) {
result.SpellId = itr->SpellId; result.SpellId = itr->SpellId;
result.SpellIndex = itr->SpellIndex; result.SpellIndex = itr->SpellIndex;
@@ -2838,7 +2838,7 @@ BotSpell Bot::GetBestBotSpellForRez(Bot* caster, Mob* target, uint16 spell_type)
result.ManaCost = 0; result.ManaCost = 0;
if (caster) { if (caster) {
std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SE_Revive); std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SpellEffect::Revive);
for (std::list<BotSpell>::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) { for (std::list<BotSpell>::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) {
if ( if (
@@ -2865,7 +2865,7 @@ BotSpell Bot::GetBestBotSpellForCharm(Bot* caster, Mob* target, uint16 spell_typ
result.ManaCost = 0; result.ManaCost = 0;
if (caster) { if (caster) {
std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SE_Charm); std::list<BotSpell> bot_spell_list = GetBotSpellsForSpellEffect(caster, spell_type, SpellEffect::Charm);
for (std::list<BotSpell>::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) { for (std::list<BotSpell>::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) {
if ( if (
+45 -28
View File
@@ -1103,6 +1103,8 @@ bool Client::Save(uint8 iCommitNow) {
database.SaveCharacterEXPModifier(this); database.SaveCharacterEXPModifier(this);
database.SaveStatCaps(this);
if (RuleB(Bots, Enabled)) { if (RuleB(Bots, Enabled)) {
database.botdb.SaveBotSettings(this); database.botdb.SaveBotSettings(this);
} }
@@ -1391,7 +1393,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
} }
case ChatChannel_Shout: { /* Shout */ case ChatChannel_Shout: { /* Shout */
Mob *sender = this; Mob *sender = this;
if (GetPet() && GetTarget() == GetPet() && GetPet()->FindType(SE_VoiceGraft)) if (GetPet() && GetTarget() == GetPet() && GetPet()->FindType(SpellEffect::VoiceGraft))
sender = GetPet(); sender = GetPet();
entity_list.ChannelMessage(sender, chan_num, language, lang_skill, message); entity_list.ChannelMessage(sender, chan_num, language, lang_skill, message);
@@ -1429,7 +1431,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
else if(!RuleB(Chat, ServerWideAuction)) { else if(!RuleB(Chat, ServerWideAuction)) {
Mob *sender = this; Mob *sender = this;
if (GetPet() && GetTarget() == GetPet() && GetPet()->FindType(SE_VoiceGraft)) if (GetPet() && GetTarget() == GetPet() && GetPet()->FindType(SpellEffect::VoiceGraft))
sender = GetPet(); sender = GetPet();
entity_list.ChannelMessage(sender, chan_num, language, lang_skill, message); entity_list.ChannelMessage(sender, chan_num, language, lang_skill, message);
@@ -1476,7 +1478,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
{ {
Mob *sender = this; Mob *sender = this;
if (GetPet() && GetTarget() == GetPet() && GetPet()->FindType(SE_VoiceGraft)) if (GetPet() && GetTarget() == GetPet() && GetPet()->FindType(SpellEffect::VoiceGraft))
sender = GetPet(); sender = GetPet();
entity_list.ChannelMessage(sender, chan_num, language, lang_skill, message); entity_list.ChannelMessage(sender, chan_num, language, lang_skill, message);
@@ -1606,7 +1608,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
} }
Mob* sender = this; Mob* sender = this;
if (GetPet() && GetTarget() == GetPet() && GetPet()->FindType(SE_VoiceGraft)) { if (GetPet() && GetTarget() == GetPet() && GetPet()->FindType(SpellEffect::VoiceGraft)) {
sender = GetPet(); sender = GetPet();
} }
@@ -4780,9 +4782,21 @@ bool Client::KeyRingClear()
); );
} }
void Client::KeyRingList() void Client::KeyRingList(Client* c)
{ {
Message(Chat::LightBlue, "Keys on Keyring:"); if (!c) {
return;
}
std::string message = "Keys on Keyring:";
if (c != this) {
message = fmt::format(
"Keys on Keyring for {}:",
GetCleanName()
);
}
c->Message(Chat::LightBlue, message.c_str());
const EQ::ItemData *item = nullptr; const EQ::ItemData *item = nullptr;
@@ -4795,7 +4809,7 @@ void Client::KeyRingList()
item->Name item->Name
); );
Message(Chat::LightBlue, item_string.c_str()); c->Message(Chat::LightBlue, item_string.c_str());
} }
} }
} }
@@ -6403,17 +6417,17 @@ void Client::SuspendMinion(int value)
// TODO: These pet command states need to be synced ... // TODO: These pet command states need to be synced ...
// Will just fix them for now // Will just fix them for now
if (m_ClientVersionBit & EQ::versions::maskUFAndLater) { if (m_ClientVersionBit & EQ::versions::maskUFAndLater) {
SetPetCommandState(PET_BUTTON_SIT, 0); SetPetCommandState(PetButton::Sit, PetButtonState::Off);
SetPetCommandState(PET_BUTTON_STOP, 0); SetPetCommandState(PetButton::Stop, PetButtonState::Off);
SetPetCommandState(PET_BUTTON_REGROUP, 0); SetPetCommandState(PetButton::Regroup, PetButtonState::Off);
SetPetCommandState(PET_BUTTON_FOLLOW, 1); SetPetCommandState(PetButton::Follow, PetButtonState::On);
SetPetCommandState(PET_BUTTON_GUARD, 0); SetPetCommandState(PetButton::Guard, PetButtonState::Off);
// Taunt saved on client side for logging on with pet // Taunt saved on client side for logging on with pet
// In our db for when we zone. // In our db for when we zone.
SetPetCommandState(PET_BUTTON_HOLD, 0); SetPetCommandState(PetButton::Hold, PetButtonState::Off);
SetPetCommandState(PET_BUTTON_GHOLD, 0); SetPetCommandState(PetButton::GreaterHold, PetButtonState::Off);
SetPetCommandState(PET_BUTTON_FOCUS, 0); SetPetCommandState(PetButton::Focus, PetButtonState::Off);
SetPetCommandState(PET_BUTTON_SPELLHOLD, 0); SetPetCommandState(PetButton::SpellHold, PetButtonState::Off);
} }
} }
else else
@@ -6894,9 +6908,9 @@ void Client::CheckLDoNHail(NPC* n)
auto pet = GetPet(); auto pet = GetPet();
if (pet) { if (pet) {
if (pet->GetPetType() == petCharmed) { if (pet->GetPetType() == PetType::Charmed) {
pet->BuffFadeByEffect(SE_Charm); pet->BuffFadeByEffect(SpellEffect::Charm);
} else if (pet->GetPetType() == petNPCFollow) { } else if (pet->GetPetType() == PetType::Follow) {
pet->SetOwnerID(0); pet->SetOwnerID(0);
} else { } else {
pet->Depop(); pet->Depop();
@@ -8433,7 +8447,7 @@ void Client::MerchantRejectMessage(Mob *merchant, int primaryfaction)
merchant->SayString(zone->random.Int(WONT_SELL_DEEDS1, WONT_SELL_DEEDS6)); merchant->SayString(zone->random.Int(WONT_SELL_DEEDS1, WONT_SELL_DEEDS6));
} else if (lowestvalue == fmod.race_mod) { // race biggest } else if (lowestvalue == fmod.race_mod) { // race biggest
// Non-standard race (ex. illusioned to wolf) // Non-standard race (ex. illusioned to wolf)
if (GetRace() > PLAYER_RACE_COUNT) { if (!IsPlayerRace(GetRace())) {
messageid = zone->random.Int(1, 3); // these aren't sequential StringIDs :( messageid = zone->random.Int(1, 3); // these aren't sequential StringIDs :(
switch (messageid) { switch (messageid) {
case 1: case 1:
@@ -9438,12 +9452,15 @@ void Client::ProcessAggroMeter()
} }
} }
void Client::SetPetCommandState(int button, int state) void Client::SetPetCommandState(uint8 button, uint8 state)
{ {
auto app = new EQApplicationPacket(OP_PetCommandState, sizeof(PetCommandState_Struct)); auto app = new EQApplicationPacket(OP_PetCommandState, sizeof(PetCommandState_Struct));
auto pcs = (PetCommandState_Struct *)app->pBuffer;
pcs->button_id = button; auto s = (PetCommandState_Struct*) app->pBuffer;
pcs->state = state;
s->button_id = button;
s->state = state;
FastQueuePacket(&app); FastQueuePacket(&app);
} }
@@ -10643,7 +10660,7 @@ void Client::MovePCDynamicZone(const std::string& zone_name, int zone_version, b
} }
void Client::Fling(float value, float target_x, float target_y, float target_z, bool ignore_los, bool clip_through_walls, bool calculate_speed) { void Client::Fling(float value, float target_x, float target_y, float target_z, bool ignore_los, bool clip_through_walls, bool calculate_speed) {
BuffFadeByEffect(SE_Levitate); BuffFadeByEffect(SpellEffect::Levitate);
if (CheckLosFN(target_x, target_y, target_z, 6.0f) || ignore_los) { if (CheckLosFN(target_x, target_y, target_z, 6.0f) || ignore_los) {
auto p = new EQApplicationPacket(OP_Fling, sizeof(fling_struct)); auto p = new EQApplicationPacket(OP_Fling, sizeof(fling_struct));
auto* f = (fling_struct*) p->pBuffer; auto* f = (fling_struct*) p->pBuffer;
@@ -10708,7 +10725,7 @@ std::vector<int> Client::GetLearnableDisciplines(uint8 min_level, uint8 max_leve
continue; continue;
} }
if (RuleB(Spells, UseCHAScribeHack) && spells[spell_id].effect_id[EFFECT_COUNT - 1] == SE_CHA) { if (RuleB(Spells, UseCHAScribeHack) && spells[spell_id].effect_id[EFFECT_COUNT - 1] == SpellEffect::CHA) {
continue; continue;
} }
@@ -10779,7 +10796,7 @@ std::vector<int> Client::GetScribeableSpells(uint8 min_level, uint8 max_level) {
continue; continue;
} }
if (RuleB(Spells, UseCHAScribeHack) && spells[spell_id].effect_id[EFFECT_COUNT - 1] == SE_CHA) { if (RuleB(Spells, UseCHAScribeHack) && spells[spell_id].effect_id[EFFECT_COUNT - 1] == SpellEffect::CHA) {
continue; continue;
} }
@@ -11421,7 +11438,7 @@ void Client::SummonBaggedItems(uint32 bag_item_id, const std::vector<LootItem>&
return; return;
} }
// todo: maybe some common functions for SE_SummonItem and SE_SummonItemIntoBag // todo: maybe some common functions for SpellEffect::SummonItem and SpellEffect::SummonItemIntoBag
const EQ::ItemData* bag_item = database.GetItem(bag_item_id); const EQ::ItemData* bag_item = database.GetItem(bag_item_id);
if (!bag_item) if (!bag_item)
+3 -2
View File
@@ -326,12 +326,13 @@ public:
void TraderStartTrader(const EQApplicationPacket *app); void TraderStartTrader(const EQApplicationPacket *app);
// void TraderPriceUpdate(const EQApplicationPacket *app); // void TraderPriceUpdate(const EQApplicationPacket *app);
uint8 WithCustomer(uint16 NewCustomer); uint8 WithCustomer(uint16 NewCustomer);
std::vector<uint32> GetKeyRing() { return keyring; }
void KeyRingLoad(); void KeyRingLoad();
bool KeyRingAdd(uint32 item_id); bool KeyRingAdd(uint32 item_id);
bool KeyRingCheck(uint32 item_id); bool KeyRingCheck(uint32 item_id);
bool KeyRingClear(); bool KeyRingClear();
bool KeyRingRemove(uint32 item_id); bool KeyRingRemove(uint32 item_id);
void KeyRingList(); void KeyRingList(Client* c = nullptr);
bool IsNameChangeAllowed(); bool IsNameChangeAllowed();
void InvokeChangeNameWindow(bool immediate = true); void InvokeChangeNameWindow(bool immediate = true);
bool ClearNameChange(); bool ClearNameChange();
@@ -523,7 +524,7 @@ public:
inline const InspectMessage_Struct& GetInspectMessage() const { return m_inspect_message; } inline const InspectMessage_Struct& GetInspectMessage() const { return m_inspect_message; }
void ReloadExpansionProfileSetting(); void ReloadExpansionProfileSetting();
void SetPetCommandState(int button, int state); void SetPetCommandState(uint8 button, uint8 state);
bool AutoAttackEnabled() const { return auto_attack; } bool AutoAttackEnabled() const { return auto_attack; }
bool AutoFireEnabled() const { return auto_fire; } bool AutoFireEnabled() const { return auto_fire; }
+107 -106
View File
@@ -32,23 +32,24 @@
int32 Client::GetMaxStat() const int32 Client::GetMaxStat() const
{ {
if ((RuleI(Character, StatCap)) > 0) { int character_cap = GetStatCap(StatCap::Stat);
return (RuleI(Character, StatCap)); if (character_cap > 0) {
return character_cap;
} }
int level = GetLevel();
int32 base = 0; uint8 level = GetLevel();
int base = 0;
if (level < 61) { if (level < 61) {
base = 255; base = 255;
} } else if (ClientVersion() >= EQ::versions::ClientVersion::SoF) {
else if (ClientVersion() >= EQ::versions::ClientVersion::SoF) {
base = 255 + 5 * (level - 60); base = 255 + 5 * (level - 60);
} } else if (level < 71) {
else if (level < 71) {
base = 255 + 5 * (level - 60); base = 255 + 5 * (level - 60);
} } else {
else {
base = 330; base = 330;
} }
return base; return base;
} }
@@ -300,7 +301,7 @@ int64 Client::CalcHPRegen(bool bCombat)
int64 Client::CalcHPRegenCap() int64 Client::CalcHPRegenCap()
{ {
int64 cap = RuleI(Character, ItemHealthRegenCap); int64 cap = GetStatCap(StatCap::HealthRegen);
if (GetLevel() > 60) { if (GetLevel() > 60) {
cap = std::max(cap, static_cast<int64>(GetLevel() - 30)); // if the rule is set greater than normal I guess cap = std::max(cap, static_cast<int64>(GetLevel() - 30)); // if the rule is set greater than normal I guess
} }
@@ -693,7 +694,7 @@ int64 Client::CalcManaRegen(bool bCombat)
} }
regen += aabonuses.ManaRegen; regen += aabonuses.ManaRegen;
// add in + 1 bonus for SE_CompleteHeal, but we don't do anything for it yet? // add in + 1 bonus for SpellEffect::CompleteHeal, but we don't do anything for it yet?
int item_bonus = itembonuses.ManaRegen; // this is capped already int item_bonus = itembonuses.ManaRegen; // this is capped already
item_bonus += itembonuses.heroic_mana_regen; item_bonus += itembonuses.heroic_mana_regen;
@@ -717,7 +718,7 @@ int64 Client::CalcManaRegen(bool bCombat)
int64 Client::CalcManaRegenCap() int64 Client::CalcManaRegenCap()
{ {
int64 cap = RuleI(Character, ItemManaRegenCap) + aabonuses.ItemManaRegenCap + itembonuses.ItemManaRegenCap + spellbonuses.ItemManaRegenCap; int64 cap = GetStatCap(StatCap::ManaRegen) + aabonuses.ItemManaRegenCap + itembonuses.ItemManaRegenCap + spellbonuses.ItemManaRegenCap;
return (cap * RuleI(Character, ManaRegenMultiplier) / 100); return (cap * RuleI(Character, ManaRegenMultiplier) / 100);
} }
@@ -976,7 +977,7 @@ int Client::CalcHaste()
} }
// 60+ 100, 51-59 85, 1-50 level+25 // 60+ 100, 51-59 85, 1-50 level+25
if (level > 59 || RuleB(Character, IgnoreLevelBasedHasteCaps)) { // 60+ if (level > 59 || RuleB(Character, IgnoreLevelBasedHasteCaps)) { // 60+
cap = RuleI(Character, HasteCap); cap = GetStatCap(StatCap::Haste);
} }
else if (level > 50) { // 51-59 else if (level > 50) { // 51-59
cap = 85; cap = 85;
@@ -989,7 +990,7 @@ int Client::CalcHaste()
} }
// 51+ 25 (despite there being higher spells...), 1-50 10 // 51+ 25 (despite there being higher spells...), 1-50 10
if (level > 50 || RuleB(Character, IgnoreLevelBasedHasteCaps)) { // 51+ if (level > 50 || RuleB(Character, IgnoreLevelBasedHasteCaps)) { // 51+
cap = RuleI(Character, Hastev3Cap); cap = GetStatCap(StatCap::HasteV3);
if (spellbonuses.hastetype3 > cap) { if (spellbonuses.hastetype3 > cap) {
h += cap; h += cap;
} else { } else {
@@ -1011,52 +1012,52 @@ int32 Client::CalcMR()
{ {
//racial bases //racial bases
switch (GetBaseRace()) { switch (GetBaseRace()) {
case HUMAN: case Race::Human:
MR = 25; MR = 25;
break; break;
case BARBARIAN: case Race::Barbarian:
MR = 25; MR = 25;
break; break;
case ERUDITE: case Race::Erudite:
MR = 30; MR = 30;
break; break;
case WOOD_ELF: case Race::WoodElf:
MR = 25; MR = 25;
break; break;
case HIGH_ELF: case Race::HighElf:
MR = 25; MR = 25;
break; break;
case DARK_ELF: case Race::DarkElf:
MR = 25; MR = 25;
break; break;
case HALF_ELF: case Race::HalfElf:
MR = 25; MR = 25;
break; break;
case DWARF: case Race::Dwarf:
MR = 30; MR = 30;
break; break;
case TROLL: case Race::Troll:
MR = 25; MR = 25;
break; break;
case OGRE: case Race::Ogre:
MR = 25; MR = 25;
break; break;
case HALFLING: case Race::Halfling:
MR = 25; MR = 25;
break; break;
case GNOME: case Race::Gnome:
MR = 25; MR = 25;
break; break;
case IKSAR: case Race::Iksar:
MR = 25; MR = 25;
break; break;
case VAHSHIR: case Race::VahShir:
MR = 25; MR = 25;
break; break;
case FROGLOK: case Race::Froglok2:
MR = 30; MR = 30;
break; break;
case DRAKKIN: case Race::Drakkin:
{ {
MR = 25; MR = 25;
if (GetDrakkinHeritage() == 2) if (GetDrakkinHeritage() == 2)
@@ -1085,52 +1086,52 @@ int32 Client::CalcFR()
{ {
//racial bases //racial bases
switch (GetBaseRace()) { switch (GetBaseRace()) {
case HUMAN: case Race::Human:
FR = 25; FR = 25;
break; break;
case BARBARIAN: case Race::Barbarian:
FR = 25; FR = 25;
break; break;
case ERUDITE: case Race::Erudite:
FR = 25; FR = 25;
break; break;
case WOOD_ELF: case Race::WoodElf:
FR = 25; FR = 25;
break; break;
case HIGH_ELF: case Race::HighElf:
FR = 25; FR = 25;
break; break;
case DARK_ELF: case Race::DarkElf:
FR = 25; FR = 25;
break; break;
case HALF_ELF: case Race::HalfElf:
FR = 25; FR = 25;
break; break;
case DWARF: case Race::Dwarf:
FR = 25; FR = 25;
break; break;
case TROLL: case Race::Troll:
FR = 5; FR = 5;
break; break;
case OGRE: case Race::Ogre:
FR = 25; FR = 25;
break; break;
case HALFLING: case Race::Halfling:
FR = 25; FR = 25;
break; break;
case GNOME: case Race::Gnome:
FR = 25; FR = 25;
break; break;
case IKSAR: case Race::Iksar:
FR = 30; FR = 30;
break; break;
case VAHSHIR: case Race::VahShir:
FR = 25; FR = 25;
break; break;
case FROGLOK: case Race::Froglok2:
FR = 25; FR = 25;
break; break;
case DRAKKIN: case Race::Drakkin:
{ {
FR = 25; FR = 25;
if (GetDrakkinHeritage() == 0) if (GetDrakkinHeritage() == 0)
@@ -1171,52 +1172,52 @@ int32 Client::CalcDR()
{ {
//racial bases //racial bases
switch (GetBaseRace()) { switch (GetBaseRace()) {
case HUMAN: case Race::Human:
DR = 15; DR = 15;
break; break;
case BARBARIAN: case Race::Barbarian:
DR = 15; DR = 15;
break; break;
case ERUDITE: case Race::Erudite:
DR = 10; DR = 10;
break; break;
case WOOD_ELF: case Race::WoodElf:
DR = 15; DR = 15;
break; break;
case HIGH_ELF: case Race::HighElf:
DR = 15; DR = 15;
break; break;
case DARK_ELF: case Race::DarkElf:
DR = 15; DR = 15;
break; break;
case HALF_ELF: case Race::HalfElf:
DR = 15; DR = 15;
break; break;
case DWARF: case Race::Dwarf:
DR = 15; DR = 15;
break; break;
case TROLL: case Race::Troll:
DR = 15; DR = 15;
break; break;
case OGRE: case Race::Ogre:
DR = 15; DR = 15;
break; break;
case HALFLING: case Race::Halfling:
DR = 20; DR = 20;
break; break;
case GNOME: case Race::Gnome:
DR = 15; DR = 15;
break; break;
case IKSAR: case Race::Iksar:
DR = 15; DR = 15;
break; break;
case VAHSHIR: case Race::VahShir:
DR = 15; DR = 15;
break; break;
case FROGLOK: case Race::Froglok2:
DR = 15; DR = 15;
break; break;
case DRAKKIN: case Race::Drakkin:
{ {
DR = 15; DR = 15;
if (GetDrakkinHeritage() == 1) if (GetDrakkinHeritage() == 1)
@@ -1263,52 +1264,52 @@ int32 Client::CalcPR()
{ {
//racial bases //racial bases
switch (GetBaseRace()) { switch (GetBaseRace()) {
case HUMAN: case Race::Human:
PR = 15; PR = 15;
break; break;
case BARBARIAN: case Race::Barbarian:
PR = 15; PR = 15;
break; break;
case ERUDITE: case Race::Erudite:
PR = 15; PR = 15;
break; break;
case WOOD_ELF: case Race::WoodElf:
PR = 15; PR = 15;
break; break;
case HIGH_ELF: case Race::HighElf:
PR = 15; PR = 15;
break; break;
case DARK_ELF: case Race::DarkElf:
PR = 15; PR = 15;
break; break;
case HALF_ELF: case Race::HalfElf:
PR = 15; PR = 15;
break; break;
case DWARF: case Race::Dwarf:
PR = 20; PR = 20;
break; break;
case TROLL: case Race::Troll:
PR = 15; PR = 15;
break; break;
case OGRE: case Race::Ogre:
PR = 15; PR = 15;
break; break;
case HALFLING: case Race::Halfling:
PR = 20; PR = 20;
break; break;
case GNOME: case Race::Gnome:
PR = 15; PR = 15;
break; break;
case IKSAR: case Race::Iksar:
PR = 15; PR = 15;
break; break;
case VAHSHIR: case Race::VahShir:
PR = 15; PR = 15;
break; break;
case FROGLOK: case Race::Froglok2:
PR = 30; PR = 30;
break; break;
case DRAKKIN: case Race::Drakkin:
{ {
PR = 15; PR = 15;
if (GetDrakkinHeritage() == 3) if (GetDrakkinHeritage() == 3)
@@ -1355,52 +1356,52 @@ int32 Client::CalcCR()
{ {
//racial bases //racial bases
switch (GetBaseRace()) { switch (GetBaseRace()) {
case HUMAN: case Race::Human:
CR = 25; CR = 25;
break; break;
case BARBARIAN: case Race::Barbarian:
CR = 35; CR = 35;
break; break;
case ERUDITE: case Race::Erudite:
CR = 25; CR = 25;
break; break;
case WOOD_ELF: case Race::WoodElf:
CR = 25; CR = 25;
break; break;
case HIGH_ELF: case Race::HighElf:
CR = 25; CR = 25;
break; break;
case DARK_ELF: case Race::DarkElf:
CR = 25; CR = 25;
break; break;
case HALF_ELF: case Race::HalfElf:
CR = 25; CR = 25;
break; break;
case DWARF: case Race::Dwarf:
CR = 25; CR = 25;
break; break;
case TROLL: case Race::Troll:
CR = 25; CR = 25;
break; break;
case OGRE: case Race::Ogre:
CR = 25; CR = 25;
break; break;
case HALFLING: case Race::Halfling:
CR = 25; CR = 25;
break; break;
case GNOME: case Race::Gnome:
CR = 25; CR = 25;
break; break;
case IKSAR: case Race::Iksar:
CR = 15; CR = 15;
break; break;
case VAHSHIR: case Race::VahShir:
CR = 25; CR = 25;
break; break;
case FROGLOK: case Race::Froglok2:
CR = 25; CR = 25;
break; break;
case DRAKKIN: case Race::Drakkin:
{ {
CR = 25; CR = 25;
if (GetDrakkinHeritage() == 4) if (GetDrakkinHeritage() == 4)
@@ -1482,24 +1483,24 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id)
Bard Spell Effects Bard Spell Effects
Mod uses the highest bonus from either of these for each instrument Mod uses the highest bonus from either of these for each instrument
SPA 179 SE_AllInstrumentMod is used for instrument spellbonus.______Mod. This applies to ALL instrument mods (Puretones Discipline) SPA 179 SpellEffect::AllInstrumentMod is used for instrument spellbonus.______Mod. This applies to ALL instrument mods (Puretones Discipline)
SPA 260 SE_AddSingingMod is used for instrument spellbonus.______Mod. This applies to indiviual instrument mods. (Instrument mastery AA) SPA 260 SpellEffect::AddSingingMod is used for instrument spellbonus.______Mod. This applies to indiviual instrument mods. (Instrument mastery AA)
-Example usage: From AA a value of 4 = 40% -Example usage: From AA a value of 4 = 40%
SPA 118 SE_Amplification is a stackable singing mod, on live it exists as both spell and AA bonus (stackable) SPA 118 SpellEffect::Amplification is a stackable singing mod, on live it exists as both spell and AA bonus (stackable)
- Live Behavior: Amplifcation can be modified by singing mods and amplification itself, thus on the second cast of Amplification you will recieve - Live Behavior: Amplifcation can be modified by singing mods and amplification itself, thus on the second cast of Amplification you will recieve
the mod from the first cast, this continues until you reach the song mod cap. the mod from the first cast, this continues until you reach the song mod cap.
SPA 261 SE_SongModCap raises song focus cap (No longer used on live) SPA 261 SpellEffect::SongModCap raises song focus cap (No longer used on live)
SPA 270 SE_BardSongRange increase range of beneficial bard songs (Sionachie's Crescendo) SPA 270 SpellEffect::BardSongRange increase range of beneficial bard songs (Sionachie's Crescendo)
SPA 413 SE_FcBaseEffects focus effect that replaced item instrument mods SPA 413 SpellEffect::FcBaseEffects focus effect that replaced item instrument mods
Issues 10-15-21: Issues 10-15-21:
Bonuses are not applied, unless song is stopped and restarted due to pulse keeping it continues. -> Need to recode songs to recast when duration ends. Bonuses are not applied, unless song is stopped and restarted due to pulse keeping it continues. -> Need to recode songs to recast when duration ends.
Formula Live Bards: Formula Live Bards:
mod = (10 + (aabonus.____Mod [SPA 260 AA Instrument Mastery]) + (SE_FcBaseEffect[SPA 413])/10 + (spellbonus.______Mod [SPA 179 Puretone Disc]) + (Amplication [SPA 118])/10 mod = (10 + (aabonus.____Mod [SPA 260 AA Instrument Mastery]) + (SpellEffect::FcBaseEffect[SPA 413])/10 + (spellbonus.______Mod [SPA 179 Puretone Disc]) + (Amplication [SPA 118])/10
TODO: Spell Table Fields that need to be implemented TODO: Spell Table Fields that need to be implemented
Field 225 //float base_effects_focus_slope; // -- BASE_EFFECTS_FOCUS_SLOPE Field 225 //float base_effects_focus_slope; // -- BASE_EFFECTS_FOCUS_SLOPE
@@ -1567,7 +1568,7 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id)
else else
effectmod = spellbonuses.singingMod; effectmod = spellbonuses.singingMod;
if (IsBardSong(spell_id)) if (IsBardSong(spell_id))
effectmod += aabonuses.singingMod + (spellbonuses.Amplification + itembonuses.Amplification + aabonuses.Amplification); //SPA 118 SE_Amplification effectmod += aabonuses.singingMod + (spellbonuses.Amplification + itembonuses.Amplification + aabonuses.Amplification); //SPA 118 SpellEffect::Amplification
break; break;
default: default:
effectmod = 10; effectmod = 10;
@@ -1584,7 +1585,7 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id)
if (effectmodcap) { if (effectmodcap) {
effectmodcap += aabonuses.songModCap + spellbonuses.songModCap + itembonuses.songModCap; //SPA 261 SE_SongModCap (not used on live) effectmodcap += aabonuses.songModCap + spellbonuses.songModCap + itembonuses.songModCap; //SPA 261 SpellEffect::SongModCap (not used on live)
//Incase a negative modifier is used. //Incase a negative modifier is used.
if (effectmodcap <= 0) { if (effectmodcap <= 0) {
@@ -1745,13 +1746,13 @@ int64 Client::CalcEnduranceRegen(bool bCombat)
int64 Client::CalcEnduranceRegenCap() int64 Client::CalcEnduranceRegenCap()
{ {
int64 cap = RuleI(Character, ItemEnduranceRegenCap) + aabonuses.ItemEnduranceRegenCap + itembonuses.ItemEnduranceRegenCap + spellbonuses.ItemEnduranceRegenCap; int64 cap = GetStatCap(StatCap::EnduranceRegen) + aabonuses.ItemEnduranceRegenCap + itembonuses.ItemEnduranceRegenCap + spellbonuses.ItemEnduranceRegenCap;
return (cap * RuleI(Character, EnduranceRegenMultiplier) / 100); return (cap * RuleI(Character, EnduranceRegenMultiplier) / 100);
} }
int32 Client::CalcItemATKCap() int32 Client::CalcItemATKCap()
{ {
int cap = RuleI(Character, ItemATKCap) + itembonuses.ItemATKCap + spellbonuses.ItemATKCap + aabonuses.ItemATKCap; int cap = GetStatCap(StatCap::Attack) + itembonuses.ItemATKCap + spellbonuses.ItemATKCap + aabonuses.ItemATKCap;
return cap; return cap;
} }
+786 -518
View File
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -561,6 +561,10 @@ bool Client::Process() {
{ {
ItemTimerCheck(); ItemTimerCheck();
} }
if (m_clear_wearchange_cache_timer.Check()) {
m_last_seen_wearchange.clear();
}
} }
} }
@@ -1644,7 +1648,7 @@ void Client::OPGMTraining(const EQApplicationPacket *app)
//#pragma GCC push_options //#pragma GCC push_options
//#pragma GCC optimize ("O0") //#pragma GCC optimize ("O0")
for (int sk = EQ::skills::Skill1HBlunt; sk <= EQ::skills::HIGHEST_SKILL; ++sk) { for (int sk = EQ::skills::Skill1HBlunt; sk <= EQ::skills::HIGHEST_SKILL; ++sk) {
if (sk == EQ::skills::SkillTinkering && GetRace() != GNOME) { if (sk == EQ::skills::SkillTinkering && GetRace() != Race::Gnome) {
gmtrain->skills[sk] = 0; //Non gnomes can't tinker! gmtrain->skills[sk] = 0; //Non gnomes can't tinker!
} else { } else {
gmtrain->skills[sk] = GetMaxSkillAfterSpecializationRules((EQ::skills::SkillType)sk, MaxSkill((EQ::skills::SkillType)sk, GetClass(), RuleI(Character, MaxLevel))); gmtrain->skills[sk] = GetMaxSkillAfterSpecializationRules((EQ::skills::SkillType)sk, MaxSkill((EQ::skills::SkillType)sk, GetClass(), RuleI(Character, MaxLevel)));
+46 -104
View File
@@ -3,6 +3,7 @@
#include "../common/types.h" #include "../common/types.h"
#include "../common/spdat.h" #include "../common/spdat.h"
#include "../common/emu_constants.h"
#include <cereal/cereal.hpp> #include <cereal/cereal.hpp>
@@ -45,55 +46,6 @@ namespace Archetype {
//Maximum distance from a zone point if zone was specified //Maximum distance from a zone point if zone was specified
#define ZONEPOINT_ZONE_RANGE 40000.0f #define ZONEPOINT_ZONE_RANGE 40000.0f
// Defines based on the RoF2 Client
#define PET_HEALTHREPORT 0 // 0x00 - /pet health or Pet Window
#define PET_LEADER 1 // 0x01 - /pet leader or Pet Window
#define PET_ATTACK 2 // 0x02 - /pet attack or Pet Window
#define PET_QATTACK 3 // 0x03 - /pet qattack or Pet Window
#define PET_FOLLOWME 4 // 0x04 - /pet follow or Pet Window
#define PET_GUARDHERE 5 // 0x05 - /pet guard or Pet Window
#define PET_SIT 6 // 0x06 - /pet sit or Pet Window
#define PET_SITDOWN 7 // 0x07 - /pet sit on
#define PET_STANDUP 8 // 0x08 - /pet sit off
#define PET_STOP 9 // 0x09 - /pet stop or Pet Window - Not implemented
#define PET_STOP_ON 10 // 0x0a - /pet stop on - Not implemented
#define PET_STOP_OFF 11 // 0x0b - /pet stop off - Not implemented
#define PET_TAUNT 12 // 0x0c - /pet taunt or Pet Window
#define PET_TAUNT_ON 13 // 0x0d - /pet taunt on
#define PET_TAUNT_OFF 14 // 0x0e - /pet taunt off
#define PET_HOLD 15 // 0x0f - /pet hold or Pet Window, won't add to hate list unless attacking
#define PET_HOLD_ON 16 // 0x10 - /pet hold on
#define PET_HOLD_OFF 17 // 0x11 - /pet hold off
#define PET_GHOLD 18 // 0x12 - /pet ghold, will never add to hate list unless told to
#define PET_GHOLD_ON 19 // 0x13 - /pet ghold on
#define PET_GHOLD_OFF 20 // 0x14 - /pet ghold off
#define PET_SPELLHOLD 21 // 0x15 - /pet no cast or /pet spellhold or Pet Window
#define PET_SPELLHOLD_ON 22 // 0x16 - /pet spellhold on
#define PET_SPELLHOLD_OFF 23 // 0x17 - /pet spellhold off
#define PET_FOCUS 24 // 0x18 - /pet focus or Pet Window
#define PET_FOCUS_ON 25 // 0x19 - /pet focus on
#define PET_FOCUS_OFF 26 // 0x1a - /pet focus off
#define PET_FEIGN 27 // 0x1b - /pet feign
#define PET_BACKOFF 28 // 0x1c - /pet back off
#define PET_GETLOST 29 // 0x1d - /pet get lost
#define PET_GUARDME 30 // 0x1e - Same as /pet follow, but different message in older clients - define not from client /pet target in modern clients but doesn't send packet
#define PET_REGROUP 31 // 0x1f - /pet regroup, acts like classic hold. Stops attack and moves back to guard/you but doesn't clear hate list
#define PET_REGROUP_ON 32 // 0x20 - /pet regroup on, turns on regroup
#define PET_REGROUP_OFF 33 // 0x21 - /pet regroup off, turns off regroup
#define PET_MAXCOMMANDS PET_REGROUP_OFF + 1
// can change the state of these buttons with a packet
#define PET_BUTTON_SIT 0
#define PET_BUTTON_STOP 1
#define PET_BUTTON_REGROUP 2
#define PET_BUTTON_FOLLOW 3
#define PET_BUTTON_GUARD 4
#define PET_BUTTON_TAUNT 5
#define PET_BUTTON_HOLD 6
#define PET_BUTTON_GHOLD 7
#define PET_BUTTON_FOCUS 8
#define PET_BUTTON_SPELLHOLD 9
#define AURA_HARDCAP 2 #define AURA_HARDCAP 2
#define WEAPON_STANCE_TYPE_MAX 2 #define WEAPON_STANCE_TYPE_MAX 2
@@ -101,50 +53,50 @@ namespace Archetype {
#define SHIELD_ABILITY_RECAST_TIME 180 #define SHIELD_ABILITY_RECAST_TIME 180
typedef enum { //focus types typedef enum { //focus types
focusSpellHaste = 1, //@Fc, SPA: 127, SE_IncreaseSpellHaste, On Caster, cast time mod pct, base: pct focusSpellHaste = 1, //@Fc, SPA: 127, SpellEffect::IncreaseSpellHaste, On Caster, cast time mod pct, base: pct
focusSpellDuration, //@Fc, SPA: 128, SE_IncreaseSpellDuration, On Caster, spell duration mod pct, base: pct focusSpellDuration, //@Fc, SPA: 128, SpellEffect::IncreaseSpellDuration, On Caster, spell duration mod pct, base: pct
focusRange, //@Fc, SPA: 129, SE_IncreaseRange, On Caster, spell range mod pct, base: pct focusRange, //@Fc, SPA: 129, SpellEffect::IncreaseRange, On Caster, spell range mod pct, base: pct
focusReagentCost, //@Fc, SPA: 131, SE_ReduceReagentCost, On Caster, do not consume reagent pct chance, base: min pct, limit: max pct focusReagentCost, //@Fc, SPA: 131, SpellEffect::ReduceReagentCost, On Caster, do not consume reagent pct chance, base: min pct, limit: max pct
focusManaCost, //@Fc, SPA: 132, SE_ReduceManaCost, On Caster, reduce mana cost by pct, base: min pct, limt: max pct focusManaCost, //@Fc, SPA: 132, SpellEffect::ReduceManaCost, On Caster, reduce mana cost by pct, base: min pct, limt: max pct
focusImprovedHeal, //@Fc, SPA: 125, SE_ImprovedHeal, On Caster, spell healing mod pct, base: min pct, limit: max pct focusImprovedHeal, //@Fc, SPA: 125, SpellEffect::ImprovedHeal, On Caster, spell healing mod pct, base: min pct, limit: max pct
focusImprovedDamage, //@Fc, SPA: 124, SE_ImprovedDamage, On Caster, spell damage mod pct, base: min pct, limit: max pct focusImprovedDamage, //@Fc, SPA: 124, SpellEffect::ImprovedDamage, On Caster, spell damage mod pct, base: min pct, limit: max pct
focusImprovedDamage2, //@Fc, SPA: 461, SE_ImprovedDamage2, On Caster, spell damage mod pct, base: min pct, limit: max pct focusImprovedDamage2, //@Fc, SPA: 461, SpellEffect::ImprovedDamage2, On Caster, spell damage mod pct, base: min pct, limit: max pct
focusFcDamagePctCrit, //@Fc, SPA: 302, SE_FcDamagePctCrit, On Caster, spell damage mod pct, base: min pct, limit: max pct focusFcDamagePctCrit, //@Fc, SPA: 302, SpellEffect::FcDamagePctCrit, On Caster, spell damage mod pct, base: min pct, limit: max pct
focusPetPower, //@Fc, SPA: 167, SE_PetPowerIncrease, On Caster, pet power mod, base: value focusPetPower, //@Fc, SPA: 167, SpellEffect::PetPowerIncrease, On Caster, pet power mod, base: value
focusResistRate, //@Fc, SPA: 126, SE_SpellResistReduction, On Caster, casted spell resist mod pct, base: min pct, limit: max pct focusResistRate, //@Fc, SPA: 126, SpellEffect::SpellResistReduction, On Caster, casted spell resist mod pct, base: min pct, limit: max pct
focusSpellHateMod, //@Fc, SPA: 130, SE_SpellHateMod, On Caster, spell hate mod pct, base: min pct, limit: max pct focusSpellHateMod, //@Fc, SPA: 130, SpellEffect::SpellHateMod, On Caster, spell hate mod pct, base: min pct, limit: max pct
focusTriggerOnCast, //@Fc, SPA: 339, SE_TriggerOnCast, On Caster, cast on spell use, base: chance pct limit: spellid focusTriggerOnCast, //@Fc, SPA: 339, SpellEffect::TriggerOnCast, On Caster, cast on spell use, base: chance pct limit: spellid
focusSpellVulnerability, //@Fc, SPA: 296, SE_FcSpellVulnerability, On Target, spell damage taken mod pct, base: min pct, limit: max pct focusSpellVulnerability, //@Fc, SPA: 296, SpellEffect::FcSpellVulnerability, On Target, spell damage taken mod pct, base: min pct, limit: max pct
focusFcSpellDamagePctIncomingPC, //@Fc, SPA: 483, SE_Fc_Spell_Damage_Pct_IncomingPC, On Target, spell damage taken mod pct, base: min pct, limit: max pct focusFcSpellDamagePctIncomingPC, //@Fc, SPA: 483, SpellEffect::Fc_Spell_Damage_Pct_IncomingPC, On Target, spell damage taken mod pct, base: min pct, limit: max pct
focusTwincast, //@Fc, SPA: 399, SE_FcTwincast, On Caster, chance cast spell twice, base: chance pct focusTwincast, //@Fc, SPA: 399, SpellEffect::FcTwincast, On Caster, chance cast spell twice, base: chance pct
focusSympatheticProc, //@Fc, SPA: 383, SE_SympatheticProc, On Caster, cast on spell use, base: variable proc chance on cast time, limit: spellid focusSympatheticProc, //@Fc, SPA: 383, SpellEffect::SympatheticProc, On Caster, cast on spell use, base: variable proc chance on cast time, limit: spellid
focusFcDamageAmt, //@Fc, SPA: 286, SE_FcDamageAmt, On Caster, spell damage mod flat amt, base: amt focusFcDamageAmt, //@Fc, SPA: 286, SpellEffect::FcDamageAmt, On Caster, spell damage mod flat amt, base: amt
focusFcDamageAmt2, //@Fc, SPA: 462, SE_FcDamageAmt2, On Caster, spell damage mod flat amt, base: amt focusFcDamageAmt2, //@Fc, SPA: 462, SpellEffect::FcDamageAmt2, On Caster, spell damage mod flat amt, base: amt
focusFcDamageAmtCrit, //@Fc, SPA: 303, SE_FFcDamageAmtCrit, On Caster, spell damage mod flat amt, base: amt focusFcDamageAmtCrit, //@Fc, SPA: 303, SpellEffect::FFcDamageAmtCrit, On Caster, spell damage mod flat amt, base: amt
focusSpellDurByTic, //@Fc, SPA: 287, SE_SpellDurationIncByTic, On Caster, spell buff duration mod, base: tics focusSpellDurByTic, //@Fc, SPA: 287, SpellEffect::SpellDurationIncByTic, On Caster, spell buff duration mod, base: tics
focusSwarmPetDuration, //@Fc, SPA: 398, SE_SwarmPetDuration, On Caster, swarm pet duration mod, base: milliseconds focusSwarmPetDuration, //@Fc, SPA: 398, SpellEffect::SwarmPetDuration, On Caster, swarm pet duration mod, base: milliseconds
focusReduceRecastTime, //@Fc, SPA: 310, SE_ReduceReuseTimer, On Caster, disc reuse time mod, base: milliseconds focusReduceRecastTime, //@Fc, SPA: 310, SpellEffect::ReduceReuseTimer, On Caster, disc reuse time mod, base: milliseconds
focusBlockNextSpell, //@Fc, SPA: 335, SE_BlockNextSpellFocus, On Caster, chance to block next spell, base: chance focusBlockNextSpell, //@Fc, SPA: 335, SpellEffect::BlockNextSpellFocus, On Caster, chance to block next spell, base: chance
focusFcHealPctIncoming, //@Fc, SPA: 393, SE_FcHealPctIncoming, On Target, heal received mod pct, base: pct focusFcHealPctIncoming, //@Fc, SPA: 393, SpellEffect::FcHealPctIncoming, On Target, heal received mod pct, base: pct
focusFcDamageAmtIncoming, //@Fc, SPA: 297, SE_FcDamageAmtIncoming, On Target, damage taken flat amt, base: amt focusFcDamageAmtIncoming, //@Fc, SPA: 297, SpellEffect::FcDamageAmtIncoming, On Target, damage taken flat amt, base: amt
focusFcSpellDamageAmtIncomingPC, //@Fc, SPA: 484, SE_Fc_Spell_Damage_Amt_IncomingPC, On Target, damage taken flat amt, base: amt focusFcSpellDamageAmtIncomingPC, //@Fc, SPA: 484, SpellEffect::Fc_Spell_Damage_Amt_IncomingPC, On Target, damage taken flat amt, base: amt
focusFcCastSpellOnLand, //@Fc, SPA: 481, SE_Fc_Cast_Spell_On_Land, On Target, cast spell if hit by spell, base: chance pct, limit: spellid focusFcCastSpellOnLand, //@Fc, SPA: 481, SpellEffect::Fc_Cast_Spell_On_Land, On Target, cast spell if hit by spell, base: chance pct, limit: spellid
focusFcHealAmtIncoming, //@Fc, SPA: 394, SE_FcHealAmtIncoming, On Target, heal received mod flat amt, base: amt focusFcHealAmtIncoming, //@Fc, SPA: 394, SpellEffect::FcHealAmtIncoming, On Target, heal received mod flat amt, base: amt
focusFcBaseEffects, //@Fc, SPA: 413, SE_FcBaseEffects, On Caster, base spell effectiveness mod pct, base: pct focusFcBaseEffects, //@Fc, SPA: 413, SpellEffect::FcBaseEffects, On Caster, base spell effectiveness mod pct, base: pct
focusIncreaseNumHits, //@Fc, SPA: 421, SE_FcIncreaseNumHits, On Caster, numhits mod flat amt, base: amt focusIncreaseNumHits, //@Fc, SPA: 421, SpellEffect::FcIncreaseNumHits, On Caster, numhits mod flat amt, base: amt
focusFcLimitUse, //@Fc, SPA: 420, SE_FcLimitUse, On Caster, numhits mod pct, base: pct focusFcLimitUse, //@Fc, SPA: 420, SpellEffect::FcLimitUse, On Caster, numhits mod pct, base: pct
focusFcMute, //@Fc, SPA: 357, SE_FcMute, On Caster, prevents spell casting, base: chance pct focusFcMute, //@Fc, SPA: 357, SpellEffect::FcMute, On Caster, prevents spell casting, base: chance pct
focusFcTimerRefresh, //@Fc, SPA: 389, SE_FcTimerRefresh, On Caster, reset spell recast timer, base: 1 focusFcTimerRefresh, //@Fc, SPA: 389, SpellEffect::FcTimerRefresh, On Caster, reset spell recast timer, base: 1
focusFcTimerLockout, //@Fc, SPA: 390, SE_FcTimerLockout, On Caster, set a spell to be on recast timer, base: recast duration milliseconds focusFcTimerLockout, //@Fc, SPA: 390, SpellEffect::FcTimerLockout, On Caster, set a spell to be on recast timer, base: recast duration milliseconds
focusFcStunTimeMod, //@Fc, SPA: 133, SE_FcStunTimeMod, On Caster, stun time mod pct, base: chance pct focusFcStunTimeMod, //@Fc, SPA: 133, SpellEffect::FcStunTimeMod, On Caster, stun time mod pct, base: chance pct
focusFcResistIncoming, //@Fc, SPA: 510, SE_Fc_Resist_Incoming, On Target, resist modifier, base: amt focusFcResistIncoming, //@Fc, SPA: 510, SpellEffect::Fc_Resist_Incoming, On Target, resist modifier, base: amt
focusFcAmplifyMod, //@Fc, SPA: 507, SE_Fc_Amplify_Mod, On Caster, damage-heal-dot mod pct, base: pct focusFcAmplifyMod, //@Fc, SPA: 507, SpellEffect::Fc_Amplify_Mod, On Caster, damage-heal-dot mod pct, base: pct
focusFcAmplifyAmt, //@Fc, SPA: 508, SE_Fc_Amplify_Amt, On Caster, damage-heal-dot mod flat amt, base: amt focusFcAmplifyAmt, //@Fc, SPA: 508, SpellEffect::Fc_Amplify_Amt, On Caster, damage-heal-dot mod flat amt, base: amt
focusFcCastTimeMod2, //@Fc, SPA: 500, SE_Fc_CastTimeMod2, On Caster, cast time mod pct, base: pct focusFcCastTimeMod2, //@Fc, SPA: 500, SpellEffect::Fc_CastTimeMod2, On Caster, cast time mod pct, base: pct
focusFcCastTimeAmt, //@Fc, SPA: 501, SE_Fc_CastTimeAmt, On Caster, cast time mod flat amt, base: milliseconds focusFcCastTimeAmt, //@Fc, SPA: 501, SpellEffect::Fc_CastTimeAmt, On Caster, cast time mod flat amt, base: milliseconds
focusFcHealPctCritIncoming, //@Fc, SPA: 395, SE_FcHealPctCritIncoming, On Target, spell healing mod pct, base: pct focusFcHealPctCritIncoming, //@Fc, SPA: 395, SpellEffect::FcHealPctCritIncoming, On Target, spell healing mod pct, base: pct
focusFcHealAmt, //@Fc, SPA: 392, SE_FcHealAmt, On Caster, spell healing mod flat amt, base: amt focusFcHealAmt, //@Fc, SPA: 392, SpellEffect::FcHealAmt, On Caster, spell healing mod flat amt, base: amt
focusFcHealAmtCrit, //@Fc, SPA: 396, SE_FcHealAmtCrit, On Caster, spell healing mod flat amt, base: amt focusFcHealAmtCrit, //@Fc, SPA: 396, SpellEffect::FcHealAmtCrit, On Caster, spell healing mod flat amt, base: amt
} focusType; //Any new FocusType needs to be added to the Mob::IsFocus function } focusType; //Any new FocusType needs to be added to the Mob::IsFocus function
#define HIGHEST_FOCUS focusFcHealAmtCrit //Should always be last focusType in enum #define HIGHEST_FOCUS focusFcHealAmtCrit //Should always be last focusType in enum
@@ -617,7 +569,7 @@ struct StatBonuses {
uint8 TradeSkillMastery; // Allow number of tradeskills to exceed 200 skill. uint8 TradeSkillMastery; // Allow number of tradeskills to exceed 200 skill.
int16 NoBreakAESneak; // Percent value int16 NoBreakAESneak; // Percent value
int16 FeignedCastOnChance; // Percent Value int16 FeignedCastOnChance; // Percent Value
bool PetCommands[PET_MAXCOMMANDS]; // SPA 267 bool PetCommands[PetCommand::Max]; // SPA 267
int FeignedMinionChance; // SPA 281 base1 = chance, just like normal FD int FeignedMinionChance; // SPA 281 base1 = chance, just like normal FD
int GrantForage; // affects max skill of forage as well as granting non-forage classes forage int GrantForage; // affects max skill of forage as well as granting non-forage classes forage
int aura_slots; int aura_slots;
@@ -781,16 +733,6 @@ enum {
GridRandomPath GridRandomPath
}; };
typedef enum {
petFamiliar, //only listens to /pet get lost
petAnimation, //does not listen to any commands
petOther,
petCharmed,
petNPCFollow,
petTargetLock, //remain active as long something is on the hatelist. Don't listen to any commands
petNone = 0xFF // not a pet
} PetType;
typedef enum { typedef enum {
SingleTarget, // causes effect to spell_target SingleTarget, // causes effect to spell_target
AETarget, // causes effect in aerange of target + target AETarget, // causes effect in aerange of target + target
+15
View File
@@ -1586,6 +1586,21 @@ void Corpse::LootCorpseItem(Client *c, const EQApplicationPacket *app)
} }
} }
if (parse->ZoneHasQuestSub(EVENT_LOOT_ZONE)) {
const auto &export_string = fmt::format(
"{} {} {} {}",
inst->GetItem()->ID,
inst->GetCharges(),
EntityList::RemoveNumbers(corpse_name),
GetID()
);
std::vector<std::any> args = {inst, this, c};
if (parse->EventZone(EVENT_LOOT_ZONE, zone, export_string, 0, &args) != 0) {
prevent_loot = true;
}
}
if (inst && PlayerEventLogs::Instance()->IsEventEnabled(PlayerEvent::LOOT_ITEM) && !IsPlayerCorpse()) { if (inst && PlayerEventLogs::Instance()->IsEventEnabled(PlayerEvent::LOOT_ITEM) && !IsPlayerCorpse()) {
auto e = PlayerEvent::LootItemEvent{ auto e = PlayerEvent::LootItemEvent{
.item_id = inst->GetItem()->ID, .item_id = inst->GetItem()->ID,
+6 -6
View File
@@ -263,7 +263,7 @@ int64 Mob::GetActDoTDamage(uint16 spell_id, int64 value, Mob* target, bool from_
chance += itembonuses.CriticalDoTChance + spellbonuses.CriticalDoTChance + aabonuses.CriticalDoTChance; chance += itembonuses.CriticalDoTChance + spellbonuses.CriticalDoTChance + aabonuses.CriticalDoTChance;
if (spellbonuses.CriticalDotDecay) if (spellbonuses.CriticalDotDecay)
chance += GetDecayEffectValue(spell_id, SE_CriticalDotDecay); chance += GetDecayEffectValue(spell_id, SpellEffect::CriticalDotDecay);
if (spells[spell_id].override_crit_chance > 0 && chance > spells[spell_id].override_crit_chance) if (spells[spell_id].override_crit_chance > 0 && chance > spells[spell_id].override_crit_chance)
chance = spells[spell_id].override_crit_chance; chance = spells[spell_id].override_crit_chance;
@@ -429,14 +429,14 @@ int64 Mob::GetActSpellHealing(uint16 spell_id, int64 value, Mob* target, bool fr
critical_chance += itembonuses.CriticalHealChance + spellbonuses.CriticalHealChance + aabonuses.CriticalHealChance; critical_chance += itembonuses.CriticalHealChance + spellbonuses.CriticalHealChance + aabonuses.CriticalHealChance;
if (spellbonuses.CriticalHealDecay) { if (spellbonuses.CriticalHealDecay) {
critical_chance += GetDecayEffectValue(spell_id, SE_CriticalHealDecay); critical_chance += GetDecayEffectValue(spell_id, SpellEffect::CriticalHealDecay);
} }
} }
else { else {
critical_chance = itembonuses.CriticalHealOverTime + spellbonuses.CriticalHealOverTime + aabonuses.CriticalHealOverTime; critical_chance = itembonuses.CriticalHealOverTime + spellbonuses.CriticalHealOverTime + aabonuses.CriticalHealOverTime;
if (spellbonuses.CriticalRegenDecay) { if (spellbonuses.CriticalRegenDecay) {
critical_chance += GetDecayEffectValue(spell_id, SE_CriticalRegenDecay); critical_chance += GetDecayEffectValue(spell_id, SpellEffect::CriticalRegenDecay);
} }
} }
@@ -596,7 +596,7 @@ int32 Mob::GetActSpellCost(uint16 spell_id, int32 cost)
if (buffs[buffSlot].spellid == 0 || buffs[buffSlot].spellid >= SPDAT_RECORDS) if (buffs[buffSlot].spellid == 0 || buffs[buffSlot].spellid >= SPDAT_RECORDS)
continue; continue;
if(IsEffectInSpell(buffs[buffSlot].spellid, SE_ReduceManaCost)) { if(IsEffectInSpell(buffs[buffSlot].spellid, SpellEffect::ReduceManaCost)) {
if(CalcFocusEffect(focusManaCost, buffs[buffSlot].spellid, spell_id) == 100) if(CalcFocusEffect(focusManaCost, buffs[buffSlot].spellid, spell_id) == 100)
cost = 1; cost = 1;
} }
@@ -1105,8 +1105,8 @@ void EntityList::AESpell(
IsTargetableAESpell(spell_id) && IsTargetableAESpell(spell_id) &&
is_detrimental_spell && is_detrimental_spell &&
!is_npc && !is_npc &&
!IsEffectInSpell(spell_id, SE_Lull) && !IsEffectInSpell(spell_id, SpellEffect::Lull) &&
!IsEffectInSpell(spell_id, SE_Mez) !IsEffectInSpell(spell_id, SpellEffect::Mez)
) { ) {
max_targets_allowed = RuleI(Spells, TargetedAOEMaxTargets); max_targets_allowed = RuleI(Spells, TargetedAOEMaxTargets);
} else if ( } else if (
+312 -200
View File
@@ -207,6 +207,7 @@ const char* QuestEventSubroutines[_LargestEventID] = {
"EVENT_AA_LOSS", "EVENT_AA_LOSS",
"EVENT_SPELL_BLOCKED", "EVENT_SPELL_BLOCKED",
"EVENT_READ_ITEM", "EVENT_READ_ITEM",
"EVENT_PET_COMMAND",
// Add new events before these or Lua crashes // Add new events before these or Lua crashes
"EVENT_SPELL_EFFECT_BOT", "EVENT_SPELL_EFFECT_BOT",
@@ -222,6 +223,8 @@ PerlembParser::PerlembParser() : perl(nullptr)
global_bot_quest_status_ = questUnloaded; global_bot_quest_status_ = questUnloaded;
merc_quest_status_ = questUnloaded; merc_quest_status_ = questUnloaded;
global_merc_quest_status_ = questUnloaded; global_merc_quest_status_ = questUnloaded;
zone_quest_status_ = questUnloaded;
global_zone_quest_status_ = questUnloaded;
} }
PerlembParser::~PerlembParser() PerlembParser::~PerlembParser()
@@ -265,6 +268,8 @@ void PerlembParser::ReloadQuests()
global_bot_quest_status_ = questUnloaded; global_bot_quest_status_ = questUnloaded;
merc_quest_status_ = questUnloaded; merc_quest_status_ = questUnloaded;
global_merc_quest_status_ = questUnloaded; global_merc_quest_status_ = questUnloaded;
zone_quest_status_ = questUnloaded;
global_zone_quest_status_ = questUnloaded;
item_quest_status_.clear(); item_quest_status_.clear();
spell_quest_status_.clear(); spell_quest_status_.clear();
@@ -278,6 +283,7 @@ int PerlembParser::EventCommon(
EQ::ItemInstance* inst, EQ::ItemInstance* inst,
const SPDat_Spell_Struct* spell, const SPDat_Spell_Struct* spell,
Mob* mob, Mob* mob,
Zone* zone,
uint32 extra_data, uint32 extra_data,
bool is_global, bool is_global,
std::vector<std::any>* extra_pointers std::vector<std::any>* extra_pointers
@@ -287,52 +293,22 @@ int PerlembParser::EventCommon(
return 0; return 0;
} }
bool is_player_quest = false; QuestType quest_type = GetQuestTypes(
bool is_global_player_quest = false;
bool is_global_npc_quest = false;
bool is_bot_quest = false;
bool is_global_bot_quest = false;
bool is_merc_quest = false;
bool is_global_merc_quest = false;
bool is_item_quest = false;
bool is_spell_quest = false;
std::string package_name;
GetQuestTypes(
is_player_quest,
is_global_player_quest,
is_bot_quest,
is_global_bot_quest,
is_merc_quest,
is_global_merc_quest,
is_global_npc_quest,
is_item_quest,
is_spell_quest,
event_id, event_id,
npc_mob, npc_mob,
inst, inst,
mob, mob,
zone,
is_global is_global
); );
GetQuestPackageName( std::string package_name = GetQuestPackageName(
is_player_quest, quest_type,
is_global_player_quest,
is_bot_quest,
is_global_bot_quest,
is_merc_quest,
is_global_merc_quest,
is_global_npc_quest,
is_item_quest,
is_spell_quest,
package_name,
event_id, event_id,
object_id, object_id,
data, data,
npc_mob, npc_mob,
inst, inst
is_global
); );
const std::string& sub_name = QuestEventSubroutines[event_id]; const std::string& sub_name = QuestEventSubroutines[event_id];
@@ -348,15 +324,7 @@ int PerlembParser::EventCommon(
/* Check for QGlobal export event enable */ /* Check for QGlobal export event enable */
if (parse->perl_event_export_settings[event_id].qglobals) { if (parse->perl_event_export_settings[event_id].qglobals) {
ExportQGlobals( ExportQGlobals(
is_player_quest, quest_type,
is_global_player_quest,
is_bot_quest,
is_global_bot_quest,
is_merc_quest,
is_global_merc_quest,
is_global_npc_quest,
is_item_quest,
is_spell_quest,
package_name, package_name,
npc_mob, npc_mob,
mob, mob,
@@ -367,15 +335,7 @@ int PerlembParser::EventCommon(
/* Check for Mob export event enable */ /* Check for Mob export event enable */
if (parse->perl_event_export_settings[event_id].mob) { if (parse->perl_event_export_settings[event_id].mob) {
ExportMobVariables( ExportMobVariables(
is_player_quest, quest_type,
is_global_player_quest,
is_bot_quest,
is_global_bot_quest,
is_merc_quest,
is_global_merc_quest,
is_global_npc_quest,
is_item_quest,
is_spell_quest,
package_name, package_name,
mob, mob,
npc_mob npc_mob
@@ -397,19 +357,24 @@ int PerlembParser::EventCommon(
ExportEventVariables(package_name, event_id, object_id, data, npc_mob, inst, mob, extra_data, extra_pointers); ExportEventVariables(package_name, event_id, object_id, data, npc_mob, inst, mob, extra_data, extra_pointers);
} }
if (is_player_quest || is_global_player_quest) { if (quest_type == QuestType::Player || quest_type == QuestType::PlayerGlobal) {
return SendCommands(package_name.c_str(), QuestEventSubroutines[event_id], 0, mob, mob, nullptr, nullptr); return SendCommands(package_name.c_str(), QuestEventSubroutines[event_id], 0, mob, mob, nullptr, nullptr, nullptr);
} else if (is_bot_quest || is_global_bot_quest || is_merc_quest || is_global_merc_quest) { } else if (
return SendCommands(package_name.c_str(), QuestEventSubroutines[event_id], 0, npc_mob, mob, nullptr, nullptr); quest_type == QuestType::Bot ||
} else if (is_item_quest) { quest_type == QuestType::BotGlobal ||
return SendCommands(package_name.c_str(), QuestEventSubroutines[event_id], 0, mob, mob, inst, nullptr); quest_type == QuestType::Merc ||
} else if (is_spell_quest) { quest_type == QuestType::MercGlobal
) {
return SendCommands(package_name.c_str(), QuestEventSubroutines[event_id], 0, npc_mob, mob, nullptr, nullptr, nullptr);
} else if (quest_type == QuestType::Item || quest_type == QuestType::ItemGlobal) {
return SendCommands(package_name.c_str(), QuestEventSubroutines[event_id], 0, mob, mob, inst, nullptr, nullptr);
} else if (quest_type == QuestType::Spell || quest_type == QuestType::SpellGlobal) {
if (mob) { if (mob) {
return SendCommands(package_name.c_str(), QuestEventSubroutines[event_id], 0, mob, mob, nullptr, spell); return SendCommands(package_name.c_str(), QuestEventSubroutines[event_id], 0, mob, mob, nullptr, spell, nullptr);
} else { } else {
return SendCommands(package_name.c_str(), QuestEventSubroutines[event_id], 0, npc_mob, mob, nullptr, spell); return SendCommands(package_name.c_str(), QuestEventSubroutines[event_id], 0, npc_mob, mob, nullptr, spell, nullptr);
} }
} else { } else if (quest_type == QuestType::NPC || quest_type == QuestType::NPCGlobal) {
return SendCommands( return SendCommands(
package_name.c_str(), package_name.c_str(),
QuestEventSubroutines[event_id], QuestEventSubroutines[event_id],
@@ -417,8 +382,20 @@ int PerlembParser::EventCommon(
npc_mob, npc_mob,
mob, mob,
nullptr, nullptr,
nullptr,
nullptr nullptr
); );
} else if (quest_type == QuestType::Zone || quest_type == QuestType::ZoneGlobal) {
return SendCommands(
package_name.c_str(),
QuestEventSubroutines[event_id],
0,
nullptr,
nullptr,
nullptr,
nullptr,
zone
);
} }
} }
@@ -439,6 +416,7 @@ int PerlembParser::EventNPC(
nullptr, nullptr,
nullptr, nullptr,
mob, mob,
nullptr,
extra_data, extra_data,
false, false,
extra_pointers extra_pointers
@@ -462,6 +440,7 @@ int PerlembParser::EventGlobalNPC(
nullptr, nullptr,
nullptr, nullptr,
mob, mob,
nullptr,
extra_data, extra_data,
true, true,
extra_pointers extra_pointers
@@ -484,6 +463,7 @@ int PerlembParser::EventPlayer(
nullptr, nullptr,
nullptr, nullptr,
client, client,
nullptr,
extra_data, extra_data,
false, false,
extra_pointers extra_pointers
@@ -506,6 +486,7 @@ int PerlembParser::EventGlobalPlayer(
nullptr, nullptr,
nullptr, nullptr,
client, client,
nullptr,
extra_data, extra_data,
true, true,
extra_pointers extra_pointers
@@ -534,6 +515,7 @@ int PerlembParser::EventItem(
inst, inst,
nullptr, nullptr,
client, client,
nullptr,
extra_data, extra_data,
false, false,
extra_pointers extra_pointers
@@ -558,6 +540,7 @@ int PerlembParser::EventSpell(
nullptr, nullptr,
&spells[spell_id], &spells[spell_id],
client, client,
nullptr,
extra_data, extra_data,
false, false,
extra_pointers extra_pointers
@@ -1006,7 +989,8 @@ int PerlembParser::SendCommands(
Mob* other, Mob* other,
Mob* mob, Mob* mob,
EQ::ItemInstance* inst, EQ::ItemInstance* inst,
const SPDat_Spell_Struct* spell const SPDat_Spell_Struct* spell,
Zone* zone
) )
{ {
if (!perl) { if (!perl) {
@@ -1014,12 +998,22 @@ int PerlembParser::SendCommands(
} }
int ret_value = 0; int ret_value = 0;
RunningQuest q;
q.owner = other;
q.questitem = inst;
q.questspell = spell;
if (mob && mob->IsClient()) { if (mob && mob->IsClient()) {
quest_manager.StartQuest(other, mob->CastToClient(), inst, spell); q.initiator = mob->CastToClient();
} else {
quest_manager.StartQuest(other);
} }
if (zone) {
q.zone = zone;
}
quest_manager.StartQuest(q);
try { try {
perl->eval(fmt::format("package {};", prefix).c_str()); perl->eval(fmt::format("package {};", prefix).c_str());
@@ -1033,7 +1027,8 @@ int PerlembParser::SendCommands(
"merc", "merc",
"npc", "npc",
"questitem", "questitem",
"spell" "spell",
"zone"
}; };
for (const auto& suffix : suffixes) { for (const auto& suffix : suffixes) {
@@ -1058,6 +1053,7 @@ int PerlembParser::SendCommands(
sv_setsv(client, _empty_sv); sv_setsv(client, _empty_sv);
} }
if (other) {
if (other->IsBot()) { if (other->IsBot()) {
Bot* b = quest_manager.GetBot(); Bot* b = quest_manager.GetBot();
buf = fmt::format("{}::bot", prefix); buf = fmt::format("{}::bot", prefix);
@@ -1074,6 +1070,7 @@ int PerlembParser::SendCommands(
SV* npc = get_sv(buf.c_str(), true); SV* npc = get_sv(buf.c_str(), true);
sv_setref_pv(npc, "NPC", n); sv_setref_pv(npc, "NPC", n);
} }
}
//only export QuestItem if it's an inst quest //only export QuestItem if it's an inst quest
if (inst) { if (inst) {
@@ -1110,7 +1107,8 @@ int PerlembParser::SendCommands(
"merc", "merc",
"npc", "npc",
"questitem", "questitem",
"spell" "spell",
"zone"
}; };
for (const auto& suffix : suffixes) { for (const auto& suffix : suffixes) {
@@ -1192,20 +1190,12 @@ void PerlembParser::MapFunctions()
#endif // EMBPERL_XS_CLASSES #endif // EMBPERL_XS_CLASSES
} }
void PerlembParser::GetQuestTypes( QuestType PerlembParser::GetQuestTypes(
bool& is_player_quest,
bool& is_global_player_quest,
bool& is_bot_quest,
bool& is_global_bot_quest,
bool& is_merc_quest,
bool& is_global_merc_quest,
bool& is_global_npc_quest,
bool& is_item_quest,
bool& is_spell_quest,
QuestEventID event_id, QuestEventID event_id,
Mob* npc_mob, Mob* npc_mob,
EQ::ItemInstance* inst, EQ::ItemInstance* inst,
Mob* mob, Mob* mob,
Zone* zone,
bool is_global bool is_global
) )
{ {
@@ -1219,100 +1209,74 @@ void PerlembParser::GetQuestTypes(
event_id == EVENT_SPELL_FADE || event_id == EVENT_SPELL_FADE ||
event_id == EVENT_SPELL_EFFECT_TRANSLOCATE_COMPLETE event_id == EVENT_SPELL_EFFECT_TRANSLOCATE_COMPLETE
) { ) {
is_spell_quest = true; return is_global ? QuestType::SpellGlobal : QuestType::Spell;
} else { } else {
if (npc_mob) { if (npc_mob) {
if (!inst) { if (!inst) {
if (is_global) {
if (npc_mob->IsBot()) { if (npc_mob->IsBot()) {
is_global_bot_quest = true; return is_global ? QuestType::BotGlobal : QuestType::Bot;
} else if (npc_mob->IsMerc()) { } else if (npc_mob->IsMerc()) {
is_global_merc_quest = true; return is_global ? QuestType::MercGlobal : QuestType::Merc;
} else if (npc_mob->IsNPC()) {
return is_global ? QuestType::NPCGlobal : QuestType::NPC;
} }
} else { } else {
if (npc_mob->IsBot()) { return is_global ? QuestType::ItemGlobal : QuestType::Item;
is_bot_quest = true;
} else if (npc_mob->IsMerc()) {
is_merc_quest = true;
}
}
} else {
is_item_quest = true;
} }
} else if (!npc_mob && mob) { } else if (!npc_mob && mob) {
if (!inst) { if (!inst) {
if (is_global) {
if (mob->IsClient()) { if (mob->IsClient()) {
is_global_player_quest = true; return is_global ? QuestType::PlayerGlobal : QuestType::Player;
} }
} else { } else {
if (mob->IsClient()) { return is_global ? QuestType::ItemGlobal : QuestType::Item;
is_player_quest = true;
}
}
} else {
is_item_quest = true;
} }
} else if (zone) {
return is_global ? QuestType::ZoneGlobal : QuestType::Zone;
} }
} }
} }
void PerlembParser::GetQuestPackageName( std::string PerlembParser::GetQuestPackageName(
bool& is_player_quest, QuestType quest_type,
bool& is_global_player_quest,
bool& is_bot_quest,
bool& is_global_bot_quest,
bool& is_merc_quest,
bool& is_global_merc_quest,
bool& is_global_npc_quest,
bool& is_item_quest,
bool& is_spell_quest,
std::string& package_name,
QuestEventID event_id, QuestEventID event_id,
uint32 object_id, uint32 object_id,
const char* data, const char* data,
Mob* npc_mob, Mob* npc_mob,
EQ::ItemInstance* inst, EQ::ItemInstance* inst
bool is_global
) )
{ {
if ( if (quest_type == QuestType::NPC) {
!is_player_quest && return fmt::format("qst_npc_{}", npc_mob->GetNPCTypeID());
!is_global_player_quest && } else if (quest_type == QuestType::NPCGlobal) {
!is_bot_quest && return "qst_global_npc";
!is_global_bot_quest && } else if (quest_type == QuestType::Item || quest_type == QuestType::ItemGlobal) {
!is_merc_quest &&
!is_global_merc_quest &&
!is_item_quest &&
!is_spell_quest
) {
if (is_global) {
is_global_npc_quest = true;
package_name = "qst_global_npc";
} else {
package_name = fmt::format("qst_npc_{}", npc_mob->GetNPCTypeID());
}
} else if (is_item_quest) {
if (!inst) { if (!inst) {
return; return "";
} }
package_name = fmt::format("qst_item_{}", inst->GetID()); return fmt::format("qst_item_{}", inst->GetID());
} else if (is_player_quest) { } else if (quest_type == QuestType::Player) {
package_name = "qst_player"; return "qst_player";
} else if (is_global_player_quest) { } else if (quest_type == QuestType::PlayerGlobal) {
package_name = "qst_global_player"; return "qst_global_player";
} else if (is_bot_quest) { } else if (quest_type == QuestType::Bot) {
package_name = "qst_bot"; return "qst_bot";
} else if (is_global_bot_quest) { } else if (quest_type == QuestType::BotGlobal) {
package_name = "qst_global_bot"; return "qst_global_bot";
} else if (is_merc_quest) { } else if (quest_type == QuestType::Merc) {
package_name = "qst_merc"; return "qst_merc";
} else if (is_global_merc_quest) { } else if (quest_type == QuestType::MercGlobal) {
package_name = "qst_global_merc"; return "qst_global_merc";
} else { } else if (quest_type == QuestType::Spell || quest_type == QuestType::SpellGlobal) {
package_name = fmt::format("qst_spell_{}", object_id); return fmt::format("qst_spell_{}", object_id);
} else if (quest_type == QuestType::Zone) {
return "qst_zone";
} else if (quest_type == QuestType::ZoneGlobal) {
return "qst_global_zone";
} }
return "";
} }
void PerlembParser::ExportCharID(const std::string& package_name, int& char_id, Mob* npc_mob, Mob* mob) void PerlembParser::ExportCharID(const std::string& package_name, int& char_id, Mob* npc_mob, Mob* mob)
@@ -1331,15 +1295,7 @@ void PerlembParser::ExportCharID(const std::string& package_name, int& char_id,
} }
void PerlembParser::ExportQGlobals( void PerlembParser::ExportQGlobals(
bool is_player_quest, QuestType quest_type,
bool is_global_player_quest,
bool is_bot_quest,
bool is_global_bot_quest,
bool is_merc_quest,
bool is_global_merc_quest,
bool is_global_npc_quest,
bool is_item_quest,
bool is_spell_quest,
std::string& package_name, std::string& package_name,
Mob* npc_mob, Mob* npc_mob,
Mob* mob, Mob* mob,
@@ -1347,16 +1303,7 @@ void PerlembParser::ExportQGlobals(
) )
{ {
//NPC quest //NPC quest
if ( if (quest_type == QuestType::NPC || quest_type == QuestType::NPCGlobal) {
!is_player_quest &&
!is_global_player_quest &&
!is_bot_quest &&
!is_global_bot_quest &&
!is_merc_quest &&
!is_global_merc_quest &&
!is_item_quest &&
!is_spell_quest
) {
//only export for npcs that are global enabled. //only export for npcs that are global enabled.
if (npc_mob && npc_mob->GetQglobal()) { if (npc_mob && npc_mob->GetQglobal()) {
std::map<std::string, std::string> globhash; std::map<std::string, std::string> globhash;
@@ -1485,15 +1432,7 @@ void PerlembParser::ExportQGlobals(
} }
void PerlembParser::ExportMobVariables( void PerlembParser::ExportMobVariables(
bool is_player_quest, QuestType quest_type,
bool is_global_player_quest,
bool is_bot_quest,
bool is_global_bot_quest,
bool is_merc_quest,
bool is_global_merc_quest,
bool is_global_npc_quest,
bool is_item_quest,
bool is_spell_quest,
std::string& package_name, std::string& package_name,
Mob* mob, Mob* mob,
Mob* npc_mob Mob* npc_mob
@@ -1511,15 +1450,7 @@ void PerlembParser::ExportMobVariables(
ExportVar(package_name.c_str(), "bot_owner_char_id", mob->CastToBot()->GetBotOwnerCharacterID()); ExportVar(package_name.c_str(), "bot_owner_char_id", mob->CastToBot()->GetBotOwnerCharacterID());
} }
if ( if (quest_type == QuestType::NPC || quest_type == QuestType::NPCGlobal) {
!is_player_quest &&
!is_global_player_quest &&
!is_bot_quest &&
!is_global_bot_quest &&
!is_merc_quest &&
!is_global_merc_quest &&
!is_item_quest
) {
if (mob && mob->IsClient() && npc_mob && npc_mob->IsNPC()) { if (mob && mob->IsClient() && npc_mob && npc_mob->IsNPC()) {
Client* c = mob->CastToClient(); Client* c = mob->CastToClient();
@@ -1543,16 +1474,7 @@ void PerlembParser::ExportMobVariables(
ExportVar(package_name.c_str(), "userid", mob->GetID()); ExportVar(package_name.c_str(), "userid", mob->GetID());
} }
if ( if (quest_type == QuestType::NPC || quest_type == QuestType::NPCGlobal) {
!is_player_quest &&
!is_global_player_quest &&
!is_bot_quest &&
!is_global_bot_quest &&
!is_merc_quest &&
!is_global_merc_quest &&
!is_item_quest &&
!is_spell_quest
) {
if (npc_mob->IsNPC()) { if (npc_mob->IsNPC()) {
ExportVar(package_name.c_str(), "mname", npc_mob->GetName()); ExportVar(package_name.c_str(), "mname", npc_mob->GetName());
ExportVar(package_name.c_str(), "mobid", npc_mob->GetID()); ExportVar(package_name.c_str(), "mobid", npc_mob->GetID());
@@ -1758,10 +1680,14 @@ void PerlembParser::ExportEventVariables(
ExportVar(package_name.c_str(), "doorid", data); ExportVar(package_name.c_str(), "doorid", data);
ExportVar(package_name.c_str(), "version", zone->GetInstanceVersion()); ExportVar(package_name.c_str(), "version", zone->GetInstanceVersion());
if (extra_pointers && extra_pointers->size() == 1) { if (extra_pointers && extra_pointers->size() >= 1) {
ExportVar(package_name.c_str(), "door", "Doors", std::any_cast<Doors*>(extra_pointers->at(0))); ExportVar(package_name.c_str(), "door", "Doors", std::any_cast<Doors*>(extra_pointers->at(0)));
} }
if (extra_pointers && extra_pointers->size() == 2) {
ExportVar(package_name.c_str(), "player", "Client", std::any_cast<Client*>(extra_pointers->at(1)));
}
break; break;
} }
@@ -1782,10 +1708,14 @@ void PerlembParser::ExportEventVariables(
); );
} }
if (extra_pointers && extra_pointers->size() == 2) { if (extra_pointers && extra_pointers->size() >= 2) {
ExportVar(package_name.c_str(), "corpse", "Corpse", std::any_cast<Corpse*>(extra_pointers->at(1))); ExportVar(package_name.c_str(), "corpse", "Corpse", std::any_cast<Corpse*>(extra_pointers->at(1)));
} }
if (extra_pointers && extra_pointers->size() == 3) {
ExportVar(package_name.c_str(), "player", "Client", std::any_cast<Client*>(extra_pointers->at(2)));
}
break; break;
} }
@@ -1852,7 +1782,7 @@ void PerlembParser::ExportEventVariables(
ExportVar(package_name.c_str(), "picked_up_id", data); ExportVar(package_name.c_str(), "picked_up_id", data);
ExportVar(package_name.c_str(), "picked_up_entity_id", extra_data); ExportVar(package_name.c_str(), "picked_up_entity_id", extra_data);
if (extra_pointers && extra_pointers->size() == 1) { if (extra_pointers && extra_pointers->size() >= 1) {
ExportVar( ExportVar(
package_name.c_str(), package_name.c_str(),
"item", "item",
@@ -1861,6 +1791,10 @@ void PerlembParser::ExportEventVariables(
); );
} }
if (extra_pointers && extra_pointers->size() == 2) {
ExportVar(package_name.c_str(), "player", "Client", std::any_cast<Client*>(extra_pointers->at(1)));
}
break; break;
} }
@@ -1873,6 +1807,11 @@ void PerlembParser::ExportEventVariables(
case EVENT_POPUP_RESPONSE: { case EVENT_POPUP_RESPONSE: {
ExportVar(package_name.c_str(), "popupid", data); ExportVar(package_name.c_str(), "popupid", data);
if (extra_pointers && extra_pointers->size() == 1) {
ExportVar(package_name.c_str(), "player", "Client", std::any_cast<Client*>(extra_pointers->at(0)));
}
break; break;
} }
@@ -2036,10 +1975,14 @@ void PerlembParser::ExportEventVariables(
ExportVar(package_name.c_str(), "objectid", data); ExportVar(package_name.c_str(), "objectid", data);
ExportVar(package_name.c_str(), "clicker_id", extra_data); ExportVar(package_name.c_str(), "clicker_id", extra_data);
if (extra_pointers && extra_pointers->size() == 1) { if (extra_pointers && extra_pointers->size() >= 1) {
ExportVar(package_name.c_str(), "object", "Object", std::any_cast<Object*>(extra_pointers->at(0))); ExportVar(package_name.c_str(), "object", "Object", std::any_cast<Object*>(extra_pointers->at(0)));
} }
if (extra_pointers && extra_pointers->size() == 2) {
ExportVar(package_name.c_str(), "player", "Client", std::any_cast<Client*>(extra_pointers->at(1)));
}
break; break;
} }
@@ -2115,6 +2058,13 @@ void PerlembParser::ExportEventVariables(
ExportVar(package_name.c_str(), "killed_npc_id", !killed->IsMerc() && killed->IsNPC() ? killed->GetNPCTypeID() : 0); ExportVar(package_name.c_str(), "killed_npc_id", !killed->IsMerc() && killed->IsNPC() ? killed->GetNPCTypeID() : 0);
} }
} }
if (extra_pointers && extra_pointers->size() == 3) {
Mob* killer = std::any_cast<Mob*>(extra_pointers->at(2));
if (killer) {
ExportVar(package_name.c_str(), "killer", "Mob", killer);
}
}
break; break;
} }
@@ -2142,10 +2092,21 @@ void PerlembParser::ExportEventVariables(
} }
case EVENT_SPAWN_ZONE: { case EVENT_SPAWN_ZONE: {
ExportVar(package_name.c_str(), "spawned_entity_id", mob->GetID()); if (mob) {
ExportVar(package_name.c_str(), "spawned_bot_id", mob->IsBot() ? mob->CastToBot()->GetBotID() : 0);
ExportVar(package_name.c_str(), "spawned_npc_id", mob->IsNPC() ? mob->GetNPCTypeID() : 0);
ExportVar(package_name.c_str(), "spawned", "Mob", mob); ExportVar(package_name.c_str(), "spawned", "Mob", mob);
ExportVar(package_name.c_str(), "spawned_bot_id", mob->IsBot() ? mob->CastToBot()->GetBotID() : 0);
ExportVar(package_name.c_str(), "spawned_entity_id", mob->GetID());
ExportVar(package_name.c_str(), "spawned_npc_id", mob->IsNPC() ? mob->GetNPCTypeID() : 0);
}
if (extra_pointers && extra_pointers->size() == 1) {
NPC* spawn_npc = std::any_cast<NPC*>(extra_pointers->at(0));
ExportVar(package_name.c_str(), "spawned", "NPC", spawn_npc);
ExportVar(package_name.c_str(), "spawned_bot_id", spawn_npc->IsBot() ? spawn_npc->CastToBot()->GetBotID() : 0);
ExportVar(package_name.c_str(), "spawned_entity_id", spawn_npc->GetID());
ExportVar(package_name.c_str(), "spawned_npc_id", spawn_npc->IsNPC() ? spawn_npc->GetNPCTypeID() : 0);
}
break; break;
} }
@@ -2386,6 +2347,7 @@ void PerlembParser::ExportEventVariables(
} }
case EVENT_DESPAWN: { case EVENT_DESPAWN: {
ExportVar(package_name.c_str(), "despawned", "Mob", npc_mob);
ExportVar(package_name.c_str(), "despawned_entity_id", npc_mob->GetID()); ExportVar(package_name.c_str(), "despawned_entity_id", npc_mob->GetID());
ExportVar(package_name.c_str(), "despawned_bot_id", npc_mob->IsBot() ? npc_mob->CastToBot()->GetBotID() : 0); ExportVar(package_name.c_str(), "despawned_bot_id", npc_mob->IsBot() ? npc_mob->CastToBot()->GetBotID() : 0);
ExportVar(package_name.c_str(), "despawned_merc_id", npc_mob->IsMerc() ? npc_mob->CastToMerc()->GetMercenaryID() : 0); ExportVar(package_name.c_str(), "despawned_merc_id", npc_mob->IsMerc() ? npc_mob->CastToMerc()->GetMercenaryID() : 0);
@@ -2394,9 +2356,21 @@ void PerlembParser::ExportEventVariables(
} }
case EVENT_DESPAWN_ZONE: { case EVENT_DESPAWN_ZONE: {
ExportVar(package_name.c_str(), "despawned_entity_id", mob->GetID()); if (mob) {
ExportVar(package_name.c_str(), "despawned", "Mob", mob);
ExportVar(package_name.c_str(), "despawned_bot_id", mob->IsBot() ? mob->CastToBot()->GetBotID() : 0); ExportVar(package_name.c_str(), "despawned_bot_id", mob->IsBot() ? mob->CastToBot()->GetBotID() : 0);
ExportVar(package_name.c_str(), "despawned_entity_id", mob->GetID());
ExportVar(package_name.c_str(), "despawned_npc_id", mob->IsNPC() ? mob->GetNPCTypeID() : 0); ExportVar(package_name.c_str(), "despawned_npc_id", mob->IsNPC() ? mob->GetNPCTypeID() : 0);
}
if (extra_pointers && extra_pointers->size() == 1) {
NPC* spawn_npc = std::any_cast<NPC*>(extra_pointers->at(0));
ExportVar(package_name.c_str(), "despawned", "NPC", spawn_npc);
ExportVar(package_name.c_str(), "despawned_bot_id", spawn_npc->IsBot() ? spawn_npc->CastToBot()->GetBotID() : 0);
ExportVar(package_name.c_str(), "despawned_entity_id", spawn_npc->GetID());
ExportVar(package_name.c_str(), "despawned_npc_id", spawn_npc->IsNPC() ? spawn_npc->GetNPCTypeID() : 0);
}
break; break;
} }
@@ -2551,6 +2525,20 @@ void PerlembParser::ExportEventVariables(
break; break;
} }
case EVENT_ENTER_ZONE: {
if (extra_pointers && extra_pointers->size() == 1) {
ExportVar(package_name.c_str(), "player", "Client", std::any_cast<Client*>(extra_pointers->at(0)));
}
break;
}
case EVENT_PET_COMMAND: {
ExportVar(package_name.c_str(), "pet_command", extra_data);
ExportVar(package_name.c_str(), "pet_command_name", data);
break;
}
default: { default: {
break; break;
} }
@@ -2648,6 +2636,7 @@ int PerlembParser::EventBot(
nullptr, nullptr,
nullptr, nullptr,
mob, mob,
nullptr,
extra_data, extra_data,
false, false,
extra_pointers extra_pointers
@@ -2671,6 +2660,7 @@ int PerlembParser::EventGlobalBot(
nullptr, nullptr,
nullptr, nullptr,
mob, mob,
nullptr,
extra_data, extra_data,
true, true,
extra_pointers extra_pointers
@@ -2768,6 +2758,7 @@ int PerlembParser::EventMerc(
nullptr, nullptr,
nullptr, nullptr,
mob, mob,
nullptr,
extra_data, extra_data,
false, false,
extra_pointers extra_pointers
@@ -2791,6 +2782,127 @@ int PerlembParser::EventGlobalMerc(
nullptr, nullptr,
nullptr, nullptr,
mob, mob,
nullptr,
extra_data,
true,
extra_pointers
);
}
void PerlembParser::LoadZoneScript(std::string filename)
{
if (!perl || zone_quest_status_ != questUnloaded) {
return;
}
try {
perl->eval_file("qst_zone", filename.c_str());
} catch (std::string e) {
AddError(
fmt::format(
"Error Compiling Zone Quest File [{}] Error [{}]",
filename,
e
)
);
zone_quest_status_ = questFailedToLoad;
return;
}
zone_quest_status_ = questLoaded;
}
void PerlembParser::LoadGlobalZoneScript(std::string filename)
{
if (!perl || global_zone_quest_status_ != questUnloaded) {
return;
}
try {
perl->eval_file("qst_global_zone", filename.c_str());
} catch (std::string e) {
AddError(
fmt::format(
"Error Compiling Global Zone Quest File [{}] Error [{}]",
filename,
e
)
);
global_zone_quest_status_ = questFailedToLoad;
return;
}
global_zone_quest_status_ = questLoaded;
}
bool PerlembParser::ZoneHasQuestSub(QuestEventID event_id)
{
if (
!perl ||
zone_quest_status_ != questLoaded ||
event_id >= _LargestEventID
) {
return false;
}
return perl->SubExists("qst_zone", QuestEventSubroutines[event_id]);
}
bool PerlembParser::GlobalZoneHasQuestSub(QuestEventID event_id)
{
if (
!perl ||
global_zone_quest_status_ != questLoaded ||
event_id >= _LargestEventID
) {
return false;
}
return perl->SubExists("qst_global_zone", QuestEventSubroutines[event_id]);
}
int PerlembParser::EventZone(
QuestEventID event_id,
Zone* zone,
std::string data,
uint32 extra_data,
std::vector<std::any>* extra_pointers
)
{
return EventCommon(
event_id,
0,
data.c_str(),
nullptr,
nullptr,
nullptr,
nullptr,
zone,
extra_data,
false,
extra_pointers
);
}
int PerlembParser::EventGlobalZone(
QuestEventID event_id,
Zone* zone,
std::string data,
uint32 extra_data,
std::vector<std::any>* extra_pointers
)
{
return EventCommon(
event_id,
0,
data.c_str(),
nullptr,
nullptr,
nullptr,
nullptr,
zone,
extra_data, extra_data,
true, true,
extra_pointers extra_pointers
+49 -42
View File
@@ -41,6 +41,23 @@ typedef enum {
questFailedToLoad questFailedToLoad
} PerlQuestStatus; } PerlQuestStatus;
enum class QuestType {
Bot,
BotGlobal,
Item,
ItemGlobal,
Merc,
MercGlobal,
NPC,
NPCGlobal,
Player,
PlayerGlobal,
Spell,
SpellGlobal,
Zone,
ZoneGlobal
};
class PerlembParser : public QuestInterface { class PerlembParser : public QuestInterface {
public: public:
PerlembParser(); PerlembParser();
@@ -136,6 +153,22 @@ public:
std::vector<std::any>* extra_pointers std::vector<std::any>* extra_pointers
); );
virtual int EventZone(
QuestEventID event_id,
Zone* zone,
std::string data,
uint32 extra_data,
std::vector<std::any>* extra_pointers
);
virtual int EventGlobalZone(
QuestEventID event_id,
Zone* zone,
std::string data,
uint32 extra_data,
std::vector<std::any>* extra_pointers
);
virtual bool HasQuestSub(uint32 npc_id, QuestEventID event_id); virtual bool HasQuestSub(uint32 npc_id, QuestEventID event_id);
virtual bool HasGlobalQuestSub(QuestEventID event_id); virtual bool HasGlobalQuestSub(QuestEventID event_id);
virtual bool PlayerHasQuestSub(QuestEventID event_id); virtual bool PlayerHasQuestSub(QuestEventID event_id);
@@ -146,6 +179,8 @@ public:
virtual bool GlobalBotHasQuestSub(QuestEventID event_id); virtual bool GlobalBotHasQuestSub(QuestEventID event_id);
virtual bool MercHasQuestSub(QuestEventID event_id); virtual bool MercHasQuestSub(QuestEventID event_id);
virtual bool GlobalMercHasQuestSub(QuestEventID event_id); virtual bool GlobalMercHasQuestSub(QuestEventID event_id);
virtual bool ZoneHasQuestSub(QuestEventID event_id);
virtual bool GlobalZoneHasQuestSub(QuestEventID event_id);
virtual void LoadNPCScript(std::string filename, int npc_id); virtual void LoadNPCScript(std::string filename, int npc_id);
virtual void LoadGlobalNPCScript(std::string filename); virtual void LoadGlobalNPCScript(std::string filename);
@@ -157,6 +192,8 @@ public:
virtual void LoadGlobalBotScript(std::string filename); virtual void LoadGlobalBotScript(std::string filename);
virtual void LoadMercScript(std::string filename); virtual void LoadMercScript(std::string filename);
virtual void LoadGlobalMercScript(std::string filename); virtual void LoadGlobalMercScript(std::string filename);
virtual void LoadZoneScript(std::string filename);
virtual void LoadGlobalZoneScript(std::string filename);
virtual void AddVar(std::string name, std::string val); virtual void AddVar(std::string name, std::string val);
virtual std::string GetVar(std::string name); virtual std::string GetVar(std::string name);
@@ -182,6 +219,7 @@ private:
EQ::ItemInstance* inst, EQ::ItemInstance* inst,
const SPDat_Spell_Struct* spell, const SPDat_Spell_Struct* spell,
Mob* mob, Mob* mob,
Zone* zone,
uint32 extra_data, uint32 extra_data,
bool is_global, bool is_global,
std::vector<std::any>* extra_pointers std::vector<std::any>* extra_pointers
@@ -194,59 +232,34 @@ private:
Mob* other, Mob* other,
Mob* mob, Mob* mob,
EQ::ItemInstance* inst, EQ::ItemInstance* inst,
const SPDat_Spell_Struct* spell const SPDat_Spell_Struct* spell,
Zone* zone
); );
void MapFunctions(); void MapFunctions();
void GetQuestTypes( QuestType GetQuestTypes(
bool& is_player_quest,
bool& is_global_player_quest,
bool& is_bot_quest,
bool& is_global_bot_quest,
bool& is_merc_quest,
bool& is_global_merc_quest,
bool& is_global_npc_quest,
bool& is_item_quest,
bool& is_spell_quest,
QuestEventID event, QuestEventID event,
Mob* npc_mob, Mob* npc_mob,
EQ::ItemInstance* inst, EQ::ItemInstance* inst,
Mob* mob, Mob* mob,
Zone* zone,
bool is_global bool is_global
); );
void GetQuestPackageName( std::string GetQuestPackageName(
bool& is_player_quest, QuestType quest_type,
bool& is_global_player_quest,
bool& is_bot_quest,
bool& is_global_bot_quest,
bool& is_merc_quest,
bool& is_global_merc_quest,
bool& is_global_npc_quest,
bool& is_item_quest,
bool& is_spell_quest,
std::string& package_name,
QuestEventID event, QuestEventID event,
uint32 object_id, uint32 object_id,
const char* data, const char* data,
Mob* npc_mob, Mob* npc_mob,
EQ::ItemInstance* inst, EQ::ItemInstance* inst
bool is_global
); );
void ExportCharID(const std::string& package_name, int& char_id, Mob* npc_mob, Mob* mob); void ExportCharID(const std::string& package_name, int& char_id, Mob* npc_mob, Mob* mob);
void ExportQGlobals( void ExportQGlobals(
bool is_player_quest, QuestType quest_type,
bool is_global_player_quest,
bool is_bot_quest,
bool is_global_bot_quest,
bool is_merc_quest,
bool is_global_merc_quest,
bool is_global_npc_quest,
bool is_item_quest,
bool is_spell_quest,
std::string& package_name, std::string& package_name,
Mob* npc_mob, Mob* npc_mob,
Mob* mob, Mob* mob,
@@ -254,15 +267,7 @@ private:
); );
void ExportMobVariables( void ExportMobVariables(
bool is_player_quest, QuestType quest_type,
bool is_global_player_quest,
bool is_bot_quest,
bool is_global_bot_quest,
bool is_merc_quest,
bool is_global_merc_quest,
bool is_global_npc_quest,
bool is_item_quest,
bool is_spell_quest,
std::string& package_name, std::string& package_name,
Mob* mob, Mob* mob,
Mob* npc_mob Mob* npc_mob
@@ -295,6 +300,8 @@ private:
PerlQuestStatus global_bot_quest_status_; PerlQuestStatus global_bot_quest_status_;
PerlQuestStatus merc_quest_status_; PerlQuestStatus merc_quest_status_;
PerlQuestStatus global_merc_quest_status_; PerlQuestStatus global_merc_quest_status_;
PerlQuestStatus zone_quest_status_;
PerlQuestStatus global_zone_quest_status_;
SV* _empty_sv; SV* _empty_sv;
+54
View File
@@ -6005,6 +6005,55 @@ bool Perl__handin(perl::reference handin_ref)
return quest_manager.handin(handin_map); return quest_manager.handin(handin_map);
} }
perl::array Perl__get_paused_timers(Mob* m)
{
perl::array a;
const auto& l = quest_manager.GetPausedTimers(m);
if (!l.empty()) {
a.reserve(l.size());
for (const auto& v : l) {
a.push_back(v);
}
}
return a;
}
perl::array Perl__get_timers(Mob* m)
{
perl::array a;
const auto& l = quest_manager.GetTimers(m);
if (!l.empty()) {
a.reserve(l.size());
for (const auto& v: l) {
a.push_back(v);
}
}
return a;
}
std::string Perl__get_pet_command_name(uint8 pet_command)
{
return PetCommand::GetName(pet_command);
}
std::string Perl__get_pet_type_name(uint8 pet_type)
{
return PetType::GetName(pet_type);
}
std::string Perl__get_stat_cap_name(uint8 stat_id)
{
return StatCap::GetName(stat_id);
}
void perl_register_quest() void perl_register_quest()
{ {
perl::interpreter perl(PERL_GET_THX); perl::interpreter perl(PERL_GET_THX);
@@ -6694,6 +6743,9 @@ void perl_register_quest()
package.add("getguildidbycharid", &Perl__getguildidbycharid); package.add("getguildidbycharid", &Perl__getguildidbycharid);
package.add("getgroupidbycharid", &Perl__getgroupidbycharid); package.add("getgroupidbycharid", &Perl__getgroupidbycharid);
package.add("getinventoryslotname", &Perl__getinventoryslotname); package.add("getinventoryslotname", &Perl__getinventoryslotname);
package.add("get_paused_timers", &Perl__get_paused_timers);
package.add("get_pet_command_name", &Perl__get_pet_command_name);
package.add("get_pet_type_name", &Perl__get_pet_type_name);
package.add("getraididbycharid", &Perl__getraididbycharid); package.add("getraididbycharid", &Perl__getraididbycharid);
package.add("get_race_bitmask", &Perl__get_race_bitmask); package.add("get_race_bitmask", &Perl__get_race_bitmask);
package.add("get_recipe_component_item_ids", &Perl__GetRecipeComponentItemIDs); package.add("get_recipe_component_item_ids", &Perl__GetRecipeComponentItemIDs);
@@ -6713,6 +6765,8 @@ void perl_register_quest()
package.add("getspellstat", (int(*)(uint32, std::string))&Perl__getspellstat); package.add("getspellstat", (int(*)(uint32, std::string))&Perl__getspellstat);
package.add("getspellstat", (int(*)(uint32, std::string, uint8))&Perl__getspellstat); package.add("getspellstat", (int(*)(uint32, std::string, uint8))&Perl__getspellstat);
package.add("getskillname", &Perl__getskillname); package.add("getskillname", &Perl__getskillname);
package.add("get_stat_cap_name", &Perl__get_stat_cap_name);
package.add("get_timers", &Perl__get_timers);
package.add("getlevel", &Perl__getlevel); package.add("getlevel", &Perl__getlevel);
package.add("getplayerburiedcorpsecount", &Perl__getplayerburiedcorpsecount); package.add("getplayerburiedcorpsecount", &Perl__getplayerburiedcorpsecount);
package.add("getplayercorpsecount", &Perl__getplayercorpsecount); package.add("getplayercorpsecount", &Perl__getplayercorpsecount);
+7 -4
View File
@@ -56,8 +56,6 @@ extern volatile bool is_zone_loaded;
extern WorldServer worldserver; extern WorldServer worldserver;
extern uint32 numclients; extern uint32 numclients;
extern char errorname[32];
Entity::Entity() Entity::Entity()
{ {
id = 0; id = 0;
@@ -743,6 +741,11 @@ void EntityList::AddNPC(NPC *npc, bool send_spawn_packet, bool dont_queue)
npc->DispatchZoneControllerEvent(EVENT_SPAWN_ZONE, npc, "", 0, nullptr); npc->DispatchZoneControllerEvent(EVENT_SPAWN_ZONE, npc, "", 0, nullptr);
} }
if (parse->ZoneHasQuestSub(EVENT_SPAWN_ZONE)) {
std::vector<std::any> args = { npc };
parse->EventZone(EVENT_SPAWN_ZONE, zone, "", 0, &args);
}
if (zone->HasMap() && zone->HasWaterMap()) { if (zone->HasMap() && zone->HasWaterMap()) {
npc->SetSpawnedInWater(false); npc->SetSpawnedInWater(false);
if (zone->watermap->InLiquid(npc->GetPosition())) { if (zone->watermap->InLiquid(npc->GetPosition())) {
@@ -1386,7 +1389,7 @@ void EntityList::SendZoneSpawnsBulk(Client *client)
bool is_delayed_packet = ( bool is_delayed_packet = (
DistanceSquared(client_position, spawn_position) > distance_max || DistanceSquared(client_position, spawn_position) > distance_max ||
(spawn->IsClient() && (spawn->GetRace() == MINOR_ILL_OBJ || spawn->GetRace() == TREE)) (spawn->IsClient() && (spawn->GetRace() == Race::MinorIllusion || spawn->GetRace() == Race::Tree))
); );
if (is_delayed_packet) { if (is_delayed_packet) {
@@ -1410,7 +1413,7 @@ void EntityList::SendZoneSpawnsBulk(Client *client)
* *
* Illusion races on PCs don't work as a mass spawn * Illusion races on PCs don't work as a mass spawn
* But they will work as an add_spawn AFTER CLIENT_CONNECTED. * But they will work as an add_spawn AFTER CLIENT_CONNECTED.
* if (spawn->IsClient() && (race == MINOR_ILL_OBJ || race == TREE)) { * if (spawn->IsClient() && (race == Race::MinorIllusion || race == Race::Tree)) {
* app = new EQApplicationPacket; * app = new EQApplicationPacket;
* spawn->CreateSpawnPacket(app); * spawn->CreateSpawnPacket(app);
* client->QueuePacket(app, true, Client::CLIENT_CONNECTED); * client->QueuePacket(app, true, Client::CLIENT_CONNECTED);
+1
View File
@@ -145,6 +145,7 @@ typedef enum {
EVENT_AA_LOSS, EVENT_AA_LOSS,
EVENT_SPELL_BLOCKED, EVENT_SPELL_BLOCKED,
EVENT_READ_ITEM, EVENT_READ_ITEM,
EVENT_PET_COMMAND,
// Add new events before these or Lua crashes // Add new events before these or Lua crashes
EVENT_SPELL_EFFECT_BOT, EVENT_SPELL_EFFECT_BOT,
+7 -7
View File
@@ -130,7 +130,7 @@ uint64 Client::CalcEXP(uint8 consider_level, bool ignore_modifiers) {
if ( if (
GetClass() == Class::Warrior || GetClass() == Class::Warrior ||
GetClass() == Class::Rogue || GetClass() == Class::Rogue ||
GetBaseRace() == HALFLING GetBaseRace() == Race::Halfling
) { ) {
total_modifier *= 1.05; total_modifier *= 1.05;
} }
@@ -291,7 +291,7 @@ void Client::CalculateStandardAAExp(uint64 &add_aaxp, uint8 conlevel, bool resex
// Shouldn't race not affect AA XP? // Shouldn't race not affect AA XP?
if (RuleB(Character, UseRaceClassExpBonuses)) if (RuleB(Character, UseRaceClassExpBonuses))
{ {
if (GetBaseRace() == HALFLING) { if (GetBaseRace() == Race::Halfling) {
aatotalmod *= 1.05; aatotalmod *= 1.05;
} }
@@ -439,7 +439,7 @@ void Client::CalculateExp(uint64 in_add_exp, uint64 &add_exp, uint64 &add_aaxp,
if (RuleB(Character, UseRaceClassExpBonuses)) if (RuleB(Character, UseRaceClassExpBonuses))
{ {
if (GetBaseRace() == HALFLING) { if (GetBaseRace() == Race::Halfling) {
totalmod *= 1.05; totalmod *= 1.05;
} }
@@ -1057,13 +1057,13 @@ uint32 Client::GetEXPForLevel(uint16 check_level)
if(RuleB(Character,UseOldRaceExpPenalties)) if(RuleB(Character,UseOldRaceExpPenalties))
{ {
float racemod = 1.0; float racemod = 1.0;
if(GetBaseRace() == TROLL || GetBaseRace() == IKSAR) { if(GetBaseRace() == Race::Troll || GetBaseRace() == Race::Iksar) {
racemod = 1.2; racemod = 1.2;
} else if(GetBaseRace() == OGRE) { } else if(GetBaseRace() == Race::Ogre) {
racemod = 1.15; racemod = 1.15;
} else if(GetBaseRace() == BARBARIAN) { } else if(GetBaseRace() == Race::Barbarian) {
racemod = 1.05; racemod = 1.05;
} else if(GetBaseRace() == HALFLING) { } else if(GetBaseRace() == Race::Halfling) {
racemod = 0.95; racemod = 0.95;
} }
+1 -1
View File
@@ -365,7 +365,7 @@ void Mob::CalculateNewFearpoint()
// fallback logic if pathing system can't be used // fallback logic if pathing system can't be used
bool inliquid = zone->HasWaterMap() && zone->watermap->InLiquid(glm::vec3(GetPosition())) || zone->IsWaterZone(GetZ()); bool inliquid = zone->HasWaterMap() && zone->watermap->InLiquid(glm::vec3(GetPosition())) || zone->IsWaterZone(GetZ());
bool stay_inliquid = (inliquid && IsNPC() && CastToNPC()->IsUnderwaterOnly()); bool stay_inliquid = (inliquid && IsNPC() && CastToNPC()->IsUnderwaterOnly());
bool levitating = IsClient() && (FindType(SE_Levitate) || flymode != GravityBehavior::Ground); bool levitating = IsClient() && (FindType(SpellEffect::Levitate) || flymode != GravityBehavior::Ground);
bool open_outdoor_zone = !zone->CanCastOutdoor() && !zone->IsCity(); bool open_outdoor_zone = !zone->CanCastOutdoor() && !zone->IsCity();
int loop = 0; int loop = 0;
+3 -3
View File
@@ -83,7 +83,7 @@ void command_feature(Client *c, const Seperator *sep)
feature_changed = "Beard Color"; feature_changed = "Beard Color";
value_changed = f.beardcolor; value_changed = f.beardcolor;
} else if (is_details) { } else if (is_details) {
if (t->GetRace() != DRAKKIN) { if (t->GetRace() != Race::Drakkin) {
c->Message(Chat::White, "You must target a Drakkin to use this command."); c->Message(Chat::White, "You must target a Drakkin to use this command.");
return; return;
} }
@@ -116,7 +116,7 @@ void command_feature(Client *c, const Seperator *sep)
feature_changed = "Helmet Texture"; feature_changed = "Helmet Texture";
value_changed = helm_texture; value_changed = helm_texture;
} else if (is_heritage) { } else if (is_heritage) {
if (t->GetRace() != DRAKKIN) { if (t->GetRace() != Race::Drakkin) {
c->Message(Chat::White, "You must target a Drakkin to use this command."); c->Message(Chat::White, "You must target a Drakkin to use this command.");
return; return;
} }
@@ -148,7 +148,7 @@ void command_feature(Client *c, const Seperator *sep)
feature_changed = "Size"; feature_changed = "Size";
value_changed = size; value_changed = size;
} else if (is_tattoo) { } else if (is_tattoo) {
if (t->GetRace() != DRAKKIN) { if (t->GetRace() != Race::Drakkin) {
c->Message(Chat::White, "You must target a Drakkin to use this command."); c->Message(Chat::White, "You must target a Drakkin to use this command.");
return; return;
} }
+2
View File
@@ -1,5 +1,6 @@
#include "../client.h" #include "../client.h"
#include "find/aa.cpp" #include "find/aa.cpp"
#include "find/account.cpp"
#include "find/body_type.cpp" #include "find/body_type.cpp"
#include "find/bot.cpp" #include "find/bot.cpp"
#include "find/bug_category.cpp" #include "find/bug_category.cpp"
@@ -38,6 +39,7 @@ void command_find(Client *c, const Seperator *sep)
std::vector<Cmd> commands = { std::vector<Cmd> commands = {
Cmd{.cmd = "aa", .u = "aa [Search Criteria]", .fn = FindAA, .a = {"#findaa"}}, Cmd{.cmd = "aa", .u = "aa [Search Criteria]", .fn = FindAA, .a = {"#findaa"}},
Cmd{.cmd = "account", .u = "account [Search Criteria]", .fn = FindAccount, .a = {"#findaccount"}},
Cmd{.cmd = "body_type", .u = "body_type [Search Criteria]", .fn = FindBodyType, .a = {"#findbodytype"}}, Cmd{.cmd = "body_type", .u = "body_type [Search Criteria]", .fn = FindBodyType, .a = {"#findbodytype"}},
Cmd{.cmd = "bug_category", .u = "bug_category [Search Criteria]", .fn = FindBugCategory, .a = {"#findbugcategory"}}, Cmd{.cmd = "bug_category", .u = "bug_category [Search Criteria]", .fn = FindBugCategory, .a = {"#findbugcategory"}},
Cmd{.cmd = "character", .u = "character [Search Criteria]", .fn = FindCharacter, .a = {"#findcharacter"}}, Cmd{.cmd = "character", .u = "character [Search Criteria]", .fn = FindCharacter, .a = {"#findcharacter"}},
+50
View File
@@ -0,0 +1,50 @@
#include "../../client.h"
#include "../../common/repositories/account_repository.h"
void FindAccount(Client *c, const Seperator *sep)
{
const uint16 arguments = sep->argnum;
if (arguments < 2) {
c->Message(Chat::White, "Usage: #find account [Character Name]");
c->Message(Chat::White, "Note: Used to print the account ID and name of the account a character belongs to.");
return;
}
const std::string& character_name = sep->arg[2];
const auto& e = CharacterDataRepository::FindByName(database, character_name);
if (!e.id) {
c->Message(
Chat::White,
fmt::format(
"Character '{}' does not exist.",
character_name
).c_str()
);
return;
}
auto a = AccountRepository::FindOne(database, e.account_id);
if (!a.id) {
c->Message(
Chat::White,
fmt::format(
"Character '{}' is not attached to an account.",
character_name
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Account {} ({}) owns the character {}.",
a.name,
a.id,
character_name
).c_str()
);
}
+1
View File
@@ -110,6 +110,7 @@ void SendNPCEditSubCommands(Client *c)
c->Message(Chat::White, "Usage: #npcedit setanimation [Animation ID] - Sets an NPC's Animation on Spawn (Stored in spawn2 table)"); c->Message(Chat::White, "Usage: #npcedit setanimation [Animation ID] - Sets an NPC's Animation on Spawn (Stored in spawn2 table)");
c->Message(Chat::White, "Usage: #npcedit respawntime [Respawn Time] - Sets an NPC's Respawn Timer in Seconds (Stored in spawn2 table)"); c->Message(Chat::White, "Usage: #npcedit respawntime [Respawn Time] - Sets an NPC's Respawn Timer in Seconds (Stored in spawn2 table)");
c->Message(Chat::White, "Usage: #npcedit set_grid [Grid ID] - Sets an NPC's Grid ID"); c->Message(Chat::White, "Usage: #npcedit set_grid [Grid ID] - Sets an NPC's Grid ID");
c->Message(Chat::White, "Usage: #npcedit npc_tint_id [NPC Tint ID] - Sets an NPC's Tint ID (0 to 78 for RoF2)");
} }
void command_npcedit(Client *c, const Seperator *sep) void command_npcedit(Client *c, const Seperator *sep)
+13
View File
@@ -44,6 +44,19 @@ void SetRace(Client *c, const Seperator *sep)
} }
); );
if (race_id == Race::Doug) {
c->Message(
Chat::White,
fmt::format(
"{} {} been returned to {} base race.",
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
c == t ? "have" : "has",
c == t ? "your" : "their"
).c_str()
);
return;
}
c->Message( c->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
+2
View File
@@ -15,6 +15,7 @@
#include "show/group_info.cpp" #include "show/group_info.cpp"
#include "show/hatelist.cpp" #include "show/hatelist.cpp"
#include "show/inventory.cpp" #include "show/inventory.cpp"
#include "show/keyring.cpp"
#include "show/ip_lookup.cpp" #include "show/ip_lookup.cpp"
#include "show/line_of_sight.cpp" #include "show/line_of_sight.cpp"
#include "show/network.cpp" #include "show/network.cpp"
@@ -78,6 +79,7 @@ void command_show(Client *c, const Seperator *sep)
Cmd{.cmd = "hatelist", .u = "hatelist", .fn = ShowHateList, .a = {"#hatelist"}}, Cmd{.cmd = "hatelist", .u = "hatelist", .fn = ShowHateList, .a = {"#hatelist"}},
Cmd{.cmd = "inventory", .u = "inventory", .fn = ShowInventory, .a = {"#peekinv"}}, Cmd{.cmd = "inventory", .u = "inventory", .fn = ShowInventory, .a = {"#peekinv"}},
Cmd{.cmd = "ip_lookup", .u = "ip_lookup", .fn = ShowIPLookup, .a = {"#iplookup"}}, Cmd{.cmd = "ip_lookup", .u = "ip_lookup", .fn = ShowIPLookup, .a = {"#iplookup"}},
Cmd{.cmd = "keyring", .u = "keyring", .fn = ShowKeyring, .a = {"#showkeyring"}},
Cmd{.cmd = "line_of_sight", .u = "line_of_sight", .fn = ShowLineOfSight, .a = {"#checklos"}}, Cmd{.cmd = "line_of_sight", .u = "line_of_sight", .fn = ShowLineOfSight, .a = {"#checklos"}},
Cmd{.cmd = "network", .u = "network", .fn = ShowNetwork, .a = {"#network"}}, Cmd{.cmd = "network", .u = "network", .fn = ShowNetwork, .a = {"#network"}},
Cmd{.cmd = "network_stats", .u = "network_stats", .fn = ShowNetworkStats, .a = {"#netstats"}}, Cmd{.cmd = "network_stats", .u = "network_stats", .fn = ShowNetworkStats, .a = {"#netstats"}},
+1 -1
View File
@@ -9,7 +9,7 @@ void ShowIPLookup(Client *c, const Seperator *sep)
auto pack = new ServerPacket( auto pack = new ServerPacket(
ServerOP_IPLookup, ServerOP_IPLookup,
sizeof(ServerGenericWorldQuery_Struct) + ip_length + 1 sizeof(ServerGenericWorldQuery_Struct) + ip_length
); );
auto s = (ServerGenericWorldQuery_Struct *) pack->pBuffer; auto s = (ServerGenericWorldQuery_Struct *) pack->pBuffer;
+12
View File
@@ -0,0 +1,12 @@
#include "../../client.h"
#include "../../dialogue_window.h"
void ShowKeyring(Client *c, const Seperator *sep)
{
Client* t = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) {
t = c->GetTarget()->CastToClient();
}
t->KeyRingList(c);
}
+21 -21
View File
@@ -16,17 +16,17 @@ void ShowNetwork(Client *c, const Seperator *sep)
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Max Packet Size") + DialogueWindow::TableCell("Max Packet Size") +
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.max_packet_size)) DialogueWindow::TableCell(Strings::Commify(opts.reliable_stream_options.max_packet_size))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Max Connection Count") + DialogueWindow::TableCell("Max Connection Count") +
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.max_connection_count)) DialogueWindow::TableCell(Strings::Commify(opts.reliable_stream_options.max_connection_count))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Keep Alive Delay") + DialogueWindow::TableCell("Keep Alive Delay") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.keepalive_delay_ms)) DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.reliable_stream_options.keepalive_delay_ms))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
@@ -34,64 +34,64 @@ void ShowNetwork(Client *c, const Seperator *sep)
DialogueWindow::TableCell( DialogueWindow::TableCell(
fmt::format( fmt::format(
"{:.2f}", "{:.2f}",
opts.daybreak_options.resend_delay_factor opts.reliable_stream_options.resend_delay_factor
) )
) )
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Resend Delay") + DialogueWindow::TableCell("Resend Delay") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.resend_delay_ms)) DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.reliable_stream_options.resend_delay_ms))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Resend Delay Minimum") + DialogueWindow::TableCell("Resend Delay Minimum") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.resend_delay_min)) DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.reliable_stream_options.resend_delay_min))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Resend Delay Maximum") + DialogueWindow::TableCell("Resend Delay Maximum") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.resend_delay_max)) DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.reliable_stream_options.resend_delay_max))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Connect Delay") + DialogueWindow::TableCell("Connect Delay") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.connect_delay_ms)) DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.reliable_stream_options.connect_delay_ms))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Connect Stale") + DialogueWindow::TableCell("Connect Stale") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.connect_stale_ms)) DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.reliable_stream_options.connect_stale_ms))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Stale Connection") + DialogueWindow::TableCell("Stale Connection") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.stale_connection_ms)) DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.reliable_stream_options.stale_connection_ms))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("CRC Length") + DialogueWindow::TableCell("CRC Length") +
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.crc_length)) DialogueWindow::TableCell(Strings::Commify(opts.reliable_stream_options.crc_length))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Hold Size") + DialogueWindow::TableCell("Hold Size") +
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.hold_size)) DialogueWindow::TableCell(Strings::Commify(opts.reliable_stream_options.hold_size))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Hold Length") + DialogueWindow::TableCell("Hold Length") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.hold_length_ms)) DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.reliable_stream_options.hold_length_ms))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Simulated In Packet Loss") + DialogueWindow::TableCell("Simulated In Packet Loss") +
DialogueWindow::TableCell(std::to_string(opts.daybreak_options.simulated_in_packet_loss)) DialogueWindow::TableCell(std::to_string(opts.reliable_stream_options.simulated_in_packet_loss))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Simulated Out Packet Loss") + DialogueWindow::TableCell("Simulated Out Packet Loss") +
DialogueWindow::TableCell(std::to_string(opts.daybreak_options.simulated_out_packet_loss)) DialogueWindow::TableCell(std::to_string(opts.reliable_stream_options.simulated_out_packet_loss))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
@@ -99,34 +99,34 @@ void ShowNetwork(Client *c, const Seperator *sep)
DialogueWindow::TableCell( DialogueWindow::TableCell(
fmt::format( fmt::format(
"{:.2f}", "{:.2f}",
opts.daybreak_options.tic_rate_hertz opts.reliable_stream_options.tic_rate_hertz
) )
) )
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Resend Timeout") + DialogueWindow::TableCell("Resend Timeout") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.resend_timeout)) DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.reliable_stream_options.resend_timeout))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Connection Close Time") + DialogueWindow::TableCell("Connection Close Time") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.connection_close_time)) DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.reliable_stream_options.connection_close_time))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Encode Passes (1)") + DialogueWindow::TableCell("Encode Passes (1)") +
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.encode_passes[0])) DialogueWindow::TableCell(Strings::Commify(opts.reliable_stream_options.encode_passes[0]))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Encode Passes (2)") + DialogueWindow::TableCell("Encode Passes (2)") +
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.encode_passes[1])) DialogueWindow::TableCell(Strings::Commify(opts.reliable_stream_options.encode_passes[1]))
); );
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Port") + DialogueWindow::TableCell("Port") +
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.port)) DialogueWindow::TableCell(Strings::Commify(opts.reliable_stream_options.port))
); );
popup_table = DialogueWindow::Table(popup_table); popup_table = DialogueWindow::Table(popup_table);
+5 -5
View File
@@ -7,7 +7,7 @@ void ShowNetworkStats(Client *c, const Seperator *sep)
const auto opts = connection->GetManager()->GetOptions(); const auto opts = connection->GetManager()->GetOptions();
const auto eqs_stats = connection->GetStats(); const auto eqs_stats = connection->GetStats();
const auto& stats = eqs_stats.DaybreakStats; const auto& stats = eqs_stats.ReliableStreamStats;
const auto sec_since_stats_reset = std::chrono::duration_cast<std::chrono::duration<double>>( const auto sec_since_stats_reset = std::chrono::duration_cast<std::chrono::duration<double>>(
EQ::Net::Clock::now() - stats.created EQ::Net::Clock::now() - stats.created
@@ -217,7 +217,7 @@ void ShowNetworkStats(Client *c, const Seperator *sep)
) )
); );
if (opts.daybreak_options.outgoing_data_rate > 0.0) { if (opts.reliable_stream_options.outgoing_data_rate > 0.0) {
popup_table += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Outgoing Link Saturation") + DialogueWindow::TableCell("Outgoing Link Saturation") +
DialogueWindow::TableCell( DialogueWindow::TableCell(
@@ -229,14 +229,14 @@ void ShowNetworkStats(Client *c, const Seperator *sep)
1.0 - 1.0 -
( (
( (
opts.daybreak_options.outgoing_data_rate - opts.reliable_stream_options.outgoing_data_rate -
stats.datarate_remaining stats.datarate_remaining
) / ) /
opts.daybreak_options.outgoing_data_rate opts.reliable_stream_options.outgoing_data_rate
) )
) )
), ),
opts.daybreak_options.outgoing_data_rate opts.reliable_stream_options.outgoing_data_rate
) )
) )
); );
+1 -1
View File
@@ -10,7 +10,7 @@ void ShowRecipe(Client *c, const Seperator *sep)
return; return;
} }
const uint16 recipe_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[2])); const uint32 recipe_id = Strings::ToUnsignedInt(sep->arg[2]);
const auto& re = TradeskillRecipeEntriesRepository::GetWhere( const auto& re = TradeskillRecipeEntriesRepository::GetWhere(
content_db, content_db,
+49 -5
View File
@@ -2472,19 +2472,63 @@ bool Group::AmIPuller(const char *mob_name)
return !((bool)PullerName.compare(mob_name)); return !((bool)PullerName.compare(mob_name));
} }
bool Group::HasRole(Mob *m, uint8 Role) bool Group::HasRole(Mob* m, uint8 Role)
{ {
if(!m) if (!m) {
return false; return false;
}
for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) for (uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) {
{ if (m == members[i] && MemberRoles[i] & Role) {
if((m == members[i]) && (MemberRoles[i] & Role))
return true; return true;
} }
}
return false; return false;
} }
uint8 Group::GetMemberRole(Mob* m)
{
if (!m) {
return 0;
}
for (uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) {
if (m == members[i]) {
uint8 role = MemberRoles[i];
if (m == leader) {
role |= RoleLeader;
}
return role;
}
}
return 0;
}
uint8 Group::GetMemberRole(const char* name)
{
if (!name) {
return 0;
}
for (uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) {
if (!strcasecmp(membername[i], name)) {
uint8 role = MemberRoles[i];
if (leader && !strcasecmp(leader->GetName(), name)) {
role |= RoleLeader;
}
return role;
}
}
return 0;
}
void Group::QueueClients(Mob *sender, const EQApplicationPacket *app, bool ack_required /*= true*/, bool ignore_sender /*= true*/, float distance /*= 0*/) { void Group::QueueClients(Mob *sender, const EQApplicationPacket *app, bool ack_required /*= true*/, bool ignore_sender /*= true*/, float distance /*= 0*/) {
if (sender && sender->IsClient()) { if (sender && sender->IsClient()) {
for (uint32 i = 0; i < MAX_GROUP_MEMBERS; i++) { for (uint32 i = 0; i < MAX_GROUP_MEMBERS; i++) {
+8 -1
View File
@@ -30,7 +30,12 @@ class Mob;
#define MAX_MARKED_NPCS 3 #define MAX_MARKED_NPCS 3
enum { RoleAssist = 1, RoleTank = 2, RolePuller = 4 }; enum {
RoleAssist = 1,
RoleTank = 2,
RolePuller = 4,
RoleLeader = 8
};
class GroupIDConsumer { class GroupIDConsumer {
public: public:
@@ -119,6 +124,8 @@ public:
void SetGroupTankTarget(Mob *m); void SetGroupTankTarget(Mob *m);
void SetGroupPullerTarget(Mob *m); void SetGroupPullerTarget(Mob *m);
bool HasRole(Mob *m, uint8 Role); bool HasRole(Mob *m, uint8 Role);
uint8 GetMemberRole(Mob* m);
uint8 GetMemberRole(const char* name);
void NotifyAssistTarget(Client *c); void NotifyAssistTarget(Client *c);
void NotifyTankTarget(Client *c); void NotifyTankTarget(Client *c);
void NotifyPullerTarget(Client *c); void NotifyPullerTarget(Client *c);
+14
View File
@@ -664,6 +664,18 @@ void Lua_Bot::RaidGroupSay(const char* message) {
self->RaidGroupSay(message); self->RaidGroupSay(message);
} }
int Lua_Bot::GetStatCap(uint8 stat_id)
{
Lua_Safe_Call_Int();
return self->GetStatCap(stat_id);
}
void Lua_Bot::SetStatCap(uint8 stat_id, int stat_cap)
{
Lua_Safe_Call_Void();
self->SetStatCap(stat_id, stat_cap, true);
}
luabind::scope lua_register_bot() { luabind::scope lua_register_bot() {
return luabind::class_<Lua_Bot, Lua_Mob>("Bot") return luabind::class_<Lua_Bot, Lua_Mob>("Bot")
.def(luabind::constructor<>()) .def(luabind::constructor<>())
@@ -747,6 +759,7 @@ luabind::scope lua_register_bot() {
.def("GetSpellDamage", (int(Lua_Bot::*)(void))&Lua_Bot::GetSpellDamage) .def("GetSpellDamage", (int(Lua_Bot::*)(void))&Lua_Bot::GetSpellDamage)
.def("GetSpellRecastTimer", (uint32(Lua_Bot::*)())&Lua_Bot::GetSpellRecastTimer) .def("GetSpellRecastTimer", (uint32(Lua_Bot::*)())&Lua_Bot::GetSpellRecastTimer)
.def("GetSpellRecastTimer", (uint32(Lua_Bot::*)(uint16))&Lua_Bot::GetSpellRecastTimer) .def("GetSpellRecastTimer", (uint32(Lua_Bot::*)(uint16))&Lua_Bot::GetSpellRecastTimer)
.def("GetStatCap", (int(Lua_Bot::*)(uint8))&Lua_Bot::GetStatCap)
.def("HasAugmentEquippedByID", (bool(Lua_Bot::*)(uint32))&Lua_Bot::HasAugmentEquippedByID) .def("HasAugmentEquippedByID", (bool(Lua_Bot::*)(uint32))&Lua_Bot::HasAugmentEquippedByID)
.def("HasBotItem", (int16(Lua_Bot::*)(uint32))&Lua_Bot::HasBotItem) .def("HasBotItem", (int16(Lua_Bot::*)(uint32))&Lua_Bot::HasBotItem)
.def("HasBotSpellEntry", (bool(Lua_Bot::*)(uint16))&Lua_Bot::HasBotSpellEntry) .def("HasBotSpellEntry", (bool(Lua_Bot::*)(uint16))&Lua_Bot::HasBotSpellEntry)
@@ -783,6 +796,7 @@ luabind::scope lua_register_bot() {
.def("SetSpellDurationRaid", (void(Lua_Bot::*)(int,int,int,bool,bool))&Lua_Bot::SetSpellDurationRaid) .def("SetSpellDurationRaid", (void(Lua_Bot::*)(int,int,int,bool,bool))&Lua_Bot::SetSpellDurationRaid)
.def("SetSpellRecastTimer", (void(Lua_Bot::*)(uint16))&Lua_Bot::SetSpellRecastTimer) .def("SetSpellRecastTimer", (void(Lua_Bot::*)(uint16))&Lua_Bot::SetSpellRecastTimer)
.def("SetSpellRecastTimer", (void(Lua_Bot::*)(uint16, uint32))&Lua_Bot::SetSpellRecastTimer) .def("SetSpellRecastTimer", (void(Lua_Bot::*)(uint16, uint32))&Lua_Bot::SetSpellRecastTimer)
.def("SetStatCap", (void(Lua_Bot::*)(uint8,int))&Lua_Bot::SetStatCap)
.def("SendPayload", (void(Lua_Bot::*)(int))&Lua_Bot::SendPayload) .def("SendPayload", (void(Lua_Bot::*)(int))&Lua_Bot::SendPayload)
.def("SendPayload", (void(Lua_Bot::*)(int,std::string))&Lua_Bot::SendPayload) .def("SendPayload", (void(Lua_Bot::*)(int,std::string))&Lua_Bot::SendPayload)
.def("Signal", (void(Lua_Bot::*)(int))&Lua_Bot::Signal) .def("Signal", (void(Lua_Bot::*)(int))&Lua_Bot::Signal)
+2
View File
@@ -126,6 +126,8 @@ public:
void SetItemReuseTimer(uint32 item_id, uint32 reuse_timer); void SetItemReuseTimer(uint32 item_id, uint32 reuse_timer);
void SetSpellRecastTimer(uint16 spell_id); void SetSpellRecastTimer(uint16 spell_id);
void SetSpellRecastTimer(uint16 spell_id, uint32 reuse_timer); void SetSpellRecastTimer(uint16 spell_id, uint32 reuse_timer);
int GetStatCap(uint8 stat_id);
void SetStatCap(uint8 stat_id, int stat_cap);
uint32 CountAugmentEquippedByID(uint32 item_id); uint32 CountAugmentEquippedByID(uint32 item_id);
uint32 CountItemEquippedByID(uint32 item_id); uint32 CountItemEquippedByID(uint32 item_id);
+39 -1
View File
@@ -3575,7 +3575,13 @@ bool Lua_Client::KeyRingClear()
void Lua_Client::KeyRingList() void Lua_Client::KeyRingList()
{ {
Lua_Safe_Call_Void(); Lua_Safe_Call_Void();
self->KeyRingList(); self->KeyRingList(self);
}
void Lua_Client::KeyRingList(Lua_Client c)
{
Lua_Safe_Call_Void();
self->KeyRingList(self);
} }
bool Lua_Client::KeyRingRemove(uint32 item_id) bool Lua_Client::KeyRingRemove(uint32 item_id)
@@ -3602,6 +3608,34 @@ void Lua_Client::EnableTitleSet(uint32 title_set) {
self->EnableTitle(title_set); self->EnableTitle(title_set);
} }
luabind::object Lua_Client::GetKeyRing(lua_State* L)
{
auto lua_table = luabind::newtable(L);
if (d_) {
auto self = reinterpret_cast<NativeType *>(d_);
int index = 1;
for (const uint32& item_id: self->GetKeyRing()) {
lua_table[index] = item_id;
index++;
}
}
return lua_table;
}
int Lua_Client::GetStatCap(uint8 stat_id)
{
Lua_Safe_Call_Int();
return self->GetStatCap(stat_id);
}
void Lua_Client::SetStatCap(uint8 stat_id, int stat_cap)
{
Lua_Safe_Call_Void();
self->SetStatCap(stat_id, stat_cap, true);
}
luabind::scope lua_register_client() { luabind::scope lua_register_client() {
return luabind::class_<Lua_Client, Lua_Mob>("Client") return luabind::class_<Lua_Client, Lua_Mob>("Client")
.def(luabind::constructor<>()) .def(luabind::constructor<>())
@@ -3832,6 +3866,7 @@ luabind::scope lua_register_client() {
.def("GetInvulnerableEnvironmentDamage", (bool(Lua_Client::*)(void))&Lua_Client::GetInvulnerableEnvironmentDamage) .def("GetInvulnerableEnvironmentDamage", (bool(Lua_Client::*)(void))&Lua_Client::GetInvulnerableEnvironmentDamage)
.def("GetItemIDAt", (int(Lua_Client::*)(int))&Lua_Client::GetItemIDAt) .def("GetItemIDAt", (int(Lua_Client::*)(int))&Lua_Client::GetItemIDAt)
.def("GetItemCooldown", (uint32(Lua_Client::*)(uint32))&Lua_Client::GetItemCooldown) .def("GetItemCooldown", (uint32(Lua_Client::*)(uint32))&Lua_Client::GetItemCooldown)
.def("GetKeyRing", (luabind::object(Lua_Client::*)(lua_State* L))&Lua_Client::GetKeyRing)
.def("GetLDoNLosses", (int(Lua_Client::*)(void))&Lua_Client::GetLDoNLosses) .def("GetLDoNLosses", (int(Lua_Client::*)(void))&Lua_Client::GetLDoNLosses)
.def("GetLDoNLossesTheme", (int(Lua_Client::*)(int))&Lua_Client::GetLDoNLossesTheme) .def("GetLDoNLossesTheme", (int(Lua_Client::*)(int))&Lua_Client::GetLDoNLossesTheme)
.def("GetLDoNPointsTheme", (int(Lua_Client::*)(int))&Lua_Client::GetLDoNPointsTheme) .def("GetLDoNPointsTheme", (int(Lua_Client::*)(int))&Lua_Client::GetLDoNPointsTheme)
@@ -3875,6 +3910,7 @@ luabind::scope lua_register_client() {
.def("GetSpellDamage", (int(Lua_Client::*)(void))&Lua_Client::GetSpellDamage) .def("GetSpellDamage", (int(Lua_Client::*)(void))&Lua_Client::GetSpellDamage)
.def("GetSpellIDByBookSlot", (uint32(Lua_Client::*)(int))&Lua_Client::GetSpellIDByBookSlot) .def("GetSpellIDByBookSlot", (uint32(Lua_Client::*)(int))&Lua_Client::GetSpellIDByBookSlot)
.def("GetSpentAA", (int(Lua_Client::*)(void))&Lua_Client::GetSpentAA) .def("GetSpentAA", (int(Lua_Client::*)(void))&Lua_Client::GetSpentAA)
.def("GetStatCap", (int(Lua_Client::*)(uint8))&Lua_Client::GetStatCap)
.def("GetStartZone", (int(Lua_Client::*)(void))&Lua_Client::GetStartZone) .def("GetStartZone", (int(Lua_Client::*)(void))&Lua_Client::GetStartZone)
.def("GetTargetRingX", (float(Lua_Client::*)(void))&Lua_Client::GetTargetRingX) .def("GetTargetRingX", (float(Lua_Client::*)(void))&Lua_Client::GetTargetRingX)
.def("GetTargetRingY", (float(Lua_Client::*)(void))&Lua_Client::GetTargetRingY) .def("GetTargetRingY", (float(Lua_Client::*)(void))&Lua_Client::GetTargetRingY)
@@ -3932,6 +3968,7 @@ luabind::scope lua_register_client() {
.def("KeyRingCheck", (bool(Lua_Client::*)(uint32))&Lua_Client::KeyRingCheck) .def("KeyRingCheck", (bool(Lua_Client::*)(uint32))&Lua_Client::KeyRingCheck)
.def("KeyRingClear", (bool(Lua_Client::*)(void))&Lua_Client::KeyRingClear) .def("KeyRingClear", (bool(Lua_Client::*)(void))&Lua_Client::KeyRingClear)
.def("KeyRingList", (void(Lua_Client::*)(void))&Lua_Client::KeyRingList) .def("KeyRingList", (void(Lua_Client::*)(void))&Lua_Client::KeyRingList)
.def("KeyRingList", (void(Lua_Client::*)(Lua_Client))&Lua_Client::KeyRingList)
.def("KeyRingRemove", (bool(Lua_Client::*)(uint32))&Lua_Client::KeyRingRemove) .def("KeyRingRemove", (bool(Lua_Client::*)(uint32))&Lua_Client::KeyRingRemove)
.def("Kick", (void(Lua_Client::*)(void))&Lua_Client::Kick) .def("Kick", (void(Lua_Client::*)(void))&Lua_Client::Kick)
.def("LearnDisciplines", (uint16(Lua_Client::*)(uint8,uint8))&Lua_Client::LearnDisciplines) .def("LearnDisciplines", (uint16(Lua_Client::*)(uint8,uint8))&Lua_Client::LearnDisciplines)
@@ -4139,6 +4176,7 @@ luabind::scope lua_register_client() {
.def("SetStartZone", (void(Lua_Client::*)(int,float))&Lua_Client::SetStartZone) .def("SetStartZone", (void(Lua_Client::*)(int,float))&Lua_Client::SetStartZone)
.def("SetStartZone", (void(Lua_Client::*)(int,float,float))&Lua_Client::SetStartZone) .def("SetStartZone", (void(Lua_Client::*)(int,float,float))&Lua_Client::SetStartZone)
.def("SetStartZone", (void(Lua_Client::*)(int,float,float,float))&Lua_Client::SetStartZone) .def("SetStartZone", (void(Lua_Client::*)(int,float,float,float))&Lua_Client::SetStartZone)
.def("SetStatCap", (void(Lua_Client::*)(uint8,int))&Lua_Client::SetStatCap)
.def("SetStats", (void(Lua_Client::*)(int,int))&Lua_Client::SetStats) .def("SetStats", (void(Lua_Client::*)(int,int))&Lua_Client::SetStats)
.def("SetThirst", (void(Lua_Client::*)(int))&Lua_Client::SetThirst) .def("SetThirst", (void(Lua_Client::*)(int))&Lua_Client::SetThirst)
.def("SetTint", (void(Lua_Client::*)(int,uint32))&Lua_Client::SetTint) .def("SetTint", (void(Lua_Client::*)(int,uint32))&Lua_Client::SetTint)
+4
View File
@@ -521,9 +521,11 @@ public:
bool KeyRingCheck(uint32 item_id); bool KeyRingCheck(uint32 item_id);
bool KeyRingClear(); bool KeyRingClear();
void KeyRingList(); void KeyRingList();
void KeyRingList(Lua_Client c);
bool KeyRingRemove(uint32 item_id); bool KeyRingRemove(uint32 item_id);
bool CompleteTask(int task_id); bool CompleteTask(int task_id);
bool UncompleteTask(int task_id); bool UncompleteTask(int task_id);
luabind::object GetKeyRing(lua_State* L);
// account data buckets // account data buckets
void SetAccountBucket(std::string bucket_name, std::string bucket_value); void SetAccountBucket(std::string bucket_name, std::string bucket_value);
@@ -605,6 +607,8 @@ public:
bool RemoveAAPoints(uint32 points); bool RemoveAAPoints(uint32 points);
bool RemoveAlternateCurrencyValue(uint32 currency_id, uint32 amount); bool RemoveAlternateCurrencyValue(uint32 currency_id, uint32 amount);
bool AreTasksCompleted(luabind::object task_ids); bool AreTasksCompleted(luabind::object task_ids);
int GetStatCap(uint8 stat_id);
void SetStatCap(uint8 stat_id, int stat_cap);
void DialogueWindow(std::string markdown); void DialogueWindow(std::string markdown);

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