mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-22 16:28:28 +00:00
Compare commits
110 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c0a88de4fb | |||
| 5117843089 | |||
| 77c7ea191a | |||
| 527798db92 | |||
| 3ea644b732 | |||
| 3850343254 | |||
| 77597c7868 | |||
| 8a0ef65373 | |||
| 75d9e6ffaf | |||
| e9ca2b4202 | |||
| a29a2321f1 | |||
| 5ff9407e26 | |||
| 20e135fbc4 | |||
| e21c386bda | |||
| 73a85135b2 | |||
| 87b1dc4b03 | |||
| b2bf1d2b6f | |||
| 4a8b89f93a | |||
| 1cccca45a0 | |||
| 8af4fb2330 | |||
| 4d118ab978 | |||
| fcb40daaf1 | |||
| 553bafdbe1 | |||
| d0443db199 | |||
| 9206163190 | |||
| e504482b94 | |||
| 77b88e3dec | |||
| aeeb350068 | |||
| df83113cea | |||
| 940abfaf7a | |||
| a46443b95e | |||
| 871f320311 | |||
| a222128599 | |||
| 45b249e33d | |||
| c24834de5d | |||
| 841d7f2700 | |||
| 56c29154f0 | |||
| 6466c2ff21 | |||
| 16dc210cd8 | |||
| 77045f558e | |||
| e1fa2d5bc5 | |||
| b03f52de18 | |||
| 226cc3d6cb | |||
| 7f54e26dec | |||
| 11a81d8e8a | |||
| e719aa43cf | |||
| 22994e3264 | |||
| cfbdecad19 | |||
| 2427f7e034 | |||
| 9a6403b196 | |||
| d8953c5156 | |||
| 33b40e83b7 | |||
| e75c31d524 | |||
| cf1f8d5460 | |||
| 690cacdaab | |||
| f9f45eedcd | |||
| 93ddffa57f | |||
| c9993fb698 | |||
| aa0fbb8b45 | |||
| 62532c6bdd | |||
| f8c3c03185 | |||
| 692a90f3f0 | |||
| 3a49d851ca | |||
| fdc5c27061 | |||
| 56be69ddb1 | |||
| 9477ff72ac | |||
| 6d8e80b1e5 | |||
| ebeaef598b | |||
| 60b65da7f2 | |||
| 100e6698ea | |||
| 2bd94ab7a2 | |||
| 4c8d68c24b | |||
| 1755678b1f | |||
| 39e2763968 | |||
| f7780b0247 | |||
| c0fe0f11f7 | |||
| a1f1f11940 | |||
| 4c5013e09e | |||
| 838ffbd8c7 | |||
| 42b41d973c | |||
| e7761133a9 | |||
| 93f2bea96e | |||
| ded82ac6d6 | |||
| 6ef182edfd | |||
| e466ca1c6d | |||
| fa5a3155fe | |||
| a20d333f9d | |||
| 853739b538 | |||
| 6094ec9c7b | |||
| 9da1d6b397 | |||
| 8ea7299a57 | |||
| 0811a899d1 | |||
| fad9599642 | |||
| 62711b13d8 | |||
| 2702485206 | |||
| 0aadb891a1 | |||
| d812310c5b | |||
| 1420983700 | |||
| d25cc35f1b | |||
| ed7f395612 | |||
| 8dceb20dd8 | |||
| 6929d180ca | |||
| 011a66a75e | |||
| 07120563a2 | |||
| cc985cbcd5 | |||
| 97caa79472 | |||
| cfa575c756 | |||
| 85063249b4 | |||
| 04d6f8feea | |||
| dfc1bf0381 |
+236
@@ -1,3 +1,239 @@
|
||||
## [22.36.0] - 12/16/2023
|
||||
|
||||
### Bots
|
||||
|
||||
* Add rule to toggle DT hitting owner ([#3757](https://github.com/EQEmu/Server/pull/3757)) @nytmyr 2023-12-11
|
||||
* Enable auto-saving of bots. ([#3758](https://github.com/EQEmu/Server/pull/3758)) @nytmyr 2023-12-13
|
||||
|
||||
### Code
|
||||
|
||||
* Cleanup classes.cpp/classes.h ([#3752](https://github.com/EQEmu/Server/pull/3752)) @Kinglykrab 2023-12-13
|
||||
|
||||
### Corpse
|
||||
|
||||
* Fix /corpse command regression from #3727 ([#3770](https://github.com/EQEmu/Server/pull/3770)) @Akkadius 2023-12-16
|
||||
|
||||
### Database
|
||||
|
||||
* Make it clearer to users that a database backup is occurring ([#3769](https://github.com/EQEmu/Server/pull/3769)) @Akkadius 2023-12-16
|
||||
* When database version is greater than binary, we are up to date ([#3771](https://github.com/EQEmu/Server/pull/3771)) @Akkadius 2023-12-16
|
||||
|
||||
### Fixes
|
||||
|
||||
* Fix Starting Items SQL ([#3766](https://github.com/EQEmu/Server/pull/3766)) @Kinglykrab 2023-12-16
|
||||
|
||||
### Logging
|
||||
|
||||
* Change empty object loading to warning ([#3759](https://github.com/EQEmu/Server/pull/3759)) @nytmyr 2023-12-11
|
||||
|
||||
### Rules
|
||||
|
||||
* Add DOT and HOT Rules ([#3760](https://github.com/EQEmu/Server/pull/3760)) @Kinglykrab 2023-12-16
|
||||
|
||||
## [22.35.0] - 12/10/2023
|
||||
|
||||
### Bots
|
||||
|
||||
* Add BotHealOnLevel to fully heal/mana on level. ([#3745](https://github.com/EQEmu/Server/pull/3745)) @nytmyr 2023-12-08
|
||||
* Fix bots learning spells on level ([#3744](https://github.com/EQEmu/Server/pull/3744)) @nytmyr 2023-12-08
|
||||
|
||||
### Bug
|
||||
|
||||
* Fix blocked spells regression from #3638 ([#3753](https://github.com/EQEmu/Server/pull/3753)) @joligario 2023-12-11
|
||||
* PR 3638 Missed the blocked spells repository updates ([#3748](https://github.com/EQEmu/Server/pull/3748)) @fryguy503 2023-12-08
|
||||
|
||||
### CMake
|
||||
|
||||
* Update minimum version of CMake ([#3743](https://github.com/EQEmu/Server/pull/3743)) @joligario 2023-12-08
|
||||
|
||||
### Code
|
||||
|
||||
* Remove hard-coded Status Checks ([#3727](https://github.com/EQEmu/Server/pull/3727)) @Kinglykrab 2023-12-03
|
||||
|
||||
### Commands
|
||||
|
||||
* #guild set CharName 0 did not remove char from guild. ([#3717](https://github.com/EQEmu/Server/pull/3717)) @noudess 2023-11-25
|
||||
* #petname changes PC to Nobody if selected. ([#3720](https://github.com/EQEmu/Server/pull/3720)) @noudess 2023-11-26
|
||||
* Add #show aas Command ([#3710](https://github.com/EQEmu/Server/pull/3710)) @Kinglykrab 2023-11-26
|
||||
* Add #task complete Command ([#3711](https://github.com/EQEmu/Server/pull/3711)) @Kinglykrab 2023-11-26
|
||||
* Cleanup #acceptrules Command ([#3716](https://github.com/EQEmu/Server/pull/3716)) @Kinglykrab 2023-11-26
|
||||
* Cleanup #disarmtrap Command ([#3713](https://github.com/EQEmu/Server/pull/3713)) @Kinglykrab 2023-11-26
|
||||
* Cleanup #list Command ([#3714](https://github.com/EQEmu/Server/pull/3714)) @Kinglykrab 2023-11-26
|
||||
* Cleanup #movement Command ([#3715](https://github.com/EQEmu/Server/pull/3715)) @Kinglykrab 2023-11-26
|
||||
* Cleanup #object Command ([#3722](https://github.com/EQEmu/Server/pull/3722)) @Kinglykrab 2023-12-03
|
||||
* Cleanup #zonebootup and #zoneshutdown Commands ([#3729](https://github.com/EQEmu/Server/pull/3729)) @Kinglykrab 2023-12-03
|
||||
* Fix formatting of #wpinfo output. ([#3728](https://github.com/EQEmu/Server/pull/3728)) @noudess 2023-12-01
|
||||
|
||||
### Database
|
||||
|
||||
* Add primary key to keyring table ([#3746](https://github.com/EQEmu/Server/pull/3746)) @Kinglykrab 2023-12-08
|
||||
* Consolidate Starting Items Table ([#3723](https://github.com/EQEmu/Server/pull/3723)) @Kinglykrab 2023-11-30
|
||||
* Extra whitespace in #3723 ([#3730](https://github.com/EQEmu/Server/pull/3730)) @joligario 2023-12-02
|
||||
* Minor adjustment to #3726 ([#3732](https://github.com/EQEmu/Server/pull/3732)) @joligario 2023-12-03
|
||||
* Modify `updated` column in `items` table with proper default. ([#3726](https://github.com/EQEmu/Server/pull/3726)) @joligario 2023-12-02
|
||||
* Pull Spell Group Cache from Content DB ([#3749](https://github.com/EQEmu/Server/pull/3749)) @fryguy503 2023-12-08
|
||||
|
||||
### Faction
|
||||
|
||||
* Alliance line is only allowed 1 faction change at a time. ([#3718](https://github.com/EQEmu/Server/pull/3718)) @noudess 2023-11-26
|
||||
|
||||
### Fixes
|
||||
|
||||
* Changing Group Leader Invalidated GetLeaderName() ([#3712](https://github.com/EQEmu/Server/pull/3712)) @Kinglykrab 2023-11-26
|
||||
* Fix 9245 SQL ([#3740](https://github.com/EQEmu/Server/pull/3740)) @Kinglykrab 2023-12-05
|
||||
* Fix Swarm Pets Requiring NPC Aggros Flag ([#3738](https://github.com/EQEmu/Server/pull/3738)) @Kinglykrab 2023-12-05
|
||||
* Guild Message Limits ([#3724](https://github.com/EQEmu/Server/pull/3724)) @neckkola 2023-11-29
|
||||
|
||||
### Quest API
|
||||
|
||||
* Add EVENT_AA_GAIN to AddAAPoints() ([#3733](https://github.com/EQEmu/Server/pull/3733)) @Kinglykrab 2023-12-03
|
||||
* Add GMMove Overloads to Perl/Lua ([#3719](https://github.com/EQEmu/Server/pull/3719)) @Kinglykrab 2023-11-25
|
||||
|
||||
### Scripts
|
||||
|
||||
* Import items into `items_new` table instead of writing directly to the existing `items` table. ([#3725](https://github.com/EQEmu/Server/pull/3725)) @joligario 2023-11-30
|
||||
* Revert database engine change from #3702. ([#3736](https://github.com/EQEmu/Server/pull/3736)) @joligario 2023-12-03
|
||||
* Update 13th Floor Import Tool ([#3702](https://github.com/EQEmu/Server/pull/3702)) @joligario 2023-11-26
|
||||
|
||||
## [22.34.2] - 11/23/2023
|
||||
|
||||
### Admin
|
||||
|
||||
* Update date in changelog ([#3698](https://github.com/EQEmu/Server/pull/3698)) @joligario 2023-11-19
|
||||
|
||||
### Code
|
||||
|
||||
* Fix typo in #giveitem ([#3704](https://github.com/EQEmu/Server/pull/3704)) @Kinglykrab 2023-11-22
|
||||
|
||||
### Fixes
|
||||
|
||||
* Add "IgnoreLevelBasedHasteCaps" rule to GetHaste() ([#3705](https://github.com/EQEmu/Server/pull/3705)) @jcr4990 2023-11-23
|
||||
* Fix bots/Mercenaries being removed from hatelist ([#3708](https://github.com/EQEmu/Server/pull/3708)) @Kinglykrab 2023-11-23
|
||||
* Fix some spell types failing IsValidSpellRange check ([#3707](https://github.com/EQEmu/Server/pull/3707)) @nytmyr 2023-11-23
|
||||
|
||||
### Loginserver
|
||||
|
||||
* Update ticket login table structure ([#3703](https://github.com/EQEmu/Server/pull/3703)) @KimLS 2023-11-22
|
||||
|
||||
## [22.34.1] - 11/20/2023
|
||||
|
||||
### EQTime
|
||||
|
||||
Hotfix for world not spamming save messages by setting to detail level logging @Akkadius 2023-11-20
|
||||
|
||||
## [22.34.0] - 11/19/2023
|
||||
|
||||
### Bots
|
||||
|
||||
* Add ownerraid, byclass and byrace actionables and fix group-based arguments for raids. ([#3680](https://github.com/EQEmu/Server/pull/3680)) @nytmyr 2023-11-19
|
||||
|
||||
### Code
|
||||
|
||||
* Cleanup #giveitem and #summonitem ([#3692](https://github.com/EQEmu/Server/pull/3692)) @Kinglykrab 2023-11-19
|
||||
* Cleanup #show currencies Command ([#3693](https://github.com/EQEmu/Server/pull/3693)) @Kinglykrab 2023-11-19
|
||||
|
||||
### Commands
|
||||
|
||||
* Add #show aa_points Command ([#3695](https://github.com/EQEmu/Server/pull/3695)) @Kinglykrab 2023-11-19
|
||||
|
||||
### Database
|
||||
|
||||
* Pull pet power from content database ([#3689](https://github.com/EQEmu/Server/pull/3689)) @joligario 2023-11-18
|
||||
|
||||
### GM Commands
|
||||
|
||||
* Add `#takeplatinum` ([#3690](https://github.com/EQEmu/Server/pull/3690)) @joligario 2023-11-19
|
||||
* Remove duplicate comment ([#3691](https://github.com/EQEmu/Server/pull/3691)) @joligario 2023-11-19
|
||||
|
||||
### Illusions
|
||||
|
||||
* RandomizeFeastures erased texture. ([#3686](https://github.com/EQEmu/Server/pull/3686)) @noudess 2023-11-12
|
||||
|
||||
### Spawn
|
||||
|
||||
* (imported from takp) Added min_time and max_time to spawnentry. This will prevent a NPC from… ([#3685](https://github.com/EQEmu/Server/pull/3685)) @regneq 2023-11-18
|
||||
|
||||
## [22.33.0] - 11/11/2023
|
||||
|
||||
### Feature
|
||||
|
||||
* Add Comment to Item Data/Quest API ([#3669](https://github.com/EQEmu/Server/pull/3669)) @Kinglykrab 2023-11-07
|
||||
|
||||
### Spawn2
|
||||
|
||||
* Fix edge case with instances not copying disabled spawn state ([#3688](https://github.com/EQEmu/Server/pull/3688)) @Akkadius 2023-11-12
|
||||
|
||||
## [22.32.1] - 11/6/2023
|
||||
|
||||
### Hotfix
|
||||
|
||||
* Adjust spawn2_disabled migration to copy data over
|
||||
|
||||
## [22.32.0] - 11/6/2023
|
||||
|
||||
### Bots
|
||||
|
||||
* Fix invalid races from being created ([#3681](https://github.com/EQEmu/Server/pull/3681)) @nytmyr 2023-11-06
|
||||
|
||||
### Crash
|
||||
|
||||
* Fix crash on CentOS when forming a raid with PCs or BOTs ([#3676](https://github.com/EQEmu/Server/pull/3676)) @neckkola 2023-11-06
|
||||
|
||||
### Fixes
|
||||
|
||||
* Add IsTGBCompatibleSpell() to package.add ([#3675](https://github.com/EQEmu/Server/pull/3675)) @Kinglykrab 2023-11-04
|
||||
* Fix Perl__worldwideremovetask package ([#3670](https://github.com/EQEmu/Server/pull/3670)) @Kinglykrab 2023-11-04
|
||||
* Revert " Fix Killed XYZH support in EVENT_DEATH in Perl. " (#3682) ([#3591](https://github.com/EQEmu/Server/pull/3591)) @fryguy503 2023-11-06
|
||||
CRASH
|
||||
|
||||
### GCC
|
||||
|
||||
* Compatibility fix for GCC 13 ([#3677](https://github.com/EQEmu/Server/pull/3677)) @joligario 2023-11-05
|
||||
|
||||
### Parser
|
||||
|
||||
* Cleanup Spire Parsing for crosszonemoveplayerbycharid ([#3674](https://github.com/EQEmu/Server/pull/3674)) @Kinglykrab 2023-11-04
|
||||
* Cleanup Spire Parsing for crosszonemoveplayerbyexpeditionid ([#3671](https://github.com/EQEmu/Server/pull/3671)) @Kinglykrab 2023-11-04
|
||||
* Cleanup Spire Parsing for crosszonemoveplayerbygroupid ([#3673](https://github.com/EQEmu/Server/pull/3673)) @Kinglykrab 2023-11-04
|
||||
* Cleanup Spire Parsing for crosszonemoveplayerbyguildid ([#3672](https://github.com/EQEmu/Server/pull/3672)) @Kinglykrab 2023-11-04
|
||||
|
||||
### Quest API
|
||||
|
||||
* Add GetBaseRaceName() to Perl and Lua ([#3668](https://github.com/EQEmu/Server/pull/3668)) @joligario 2023-11-01
|
||||
* Add details to Lua event dispatch errors ([#3679](https://github.com/EQEmu/Server/pull/3679)) @hgtw 2023-11-06
|
||||
|
||||
### Spawn
|
||||
|
||||
* Split spawn2 enabled into its own state table ([#3664](https://github.com/EQEmu/Server/pull/3664)) @Akkadius 2023-11-06
|
||||
|
||||
### Spells
|
||||
|
||||
* Added IsNightTime() for Dance of the Fireflies ([#3667](https://github.com/EQEmu/Server/pull/3667)) @regneq 2023-11-04
|
||||
|
||||
## [22.31.3] - 10/31/2023
|
||||
|
||||
### Bug
|
||||
|
||||
* Force raids off content database ([#3665](https://github.com/EQEmu/Server/pull/3665)) @joligario 2023-10-31
|
||||
|
||||
### Crash
|
||||
|
||||
* Revert " Fix spell in AESpell related to beacons " ([#3659](https://github.com/EQEmu/Server/pull/3659)) @Akkadius 2023-10-31
|
||||
|
||||
### Fixes
|
||||
|
||||
* Fix issue with blocked spells not loading properly @Akkadius 2023-10-31
|
||||
|
||||
### Logs
|
||||
|
||||
* Convert Loot Messages to Error Logs ([#3663](https://github.com/EQEmu/Server/pull/3663)) @Kinglykrab 2023-10-31
|
||||
|
||||
## [22.31.2] - 10/31/2023
|
||||
|
||||
### Fixes
|
||||
|
||||
* Hotfix issue with beacon spells crashing @Akkadius 2023-10-31
|
||||
|
||||
## [22.31.1] - 10/31/2023
|
||||
|
||||
### Fixes
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
|
||||
|
||||
add_subdirectory(import)
|
||||
add_subdirectory(export)
|
||||
|
||||
@@ -787,6 +787,10 @@ INCLUDE_DIRECTORIES(Patches SocketLib StackWalker)
|
||||
|
||||
ADD_LIBRARY(common ${common_sources} ${common_headers} ${repositories})
|
||||
|
||||
IF(WIN32)
|
||||
TARGET_PRECOMPILE_HEADERS(common PRIVATE pch/pch.h)
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF (UNIX)
|
||||
SET_SOURCE_FILES_PROPERTIES("SocketLib/Mime.cpp" PROPERTY COMPILE_FLAGS -Wno-unused-result)
|
||||
SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/uf.cpp" PROPERTIES COMPILE_FLAGS -O0)
|
||||
|
||||
+296
-473
File diff suppressed because it is too large
Load Diff
+96
-93
@@ -19,99 +19,106 @@
|
||||
#define CLASSES_CH
|
||||
|
||||
#include "../common/types.h"
|
||||
#include "../common/rulesys.h"
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
#define NO_CLASS 0
|
||||
#define WARRIOR 1
|
||||
#define CLERIC 2
|
||||
#define PALADIN 3
|
||||
#define RANGER 4
|
||||
#define SHADOWKNIGHT 5
|
||||
#define DRUID 6
|
||||
#define MONK 7
|
||||
#define BARD 8
|
||||
#define ROGUE 9
|
||||
#define SHAMAN 10
|
||||
#define NECROMANCER 11
|
||||
#define WIZARD 12
|
||||
#define MAGICIAN 13
|
||||
#define ENCHANTER 14
|
||||
#define BEASTLORD 15
|
||||
#define BERSERKER 16
|
||||
#define WARRIORGM 20
|
||||
#define CLERICGM 21
|
||||
#define PALADINGM 22
|
||||
#define RANGERGM 23
|
||||
#define SHADOWKNIGHTGM 24
|
||||
#define DRUIDGM 25
|
||||
#define MONKGM 26
|
||||
#define BARDGM 27
|
||||
#define ROGUEGM 28
|
||||
#define SHAMANGM 29
|
||||
#define NECROMANCERGM 30
|
||||
#define WIZARDGM 31
|
||||
#define MAGICIANGM 32
|
||||
#define ENCHANTERGM 33
|
||||
#define BEASTLORDGM 34
|
||||
#define BERSERKERGM 35
|
||||
#define BANKER 40
|
||||
#define MERCHANT 41
|
||||
#define DISCORD_MERCHANT 59
|
||||
#define ADVENTURE_RECRUITER 60
|
||||
#define ADVENTURE_MERCHANT 61
|
||||
#define LDON_TREASURE 62 // objects you can use /open on first seen in LDONs, seen on Danvi's Corpse in Akheva
|
||||
#define TRIBUTE_MASTER 63
|
||||
#define GUILD_TRIBUTE_MASTER 64 // not sure
|
||||
#define GUILD_BANKER 66
|
||||
#define NORRATHS_KEEPERS_MERCHANT 67
|
||||
#define DARK_REIGN_MERCHANT 68
|
||||
#define FELLOWSHIP_MASTER 69
|
||||
#define ALT_CURRENCY_MERCHANT 70
|
||||
#define MERCENARY_MASTER 71
|
||||
namespace Class {
|
||||
constexpr uint8 None = 0;
|
||||
constexpr uint8 Warrior = 1;
|
||||
constexpr uint8 Cleric = 2;
|
||||
constexpr uint8 Paladin = 3;
|
||||
constexpr uint8 Ranger = 4;
|
||||
constexpr uint8 ShadowKnight = 5;
|
||||
constexpr uint8 Druid = 6;
|
||||
constexpr uint8 Monk = 7;
|
||||
constexpr uint8 Bard = 8;
|
||||
constexpr uint8 Rogue = 9;
|
||||
constexpr uint8 Shaman = 10;
|
||||
constexpr uint8 Necromancer = 11;
|
||||
constexpr uint8 Wizard = 12;
|
||||
constexpr uint8 Magician = 13;
|
||||
constexpr uint8 Enchanter = 14;
|
||||
constexpr uint8 Beastlord = 15;
|
||||
constexpr uint8 Berserker = 16;
|
||||
constexpr uint8 WarriorGM = 20;
|
||||
constexpr uint8 ClericGM = 21;
|
||||
constexpr uint8 PaladinGM = 22;
|
||||
constexpr uint8 RangerGM = 23;
|
||||
constexpr uint8 ShadowKnightGM = 24;
|
||||
constexpr uint8 DruidGM = 25;
|
||||
constexpr uint8 MonkGM = 26;
|
||||
constexpr uint8 BardGM = 27;
|
||||
constexpr uint8 RogueGM = 28;
|
||||
constexpr uint8 ShamanGM = 29;
|
||||
constexpr uint8 NecromancerGM = 30;
|
||||
constexpr uint8 WizardGM = 31;
|
||||
constexpr uint8 MagicianGM = 32;
|
||||
constexpr uint8 EnchanterGM = 33;
|
||||
constexpr uint8 BeastlordGM = 34;
|
||||
constexpr uint8 BerserkerGM = 35;
|
||||
constexpr uint8 Banker = 40;
|
||||
constexpr uint8 Merchant = 41;
|
||||
constexpr uint8 DiscordMerchant = 59;
|
||||
constexpr uint8 AdventureRecruiter = 60;
|
||||
constexpr uint8 AdventureMerchant = 61;
|
||||
constexpr uint8 LDoNTreasure = 62;
|
||||
constexpr uint8 TributeMaster = 63;
|
||||
constexpr uint8 GuildTributeMaster = 64;
|
||||
constexpr uint8 GuildBanker = 66;
|
||||
constexpr uint8 NorrathsKeepersMerchant = 67;
|
||||
constexpr uint8 DarkReignMerchant = 68;
|
||||
constexpr uint8 FellowshipMaster = 69;
|
||||
constexpr uint8 AlternateCurrencyMerchant = 70;
|
||||
constexpr uint8 MercenaryLiaison = 71;
|
||||
|
||||
constexpr uint8 PLAYER_CLASS_COUNT = 16;
|
||||
constexpr uint16 ALL_CLASSES_BITMASK = 65535;
|
||||
};
|
||||
|
||||
// player class values
|
||||
#define PLAYER_CLASS_UNKNOWN 0
|
||||
#define PLAYER_CLASS_WARRIOR 1
|
||||
#define PLAYER_CLASS_CLERIC 2
|
||||
#define PLAYER_CLASS_PALADIN 3
|
||||
#define PLAYER_CLASS_RANGER 4
|
||||
#define PLAYER_CLASS_SHADOWKNIGHT 5
|
||||
#define PLAYER_CLASS_DRUID 6
|
||||
#define PLAYER_CLASS_MONK 7
|
||||
#define PLAYER_CLASS_BARD 8
|
||||
#define PLAYER_CLASS_ROGUE 9
|
||||
#define PLAYER_CLASS_SHAMAN 10
|
||||
#define PLAYER_CLASS_NECROMANCER 11
|
||||
#define PLAYER_CLASS_WIZARD 12
|
||||
#define PLAYER_CLASS_MAGICIAN 13
|
||||
#define PLAYER_CLASS_ENCHANTER 14
|
||||
#define PLAYER_CLASS_BEASTLORD 15
|
||||
#define PLAYER_CLASS_BERSERKER 16
|
||||
static std::map<uint8, uint16> player_class_bitmasks = {
|
||||
{Class::Warrior, 1},
|
||||
{Class::Cleric, 2},
|
||||
{Class::Paladin, 4},
|
||||
{Class::Ranger, 8},
|
||||
{Class::ShadowKnight, 16},
|
||||
{Class::Druid, 32},
|
||||
{Class::Monk, 64},
|
||||
{Class::Bard, 128},
|
||||
{Class::Rogue, 256},
|
||||
{Class::Shaman, 512},
|
||||
{Class::Necromancer, 1024},
|
||||
{Class::Wizard, 2048},
|
||||
{Class::Magician, 4096},
|
||||
{Class::Enchanter, 8192},
|
||||
{Class::Beastlord, 16384},
|
||||
{Class::Berserker, 32768},
|
||||
};
|
||||
|
||||
#define PLAYER_CLASS_COUNT 16
|
||||
static std::string shadow_knight_class_name = (
|
||||
RuleB(World, UseOldShadowKnightClassExport) ?
|
||||
"Shadowknight" :
|
||||
"Shadow Knight"
|
||||
);
|
||||
|
||||
|
||||
// player class bits
|
||||
#define PLAYER_CLASS_UNKNOWN_BIT 0
|
||||
#define PLAYER_CLASS_WARRIOR_BIT 1
|
||||
#define PLAYER_CLASS_CLERIC_BIT 2
|
||||
#define PLAYER_CLASS_PALADIN_BIT 4
|
||||
#define PLAYER_CLASS_RANGER_BIT 8
|
||||
#define PLAYER_CLASS_SHADOWKNIGHT_BIT 16
|
||||
#define PLAYER_CLASS_DRUID_BIT 32
|
||||
#define PLAYER_CLASS_MONK_BIT 64
|
||||
#define PLAYER_CLASS_BARD_BIT 128
|
||||
#define PLAYER_CLASS_ROGUE_BIT 256
|
||||
#define PLAYER_CLASS_SHAMAN_BIT 512
|
||||
#define PLAYER_CLASS_NECROMANCER_BIT 1024
|
||||
#define PLAYER_CLASS_WIZARD_BIT 2048
|
||||
#define PLAYER_CLASS_MAGICIAN_BIT 4096
|
||||
#define PLAYER_CLASS_ENCHANTER_BIT 8192
|
||||
#define PLAYER_CLASS_BEASTLORD_BIT 16384
|
||||
#define PLAYER_CLASS_BERSERKER_BIT 32768
|
||||
|
||||
#define PLAYER_CLASS_ALL_MASK 65535 // was 65536
|
||||
static std::map<uint8, std::string> class_names = {
|
||||
{Class::Warrior, "Warrior"},
|
||||
{Class::Cleric, "Cleric"},
|
||||
{Class::Paladin, "Paladin"},
|
||||
{Class::Ranger, "Ranger"},
|
||||
{Class::ShadowKnight, shadow_knight_class_name},
|
||||
{Class::Druid, "Druid"},
|
||||
{Class::Monk, "Monk"},
|
||||
{Class::Bard, "Bard"},
|
||||
{Class::Rogue, "Rogue"},
|
||||
{Class::Shaman, "Shaman"},
|
||||
{Class::Necromancer, "Necromancer"},
|
||||
{Class::Wizard, "Wizard"},
|
||||
{Class::Magician, "Magician"},
|
||||
{Class::Enchanter, "Enchanter"},
|
||||
{Class::Beastlord, "Beastlord"},
|
||||
{Class::Berserker, "Berserker"},
|
||||
};
|
||||
|
||||
|
||||
#define ARMOR_TYPE_UNKNOWN 0
|
||||
@@ -126,16 +133,12 @@
|
||||
|
||||
|
||||
const char* GetClassIDName(uint8 class_id, uint8 level = 0);
|
||||
const char* GetPlayerClassName(uint32 player_class_value, uint8 level = 0);
|
||||
|
||||
bool IsPlayerClass(uint8 class_id);
|
||||
const std::string GetPlayerClassAbbreviation(uint8 class_id);
|
||||
|
||||
uint32 GetPlayerClassValue(uint8 class_id);
|
||||
uint32 GetPlayerClassBit(uint8 class_id);
|
||||
|
||||
uint8 GetClassIDFromPlayerClassValue(uint32 player_class_value);
|
||||
uint8 GetClassIDFromPlayerClassBit(uint32 player_class_bit);
|
||||
uint8 GetPlayerClassValue(uint8 class_id);
|
||||
uint16 GetPlayerClassBit(uint8 class_id);
|
||||
|
||||
bool IsFighterClass(uint8 class_id);
|
||||
bool IsSpellFighterClass(uint8 class_id);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
#include "eqemu_command_handler.h"
|
||||
#include "terminal_color.hpp"
|
||||
#include "../platform.h"
|
||||
|
||||
+41
-36
@@ -29,6 +29,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../common/repositories/account_repository.h"
|
||||
|
||||
// Disgrace: for windows compile
|
||||
#ifdef _WINDOWS
|
||||
#include <windows.h>
|
||||
@@ -1643,25 +1645,20 @@ void Database::ClearGroupLeader(uint32 gid) {
|
||||
std::cout << "Unable to clear group leader: " << results.ErrorMessage() << std::endl;
|
||||
}
|
||||
|
||||
uint8 Database::GetAgreementFlag(uint32 acctid) {
|
||||
|
||||
std::string query = StringFormat("SELECT rulesflag FROM account WHERE id=%i",acctid);
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success())
|
||||
uint8 Database::GetAgreementFlag(uint32 account_id)
|
||||
{
|
||||
const auto& e = AccountRepository::FindOne(*this, account_id);
|
||||
if (!e.id) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (results.RowCount() != 1)
|
||||
return 0;
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
return Strings::ToUnsignedInt(row[0]);
|
||||
return e.rulesflag;
|
||||
}
|
||||
|
||||
void Database::SetAgreementFlag(uint32 acctid) {
|
||||
std::string query = StringFormat("UPDATE account SET rulesflag=1 where id=%i", acctid);
|
||||
QueryDatabase(query);
|
||||
void Database::SetAgreementFlag(uint32 account_id) {
|
||||
auto e = AccountRepository::FindOne(*this, account_id);
|
||||
e.rulesflag = 1;
|
||||
AccountRepository::UpdateOne(*this, e);
|
||||
}
|
||||
|
||||
void Database::ClearRaid(uint32 rid) {
|
||||
@@ -2097,37 +2094,45 @@ void Database::ClearInvSnapshots(bool from_now) {
|
||||
|
||||
struct TimeOfDay_Struct Database::LoadTime(time_t &realtime)
|
||||
{
|
||||
|
||||
TimeOfDay_Struct eqTime;
|
||||
std::string query = StringFormat("SELECT minute,hour,day,month,year,realtime FROM eqtime limit 1");
|
||||
TimeOfDay_Struct t{};
|
||||
std::string query = StringFormat("SELECT minute,hour,day,month,year,realtime FROM eqtime limit 1");
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success() || results.RowCount() == 0){
|
||||
if (!results.Success() || results.RowCount() == 0) {
|
||||
LogInfo("Loading EQ time of day failed. Using defaults");
|
||||
eqTime.minute = 0;
|
||||
eqTime.hour = 9;
|
||||
eqTime.day = 1;
|
||||
eqTime.month = 1;
|
||||
eqTime.year = 3100;
|
||||
t.minute = 0;
|
||||
t.hour = 9;
|
||||
t.day = 1;
|
||||
t.month = 1;
|
||||
t.year = 3100;
|
||||
realtime = time(nullptr);
|
||||
}
|
||||
else{
|
||||
auto row = results.begin();
|
||||
|
||||
eqTime.minute = Strings::ToUnsignedInt(row[0]);
|
||||
eqTime.hour = Strings::ToUnsignedInt(row[1]);
|
||||
eqTime.day = Strings::ToUnsignedInt(row[2]);
|
||||
eqTime.month = Strings::ToUnsignedInt(row[3]);
|
||||
eqTime.year = Strings::ToUnsignedInt(row[4]);
|
||||
realtime = Strings::ToBigInt(row[5]);
|
||||
return t;
|
||||
}
|
||||
|
||||
return eqTime;
|
||||
auto row = results.begin();
|
||||
|
||||
uint8 hour = Strings::ToUnsignedInt(row[1]);
|
||||
time_t realtime_ = Strings::ToBigInt(row[5]);
|
||||
if (RuleI(World, BootHour) > 0 && RuleI(World, BootHour) <= 24) {
|
||||
hour = RuleI(World, BootHour);
|
||||
realtime_ = time(nullptr);
|
||||
}
|
||||
|
||||
t.minute = Strings::ToUnsignedInt(row[0]);
|
||||
t.hour = hour;
|
||||
t.day = Strings::ToUnsignedInt(row[2]);
|
||||
t.month = Strings::ToUnsignedInt(row[3]);
|
||||
t.year = Strings::ToUnsignedInt(row[4]);
|
||||
realtime = realtime_;
|
||||
|
||||
LogEqTime("Setting hour to [{}]", hour);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
bool Database::SaveTime(int8 minute, int8 hour, int8 day, int8 month, int16 year)
|
||||
{
|
||||
std::string query = StringFormat("UPDATE eqtime set minute = %d, hour = %d, day = %d, month = %d, year = %d, realtime = %d limit 1", minute, hour, day, month, year, time(0));
|
||||
std::string query = StringFormat("UPDATE eqtime set minute = %d, hour = %d, day = %d, month = %d, year = %d, realtime = %d limit 1", minute, hour, day, month, year, time(nullptr));
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
return results.Success();
|
||||
|
||||
+2
-2
@@ -188,10 +188,10 @@ public:
|
||||
uint32 CheckLogin(const char* name, const char* password, const char *loginserver, int16* oStatus = 0);
|
||||
uint32 CreateAccount(const char* name, const char* password, int16 status, const char* loginserver, uint32 lsaccount_id);
|
||||
uint32 GetAccountIDFromLSID(const std::string& in_loginserver_id, uint32 in_loginserver_account_id, char* in_account_name = 0, int16* in_status = 0);
|
||||
uint8 GetAgreementFlag(uint32 acctid);
|
||||
uint8 GetAgreementFlag(uint32 account_id);
|
||||
|
||||
void GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus);
|
||||
void SetAgreementFlag(uint32 acctid);
|
||||
void SetAgreementFlag(uint32 account_id);
|
||||
|
||||
int GetIPExemption(std::string account_ip);
|
||||
void SetIPExemption(std::string account_ip, int exemption_amount);
|
||||
|
||||
@@ -322,6 +322,10 @@ void DatabaseDumpService::DatabaseDump()
|
||||
pipe_file
|
||||
);
|
||||
|
||||
LogInfo("Backing up database [{}]", execute_command);
|
||||
LogInfo("This can take a few minutes depending on the size of your database");
|
||||
LogInfo("LOADING... PLEASE WAIT...");
|
||||
|
||||
BuildCredentialsFile();
|
||||
std::string execution_result = Process::execute(execute_command);
|
||||
if (!execution_result.empty() && IsDumpOutputToConsole()) {
|
||||
|
||||
@@ -274,9 +274,9 @@ bool DatabaseUpdate::CheckVersionsUpToDate(DatabaseVersion v, DatabaseVersion b)
|
||||
LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
|
||||
|
||||
// server database version is required
|
||||
bool server_up_to_date = v.server_database_version == b.server_database_version;
|
||||
bool server_up_to_date = v.server_database_version >= b.server_database_version;
|
||||
// bots database version is optional, if not enabled then it is always up-to-date
|
||||
bool bots_up_to_date = RuleB(Bots, Enabled) ? v.bots_database_version == b.bots_database_version : true;
|
||||
bool bots_up_to_date = RuleB(Bots, Enabled) ? v.bots_database_version >= b.bots_database_version : true;
|
||||
|
||||
return server_up_to_date && bots_up_to_date;
|
||||
}
|
||||
|
||||
@@ -4997,6 +4997,144 @@ ADD PRIMARY KEY (`id`) USING BTREE,
|
||||
ADD UNIQUE INDEX(`varname`);
|
||||
)"
|
||||
},
|
||||
ManifestEntry{
|
||||
.version = 9241,
|
||||
.description = "2023_10_29_split_spawn2_enabled.sql",
|
||||
.check = "SHOW TABLES LIKE 'spawn2_disabled'",
|
||||
.condition = "empty",
|
||||
.match = "",
|
||||
.sql = R"(
|
||||
CREATE TABLE `spawn2_backup_2023_10_29` LIKE `spawn2`;
|
||||
INSERT INTO `spawn2_backup_2023_10_29` SELECT * FROM `spawn2`;
|
||||
CREATE TABLE `spawn2_disabled` (
|
||||
`id` bigint(11) NOT NULL AUTO_INCREMENT,
|
||||
`spawn2_id` int(11) DEFAULT NULL,
|
||||
`instance_id` int(11) DEFAULT 0,
|
||||
`disabled` smallint(11) DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `spawn2_id` (`spawn2_id`,`instance_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
|
||||
INSERT INTO spawn2_disabled (spawn2_id, disabled) SELECT id, 1 FROM spawn2 WHERE enabled = 0;
|
||||
ALTER TABLE `spawn2` DROP COLUMN `enabled`;
|
||||
)"
|
||||
},
|
||||
ManifestEntry{
|
||||
.version = 9242,
|
||||
.description = "2023_11_7_mintime_maxtime_spawnentry.sql",
|
||||
.check = "SHOW COLUMNS FROM `spawnentry` LIKE 'min_time'",
|
||||
.condition = "empty",
|
||||
.match = "",
|
||||
.sql = R"(
|
||||
ALTER TABLE `spawnentry`
|
||||
ADD COLUMN `min_time` smallint(4) NOT NULL DEFAULT 0 AFTER `condition_value_filter`,
|
||||
ADD COLUMN `max_time` smallint(4) NOT NULL DEFAULT 0 AFTER `min_time`;
|
||||
)"
|
||||
},
|
||||
ManifestEntry{
|
||||
.version = 9243,
|
||||
.description = "2023_11_27_starting_items_revamp.sql",
|
||||
.check = "SHOW COLUMNS FROM `starting_items` LIKE 'race_list'",
|
||||
.condition = "empty",
|
||||
.match = "",
|
||||
.sql = R"(
|
||||
CREATE TABLE `starting_items_backup_9243` LIKE `starting_items`;
|
||||
INSERT INTO `starting_items_backup_9243` SELECT * FROM `starting_items`;
|
||||
|
||||
CREATE TABLE `starting_items_new` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`race_list` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
|
||||
`class_list` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
|
||||
`deity_list` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
|
||||
`zone_id_list` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
|
||||
`item_id` int(11) UNSIGNED NOT NULL DEFAULT 0,
|
||||
`item_charges` tinyint(3) UNSIGNED NOT NULL DEFAULT 1,
|
||||
`gm` mediumint(3) UNSIGNED NOT NULL DEFAULT 0,
|
||||
`slot` mediumint(9) NOT NULL DEFAULT -1,
|
||||
`min_expansion` tinyint(4) NOT NULL DEFAULT -1,
|
||||
`max_expansion` tinyint(4) NOT NULL DEFAULT -1,
|
||||
`content_flags` varchar(100) NULL,
|
||||
`content_flags_disabled` varchar(100) NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
|
||||
INSERT INTO
|
||||
`starting_items_new`
|
||||
(
|
||||
SELECT
|
||||
0 AS `id`,
|
||||
GROUP_CONCAT(DISTINCT `class` ORDER BY class ASC SEPARATOR '|') AS `class_list`,
|
||||
GROUP_CONCAT(DISTINCT `race` ORDER BY race ASC SEPARATOR '|') AS `race_list`,
|
||||
GROUP_CONCAT(DISTINCT `deityid` ORDER BY deityid ASC SEPARATOR '|') AS `deity_list`,
|
||||
GROUP_CONCAT(DISTINCT `zoneid` ORDER BY zoneid ASC SEPARATOR '|') AS `zone_list`,
|
||||
`itemid`,
|
||||
`item_charges`,
|
||||
`gm`,
|
||||
`slot`,
|
||||
`min_expansion`,
|
||||
`max_expansion`,
|
||||
`content_flags`,
|
||||
`content_flags_disabled`
|
||||
FROM
|
||||
`starting_items`
|
||||
GROUP BY
|
||||
`itemid`
|
||||
);
|
||||
|
||||
DROP TABLE `starting_items`;
|
||||
RENAME TABLE `starting_items_new` TO `starting_items`;
|
||||
)"
|
||||
},
|
||||
ManifestEntry{
|
||||
.version = 9244,
|
||||
.description = "2023_11_30_items_table_schema.sql",
|
||||
.check = "SHOW COLUMNS FROM `items` LIKE 'updated'",
|
||||
.condition = "contains",
|
||||
.match = "0000-00-00 00:00:00",
|
||||
.sql = R"(
|
||||
ALTER TABLE `items` MODIFY COLUMN `updated` datetime NULL DEFAULT NULL;
|
||||
)"
|
||||
},
|
||||
ManifestEntry{
|
||||
.version = 9245,
|
||||
.description = "2023_12_03_object_incline.sql",
|
||||
.check = "SHOW COLUMNS FROM `object` LIKE 'incline'",
|
||||
.condition = "empty",
|
||||
.match = "",
|
||||
.sql = R"(
|
||||
ALTER TABLE `object` CHANGE COLUMN `unknown08` `size_percentage` float NOT NULL DEFAULT 0 AFTER `icon`;
|
||||
ALTER TABLE `object` CHANGE COLUMN `unknown10` `solid_type` mediumint(5) NOT NULL DEFAULT 0 AFTER `size`;
|
||||
ALTER TABLE `object` CHANGE COLUMN `unknown20` `incline` int(11) NOT NULL DEFAULT 0 AFTER `solid_type`;
|
||||
)"
|
||||
},
|
||||
ManifestEntry{
|
||||
.version = 9246,
|
||||
.description = "2023_12_07_keyring_id.sql",
|
||||
.check = "SHOW COLUMNS FROM `keyring` LIKE 'id'",
|
||||
.condition = "empty",
|
||||
.match = "",
|
||||
.sql = R"(
|
||||
ALTER TABLE `keyring`
|
||||
ADD COLUMN `id` int UNSIGNED NOT NULL AUTO_INCREMENT FIRST,
|
||||
ADD PRIMARY KEY (`id`);
|
||||
)"
|
||||
},
|
||||
ManifestEntry{
|
||||
.version = 9247,
|
||||
.description = "2023_12_14_starting_items_fix.sql",
|
||||
.check = "SHOW COLUMNS FROM `starting_items` LIKE 'inventory_slot'",
|
||||
.condition = "empty",
|
||||
.match = "",
|
||||
.sql = R"(
|
||||
ALTER TABLE `starting_items`
|
||||
CHANGE COLUMN `race_list` `temporary` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL AFTER `id`,
|
||||
CHANGE COLUMN `class_list` `race_list` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL AFTER `temporary`,
|
||||
CHANGE COLUMN `gm` `status` mediumint(3) NOT NULL DEFAULT 0 AFTER `item_charges`,
|
||||
CHANGE COLUMN `slot` `inventory_slot` mediumint(9) NOT NULL DEFAULT -1 AFTER `status`;
|
||||
|
||||
ALTER TABLE `starting_items`
|
||||
CHANGE COLUMN `temporary` `class_list` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL AFTER `id`;
|
||||
)"
|
||||
}
|
||||
|
||||
// -- template; copy/paste this when you need to create a new entry
|
||||
// ManifestEntry{
|
||||
|
||||
@@ -29,6 +29,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../common/repositories/raid_members_repository.h"
|
||||
#include "../common/repositories/respawn_times_repository.h"
|
||||
#include "../common/repositories/spawn_condition_values_repository.h"
|
||||
#include "repositories/spawn2_disabled_repository.h"
|
||||
|
||||
|
||||
#include "database.h"
|
||||
@@ -49,6 +50,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
|
||||
bool Database::AddClientToInstance(uint16 instance_id, uint32 character_id)
|
||||
{
|
||||
auto e = InstanceListPlayerRepository::NewEntity();
|
||||
@@ -553,6 +555,7 @@ void Database::PurgeExpiredInstances()
|
||||
CharacterCorpsesRepository::BuryInstances(*this, imploded_instance_ids);
|
||||
DynamicZoneMembersRepository::DeleteByManyInstances(*this, imploded_instance_ids);
|
||||
DynamicZonesRepository::DeleteWhere(*this, fmt::format("instance_id IN ({})", imploded_instance_ids));
|
||||
Spawn2DisabledRepository::DeleteWhere(*this, fmt::format("instance_id IN ({})", imploded_instance_ids));
|
||||
}
|
||||
|
||||
void Database::SetInstanceDuration(uint16 instance_id, uint32 new_duration)
|
||||
|
||||
@@ -345,6 +345,7 @@ namespace DatabaseSchema {
|
||||
"respawn_times",
|
||||
"saylink",
|
||||
"server_scheduled_events",
|
||||
"spawn2_disabled",
|
||||
"player_event_log_settings",
|
||||
"player_event_logs",
|
||||
"shared_task_activity_state",
|
||||
|
||||
@@ -1052,4 +1052,27 @@ enum ScribeSpellActions
|
||||
Unmemorize
|
||||
};
|
||||
|
||||
enum SpellTimeRestrictions
|
||||
{
|
||||
NoRestriction,
|
||||
Day,
|
||||
Night
|
||||
};
|
||||
|
||||
enum MoneyTypes
|
||||
{
|
||||
Copper,
|
||||
Silver,
|
||||
Gold,
|
||||
Platinum
|
||||
};
|
||||
|
||||
enum MoneySubtypes
|
||||
{
|
||||
Personal,
|
||||
Bank,
|
||||
Cursor,
|
||||
SharedBank // Platinum Only
|
||||
};
|
||||
|
||||
#endif /*COMMON_EQ_CONSTANTS_H*/
|
||||
|
||||
@@ -2594,11 +2594,11 @@ struct BookButton_Struct
|
||||
struct Object_Struct {
|
||||
/*00*/ uint32 linked_list_addr[2];// They are, get this, prev and next, ala linked list
|
||||
/*08*/ float size; //
|
||||
/*10*/ uint16 solidtype; //
|
||||
/*10*/ uint16 solid_type; //
|
||||
/*12*/ uint32 drop_id; // Unique object id for zone
|
||||
/*16*/ uint16 zone_id; // Redudant, but: Zone the object appears in
|
||||
/*18*/ uint16 zone_instance; //
|
||||
/*20*/ uint32 unknown020; //
|
||||
/*20*/ uint32 incline; //
|
||||
/*24*/ uint32 unknown024; //
|
||||
/*28*/ float tilt_x;
|
||||
/*32*/ float tilt_y;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "linked_list.h"
|
||||
#include "path_manager.h"
|
||||
#include <fstream>
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
struct LoginConfig {
|
||||
std::string LoginHost;
|
||||
|
||||
@@ -100,6 +100,8 @@ EQEmuLogSys *EQEmuLogSys::LoadLogSettingsDefaults()
|
||||
log_settings[Logs::Discord].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::QuestErrors].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::QuestErrors].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::EqTime].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::EqTime].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||
|
||||
/**
|
||||
* RFC 5424
|
||||
|
||||
@@ -33,9 +33,10 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <fmt/format.h>
|
||||
#undef FMT_HEADER_ONLY
|
||||
#include <fmt/core.h>
|
||||
#include "types.h"
|
||||
|
||||
|
||||
namespace Logs {
|
||||
enum DebugLevel {
|
||||
General = 1, // 1 - Low-Level general debugging, useful info on single line
|
||||
@@ -139,6 +140,7 @@ namespace Logs {
|
||||
PlayerEvents,
|
||||
DataBuckets,
|
||||
Zoning,
|
||||
EqTime,
|
||||
MaxCategoryID /* Don't Remove this */
|
||||
};
|
||||
|
||||
@@ -237,6 +239,7 @@ namespace Logs {
|
||||
"PlayerEvents",
|
||||
"DataBuckets",
|
||||
"Zoning",
|
||||
"EqTime",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -814,6 +814,16 @@
|
||||
OutF(LogSys, Logs::Detail, Logs::Zoning, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogEqTime(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::General, Logs::EqTime))\
|
||||
OutF(LogSys, Logs::General, Logs::EqTime, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogEqTimeDetail(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::Detail, Logs::EqTime))\
|
||||
OutF(LogSys, Logs::Detail, Logs::EqTime, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define Log(debug_level, log_category, message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(debug_level, log_category))\
|
||||
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
|
||||
+51
-7
@@ -46,16 +46,16 @@ EQTime::EQTime()
|
||||
timezone = 0;
|
||||
memset(&eqTime, 0, sizeof(eqTime));
|
||||
//Defaults for time
|
||||
TimeOfDay_Struct start;
|
||||
start.day = 1;
|
||||
start.hour = 9;
|
||||
start.minute = 0;
|
||||
start.month = 1;
|
||||
start.year = 3100;
|
||||
TimeOfDay_Struct t{};
|
||||
t.day = 1;
|
||||
t.hour = 9;
|
||||
t.minute = 0;
|
||||
t.month = 1;
|
||||
t.year = 3100;
|
||||
//Set default time zone
|
||||
timezone = 0;
|
||||
//Start EQTimer
|
||||
SetCurrentEQTimeOfDay(start, time(0));
|
||||
SetCurrentEQTimeOfDay(t, time(nullptr));
|
||||
}
|
||||
|
||||
//getEQTimeOfDay - Reads timeConvert and writes the result to eqTimeOfDay
|
||||
@@ -200,3 +200,47 @@ void EQTime::ToString(TimeOfDay_Struct *t, std::string &str) {
|
||||
buf[127] = '\0';
|
||||
str = buf;
|
||||
}
|
||||
|
||||
bool EQTime::IsDayTime() {
|
||||
TimeOfDay_Struct tod{}; //Day time is 5am to 6:59pm (14 hours in-game)
|
||||
GetCurrentEQTimeOfDay(&tod); //TODO: what if it fails and returns zero?
|
||||
|
||||
if (tod.hour >= 5 || tod.hour < 19) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EQTime::IsNightTime() {
|
||||
TimeOfDay_Struct tod{}; //Night time is 7pm to 4:59am (10 hours in-game)
|
||||
GetCurrentEQTimeOfDay(&tod); //TODO: what if it fails and returns zero?
|
||||
|
||||
if (tod.hour >= 19 || tod.hour < 5) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EQTime::IsInbetweenTime(uint8 min_time, uint8 max_time) {
|
||||
TimeOfDay_Struct tod{};
|
||||
GetCurrentEQTimeOfDay(&tod);
|
||||
|
||||
if (min_time == 0 || max_time == 0 || min_time > 24 || max_time > 24) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (max_time < min_time) {
|
||||
if ((tod.hour >= min_time && tod.hour > max_time) || (tod.hour < min_time && tod.hour <= max_time)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (tod.hour >= min_time && tod.hour <= max_time) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,9 @@ public:
|
||||
uint32 getEQTimeZone() { return timezone; }
|
||||
uint32 getEQTimeZoneHr() { return timezone/60; }
|
||||
uint32 getEQTimeZoneMin() { return timezone%60; }
|
||||
bool IsDayTime();
|
||||
bool IsNightTime();
|
||||
bool IsInbetweenTime(uint8 min_time, uint8 max_time);
|
||||
|
||||
//Set functions
|
||||
int SetCurrentEQTimeOfDay(TimeOfDay_Struct start_eq, time_t start_real);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "../repositories/character_data_repository.h"
|
||||
#include "../json/json_archive_single_line.h"
|
||||
#include <vector>
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
#include <cereal/archives/json.hpp>
|
||||
#include <cereal/types/vector.hpp>
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "../common/strings.h"
|
||||
#include "../common/rulesys.h"
|
||||
#include "../common/util/uuid.h"
|
||||
#include <fmt/core.h>
|
||||
#include <fmt/format.h>
|
||||
|
||||
const char* const DZ_REPLAY_TIMER_NAME = "Replay Timer"; // see December 14, 2016 patch notes
|
||||
|
||||
@@ -238,25 +238,6 @@ enum { //some random constants
|
||||
// Timer to update aggrometer
|
||||
#define AGGRO_METER_UPDATE_MS 1000
|
||||
|
||||
//Some hard coded statuses from commands and other places:
|
||||
enum {
|
||||
minStatusToBeGM = 40,
|
||||
minStatusToUseGMCommands = 80,
|
||||
minStatusToKick = 150,
|
||||
minStatusToAvoidFalling = 100,
|
||||
minStatusToIgnoreZoneFlags = 80,
|
||||
minStatusToSeeOthersZoneFlags = 80,
|
||||
minStatusToEditOtherGuilds = 80,
|
||||
commandMovecharSelfOnly = 80, //below this == only self move allowed
|
||||
commandMovecharToSpecials = 200, //ability to send people to cshom/load zones
|
||||
commandCastSpecials = 100, //can cast special spells
|
||||
commandDoAnimOthers = 100, //can #doanim on others
|
||||
commandEditPlayerCorpses = 150, //can Edit Player Corpses
|
||||
commandInterrogateInv = 100, //below this == only log on error state and self-only target dump
|
||||
commandInvSnapshot = 150 //ability to clear/restore snapshots
|
||||
};
|
||||
|
||||
|
||||
// This is the item ID we use for say links, we use the max that fits in 5 ASCII chars
|
||||
#define SAYLINK_ITEM_ID 0xFFFFF
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
|
||||
#endif
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace EQ
|
||||
|
||||
// Swap items in inventory
|
||||
enum SwapItemFailState : int8 { swapInvalid = -1, swapPass = 0, swapNotAllowed, swapNullData, swapRaceClass, swapDeity, swapLevel };
|
||||
bool SwapItem(int16 source_slot, int16 destination_slot, SwapItemFailState& fail_state, uint16 race_id = RACE_DOUG_0, uint8 class_id = NO_CLASS, uint16 deity_id = deity::DeityType::DeityUnknown, uint8 level = 0);
|
||||
bool SwapItem(int16 source_slot, int16 destination_slot, SwapItemFailState& fail_state, uint16 race_id = RACE_DOUG_0, uint8 class_id = Class::None, uint16 deity_id = deity::DeityType::DeityUnknown, uint8 level = 0);
|
||||
|
||||
// Remove item from inventory
|
||||
bool DeleteItem(int16 slot_id, int16 quantity = 0);
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
#include <cstring>
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
#include <csignal>
|
||||
#include <vector>
|
||||
#include "ip_util.h"
|
||||
|
||||
@@ -356,6 +356,7 @@ namespace EQ
|
||||
struct ItemData {
|
||||
// Non packet based fields
|
||||
uint8 MinStatus {};
|
||||
char Comment[255] {};
|
||||
|
||||
// Packet based fields
|
||||
uint8 ItemClass {}; // Item Type: 0=common, 1=container, 2=book
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "console_server.h"
|
||||
#include "../strings.h"
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
EQ::Net::ConsoleServer::ConsoleServer(const std::string &addr, int port)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "../eqemu_logsys.h"
|
||||
#include "../servertalk.h"
|
||||
#include "../rulesys.h"
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
EQ::Net::ConsoleServerConnection::ConsoleServerConnection(ConsoleServer *parent, std::shared_ptr<TCPConnection> connection)
|
||||
{
|
||||
@@ -21,7 +21,7 @@ EQ::Net::ConsoleServerConnection::ConsoleServerConnection(ConsoleServer *parent,
|
||||
m_connection->OnDisconnect(std::bind(&ConsoleServerConnection::OnDisconnect, this, std::placeholders::_1));
|
||||
m_connection->Start();
|
||||
ClearBuffer();
|
||||
|
||||
|
||||
auto addr = m_connection->RemoteIP();
|
||||
|
||||
SendLine(fmt::format("Establishing connection from: {0}:{1}", addr, m_connection->RemotePort()));
|
||||
@@ -85,12 +85,12 @@ void EQ::Net::ConsoleServerConnection::QueueMessage(const std::string &msg)
|
||||
}
|
||||
else {
|
||||
std::string cmd(m_line, m_line + m_cursor);
|
||||
|
||||
|
||||
size_t len = m_user.length() + 2 + cmd.length();
|
||||
for (size_t i = 0; i < len; ++i) {
|
||||
Send("\x08");
|
||||
}
|
||||
|
||||
|
||||
if (msg.length() < cmd.length()) {
|
||||
Send(msg);
|
||||
size_t blank_spaces = 2 + cmd.length() - msg.length();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "crc32.h"
|
||||
#include "../eqemu_logsys.h"
|
||||
#include <zlib.h>
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
#include <sstream>
|
||||
|
||||
EQ::Net::DaybreakConnectionManager::DaybreakConnectionManager()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "packet.h"
|
||||
#include "endian.h"
|
||||
#include <cctype>
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
void EQ::Net::Packet::PutInt8(size_t offset, int8_t value)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "websocket_server.h"
|
||||
#include "../event/event_loop.h"
|
||||
#include "../event/timer.h"
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
#include <map>
|
||||
#include <unordered_set>
|
||||
#include <array>
|
||||
@@ -50,7 +50,7 @@ EQ::Net::WebsocketServer::WebsocketServer(const std::string &addr, int port)
|
||||
if (iter != _impl->connections.end()) {
|
||||
iter->second->GetTCPConnection()->Write(data, size);
|
||||
}
|
||||
|
||||
|
||||
return websocketpp::lib::error_code();
|
||||
});
|
||||
|
||||
@@ -76,7 +76,7 @@ EQ::Net::WebsocketServer::WebsocketServer(const std::string &addr, int port)
|
||||
_impl->login_handler = [](const WebsocketServerConnection* connection, const std::string& user, const std::string& pass) {
|
||||
WebsocketLoginStatus ret;
|
||||
ret.account_name = "admin";
|
||||
|
||||
|
||||
if (connection->RemoteIP() == "127.0.0.1" || connection->RemoteIP() == "::") {
|
||||
ret.logged_in = true;
|
||||
return ret;
|
||||
@@ -125,8 +125,8 @@ Json::Value EQ::Net::WebsocketServer::HandleRequest(WebsocketServerConnection *c
|
||||
void EQ::Net::WebsocketServer::SetMethodHandler(const std::string &method, MethodHandler handler, int required_status)
|
||||
{
|
||||
//Reserved method names
|
||||
if (method == "subscribe" ||
|
||||
method == "unsubscribe" ||
|
||||
if (method == "subscribe" ||
|
||||
method == "unsubscribe" ||
|
||||
method == "login") {
|
||||
return;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ Json::Value EQ::Net::WebsocketServer::Login(WebsocketServerConnection *connectio
|
||||
|
||||
auto user = params[0].asString();
|
||||
auto pass = params[1].asString();
|
||||
|
||||
|
||||
auto r = _impl->login_handler(connection, user, pass);
|
||||
|
||||
if (r.logged_in) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "../timer.h"
|
||||
#include "../util/uuid.h"
|
||||
#include <sstream>
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
struct EQ::Net::WebsocketServerConnection::Impl {
|
||||
WebsocketServer *parent;
|
||||
@@ -16,7 +16,7 @@ struct EQ::Net::WebsocketServerConnection::Impl {
|
||||
int status;
|
||||
};
|
||||
|
||||
EQ::Net::WebsocketServerConnection::WebsocketServerConnection(WebsocketServer *parent,
|
||||
EQ::Net::WebsocketServerConnection::WebsocketServerConnection(WebsocketServer *parent,
|
||||
std::shared_ptr<TCPConnection> connection,
|
||||
std::shared_ptr<websocket_connection> ws_connection)
|
||||
{
|
||||
@@ -34,7 +34,7 @@ EQ::Net::WebsocketServerConnection::WebsocketServerConnection(WebsocketServer *p
|
||||
connection->OnDisconnect([this](EQ::Net::TCPConnection *connection) {
|
||||
_impl->parent->ReleaseConnection(this);
|
||||
});
|
||||
|
||||
|
||||
connection->OnRead([this](EQ::Net::TCPConnection *c, const unsigned char *buffer, size_t buffer_size) {
|
||||
_impl->ws_connection->read_all((const char*)buffer, buffer_size);
|
||||
});
|
||||
|
||||
@@ -2706,7 +2706,7 @@ namespace RoF2
|
||||
|
||||
switch (raid_gen->action)
|
||||
{
|
||||
case raidAdd:
|
||||
case raidAdd:
|
||||
{
|
||||
RaidAddMember_Struct* emu = (RaidAddMember_Struct*)__emu_buffer;
|
||||
|
||||
@@ -3986,7 +3986,7 @@ namespace RoF2
|
||||
if (strlen(emu->suffix))
|
||||
PacketSize += strlen(emu->suffix) + 1;
|
||||
|
||||
if (emu->DestructibleObject || emu->class_ == LDON_TREASURE)
|
||||
if (emu->DestructibleObject || emu->class_ == Class::LDoNTreasure)
|
||||
{
|
||||
if (emu->DestructibleObject)
|
||||
PacketSize = PacketSize - 4; // No bodytype
|
||||
@@ -4076,7 +4076,7 @@ namespace RoF2
|
||||
// actually part of bitfields
|
||||
uint8 OtherData = 0;
|
||||
|
||||
if (emu->class_ == LDON_TREASURE) //LDoN Chest
|
||||
if (emu->class_ == Class::LDoNTreasure) //LDoN Chest
|
||||
{
|
||||
OtherData = OtherData | 0x04;
|
||||
}
|
||||
@@ -4104,7 +4104,7 @@ namespace RoF2
|
||||
// int DefaultEmitterID
|
||||
VARSTRUCT_ENCODE_TYPE(float, Buffer, 0); // unknown4
|
||||
|
||||
if (emu->DestructibleObject || emu->class_ == LDON_TREASURE)
|
||||
if (emu->DestructibleObject || emu->class_ == Class::LDoNTreasure)
|
||||
{
|
||||
VARSTRUCT_ENCODE_STRING(Buffer, emu->DestructibleModel);
|
||||
VARSTRUCT_ENCODE_STRING(Buffer, emu->DestructibleName2);
|
||||
|
||||
@@ -2758,7 +2758,7 @@ namespace UF
|
||||
if (strlen(emu->suffix))
|
||||
PacketSize += strlen(emu->suffix) + 1;
|
||||
|
||||
if (emu->DestructibleObject || emu->class_ == LDON_TREASURE)
|
||||
if (emu->DestructibleObject || emu->class_ == Class::LDoNTreasure)
|
||||
{
|
||||
if (emu->DestructibleObject)
|
||||
PacketSize = PacketSize - 4; // No bodytype
|
||||
@@ -2847,7 +2847,7 @@ namespace UF
|
||||
|
||||
uint8 OtherData = 0;
|
||||
|
||||
if (emu->class_ == LDON_TREASURE) //Ldon chest
|
||||
if (emu->class_ == Class::LDoNTreasure) //Ldon chest
|
||||
{
|
||||
OtherData = OtherData | 0x01;
|
||||
}
|
||||
@@ -2873,7 +2873,7 @@ namespace UF
|
||||
}
|
||||
VARSTRUCT_ENCODE_TYPE(float, Buffer, 0); // unknown4
|
||||
|
||||
if (emu->DestructibleObject || emu->class_ == LDON_TREASURE)
|
||||
if (emu->DestructibleObject || emu->class_ == Class::LDoNTreasure)
|
||||
{
|
||||
VARSTRUCT_ENCODE_STRING(Buffer, emu->DestructibleModel);
|
||||
VARSTRUCT_ENCODE_STRING(Buffer, emu->DestructibleName2);
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// types
|
||||
#include <limits>
|
||||
#include <string>
|
||||
#include <cctype>
|
||||
#include <sstream>
|
||||
|
||||
// containers
|
||||
#include <iterator>
|
||||
#include <set>
|
||||
#include <unordered_set>
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
// utilities
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
#include <tuple>
|
||||
#include <fstream>
|
||||
#include <cstdio>
|
||||
|
||||
// fmt
|
||||
#include <fmt/format.h>
|
||||
@@ -1,17 +1,17 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
|
||||
|
||||
Copyright (C) 2001-2019 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
|
||||
class DBcore;
|
||||
@@ -37,7 +37,7 @@ namespace EQ
|
||||
|
||||
static bool AddProfanity(DBcore *db, std::string profanity);
|
||||
static bool RemoveProfanity(DBcore *db, std::string profanity);
|
||||
|
||||
|
||||
static void RedactMessage(char *message);
|
||||
static void RedactMessage(std::string &message);
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace EQ
|
||||
static bool load_database_entries(DBcore *db);
|
||||
static bool clear_database_entries(DBcore *db);
|
||||
static bool check_for_existing_entry(const std::string& profanity);
|
||||
|
||||
|
||||
};
|
||||
|
||||
} /*EQEmu*/
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "../../strings.h"
|
||||
#include <ctime>
|
||||
|
||||
|
||||
class BaseBlockedSpellsRepository {
|
||||
public:
|
||||
struct BlockedSpells {
|
||||
@@ -31,6 +32,10 @@ public:
|
||||
float z_diff;
|
||||
std::string message;
|
||||
std::string description;
|
||||
int8_t min_expansion;
|
||||
int8_t max_expansion;
|
||||
std::string content_flags;
|
||||
std::string content_flags_disabled;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
@@ -53,6 +58,10 @@ public:
|
||||
"z_diff",
|
||||
"message",
|
||||
"description",
|
||||
"min_expansion",
|
||||
"max_expansion",
|
||||
"content_flags",
|
||||
"content_flags_disabled",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -71,6 +80,10 @@ public:
|
||||
"z_diff",
|
||||
"message",
|
||||
"description",
|
||||
"min_expansion",
|
||||
"max_expansion",
|
||||
"content_flags",
|
||||
"content_flags_disabled",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -111,18 +124,22 @@ public:
|
||||
{
|
||||
BlockedSpells e{};
|
||||
|
||||
e.id = 0;
|
||||
e.spellid = 0;
|
||||
e.type = 0;
|
||||
e.zoneid = 0;
|
||||
e.x = 0;
|
||||
e.y = 0;
|
||||
e.z = 0;
|
||||
e.x_diff = 0;
|
||||
e.y_diff = 0;
|
||||
e.z_diff = 0;
|
||||
e.message = "";
|
||||
e.description = "";
|
||||
e.id = 0;
|
||||
e.spellid = 0;
|
||||
e.type = 0;
|
||||
e.zoneid = 0;
|
||||
e.x = 0;
|
||||
e.y = 0;
|
||||
e.z = 0;
|
||||
e.x_diff = 0;
|
||||
e.y_diff = 0;
|
||||
e.z_diff = 0;
|
||||
e.message = "";
|
||||
e.description = "";
|
||||
e.min_expansion = -1;
|
||||
e.max_expansion = -1;
|
||||
e.content_flags = "";
|
||||
e.content_flags_disabled = "";
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -148,8 +165,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
blocked_spells_id
|
||||
)
|
||||
);
|
||||
@@ -158,18 +176,22 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BlockedSpells e{};
|
||||
|
||||
e.id = static_cast<int32_t>(atoi(row[0]));
|
||||
e.spellid = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.type = static_cast<int8_t>(atoi(row[2]));
|
||||
e.zoneid = static_cast<int32_t>(atoi(row[3]));
|
||||
e.x = strtof(row[4], nullptr);
|
||||
e.y = strtof(row[5], nullptr);
|
||||
e.z = strtof(row[6], nullptr);
|
||||
e.x_diff = strtof(row[7], nullptr);
|
||||
e.y_diff = strtof(row[8], nullptr);
|
||||
e.z_diff = strtof(row[9], nullptr);
|
||||
e.message = row[10] ? row[10] : "";
|
||||
e.description = row[11] ? row[11] : "";
|
||||
e.id = static_cast<int32_t>(atoi(row[0]));
|
||||
e.spellid = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.type = static_cast<int8_t>(atoi(row[2]));
|
||||
e.zoneid = static_cast<int32_t>(atoi(row[3]));
|
||||
e.x = strtof(row[4], nullptr);
|
||||
e.y = strtof(row[5], nullptr);
|
||||
e.z = strtof(row[6], nullptr);
|
||||
e.x_diff = strtof(row[7], nullptr);
|
||||
e.y_diff = strtof(row[8], nullptr);
|
||||
e.z_diff = strtof(row[9], nullptr);
|
||||
e.message = row[10] ? row[10] : "";
|
||||
e.description = row[11] ? row[11] : "";
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[12]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[13]));
|
||||
e.content_flags = row[14] ? row[14] : "";
|
||||
e.content_flags_disabled = row[15] ? row[15] : "";
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -214,6 +236,10 @@ public:
|
||||
v.push_back(columns[9] + " = " + std::to_string(e.z_diff));
|
||||
v.push_back(columns[10] + " = '" + Strings::Escape(e.message) + "'");
|
||||
v.push_back(columns[11] + " = '" + Strings::Escape(e.description) + "'");
|
||||
v.push_back(columns[12] + " = " + std::to_string(e.min_expansion));
|
||||
v.push_back(columns[13] + " = " + std::to_string(e.max_expansion));
|
||||
v.push_back(columns[14] + " = '" + Strings::Escape(e.content_flags) + "'");
|
||||
v.push_back(columns[15] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -247,6 +273,10 @@ public:
|
||||
v.push_back(std::to_string(e.z_diff));
|
||||
v.push_back("'" + Strings::Escape(e.message) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.description) + "'");
|
||||
v.push_back(std::to_string(e.min_expansion));
|
||||
v.push_back(std::to_string(e.max_expansion));
|
||||
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -288,6 +318,10 @@ public:
|
||||
v.push_back(std::to_string(e.z_diff));
|
||||
v.push_back("'" + Strings::Escape(e.message) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.description) + "'");
|
||||
v.push_back(std::to_string(e.min_expansion));
|
||||
v.push_back(std::to_string(e.max_expansion));
|
||||
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
@@ -321,18 +355,22 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BlockedSpells e{};
|
||||
|
||||
e.id = static_cast<int32_t>(atoi(row[0]));
|
||||
e.spellid = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.type = static_cast<int8_t>(atoi(row[2]));
|
||||
e.zoneid = static_cast<int32_t>(atoi(row[3]));
|
||||
e.x = strtof(row[4], nullptr);
|
||||
e.y = strtof(row[5], nullptr);
|
||||
e.z = strtof(row[6], nullptr);
|
||||
e.x_diff = strtof(row[7], nullptr);
|
||||
e.y_diff = strtof(row[8], nullptr);
|
||||
e.z_diff = strtof(row[9], nullptr);
|
||||
e.message = row[10] ? row[10] : "";
|
||||
e.description = row[11] ? row[11] : "";
|
||||
e.id = static_cast<int32_t>(atoi(row[0]));
|
||||
e.spellid = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.type = static_cast<int8_t>(atoi(row[2]));
|
||||
e.zoneid = static_cast<int32_t>(atoi(row[3]));
|
||||
e.x = strtof(row[4], nullptr);
|
||||
e.y = strtof(row[5], nullptr);
|
||||
e.z = strtof(row[6], nullptr);
|
||||
e.x_diff = strtof(row[7], nullptr);
|
||||
e.y_diff = strtof(row[8], nullptr);
|
||||
e.z_diff = strtof(row[9], nullptr);
|
||||
e.message = row[10] ? row[10] : "";
|
||||
e.description = row[11] ? row[11] : "";
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[12]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[13]));
|
||||
e.content_flags = row[14] ? row[14] : "";
|
||||
e.content_flags_disabled = row[15] ? row[15] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -357,18 +395,22 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BlockedSpells e{};
|
||||
|
||||
e.id = static_cast<int32_t>(atoi(row[0]));
|
||||
e.spellid = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.type = static_cast<int8_t>(atoi(row[2]));
|
||||
e.zoneid = static_cast<int32_t>(atoi(row[3]));
|
||||
e.x = strtof(row[4], nullptr);
|
||||
e.y = strtof(row[5], nullptr);
|
||||
e.z = strtof(row[6], nullptr);
|
||||
e.x_diff = strtof(row[7], nullptr);
|
||||
e.y_diff = strtof(row[8], nullptr);
|
||||
e.z_diff = strtof(row[9], nullptr);
|
||||
e.message = row[10] ? row[10] : "";
|
||||
e.description = row[11] ? row[11] : "";
|
||||
e.id = static_cast<int32_t>(atoi(row[0]));
|
||||
e.spellid = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.type = static_cast<int8_t>(atoi(row[2]));
|
||||
e.zoneid = static_cast<int32_t>(atoi(row[3]));
|
||||
e.x = strtof(row[4], nullptr);
|
||||
e.y = strtof(row[5], nullptr);
|
||||
e.z = strtof(row[6], nullptr);
|
||||
e.x_diff = strtof(row[7], nullptr);
|
||||
e.y_diff = strtof(row[8], nullptr);
|
||||
e.z_diff = strtof(row[9], nullptr);
|
||||
e.message = row[10] ? row[10] : "";
|
||||
e.description = row[11] ? row[11] : "";
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[12]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[13]));
|
||||
e.content_flags = row[14] ? row[14] : "";
|
||||
e.content_flags_disabled = row[15] ? row[15] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "../../database.h"
|
||||
#include "../../strings.h"
|
||||
#include <ctime>
|
||||
#include <fmt/format.h>
|
||||
|
||||
class BaseCharacterExpeditionLockoutsRepository {
|
||||
public:
|
||||
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
int32_t damageshield;
|
||||
int32_t deity;
|
||||
int32_t delay;
|
||||
int32_t augdistiller;
|
||||
uint32_t augdistiller;
|
||||
int32_t dotshielding;
|
||||
int32_t dr;
|
||||
int32_t clicktype;
|
||||
@@ -227,7 +227,7 @@ public:
|
||||
int32_t focusunk5;
|
||||
std::string focusunk6;
|
||||
int32_t focusunk7;
|
||||
int32_t scrollunk1;
|
||||
uint32_t scrollunk1;
|
||||
int32_t scrollunk2;
|
||||
int32_t scrollunk3;
|
||||
int32_t scrollunk4;
|
||||
@@ -266,10 +266,10 @@ public:
|
||||
std::string created;
|
||||
int16_t elitematerial;
|
||||
int16_t ldonsellbackrate;
|
||||
int16_t scriptfileid;
|
||||
int32_t scriptfileid;
|
||||
int16_t expendablearrow;
|
||||
int16_t powersourcecapacity;
|
||||
int16_t bardeffect;
|
||||
int32_t powersourcecapacity;
|
||||
int32_t bardeffect;
|
||||
int16_t bardeffecttype;
|
||||
int16_t bardlevel2;
|
||||
int16_t bardlevel;
|
||||
@@ -1307,7 +1307,7 @@ public:
|
||||
e.damageshield = static_cast<int32_t>(atoi(row[52]));
|
||||
e.deity = static_cast<int32_t>(atoi(row[53]));
|
||||
e.delay = static_cast<int32_t>(atoi(row[54]));
|
||||
e.augdistiller = static_cast<int32_t>(atoi(row[55]));
|
||||
e.augdistiller = static_cast<uint32_t>(strtoul(row[55], nullptr, 10));
|
||||
e.dotshielding = static_cast<int32_t>(atoi(row[56]));
|
||||
e.dr = static_cast<int32_t>(atoi(row[57]));
|
||||
e.clicktype = static_cast<int32_t>(atoi(row[58]));
|
||||
@@ -1459,7 +1459,7 @@ public:
|
||||
e.focusunk5 = static_cast<int32_t>(atoi(row[204]));
|
||||
e.focusunk6 = row[205] ? row[205] : "";
|
||||
e.focusunk7 = static_cast<int32_t>(atoi(row[206]));
|
||||
e.scrollunk1 = static_cast<int32_t>(atoi(row[207]));
|
||||
e.scrollunk1 = static_cast<uint32_t>(strtoul(row[207], nullptr, 10));
|
||||
e.scrollunk2 = static_cast<int32_t>(atoi(row[208]));
|
||||
e.scrollunk3 = static_cast<int32_t>(atoi(row[209]));
|
||||
e.scrollunk4 = static_cast<int32_t>(atoi(row[210]));
|
||||
@@ -1498,10 +1498,10 @@ public:
|
||||
e.created = row[243] ? row[243] : "";
|
||||
e.elitematerial = static_cast<int16_t>(atoi(row[244]));
|
||||
e.ldonsellbackrate = static_cast<int16_t>(atoi(row[245]));
|
||||
e.scriptfileid = static_cast<int16_t>(atoi(row[246]));
|
||||
e.scriptfileid = static_cast<int32_t>(atoi(row[246]));
|
||||
e.expendablearrow = static_cast<int16_t>(atoi(row[247]));
|
||||
e.powersourcecapacity = static_cast<int16_t>(atoi(row[248]));
|
||||
e.bardeffect = static_cast<int16_t>(atoi(row[249]));
|
||||
e.powersourcecapacity = static_cast<int32_t>(atoi(row[248]));
|
||||
e.bardeffect = static_cast<int32_t>(atoi(row[249]));
|
||||
e.bardeffecttype = static_cast<int16_t>(atoi(row[250]));
|
||||
e.bardlevel2 = static_cast<int16_t>(atoi(row[251]));
|
||||
e.bardlevel = static_cast<int16_t>(atoi(row[252]));
|
||||
@@ -2563,7 +2563,7 @@ public:
|
||||
e.damageshield = static_cast<int32_t>(atoi(row[52]));
|
||||
e.deity = static_cast<int32_t>(atoi(row[53]));
|
||||
e.delay = static_cast<int32_t>(atoi(row[54]));
|
||||
e.augdistiller = static_cast<int32_t>(atoi(row[55]));
|
||||
e.augdistiller = static_cast<uint32_t>(strtoul(row[55], nullptr, 10));
|
||||
e.dotshielding = static_cast<int32_t>(atoi(row[56]));
|
||||
e.dr = static_cast<int32_t>(atoi(row[57]));
|
||||
e.clicktype = static_cast<int32_t>(atoi(row[58]));
|
||||
@@ -2715,7 +2715,7 @@ public:
|
||||
e.focusunk5 = static_cast<int32_t>(atoi(row[204]));
|
||||
e.focusunk6 = row[205] ? row[205] : "";
|
||||
e.focusunk7 = static_cast<int32_t>(atoi(row[206]));
|
||||
e.scrollunk1 = static_cast<int32_t>(atoi(row[207]));
|
||||
e.scrollunk1 = static_cast<uint32_t>(strtoul(row[207], nullptr, 10));
|
||||
e.scrollunk2 = static_cast<int32_t>(atoi(row[208]));
|
||||
e.scrollunk3 = static_cast<int32_t>(atoi(row[209]));
|
||||
e.scrollunk4 = static_cast<int32_t>(atoi(row[210]));
|
||||
@@ -2754,10 +2754,10 @@ public:
|
||||
e.created = row[243] ? row[243] : "";
|
||||
e.elitematerial = static_cast<int16_t>(atoi(row[244]));
|
||||
e.ldonsellbackrate = static_cast<int16_t>(atoi(row[245]));
|
||||
e.scriptfileid = static_cast<int16_t>(atoi(row[246]));
|
||||
e.scriptfileid = static_cast<int32_t>(atoi(row[246]));
|
||||
e.expendablearrow = static_cast<int16_t>(atoi(row[247]));
|
||||
e.powersourcecapacity = static_cast<int16_t>(atoi(row[248]));
|
||||
e.bardeffect = static_cast<int16_t>(atoi(row[249]));
|
||||
e.powersourcecapacity = static_cast<int32_t>(atoi(row[248]));
|
||||
e.bardeffect = static_cast<int32_t>(atoi(row[249]));
|
||||
e.bardeffecttype = static_cast<int16_t>(atoi(row[250]));
|
||||
e.bardlevel2 = static_cast<int16_t>(atoi(row[251]));
|
||||
e.bardlevel = static_cast<int16_t>(atoi(row[252]));
|
||||
@@ -2872,7 +2872,7 @@ public:
|
||||
e.damageshield = static_cast<int32_t>(atoi(row[52]));
|
||||
e.deity = static_cast<int32_t>(atoi(row[53]));
|
||||
e.delay = static_cast<int32_t>(atoi(row[54]));
|
||||
e.augdistiller = static_cast<int32_t>(atoi(row[55]));
|
||||
e.augdistiller = static_cast<uint32_t>(strtoul(row[55], nullptr, 10));
|
||||
e.dotshielding = static_cast<int32_t>(atoi(row[56]));
|
||||
e.dr = static_cast<int32_t>(atoi(row[57]));
|
||||
e.clicktype = static_cast<int32_t>(atoi(row[58]));
|
||||
@@ -3024,7 +3024,7 @@ public:
|
||||
e.focusunk5 = static_cast<int32_t>(atoi(row[204]));
|
||||
e.focusunk6 = row[205] ? row[205] : "";
|
||||
e.focusunk7 = static_cast<int32_t>(atoi(row[206]));
|
||||
e.scrollunk1 = static_cast<int32_t>(atoi(row[207]));
|
||||
e.scrollunk1 = static_cast<uint32_t>(strtoul(row[207], nullptr, 10));
|
||||
e.scrollunk2 = static_cast<int32_t>(atoi(row[208]));
|
||||
e.scrollunk3 = static_cast<int32_t>(atoi(row[209]));
|
||||
e.scrollunk4 = static_cast<int32_t>(atoi(row[210]));
|
||||
@@ -3063,10 +3063,10 @@ public:
|
||||
e.created = row[243] ? row[243] : "";
|
||||
e.elitematerial = static_cast<int16_t>(atoi(row[244]));
|
||||
e.ldonsellbackrate = static_cast<int16_t>(atoi(row[245]));
|
||||
e.scriptfileid = static_cast<int16_t>(atoi(row[246]));
|
||||
e.scriptfileid = static_cast<int32_t>(atoi(row[246]));
|
||||
e.expendablearrow = static_cast<int16_t>(atoi(row[247]));
|
||||
e.powersourcecapacity = static_cast<int16_t>(atoi(row[248]));
|
||||
e.bardeffect = static_cast<int16_t>(atoi(row[249]));
|
||||
e.powersourcecapacity = static_cast<int32_t>(atoi(row[248]));
|
||||
e.bardeffect = static_cast<int32_t>(atoi(row[249]));
|
||||
e.bardeffecttype = static_cast<int16_t>(atoi(row[250]));
|
||||
e.bardlevel2 = static_cast<int16_t>(atoi(row[251]));
|
||||
e.bardlevel = static_cast<int16_t>(atoi(row[252]));
|
||||
|
||||
@@ -0,0 +1,344 @@
|
||||
/**
|
||||
* 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://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_KEYRING_REPOSITORY_H
|
||||
#define EQEMU_BASE_KEYRING_REPOSITORY_H
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../strings.h"
|
||||
#include <ctime>
|
||||
|
||||
|
||||
class BaseKeyringRepository {
|
||||
public:
|
||||
struct Keyring {
|
||||
uint32_t id;
|
||||
int32_t char_id;
|
||||
int32_t item_id;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
{
|
||||
return std::string("id");
|
||||
}
|
||||
|
||||
static std::vector<std::string> Columns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"char_id",
|
||||
"item_id",
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"char_id",
|
||||
"item_id",
|
||||
};
|
||||
}
|
||||
|
||||
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("keyring");
|
||||
}
|
||||
|
||||
static std::string BaseSelect()
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
static std::string BaseInsert()
|
||||
{
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static Keyring NewEntity()
|
||||
{
|
||||
Keyring e{};
|
||||
|
||||
e.id = 0;
|
||||
e.char_id = 0;
|
||||
e.item_id = 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
static Keyring GetKeyring(
|
||||
const std::vector<Keyring> &keyrings,
|
||||
int keyring_id
|
||||
)
|
||||
{
|
||||
for (auto &keyring : keyrings) {
|
||||
if (keyring.id == keyring_id) {
|
||||
return keyring;
|
||||
}
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static Keyring FindOne(
|
||||
Database& db,
|
||||
int keyring_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
keyring_id
|
||||
)
|
||||
);
|
||||
|
||||
auto row = results.begin();
|
||||
if (results.RowCount() == 1) {
|
||||
Keyring e{};
|
||||
|
||||
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.char_id = static_cast<int32_t>(atoi(row[1]));
|
||||
e.item_id = static_cast<int32_t>(atoi(row[2]));
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int keyring_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
PrimaryKey(),
|
||||
keyring_id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
const Keyring &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.char_id));
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.item_id));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
Strings::Implode(", ", v),
|
||||
PrimaryKey(),
|
||||
e.id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static Keyring InsertOne(
|
||||
Database& db,
|
||||
Keyring e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.char_id));
|
||||
v.push_back(std::to_string(e.item_id));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
if (results.Success()) {
|
||||
e.id = results.LastInsertedID();
|
||||
return e;
|
||||
}
|
||||
|
||||
e = NewEntity();
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
const std::vector<Keyring> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.char_id));
|
||||
v.push_back(std::to_string(e.item_id));
|
||||
|
||||
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<Keyring> All(Database& db)
|
||||
{
|
||||
std::vector<Keyring> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
Keyring e{};
|
||||
|
||||
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.char_id = static_cast<int32_t>(atoi(row[1]));
|
||||
e.item_id = static_cast<int32_t>(atoi(row[2]));
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Keyring> GetWhere(Database& db, const std::string &where_filter)
|
||||
{
|
||||
std::vector<Keyring> 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) {
|
||||
Keyring e{};
|
||||
|
||||
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.char_id = static_cast<int32_t>(atoi(row[1]));
|
||||
e.item_id = static_cast<int32_t>(atoi(row[2]));
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_KEYRING_REPOSITORY_H
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "../../strings.h"
|
||||
#include <ctime>
|
||||
|
||||
|
||||
class BaseObjectRepository {
|
||||
public:
|
||||
struct Object {
|
||||
@@ -31,9 +32,9 @@ public:
|
||||
std::string objectname;
|
||||
int32_t type;
|
||||
int32_t icon;
|
||||
int32_t unknown08;
|
||||
int32_t unknown10;
|
||||
int32_t unknown20;
|
||||
float size_percentage;
|
||||
int32_t solid_type;
|
||||
int32_t incline;
|
||||
int32_t unknown24;
|
||||
int32_t unknown60;
|
||||
int32_t unknown64;
|
||||
@@ -71,9 +72,9 @@ public:
|
||||
"objectname",
|
||||
"type",
|
||||
"icon",
|
||||
"unknown08",
|
||||
"unknown10",
|
||||
"unknown20",
|
||||
"size_percentage",
|
||||
"solid_type",
|
||||
"incline",
|
||||
"unknown24",
|
||||
"unknown60",
|
||||
"unknown64",
|
||||
@@ -107,9 +108,9 @@ public:
|
||||
"objectname",
|
||||
"type",
|
||||
"icon",
|
||||
"unknown08",
|
||||
"unknown10",
|
||||
"unknown20",
|
||||
"size_percentage",
|
||||
"solid_type",
|
||||
"incline",
|
||||
"unknown24",
|
||||
"unknown60",
|
||||
"unknown64",
|
||||
@@ -177,9 +178,9 @@ public:
|
||||
e.objectname = "";
|
||||
e.type = 0;
|
||||
e.icon = 0;
|
||||
e.unknown08 = 0;
|
||||
e.unknown10 = 0;
|
||||
e.unknown20 = 0;
|
||||
e.size_percentage = 0;
|
||||
e.solid_type = 0;
|
||||
e.incline = 0;
|
||||
e.unknown24 = 0;
|
||||
e.unknown60 = 0;
|
||||
e.unknown64 = 0;
|
||||
@@ -220,8 +221,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
object_id
|
||||
)
|
||||
);
|
||||
@@ -242,9 +244,9 @@ public:
|
||||
e.objectname = row[9] ? row[9] : "";
|
||||
e.type = static_cast<int32_t>(atoi(row[10]));
|
||||
e.icon = static_cast<int32_t>(atoi(row[11]));
|
||||
e.unknown08 = static_cast<int32_t>(atoi(row[12]));
|
||||
e.unknown10 = static_cast<int32_t>(atoi(row[13]));
|
||||
e.unknown20 = static_cast<int32_t>(atoi(row[14]));
|
||||
e.size_percentage = strtof(row[12], nullptr);
|
||||
e.solid_type = static_cast<int32_t>(atoi(row[13]));
|
||||
e.incline = static_cast<int32_t>(atoi(row[14]));
|
||||
e.unknown24 = static_cast<int32_t>(atoi(row[15]));
|
||||
e.unknown60 = static_cast<int32_t>(atoi(row[16]));
|
||||
e.unknown64 = static_cast<int32_t>(atoi(row[17]));
|
||||
@@ -304,9 +306,9 @@ public:
|
||||
v.push_back(columns[9] + " = '" + Strings::Escape(e.objectname) + "'");
|
||||
v.push_back(columns[10] + " = " + std::to_string(e.type));
|
||||
v.push_back(columns[11] + " = " + std::to_string(e.icon));
|
||||
v.push_back(columns[12] + " = " + std::to_string(e.unknown08));
|
||||
v.push_back(columns[13] + " = " + std::to_string(e.unknown10));
|
||||
v.push_back(columns[14] + " = " + std::to_string(e.unknown20));
|
||||
v.push_back(columns[12] + " = " + std::to_string(e.size_percentage));
|
||||
v.push_back(columns[13] + " = " + std::to_string(e.solid_type));
|
||||
v.push_back(columns[14] + " = " + std::to_string(e.incline));
|
||||
v.push_back(columns[15] + " = " + std::to_string(e.unknown24));
|
||||
v.push_back(columns[16] + " = " + std::to_string(e.unknown60));
|
||||
v.push_back(columns[17] + " = " + std::to_string(e.unknown64));
|
||||
@@ -355,9 +357,9 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.objectname) + "'");
|
||||
v.push_back(std::to_string(e.type));
|
||||
v.push_back(std::to_string(e.icon));
|
||||
v.push_back(std::to_string(e.unknown08));
|
||||
v.push_back(std::to_string(e.unknown10));
|
||||
v.push_back(std::to_string(e.unknown20));
|
||||
v.push_back(std::to_string(e.size_percentage));
|
||||
v.push_back(std::to_string(e.solid_type));
|
||||
v.push_back(std::to_string(e.incline));
|
||||
v.push_back(std::to_string(e.unknown24));
|
||||
v.push_back(std::to_string(e.unknown60));
|
||||
v.push_back(std::to_string(e.unknown64));
|
||||
@@ -414,9 +416,9 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.objectname) + "'");
|
||||
v.push_back(std::to_string(e.type));
|
||||
v.push_back(std::to_string(e.icon));
|
||||
v.push_back(std::to_string(e.unknown08));
|
||||
v.push_back(std::to_string(e.unknown10));
|
||||
v.push_back(std::to_string(e.unknown20));
|
||||
v.push_back(std::to_string(e.size_percentage));
|
||||
v.push_back(std::to_string(e.solid_type));
|
||||
v.push_back(std::to_string(e.incline));
|
||||
v.push_back(std::to_string(e.unknown24));
|
||||
v.push_back(std::to_string(e.unknown60));
|
||||
v.push_back(std::to_string(e.unknown64));
|
||||
@@ -477,9 +479,9 @@ public:
|
||||
e.objectname = row[9] ? row[9] : "";
|
||||
e.type = static_cast<int32_t>(atoi(row[10]));
|
||||
e.icon = static_cast<int32_t>(atoi(row[11]));
|
||||
e.unknown08 = static_cast<int32_t>(atoi(row[12]));
|
||||
e.unknown10 = static_cast<int32_t>(atoi(row[13]));
|
||||
e.unknown20 = static_cast<int32_t>(atoi(row[14]));
|
||||
e.size_percentage = strtof(row[12], nullptr);
|
||||
e.solid_type = static_cast<int32_t>(atoi(row[13]));
|
||||
e.incline = static_cast<int32_t>(atoi(row[14]));
|
||||
e.unknown24 = static_cast<int32_t>(atoi(row[15]));
|
||||
e.unknown60 = static_cast<int32_t>(atoi(row[16]));
|
||||
e.unknown64 = static_cast<int32_t>(atoi(row[17]));
|
||||
@@ -531,9 +533,9 @@ public:
|
||||
e.objectname = row[9] ? row[9] : "";
|
||||
e.type = static_cast<int32_t>(atoi(row[10]));
|
||||
e.icon = static_cast<int32_t>(atoi(row[11]));
|
||||
e.unknown08 = static_cast<int32_t>(atoi(row[12]));
|
||||
e.unknown10 = static_cast<int32_t>(atoi(row[13]));
|
||||
e.unknown20 = static_cast<int32_t>(atoi(row[14]));
|
||||
e.size_percentage = strtof(row[12], nullptr);
|
||||
e.solid_type = static_cast<int32_t>(atoi(row[13]));
|
||||
e.incline = static_cast<int32_t>(atoi(row[14]));
|
||||
e.unknown24 = static_cast<int32_t>(atoi(row[15]));
|
||||
e.unknown60 = static_cast<int32_t>(atoi(row[16]));
|
||||
e.unknown64 = static_cast<int32_t>(atoi(row[17]));
|
||||
|
||||
@@ -0,0 +1,354 @@
|
||||
/**
|
||||
* 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://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_SPAWN2_DISABLED_REPOSITORY_H
|
||||
#define EQEMU_BASE_SPAWN2_DISABLED_REPOSITORY_H
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../strings.h"
|
||||
#include <ctime>
|
||||
|
||||
|
||||
class BaseSpawn2DisabledRepository {
|
||||
public:
|
||||
struct Spawn2Disabled {
|
||||
int64_t id;
|
||||
int32_t spawn2_id;
|
||||
int32_t instance_id;
|
||||
int16_t disabled;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
{
|
||||
return std::string("id");
|
||||
}
|
||||
|
||||
static std::vector<std::string> Columns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"spawn2_id",
|
||||
"instance_id",
|
||||
"disabled",
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"spawn2_id",
|
||||
"instance_id",
|
||||
"disabled",
|
||||
};
|
||||
}
|
||||
|
||||
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("spawn2_disabled");
|
||||
}
|
||||
|
||||
static std::string BaseSelect()
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
static std::string BaseInsert()
|
||||
{
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static Spawn2Disabled NewEntity()
|
||||
{
|
||||
Spawn2Disabled e{};
|
||||
|
||||
e.id = 0;
|
||||
e.spawn2_id = 0;
|
||||
e.instance_id = 0;
|
||||
e.disabled = 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
static Spawn2Disabled GetSpawn2Disabled(
|
||||
const std::vector<Spawn2Disabled> &spawn2_disableds,
|
||||
int spawn2_disabled_id
|
||||
)
|
||||
{
|
||||
for (auto &spawn2_disabled : spawn2_disableds) {
|
||||
if (spawn2_disabled.id == spawn2_disabled_id) {
|
||||
return spawn2_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static Spawn2Disabled FindOne(
|
||||
Database& db,
|
||||
int spawn2_disabled_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
spawn2_disabled_id
|
||||
)
|
||||
);
|
||||
|
||||
auto row = results.begin();
|
||||
if (results.RowCount() == 1) {
|
||||
Spawn2Disabled e{};
|
||||
|
||||
e.id = strtoll(row[0], nullptr, 10);
|
||||
e.spawn2_id = static_cast<int32_t>(atoi(row[1]));
|
||||
e.instance_id = static_cast<int32_t>(atoi(row[2]));
|
||||
e.disabled = static_cast<int16_t>(atoi(row[3]));
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int spawn2_disabled_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
PrimaryKey(),
|
||||
spawn2_disabled_id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
const Spawn2Disabled &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.spawn2_id));
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.instance_id));
|
||||
v.push_back(columns[3] + " = " + std::to_string(e.disabled));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
Strings::Implode(", ", v),
|
||||
PrimaryKey(),
|
||||
e.id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static Spawn2Disabled InsertOne(
|
||||
Database& db,
|
||||
Spawn2Disabled e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.spawn2_id));
|
||||
v.push_back(std::to_string(e.instance_id));
|
||||
v.push_back(std::to_string(e.disabled));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
if (results.Success()) {
|
||||
e.id = results.LastInsertedID();
|
||||
return e;
|
||||
}
|
||||
|
||||
e = NewEntity();
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
const std::vector<Spawn2Disabled> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.spawn2_id));
|
||||
v.push_back(std::to_string(e.instance_id));
|
||||
v.push_back(std::to_string(e.disabled));
|
||||
|
||||
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<Spawn2Disabled> All(Database& db)
|
||||
{
|
||||
std::vector<Spawn2Disabled> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
Spawn2Disabled e{};
|
||||
|
||||
e.id = strtoll(row[0], nullptr, 10);
|
||||
e.spawn2_id = static_cast<int32_t>(atoi(row[1]));
|
||||
e.instance_id = static_cast<int32_t>(atoi(row[2]));
|
||||
e.disabled = static_cast<int16_t>(atoi(row[3]));
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Spawn2Disabled> GetWhere(Database& db, const std::string &where_filter)
|
||||
{
|
||||
std::vector<Spawn2Disabled> 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) {
|
||||
Spawn2Disabled e{};
|
||||
|
||||
e.id = strtoll(row[0], nullptr, 10);
|
||||
e.spawn2_id = static_cast<int32_t>(atoi(row[1]));
|
||||
e.instance_id = static_cast<int32_t>(atoi(row[2]));
|
||||
e.disabled = static_cast<int16_t>(atoi(row[3]));
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_SPAWN2_DISABLED_REPOSITORY_H
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "../../strings.h"
|
||||
#include <ctime>
|
||||
|
||||
|
||||
class BaseSpawn2Repository {
|
||||
public:
|
||||
struct Spawn2 {
|
||||
@@ -33,7 +34,6 @@ public:
|
||||
int8_t path_when_zone_idle;
|
||||
uint32_t _condition;
|
||||
int32_t cond_value;
|
||||
uint8_t enabled;
|
||||
uint8_t animation;
|
||||
int8_t min_expansion;
|
||||
int8_t max_expansion;
|
||||
@@ -63,7 +63,6 @@ public:
|
||||
"path_when_zone_idle",
|
||||
"_condition",
|
||||
"cond_value",
|
||||
"enabled",
|
||||
"animation",
|
||||
"min_expansion",
|
||||
"max_expansion",
|
||||
@@ -89,7 +88,6 @@ public:
|
||||
"path_when_zone_idle",
|
||||
"_condition",
|
||||
"cond_value",
|
||||
"enabled",
|
||||
"animation",
|
||||
"min_expansion",
|
||||
"max_expansion",
|
||||
@@ -149,7 +147,6 @@ public:
|
||||
e.path_when_zone_idle = 0;
|
||||
e._condition = 0;
|
||||
e.cond_value = 1;
|
||||
e.enabled = 1;
|
||||
e.animation = 0;
|
||||
e.min_expansion = -1;
|
||||
e.max_expansion = -1;
|
||||
@@ -180,8 +177,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
spawn2_id
|
||||
)
|
||||
);
|
||||
@@ -204,12 +202,11 @@ public:
|
||||
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
||||
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
||||
e.enabled = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||
e.animation = static_cast<uint8_t>(strtoul(row[15], nullptr, 10));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[16]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[17]));
|
||||
e.content_flags = row[18] ? row[18] : "";
|
||||
e.content_flags_disabled = row[19] ? row[19] : "";
|
||||
e.animation = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[15]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[16]));
|
||||
e.content_flags = row[17] ? row[17] : "";
|
||||
e.content_flags_disabled = row[18] ? row[18] : "";
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -256,12 +253,11 @@ public:
|
||||
v.push_back(columns[11] + " = " + std::to_string(e.path_when_zone_idle));
|
||||
v.push_back(columns[12] + " = " + std::to_string(e._condition));
|
||||
v.push_back(columns[13] + " = " + std::to_string(e.cond_value));
|
||||
v.push_back(columns[14] + " = " + std::to_string(e.enabled));
|
||||
v.push_back(columns[15] + " = " + std::to_string(e.animation));
|
||||
v.push_back(columns[16] + " = " + std::to_string(e.min_expansion));
|
||||
v.push_back(columns[17] + " = " + std::to_string(e.max_expansion));
|
||||
v.push_back(columns[18] + " = '" + Strings::Escape(e.content_flags) + "'");
|
||||
v.push_back(columns[19] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||
v.push_back(columns[14] + " = " + std::to_string(e.animation));
|
||||
v.push_back(columns[15] + " = " + std::to_string(e.min_expansion));
|
||||
v.push_back(columns[16] + " = " + std::to_string(e.max_expansion));
|
||||
v.push_back(columns[17] + " = '" + Strings::Escape(e.content_flags) + "'");
|
||||
v.push_back(columns[18] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -297,7 +293,6 @@ public:
|
||||
v.push_back(std::to_string(e.path_when_zone_idle));
|
||||
v.push_back(std::to_string(e._condition));
|
||||
v.push_back(std::to_string(e.cond_value));
|
||||
v.push_back(std::to_string(e.enabled));
|
||||
v.push_back(std::to_string(e.animation));
|
||||
v.push_back(std::to_string(e.min_expansion));
|
||||
v.push_back(std::to_string(e.max_expansion));
|
||||
@@ -346,7 +341,6 @@ public:
|
||||
v.push_back(std::to_string(e.path_when_zone_idle));
|
||||
v.push_back(std::to_string(e._condition));
|
||||
v.push_back(std::to_string(e.cond_value));
|
||||
v.push_back(std::to_string(e.enabled));
|
||||
v.push_back(std::to_string(e.animation));
|
||||
v.push_back(std::to_string(e.min_expansion));
|
||||
v.push_back(std::to_string(e.max_expansion));
|
||||
@@ -399,12 +393,11 @@ public:
|
||||
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
||||
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
||||
e.enabled = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||
e.animation = static_cast<uint8_t>(strtoul(row[15], nullptr, 10));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[16]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[17]));
|
||||
e.content_flags = row[18] ? row[18] : "";
|
||||
e.content_flags_disabled = row[19] ? row[19] : "";
|
||||
e.animation = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[15]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[16]));
|
||||
e.content_flags = row[17] ? row[17] : "";
|
||||
e.content_flags_disabled = row[18] ? row[18] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -443,12 +436,11 @@ public:
|
||||
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
||||
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
||||
e.enabled = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||
e.animation = static_cast<uint8_t>(strtoul(row[15], nullptr, 10));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[16]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[17]));
|
||||
e.content_flags = row[18] ? row[18] : "";
|
||||
e.content_flags_disabled = row[19] ? row[19] : "";
|
||||
e.animation = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[15]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[16]));
|
||||
e.content_flags = row[17] ? row[17] : "";
|
||||
e.content_flags_disabled = row[18] ? row[18] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "../../strings.h"
|
||||
#include <ctime>
|
||||
|
||||
|
||||
class BaseSpawnentryRepository {
|
||||
public:
|
||||
struct Spawnentry {
|
||||
@@ -23,6 +24,8 @@ public:
|
||||
int32_t npcID;
|
||||
int16_t chance;
|
||||
int32_t condition_value_filter;
|
||||
int16_t min_time;
|
||||
int16_t max_time;
|
||||
int8_t min_expansion;
|
||||
int8_t max_expansion;
|
||||
std::string content_flags;
|
||||
@@ -41,6 +44,8 @@ public:
|
||||
"npcID",
|
||||
"chance",
|
||||
"condition_value_filter",
|
||||
"min_time",
|
||||
"max_time",
|
||||
"min_expansion",
|
||||
"max_expansion",
|
||||
"content_flags",
|
||||
@@ -55,6 +60,8 @@ public:
|
||||
"npcID",
|
||||
"chance",
|
||||
"condition_value_filter",
|
||||
"min_time",
|
||||
"max_time",
|
||||
"min_expansion",
|
||||
"max_expansion",
|
||||
"content_flags",
|
||||
@@ -103,6 +110,8 @@ public:
|
||||
e.npcID = 0;
|
||||
e.chance = 0;
|
||||
e.condition_value_filter = 1;
|
||||
e.min_time = 0;
|
||||
e.max_time = 0;
|
||||
e.min_expansion = -1;
|
||||
e.max_expansion = -1;
|
||||
e.content_flags = "";
|
||||
@@ -132,8 +141,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
spawnentry_id
|
||||
)
|
||||
);
|
||||
@@ -146,10 +156,12 @@ public:
|
||||
e.npcID = static_cast<int32_t>(atoi(row[1]));
|
||||
e.chance = static_cast<int16_t>(atoi(row[2]));
|
||||
e.condition_value_filter = static_cast<int32_t>(atoi(row[3]));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[4]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[5]));
|
||||
e.content_flags = row[6] ? row[6] : "";
|
||||
e.content_flags_disabled = row[7] ? row[7] : "";
|
||||
e.min_time = static_cast<int16_t>(atoi(row[4]));
|
||||
e.max_time = static_cast<int16_t>(atoi(row[5]));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[6]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[7]));
|
||||
e.content_flags = row[8] ? row[8] : "";
|
||||
e.content_flags_disabled = row[9] ? row[9] : "";
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -187,10 +199,12 @@ public:
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.npcID));
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.chance));
|
||||
v.push_back(columns[3] + " = " + std::to_string(e.condition_value_filter));
|
||||
v.push_back(columns[4] + " = " + std::to_string(e.min_expansion));
|
||||
v.push_back(columns[5] + " = " + std::to_string(e.max_expansion));
|
||||
v.push_back(columns[6] + " = '" + Strings::Escape(e.content_flags) + "'");
|
||||
v.push_back(columns[7] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||
v.push_back(columns[4] + " = " + std::to_string(e.min_time));
|
||||
v.push_back(columns[5] + " = " + std::to_string(e.max_time));
|
||||
v.push_back(columns[6] + " = " + std::to_string(e.min_expansion));
|
||||
v.push_back(columns[7] + " = " + std::to_string(e.max_expansion));
|
||||
v.push_back(columns[8] + " = '" + Strings::Escape(e.content_flags) + "'");
|
||||
v.push_back(columns[9] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -216,6 +230,8 @@ public:
|
||||
v.push_back(std::to_string(e.npcID));
|
||||
v.push_back(std::to_string(e.chance));
|
||||
v.push_back(std::to_string(e.condition_value_filter));
|
||||
v.push_back(std::to_string(e.min_time));
|
||||
v.push_back(std::to_string(e.max_time));
|
||||
v.push_back(std::to_string(e.min_expansion));
|
||||
v.push_back(std::to_string(e.max_expansion));
|
||||
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||
@@ -253,6 +269,8 @@ public:
|
||||
v.push_back(std::to_string(e.npcID));
|
||||
v.push_back(std::to_string(e.chance));
|
||||
v.push_back(std::to_string(e.condition_value_filter));
|
||||
v.push_back(std::to_string(e.min_time));
|
||||
v.push_back(std::to_string(e.max_time));
|
||||
v.push_back(std::to_string(e.min_expansion));
|
||||
v.push_back(std::to_string(e.max_expansion));
|
||||
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||
@@ -294,10 +312,12 @@ public:
|
||||
e.npcID = static_cast<int32_t>(atoi(row[1]));
|
||||
e.chance = static_cast<int16_t>(atoi(row[2]));
|
||||
e.condition_value_filter = static_cast<int32_t>(atoi(row[3]));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[4]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[5]));
|
||||
e.content_flags = row[6] ? row[6] : "";
|
||||
e.content_flags_disabled = row[7] ? row[7] : "";
|
||||
e.min_time = static_cast<int16_t>(atoi(row[4]));
|
||||
e.max_time = static_cast<int16_t>(atoi(row[5]));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[6]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[7]));
|
||||
e.content_flags = row[8] ? row[8] : "";
|
||||
e.content_flags_disabled = row[9] ? row[9] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -326,10 +346,12 @@ public:
|
||||
e.npcID = static_cast<int32_t>(atoi(row[1]));
|
||||
e.chance = static_cast<int16_t>(atoi(row[2]));
|
||||
e.condition_value_filter = static_cast<int32_t>(atoi(row[3]));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[4]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[5]));
|
||||
e.content_flags = row[6] ? row[6] : "";
|
||||
e.content_flags_disabled = row[7] ? row[7] : "";
|
||||
e.min_time = static_cast<int16_t>(atoi(row[4]));
|
||||
e.max_time = static_cast<int16_t>(atoi(row[5]));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[6]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[7]));
|
||||
e.content_flags = row[8] ? row[8] : "";
|
||||
e.content_flags_disabled = row[9] ? row[9] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
|
||||
@@ -16,18 +16,19 @@
|
||||
#include "../../strings.h"
|
||||
#include <ctime>
|
||||
|
||||
|
||||
class BaseStartingItemsRepository {
|
||||
public:
|
||||
struct StartingItems {
|
||||
uint32_t id;
|
||||
int32_t race;
|
||||
int32_t class_;
|
||||
int32_t deityid;
|
||||
int32_t zoneid;
|
||||
int32_t itemid;
|
||||
std::string class_list;
|
||||
std::string race_list;
|
||||
std::string deity_list;
|
||||
std::string zone_id_list;
|
||||
uint32_t item_id;
|
||||
uint8_t item_charges;
|
||||
int8_t gm;
|
||||
int32_t slot;
|
||||
int32_t status;
|
||||
int32_t inventory_slot;
|
||||
int8_t min_expansion;
|
||||
int8_t max_expansion;
|
||||
std::string content_flags;
|
||||
@@ -43,14 +44,14 @@ public:
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"race",
|
||||
"`class`",
|
||||
"deityid",
|
||||
"zoneid",
|
||||
"itemid",
|
||||
"class_list",
|
||||
"race_list",
|
||||
"deity_list",
|
||||
"zone_id_list",
|
||||
"item_id",
|
||||
"item_charges",
|
||||
"gm",
|
||||
"slot",
|
||||
"status",
|
||||
"inventory_slot",
|
||||
"min_expansion",
|
||||
"max_expansion",
|
||||
"content_flags",
|
||||
@@ -62,14 +63,14 @@ public:
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"race",
|
||||
"`class`",
|
||||
"deityid",
|
||||
"zoneid",
|
||||
"itemid",
|
||||
"class_list",
|
||||
"race_list",
|
||||
"deity_list",
|
||||
"zone_id_list",
|
||||
"item_id",
|
||||
"item_charges",
|
||||
"gm",
|
||||
"slot",
|
||||
"status",
|
||||
"inventory_slot",
|
||||
"min_expansion",
|
||||
"max_expansion",
|
||||
"content_flags",
|
||||
@@ -115,14 +116,14 @@ public:
|
||||
StartingItems e{};
|
||||
|
||||
e.id = 0;
|
||||
e.race = 0;
|
||||
e.class_ = 0;
|
||||
e.deityid = 0;
|
||||
e.zoneid = 0;
|
||||
e.itemid = 0;
|
||||
e.class_list = "";
|
||||
e.race_list = "";
|
||||
e.deity_list = "";
|
||||
e.zone_id_list = "";
|
||||
e.item_id = 0;
|
||||
e.item_charges = 1;
|
||||
e.gm = 0;
|
||||
e.slot = -1;
|
||||
e.status = 0;
|
||||
e.inventory_slot = -1;
|
||||
e.min_expansion = -1;
|
||||
e.max_expansion = -1;
|
||||
e.content_flags = "";
|
||||
@@ -152,8 +153,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
starting_items_id
|
||||
)
|
||||
);
|
||||
@@ -163,14 +165,14 @@ public:
|
||||
StartingItems e{};
|
||||
|
||||
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.race = static_cast<int32_t>(atoi(row[1]));
|
||||
e.class_ = static_cast<int32_t>(atoi(row[2]));
|
||||
e.deityid = static_cast<int32_t>(atoi(row[3]));
|
||||
e.zoneid = static_cast<int32_t>(atoi(row[4]));
|
||||
e.itemid = static_cast<int32_t>(atoi(row[5]));
|
||||
e.class_list = row[1] ? row[1] : "";
|
||||
e.race_list = row[2] ? row[2] : "";
|
||||
e.deity_list = row[3] ? row[3] : "";
|
||||
e.zone_id_list = row[4] ? row[4] : "";
|
||||
e.item_id = static_cast<uint32_t>(strtoul(row[5], nullptr, 10));
|
||||
e.item_charges = static_cast<uint8_t>(strtoul(row[6], nullptr, 10));
|
||||
e.gm = static_cast<int8_t>(atoi(row[7]));
|
||||
e.slot = static_cast<int32_t>(atoi(row[8]));
|
||||
e.status = static_cast<int32_t>(atoi(row[7]));
|
||||
e.inventory_slot = static_cast<int32_t>(atoi(row[8]));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[9]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[10]));
|
||||
e.content_flags = row[11] ? row[11] : "";
|
||||
@@ -208,14 +210,14 @@ public:
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.race));
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.class_));
|
||||
v.push_back(columns[3] + " = " + std::to_string(e.deityid));
|
||||
v.push_back(columns[4] + " = " + std::to_string(e.zoneid));
|
||||
v.push_back(columns[5] + " = " + std::to_string(e.itemid));
|
||||
v.push_back(columns[1] + " = '" + Strings::Escape(e.class_list) + "'");
|
||||
v.push_back(columns[2] + " = '" + Strings::Escape(e.race_list) + "'");
|
||||
v.push_back(columns[3] + " = '" + Strings::Escape(e.deity_list) + "'");
|
||||
v.push_back(columns[4] + " = '" + Strings::Escape(e.zone_id_list) + "'");
|
||||
v.push_back(columns[5] + " = " + std::to_string(e.item_id));
|
||||
v.push_back(columns[6] + " = " + std::to_string(e.item_charges));
|
||||
v.push_back(columns[7] + " = " + std::to_string(e.gm));
|
||||
v.push_back(columns[8] + " = " + std::to_string(e.slot));
|
||||
v.push_back(columns[7] + " = " + std::to_string(e.status));
|
||||
v.push_back(columns[8] + " = " + std::to_string(e.inventory_slot));
|
||||
v.push_back(columns[9] + " = " + std::to_string(e.min_expansion));
|
||||
v.push_back(columns[10] + " = " + std::to_string(e.max_expansion));
|
||||
v.push_back(columns[11] + " = '" + Strings::Escape(e.content_flags) + "'");
|
||||
@@ -242,14 +244,14 @@ public:
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.race));
|
||||
v.push_back(std::to_string(e.class_));
|
||||
v.push_back(std::to_string(e.deityid));
|
||||
v.push_back(std::to_string(e.zoneid));
|
||||
v.push_back(std::to_string(e.itemid));
|
||||
v.push_back("'" + Strings::Escape(e.class_list) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.race_list) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.deity_list) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.zone_id_list) + "'");
|
||||
v.push_back(std::to_string(e.item_id));
|
||||
v.push_back(std::to_string(e.item_charges));
|
||||
v.push_back(std::to_string(e.gm));
|
||||
v.push_back(std::to_string(e.slot));
|
||||
v.push_back(std::to_string(e.status));
|
||||
v.push_back(std::to_string(e.inventory_slot));
|
||||
v.push_back(std::to_string(e.min_expansion));
|
||||
v.push_back(std::to_string(e.max_expansion));
|
||||
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||
@@ -284,14 +286,14 @@ public:
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.race));
|
||||
v.push_back(std::to_string(e.class_));
|
||||
v.push_back(std::to_string(e.deityid));
|
||||
v.push_back(std::to_string(e.zoneid));
|
||||
v.push_back(std::to_string(e.itemid));
|
||||
v.push_back("'" + Strings::Escape(e.class_list) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.race_list) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.deity_list) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.zone_id_list) + "'");
|
||||
v.push_back(std::to_string(e.item_id));
|
||||
v.push_back(std::to_string(e.item_charges));
|
||||
v.push_back(std::to_string(e.gm));
|
||||
v.push_back(std::to_string(e.slot));
|
||||
v.push_back(std::to_string(e.status));
|
||||
v.push_back(std::to_string(e.inventory_slot));
|
||||
v.push_back(std::to_string(e.min_expansion));
|
||||
v.push_back(std::to_string(e.max_expansion));
|
||||
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||
@@ -330,14 +332,14 @@ public:
|
||||
StartingItems e{};
|
||||
|
||||
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.race = static_cast<int32_t>(atoi(row[1]));
|
||||
e.class_ = static_cast<int32_t>(atoi(row[2]));
|
||||
e.deityid = static_cast<int32_t>(atoi(row[3]));
|
||||
e.zoneid = static_cast<int32_t>(atoi(row[4]));
|
||||
e.itemid = static_cast<int32_t>(atoi(row[5]));
|
||||
e.class_list = row[1] ? row[1] : "";
|
||||
e.race_list = row[2] ? row[2] : "";
|
||||
e.deity_list = row[3] ? row[3] : "";
|
||||
e.zone_id_list = row[4] ? row[4] : "";
|
||||
e.item_id = static_cast<uint32_t>(strtoul(row[5], nullptr, 10));
|
||||
e.item_charges = static_cast<uint8_t>(strtoul(row[6], nullptr, 10));
|
||||
e.gm = static_cast<int8_t>(atoi(row[7]));
|
||||
e.slot = static_cast<int32_t>(atoi(row[8]));
|
||||
e.status = static_cast<int32_t>(atoi(row[7]));
|
||||
e.inventory_slot = static_cast<int32_t>(atoi(row[8]));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[9]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[10]));
|
||||
e.content_flags = row[11] ? row[11] : "";
|
||||
@@ -367,14 +369,14 @@ public:
|
||||
StartingItems e{};
|
||||
|
||||
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.race = static_cast<int32_t>(atoi(row[1]));
|
||||
e.class_ = static_cast<int32_t>(atoi(row[2]));
|
||||
e.deityid = static_cast<int32_t>(atoi(row[3]));
|
||||
e.zoneid = static_cast<int32_t>(atoi(row[4]));
|
||||
e.itemid = static_cast<int32_t>(atoi(row[5]));
|
||||
e.class_list = row[1] ? row[1] : "";
|
||||
e.race_list = row[2] ? row[2] : "";
|
||||
e.deity_list = row[3] ? row[3] : "";
|
||||
e.zone_id_list = row[4] ? row[4] : "";
|
||||
e.item_id = static_cast<uint32_t>(strtoul(row[5], nullptr, 10));
|
||||
e.item_charges = static_cast<uint8_t>(strtoul(row[6], nullptr, 10));
|
||||
e.gm = static_cast<int8_t>(atoi(row[7]));
|
||||
e.slot = static_cast<int32_t>(atoi(row[8]));
|
||||
e.status = static_cast<int32_t>(atoi(row[7]));
|
||||
e.inventory_slot = static_cast<int32_t>(atoi(row[8]));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[9]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[10]));
|
||||
e.content_flags = row[11] ? row[11] : "";
|
||||
|
||||
@@ -120,6 +120,8 @@ public:
|
||||
{.parent_command = "set", .sub_command = "title_suffix", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "titlesuffix"},
|
||||
{.parent_command = "set", .sub_command = "weather", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "weather"},
|
||||
{.parent_command = "set", .sub_command = "zone", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "zclip|zcolor|zheader|zonelock|zsafecoords|zsky|zunderworld"},
|
||||
{.parent_command = "show", .sub_command = "aas", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showaas"},
|
||||
{.parent_command = "show", .sub_command = "aa_points", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showaapoints|showaapts"},
|
||||
{.parent_command = "show", .sub_command = "aggro", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "aggro"},
|
||||
{.parent_command = "show", .sub_command = "buffs", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showbuffs"},
|
||||
{.parent_command = "show", .sub_command = "buried_corpse_count", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "getplayerburiedcorpsecount"},
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
#ifndef EQEMU_KEYRING_REPOSITORY_H
|
||||
#define EQEMU_KEYRING_REPOSITORY_H
|
||||
|
||||
#include "../database.h"
|
||||
#include "../strings.h"
|
||||
#include "base/base_keyring_repository.h"
|
||||
|
||||
class KeyringRepository: public BaseKeyringRepository {
|
||||
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
|
||||
*
|
||||
* KeyringRepository::GetByZoneAndVersion(int zone_id, int zone_version)
|
||||
* KeyringRepository::GetWhereNeverExpires()
|
||||
* KeyringRepository::GetWhereXAndY()
|
||||
* KeyringRepository::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_KEYRING_REPOSITORY_H
|
||||
@@ -0,0 +1,50 @@
|
||||
#ifndef EQEMU_SPAWN2_DISABLED_REPOSITORY_H
|
||||
#define EQEMU_SPAWN2_DISABLED_REPOSITORY_H
|
||||
|
||||
#include "../database.h"
|
||||
#include "../strings.h"
|
||||
#include "base/base_spawn2_disabled_repository.h"
|
||||
|
||||
class Spawn2DisabledRepository: public BaseSpawn2DisabledRepository {
|
||||
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
|
||||
*
|
||||
* Spawn2DisabledRepository::GetByZoneAndVersion(int zone_id, int zone_version)
|
||||
* Spawn2DisabledRepository::GetWhereNeverExpires()
|
||||
* Spawn2DisabledRepository::GetWhereXAndY()
|
||||
* Spawn2DisabledRepository::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_SPAWN2_DISABLED_REPOSITORY_H
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
#include "strings.h"
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include "../common/repositories/rule_sets_repository.h"
|
||||
#include "../common/repositories/rule_values_repository.h"
|
||||
|
||||
@@ -303,6 +303,9 @@ RULE_BOOL(World, EnforceCharacterLimitAtLogin, false, "Enforce the limit for cha
|
||||
RULE_BOOL(World, EnableDevTools, true, "Enable or Disable the Developer Tools globally (Most of the time you want this enabled)")
|
||||
RULE_BOOL(World, EnableChecksumVerification, false, "Enable or Disable the Checksum Verification for eqgame.exe and spells_us.txt")
|
||||
RULE_INT(World, MaximumQuestErrors, 30, "Changes the maximum number of quest errors that can be displayed in #questerrors, default is 30")
|
||||
RULE_INT(World, BootHour, 0, "Sets the in-game hour world will set when it first boots. 0-24 are valid options, where 0 disables this rule")
|
||||
RULE_BOOL(World, UseItemLinksForKeyRing, false, "Uses item links for Key Ring Listing instead of item name")
|
||||
RULE_BOOL(World, UseOldShadowKnightClassExport, true, "Disable to have Shadowknight show as Shadow Knight (live-like)")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Zone)
|
||||
@@ -456,6 +459,8 @@ RULE_INT(Spells, WizardCritMinimumRandomRatio, 20, "The minimum value for the ra
|
||||
RULE_INT(Spells, WizardCritMaximumRandomRatio, 70, "The maximum value for the random range which Wizards and Caster DPS Mercs innately have for spell crit ratio. Set to 70 for vanilla values.")
|
||||
RULE_INT(Spells, DefensiveProcPenaltyLevelGap, 6, "Defensive Proc Penalty Level Gap where procs start losing their proc rate at RuleR(Spells, DefensiveProcPenaltyModifier)% per level difference")
|
||||
RULE_REAL(Spells, DefensiveProcPenaltyLevelGapModifier, 10.0f, "Defensive Proc Penalty Level Gap Modifier where procs start losing their proc rate at defined % after RuleI(Spells, DefensiveProcLevelGap) level difference")
|
||||
RULE_BOOL(Spells, DOTBonusDamageSplitOverDuration, true, "Disable to have Damage Over Time total bonus damage added to each tick instead of divided across duration")
|
||||
RULE_BOOL(Spells, HOTBonusHealingSplitOverDuration, true, "Disable to have Heal Over Time total bonus healing added to each tick instead of divided across duration")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Combat)
|
||||
@@ -648,6 +653,9 @@ RULE_BOOL(Bots, ResurrectionSickness, true, "Use Resurrection Sickness based on
|
||||
RULE_INT(Bots, OldResurrectionSicknessSpell, 757, "757 is Default Old Resurrection Sickness Spell")
|
||||
RULE_INT(Bots, ResurrectionSicknessSpell, 756, "756 is Default Resurrection Sickness Spell")
|
||||
RULE_BOOL(Bots, AllowPickpocketCommand, true, "Allows the use of the bot command 'pickpocket'")
|
||||
RULE_BOOL(Bots, BotHealOnLevel, false, "Setting whether a bot should heal completely when leveling. Default FALSE.")
|
||||
RULE_INT(Bots, AutosaveIntervalSeconds, 300, "Number of seconds after which a timer is triggered which stores the bot data. The value 0 means no periodic automatic saving.")
|
||||
RULE_BOOL(Bots, CazicTouchBotsOwner, true, "Default True. Cazic Touch/DT will hit bot owner rather than bot.")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Chat)
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct eq_cpu_info_s {
|
||||
std::string model;
|
||||
|
||||
+9
-9
@@ -461,12 +461,12 @@ struct SPackSendQueue {
|
||||
uchar buffer[0];
|
||||
};
|
||||
|
||||
struct ServerZoneStateChange_struct {
|
||||
uint32 ZoneServerID;
|
||||
char adminname[64];
|
||||
uint32 zoneid;
|
||||
uint16 instanceid;
|
||||
bool makestatic;
|
||||
struct ServerZoneStateChange_Struct {
|
||||
uint32 zone_server_id;
|
||||
uint32 zone_id;
|
||||
uint16 instance_id;
|
||||
bool is_static;
|
||||
char admin_name[64];
|
||||
};
|
||||
|
||||
struct ServerZoneIncomingClient_Struct {
|
||||
@@ -1142,10 +1142,10 @@ struct ServerInstanceUpdateTime_Struct
|
||||
uint32 new_duration;
|
||||
};
|
||||
|
||||
struct ServerSpawnStatusChange_Struct
|
||||
{
|
||||
struct ServerSpawnStatusChange_Struct {
|
||||
uint32 id;
|
||||
bool new_status;
|
||||
bool new_status;
|
||||
uint32 instance_id;
|
||||
};
|
||||
|
||||
struct ServerQGlobalUpdate_Struct
|
||||
|
||||
+79
-36
@@ -18,7 +18,7 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1800
|
||||
#include <algorithm>
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "repositories/criteria/content_filter_criteria.h"
|
||||
#include "repositories/account_repository.h"
|
||||
#include "repositories/faction_association_repository.h"
|
||||
#include "repositories/starting_items_repository.h"
|
||||
#include "path_manager.h"
|
||||
#include "repositories/loottable_repository.h"
|
||||
|
||||
@@ -51,7 +52,9 @@ namespace ItemField
|
||||
#define F(x) x,
|
||||
#include "item_fieldlist.h"
|
||||
#undef F
|
||||
updated
|
||||
updated,
|
||||
minstatus,
|
||||
comment,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -444,45 +447,81 @@ bool SharedDatabase::SetSharedPlatinum(uint32 account_id, int32 amount_to_add) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, EQ::InventoryProfile* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin_level) {
|
||||
bool SharedDatabase::SetStartingItems(
|
||||
PlayerProfile_Struct *pp,
|
||||
EQ::InventoryProfile *inv,
|
||||
uint32 si_race,
|
||||
uint32 si_class,
|
||||
uint32 si_deity,
|
||||
uint32 si_current_zone,
|
||||
char *si_name,
|
||||
int admin_level
|
||||
)
|
||||
{
|
||||
const EQ::ItemData *item_data;
|
||||
|
||||
const EQ::ItemData *myitem;
|
||||
const auto &l = StartingItemsRepository::All(*this);
|
||||
|
||||
const std::string query = StringFormat(
|
||||
"SELECT itemid, item_charges, slot FROM starting_items "
|
||||
"WHERE (race = %i or race = 0) AND (class = %i or class = 0) AND "
|
||||
"(deityid = %i or deityid = 0) AND (zoneid = %i or zoneid = 0) AND "
|
||||
"gm <= %i %s ORDER BY id",
|
||||
si_race,
|
||||
si_class,
|
||||
si_deity,
|
||||
si_current_zone,
|
||||
admin_level,
|
||||
ContentFilterCriteria::apply().c_str()
|
||||
);
|
||||
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
if (l.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<StartingItemsRepository::StartingItems> v;
|
||||
|
||||
for (auto& row = results.begin(); row != results.end(); ++row) {
|
||||
const int32 itemid = Strings::ToInt(row[0]);
|
||||
const int32 charges = Strings::ToInt(row[1]);
|
||||
int32 slot = Strings::ToInt(row[2]);
|
||||
myitem = GetItem(itemid);
|
||||
for (const auto &e : l) {
|
||||
const auto &classes = Strings::Split(e.class_list, "|");
|
||||
const auto &deities = Strings::Split(e.deity_list, "|");
|
||||
const auto &races = Strings::Split(e.race_list, "|");
|
||||
const auto &zones = Strings::Split(e.zone_id_list, "|");
|
||||
|
||||
if(!myitem)
|
||||
const std::string &all = std::to_string(0);
|
||||
|
||||
if (classes[0] != all) {
|
||||
if (!Strings::Contains(classes, std::to_string(si_class))) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (deities[0] != all) {
|
||||
if (!Strings::Contains(deities, std::to_string(si_deity))) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (races[0] != all) {
|
||||
if (!Strings::Contains(races, std::to_string(si_race))) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (zones[0] != all) {
|
||||
if (!Strings::Contains(zones, std::to_string(si_current_zone))) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
v.emplace_back(e);
|
||||
}
|
||||
|
||||
for (const auto &e : v) {
|
||||
const uint32 item_id = e.item_id;
|
||||
const uint8 item_charges = e.item_charges;
|
||||
int32 slot = e.inventory_slot;
|
||||
|
||||
item_data = GetItem(item_id);
|
||||
|
||||
if (!item_data) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const EQ::ItemInstance* myinst = CreateBaseItem(myitem, charges);
|
||||
const auto *inst = CreateBaseItem(item_data, item_charges);
|
||||
|
||||
if(slot < 0)
|
||||
slot = inv->FindFreeSlot(0, 0);
|
||||
if (slot < EQ::invslot::slotCharm) {
|
||||
slot = inv->FindFreeSlot(false, false);
|
||||
}
|
||||
|
||||
inv->PutItem(slot, *myinst);
|
||||
safe_delete(myinst);
|
||||
inv->PutItem(slot, *inst);
|
||||
safe_delete(inst);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -965,7 +1004,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
#define F(x) "`"#x"`,"
|
||||
#include "item_fieldlist.h"
|
||||
#undef F
|
||||
"updated FROM items ORDER BY id";
|
||||
"updated, minstatus, comment FROM items ORDER BY id";
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
return;
|
||||
@@ -977,9 +1016,13 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
// Unique Identifier
|
||||
item.ID = Strings::ToUnsignedInt(row[ItemField::id]);
|
||||
|
||||
// Name and Lore
|
||||
// Minimum Status
|
||||
item.MinStatus = static_cast<uint8>(Strings::ToUnsignedInt(row[ItemField::minstatus]));
|
||||
|
||||
// Name, Lore, and Comment
|
||||
strn0cpy(item.Name, row[ItemField::name], sizeof(item.Name));
|
||||
strn0cpy(item.Lore, row[ItemField::lore], sizeof(item.Lore));
|
||||
strn0cpy(item.Comment, row[ItemField::comment], sizeof(item.Comment));
|
||||
|
||||
// Flags
|
||||
item.ArtifactFlag = Strings::ToBool(row[ItemField::artifactflag]);
|
||||
@@ -1765,7 +1808,7 @@ bool SharedDatabase::LoadSkillCaps(const std::string &prefix) {
|
||||
}
|
||||
|
||||
void SharedDatabase::LoadSkillCaps(void *data) {
|
||||
const uint32 class_count = PLAYER_CLASS_COUNT;
|
||||
const uint32 class_count = Class::PLAYER_CLASS_COUNT;
|
||||
const uint32 skill_count = EQ::skills::HIGHEST_SKILL + 1;
|
||||
const uint32 level_count = HARD_LEVEL_CAP + 1;
|
||||
uint16 *skill_caps_table = static_cast<uint16*>(data);
|
||||
@@ -1805,7 +1848,7 @@ uint16 SharedDatabase::GetSkillCap(uint8 Class_, EQ::skills::SkillType Skill, ui
|
||||
SkillMaxLevel = RuleI(Character, MaxLevel);
|
||||
}
|
||||
|
||||
const uint32 class_count = PLAYER_CLASS_COUNT;
|
||||
const uint32 class_count = Class::PLAYER_CLASS_COUNT;
|
||||
const uint32 skill_count = EQ::skills::HIGHEST_SKILL + 1;
|
||||
const uint32 level_count = HARD_LEVEL_CAP + 1;
|
||||
if(Class_ > class_count || static_cast<uint32>(Skill) > skill_count || Level > level_count) {
|
||||
@@ -1835,7 +1878,7 @@ uint8 SharedDatabase::GetTrainLevel(uint8 Class_, EQ::skills::SkillType Skill, u
|
||||
SkillMaxLevel = RuleI(Character, MaxLevel);
|
||||
}
|
||||
|
||||
const uint32 class_count = PLAYER_CLASS_COUNT;
|
||||
const uint32 class_count = Class::PLAYER_CLASS_COUNT;
|
||||
const uint32 skill_count = EQ::skills::HIGHEST_SKILL + 1;
|
||||
const uint32 level_count = HARD_LEVEL_CAP + 1;
|
||||
if(Class_ > class_count || static_cast<uint32>(Skill) > skill_count || Level > level_count) {
|
||||
@@ -2018,7 +2061,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) {
|
||||
sp[tempid].environment_type=Strings::ToInt(row[102]);
|
||||
sp[tempid].time_of_day=Strings::ToInt(row[103]);
|
||||
|
||||
for(y=0; y < PLAYER_CLASS_COUNT;y++)
|
||||
for(y=0; y < Class::PLAYER_CLASS_COUNT;y++)
|
||||
sp[tempid].classes[y]=Strings::ToInt(row[104+y]);
|
||||
|
||||
sp[tempid].casting_animation=Strings::ToInt(row[120]);
|
||||
|
||||
+3
-3
@@ -666,7 +666,7 @@ bool IsBardSong(uint16 spell_id)
|
||||
const auto& spell = spells[spell_id];
|
||||
|
||||
if (
|
||||
spell.classes[BARD - 1] < UINT8_MAX &&
|
||||
spell.classes[Class::Bard - 1] < UINT8_MAX &&
|
||||
!spell.is_discipline
|
||||
) {
|
||||
return true;
|
||||
@@ -780,7 +780,7 @@ uint8 GetSpellMinimumLevel(uint16 spell_id)
|
||||
|
||||
const auto& spell = spells[spell_id];
|
||||
|
||||
for (int i = 0; i < PLAYER_CLASS_COUNT; i++) {
|
||||
for (int i = 0; i < Class::PLAYER_CLASS_COUNT; i++) {
|
||||
if (spell.classes[i] < minimum_level) {
|
||||
minimum_level = spell.classes[i];
|
||||
}
|
||||
@@ -798,7 +798,7 @@ uint8 GetSpellLevel(uint16 spell_id, uint8 class_id)
|
||||
return UINT8_MAX;
|
||||
}
|
||||
|
||||
if (class_id >= PLAYER_CLASS_COUNT) {
|
||||
if (class_id >= Class::PLAYER_CLASS_COUNT) {
|
||||
return UINT8_MAX;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1369,7 +1369,7 @@ struct SPDat_Spell_Struct
|
||||
/* 101 */ int8 zone_type; // 01=Outdoors, 02=dungeons, ff=Any -- ZONETYPE
|
||||
/* 102 */ int8 environment_type; // -- ENVIRONMENTTYPE
|
||||
/* 103 */ int8 time_of_day; // -- TIMEOFDAY
|
||||
/* 104 */ uint8 classes[PLAYER_CLASS_COUNT]; // Classes, and their min levels -- WARRIORMIN ... BERSERKERMIN
|
||||
/* 104 */ uint8 classes[Class::PLAYER_CLASS_COUNT]; // Classes, and their min levels -- WARRIORMIN ... BERSERKERMIN
|
||||
/* 120 */ uint8 casting_animation; // -- CASTINGANIM
|
||||
/* 121 */ //uint8 TargetAnim; // -- TARGETANIM
|
||||
/* 122 */ //uint32 TravelType; // -- TRAVELTYPE
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
*/
|
||||
|
||||
#include "strings.h"
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
+3
-3
@@ -44,7 +44,7 @@
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
// this doesn't appear to affect linux-based systems..need feedback for _WIN64
|
||||
@@ -206,7 +206,7 @@ const std::string NUM_TO_ENGLISH_Y[] = {
|
||||
"Fifty ", "Sixty ", "Seventy ", "Eighty ", "Ninety "
|
||||
};
|
||||
|
||||
// _WIN32 builds require that #include<fmt/format.h> be included in whatever code file the invocation is made from (no header files)
|
||||
// _WIN32 builds require that #include<fmt/core.h> be included in whatever code file the invocation is made from (no header files)
|
||||
template<typename T1, typename T2>
|
||||
std::vector<std::string> join_pair(
|
||||
const std::string &glue,
|
||||
@@ -239,7 +239,7 @@ std::vector<std::string> join_pair(
|
||||
return output;
|
||||
}
|
||||
|
||||
// _WIN32 builds require that #include<fmt/format.h> be included in whatever code file the invocation is made from (no header files)
|
||||
// _WIN32 builds require that #include<fmt/core.h> be included in whatever code file the invocation is made from (no header files)
|
||||
template<typename T1, typename T2, typename T3, typename T4>
|
||||
std::vector<std::string> join_tuple(
|
||||
const std::string &glue,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <cstring>
|
||||
#include "strings.h"
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <cinttypes>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <cstring>
|
||||
#include "strings.h"
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "uuid.h"
|
||||
|
||||
#include <ios>
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <objbase.h>
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@
|
||||
|
||||
// Build variables
|
||||
// these get injected during the build pipeline
|
||||
#define CURRENT_VERSION "22.31.1-dev" // always append -dev to the current version for custom-builds
|
||||
#define CURRENT_VERSION "22.36.0-dev" // always append -dev to the current version for custom-builds
|
||||
#define LOGIN_VERSION "0.8.0"
|
||||
#define COMPILE_DATE __DATE__
|
||||
#define COMPILE_TIME __TIME__
|
||||
@@ -42,7 +42,7 @@
|
||||
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||
*/
|
||||
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9240
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9247
|
||||
|
||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9040
|
||||
|
||||
|
||||
+10
-28
@@ -121,43 +121,25 @@ bool Database::GetLoginTokenDataFromToken(
|
||||
std::string &user
|
||||
)
|
||||
{
|
||||
auto query = fmt::format(
|
||||
"SELECT tbllogintokens.Id, tbllogintokens.IpAddress, tbllogintokenclaims.Name, tbllogintokenclaims.Value FROM tbllogintokens "
|
||||
"JOIN tbllogintokenclaims ON tbllogintokens.Id = tbllogintokenclaims.TokenId WHERE tbllogintokens.Expires > NOW() "
|
||||
"AND tbllogintokens.Id='{0}' AND tbllogintokens.IpAddress='{1}'",
|
||||
auto query = fmt::format("SELECT login_server, username, account_id FROM login_tickets WHERE expires > NOW()"
|
||||
" AND id='{0}' AND ip_address='{1}' LIMIT 1",
|
||||
Strings::Escape(token),
|
||||
Strings::Escape(ip)
|
||||
);
|
||||
Strings::Escape(ip));
|
||||
|
||||
auto results = QueryDatabase(query);
|
||||
if (results.RowCount() == 0 || !results.Success()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool found_username = false;
|
||||
bool found_login_id = false;
|
||||
bool found_login_server_name = false;
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
if (strcmp(row[2], "username") == 0) {
|
||||
user = row[3];
|
||||
found_username = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strcmp(row[2], "login_server_id") == 0) {
|
||||
db_account_id = Strings::ToUnsignedInt(row[3]);
|
||||
found_login_id = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strcmp(row[2], "login_server_name") == 0) {
|
||||
db_loginserver = row[3];
|
||||
found_login_server_name = true;
|
||||
continue;
|
||||
}
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
db_loginserver = row[0];
|
||||
user = row[1];
|
||||
db_account_id = Strings::ToUnsignedInt(row[2]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return found_username && found_login_id && found_login_server_name;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
DROP TABLE IF EXISTS `login_tickets`;
|
||||
CREATE TABLE `login_tickets` (
|
||||
`id` VARCHAR(128) NOT NULL,
|
||||
`login_server` TEXT NOT NULL,
|
||||
`username` TEXT NOT NULL,
|
||||
`account_id` INT(10) UNSIGNED NOT NULL,
|
||||
`ip_address` VARCHAR(45) NOT NULL,
|
||||
`expires` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
)
|
||||
ENGINE=InnoDB;
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "eqemu-server",
|
||||
"version": "22.31.1",
|
||||
"version": "22.36.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/EQEmu/Server.git"
|
||||
|
||||
@@ -29,7 +29,7 @@ void LoadSkillCaps(SharedDatabase *database, const std::string &prefix) {
|
||||
EQ::IPCMutex mutex("skill_caps");
|
||||
mutex.Lock();
|
||||
|
||||
uint32 class_count = PLAYER_CLASS_COUNT;
|
||||
uint32 class_count = Class::PLAYER_CLASS_COUNT;
|
||||
uint32 skill_count = EQ::skills::HIGHEST_SKILL + 1;
|
||||
uint32 level_count = HARD_LEVEL_CAP + 1;
|
||||
uint32 size = (class_count * skill_count * level_count * sizeof(uint16));
|
||||
|
||||
@@ -2,8 +2,13 @@
|
||||
|
||||
########################################################################
|
||||
#::: 13th floor import script
|
||||
#::: Current Source: http://items.sodeq.org/download.php
|
||||
#::: Authors: (Natedog, Akkadius)
|
||||
#::: Items Source: http://items.sodeq.org/download.php
|
||||
#::: How To:
|
||||
#::: 1. Place this script with your server eqemu_config.json
|
||||
#::: 2. Download the items.txt file and place with this script
|
||||
#::: 3. Run this script with Perl
|
||||
#::: 4. Review new and updated items in the items_new table
|
||||
#::: 5. Make any desired changes and replace the items table contents
|
||||
########################################################################
|
||||
|
||||
use DBI;
|
||||
@@ -16,6 +21,7 @@ my $db_user = "";
|
||||
my $db_pass = "";
|
||||
my $total_items = 0;
|
||||
my $read_items_file = "items.txt"; #default
|
||||
my $keep_temp_items_table = 0; #keeps the imported items table
|
||||
|
||||
read_eqemu_config_json();
|
||||
|
||||
@@ -24,7 +30,7 @@ my $dbh = DBI->connect("DBI:mysql:database=$db_name;host=$db_host;port=$db_port"
|
||||
read_items_file_from_13th_floor_text();
|
||||
update_items_table();
|
||||
|
||||
print "\n\nImport complete!\n\n";
|
||||
print "\n\nImport complete! Review items_new table before replacing into items table.\n\n";
|
||||
|
||||
sub read_eqemu_config_json {
|
||||
use JSON;
|
||||
@@ -139,7 +145,12 @@ sub read_items_file_from_13th_floor_text {
|
||||
|
||||
sub update_items_table {
|
||||
|
||||
print "Updating items table...\n";
|
||||
#::: Establish items_new table
|
||||
print "Setting up new items table...\n";
|
||||
$dbh->do("DROP TABLE IF EXISTS items_new");
|
||||
$dbh->do("CREATE TABLE items_new AS SELECT * FROM items");
|
||||
|
||||
print "Updating new items table...\n";
|
||||
|
||||
my @matching_table;
|
||||
my @missing_items_table;
|
||||
@@ -147,7 +158,7 @@ sub update_items_table {
|
||||
|
||||
print "Comparing table structure...\n";
|
||||
#::: Get columns from `items`
|
||||
my $sth = $dbh->prepare("SHOW COLUMNS FROM `items`;");
|
||||
my $sth = $dbh->prepare("SHOW COLUMNS FROM `items_new`;");
|
||||
$sth->execute();
|
||||
my @items_table;
|
||||
while (my @row = $sth->fetchrow_array()) {
|
||||
@@ -230,7 +241,7 @@ sub update_items_table {
|
||||
}
|
||||
|
||||
my $update_query = "
|
||||
INSERT INTO items (" . $items_field_list . ")
|
||||
INSERT INTO items_new (" . $items_field_list . ")
|
||||
SELECT " . $items_floor_field_list . "
|
||||
FROM items_floor fi
|
||||
ON DUPLICATE KEY UPDATE " . $update_fields;
|
||||
@@ -257,14 +268,20 @@ sub update_items_table {
|
||||
|
||||
#::: Update stackables
|
||||
print "Updating stackable field...\n";
|
||||
$dbh->do("UPDATE items i SET i.stackable = 1 WHERE i.stacksize > 1");
|
||||
$dbh->do("UPDATE items_new i SET i.stackable = 1 WHERE i.stacksize > 1");
|
||||
|
||||
#::: Update legacy research tome bagtypes
|
||||
print "Updating legacy research tomes...\n";
|
||||
$dbh->do("UPDATE items i SET i.bagtype = 24 WHERE i.id IN (17655, 17903)"); #RESEARCHWIZ
|
||||
$dbh->do("UPDATE items i SET i.bagtype = 25 WHERE i.id IN (17502, 17653)"); #RESEARCHMAG
|
||||
$dbh->do("UPDATE items i SET i.bagtype = 26 WHERE i.id IN (17501, 17654)"); #RESEARCHNEC
|
||||
$dbh->do("UPDATE items i SET i.bagtype = 27 WHERE i.id IN (17500, 17652)"); #RESEARCHENC
|
||||
$dbh->do("UPDATE items_new i SET i.bagtype = 24 WHERE i.id IN (17655, 17903)"); #RESEARCHWIZ
|
||||
$dbh->do("UPDATE items_new i SET i.bagtype = 25 WHERE i.id IN (17502, 17653)"); #RESEARCHMAG
|
||||
$dbh->do("UPDATE items_new i SET i.bagtype = 26 WHERE i.id IN (17501, 17654)"); #RESEARCHNEC
|
||||
$dbh->do("UPDATE items_new i SET i.bagtype = 27 WHERE i.id IN (17500, 17652)"); #RESEARCHENC
|
||||
|
||||
#::: Remove temp table
|
||||
if (!$keep_temp_items_table) {
|
||||
print "Cleaning up temp items table...\n";
|
||||
$dbh->do("DROP TABLE items_floor");
|
||||
}
|
||||
}
|
||||
|
||||
sub trim($) {
|
||||
|
||||
@@ -78,6 +78,8 @@ ADD_EXECUTABLE(world ${world_sources} ${world_headers})
|
||||
|
||||
INSTALL(TARGETS world RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
|
||||
TARGET_PRECOMPILE_HEADERS(world PRIVATE ../common/pch/pch.h)
|
||||
|
||||
ADD_DEFINITIONS(-DWORLD)
|
||||
|
||||
TARGET_LINK_LIBRARIES(world ${SERVER_LIBS})
|
||||
|
||||
+5
-5
@@ -1966,7 +1966,7 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc)
|
||||
{ /*Drakkin*/ 70, 80, 85, 75, 80, 85, 75}
|
||||
};
|
||||
|
||||
static const int BaseClass[PLAYER_CLASS_COUNT][8] =
|
||||
static const int BaseClass[Class::PLAYER_CLASS_COUNT][8] =
|
||||
{ /* STR STA AGI DEX WIS INT CHR ADD*/
|
||||
{ /*Warrior*/ 10, 10, 5, 0, 0, 0, 0, 25},
|
||||
{ /*Cleric*/ 5, 5, 0, 0, 10, 0, 0, 30},
|
||||
@@ -1986,7 +1986,7 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc)
|
||||
{ /*Berserker*/ 10, 5, 0, 10, 0, 0, 0, 25}
|
||||
};
|
||||
|
||||
static const bool ClassRaceLookupTable[PLAYER_CLASS_COUNT][_TABLE_RACES]=
|
||||
static const bool ClassRaceLookupTable[Class::PLAYER_CLASS_COUNT][_TABLE_RACES]=
|
||||
{ /*Human Barbarian Erudite Woodelf Highelf Darkelf Halfelf Dwarf Troll Ogre Halfling Gnome Iksar Vahshir Froglok Drakkin*/
|
||||
{ /*Warrior*/ true, true, false, true, false, true, true, true, true, true, true, true, true, true, true, true},
|
||||
{ /*Cleric*/ true, false, true, false, true, true, true, true, false, false, true, true, false, false, true, true},
|
||||
@@ -2021,7 +2021,7 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc)
|
||||
|
||||
// if out of range looking it up in the table would crash stuff
|
||||
// so we return from these
|
||||
if (classtemp >= PLAYER_CLASS_COUNT) {
|
||||
if (classtemp >= Class::PLAYER_CLASS_COUNT) {
|
||||
LogInfo(" class is out of range");
|
||||
return false;
|
||||
}
|
||||
@@ -2114,7 +2114,7 @@ void Client::SetClassStartingSkills(PlayerProfile_Struct *pp)
|
||||
}
|
||||
}
|
||||
|
||||
if (cle->GetClientVersion() < static_cast<uint8>(EQ::versions::ClientVersion::RoF2) && pp->class_ == BERSERKER) {
|
||||
if (cle->GetClientVersion() < static_cast<uint8>(EQ::versions::ClientVersion::RoF2) && pp->class_ == Class::Berserker) {
|
||||
pp->skills[EQ::skills::Skill1HPiercing] = pp->skills[EQ::skills::Skill2HPiercing];
|
||||
pp->skills[EQ::skills::Skill2HPiercing] = 0;
|
||||
}
|
||||
@@ -2299,7 +2299,7 @@ void Client::SetClassLanguages(PlayerProfile_Struct *pp)
|
||||
{
|
||||
// we only need to handle one class, but custom server might want to do more
|
||||
switch(pp->class_) {
|
||||
case ROGUE:
|
||||
case Class::Rogue:
|
||||
pp->languages[LANG_THIEVES_CANT] = 100;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "wguild_mgr.h"
|
||||
#include "../common/zone_store.h"
|
||||
#include <set>
|
||||
#include <fmt/format.h>
|
||||
|
||||
extern WebInterfaceList web_interface;
|
||||
|
||||
|
||||
+11
-11
@@ -31,7 +31,7 @@
|
||||
#include "../common/md5.h"
|
||||
#include "eqemu_api_world_data_service.h"
|
||||
#include "../common/zone_store.h"
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
extern ClientList client_list;
|
||||
extern ZSList zoneserver_list;
|
||||
@@ -578,25 +578,25 @@ void ConsoleZoneShutdown(
|
||||
strcpy(&tmpname[1], connection->UserName().c_str());
|
||||
|
||||
auto pack = new ServerPacket;
|
||||
pack->size = sizeof(ServerZoneStateChange_struct);
|
||||
pack->size = sizeof(ServerZoneStateChange_Struct);
|
||||
pack->pBuffer = new uchar[pack->size];
|
||||
memset(pack->pBuffer, 0, sizeof(ServerZoneStateChange_struct));
|
||||
ServerZoneStateChange_struct *s = (ServerZoneStateChange_struct *) pack->pBuffer;
|
||||
memset(pack->pBuffer, 0, sizeof(ServerZoneStateChange_Struct));
|
||||
auto *s = (ServerZoneStateChange_Struct *) pack->pBuffer;
|
||||
pack->opcode = ServerOP_ZoneShutdown;
|
||||
strcpy(s->adminname, tmpname);
|
||||
strcpy(s->admin_name, tmpname);
|
||||
if (Strings::IsNumber(args[0])) {
|
||||
s->ZoneServerID = Strings::ToInt(args[0]);
|
||||
s->zone_server_id = Strings::ToInt(args[0]);
|
||||
}
|
||||
else {
|
||||
s->zoneid = ZoneID(args[0].c_str());
|
||||
s->zone_id = ZoneID(args[0].c_str());
|
||||
}
|
||||
|
||||
ZoneServer *zs = 0;
|
||||
if (s->ZoneServerID != 0) {
|
||||
zs = zoneserver_list.FindByID(s->ZoneServerID);
|
||||
if (s->zone_server_id != 0) {
|
||||
zs = zoneserver_list.FindByID(s->zone_server_id);
|
||||
}
|
||||
else if (s->zoneid != 0) {
|
||||
zs = zoneserver_list.FindByName(ZoneName(s->zoneid));
|
||||
else if (s->zone_id != 0) {
|
||||
zs = zoneserver_list.FindByName(ZoneName(s->zone_id));
|
||||
}
|
||||
else {
|
||||
connection->SendLine("Error: ZoneShutdown: neither ID nor name specified");
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "zoneserver.h"
|
||||
#include "../common/eqemu_logsys.h"
|
||||
#include "../common/repositories/instance_list_repository.h"
|
||||
#include <fmt/format.h>
|
||||
|
||||
extern ClientList client_list;
|
||||
extern ZSList zoneserver_list;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
#include "clientlist.h"
|
||||
#include "cliententry.h"
|
||||
#include "eqemu_api_world_data_service.h"
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "../common/repositories/expeditions_repository.h"
|
||||
#include "../common/repositories/expedition_lockouts_repository.h"
|
||||
#include "../common/repositories/dynamic_zone_members_repository.h"
|
||||
#include <fmt/format.h>
|
||||
|
||||
void ExpeditionDatabase::PurgeExpiredExpeditions()
|
||||
{
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@ GroupLFP::GroupLFP(uint32 inLeaderID) {
|
||||
LeaderID = inLeaderID;
|
||||
for (auto &member : Members) {
|
||||
member.Name[0] = '\0';
|
||||
member.Class = NO_CLASS;
|
||||
member.Class = Class::None;
|
||||
member.Level = 0;
|
||||
member.Zone = 0;
|
||||
}
|
||||
@@ -77,7 +77,7 @@ void GroupLFP::SetDetails(ServerLFPUpdate_Struct *Update) {
|
||||
Members[i].GuildID = CLE->GuildID();
|
||||
}
|
||||
else {
|
||||
Members[i].Class = NO_CLASS;
|
||||
Members[i].Class = Class::None;
|
||||
Members[i].Level = 0;
|
||||
Members[i].Zone = 0;
|
||||
Members[i].GuildID = 0xFFFF;
|
||||
|
||||
+14
-6
@@ -424,12 +424,20 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (EQTimeTimer.Check()) {
|
||||
TimeOfDay_Struct tod;
|
||||
zoneserver_list.worldclock.GetCurrentEQTimeOfDay(time(0), &tod);
|
||||
if (!database.SaveTime(tod.minute, tod.hour, tod.day, tod.month, tod.year))
|
||||
LogError("Failed to save eqtime");
|
||||
else
|
||||
LogDebug("EQTime successfully saved");
|
||||
TimeOfDay_Struct tod{};
|
||||
zoneserver_list.worldclock.GetCurrentEQTimeOfDay(time(nullptr), &tod);
|
||||
if (!database.SaveTime(tod.minute, tod.hour, tod.day, tod.month, tod.year)) {
|
||||
LogEqTime("Failed to save eqtime");
|
||||
}
|
||||
else {
|
||||
LogEqTimeDetail("EQTime successfully saved - time is now year [{}] month [{}] day [{}] hour [{}] minute [{}]",
|
||||
tod.year,
|
||||
tod.month,
|
||||
tod.day,
|
||||
tod.hour,
|
||||
tod.minute
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
zoneserver_list.Process();
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "../common/repositories/completed_shared_task_activity_state_repository.h"
|
||||
#include "../common/repositories/shared_task_dynamic_zones_repository.h"
|
||||
#include <ctime>
|
||||
#include <fmt/format.h>
|
||||
|
||||
extern ClientList client_list;
|
||||
extern ZSList zoneserver_list;
|
||||
|
||||
@@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../common/event_sub.h"
|
||||
#include "web_interface.h"
|
||||
#include "../common/zone_store.h"
|
||||
#include <fmt/format.h>
|
||||
|
||||
extern uint32 numzones;
|
||||
extern EQ::Random emu_random;
|
||||
|
||||
+21
-18
@@ -720,15 +720,15 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
break;
|
||||
}
|
||||
case ServerOP_ZoneShutdown: {
|
||||
auto s = (ServerZoneStateChange_struct*) pack->pBuffer;
|
||||
auto *s = (ServerZoneStateChange_Struct*) pack->pBuffer;
|
||||
ZoneServer* zs = 0;
|
||||
if (s->ZoneServerID) {
|
||||
zs = zoneserver_list.FindByID(s->ZoneServerID);
|
||||
} else if (s->zoneid) {
|
||||
zs = zoneserver_list.FindByName(ZoneName(s->zoneid));
|
||||
if (s->zone_server_id) {
|
||||
zs = zoneserver_list.FindByID(s->zone_server_id);
|
||||
} else if (s->zone_id) {
|
||||
zs = zoneserver_list.FindByName(ZoneName(s->zone_id));
|
||||
} else {
|
||||
zoneserver_list.SendEmoteMessage(
|
||||
s->adminname,
|
||||
s->admin_name,
|
||||
0,
|
||||
AccountStatus::Player,
|
||||
Chat::White,
|
||||
@@ -738,7 +738,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
|
||||
if (!zs) {
|
||||
zoneserver_list.SendEmoteMessage(
|
||||
s->adminname,
|
||||
s->admin_name,
|
||||
0,
|
||||
AccountStatus::Player,
|
||||
Chat::White,
|
||||
@@ -751,8 +751,8 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
break;
|
||||
}
|
||||
case ServerOP_ZoneBootup: {
|
||||
auto s = (ServerZoneStateChange_struct*) pack->pBuffer;
|
||||
zoneserver_list.SOPZoneBootup(s->adminname, s->ZoneServerID, ZoneName(s->zoneid), s->makestatic);
|
||||
auto *s = (ServerZoneStateChange_Struct*) pack->pBuffer;
|
||||
zoneserver_list.SOPZoneBootup(s->admin_name, s->zone_server_id, ZoneName(s->zone_id), s->is_static);
|
||||
break;
|
||||
}
|
||||
case ServerOP_ZoneStatus: {
|
||||
@@ -1606,20 +1606,23 @@ void ZoneServer::ChangeWID(uint32 iCharID, uint32 iWID) {
|
||||
|
||||
|
||||
void ZoneServer::TriggerBootup(uint32 in_zone_id, uint32 in_instance_id, const char* admin_name, bool is_static_zone) {
|
||||
is_booting_up = true;
|
||||
is_booting_up = true;
|
||||
zone_server_zone_id = in_zone_id;
|
||||
instance_id = in_instance_id;
|
||||
instance_id = in_instance_id;
|
||||
|
||||
auto pack = new ServerPacket(ServerOP_ZoneBootup, sizeof(ServerZoneStateChange_Struct));
|
||||
auto *s = (ServerZoneStateChange_Struct*) pack->pBuffer;
|
||||
|
||||
s->zone_server_id = zone_server_id;
|
||||
|
||||
s->zone_id = in_zone_id ? in_zone_id : GetZoneID();
|
||||
s->instance_id = in_instance_id;
|
||||
s->is_static = is_static_zone;
|
||||
|
||||
auto pack = new ServerPacket(ServerOP_ZoneBootup, sizeof(ServerZoneStateChange_struct));
|
||||
auto s = (ServerZoneStateChange_struct*) pack->pBuffer;
|
||||
s->ZoneServerID = zone_server_id;
|
||||
if (admin_name) {
|
||||
strn0cpy(s->adminname, admin_name, sizeof(s->adminname));
|
||||
strn0cpy(s->admin_name, admin_name, sizeof(s->admin_name));
|
||||
}
|
||||
|
||||
s->zoneid = in_zone_id ? in_zone_id : GetZoneID();
|
||||
s->instanceid = in_instance_id;
|
||||
s->makestatic = is_static_zone;
|
||||
SendPacket(pack);
|
||||
delete pack;
|
||||
LSBootUpdate(in_zone_id, in_instance_id);
|
||||
|
||||
+39
-28
@@ -204,33 +204,6 @@ SET(zone_headers
|
||||
hate_list.h
|
||||
heal_rotation.h
|
||||
horse.h
|
||||
lua_bot.h
|
||||
lua_bit.h
|
||||
lua_client.h
|
||||
lua_corpse.h
|
||||
lua_door.h
|
||||
lua_encounter.h
|
||||
lua_entity.h
|
||||
lua_entity_list.h
|
||||
lua_expedition.h
|
||||
lua_general.h
|
||||
lua_group.h
|
||||
lua_hate_list.h
|
||||
lua_inventory.h
|
||||
lua_item.h
|
||||
lua_iteminst.h
|
||||
lua_mob.h
|
||||
lua_mod.h
|
||||
lua_npc.h
|
||||
lua_object.h
|
||||
lua_packet.h
|
||||
lua_parser.h
|
||||
lua_parser_events.h
|
||||
lua_ptr.h
|
||||
lua_raid.h
|
||||
lua_spawn.h
|
||||
lua_spell.h
|
||||
lua_stat_bonuses.h
|
||||
map.h
|
||||
masterentity.h
|
||||
merc.h
|
||||
@@ -280,10 +253,48 @@ SET(zone_headers
|
||||
zone_reload.h
|
||||
zone_cli.cpp)
|
||||
|
||||
ADD_EXECUTABLE(zone ${zone_sources} ${zone_headers})
|
||||
SET (lua_headers
|
||||
lua_bot.h
|
||||
lua_bit.h
|
||||
lua_client.h
|
||||
lua_corpse.h
|
||||
lua_door.h
|
||||
lua_encounter.h
|
||||
lua_entity.h
|
||||
lua_entity_list.h
|
||||
lua_expedition.h
|
||||
lua_general.h
|
||||
lua_group.h
|
||||
lua_hate_list.h
|
||||
lua_inventory.h
|
||||
lua_item.h
|
||||
lua_iteminst.h
|
||||
lua_mob.h
|
||||
lua_mod.h
|
||||
lua_npc.h
|
||||
lua_object.h
|
||||
lua_packet.h
|
||||
lua_parser.h
|
||||
lua_parser_events.h
|
||||
lua_ptr.h
|
||||
lua_raid.h
|
||||
lua_spawn.h
|
||||
lua_spell.h
|
||||
lua_stat_bonuses.h
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE(zone ${zone_sources} ${zone_headers} ${lua_headers})
|
||||
|
||||
INSTALL(TARGETS zone RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
|
||||
IF(WIN32)
|
||||
TARGET_PRECOMPILE_HEADERS(zone PRIVATE pch.h)
|
||||
ENDIF(WIN32)
|
||||
|
||||
#TARGET_PRECOMPILE_HEADERS(zone PRIVATE ../common/types.h ../common/eqemu_logsys.h ../common/eqemu_logsys_log_aliases.h ../common/features.h ../common/global_define.h)
|
||||
#TARGET_PRECOMPILE_HEADERS(zone PRIVATE mob.h npc.h corpse.h doors.h bot.h entity.h client.h zone.h)
|
||||
#TARGET_PRECOMPILE_HEADERS(zone PRIVATE ${lua_headers})
|
||||
|
||||
ADD_DEFINITIONS(-DZONE)
|
||||
|
||||
TARGET_LINK_LIBRARIES(zone ${ZONE_LIBS})
|
||||
|
||||
+111
-17
@@ -373,72 +373,72 @@ void Mob::WakeTheDead(uint16 spell_id, Corpse *corpse_to_use, Mob *tar, uint32 d
|
||||
//some basic combat mods here too since it's convienent
|
||||
switch (corpse_to_use->class_)
|
||||
{
|
||||
case CLERIC:
|
||||
case Class::Cleric:
|
||||
made_npc->npc_spells_id = 1;
|
||||
break;
|
||||
case WIZARD:
|
||||
case Class::Wizard:
|
||||
made_npc->npc_spells_id = 2;
|
||||
break;
|
||||
case NECROMANCER:
|
||||
case Class::Necromancer:
|
||||
made_npc->npc_spells_id = 3;
|
||||
break;
|
||||
case MAGICIAN:
|
||||
case Class::Magician:
|
||||
made_npc->npc_spells_id = 4;
|
||||
break;
|
||||
case ENCHANTER:
|
||||
case Class::Enchanter:
|
||||
made_npc->npc_spells_id = 5;
|
||||
break;
|
||||
case SHAMAN:
|
||||
case Class::Shaman:
|
||||
made_npc->npc_spells_id = 6;
|
||||
break;
|
||||
case DRUID:
|
||||
case Class::Druid:
|
||||
made_npc->npc_spells_id = 7;
|
||||
break;
|
||||
case PALADIN:
|
||||
case Class::Paladin:
|
||||
//SPECATK_TRIPLE
|
||||
strcpy(made_npc->special_abilities, "6,1");
|
||||
made_npc->current_hp = made_npc->current_hp * 150 / 100;
|
||||
made_npc->max_hp = made_npc->max_hp * 150 / 100;
|
||||
made_npc->npc_spells_id = 8;
|
||||
break;
|
||||
case SHADOWKNIGHT:
|
||||
case Class::ShadowKnight:
|
||||
strcpy(made_npc->special_abilities, "6,1");
|
||||
made_npc->current_hp = made_npc->current_hp * 150 / 100;
|
||||
made_npc->max_hp = made_npc->max_hp * 150 / 100;
|
||||
made_npc->npc_spells_id = 9;
|
||||
break;
|
||||
case RANGER:
|
||||
case Class::Ranger:
|
||||
strcpy(made_npc->special_abilities, "7,1");
|
||||
made_npc->current_hp = made_npc->current_hp * 135 / 100;
|
||||
made_npc->max_hp = made_npc->max_hp * 135 / 100;
|
||||
made_npc->npc_spells_id = 10;
|
||||
break;
|
||||
case BARD:
|
||||
case Class::Bard:
|
||||
strcpy(made_npc->special_abilities, "6,1");
|
||||
made_npc->current_hp = made_npc->current_hp * 110 / 100;
|
||||
made_npc->max_hp = made_npc->max_hp * 110 / 100;
|
||||
made_npc->npc_spells_id = 11;
|
||||
break;
|
||||
case BEASTLORD:
|
||||
case Class::Beastlord:
|
||||
strcpy(made_npc->special_abilities, "7,1");
|
||||
made_npc->current_hp = made_npc->current_hp * 110 / 100;
|
||||
made_npc->max_hp = made_npc->max_hp * 110 / 100;
|
||||
made_npc->npc_spells_id = 12;
|
||||
break;
|
||||
case ROGUE:
|
||||
case Class::Rogue:
|
||||
strcpy(made_npc->special_abilities, "7,1");
|
||||
made_npc->max_dmg = made_npc->max_dmg * 150 / 100;
|
||||
made_npc->current_hp = made_npc->current_hp * 110 / 100;
|
||||
made_npc->max_hp = made_npc->max_hp * 110 / 100;
|
||||
break;
|
||||
case MONK:
|
||||
case Class::Monk:
|
||||
strcpy(made_npc->special_abilities, "7,1");
|
||||
made_npc->max_dmg = made_npc->max_dmg * 150 / 100;
|
||||
made_npc->current_hp = made_npc->current_hp * 135 / 100;
|
||||
made_npc->max_hp = made_npc->max_hp * 135 / 100;
|
||||
break;
|
||||
case WARRIOR:
|
||||
case BERSERKER:
|
||||
case Class::Warrior:
|
||||
case Class::Berserker:
|
||||
strcpy(made_npc->special_abilities, "7,1");
|
||||
made_npc->max_dmg = made_npc->max_dmg * 150 / 100;
|
||||
made_npc->current_hp = made_npc->current_hp * 175 / 100;
|
||||
@@ -1354,7 +1354,7 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) {
|
||||
}
|
||||
else {
|
||||
// Bards can cast instant cast AAs while they are casting or channeling item cast.
|
||||
if (GetClass() == BARD && IsCasting() && spells[rank->spell].cast_time == 0) {
|
||||
if (GetClass() == Class::Bard && IsCasting() && spells[rank->spell].cast_time == 0) {
|
||||
if (!DoCastingChecksOnCaster(rank->spell, EQ::spells::CastingSlot::AltAbility)) {
|
||||
return;
|
||||
}
|
||||
@@ -2207,3 +2207,97 @@ bool Client::HasAlreadyPurchasedRank(AA::Rank* rank) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Client::ListPurchasedAAs(Client *to, std::string search_criteria)
|
||||
{
|
||||
if (!to) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::map<std::string, uint8> client_aa_ranks;
|
||||
|
||||
for (auto &aa : zone->aa_abilities) {
|
||||
AA::Ability *ability = aa.second.get();
|
||||
|
||||
AA::Rank *rank = ability->first;
|
||||
while (rank) {
|
||||
if (!CanUseAlternateAdvancementRank(rank)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (HasAlreadyPurchasedRank(rank)) {
|
||||
const std::string aa_name = zone->GetAAName(rank->id);
|
||||
if (
|
||||
search_criteria.empty() ||
|
||||
Strings::Contains(
|
||||
Strings::ToLower(aa_name),
|
||||
Strings::ToLower(search_criteria)
|
||||
)
|
||||
) {
|
||||
if (client_aa_ranks.find(aa_name) == client_aa_ranks.end()) {
|
||||
client_aa_ranks[aa_name] = 1;
|
||||
} else {
|
||||
client_aa_ranks[aa_name]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rank = rank->next;
|
||||
}
|
||||
}
|
||||
|
||||
if (client_aa_ranks.empty()) {
|
||||
to->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} no purchased AAs{}.",
|
||||
to->GetTargetDescription(this, TargetDescriptionType::UCYou),
|
||||
this == to ? "have" : "has",
|
||||
(
|
||||
!search_criteria.empty() ?
|
||||
fmt::format(
|
||||
" matching '{}'",
|
||||
search_criteria
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
int aa_number = 1;
|
||||
|
||||
for (const auto &aa : client_aa_ranks) {
|
||||
to->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{}. {} (Rank {})",
|
||||
aa_number,
|
||||
aa.first,
|
||||
aa.second
|
||||
).c_str()
|
||||
);
|
||||
|
||||
aa_number++;
|
||||
}
|
||||
|
||||
to->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} {} purchased AA{}{}.",
|
||||
to->GetTargetDescription(this, TargetDescriptionType::UCYou),
|
||||
this == to ? "have" : "has",
|
||||
client_aa_ranks.size(),
|
||||
client_aa_ranks.size() > 1 ? "s" : "",
|
||||
(
|
||||
!search_criteria.empty() ?
|
||||
fmt::format(
|
||||
" matching '{}'",
|
||||
search_criteria
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
+4
-4
@@ -678,7 +678,7 @@ bool Mob::IsAttackAllowed(Mob *target, bool isSpellAttack)
|
||||
|
||||
if(!isSpellAttack)
|
||||
{
|
||||
if(GetClass() == LDON_TREASURE)
|
||||
if(GetClass() == Class::LDoNTreasure)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -1070,10 +1070,10 @@ bool Mob::CombatRange(Mob* other, float fixed_size_mod, bool aeRampage, ExtraAtt
|
||||
SetPseudoRoot(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (aeRampage) {
|
||||
float aeramp_size = RuleR(Combat, AERampageMaxDistance);
|
||||
|
||||
|
||||
LogCombatDetail("AERampage: Default - aeramp_size = [{}] ", aeramp_size);
|
||||
|
||||
if (opts) {
|
||||
@@ -1093,7 +1093,7 @@ bool Mob::CombatRange(Mob* other, float fixed_size_mod, bool aeRampage, ExtraAtt
|
||||
|
||||
LogCombatDetail("AE Rampage: ramp_range = [{}] -- (size_mod [{}] * aeramp_size [{}])", ramp_range, size_mod, aeramp_size);
|
||||
LogCombatDetail("AE Rampage: _DistNoRoot [{}] <= ramp_range [{}]", _DistNoRoot, ramp_range);
|
||||
|
||||
|
||||
if (_DistNoRoot <= ramp_range) {
|
||||
LogCombatDetail("AE Rampage: Combat Distance returned [true]");
|
||||
return true;
|
||||
|
||||
+101
-105
@@ -558,7 +558,7 @@ bool Mob::AvoidDamage(Mob *other, DamageHitInfo &hit)
|
||||
}
|
||||
|
||||
// dodge
|
||||
if (CanThisClassDodge() && (InFront || GetClass() == MONK)) {
|
||||
if (CanThisClassDodge() && (InFront || GetClass() == Class::Monk)) {
|
||||
if (IsClient())
|
||||
CastToClient()->CheckIncreaseSkill(EQ::skills::SkillDodge, other, -10);
|
||||
// check auto discs ... I guess aa/items too :P
|
||||
@@ -674,28 +674,28 @@ int Mob::GetACSoftcap()
|
||||
int level = std::min(105, static_cast<int>(GetLevel())) - 1;
|
||||
|
||||
switch (GetClass()) {
|
||||
case WARRIOR:
|
||||
case Class::Warrior:
|
||||
return war_softcaps[level];
|
||||
case CLERIC:
|
||||
case BARD:
|
||||
case MONK:
|
||||
case Class::Cleric:
|
||||
case Class::Bard:
|
||||
case Class::Monk:
|
||||
return clrbrdmnk_softcaps[level];
|
||||
case PALADIN:
|
||||
case SHADOWKNIGHT:
|
||||
case Class::Paladin:
|
||||
case Class::ShadowKnight:
|
||||
return palshd_softcaps[level];
|
||||
case RANGER:
|
||||
case Class::Ranger:
|
||||
return rng_softcaps[level];
|
||||
case DRUID:
|
||||
case Class::Druid:
|
||||
return dru_softcaps[level];
|
||||
case ROGUE:
|
||||
case SHAMAN:
|
||||
case BEASTLORD:
|
||||
case BERSERKER:
|
||||
case Class::Rogue:
|
||||
case Class::Shaman:
|
||||
case Class::Beastlord:
|
||||
case Class::Berserker:
|
||||
return rogshmbstber_softcaps[level];
|
||||
case NECROMANCER:
|
||||
case WIZARD:
|
||||
case MAGICIAN:
|
||||
case ENCHANTER:
|
||||
case Class::Necromancer:
|
||||
case Class::Wizard:
|
||||
case Class::Magician:
|
||||
case Class::Enchanter:
|
||||
return necwizmagenc_softcaps[level];
|
||||
default:
|
||||
return 350;
|
||||
@@ -707,28 +707,28 @@ double Mob::GetSoftcapReturns()
|
||||
// These are based on the dev post, they seem to be correct for every level
|
||||
// AKA no more hard caps
|
||||
switch (GetClass()) {
|
||||
case WARRIOR:
|
||||
case Class::Warrior:
|
||||
return 0.35;
|
||||
case CLERIC:
|
||||
case BARD:
|
||||
case MONK:
|
||||
case Class::Cleric:
|
||||
case Class::Bard:
|
||||
case Class::Monk:
|
||||
return 0.3;
|
||||
case PALADIN:
|
||||
case SHADOWKNIGHT:
|
||||
case Class::Paladin:
|
||||
case Class::ShadowKnight:
|
||||
return 0.33;
|
||||
case RANGER:
|
||||
case Class::Ranger:
|
||||
return 0.315;
|
||||
case DRUID:
|
||||
case Class::Druid:
|
||||
return 0.265;
|
||||
case ROGUE:
|
||||
case SHAMAN:
|
||||
case BEASTLORD:
|
||||
case BERSERKER:
|
||||
case Class::Rogue:
|
||||
case Class::Shaman:
|
||||
case Class::Beastlord:
|
||||
case Class::Berserker:
|
||||
return 0.28;
|
||||
case NECROMANCER:
|
||||
case WIZARD:
|
||||
case MAGICIAN:
|
||||
case ENCHANTER:
|
||||
case Class::Necromancer:
|
||||
case Class::Wizard:
|
||||
case Class::Magician:
|
||||
case Class::Enchanter:
|
||||
return 0.25;
|
||||
default:
|
||||
return 0.3;
|
||||
@@ -739,7 +739,7 @@ int Mob::GetClassRaceACBonus()
|
||||
{
|
||||
int ac_bonus = 0;
|
||||
auto level = GetLevel();
|
||||
if (GetClass() == MONK) {
|
||||
if (GetClass() == Class::Monk) {
|
||||
int hardcap = 30;
|
||||
int softcap = 14;
|
||||
if (level > 99) {
|
||||
@@ -824,7 +824,7 @@ int Mob::GetClassRaceACBonus()
|
||||
}
|
||||
}
|
||||
|
||||
if (GetClass() == ROGUE) {
|
||||
if (GetClass() == Class::Rogue) {
|
||||
int level_scaler = level - 26;
|
||||
if (GetAGI() < 80)
|
||||
ac_bonus = level_scaler / 4;
|
||||
@@ -840,7 +840,7 @@ int Mob::GetClassRaceACBonus()
|
||||
ac_bonus = 12;
|
||||
}
|
||||
|
||||
if (GetClass() == BEASTLORD) {
|
||||
if (GetClass() == Class::Beastlord) {
|
||||
int level_scaler = level - 6;
|
||||
if (GetAGI() < 80)
|
||||
ac_bonus = level_scaler / 5;
|
||||
@@ -894,14 +894,14 @@ int Mob::ACSum(bool skip_caps)
|
||||
ac += GetPetACBonusFromOwner();
|
||||
auto spell_aa_ac = aabonuses.AC + spellbonuses.AC;
|
||||
ac += GetSkill(EQ::skills::SkillDefense) / 5;
|
||||
if (EQ::ValueWithin(static_cast<int>(GetClass()), NECROMANCER, ENCHANTER))
|
||||
if (EQ::ValueWithin(static_cast<int>(GetClass()), Class::Necromancer, Class::Enchanter))
|
||||
ac += spell_aa_ac / 3;
|
||||
else
|
||||
ac += spell_aa_ac / 4;
|
||||
}
|
||||
else { // TODO: so we can't set NPC skills ... so the skill bonus ends up being HUGE so lets nerf them a bit
|
||||
auto spell_aa_ac = aabonuses.AC + spellbonuses.AC;
|
||||
if (EQ::ValueWithin(static_cast<int>(GetClass()), NECROMANCER, ENCHANTER))
|
||||
if (EQ::ValueWithin(static_cast<int>(GetClass()), Class::Necromancer, Class::Enchanter))
|
||||
ac += GetSkill(EQ::skills::SkillDefense) / 2 + spell_aa_ac / 3;
|
||||
else
|
||||
ac += GetSkill(EQ::skills::SkillDefense) / 3 + spell_aa_ac / 4;
|
||||
@@ -1085,7 +1085,7 @@ int64 Mob::GetWeaponDamage(Mob *against, const EQ::ItemData *weapon_item) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else if ((GetClass() == MONK || GetClass() == BEASTLORD) && GetLevel() >= 30) {
|
||||
else if ((GetClass() == Class::Monk || GetClass() == Class::Beastlord) && GetLevel() >= 30) {
|
||||
dmg = GetHandToHandDamage();
|
||||
}
|
||||
else {
|
||||
@@ -1199,7 +1199,7 @@ int64 Mob::GetWeaponDamage(Mob *against, const EQ::ItemInstance *weapon_item, in
|
||||
MagicGloves = gloves->GetItemMagical(true);
|
||||
}
|
||||
|
||||
if (GetClass() == MONK || GetClass() == BEASTLORD) {
|
||||
if (GetClass() == Class::Monk || GetClass() == Class::Beastlord) {
|
||||
if (MagicGloves || GetLevel() >= 30) {
|
||||
dmg = GetHandToHandDamage();
|
||||
if (hate)
|
||||
@@ -1295,15 +1295,15 @@ int64 Mob::DoDamageCaps(int64 base_damage)
|
||||
}
|
||||
else if (level >= 40) {
|
||||
switch (GetClass()) {
|
||||
case CLERIC:
|
||||
case DRUID:
|
||||
case SHAMAN:
|
||||
case Class::Cleric:
|
||||
case Class::Druid:
|
||||
case Class::Shaman:
|
||||
cap = 80;
|
||||
break;
|
||||
case NECROMANCER:
|
||||
case WIZARD:
|
||||
case MAGICIAN:
|
||||
case ENCHANTER:
|
||||
case Class::Necromancer:
|
||||
case Class::Wizard:
|
||||
case Class::Magician:
|
||||
case Class::Enchanter:
|
||||
cap = 40;
|
||||
break;
|
||||
default:
|
||||
@@ -1313,15 +1313,15 @@ int64 Mob::DoDamageCaps(int64 base_damage)
|
||||
}
|
||||
else if (level >= 30) {
|
||||
switch (GetClass()) {
|
||||
case CLERIC:
|
||||
case DRUID:
|
||||
case SHAMAN:
|
||||
case Class::Cleric:
|
||||
case Class::Druid:
|
||||
case Class::Shaman:
|
||||
cap = 26;
|
||||
break;
|
||||
case NECROMANCER:
|
||||
case WIZARD:
|
||||
case MAGICIAN:
|
||||
case ENCHANTER:
|
||||
case Class::Necromancer:
|
||||
case Class::Wizard:
|
||||
case Class::Magician:
|
||||
case Class::Enchanter:
|
||||
cap = 18;
|
||||
break;
|
||||
default:
|
||||
@@ -1331,15 +1331,15 @@ int64 Mob::DoDamageCaps(int64 base_damage)
|
||||
}
|
||||
else if (level >= 20) {
|
||||
switch (GetClass()) {
|
||||
case CLERIC:
|
||||
case DRUID:
|
||||
case SHAMAN:
|
||||
case Class::Cleric:
|
||||
case Class::Druid:
|
||||
case Class::Shaman:
|
||||
cap = 20;
|
||||
break;
|
||||
case NECROMANCER:
|
||||
case WIZARD:
|
||||
case MAGICIAN:
|
||||
case ENCHANTER:
|
||||
case Class::Necromancer:
|
||||
case Class::Wizard:
|
||||
case Class::Magician:
|
||||
case Class::Enchanter:
|
||||
cap = 12;
|
||||
break;
|
||||
default:
|
||||
@@ -1349,15 +1349,15 @@ int64 Mob::DoDamageCaps(int64 base_damage)
|
||||
}
|
||||
else if (level >= 10) {
|
||||
switch (GetClass()) {
|
||||
case CLERIC:
|
||||
case DRUID:
|
||||
case SHAMAN:
|
||||
case Class::Cleric:
|
||||
case Class::Druid:
|
||||
case Class::Shaman:
|
||||
cap = 12;
|
||||
break;
|
||||
case NECROMANCER:
|
||||
case WIZARD:
|
||||
case MAGICIAN:
|
||||
case ENCHANTER:
|
||||
case Class::Necromancer:
|
||||
case Class::Wizard:
|
||||
case Class::Magician:
|
||||
case Class::Enchanter:
|
||||
cap = 10;
|
||||
break;
|
||||
default:
|
||||
@@ -1367,15 +1367,15 @@ int64 Mob::DoDamageCaps(int64 base_damage)
|
||||
}
|
||||
else {
|
||||
switch (GetClass()) {
|
||||
case CLERIC:
|
||||
case DRUID:
|
||||
case SHAMAN:
|
||||
case Class::Cleric:
|
||||
case Class::Druid:
|
||||
case Class::Shaman:
|
||||
cap = 9;
|
||||
break;
|
||||
case NECROMANCER:
|
||||
case WIZARD:
|
||||
case MAGICIAN:
|
||||
case ENCHANTER:
|
||||
case Class::Necromancer:
|
||||
case Class::Wizard:
|
||||
case Class::Magician:
|
||||
case Class::Enchanter:
|
||||
cap = 6;
|
||||
break;
|
||||
default:
|
||||
@@ -1476,7 +1476,7 @@ bool Mob::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
||||
LogCombatDetail("Attacking [{}] with hand [{}] [{}]", other->GetName(), Hand, bRiposte ? "this is a riposte" : "");
|
||||
|
||||
if (
|
||||
(IsCasting() && GetClass() != BARD && !IsFromSpell)
|
||||
(IsCasting() && GetClass() != Class::Bard && !IsFromSpell)
|
||||
|| ((IsClient() && CastToClient()->dead) || (other->IsClient() && other->CastToClient()->dead))
|
||||
|| (GetHP() < 0)
|
||||
|| (!IsAttackAllowed(other))
|
||||
@@ -1741,8 +1741,7 @@ bool Client::Death(Mob* killerMob, int64 damage, uint16 spell, EQ::skills::Skill
|
||||
static_cast<int>(attack_skill)
|
||||
);
|
||||
|
||||
std::vector<std::any> args = { CastToMob() };
|
||||
if (parse->EventPlayer(EVENT_DEATH, this, export_string, 0, &args) != 0) {
|
||||
if (parse->EventPlayer(EVENT_DEATH, this, export_string, 0) != 0) {
|
||||
if (GetHP() < 0) {
|
||||
SetHP(0);
|
||||
}
|
||||
@@ -2020,7 +2019,7 @@ bool Client::Death(Mob* killerMob, int64 damage, uint16 spell, EQ::skills::Skill
|
||||
/*
|
||||
Reset reuse timer for classic skill based Lay on Hands (For tit I guess)
|
||||
*/
|
||||
if (GetClass() == PALADIN) { // we could check if it's not expired I guess, but should be fine not to
|
||||
if (GetClass() == Class::Paladin) { // we could check if it's not expired I guess, but should be fine not to
|
||||
p_timers.Clear(&database, pTimerLayHands);
|
||||
}
|
||||
|
||||
@@ -2344,7 +2343,7 @@ void NPC::Damage(Mob* other, int64 damage, uint16 spell_id, EQ::skills::SkillTyp
|
||||
if (!IsEngaged())
|
||||
zone->AddAggroMob();
|
||||
|
||||
if (GetClass() == LDON_TREASURE)
|
||||
if (GetClass() == Class::LDoNTreasure)
|
||||
{
|
||||
if (IsLDoNLocked() && GetLDoNLockedSkill() != LDoNTypeMechanical)
|
||||
{
|
||||
@@ -2389,8 +2388,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
static_cast<int>(attack_skill)
|
||||
);
|
||||
|
||||
std::vector<std::any> args = { CastToMob() };
|
||||
if (parse->EventNPC(EVENT_DEATH, this, oos, export_string, 0, &args) != 0) {
|
||||
if (parse->EventNPC(EVENT_DEATH, this, oos, export_string, 0) != 0) {
|
||||
if (GetHP() < 0) {
|
||||
SetHP(0);
|
||||
}
|
||||
@@ -2407,9 +2405,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
spell,
|
||||
static_cast<int>(attack_skill)
|
||||
);
|
||||
|
||||
std::vector<std::any> args = { CastToMob() };
|
||||
if (parse->EventBot(EVENT_DEATH, CastToBot(), oos, export_string, 0, &args) != 0) {
|
||||
if (parse->EventBot(EVENT_DEATH, CastToBot(), oos, export_string, 0) != 0) {
|
||||
if (GetHP() < 0) {
|
||||
SetHP(0);
|
||||
}
|
||||
@@ -2465,7 +2461,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
BuffFadeAll();
|
||||
const auto killed_level = GetLevel();
|
||||
|
||||
if (GetClass() == LDON_TREASURE) { // open chest
|
||||
if (GetClass() == Class::LDoNTreasure) { // open chest
|
||||
auto outapp = new EQApplicationPacket(OP_Animation, sizeof(Animation_Struct));
|
||||
Animation_Struct* anim = (Animation_Struct*)outapp->pBuffer;
|
||||
anim->spawnid = GetID();
|
||||
@@ -2492,7 +2488,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
respawn2->DeathReset(1);
|
||||
}
|
||||
|
||||
if (killer_mob && GetClass() != LDON_TREASURE) {
|
||||
if (killer_mob && GetClass() != Class::LDoNTreasure) {
|
||||
hate_list.AddEntToHateList(killer_mob, damage);
|
||||
}
|
||||
|
||||
@@ -2539,7 +2535,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
hate_list.DoFactionHits(GetNPCFactionID(), GetPrimaryFaction(), GetFactionAmount());
|
||||
}
|
||||
|
||||
bool IsLdonTreasure = (GetClass() == LDON_TREASURE);
|
||||
bool IsLdonTreasure = (GetClass() == Class::LDoNTreasure);
|
||||
|
||||
if (give_exp_client && !IsCorpse()) {
|
||||
Group *kg = entity_list.GetGroupByClient(give_exp_client);
|
||||
@@ -2705,7 +2701,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
}
|
||||
|
||||
bool allow_merchant_corpse = RuleB(Merchant, AllowCorpse);
|
||||
bool is_merchant = (class_ == MERCHANT || class_ == ADVENTURE_MERCHANT || MerchantType != 0);
|
||||
bool is_merchant = (class_ == Class::Merchant || class_ == Class::AdventureMerchant || MerchantType != 0);
|
||||
|
||||
Corpse* corpse = nullptr;
|
||||
|
||||
@@ -3299,14 +3295,14 @@ int Mob::GetHandToHandDamage(void)
|
||||
7, 7, 7, 8, 8, 8, 8, 8, 8, 9, // 21-30
|
||||
9, 9, 9, 9, 9, 10, 10, 10, 10, 10, // 31-40
|
||||
10, 11, 11, 11, 11, 11, 11, 12, 12 }; // 41-49
|
||||
if (GetClass() == MONK) {
|
||||
if (GetClass() == Class::Monk) {
|
||||
if (IsClient() && CastToClient()->GetItemIDAt(12) == 10652 && GetLevel() > 50)
|
||||
return 9;
|
||||
if (level > 62)
|
||||
return 15;
|
||||
return mnk_dmg[level];
|
||||
}
|
||||
else if (GetClass() == BEASTLORD) {
|
||||
else if (GetClass() == Class::Beastlord) {
|
||||
if (level > 49)
|
||||
return 13;
|
||||
return bst_dmg[level];
|
||||
@@ -3358,7 +3354,7 @@ int Mob::GetHandToHandDelay(void)
|
||||
28, 28, 28, 27, 27, 27, 27, 27, 26, 26, // 61-70
|
||||
26, 26, 26 }; // 71-73
|
||||
|
||||
if (GetClass() == MONK) {
|
||||
if (GetClass() == Class::Monk) {
|
||||
// Have a look to see if we have epic fists on
|
||||
if (IsClient() && CastToClient()->GetItemIDAt(12) == 10652 && GetLevel() > 50)
|
||||
return 16;
|
||||
@@ -3367,7 +3363,7 @@ int Mob::GetHandToHandDelay(void)
|
||||
return GetRace() == IKSAR ? 21 : 20;
|
||||
return GetRace() == IKSAR ? mnk_iks_delay[level] : mnk_hum_delay[level];
|
||||
}
|
||||
else if (GetClass() == BEASTLORD) {
|
||||
else if (GetClass() == Class::Beastlord) {
|
||||
int level = GetLevel();
|
||||
if (level > 73)
|
||||
return 25;
|
||||
@@ -4071,7 +4067,7 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
|
||||
}
|
||||
}
|
||||
else if (skill_used == EQ::skills::SkillKick &&
|
||||
(attacker->GetLevel() > 55 || attacker->IsNPC()) && GetClass() == WARRIOR) {
|
||||
(attacker->GetLevel() > 55 || attacker->IsNPC()) && GetClass() == Class::Warrior) {
|
||||
can_stun = true;
|
||||
}
|
||||
|
||||
@@ -5057,11 +5053,11 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
|
||||
// We either require an innate crit chance or some SPA 169 to crit
|
||||
bool innate_crit = false;
|
||||
int crit_chance = GetCriticalChanceBonus(hit.skill);
|
||||
if ((GetClass() == WARRIOR || GetClass() == BERSERKER) && GetLevel() >= 12)
|
||||
if ((GetClass() == Class::Warrior || GetClass() == Class::Berserker) && GetLevel() >= 12)
|
||||
innate_crit = true;
|
||||
else if (GetClass() == RANGER && GetLevel() >= 12 && hit.skill == EQ::skills::SkillArchery)
|
||||
else if (GetClass() == Class::Ranger && GetLevel() >= 12 && hit.skill == EQ::skills::SkillArchery)
|
||||
innate_crit = true;
|
||||
else if (GetClass() == ROGUE && GetLevel() >= 12 && hit.skill == EQ::skills::SkillThrowing)
|
||||
else if (GetClass() == Class::Rogue && GetLevel() >= 12 && hit.skill == EQ::skills::SkillThrowing)
|
||||
innate_crit = true;
|
||||
|
||||
// we have a chance to crit!
|
||||
@@ -5081,7 +5077,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
|
||||
dex_bonus += 45; // chances did not match live without a small boost
|
||||
|
||||
// so if we have an innate crit we have a better chance, except for ber throwing
|
||||
if (!innate_crit || (GetClass() == BERSERKER && hit.skill == EQ::skills::SkillThrowing))
|
||||
if (!innate_crit || (GetClass() == Class::Berserker && hit.skill == EQ::skills::SkillThrowing))
|
||||
dex_bonus = dex_bonus * 3 / 5;
|
||||
|
||||
if (crit_chance)
|
||||
@@ -5105,7 +5101,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
|
||||
LogCombat("Crit success roll [{}] dex chance [{}] og dmg [{}] crit_mod [{}] new dmg [{}]", roll, dex_bonus, og_damage, crit_mod, hit.damage_done);
|
||||
|
||||
// step 3: check deadly strike
|
||||
if (GetClass() == ROGUE && hit.skill == EQ::skills::SkillThrowing) {
|
||||
if (GetClass() == Class::Rogue && hit.skill == EQ::skills::SkillThrowing) {
|
||||
if (BehindMob(defender, GetX(), GetY())) {
|
||||
int chance = GetLevel() * 12;
|
||||
if (zone->random.Int(1, 1000) < chance) {
|
||||
@@ -5288,7 +5284,7 @@ void Mob::DoRiposte(Mob *defender)
|
||||
if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
|
||||
LogCombat("Preforming a return SPECIAL ATTACK ([{}] percent chance)", DoubleRipChance);
|
||||
|
||||
if (defender->GetClass() == MONK)
|
||||
if (defender->GetClass() == Class::Monk)
|
||||
defender->MonkSpecialAttack(this, defender->aabonuses.GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_SKILL]);
|
||||
else if (defender->IsClient()) // so yeah, even if you don't have the skill you can still do the attack :P (and we don't crash anymore)
|
||||
defender->CastToClient()->DoClassAttacks(this, defender->aabonuses.GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_SKILL], true);
|
||||
@@ -5305,7 +5301,7 @@ void Mob::ApplyMeleeDamageMods(uint16 skill, int64 &damage, Mob *defender, Extra
|
||||
dmgbonusmod += opts->melee_damage_bonus_flat;
|
||||
|
||||
if (defender) {
|
||||
if (defender->IsOfClientBotMerc() && defender->GetClass() == WARRIOR) {
|
||||
if (defender->IsOfClientBotMerc() && defender->GetClass() == Class::Warrior) {
|
||||
dmgbonusmod -= 5;
|
||||
}
|
||||
// 168 defensive
|
||||
@@ -5449,7 +5445,7 @@ const DamageTable &Mob::GetDamageTable() const
|
||||
{ 415, 15, 40 }, // 105
|
||||
};
|
||||
|
||||
bool monk = GetClass() == MONK;
|
||||
bool monk = GetClass() == Class::Monk;
|
||||
bool melee = IsWarriorClass();
|
||||
// tables caped at 105 for now -- future proofed for a while at least :P
|
||||
int level = std::min(static_cast<int>(GetLevel()), 105);
|
||||
@@ -5897,7 +5893,7 @@ void Mob::CommonOutgoingHitSuccess(Mob* defender, DamageHitInfo &hit, ExtraAttac
|
||||
|
||||
// BER weren't parsing the halving
|
||||
if (hit.skill == EQ::skills::SkillArchery ||
|
||||
(hit.skill == EQ::skills::SkillThrowing && GetClass() != BERSERKER))
|
||||
(hit.skill == EQ::skills::SkillThrowing && GetClass() != Class::Berserker))
|
||||
hit.damage_done /= 2;
|
||||
|
||||
if (hit.damage_done < 1)
|
||||
@@ -5910,7 +5906,7 @@ void Mob::CommonOutgoingHitSuccess(Mob* defender, DamageHitInfo &hit, ExtraAttac
|
||||
if (headshot > 0) {
|
||||
hit.damage_done = headshot;
|
||||
}
|
||||
else if (GetClass() == RANGER && GetLevel() > 50) { // no double dmg on headshot
|
||||
else if (GetClass() == Class::Ranger && GetLevel() > 50) { // no double dmg on headshot
|
||||
if ((defender->IsNPC() && !defender->IsMoving() && !defender->IsRooted()) || !RuleB(Combat, ArcheryBonusRequiresStationary)) {
|
||||
hit.damage_done *= 2;
|
||||
MessageString(Chat::MeleeCrit, BOW_DOUBLE_DAMAGE);
|
||||
@@ -5935,7 +5931,7 @@ void Mob::CommonOutgoingHitSuccess(Mob* defender, DamageHitInfo &hit, ExtraAttac
|
||||
hit.damage_done = ass;
|
||||
}
|
||||
}
|
||||
else if (hit.skill == EQ::skills::SkillFrenzy && GetClass() == BERSERKER && GetLevel() > 50) {
|
||||
else if (hit.skill == EQ::skills::SkillFrenzy && GetClass() == Class::Berserker && GetLevel() > 50) {
|
||||
extra_mincap = 4 * GetLevel() / 5;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -117,7 +117,7 @@ void Client::CalcBonuses()
|
||||
|
||||
// hmm maybe a better way to do this
|
||||
int metabolism = spellbonuses.Metabolism + itembonuses.Metabolism + aabonuses.Metabolism;
|
||||
int timer = GetClass() == MONK ? CONSUMPTION_MNK_TIMER : CONSUMPTION_TIMER;
|
||||
int timer = GetClass() == Class::Monk ? CONSUMPTION_MNK_TIMER : CONSUMPTION_TIMER;
|
||||
timer = timer * (100 + metabolism) / 100;
|
||||
if (timer != consume_food_timer.GetTimerTime())
|
||||
consume_food_timer.SetTimer(timer);
|
||||
@@ -2053,7 +2053,7 @@ void Mob::CalcSpellBonuses(StatBonuses* newbon)
|
||||
}
|
||||
}
|
||||
|
||||
if (GetClass() == BARD)
|
||||
if (GetClass() == Class::Bard)
|
||||
newbon->ManaRegen = 0; // Bards do not get mana regen from spells.
|
||||
}
|
||||
|
||||
|
||||
+180
-152
File diff suppressed because it is too large
Load Diff
+5
-4
@@ -394,14 +394,14 @@ public:
|
||||
|
||||
// Static Class Methods
|
||||
static Bot* LoadBot(uint32 botID);
|
||||
static uint32 SpawnedBotCount(const uint32 owner_id, uint8 class_id = NO_CLASS);
|
||||
static uint32 SpawnedBotCount(const uint32 owner_id, uint8 class_id = Class::None);
|
||||
static void LevelBotWithClient(Client* client, uint8 level, bool sendlvlapp);
|
||||
|
||||
static bool IsBotAttackAllowed(Mob* attacker, Mob* target, bool& hasRuleDefined);
|
||||
static Bot* GetBotByBotClientOwnerAndBotName(Client* c, const std::string& botName);
|
||||
static void ProcessBotGroupInvite(Client* c, std::string const& botName);
|
||||
static void ProcessBotGroupDisband(Client* c, const std::string& botName);
|
||||
static void BotOrderCampAll(Client* c, uint8 class_id = NO_CLASS);
|
||||
static void BotOrderCampAll(Client* c, uint8 class_id = Class::None);
|
||||
static void ProcessBotInspectionRequest(Bot* inspectedBot, Client* client);
|
||||
static void LoadAndSpawnAllZonedBots(Client* bot_owner);
|
||||
static bool GroupHasBot(Group* group);
|
||||
@@ -604,7 +604,7 @@ public:
|
||||
void SetBotCharmer(bool c) { _botCharmer = c; }
|
||||
void SetPetChooser(bool p) { _petChooser = p; }
|
||||
void SetBotOwner(Mob* botOwner) { this->_botOwner = botOwner; }
|
||||
void SetRangerAutoWeaponSelect(bool enable) { GetClass() == RANGER ? _rangerAutoWeaponSelect = enable : _rangerAutoWeaponSelect = false; }
|
||||
void SetRangerAutoWeaponSelect(bool enable) { GetClass() == Class::Ranger ? _rangerAutoWeaponSelect = enable : _rangerAutoWeaponSelect = false; }
|
||||
void SetBotStance(EQ::constants::StanceType botStance) {
|
||||
if (botStance >= EQ::constants::stancePassive && botStance <= EQ::constants::stanceBurnAE)
|
||||
_botStance = botStance;
|
||||
@@ -738,7 +738,7 @@ public:
|
||||
//Raid additions
|
||||
Raid* p_raid_instance;
|
||||
|
||||
static uint8 spell_casting_chances[SPELL_TYPE_COUNT][PLAYER_CLASS_COUNT][EQ::constants::STANCE_TYPE_COUNT][cntHSND];
|
||||
static uint8 spell_casting_chances[SPELL_TYPE_COUNT][Class::PLAYER_CLASS_COUNT][EQ::constants::STANCE_TYPE_COUNT][cntHSND];
|
||||
|
||||
bool BotCastMez(Mob* tar, uint8 botLevel, bool checked_los, BotSpell& botSpell, Raid* raid);
|
||||
bool BotCastHeal(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpell, Raid* raid);
|
||||
@@ -866,6 +866,7 @@ private:
|
||||
Timer m_evade_timer; // can be moved to pTimers at some point
|
||||
Timer m_alt_combat_hate_timer;
|
||||
Timer m_auto_defend_timer;
|
||||
Timer auto_save_timer;
|
||||
bool m_dirtyautohaters;
|
||||
bool m_guard_flag;
|
||||
bool m_hold_flag;
|
||||
|
||||
+731
-293
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -677,7 +677,7 @@ void helper_command_depart_list(Client* bot_owner, Bot* druid_bot, Bot* wizard_b
|
||||
bool helper_is_help_or_usage(const char* arg);
|
||||
bool helper_no_available_bots(Client *bot_owner, Bot *my_bot = nullptr);
|
||||
void helper_send_available_subcommands(Client *bot_owner, const char* command_simile, const std::list<const char*>& subcommand_list);
|
||||
void helper_send_usage_required_bots(Client *bot_owner, BCEnum::SpType spell_type, uint8 bot_class = NO_CLASS);
|
||||
void helper_send_usage_required_bots(Client *bot_owner, BCEnum::SpType spell_type, uint8 bot_class = Class::None);
|
||||
bool helper_spell_check_fail(STBaseEntry* local_entry);
|
||||
bool helper_spell_list_fail(Client *bot_owner, bcst_list* spell_list, BCEnum::SpType spell_type);
|
||||
#endif
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "bot.h"
|
||||
#include "client.h"
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
|
||||
bool BotDatabase::LoadBotCommandSettings(std::map<std::string, std::pair<uint8, std::vector<std::string>>> &bot_command_settings)
|
||||
@@ -141,7 +141,7 @@ bool BotDatabase::LoadBotSpellCastingChances()
|
||||
if (spell_type_index >= Bot::SPELL_TYPE_COUNT)
|
||||
continue;
|
||||
uint8 class_index = Strings::ToInt(row[1]);
|
||||
if (class_index < WARRIOR || class_index > BERSERKER)
|
||||
if (class_index < Class::Warrior || class_index > Class::Berserker)
|
||||
continue;
|
||||
--class_index;
|
||||
uint8 stance_index = Strings::ToInt(row[2]);
|
||||
@@ -224,7 +224,7 @@ bool BotDatabase::QueryBotCount(const uint32 owner_id, int class_id, uint32& bot
|
||||
auto row = results.begin();
|
||||
bot_count = Strings::ToUnsignedInt(row[0]);
|
||||
|
||||
if (EQ::ValueWithin(class_id, WARRIOR, BERSERKER)) {
|
||||
if (EQ::ValueWithin(class_id, Class::Warrior, Class::Berserker)) {
|
||||
query = fmt::format(
|
||||
"SELECT COUNT(`bot_id`) FROM `bot_data` WHERE `owner_id` = {} AND `class` = {}",
|
||||
owner_id,
|
||||
@@ -2517,7 +2517,7 @@ uint8 BotDatabase::GetSpellCastingChance(uint8 spell_type_index, uint8 class_ind
|
||||
{
|
||||
if (spell_type_index >= Bot::SPELL_TYPE_COUNT)
|
||||
return 0;
|
||||
if (class_index >= PLAYER_CLASS_COUNT)
|
||||
if (class_index >= Class::PLAYER_CLASS_COUNT)
|
||||
return 0;
|
||||
if (stance_index >= EQ::constants::STANCE_TYPE_COUNT)
|
||||
return 0;
|
||||
|
||||
+69
-69
@@ -101,7 +101,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
|
||||
|
||||
bool Bot::BotCastSong(Mob* tar, uint8 botLevel) {
|
||||
bool casted_spell = false;
|
||||
if (GetClass() != BARD || tar != this || IsEngaged()) // Out-of-Combat songs can not be cast in combat
|
||||
if (GetClass() != Class::Bard || tar != this || IsEngaged()) // Out-of-Combat songs can not be cast in combat
|
||||
return casted_spell;
|
||||
|
||||
for (auto botSongList = GetPrioritizedBotSpellsBySpellType(this, SpellType_OutOfCombatBuffSong);
|
||||
@@ -169,7 +169,7 @@ bool Bot::BotCastCombatSong(Mob* tar, uint8 botLevel) {
|
||||
|
||||
bool Bot::BotCastHateReduction(Mob* tar, uint8 botLevel, const BotSpell& botSpell) {
|
||||
bool casted_spell = false;
|
||||
if (GetClass() == BARD) {
|
||||
if (GetClass() == Class::Bard) {
|
||||
std::list<BotSpell_wPriority> botSongList = GetPrioritizedBotSpellsBySpellType(this, SpellType_HateRedux);
|
||||
for (auto iter : botSongList) {
|
||||
if (!iter.SpellId)
|
||||
@@ -183,7 +183,7 @@ bool Bot::BotCastHateReduction(Mob* tar, uint8 botLevel, const BotSpell& botSpel
|
||||
if (tar->CanBuffStack(iter.SpellId, botLevel, true) < 0)
|
||||
continue;
|
||||
|
||||
if (IsValidSpellRange(botSpell.SpellId, tar)) {
|
||||
if (IsValidSpellRange(iter.SpellId, tar)) {
|
||||
casted_spell = AIDoSpellCast(iter.SpellIndex, tar, iter.ManaCost);
|
||||
}
|
||||
if (casted_spell) {
|
||||
@@ -220,7 +220,7 @@ bool Bot::BotCastCure(Mob* tar, uint8 botClass, BotSpell& botSpell, Raid* raid)
|
||||
|
||||
casted_spell = AIDoSpellCast(botSpell.SpellIndex, tar, botSpell.ManaCost, &TempDontCureMeBeforeTime);
|
||||
|
||||
if (casted_spell && botClass != BARD) {
|
||||
if (casted_spell && botClass != Class::Bard) {
|
||||
if (IsGroupSpell(botSpell.SpellId)) {
|
||||
if (HasGroup()) {
|
||||
Group const* group = GetGroup();
|
||||
@@ -301,7 +301,7 @@ bool Bot::BotCastSlow(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpe
|
||||
}
|
||||
|
||||
switch (botClass) {
|
||||
case BARD: {
|
||||
case Class::Bard: {
|
||||
// probably needs attackable check
|
||||
for (
|
||||
auto botSongList = GetPrioritizedBotSpellsBySpellType(this, SpellType_Slow);
|
||||
@@ -328,7 +328,7 @@ bool Bot::BotCastSlow(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpe
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IsValidSpellRange(botSpell.SpellId, tar)) {
|
||||
if (IsValidSpellRange(iter.SpellId, tar)) {
|
||||
casted_spell = AIDoSpellCast(iter.SpellIndex, tar, iter.ManaCost);
|
||||
}
|
||||
|
||||
@@ -339,12 +339,12 @@ bool Bot::BotCastSlow(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpe
|
||||
|
||||
break;
|
||||
}
|
||||
case ENCHANTER: {
|
||||
case Class::Enchanter: {
|
||||
botSpell = GetBestBotSpellForMagicBasedSlow(this);
|
||||
break;
|
||||
}
|
||||
case SHAMAN:
|
||||
case BEASTLORD: {
|
||||
case Class::Shaman:
|
||||
case Class::Beastlord: {
|
||||
botSpell = GetBestBotSpellForDiseaseBasedSlow(this);
|
||||
|
||||
if (botSpell.SpellId == 0 || ((tar->GetMR() - 50) < (tar->GetDR() + spells[botSpell.SpellId].resist_difficulty)))
|
||||
@@ -364,7 +364,7 @@ bool Bot::BotCastSlow(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpe
|
||||
casted_spell = AIDoSpellCast(botSpell.SpellIndex, tar, botSpell.ManaCost);
|
||||
}
|
||||
|
||||
if (casted_spell && GetClass() != BARD) {
|
||||
if (casted_spell && GetClass() != Class::Bard) {
|
||||
if (raid) {
|
||||
const auto msg = fmt::format("Attempting to slow {}.", tar->GetCleanName());
|
||||
raid->RaidSay(msg.c_str(), GetCleanName(), 0, 100);
|
||||
@@ -391,7 +391,7 @@ bool Bot::BotCastDOT(Mob* tar, uint8 botLevel, const BotSpell& botSpell, const b
|
||||
return casted_spell;
|
||||
}
|
||||
|
||||
if (GetClass() == BARD) {
|
||||
if (GetClass() == Class::Bard) {
|
||||
std::list<BotSpell_wPriority> dotList = GetPrioritizedBotSpellsBySpellType(this, SpellType_DOT);
|
||||
|
||||
const int maxDotSelect = 5;
|
||||
@@ -447,7 +447,7 @@ bool Bot::BotCastDOT(Mob* tar, uint8 botLevel, const BotSpell& botSpell, const b
|
||||
|
||||
uint32 TempDontDotMeBefore = tar->DontDotMeBefore();
|
||||
|
||||
if (IsValidSpellRange(botSpell.SpellId, tar)) {
|
||||
if (IsValidSpellRange(s.SpellId, tar)) {
|
||||
casted_spell = AIDoSpellCast(s.SpellIndex, tar, s.ManaCost, &TempDontDotMeBefore);
|
||||
}
|
||||
|
||||
@@ -569,7 +569,7 @@ bool Bot::BotCastCombatBuff(Mob* tar, uint8 botLevel, uint8 botClass) {
|
||||
(tar == this && spells[s.SpellId].target_type != ST_TargetsTarget) ||
|
||||
spells[s.SpellId].target_type == ST_Group ||
|
||||
spells[s.SpellId].target_type == ST_GroupTeleport ||
|
||||
(botClass == BARD && spells[s.SpellId].target_type == ST_AEBard)
|
||||
(botClass == Class::Bard && spells[s.SpellId].target_type == ST_AEBard)
|
||||
) &&
|
||||
!tar->IsImmuneToSpell(s.SpellId, this) &&
|
||||
tar->CanBuffStack(s.SpellId, botLevel, true) >= 0
|
||||
@@ -582,7 +582,7 @@ bool Bot::BotCastCombatBuff(Mob* tar, uint8 botLevel, uint8 botClass) {
|
||||
if (
|
||||
((IsEffectInSpell(s.SpellId, SE_Levitate) && !zone->CanLevitate()) ||
|
||||
(IsEffectInSpell(s.SpellId, SE_MovementSpeed) && !zone->CanCastOutdoor())) &&
|
||||
(botClass != BARD || !IsSpellUsableInThisZoneType(s.SpellId, zone->GetZoneType()))
|
||||
(botClass != Class::Bard || !IsSpellUsableInThisZoneType(s.SpellId, zone->GetZoneType()))
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
@@ -625,7 +625,7 @@ bool Bot::BotCastCombatBuff(Mob* tar, uint8 botLevel, uint8 botClass) {
|
||||
}
|
||||
}
|
||||
// TODO: Add TriggerSpell Support for Exchanter Runes
|
||||
if (botClass == ENCHANTER && IsEffectInSpell(s.SpellId, SE_Rune)) {
|
||||
if (botClass == Class::Enchanter && IsEffectInSpell(s.SpellId, SE_Rune)) {
|
||||
float manaRatioToCast = 75.0f;
|
||||
|
||||
switch(GetBotStance()) {
|
||||
@@ -671,7 +671,7 @@ bool Bot::BotCastCombatBuff(Mob* tar, uint8 botLevel, uint8 botClass) {
|
||||
bool Bot::BotCastPet(Mob* tar, uint8 botClass, BotSpell& botSpell) {
|
||||
bool casted_spell = false;
|
||||
if (!IsPet() && !GetPetID() && !IsBotCharmer()) {
|
||||
if (botClass == WIZARD) {
|
||||
if (botClass == Class::Wizard) {
|
||||
auto buffs_max = GetMaxBuffSlots();
|
||||
auto my_buffs = GetBuffs();
|
||||
int familiar_buff_slot = -1;
|
||||
@@ -694,7 +694,7 @@ bool Bot::BotCastPet(Mob* tar, uint8 botClass, BotSpell& botSpell) {
|
||||
|
||||
botSpell = GetFirstBotSpellBySpellType(this, SpellType_Pet);
|
||||
}
|
||||
else if (botClass == MAGICIAN) {
|
||||
else if (botClass == Class::Magician) {
|
||||
botSpell = GetBestBotMagicianPetSpell(this);
|
||||
}
|
||||
else {
|
||||
@@ -735,13 +735,13 @@ bool Bot::BotCastDispel(Mob* tar, BotSpell& botSpell, uint32 iSpellTypes, const
|
||||
bool Bot::BotCastNuke(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpell, const bool& checked_los) {
|
||||
|
||||
bool casted_spell = false;
|
||||
if ((tar->GetHPRatio() <= 95.0f) || ((botClass == BARD) || (botClass == SHAMAN) || (botClass == ENCHANTER) || (botClass == PALADIN) || (botClass == SHADOWKNIGHT) || (botClass == WARRIOR)))
|
||||
if ((tar->GetHPRatio() <= 95.0f) || ((botClass == Class::Bard) || (botClass == Class::Shaman) || (botClass == Class::Enchanter) || (botClass == Class::Paladin) || (botClass == Class::ShadowKnight) || (botClass == Class::Warrior)))
|
||||
{
|
||||
if (!checked_los && (!CheckLosFN(tar) || !CheckWaterLoS(tar))) {
|
||||
return casted_spell;
|
||||
}
|
||||
|
||||
if (botClass == CLERIC || botClass == ENCHANTER)
|
||||
if (botClass == Class::Cleric || botClass == Class::Enchanter)
|
||||
{
|
||||
float manaRatioToCast = 75.0f;
|
||||
|
||||
@@ -770,17 +770,17 @@ bool Bot::BotCastNuke(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpe
|
||||
return casted_spell;
|
||||
}
|
||||
|
||||
if (botClass == MAGICIAN || botClass == SHADOWKNIGHT || botClass == NECROMANCER || botClass == PALADIN || botClass == RANGER || botClass == DRUID || botClass == CLERIC) {
|
||||
if (botClass == Class::Magician || botClass == Class::ShadowKnight || botClass == Class::Necromancer || botClass == Class::Paladin || botClass == Class::Ranger || botClass == Class::Druid || botClass == Class::Cleric) {
|
||||
if (tar->GetBodyType() == BT_Undead || tar->GetBodyType() == BT_SummonedUndead || tar->GetBodyType() == BT_Vampire)
|
||||
botSpell = GetBestBotSpellForNukeByTargetType(this, ST_Undead);
|
||||
else if (tar->GetBodyType() == BT_Summoned || tar->GetBodyType() == BT_Summoned2 || tar->GetBodyType() == BT_Summoned3)
|
||||
botSpell = GetBestBotSpellForNukeByTargetType(this, ST_Summoned);
|
||||
}
|
||||
|
||||
if ((botClass == PALADIN || botClass == DRUID || botClass == CLERIC || botClass == ENCHANTER || botClass == WIZARD) && !IsValidSpell(botSpell.SpellId)) {
|
||||
if ((botClass == Class::Paladin || botClass == Class::Druid || botClass == Class::Cleric || botClass == Class::Enchanter || botClass == Class::Wizard) && !IsValidSpell(botSpell.SpellId)) {
|
||||
uint8 stunChance = (tar->IsCasting() ? 30: 15);
|
||||
|
||||
if (botClass == PALADIN) {
|
||||
if (botClass == Class::Paladin) {
|
||||
stunChance = 50;
|
||||
}
|
||||
|
||||
@@ -789,7 +789,7 @@ bool Bot::BotCastNuke(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpe
|
||||
}
|
||||
}
|
||||
|
||||
if (botClass == WIZARD && botSpell.SpellId == 0) {
|
||||
if (botClass == Class::Wizard && botSpell.SpellId == 0) {
|
||||
botSpell = GetBestBotWizardNukeSpellByTargetResists(this, tar);
|
||||
}
|
||||
|
||||
@@ -819,7 +819,7 @@ bool Bot::BotCastEscape(Mob*& tar, uint8 botClass, BotSpell& botSpell, uint32 iS
|
||||
auto hpr = (uint8) GetHPRatio();
|
||||
bool mayGetAggro = false;
|
||||
|
||||
if (hpr > 15 && ((botClass == WIZARD) || (botClass == ENCHANTER) || (botClass == RANGER))) {
|
||||
if (hpr > 15 && ((botClass == Class::Wizard) || (botClass == Class::Enchanter) || (botClass == Class::Ranger))) {
|
||||
mayGetAggro = HasOrMayGetAggro();
|
||||
}
|
||||
|
||||
@@ -835,7 +835,7 @@ bool Bot::BotCastEscape(Mob*& tar, uint8 botClass, BotSpell& botSpell, uint32 iS
|
||||
tar = this; //target self for invul type spells
|
||||
}
|
||||
|
||||
if (IsValidSpellRange(botSpell.SpellId, tar) || botClass == BARD) {
|
||||
if (IsValidSpellRange(botSpell.SpellId, tar) || botClass == Class::Bard) {
|
||||
casted_spell = AIDoSpellCast(botSpell.SpellIndex, tar, botSpell.ManaCost);
|
||||
}
|
||||
}
|
||||
@@ -877,7 +877,7 @@ bool Bot::BotCastBuff(Mob* tar, uint8 botLevel, uint8 botClass) {
|
||||
(tar == this && spells[s.SpellId].target_type != ST_TargetsTarget) ||
|
||||
spells[s.SpellId].target_type == ST_Group ||
|
||||
spells[s.SpellId].target_type == ST_GroupTeleport ||
|
||||
(botClass == BARD && spells[s.SpellId].target_type == ST_AEBard)
|
||||
(botClass == Class::Bard && spells[s.SpellId].target_type == ST_AEBard)
|
||||
) &&
|
||||
!tar->IsImmuneToSpell(s.SpellId, this) &&
|
||||
tar->CanBuffStack(s.SpellId, botLevel, true) >= 0
|
||||
@@ -892,7 +892,7 @@ bool Bot::BotCastBuff(Mob* tar, uint8 botLevel, uint8 botClass) {
|
||||
(IsEffectInSpell(s.SpellId, SE_Levitate) && !zone->CanLevitate()) ||
|
||||
(IsEffectInSpell(s.SpellId, SE_MovementSpeed) && !zone->CanCastOutdoor())
|
||||
) &&
|
||||
(botClass != BARD || !IsSpellUsableInThisZoneType(s.SpellId, zone->GetZoneType()))
|
||||
(botClass != Class::Bard || !IsSpellUsableInThisZoneType(s.SpellId, zone->GetZoneType()))
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
@@ -919,7 +919,7 @@ bool Bot::BotCastBuff(Mob* tar, uint8 botLevel, uint8 botClass) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (botClass == ENCHANTER && IsEffectInSpell(s.SpellId, SE_Rune))
|
||||
if (botClass == Class::Enchanter && IsEffectInSpell(s.SpellId, SE_Rune))
|
||||
{
|
||||
float manaRatioToCast = 75.0f;
|
||||
|
||||
@@ -1003,17 +1003,17 @@ bool Bot::BotCastHeal(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpe
|
||||
isPrimaryHealer = IsGroupHealer();
|
||||
}
|
||||
|
||||
if (hpr < 95 || tar->IsClient() || botClass == BARD) {
|
||||
if (tar->GetClass() == NECROMANCER && hpr >= 40) {
|
||||
if (hpr < 95 || tar->IsClient() || botClass == Class::Bard) {
|
||||
if (tar->GetClass() == Class::Necromancer && hpr >= 40) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tar->GetClass() == SHAMAN && hpr >= 80) {
|
||||
if (tar->GetClass() == Class::Shaman && hpr >= 80) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Evaluate the situation
|
||||
if ((IsEngaged()) && ((botClass == CLERIC) || (botClass == DRUID) || (botClass == SHAMAN) || (botClass == PALADIN))) {
|
||||
if ((IsEngaged()) && ((botClass == Class::Cleric) || (botClass == Class::Druid) || (botClass == Class::Shaman) || (botClass == Class::Paladin))) {
|
||||
if (tar->GetTarget() && tar->GetTarget()->GetHateTop() && tar->GetTarget()->GetHateTop() == tar) {
|
||||
hasAggro = true;
|
||||
}
|
||||
@@ -1045,7 +1045,7 @@ bool Bot::BotCastHeal(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpe
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((botClass == CLERIC) || (botClass == DRUID) || (botClass == SHAMAN) || (botClass == PALADIN)) {
|
||||
else if ((botClass == Class::Cleric) || (botClass == Class::Druid) || (botClass == Class::Shaman) || (botClass == Class::Paladin)) {
|
||||
if (GetNumberNeedingHealedInGroup(40, true, raid) >= 2) {
|
||||
botSpell = GetBestBotSpellForGroupCompleteHeal(this);
|
||||
|
||||
@@ -1119,7 +1119,7 @@ bool Bot::BotCastHeal(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpe
|
||||
if (!IsValidSpell(botSpell.SpellId)) {
|
||||
botSpell = GetFirstBotSpellForSingleTargetHeal(this);
|
||||
}
|
||||
if (botSpell.SpellId == 0 && botClass == BARD) {
|
||||
if (botSpell.SpellId == 0 && botClass == Class::Bard) {
|
||||
botSpell = GetFirstBotSpellBySpellType(this, SpellType_Heal);
|
||||
}
|
||||
|
||||
@@ -1134,11 +1134,11 @@ bool Bot::BotCastHeal(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpe
|
||||
|
||||
uint32 TempDontHealMeBeforeTime = tar->DontHealMeBefore();
|
||||
|
||||
if (IsValidSpellRange(botSpell.SpellId, tar) || botClass == BARD) {
|
||||
if (IsValidSpellRange(botSpell.SpellId, tar) || botClass == Class::Bard) {
|
||||
casted_spell = AIDoSpellCast(botSpell.SpellIndex, tar, botSpell.ManaCost, &TempDontHealMeBeforeTime);
|
||||
}
|
||||
|
||||
if (casted_spell && botClass != BARD) {
|
||||
if (casted_spell && botClass != Class::Bard) {
|
||||
if (IsGroupSpell(botSpell.SpellId)) {
|
||||
if (HasGroup()) {
|
||||
Group *group = GetGroup();
|
||||
@@ -1362,9 +1362,9 @@ bool Bot::AI_IdleCastCheck() {
|
||||
//Ok, IdleCastCheck depends of class.
|
||||
switch (GetClass()) {
|
||||
// Healers WITHOUT pets will check if a heal is needed before buffing.
|
||||
case CLERIC:
|
||||
case PALADIN:
|
||||
case RANGER: {
|
||||
case Class::Cleric:
|
||||
case Class::Paladin:
|
||||
case Class::Ranger: {
|
||||
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_Cure)) {
|
||||
if (!AICastSpell(this, 100, SpellType_Heal)) {
|
||||
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_Heal)) {
|
||||
@@ -1379,10 +1379,10 @@ bool Bot::AI_IdleCastCheck() {
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
case MONK:
|
||||
case ROGUE:
|
||||
case WARRIOR:
|
||||
case BERSERKER: {
|
||||
case Class::Monk:
|
||||
case Class::Rogue:
|
||||
case Class::Warrior:
|
||||
case Class::Berserker: {
|
||||
if (!AICastSpell(this, 100, SpellType_Cure)) {
|
||||
if (!AICastSpell(this, 100, SpellType_Heal)) {
|
||||
if (!AICastSpell(this, 100, SpellType_Buff)) {
|
||||
@@ -1397,10 +1397,10 @@ bool Bot::AI_IdleCastCheck() {
|
||||
}
|
||||
// Pets class will first cast their pet, then buffs
|
||||
|
||||
case MAGICIAN:
|
||||
case SHADOWKNIGHT:
|
||||
case NECROMANCER:
|
||||
case ENCHANTER: {
|
||||
case Class::Magician:
|
||||
case Class::ShadowKnight:
|
||||
case Class::Necromancer:
|
||||
case Class::Enchanter: {
|
||||
if (!AICastSpell(this, 100, SpellType_Pet)) {
|
||||
if (!AICastSpell(this, 100, SpellType_Cure)) {
|
||||
if (!AICastSpell(GetPet(), 100, SpellType_Cure)) {
|
||||
@@ -1417,9 +1417,9 @@ bool Bot::AI_IdleCastCheck() {
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
case DRUID:
|
||||
case SHAMAN:
|
||||
case BEASTLORD: {
|
||||
case Class::Druid:
|
||||
case Class::Shaman:
|
||||
case Class::Beastlord: {
|
||||
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_Cure)) {
|
||||
if (!AICastSpell(this, 100, SpellType_Pet)) {
|
||||
if (!AICastSpell(this, 100, SpellType_Heal)) {
|
||||
@@ -1438,7 +1438,7 @@ bool Bot::AI_IdleCastCheck() {
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
case WIZARD: { // This can eventually be move into the BEASTLORD case handler once pre-combat is fully implemented
|
||||
case Class::Wizard: { // This can eventually be move into the Class::Beastlord case handler once pre-combat is fully implemented
|
||||
if (pre_combat) {
|
||||
if (!AICastSpell(this, 100, SpellType_Pet)) {
|
||||
if (!AICastSpell(this, 100, SpellType_Cure)) {
|
||||
@@ -1469,7 +1469,7 @@ bool Bot::AI_IdleCastCheck() {
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
case BARD: {
|
||||
case Class::Bard: {
|
||||
if (pre_combat) {
|
||||
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_Cure)) {
|
||||
if (!AICastSpell(this, 100, SpellType_Buff)) {
|
||||
@@ -1518,7 +1518,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
|
||||
LogAIDetail("Engaged autocast check triggered (BOTS). Trying to cast healing spells then maybe offensive spells");
|
||||
|
||||
if (botClass == CLERIC) {
|
||||
if (botClass == Class::Cleric) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) {
|
||||
if (!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) {
|
||||
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Heal), BotAISpellRange, SpellType_Heal)) {
|
||||
@@ -1534,7 +1534,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (botClass == DRUID) {
|
||||
else if (botClass == Class::Druid) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) {
|
||||
if (!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) {
|
||||
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_Heal), BotAISpellRange, SpellType_Heal)) {
|
||||
@@ -1552,7 +1552,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (botClass == SHAMAN) {
|
||||
else if (botClass == Class::Shaman) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Slow), SpellType_Slow)) {
|
||||
if (!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) {
|
||||
@@ -1573,7 +1573,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (botClass == RANGER) {
|
||||
else if (botClass == Class::Ranger) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) {
|
||||
if (!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) {
|
||||
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_InCombatBuff), BotAISpellRange, SpellType_InCombatBuff)) {
|
||||
@@ -1588,7 +1588,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (botClass == BEASTLORD) {
|
||||
else if (botClass == Class::Beastlord) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Slow), SpellType_Slow)) {
|
||||
if (!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Debuff), SpellType_Debuff)) {
|
||||
@@ -1609,7 +1609,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (botClass == WIZARD) {
|
||||
else if (botClass == Class::Wizard) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Debuff), SpellType_Debuff)) {
|
||||
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_InCombatBuff), BotAISpellRange, SpellType_InCombatBuff)) {
|
||||
@@ -1620,7 +1620,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (botClass == PALADIN) {
|
||||
else if (botClass == Class::Paladin) {
|
||||
if (!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) {
|
||||
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_InCombatBuff), BotAISpellRange, SpellType_InCombatBuff)) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Debuff), SpellType_Debuff)) {
|
||||
@@ -1633,7 +1633,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (botClass == SHADOWKNIGHT) {
|
||||
else if (botClass == Class::ShadowKnight) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Lifetap), SpellType_Lifetap)) {
|
||||
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_InCombatBuff), BotAISpellRange, SpellType_InCombatBuff)) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Debuff), SpellType_Debuff)) {
|
||||
@@ -1646,7 +1646,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (botClass == MAGICIAN) {
|
||||
else if (botClass == Class::Magician) {
|
||||
if (!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Pet), SpellType_Pet)) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Debuff), SpellType_Debuff)) {
|
||||
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_InCombatBuff), BotAISpellRange, SpellType_InCombatBuff)) {
|
||||
@@ -1659,7 +1659,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (botClass == NECROMANCER) {
|
||||
else if (botClass == Class::Necromancer) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) {
|
||||
if (!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Pet), SpellType_Pet)) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Debuff), SpellType_Debuff)) {
|
||||
@@ -1678,7 +1678,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (botClass == ENCHANTER) {
|
||||
else if (botClass == Class::Enchanter) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Mez), SpellType_Mez)) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Slow), SpellType_Slow)) {
|
||||
@@ -1695,7 +1695,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (botClass == BARD) {
|
||||
else if (botClass == Class::Bard) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) {// Bards will use their escape songs
|
||||
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_HateRedux), BotAISpellRange, SpellType_HateRedux)) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Slow), SpellType_Slow)) {
|
||||
@@ -1714,7 +1714,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (botClass == BERSERKER) {
|
||||
else if (botClass == Class::Berserker) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) {
|
||||
if (!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Debuff), SpellType_Debuff)) {
|
||||
@@ -1731,7 +1731,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (botClass == MONK) {
|
||||
else if (botClass == Class::Monk) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) {
|
||||
if (!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Debuff), SpellType_Debuff)) {
|
||||
@@ -1748,7 +1748,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (botClass == ROGUE) {
|
||||
else if (botClass == Class::Rogue) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) {
|
||||
if (!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Debuff), SpellType_Debuff)) {
|
||||
@@ -1765,7 +1765,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (botClass == WARRIOR) {
|
||||
else if (botClass == Class::Warrior) {
|
||||
if (!AICastSpell(this, GetChanceToCastBySpellType(SpellType_Heal), SpellType_Heal)) {
|
||||
if (!entity_list.Bot_AICheckCloseBeneficialSpells(this, GetChanceToCastBySpellType(SpellType_InCombatBuff), BotAISpellRange, SpellType_InCombatBuff)) {
|
||||
if (!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Debuff), SpellType_Debuff)) {
|
||||
@@ -3000,7 +3000,7 @@ uint8 Bot::GetChanceToCastBySpellType(uint32 spellType)
|
||||
return 0;
|
||||
|
||||
uint8 class_index = GetClass();
|
||||
if (class_index > BERSERKER || class_index < WARRIOR)
|
||||
if (class_index > Class::Berserker || class_index < Class::Warrior)
|
||||
return 0;
|
||||
--class_index;
|
||||
|
||||
|
||||
+133
-87
@@ -65,9 +65,11 @@ extern volatile bool RunLoops;
|
||||
#include "../common/repositories/character_disciplines_repository.h"
|
||||
#include "../common/repositories/character_data_repository.h"
|
||||
#include "../common/repositories/discovered_items_repository.h"
|
||||
#include "../common/repositories/keyring_repository.h"
|
||||
#include "../common/events/player_events.h"
|
||||
#include "../common/events/player_event_logs.h"
|
||||
#include "dialogue_window.h"
|
||||
#include <fmt/format.h>
|
||||
|
||||
|
||||
extern QueryServ* QServ;
|
||||
@@ -2262,10 +2264,10 @@ void Client::QuestReadBook(const char* text, uint8 type) {
|
||||
|
||||
uint32 Client::GetCarriedPlatinum() {
|
||||
return (
|
||||
GetMoney(3, 0) +
|
||||
(GetMoney(2, 0) / 10) +
|
||||
(GetMoney(1, 0) / 100) +
|
||||
(GetMoney(0, 0) / 1000)
|
||||
GetMoney(MoneyTypes::Platinum, MoneySubtypes::Personal) +
|
||||
(GetMoney(MoneyTypes::Gold, MoneySubtypes::Personal) / 10) +
|
||||
(GetMoney(MoneyTypes::Silver, MoneySubtypes::Personal) / 100) +
|
||||
(GetMoney(MoneyTypes::Copper, MoneySubtypes::Personal) / 1000)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2675,7 +2677,7 @@ bool Client::HasSkill(EQ::skills::SkillType skill_id) const {
|
||||
}
|
||||
|
||||
bool Client::CanHaveSkill(EQ::skills::SkillType skill_id) const {
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF2 && class_ == BERSERKER && skill_id == EQ::skills::Skill1HPiercing)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF2 && class_ == Class::Berserker && skill_id == EQ::skills::Skill1HPiercing)
|
||||
skill_id = EQ::skills::Skill2HPiercing;
|
||||
|
||||
return(content_db.GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)) > 0);
|
||||
@@ -2683,7 +2685,7 @@ bool Client::CanHaveSkill(EQ::skills::SkillType skill_id) const {
|
||||
}
|
||||
|
||||
uint16 Client::MaxSkill(EQ::skills::SkillType skillid, uint16 class_, uint16 level) const {
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF2 && class_ == BERSERKER && skillid == EQ::skills::Skill1HPiercing)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF2 && class_ == Class::Berserker && skillid == EQ::skills::Skill1HPiercing)
|
||||
skillid = EQ::skills::Skill2HPiercing;
|
||||
|
||||
return(content_db.GetSkillCap(class_, skillid, level));
|
||||
@@ -2691,7 +2693,7 @@ uint16 Client::MaxSkill(EQ::skills::SkillType skillid, uint16 class_, uint16 lev
|
||||
|
||||
uint8 Client::SkillTrainLevel(EQ::skills::SkillType skillid, uint16 class_)
|
||||
{
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF2 && class_ == BERSERKER && skillid == EQ::skills::Skill1HPiercing)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF2 && class_ == Class::Berserker && skillid == EQ::skills::Skill1HPiercing)
|
||||
skillid = EQ::skills::Skill2HPiercing;
|
||||
|
||||
return(content_db.GetTrainLevel(class_, skillid, RuleI(Character, MaxLevel)));
|
||||
@@ -3027,7 +3029,7 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail)
|
||||
|
||||
int max_percent = 50 + maxHPBonus;
|
||||
|
||||
if (GetClass() == MONK && GetSkill(EQ::skills::SkillBindWound) > 200) {
|
||||
if (GetClass() == Class::Monk && GetSkill(EQ::skills::SkillBindWound) > 200) {
|
||||
max_percent = 70 + maxHPBonus;
|
||||
}
|
||||
|
||||
@@ -3076,9 +3078,9 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail)
|
||||
else {
|
||||
int percent_base = 50;
|
||||
if (GetRawSkill(EQ::skills::SkillBindWound) > 200) {
|
||||
if ((GetClass() == MONK) || (GetClass() == BEASTLORD))
|
||||
if ((GetClass() == Class::Monk) || (GetClass() == Class::Beastlord))
|
||||
percent_base = 70;
|
||||
else if ((GetLevel() > 50) && ((GetClass() == WARRIOR) || (GetClass() == ROGUE) || (GetClass() == CLERIC)))
|
||||
else if ((GetLevel() > 50) && ((GetClass() == Class::Warrior) || (GetClass() == Class::Rogue) || (GetClass() == Class::Cleric)))
|
||||
percent_base = 70;
|
||||
}
|
||||
|
||||
@@ -4087,54 +4089,87 @@ void Client::SendWindow(
|
||||
|
||||
void Client::KeyRingLoad()
|
||||
{
|
||||
std::string query = StringFormat("SELECT item_id FROM keyring "
|
||||
"WHERE char_id = '%i' ORDER BY item_id", character_id);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
const auto &l = KeyringRepository::GetWhere(
|
||||
database,
|
||||
fmt::format(
|
||||
"`char_id` = {} ORDER BY `item_id`",
|
||||
character_id
|
||||
)
|
||||
);
|
||||
|
||||
if (l.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row)
|
||||
keyring.push_back(Strings::ToInt(row[0]));
|
||||
|
||||
for (const auto &e : l) {
|
||||
keyring.emplace_back(e.item_id);
|
||||
}
|
||||
}
|
||||
|
||||
void Client::KeyRingAdd(uint32 item_id)
|
||||
{
|
||||
if(0==item_id)
|
||||
return;
|
||||
|
||||
bool found = KeyRingCheck(item_id);
|
||||
if (found)
|
||||
return;
|
||||
|
||||
std::string query = StringFormat("INSERT INTO keyring(char_id, item_id) VALUES(%i, %i)", character_id, item_id);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
if (!item_id) {
|
||||
return;
|
||||
}
|
||||
|
||||
Message(Chat::LightBlue,"Added to keyring.");
|
||||
const bool found = KeyRingCheck(item_id);
|
||||
if (found) {
|
||||
return;
|
||||
}
|
||||
|
||||
keyring.push_back(item_id);
|
||||
auto e = KeyringRepository::NewEntity();
|
||||
|
||||
e.char_id = CharacterID();
|
||||
e.item_id = item_id;
|
||||
|
||||
e = KeyringRepository::InsertOne(database, e);
|
||||
|
||||
if (!e.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
keyring.emplace_back(item_id);
|
||||
|
||||
if (!RuleB(World, UseItemLinksForKeyRing)) {
|
||||
Message(Chat::LightBlue, "Added to keyring.");
|
||||
return;
|
||||
}
|
||||
|
||||
const std::string &item_link = database.CreateItemLink(item_id);
|
||||
|
||||
Message(
|
||||
Chat::LightBlue,
|
||||
fmt::format(
|
||||
"Added {} to keyring.",
|
||||
item_link
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
bool Client::KeyRingCheck(uint32 item_id)
|
||||
{
|
||||
for (auto iter = keyring.begin(); iter != keyring.end(); ++iter) {
|
||||
if(*iter == item_id)
|
||||
for (const auto &e : keyring) {
|
||||
if (e == item_id) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Client::KeyRingList()
|
||||
{
|
||||
Message(Chat::LightBlue,"Keys on Keyring:");
|
||||
Message(Chat::LightBlue, "Keys on Keyring:");
|
||||
|
||||
const EQ::ItemData *item = nullptr;
|
||||
for (auto iter = keyring.begin(); iter != keyring.end(); ++iter) {
|
||||
if ((item = database.GetItem(*iter))!=nullptr) {
|
||||
Message(Chat::LightBlue,item->Name);
|
||||
|
||||
for (const auto &e : keyring) {
|
||||
item = database.GetItem(e);
|
||||
if (item) {
|
||||
const std::string &item_string = RuleB(World, UseItemLinksForKeyRing) ? database.CreateItemLink(e) : item->Name;
|
||||
|
||||
Message(Chat::LightBlue, item_string.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4198,7 +4233,7 @@ void Client::UpdateLFP() {
|
||||
|
||||
for(unsigned int i=0; i<MAX_GROUP_MEMBERS; i++) {
|
||||
LFPMembers[i].Name[0] = '\0';
|
||||
LFPMembers[i].Class = NO_CLASS;
|
||||
LFPMembers[i].Class = Class::None;
|
||||
LFPMembers[i].Level = 0;
|
||||
LFPMembers[i].Zone = 0;
|
||||
}
|
||||
@@ -4815,7 +4850,7 @@ void Client::HandleLDoNOpen(NPC *target)
|
||||
{
|
||||
if(target)
|
||||
{
|
||||
if(target->GetClass() != LDON_TREASURE)
|
||||
if(target->GetClass() != Class::LDoNTreasure)
|
||||
{
|
||||
LogDebug("[{}] tried to open [{}] but [{}] was not a treasure chest",
|
||||
GetName(), target->GetName(), target->GetName());
|
||||
@@ -4884,7 +4919,7 @@ void Client::HandleLDoNOpen(NPC *target)
|
||||
|
||||
void Client::HandleLDoNSenseTraps(NPC *target, uint16 skill, uint8 type)
|
||||
{
|
||||
if(target && target->GetClass() == LDON_TREASURE)
|
||||
if(target && target->GetClass() == Class::LDoNTreasure)
|
||||
{
|
||||
if(target->IsLDoNTrapped())
|
||||
{
|
||||
@@ -4927,7 +4962,7 @@ void Client::HandleLDoNDisarm(NPC *target, uint16 skill, uint8 type)
|
||||
{
|
||||
if(target)
|
||||
{
|
||||
if(target->GetClass() == LDON_TREASURE)
|
||||
if(target->GetClass() == Class::LDoNTreasure)
|
||||
{
|
||||
if(!target->IsLDoNTrapped())
|
||||
{
|
||||
@@ -4977,7 +5012,7 @@ void Client::HandleLDoNPickLock(NPC *target, uint16 skill, uint8 type)
|
||||
{
|
||||
if(target)
|
||||
{
|
||||
if(target->GetClass() == LDON_TREASURE)
|
||||
if(target->GetClass() == Class::LDoNTreasure)
|
||||
{
|
||||
if(target->IsLDoNTrapped())
|
||||
{
|
||||
@@ -8119,16 +8154,17 @@ void Client::SendHPUpdateMarquee(){
|
||||
|
||||
uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
||||
uint32 value = 0;
|
||||
|
||||
switch (type) {
|
||||
case 0: {
|
||||
case MoneyTypes::Copper: {
|
||||
switch (subtype) {
|
||||
case 0:
|
||||
case MoneySubtypes::Personal:
|
||||
value = static_cast<uint32>(m_pp.copper);
|
||||
break;
|
||||
case 1:
|
||||
case MoneySubtypes::Bank:
|
||||
value = static_cast<uint32>(m_pp.copper_bank);
|
||||
break;
|
||||
case 2:
|
||||
case MoneySubtypes::Cursor:
|
||||
value = static_cast<uint32>(m_pp.copper_cursor);
|
||||
break;
|
||||
default:
|
||||
@@ -8136,15 +8172,15 @@ uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
case MoneyTypes::Silver: {
|
||||
switch (subtype) {
|
||||
case 0:
|
||||
case MoneySubtypes::Personal:
|
||||
value = static_cast<uint32>(m_pp.silver);
|
||||
break;
|
||||
case 1:
|
||||
case MoneySubtypes::Bank:
|
||||
value = static_cast<uint32>(m_pp.silver_bank);
|
||||
break;
|
||||
case 2:
|
||||
case MoneySubtypes::Cursor:
|
||||
value = static_cast<uint32>(m_pp.silver_cursor);
|
||||
break;
|
||||
default:
|
||||
@@ -8152,15 +8188,15 @@ uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
case MoneyTypes::Gold: {
|
||||
switch (subtype) {
|
||||
case 0:
|
||||
case MoneySubtypes::Personal:
|
||||
value = static_cast<uint32>(m_pp.gold);
|
||||
break;
|
||||
case 1:
|
||||
case MoneySubtypes::Bank:
|
||||
value = static_cast<uint32>(m_pp.gold_bank);
|
||||
break;
|
||||
case 2:
|
||||
case MoneySubtypes::Cursor:
|
||||
value = static_cast<uint32>(m_pp.gold_cursor);
|
||||
break;
|
||||
default:
|
||||
@@ -8168,18 +8204,18 @@ uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
case MoneyTypes::Platinum: {
|
||||
switch (subtype) {
|
||||
case 0:
|
||||
case MoneySubtypes::Personal:
|
||||
value = static_cast<uint32>(m_pp.platinum);
|
||||
break;
|
||||
case 1:
|
||||
case MoneySubtypes::Bank:
|
||||
value = static_cast<uint32>(m_pp.platinum_bank);
|
||||
break;
|
||||
case 2:
|
||||
case MoneySubtypes::Cursor:
|
||||
value = static_cast<uint32>(m_pp.platinum_cursor);
|
||||
break;
|
||||
case 3:
|
||||
case MoneySubtypes::SharedBank:
|
||||
value = static_cast<uint32>(m_pp.platinum_shared);
|
||||
break;
|
||||
default:
|
||||
@@ -8190,6 +8226,7 @@ uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -8567,20 +8604,20 @@ void Client::InitInnates()
|
||||
}
|
||||
|
||||
switch (class_) {
|
||||
case DRUID:
|
||||
case Class::Druid:
|
||||
m_pp.InnateSkills[InnateHarmony] = InnateEnabled;
|
||||
break;
|
||||
case BARD:
|
||||
case Class::Bard:
|
||||
m_pp.InnateSkills[InnateReveal] = InnateEnabled;
|
||||
break;
|
||||
case ROGUE:
|
||||
case Class::Rogue:
|
||||
m_pp.InnateSkills[InnateSurprise] = InnateEnabled;
|
||||
m_pp.InnateSkills[InnateReveal] = InnateEnabled;
|
||||
break;
|
||||
case RANGER:
|
||||
case Class::Ranger:
|
||||
m_pp.InnateSkills[InnateAwareness] = InnateEnabled;
|
||||
break;
|
||||
case MONK:
|
||||
case Class::Monk:
|
||||
m_pp.InnateSkills[InnateSurprise] = InnateEnabled;
|
||||
m_pp.InnateSkills[InnateAwareness] = InnateEnabled;
|
||||
default:
|
||||
@@ -9718,7 +9755,7 @@ std::vector<int> Client::GetLearnableDisciplines(uint8 min_level, uint8 max_leve
|
||||
continue;
|
||||
}
|
||||
|
||||
if (spells[spell_id].classes[WARRIOR] == 0) {
|
||||
if (spells[spell_id].classes[Class::Warrior] == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -9789,7 +9826,7 @@ std::vector<int> Client::GetScribeableSpells(uint8 min_level, uint8 max_level) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (spells[spell_id].classes[WARRIOR] == 0) {
|
||||
if (spells[spell_id].classes[Class::Warrior] == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -10353,6 +10390,16 @@ void Client::SetDoorToolEntityId(uint16 door_tool_entity_id)
|
||||
Client::m_door_tool_entity_id = door_tool_entity_id;
|
||||
}
|
||||
|
||||
uint16 Client::GetObjectToolEntityId() const
|
||||
{
|
||||
return m_object_tool_entity_id;
|
||||
}
|
||||
|
||||
void Client::SetObjectToolEntityId(uint16 object_tool_entity_id)
|
||||
{
|
||||
Client::m_object_tool_entity_id = object_tool_entity_id;
|
||||
}
|
||||
|
||||
int Client::GetIPExemption()
|
||||
{
|
||||
return database.GetIPExemption(GetIPString());
|
||||
@@ -10648,37 +10695,37 @@ uint16 Client::LearnDisciplines(uint8 min_level, uint8 max_level)
|
||||
|
||||
uint16 Client::GetClassTrackingDistanceMultiplier(uint16 class_) {
|
||||
switch (class_) {
|
||||
case WARRIOR:
|
||||
case Class::Warrior:
|
||||
return RuleI(Character, WarriorTrackingDistanceMultiplier);
|
||||
case CLERIC:
|
||||
case Class::Cleric:
|
||||
return RuleI(Character, ClericTrackingDistanceMultiplier);
|
||||
case PALADIN:
|
||||
case Class::Paladin:
|
||||
return RuleI(Character, PaladinTrackingDistanceMultiplier);
|
||||
case RANGER:
|
||||
case Class::Ranger:
|
||||
return RuleI(Character, RangerTrackingDistanceMultiplier);
|
||||
case SHADOWKNIGHT:
|
||||
case Class::ShadowKnight:
|
||||
return RuleI(Character, ShadowKnightTrackingDistanceMultiplier);
|
||||
case DRUID:
|
||||
case Class::Druid:
|
||||
return RuleI(Character, DruidTrackingDistanceMultiplier);
|
||||
case MONK:
|
||||
case Class::Monk:
|
||||
return RuleI(Character, MonkTrackingDistanceMultiplier);
|
||||
case BARD:
|
||||
case Class::Bard:
|
||||
return RuleI(Character, BardTrackingDistanceMultiplier);
|
||||
case ROGUE:
|
||||
case Class::Rogue:
|
||||
return RuleI(Character, RogueTrackingDistanceMultiplier);
|
||||
case SHAMAN:
|
||||
case Class::Shaman:
|
||||
return RuleI(Character, ShamanTrackingDistanceMultiplier);
|
||||
case NECROMANCER:
|
||||
case Class::Necromancer:
|
||||
return RuleI(Character, NecromancerTrackingDistanceMultiplier);
|
||||
case WIZARD:
|
||||
case Class::Wizard:
|
||||
return RuleI(Character, WizardTrackingDistanceMultiplier);
|
||||
case MAGICIAN:
|
||||
case Class::Magician:
|
||||
return RuleI(Character, MagicianTrackingDistanceMultiplier);
|
||||
case ENCHANTER:
|
||||
case Class::Enchanter:
|
||||
return RuleI(Character, EnchanterTrackingDistanceMultiplier);
|
||||
case BEASTLORD:
|
||||
case Class::Beastlord:
|
||||
return RuleI(Character, BeastlordTrackingDistanceMultiplier);
|
||||
case BERSERKER:
|
||||
case Class::Berserker:
|
||||
return RuleI(Character, BerserkerTrackingDistanceMultiplier);
|
||||
default:
|
||||
return 0;
|
||||
@@ -11125,16 +11172,15 @@ void Client::AddAAPoints(uint32 points)
|
||||
{
|
||||
m_pp.aapoints += points;
|
||||
|
||||
if (points == 1 && m_pp.aapoints == 1)
|
||||
{
|
||||
if (parse->PlayerHasQuestSub(EVENT_AA_GAIN)) {
|
||||
parse->EventPlayer(EVENT_AA_GAIN, this, std::to_string(points), 0);
|
||||
}
|
||||
|
||||
if (points == 1 && m_pp.aapoints == 1) {
|
||||
MessageString(Chat::Yellow, GAIN_SINGLE_AA_SINGLE_AA, fmt::format_int(m_pp.aapoints).c_str());
|
||||
}
|
||||
else if (points == 1 && m_pp.aapoints > 1)
|
||||
{
|
||||
} else if (points == 1 && m_pp.aapoints > 1) {
|
||||
MessageString(Chat::Yellow, GAIN_SINGLE_AA_MULTI_AA, fmt::format_int(m_pp.aapoints).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
MessageString(Chat::Yellow, GAIN_MULTI_AA_MULTI_AA, fmt::format_int(points).c_str(), fmt::format_int(m_pp.aapoints).c_str());
|
||||
}
|
||||
|
||||
|
||||
+15
-7
@@ -908,6 +908,7 @@ public:
|
||||
void AutoGrantAAPoints();
|
||||
void GrantAllAAPoints(uint8 unlock_level = 0);
|
||||
bool HasAlreadyPurchasedRank(AA::Rank* rank);
|
||||
void ListPurchasedAAs(Client *to, std::string search_criteria = std::string());
|
||||
|
||||
bool SendGMCommand(std::string message, bool ignore_status = false);
|
||||
|
||||
@@ -1274,6 +1275,10 @@ public:
|
||||
}
|
||||
else { return 0; }
|
||||
}
|
||||
inline bool CompleteTask(uint32 task_id)
|
||||
{
|
||||
return task_state ? task_state->CompleteTask(this, task_id) : false;
|
||||
}
|
||||
inline void FailTask(int task_id) { if (task_state) { task_state->FailTask(this, task_id); }}
|
||||
inline int TaskTimeLeft(int task_id) { return (task_state ? task_state->TaskTimeLeft(task_id) : 0); }
|
||||
inline int EnabledTaskCount(int task_set_id)
|
||||
@@ -1809,9 +1814,12 @@ private:
|
||||
bool dev_tools_enabled;
|
||||
|
||||
uint16 m_door_tool_entity_id;
|
||||
uint16 m_object_tool_entity_id;
|
||||
public:
|
||||
uint16 GetDoorToolEntityId() const;
|
||||
void SetDoorToolEntityId(uint16 door_tool_entity_id);
|
||||
uint16 GetObjectToolEntityId() const;
|
||||
void SetObjectToolEntityId(uint16 object_tool_entity_id);
|
||||
private:
|
||||
|
||||
int32 max_end;
|
||||
@@ -2037,14 +2045,14 @@ public:
|
||||
bool GetBotPrecombat() { return m_bot_precombat; }
|
||||
void SetBotPrecombat(bool flag = true) { m_bot_precombat = flag; }
|
||||
|
||||
int GetBotRequiredLevel(uint8 class_id = NO_CLASS);
|
||||
uint32 GetBotCreationLimit(uint8 class_id = NO_CLASS);
|
||||
int GetBotSpawnLimit(uint8 class_id = NO_CLASS);
|
||||
void SetBotCreationLimit(uint32 new_creation_limit, uint8 class_id = NO_CLASS);
|
||||
void SetBotRequiredLevel(int new_required_level, uint8 class_id = NO_CLASS);
|
||||
void SetBotSpawnLimit(int new_spawn_limit, uint8 class_id = NO_CLASS);
|
||||
int GetBotRequiredLevel(uint8 class_id = Class::None);
|
||||
uint32 GetBotCreationLimit(uint8 class_id = Class::None);
|
||||
int GetBotSpawnLimit(uint8 class_id = Class::None);
|
||||
void SetBotCreationLimit(uint32 new_creation_limit, uint8 class_id = Class::None);
|
||||
void SetBotRequiredLevel(int new_required_level, uint8 class_id = Class::None);
|
||||
void SetBotSpawnLimit(int new_spawn_limit, uint8 class_id = Class::None);
|
||||
|
||||
void CampAllBots(uint8 class_id = NO_CLASS);
|
||||
void CampAllBots(uint8 class_id = Class::None);
|
||||
void SpawnRaidBotsOnConnect(Raid* raid);
|
||||
|
||||
private:
|
||||
|
||||
+29
-29
@@ -345,7 +345,7 @@ uint32 Mob::GetClassLevelFactor()
|
||||
uint32 multiplier = 0;
|
||||
uint8 mlevel = GetLevel();
|
||||
switch (GetClass()) {
|
||||
case WARRIOR: {
|
||||
case Class::Warrior: {
|
||||
if (mlevel < 20) {
|
||||
multiplier = 220;
|
||||
}
|
||||
@@ -372,9 +372,9 @@ uint32 Mob::GetClassLevelFactor()
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DRUID:
|
||||
case CLERIC:
|
||||
case SHAMAN: {
|
||||
case Class::Druid:
|
||||
case Class::Cleric:
|
||||
case Class::Shaman: {
|
||||
if (mlevel < 70) {
|
||||
multiplier = 150;
|
||||
}
|
||||
@@ -383,9 +383,9 @@ uint32 Mob::GetClassLevelFactor()
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BERSERKER:
|
||||
case PALADIN:
|
||||
case SHADOWKNIGHT: {
|
||||
case Class::Berserker:
|
||||
case Class::Paladin:
|
||||
case Class::ShadowKnight: {
|
||||
if (mlevel < 35) {
|
||||
multiplier = 210;
|
||||
}
|
||||
@@ -409,10 +409,10 @@ uint32 Mob::GetClassLevelFactor()
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MONK:
|
||||
case BARD:
|
||||
case ROGUE:
|
||||
case BEASTLORD: {
|
||||
case Class::Monk:
|
||||
case Class::Bard:
|
||||
case Class::Rogue:
|
||||
case Class::Beastlord: {
|
||||
if (mlevel < 51) {
|
||||
multiplier = 180;
|
||||
}
|
||||
@@ -427,7 +427,7 @@ uint32 Mob::GetClassLevelFactor()
|
||||
}
|
||||
break;
|
||||
}
|
||||
case RANGER: {
|
||||
case Class::Ranger: {
|
||||
if (mlevel < 58) {
|
||||
multiplier = 200;
|
||||
}
|
||||
@@ -439,10 +439,10 @@ uint32 Mob::GetClassLevelFactor()
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MAGICIAN:
|
||||
case WIZARD:
|
||||
case NECROMANCER:
|
||||
case ENCHANTER: {
|
||||
case Class::Magician:
|
||||
case Class::Wizard:
|
||||
case Class::Necromancer:
|
||||
case Class::Enchanter: {
|
||||
if (mlevel < 70) {
|
||||
multiplier = 120;
|
||||
}
|
||||
@@ -677,7 +677,7 @@ int64 Client::CalcManaRegen(bool bCombat)
|
||||
if (IsSitting() || CanMedOnHorse()) {
|
||||
// kind of weird to do it here w/e
|
||||
// client does some base medding regen for shrouds here
|
||||
if (GetClass() != BARD) {
|
||||
if (GetClass() != Class::Bard) {
|
||||
auto skill = GetSkill(EQ::skills::SkillMeditate);
|
||||
if (skill > 0) {
|
||||
regen++;
|
||||
@@ -1077,7 +1077,7 @@ int32 Client::CalcMR()
|
||||
MR = 20;
|
||||
}
|
||||
MR += itembonuses.MR + spellbonuses.MR + aabonuses.MR;
|
||||
if (GetClass() == WARRIOR || GetClass() == BERSERKER) {
|
||||
if (GetClass() == Class::Warrior || GetClass() == Class::Berserker) {
|
||||
MR += GetLevel() / 2;
|
||||
}
|
||||
if (MR < 1) {
|
||||
@@ -1151,14 +1151,14 @@ int32 Client::CalcFR()
|
||||
FR = 20;
|
||||
}
|
||||
int c = GetClass();
|
||||
if (c == RANGER) {
|
||||
if (c == Class::Ranger) {
|
||||
FR += 4;
|
||||
int l = GetLevel();
|
||||
if (l > 49) {
|
||||
FR += l - 49;
|
||||
}
|
||||
}
|
||||
if (c == MONK) {
|
||||
if (c == Class::Monk) {
|
||||
FR += 8;
|
||||
int l = GetLevel();
|
||||
if (l > 49) {
|
||||
@@ -1238,19 +1238,19 @@ int32 Client::CalcDR()
|
||||
}
|
||||
int c = GetClass();
|
||||
// the monk one is part of base resist
|
||||
if (c == MONK) {
|
||||
if (c == Class::Monk) {
|
||||
int l = GetLevel();
|
||||
if (l > 50)
|
||||
DR += l - 50;
|
||||
}
|
||||
if (c == PALADIN) {
|
||||
if (c == Class::Paladin) {
|
||||
DR += 8;
|
||||
int l = GetLevel();
|
||||
if (l > 49) {
|
||||
DR += l - 49;
|
||||
}
|
||||
}
|
||||
else if (c == SHADOWKNIGHT || c == BEASTLORD) {
|
||||
else if (c == Class::ShadowKnight || c == Class::Beastlord) {
|
||||
DR += 4;
|
||||
int l = GetLevel();
|
||||
if (l > 49) {
|
||||
@@ -1330,19 +1330,19 @@ int32 Client::CalcPR()
|
||||
}
|
||||
int c = GetClass();
|
||||
// this monk bonus is part of the base
|
||||
if (c == MONK) {
|
||||
if (c == Class::Monk) {
|
||||
int l = GetLevel();
|
||||
if (l > 50)
|
||||
PR += l - 50;
|
||||
}
|
||||
if (c == ROGUE) {
|
||||
if (c == Class::Rogue) {
|
||||
PR += 8;
|
||||
int l = GetLevel();
|
||||
if (l > 49) {
|
||||
PR += l - 49;
|
||||
}
|
||||
}
|
||||
else if (c == SHADOWKNIGHT) {
|
||||
else if (c == Class::ShadowKnight) {
|
||||
PR += 4;
|
||||
int l = GetLevel();
|
||||
if (l > 49) {
|
||||
@@ -1421,7 +1421,7 @@ int32 Client::CalcCR()
|
||||
CR = 25;
|
||||
}
|
||||
int c = GetClass();
|
||||
if (c == RANGER || c == BEASTLORD) {
|
||||
if (c == Class::Ranger || c == Class::Beastlord) {
|
||||
CR += 4;
|
||||
int l = GetLevel();
|
||||
if (l > 49) {
|
||||
@@ -1455,7 +1455,7 @@ int32 Client::CalcATK()
|
||||
|
||||
uint32 Mob::GetInstrumentMod(uint16 spell_id)
|
||||
{
|
||||
if (GetClass() != BARD) {
|
||||
if (GetClass() != Class::Bard) {
|
||||
//Other classes can get a base effects mod using SPA 413
|
||||
if (HasBaseEffectFocus()) {
|
||||
return (10 + (GetFocusEffect(focusFcBaseEffects, spell_id) / 10));//TODO: change action->instrument mod to float to support < 10% focus values
|
||||
@@ -1689,7 +1689,7 @@ int64 Client::CalcEnduranceRegen(bool bCombat)
|
||||
|
||||
int weight_limit = GetSTR();
|
||||
auto level = GetLevel();
|
||||
if (GetClass() == MONK) {
|
||||
if (GetClass() == Class::Monk) {
|
||||
if (level > 99)
|
||||
weight_limit = 58;
|
||||
else if (level > 94)
|
||||
|
||||
+247
-225
@@ -60,6 +60,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../common/repositories/criteria/content_filter_criteria.h"
|
||||
#include "../common/shared_tasks.h"
|
||||
#include "gm_commands/door_manipulation.h"
|
||||
#include "gm_commands/object_manipulation.h"
|
||||
#include "client.h"
|
||||
#include "../common/repositories/account_repository.h"
|
||||
|
||||
@@ -1380,15 +1381,11 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
||||
SetClientMaxLevel(client_max_level);
|
||||
|
||||
// we know our class now, so we might have to fix our consume timer!
|
||||
if (class_ == MONK)
|
||||
if (class_ == Class::Monk)
|
||||
consume_food_timer.SetTimer(CONSUMPTION_MNK_TIMER);
|
||||
|
||||
InitInnates();
|
||||
|
||||
/* If GM not set in DB, and does not meet min status to be GM, reset */
|
||||
if (m_pp.gm && admin < minStatusToBeGM)
|
||||
m_pp.gm = 0;
|
||||
|
||||
/* Load Guild */
|
||||
if (!IsInAGuild()) {
|
||||
m_pp.guild_id = GUILD_NONE;
|
||||
@@ -1595,9 +1592,9 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
||||
m_pp.spellSlotRefresh[i] = p_timers.GetRemainingTime(pTimerSpellStart + m_pp.mem_spells[i]) * 1000;
|
||||
|
||||
/* Ability slot refresh send SK/PAL */
|
||||
if (m_pp.class_ == SHADOWKNIGHT || m_pp.class_ == PALADIN) {
|
||||
if (m_pp.class_ == Class::ShadowKnight || m_pp.class_ == Class::Paladin) {
|
||||
uint32 abilitynum = 0;
|
||||
if (m_pp.class_ == SHADOWKNIGHT) { abilitynum = pTimerHarmTouch; }
|
||||
if (m_pp.class_ == Class::ShadowKnight) { abilitynum = pTimerHarmTouch; }
|
||||
else { abilitynum = pTimerLayHands; }
|
||||
|
||||
uint32 remaining = p_timers.GetRemainingTime(abilitynum);
|
||||
@@ -1702,8 +1699,9 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
||||
this is not quite where live sends inventory, they do it after tribute
|
||||
*/
|
||||
if (loaditems) { /* Don't load if a length error occurs */
|
||||
if (admin >= minStatusToBeGM)
|
||||
if (m_pp.gm) {
|
||||
m_inv.SetGMInventory(true); // set to true to allow expansion-restricted packets through
|
||||
}
|
||||
|
||||
BulkSendInventoryItems();
|
||||
/* Send stuff on the cursor which isn't sent in bulk */
|
||||
@@ -1937,8 +1935,8 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app)
|
||||
Adventure_Purchase_Struct* aps = (Adventure_Purchase_Struct*)app->pBuffer;
|
||||
uint32 merchantid = 0;
|
||||
Mob* tmp = entity_list.GetMob(aps->npcid);
|
||||
if (tmp == 0 || !tmp->IsNPC() || ((tmp->GetClass() != ADVENTURE_MERCHANT) &&
|
||||
(tmp->GetClass() != DISCORD_MERCHANT) && (tmp->GetClass() != NORRATHS_KEEPERS_MERCHANT) && (tmp->GetClass() != DARK_REIGN_MERCHANT)))
|
||||
if (tmp == 0 || !tmp->IsNPC() || ((tmp->GetClass() != Class::AdventureMerchant) &&
|
||||
(tmp->GetClass() != Class::DiscordMerchant) && (tmp->GetClass() != Class::NorrathsKeepersMerchant) && (tmp->GetClass() != Class::DarkReignMerchant)))
|
||||
return;
|
||||
|
||||
//you have to be somewhat close to them to be properly using them
|
||||
@@ -2123,8 +2121,8 @@ void Client::Handle_OP_AdventureMerchantRequest(const EQApplicationPacket *app)
|
||||
uint32 merchantid = 0;
|
||||
|
||||
Mob* tmp = entity_list.GetMob(eid->entity_id);
|
||||
if (tmp == 0 || !tmp->IsNPC() || ((tmp->GetClass() != ADVENTURE_MERCHANT) &&
|
||||
(tmp->GetClass() != DISCORD_MERCHANT) && (tmp->GetClass() != NORRATHS_KEEPERS_MERCHANT) && (tmp->GetClass() != DARK_REIGN_MERCHANT)))
|
||||
if (tmp == 0 || !tmp->IsNPC() || ((tmp->GetClass() != Class::AdventureMerchant) &&
|
||||
(tmp->GetClass() != Class::DiscordMerchant) && (tmp->GetClass() != Class::NorrathsKeepersMerchant) && (tmp->GetClass() != Class::DarkReignMerchant)))
|
||||
return;
|
||||
|
||||
if (!tmp->CastToNPC()->IsMerchantOpen()) {
|
||||
@@ -2199,8 +2197,8 @@ void Client::Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app)
|
||||
Adventure_Sell_Struct *ams_in = (Adventure_Sell_Struct*)app->pBuffer;
|
||||
|
||||
Mob* vendor = entity_list.GetMob(ams_in->npcid);
|
||||
if (vendor == 0 || !vendor->IsNPC() || ((vendor->GetClass() != ADVENTURE_MERCHANT) &&
|
||||
(vendor->GetClass() != NORRATHS_KEEPERS_MERCHANT) && (vendor->GetClass() != DARK_REIGN_MERCHANT)))
|
||||
if (vendor == 0 || !vendor->IsNPC() || ((vendor->GetClass() != Class::AdventureMerchant) &&
|
||||
(vendor->GetClass() != Class::NorrathsKeepersMerchant) && (vendor->GetClass() != Class::DarkReignMerchant)))
|
||||
{
|
||||
Message(Chat::Red, "Vendor was not found.");
|
||||
return;
|
||||
@@ -2300,17 +2298,17 @@ void Client::Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app)
|
||||
|
||||
switch (vendor->GetClass())
|
||||
{
|
||||
case ADVENTURE_MERCHANT:
|
||||
case Class::AdventureMerchant:
|
||||
{
|
||||
UpdateLDoNPoints(6, price);
|
||||
break;
|
||||
}
|
||||
case NORRATHS_KEEPERS_MERCHANT:
|
||||
case Class::NorrathsKeepersMerchant:
|
||||
{
|
||||
SetRadiantCrystals(GetRadiantCrystals() + price);
|
||||
break;
|
||||
}
|
||||
case DARK_REIGN_MERCHANT:
|
||||
case Class::DarkReignMerchant:
|
||||
{
|
||||
SetEbonCrystals(GetEbonCrystals() + price);
|
||||
break;
|
||||
@@ -2484,7 +2482,7 @@ void Client::Handle_OP_AltCurrencyMerchantRequest(const EQApplicationPacket *app
|
||||
return;
|
||||
}
|
||||
|
||||
if (target->GetClass() != ALT_CURRENCY_MERCHANT) {
|
||||
if (target->GetClass() != Class::AlternateCurrencyMerchant) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2555,7 +2553,7 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app)
|
||||
if (DistanceSquared(m_Position, tar->GetPosition())> USE_NPC_RANGE2)
|
||||
return;
|
||||
|
||||
if (tar->GetClass() != ALT_CURRENCY_MERCHANT) {
|
||||
if (tar->GetClass() != Class::AlternateCurrencyMerchant) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2724,7 +2722,7 @@ void Client::Handle_OP_AltCurrencySell(const EQApplicationPacket *app)
|
||||
if (DistanceSquared(m_Position, tar->GetPosition()) > USE_NPC_RANGE2)
|
||||
return;
|
||||
|
||||
if (tar->GetClass() != ALT_CURRENCY_MERCHANT) {
|
||||
if (tar->GetClass() != Class::AlternateCurrencyMerchant) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2860,7 +2858,7 @@ void Client::Handle_OP_AltCurrencySellSelection(const EQApplicationPacket *app)
|
||||
if (DistanceSquared(m_Position, tar->GetPosition()) > USE_NPC_RANGE2)
|
||||
return;
|
||||
|
||||
if (tar->GetClass() != ALT_CURRENCY_MERCHANT) {
|
||||
if (tar->GetClass() != Class::AlternateCurrencyMerchant) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2968,7 +2966,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app)
|
||||
|
||||
bool IsPoison = (poison && poison->ItemType == EQ::item::ItemTypePoison);
|
||||
|
||||
if (IsPoison && GetClass() == ROGUE) {
|
||||
if (IsPoison && GetClass() == Class::Rogue) {
|
||||
|
||||
// Live always checks for skillup, even when poison is too high
|
||||
CheckIncreaseSkill(EQ::skills::SkillApplyPoison, nullptr, 10);
|
||||
@@ -3928,7 +3926,7 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app)
|
||||
if (!HasSkill(EQ::skills::SkillBegging) || !GetTarget())
|
||||
return;
|
||||
|
||||
if (GetTarget()->GetClass() == LDON_TREASURE)
|
||||
if (GetTarget()->GetClass() == Class::LDoNTreasure)
|
||||
return;
|
||||
|
||||
p_timers.Start(pTimerBeggingPickPocket, 8);
|
||||
@@ -4473,7 +4471,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
|
||||
else if (slot == CastingSlot::Ability) {
|
||||
uint16 spell_to_cast = 0;
|
||||
|
||||
if (castspell->spell_id == SPELL_LAY_ON_HANDS && GetClass() == PALADIN) {
|
||||
if (castspell->spell_id == SPELL_LAY_ON_HANDS && GetClass() == Class::Paladin) {
|
||||
if (!p_timers.Expired(&database, pTimerLayHands)) {
|
||||
Message(Chat::Red, "Ability recovery time not yet met.");
|
||||
InterruptSpell(castspell->spell_id);
|
||||
@@ -4483,7 +4481,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
|
||||
p_timers.Start(pTimerLayHands, LayOnHandsReuseTime);
|
||||
}
|
||||
else if ((castspell->spell_id == SPELL_HARM_TOUCH
|
||||
|| castspell->spell_id == SPELL_HARM_TOUCH2) && GetClass() == SHADOWKNIGHT) {
|
||||
|| castspell->spell_id == SPELL_HARM_TOUCH2) && GetClass() == Class::ShadowKnight) {
|
||||
if (!p_timers.Expired(&database, pTimerHarmTouch)) {
|
||||
Message(Chat::Red, "Ability recovery time not yet met.");
|
||||
InterruptSpell(castspell->spell_id);
|
||||
@@ -4653,6 +4651,20 @@ void Client::Handle_OP_ClickObject(const EQApplicationPacket *app)
|
||||
std::vector<std::any> args = { object };
|
||||
parse->EventPlayer(EVENT_CLICK_OBJECT, this, std::to_string(click_object->drop_id), GetID(), &args);
|
||||
}
|
||||
|
||||
if (IsDevToolsEnabled()) {
|
||||
SetObjectToolEntityId(entity->GetID());
|
||||
ObjectManipulation::CommandHeader(this);
|
||||
Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Object ({}) [{}] [{}]",
|
||||
entity->CastToObject()->GetDBID(),
|
||||
Saylink::Silent("#object edit", "Edit"),
|
||||
Saylink::Silent("#object delete", "Delete")
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Observed in RoF after OP_ClickObjectAction:
|
||||
@@ -5110,7 +5122,7 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app)
|
||||
}
|
||||
}
|
||||
|
||||
if (t->GetClass() == LDON_TREASURE) {
|
||||
if (t->GetClass() == Class::LDoNTreasure) {
|
||||
Message(Chat::Yellow, fmt::format("{}", t->GetCleanName()).c_str());
|
||||
return;
|
||||
}
|
||||
@@ -6238,7 +6250,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app)
|
||||
damage = 31337;
|
||||
}
|
||||
|
||||
if (admin >= minStatusToAvoidFalling && GetGM()) {
|
||||
if (GetGM()) {
|
||||
Message(
|
||||
Chat::Red,
|
||||
fmt::format(
|
||||
@@ -6446,84 +6458,90 @@ void Client::Handle_OP_GetGuildsList(const EQApplicationPacket *app)
|
||||
|
||||
void Client::Handle_OP_GMBecomeNPC(const EQApplicationPacket *app)
|
||||
{
|
||||
if (Admin() < minStatusToUseGMCommands) {
|
||||
if (!GetGM()) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /becomenpc when they shouldn't be able to"});
|
||||
return;
|
||||
}
|
||||
|
||||
if (app->size != sizeof(BecomeNPC_Struct)) {
|
||||
LogError("Wrong size: OP_GMBecomeNPC, size=[{}], expected [{}]", app->size, sizeof(BecomeNPC_Struct));
|
||||
return;
|
||||
}
|
||||
//entity_list.QueueClients(this, app, false);
|
||||
BecomeNPC_Struct* bnpc = (BecomeNPC_Struct*)app->pBuffer;
|
||||
|
||||
Mob* cli = (Mob*)entity_list.GetMob(bnpc->id);
|
||||
if (cli == nullptr) {
|
||||
auto *b = (BecomeNPC_Struct *) app->pBuffer;
|
||||
|
||||
Mob *m = entity_list.GetMob(b->id);
|
||||
if (!m) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (cli->IsClient()) {
|
||||
Client* target = cli->CastToClient();
|
||||
target->QueuePacket(app);
|
||||
if(target->GetGM()) {
|
||||
target->SetInvul(false);
|
||||
target->SetHideMe(false);
|
||||
target->SetGM(false);
|
||||
if (m->IsClient()) {
|
||||
Client *t = m->CastToClient();
|
||||
t->QueuePacket(app);
|
||||
if (t->GetGM()) {
|
||||
t->SetInvul(false);
|
||||
t->SetHideMe(false);
|
||||
t->SetGM(false);
|
||||
}
|
||||
|
||||
cli->SendAppearancePacket(AT_NPCName, 1, true);
|
||||
target->SetBecomeNPC(true);
|
||||
target->SetBecomeNPCLevel(bnpc->maxlevel);
|
||||
cli->MessageString(Chat::White, TOGGLE_OFF);
|
||||
target->tellsoff = true;
|
||||
target->UpdateWho();
|
||||
m->SendAppearancePacket(AT_NPCName, 1, true);
|
||||
t->SetBecomeNPC(true);
|
||||
t->SetBecomeNPCLevel(b->maxlevel);
|
||||
m->MessageString(Chat::White, TOGGLE_OFF);
|
||||
t->tellsoff = true;
|
||||
t->UpdateWho();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_GMDelCorpse(const EQApplicationPacket *app)
|
||||
{
|
||||
if (app->size != sizeof(GMDelCorpse_Struct))
|
||||
if (app->size != sizeof(GMDelCorpse_Struct)) {
|
||||
return;
|
||||
if (Admin() < commandEditPlayerCorpses) {
|
||||
}
|
||||
|
||||
if (!GetGM()) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /delcorpse"});
|
||||
return;
|
||||
}
|
||||
GMDelCorpse_Struct* dc = (GMDelCorpse_Struct *)app->pBuffer;
|
||||
Mob* corpse = entity_list.GetMob(dc->corpsename);
|
||||
if (corpse == 0) {
|
||||
|
||||
auto *c = (GMDelCorpse_Struct *) app->pBuffer;
|
||||
Mob *corpse = entity_list.GetMob(c->corpsename);
|
||||
if (!c) {
|
||||
return;
|
||||
}
|
||||
if (corpse->IsCorpse() != true) {
|
||||
|
||||
if (!corpse->IsCorpse()) {
|
||||
return;
|
||||
}
|
||||
|
||||
corpse->CastToCorpse()->Delete();
|
||||
std::cout << name << " deleted corpse " << dc->corpsename << std::endl;
|
||||
Message(Chat::Red, "Corpse %s deleted.", dc->corpsename);
|
||||
return;
|
||||
Message(Chat::Red, fmt::format("Corpse {} deleted.", c->corpsename).c_str());
|
||||
}
|
||||
|
||||
void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app)
|
||||
{
|
||||
if (Admin() < minStatusToUseGMCommands) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
return;
|
||||
}
|
||||
if (app->size != sizeof(GMEmoteZone_Struct)) {
|
||||
LogError("Wrong size: OP_GMEmoteZone, size=[{}], expected [{}]", app->size, sizeof(GMEmoteZone_Struct));
|
||||
return;
|
||||
}
|
||||
GMEmoteZone_Struct* gmez = (GMEmoteZone_Struct*)app->pBuffer;
|
||||
char* newmessage = nullptr;
|
||||
if (strstr(gmez->text, "^") == 0)
|
||||
entity_list.Message(Chat::White, 15, gmez->text);
|
||||
else {
|
||||
for (newmessage = strtok((char*)gmez->text, "^"); newmessage != nullptr; newmessage = strtok(nullptr, "^"))
|
||||
entity_list.Message(Chat::White, 15, newmessage);
|
||||
|
||||
if (!GetGM()) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /emote"});
|
||||
return;
|
||||
}
|
||||
|
||||
auto *gmez = (GMEmoteZone_Struct*)app->pBuffer;
|
||||
char *newmessage = nullptr;
|
||||
if (strstr(gmez->text, "^") == 0) {
|
||||
entity_list.Message(0, Chat::White, gmez->text);
|
||||
} else {
|
||||
for (newmessage = strtok((char *) gmez->text, "^"); newmessage != nullptr; newmessage = strtok(nullptr, "^")) {
|
||||
entity_list.Message(0, Chat::White, newmessage);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_GMEndTraining(const EQApplicationPacket *app)
|
||||
@@ -6533,154 +6551,149 @@ void Client::Handle_OP_GMEndTraining(const EQApplicationPacket *app)
|
||||
DumpPacket(app);
|
||||
return;
|
||||
}
|
||||
|
||||
OPGMEndTraining(app);
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_GMFind(const EQApplicationPacket *app)
|
||||
{
|
||||
if (Admin() < minStatusToUseGMCommands) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /find"});
|
||||
return;
|
||||
}
|
||||
|
||||
if (app->size != sizeof(GMFind_Struct)) {
|
||||
LogError("Wrong size: OP_GMFind, size=[{}], expected [{}]", app->size, sizeof(GMFind_Struct));
|
||||
return;
|
||||
}
|
||||
|
||||
//Break down incoming
|
||||
auto* request = (GMFind_Struct*) app->pBuffer;
|
||||
//Create a new outgoing
|
||||
auto outapp = new EQApplicationPacket(OP_GMFind, sizeof(GMFind_Struct));
|
||||
auto* foundplayer = (GMFind_Struct*) outapp->pBuffer;
|
||||
//Copy the constants
|
||||
strcpy(foundplayer->charname, request->charname);
|
||||
strcpy(foundplayer->gmname, request->gmname);
|
||||
//Check if the NPC exits intrazone...
|
||||
auto* gt = entity_list.GetMob(request->charname);
|
||||
if (gt) {
|
||||
foundplayer->success = 1;
|
||||
foundplayer->x = gt->GetX();
|
||||
foundplayer->y = gt->GetY();
|
||||
foundplayer->z = gt->GetZ();
|
||||
foundplayer->zoneID = zone->GetZoneID();
|
||||
if (!GetGM()) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /find"});
|
||||
return;
|
||||
}
|
||||
//Send the packet...
|
||||
|
||||
auto *r = (GMFind_Struct *) app->pBuffer;
|
||||
auto outapp = new EQApplicationPacket(OP_GMFind, sizeof(GMFind_Struct));
|
||||
auto *f = (GMFind_Struct *) outapp->pBuffer;
|
||||
|
||||
strcpy(f->charname, r->charname);
|
||||
strcpy(f->gmname, r->gmname);
|
||||
|
||||
auto* gt = entity_list.GetMob(r->charname);
|
||||
if (gt) {
|
||||
f->success = 1;
|
||||
f->x = gt->GetX();
|
||||
f->y = gt->GetY();
|
||||
f->z = gt->GetZ();
|
||||
f->zoneID = zone->GetZoneID();
|
||||
}
|
||||
|
||||
FastQueuePacket(&outapp);
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_GMGoto(const EQApplicationPacket *app)
|
||||
{
|
||||
if (app->size != sizeof(GMSummon_Struct)) {
|
||||
std::cout << "Wrong size on OP_GMGoto. Got: " << app->size << ", Expected: " << sizeof(GMSummon_Struct) << std::endl;
|
||||
LogError("Wrong size: OP_GMGoto, size=[{}], expected [{}]", app->size, sizeof(GMSummon_Struct));
|
||||
return;
|
||||
}
|
||||
if (Admin() < minStatusToUseGMCommands) {
|
||||
|
||||
if (!GetGM()) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /goto"});
|
||||
return;
|
||||
}
|
||||
GMSummon_Struct* gmg = (GMSummon_Struct*)app->pBuffer;
|
||||
Mob* gt = entity_list.GetMob(gmg->charname);
|
||||
if (gt != nullptr) {
|
||||
|
||||
auto *gmg = (GMSummon_Struct *) app->pBuffer;
|
||||
Mob *gt = entity_list.GetMob(gmg->charname);
|
||||
if (!gt) {
|
||||
MovePC(zone->GetZoneID(), zone->GetInstanceID(), gt->GetX(), gt->GetY(), gt->GetZ(), gt->GetHeading());
|
||||
}
|
||||
else if (!worldserver.Connected())
|
||||
} else if (!worldserver.Connected()) {
|
||||
Message(Chat::Red, "Error: World server disconnected.");
|
||||
else {
|
||||
} else {
|
||||
auto pack = new ServerPacket(ServerOP_GMGoto, sizeof(ServerGMGoto_Struct));
|
||||
memset(pack->pBuffer, 0, pack->size);
|
||||
ServerGMGoto_Struct* wsgmg = (ServerGMGoto_Struct*)pack->pBuffer;
|
||||
ServerGMGoto_Struct *wsgmg = (ServerGMGoto_Struct *) pack->pBuffer;
|
||||
strcpy(wsgmg->myname, GetName());
|
||||
strcpy(wsgmg->gotoname, gmg->charname);
|
||||
wsgmg->admin = admin;
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_GMHideMe(const EQApplicationPacket *app)
|
||||
{
|
||||
if (Admin() < minStatusToUseGMCommands) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /hideme"});
|
||||
return;
|
||||
}
|
||||
if (app->size != sizeof(SpawnAppearance_Struct)) {
|
||||
LogError("Wrong size: OP_GMHideMe, size=[{}], expected [{}]", app->size, sizeof(SpawnAppearance_Struct));
|
||||
return;
|
||||
}
|
||||
SpawnAppearance_Struct* sa = (SpawnAppearance_Struct*)app->pBuffer;
|
||||
Message(Chat::Red, "#: %i, %i", sa->type, sa->parameter);
|
||||
SetHideMe(!sa->parameter);
|
||||
return;
|
||||
|
||||
if (!GetGM()) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /hideme"});
|
||||
return;
|
||||
}
|
||||
|
||||
auto *sa = (SpawnAppearance_Struct *) app->pBuffer;
|
||||
SetHideMe(!sa->parameter);
|
||||
}
|
||||
|
||||
void Client::Handle_OP_GMKick(const EQApplicationPacket *app)
|
||||
{
|
||||
if (app->size != sizeof(GMKick_Struct))
|
||||
if (app->size != sizeof(GMKick_Struct)) {
|
||||
return;
|
||||
if (Admin() < minStatusToKick) {
|
||||
}
|
||||
|
||||
if (!GetGM()) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /kick"});
|
||||
return;
|
||||
}
|
||||
GMKick_Struct* gmk = (GMKick_Struct *)app->pBuffer;
|
||||
|
||||
Client* client = entity_list.GetClientByName(gmk->name);
|
||||
if (client == 0) {
|
||||
if (!worldserver.Connected())
|
||||
auto *gmk = (GMKick_Struct *)app->pBuffer;
|
||||
Client *c = entity_list.GetClientByName(gmk->name);
|
||||
if (!c) {
|
||||
if (!worldserver.Connected()) {
|
||||
Message(Chat::Red, "Error: World server disconnected");
|
||||
else {
|
||||
} else {
|
||||
auto pack = new ServerPacket(ServerOP_KickPlayer, sizeof(ServerKickPlayer_Struct));
|
||||
ServerKickPlayer_Struct* skp = (ServerKickPlayer_Struct*)pack->pBuffer;
|
||||
auto *skp = (ServerKickPlayer_Struct *) pack->pBuffer;
|
||||
strcpy(skp->adminname, gmk->gmname);
|
||||
strcpy(skp->name, gmk->name);
|
||||
skp->adminrank = Admin();
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
entity_list.QueueClients(this, app);
|
||||
//client->Kick();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_GMKill(const EQApplicationPacket *app)
|
||||
{
|
||||
if (Admin() < minStatusToUseGMCommands) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /kill"});
|
||||
return;
|
||||
}
|
||||
if (app->size != sizeof(GMKill_Struct)) {
|
||||
LogError("Wrong size: OP_GMKill, size=[{}], expected [{}]", app->size, sizeof(GMKill_Struct));
|
||||
return;
|
||||
}
|
||||
GMKill_Struct* gmk = (GMKill_Struct *)app->pBuffer;
|
||||
Mob* obj = entity_list.GetMob(gmk->name);
|
||||
Client* client = entity_list.GetClientByName(gmk->name);
|
||||
if (obj != 0) {
|
||||
if (client != 0) {
|
||||
|
||||
if (!GetGM()) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /kill"});
|
||||
return;
|
||||
}
|
||||
|
||||
auto *gmk = (GMKill_Struct *) app->pBuffer;
|
||||
Mob *obj = entity_list.GetMob(gmk->name);
|
||||
Client *c = entity_list.GetClientByName(gmk->name);
|
||||
if (obj) {
|
||||
if (c) {
|
||||
entity_list.QueueClients(this, app);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
obj->Kill();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!worldserver.Connected())
|
||||
} else {
|
||||
if (!worldserver.Connected()) {
|
||||
Message(Chat::Red, "Error: World server disconnected");
|
||||
else {
|
||||
} else {
|
||||
auto pack = new ServerPacket(ServerOP_KillPlayer, sizeof(ServerKillPlayer_Struct));
|
||||
ServerKillPlayer_Struct* skp = (ServerKillPlayer_Struct*)pack->pBuffer;
|
||||
auto *skp = (ServerKillPlayer_Struct *) pack->pBuffer;
|
||||
strcpy(skp->gmname, gmk->gmname);
|
||||
strcpy(skp->target, gmk->name);
|
||||
skp->admin = Admin();
|
||||
@@ -6688,7 +6701,6 @@ void Client::Handle_OP_GMKill(const EQApplicationPacket *app)
|
||||
safe_delete(pack);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_GMLastName(const EQApplicationPacket *app)
|
||||
@@ -6697,32 +6709,30 @@ void Client::Handle_OP_GMLastName(const EQApplicationPacket *app)
|
||||
std::cout << "Wrong size on OP_GMLastName. Got: " << app->size << ", Expected: " << sizeof(GMLastName_Struct) << std::endl;
|
||||
return;
|
||||
}
|
||||
GMLastName_Struct* gmln = (GMLastName_Struct*)app->pBuffer;
|
||||
if (strlen(gmln->lastname) >= 64) {
|
||||
Message(Chat::Red, "/LastName: New last name too long. (max=63)");
|
||||
}
|
||||
else {
|
||||
Client* client = entity_list.GetClientByName(gmln->name);
|
||||
if (client == 0) {
|
||||
Message(Chat::Red, "/LastName: %s not found", gmln->name);
|
||||
}
|
||||
else {
|
||||
if (Admin() < minStatusToUseGMCommands) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /lastname"});
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
client->ChangeLastName(gmln->lastname);
|
||||
if (!GetGM()) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /lastname"});
|
||||
return;
|
||||
}
|
||||
|
||||
auto *gmln = (GMLastName_Struct *) app->pBuffer;
|
||||
if (strlen(gmln->lastname) >= 64) {
|
||||
Message(Chat::Red, "/LastName: New last name too long. Max length is 63.");
|
||||
} else {
|
||||
Client *c = entity_list.GetClientByName(gmln->name);
|
||||
if (!c) {
|
||||
Message(Chat::Red, fmt::format("/LastName: {} not found", gmln->name).c_str());
|
||||
} else {
|
||||
c->ChangeLastName(gmln->lastname);
|
||||
}
|
||||
|
||||
gmln->unknown[0] = 1;
|
||||
gmln->unknown[1] = 1;
|
||||
gmln->unknown[2] = 1;
|
||||
gmln->unknown[3] = 1;
|
||||
entity_list.QueueClients(this, app, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app)
|
||||
@@ -6731,44 +6741,49 @@ void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app)
|
||||
LogError("Wrong size: OP_GMNameChange, size=[{}], expected [{}]", app->size, sizeof(GMName_Struct));
|
||||
return;
|
||||
}
|
||||
const GMName_Struct* gmn = (const GMName_Struct *)app->pBuffer;
|
||||
if (Admin() < minStatusToUseGMCommands) {
|
||||
|
||||
auto *gmn = (GMName_Struct *) app->pBuffer;
|
||||
if (!GetGM()) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /name"});
|
||||
return;
|
||||
}
|
||||
Client* client = entity_list.GetClientByName(gmn->oldname);
|
||||
LogInfo("GM([{}]) changeing players name. Old:[{}] New:[{}]", GetName(), gmn->oldname, gmn->newname);
|
||||
bool usedname = database.CheckUsedName(gmn->newname);
|
||||
if (client == 0) {
|
||||
Message(Chat::Red, "%s not found for name change. Operation failed!", gmn->oldname);
|
||||
return;
|
||||
}
|
||||
if ((strlen(gmn->newname) > 63) || (strlen(gmn->newname) == 0)) {
|
||||
Message(Chat::Red, "Invalid number of characters in new name (%s).", gmn->newname);
|
||||
return;
|
||||
}
|
||||
if (!usedname) {
|
||||
Message(Chat::Red, "%s is already in use. Operation failed!", gmn->newname);
|
||||
return;
|
||||
|
||||
Client *c = entity_list.GetClientByName(gmn->oldname);
|
||||
LogInfo("GM([{}]) changeing players name. Old:[{}] New:[{}]", GetName(), gmn->oldname, gmn->newname);
|
||||
|
||||
const bool used_name = database.CheckUsedName(gmn->newname);
|
||||
if (!c) {
|
||||
Message(Chat::Red, fmt::format("{} not found for name change. Operation failed!", gmn->oldname).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen(gmn->newname) > 63 || strlen(gmn->newname) == 0) {
|
||||
Message(Chat::Red, fmt::format("Invalid number of characters in new name '{}'.", gmn->newname).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!used_name) {
|
||||
Message(Chat::Red, fmt::format("{} is already in use. Operation failed!", gmn->newname).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
database.UpdateName(gmn->oldname, gmn->newname);
|
||||
strcpy(client->name, gmn->newname);
|
||||
client->Save();
|
||||
strcpy(c->name, gmn->newname);
|
||||
c->Save();
|
||||
|
||||
if (gmn->badname == 1) {
|
||||
database.AddToNameFilter(gmn->oldname);
|
||||
}
|
||||
EQApplicationPacket* outapp = app->Copy();
|
||||
GMName_Struct* gmn2 = (GMName_Struct*)outapp->pBuffer;
|
||||
|
||||
auto *outapp = app->Copy();
|
||||
auto *gmn2 = (GMName_Struct *) outapp->pBuffer;
|
||||
gmn2->unknown[0] = 1;
|
||||
gmn2->unknown[1] = 1;
|
||||
gmn2->unknown[2] = 1;
|
||||
entity_list.QueueClients(this, outapp, false);
|
||||
safe_delete(outapp);
|
||||
UpdateWho();
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app)
|
||||
@@ -6863,6 +6878,7 @@ void Client::Handle_OP_GMSummon(const EQApplicationPacket *app)
|
||||
std::cout << "Wrong size on OP_GMSummon. Got: " << app->size << ", Expected: " << sizeof(GMSummon_Struct) << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
OPGMSummon(app);
|
||||
return;
|
||||
}
|
||||
@@ -6873,12 +6889,14 @@ void Client::Handle_OP_GMToggle(const EQApplicationPacket *app)
|
||||
std::cout << "Wrong size on OP_GMToggle. Got: " << app->size << ", Expected: " << sizeof(GMToggle_Struct) << std::endl;
|
||||
return;
|
||||
}
|
||||
if (Admin() < minStatusToUseGMCommands) {
|
||||
|
||||
if (!GetGM()) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /toggle"});
|
||||
return;
|
||||
}
|
||||
GMToggle_Struct *ts = (GMToggle_Struct *)app->pBuffer;
|
||||
|
||||
auto *ts = (GMToggle_Struct *)app->pBuffer;
|
||||
if (ts->toggle == 0) {
|
||||
MessageString(Chat::White, TOGGLE_OFF);
|
||||
tellsoff = true;
|
||||
@@ -6886,10 +6904,10 @@ void Client::Handle_OP_GMToggle(const EQApplicationPacket *app)
|
||||
MessageString(Chat::White, TOGGLE_ON);
|
||||
tellsoff = false;
|
||||
} else {
|
||||
Message(Chat::White, "Unkown value in /toggle packet");
|
||||
Message(Chat::White, "Unknown value in /toggle packet.");
|
||||
}
|
||||
|
||||
UpdateWho();
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_GMTraining(const EQApplicationPacket *app)
|
||||
@@ -6899,6 +6917,7 @@ void Client::Handle_OP_GMTraining(const EQApplicationPacket *app)
|
||||
DumpPacket(app);
|
||||
return;
|
||||
}
|
||||
|
||||
OPGMTraining(app);
|
||||
return;
|
||||
}
|
||||
@@ -6910,6 +6929,7 @@ void Client::Handle_OP_GMTrainSkill(const EQApplicationPacket *app)
|
||||
DumpPacket(app);
|
||||
return;
|
||||
}
|
||||
|
||||
OPGMTrainSkill(app);
|
||||
return;
|
||||
}
|
||||
@@ -6920,27 +6940,30 @@ void Client::Handle_OP_GMZoneRequest(const EQApplicationPacket *app)
|
||||
std::cout << "Wrong size on OP_GMZoneRequest. Got: " << app->size << ", Expected: " << sizeof(GMZoneRequest_Struct) << std::endl;
|
||||
return;
|
||||
}
|
||||
if (Admin() < minStatusToBeGM) {
|
||||
|
||||
if (!GetGM()) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /zone"});
|
||||
return;
|
||||
}
|
||||
|
||||
auto* gmzr = (GMZoneRequest_Struct*)app->pBuffer;
|
||||
auto *gmzr = (GMZoneRequest_Struct *) app->pBuffer;
|
||||
float target_x = -1, target_y = -1, target_z = -1, target_heading;
|
||||
|
||||
int16 min_status = AccountStatus::Player;
|
||||
uint8 min_level = 0;
|
||||
char target_zone[32];
|
||||
uint16 zone_id = gmzr->zone_id;
|
||||
if (gmzr->zone_id == 0)
|
||||
int16 min_status = AccountStatus::Player;
|
||||
uint8 min_level = 0;
|
||||
char target_zone[32];
|
||||
uint16 zone_id = gmzr->zone_id;
|
||||
if (gmzr->zone_id == 0) {
|
||||
zone_id = zonesummon_id;
|
||||
}
|
||||
|
||||
const char* zone_short_name = ZoneName(zone_id);
|
||||
if (zone_short_name == nullptr)
|
||||
const char *zone_short_name = ZoneName(zone_id);
|
||||
if (zone_short_name == nullptr) {
|
||||
target_zone[0] = 0;
|
||||
else
|
||||
} else {
|
||||
strcpy(target_zone, zone_short_name);
|
||||
}
|
||||
|
||||
// this both loads the safe points and does a sanity check on zone name
|
||||
auto z = GetZone(target_zone, 0);
|
||||
@@ -6954,41 +6977,40 @@ void Client::Handle_OP_GMZoneRequest(const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
auto outapp = new EQApplicationPacket(OP_GMZoneRequest, sizeof(GMZoneRequest_Struct));
|
||||
auto* gmzr2 = (GMZoneRequest_Struct*)outapp->pBuffer;
|
||||
auto *gmzr2 = (GMZoneRequest_Struct *) outapp->pBuffer;
|
||||
strcpy(gmzr2->charname, GetName());
|
||||
gmzr2->zone_id = gmzr->zone_id;
|
||||
gmzr2->x = target_x;
|
||||
gmzr2->y = target_y;
|
||||
gmzr2->z = target_z;
|
||||
gmzr2->x = target_x;
|
||||
gmzr2->y = target_y;
|
||||
gmzr2->z = target_z;
|
||||
gmzr2->heading = target_heading;
|
||||
// Next line stolen from ZoneChange as well... - This gives us a nicer message than the normal "zone is down" message...
|
||||
if (target_zone[0] != 0 && admin >= min_status && GetLevel() >= min_level)
|
||||
|
||||
if (target_zone[0] != 0 && admin >= min_status && GetLevel() >= min_level) {
|
||||
gmzr2->success = 1;
|
||||
else {
|
||||
std::cout << "GetZoneSafeCoords failed. zoneid = " << gmzr->zone_id << "; czone = " << zone->GetZoneID() << std::endl;
|
||||
} else {
|
||||
LogError("GetZoneSafeCoords failed. Zone ID [{}] Current Zone [{}]", gmzr->zone_id, zone->GetZoneID());
|
||||
gmzr2->success = 0;
|
||||
}
|
||||
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_GMZoneRequest2(const EQApplicationPacket *app)
|
||||
{
|
||||
if (Admin() < minStatusToBeGM) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /zone"});
|
||||
return;
|
||||
}
|
||||
if (app->size < sizeof(uint32)) {
|
||||
LogError("OP size error: OP_GMZoneRequest2 expected:[{}] got:[{}]", sizeof(uint32), app->size);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GetGM()) {
|
||||
Message(Chat::Red, "Your account has been reported for hacking.");
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /zone"});
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 zonereq = *((uint32 *)app->pBuffer);
|
||||
GoToSafeCoords(zonereq, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_GroupAcknowledge(const EQApplicationPacket *app)
|
||||
@@ -8598,7 +8620,7 @@ void Client::Handle_OP_Hide(const EQApplicationPacket *app)
|
||||
hidden = true;
|
||||
tmHidden = Timer::GetCurrentTime();
|
||||
}
|
||||
if (GetClass() == ROGUE) {
|
||||
if (GetClass() == Class::Rogue) {
|
||||
auto outapp = new EQApplicationPacket(OP_SimpleMessage, sizeof(SimpleMessage_Struct));
|
||||
SimpleMessage_Struct *msg = (SimpleMessage_Struct *)outapp->pBuffer;
|
||||
msg->color = 0x010E;
|
||||
@@ -9147,7 +9169,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
|
||||
Bards on live can click items while casting spell gems, it stops that song cast and replaces it with item click cast.
|
||||
Can not click while casting other items.
|
||||
*/
|
||||
if (GetClass() == BARD && IsCasting() && casting_spell_slot < CastingSlot::MaxGems)
|
||||
if (GetClass() == Class::Bard && IsCasting() && casting_spell_slot < CastingSlot::MaxGems)
|
||||
{
|
||||
is_casting_bard_song = true;
|
||||
}
|
||||
@@ -9313,7 +9335,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
|
||||
if (!IsCastWhileInvisibleSpell(item->Click.Effect)) {
|
||||
CommonBreakInvisible(); // client can't do this for us :(
|
||||
}
|
||||
if (GetClass() == BARD){
|
||||
if (GetClass() == Class::Bard){
|
||||
DoBardCastingFromItemClick(is_casting_bard_song, item->CastTime, item->Click.Effect, target_id, CastingSlot::Item, slot_id, item->RecastType, item->RecastDelay);
|
||||
}
|
||||
else {
|
||||
@@ -9385,7 +9407,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
|
||||
if (!IsCastWhileInvisibleSpell(augitem->Click.Effect)) {
|
||||
CommonBreakInvisible(); // client can't do this for us :(
|
||||
}
|
||||
if (GetClass() == BARD) {
|
||||
if (GetClass() == Class::Bard) {
|
||||
DoBardCastingFromItemClick(is_casting_bard_song, augitem->CastTime, augitem->Click.Effect, target_id, CastingSlot::Item, slot_id, augitem->RecastType, augitem->RecastDelay);
|
||||
}
|
||||
else {
|
||||
@@ -9521,7 +9543,7 @@ void Client::Handle_OP_LDoNDisarmTraps(const EQApplicationPacket *app)
|
||||
void Client::Handle_OP_LDoNInspect(const EQApplicationPacket *app)
|
||||
{
|
||||
auto* t = GetTarget();
|
||||
if (t && t->GetClass() == LDON_TREASURE && !t->IsAura()) {
|
||||
if (t && t->GetClass() == Class::LDoNTreasure && !t->IsAura()) {
|
||||
if (parse->PlayerHasQuestSub(EVENT_INSPECT)) {
|
||||
std::vector<std::any> args = { t };
|
||||
if (parse->EventPlayer(EVENT_INSPECT, this, "", t->GetID(), &args) == 0) {
|
||||
@@ -9850,7 +9872,7 @@ void Client::Handle_OP_LFPCommand(const EQApplicationPacket *app)
|
||||
|
||||
for (unsigned int i = 0; i<MAX_GROUP_MEMBERS; i++) {
|
||||
LFPMembers[i].Name[0] = '\0';
|
||||
LFPMembers[i].Class = NO_CLASS;
|
||||
LFPMembers[i].Class = Class::None;
|
||||
LFPMembers[i].Level = 0;
|
||||
LFPMembers[i].Zone = 0;
|
||||
LFPMembers[i].GuildID = 0xFFFF;
|
||||
@@ -10191,7 +10213,7 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app)
|
||||
if (DistanceSquared(m_Position, tar->GetPosition()) > USE_NPC_RANGE2)
|
||||
return;
|
||||
|
||||
if (tar->GetClass() != MERCENARY_MASTER) {
|
||||
if (tar->GetClass() != Class::MercenaryLiaison) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10566,7 +10588,7 @@ void Client::Handle_OP_OpenGuildTributeMaster(const EQApplicationPacket *app)
|
||||
//Opens the guild tribute master window
|
||||
StartTribute_Struct* st = (StartTribute_Struct*)app->pBuffer;
|
||||
Mob* tribmast = entity_list.GetMob(st->tribute_master_id);
|
||||
if (tribmast && tribmast->IsNPC() && tribmast->GetClass() == GUILD_TRIBUTE_MASTER
|
||||
if (tribmast && tribmast->IsNPC() && tribmast->GetClass() == Class::GuildTributeMaster
|
||||
&& DistanceSquared(m_Position, tribmast->GetPosition()) <= USE_NPC_RANGE2) {
|
||||
st->response = 1;
|
||||
QueuePacket(app);
|
||||
@@ -10597,7 +10619,7 @@ void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app)
|
||||
//Opens the tribute master window
|
||||
StartTribute_Struct* st = (StartTribute_Struct*)app->pBuffer;
|
||||
Mob* tribmast = entity_list.GetMob(st->tribute_master_id);
|
||||
if (tribmast && tribmast->IsNPC() && tribmast->GetClass() == TRIBUTE_MASTER
|
||||
if (tribmast && tribmast->IsNPC() && tribmast->GetClass() == Class::TributeMaster
|
||||
&& DistanceSquared(m_Position, tribmast->GetPosition()) <= USE_NPC_RANGE2) {
|
||||
st->response = 1;
|
||||
QueuePacket(app);
|
||||
@@ -13503,7 +13525,7 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetClass() != WARRIOR){
|
||||
if (GetClass() != Class::Warrior){
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13559,7 +13581,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
|
||||
bool tmpmer_used = false;
|
||||
Mob* tmp = entity_list.GetMob(mp->npcid);
|
||||
|
||||
if (tmp == 0 || !tmp->IsNPC() || tmp->GetClass() != MERCHANT)
|
||||
if (tmp == 0 || !tmp->IsNPC() || tmp->GetClass() != Class::Merchant)
|
||||
return;
|
||||
|
||||
if (mp->quantity < 1) return;
|
||||
@@ -13868,7 +13890,7 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app)
|
||||
|
||||
Mob* vendor = entity_list.GetMob(mp->npcid);
|
||||
|
||||
if (vendor == 0 || !vendor->IsNPC() || vendor->GetClass() != MERCHANT)
|
||||
if (vendor == 0 || !vendor->IsNPC() || vendor->GetClass() != Class::Merchant)
|
||||
return;
|
||||
|
||||
//you have to be somewhat close to them to be properly using them
|
||||
@@ -14094,7 +14116,7 @@ void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app)
|
||||
int merchantid = 0;
|
||||
Mob* tmp = entity_list.GetMob(mc->npcid);
|
||||
|
||||
if (tmp == 0 || !tmp->IsNPC() || tmp->GetClass() != MERCHANT)
|
||||
if (tmp == 0 || !tmp->IsNPC() || tmp->GetClass() != Class::Merchant)
|
||||
return;
|
||||
|
||||
//you have to be somewhat close to them to be properly using them
|
||||
@@ -14201,7 +14223,7 @@ void Client::Handle_OP_Sneak(const EQApplicationPacket *app)
|
||||
sa_out->parameter = sneaking;
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
if (GetClass() == ROGUE) {
|
||||
if (GetClass() == Class::Rogue) {
|
||||
outapp = new EQApplicationPacket(OP_SimpleMessage, 12);
|
||||
SimpleMessage_Struct *msg = (SimpleMessage_Struct *)outapp->pBuffer;
|
||||
msg->color = 0x010E;
|
||||
@@ -15517,7 +15539,7 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app)
|
||||
tribute_master_id = t->tribute_master_id;
|
||||
//make sure they are dealing with a valid tribute master
|
||||
Mob* tribmast = entity_list.GetMob(t->tribute_master_id);
|
||||
if (!tribmast || !tribmast->IsNPC() || tribmast->GetClass() != TRIBUTE_MASTER)
|
||||
if (!tribmast || !tribmast->IsNPC() || tribmast->GetClass() != Class::TributeMaster)
|
||||
return;
|
||||
if (DistanceSquared(m_Position, tribmast->GetPosition()) > USE_NPC_RANGE2)
|
||||
return;
|
||||
@@ -15544,7 +15566,7 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app)
|
||||
tribute_master_id = t->tribute_master_id;
|
||||
//make sure they are dealing with a valid tribute master
|
||||
Mob* tribmast = entity_list.GetMob(t->tribute_master_id);
|
||||
if (!tribmast || !tribmast->IsNPC() || tribmast->GetClass() != TRIBUTE_MASTER)
|
||||
if (!tribmast || !tribmast->IsNPC() || tribmast->GetClass() != Class::TributeMaster)
|
||||
return;
|
||||
if (DistanceSquared(m_Position, tribmast->GetPosition()) > USE_NPC_RANGE2)
|
||||
return;
|
||||
|
||||
@@ -434,7 +434,7 @@ bool Client::Process() {
|
||||
}
|
||||
}
|
||||
|
||||
if (GetClass() == WARRIOR || GetClass() == BERSERKER) {
|
||||
if (GetClass() == Class::Warrior || GetClass() == Class::Berserker) {
|
||||
if (!dead && !IsBerserk() && GetHPRatio() < RuleI(Combat, BerserkerFrenzyStart)) {
|
||||
entity_list.MessageCloseString(this, false, 200, 0, BERSERK_START, GetName());
|
||||
berserk = true;
|
||||
@@ -1121,7 +1121,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
|
||||
if (
|
||||
m->scribing != memSpellForget &&
|
||||
(
|
||||
!EQ::ValueWithin(GetClass(), PLAYER_CLASS_WARRIOR, PLAYER_CLASS_BERSERKER) ||
|
||||
!IsPlayerClass(GetClass()) ||
|
||||
GetLevel() < spells[m->spell_id].classes[GetClass() - 1]
|
||||
)
|
||||
) {
|
||||
@@ -1552,12 +1552,12 @@ void Client::OPGMTraining(const EQApplicationPacket *app)
|
||||
|
||||
Mob* pTrainer = entity_list.GetMob(gmtrain->npcid);
|
||||
|
||||
if(!pTrainer || !pTrainer->IsNPC() || pTrainer->GetClass() < WARRIORGM || pTrainer->GetClass() > BERSERKERGM)
|
||||
if(!pTrainer || !pTrainer->IsNPC() || pTrainer->GetClass() < Class::WarriorGM || pTrainer->GetClass() > Class::BerserkerGM)
|
||||
return;
|
||||
|
||||
//you can only use your own trainer, client enforces this, but why trust it
|
||||
if (!RuleB(Character, AllowCrossClassTrainers)) {
|
||||
int trains_class = pTrainer->GetClass() - (WARRIORGM - WARRIOR);
|
||||
int trains_class = pTrainer->GetClass() - (Class::WarriorGM - Class::Warrior);
|
||||
if (GetClass() != trains_class)
|
||||
return;
|
||||
}
|
||||
@@ -1579,7 +1579,7 @@ void Client::OPGMTraining(const EQApplicationPacket *app)
|
||||
}
|
||||
}
|
||||
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF2 && GetClass() == BERSERKER) {
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF2 && GetClass() == Class::Berserker) {
|
||||
gmtrain->skills[EQ::skills::Skill1HPiercing] = gmtrain->skills[EQ::skills::Skill2HPiercing];
|
||||
gmtrain->skills[EQ::skills::Skill2HPiercing] = 0;
|
||||
}
|
||||
@@ -1607,12 +1607,12 @@ void Client::OPGMEndTraining(const EQApplicationPacket *app)
|
||||
FastQueuePacket(&outapp);
|
||||
|
||||
Mob* pTrainer = entity_list.GetMob(p->npcid);
|
||||
if(!pTrainer || !pTrainer->IsNPC() || pTrainer->GetClass() < WARRIORGM || pTrainer->GetClass() > BERSERKERGM)
|
||||
if(!pTrainer || !pTrainer->IsNPC() || pTrainer->GetClass() < Class::WarriorGM || pTrainer->GetClass() > Class::BerserkerGM)
|
||||
return;
|
||||
|
||||
//you can only use your own trainer, client enforces this, but why trust it
|
||||
if (!RuleB(Character, AllowCrossClassTrainers)) {
|
||||
int trains_class = pTrainer->GetClass() - (WARRIORGM - WARRIOR);
|
||||
int trains_class = pTrainer->GetClass() - (Class::WarriorGM - Class::Warrior);
|
||||
if (GetClass() != trains_class)
|
||||
return;
|
||||
}
|
||||
@@ -1638,12 +1638,12 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app)
|
||||
GMSkillChange_Struct* gmskill = (GMSkillChange_Struct*) app->pBuffer;
|
||||
|
||||
Mob* pTrainer = entity_list.GetMob(gmskill->npcid);
|
||||
if(!pTrainer || !pTrainer->IsNPC() || pTrainer->GetClass() < WARRIORGM || pTrainer->GetClass() > BERSERKERGM)
|
||||
if(!pTrainer || !pTrainer->IsNPC() || pTrainer->GetClass() < Class::WarriorGM || pTrainer->GetClass() > Class::BerserkerGM)
|
||||
return;
|
||||
|
||||
//you can only use your own trainer, client enforces this, but why trust it
|
||||
if (!RuleB(Character, AllowCrossClassTrainers)) {
|
||||
int trains_class = pTrainer->GetClass() - (WARRIORGM - WARRIOR);
|
||||
int trains_class = pTrainer->GetClass() - (Class::WarriorGM - Class::Warrior);
|
||||
if (GetClass() != trains_class)
|
||||
return;
|
||||
}
|
||||
|
||||
+4
-1
@@ -1,7 +1,7 @@
|
||||
#include <string.h>
|
||||
#include <algorithm>
|
||||
#include <thread>
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/core.h>
|
||||
#include "../common/repositories/command_subsettings_repository.h"
|
||||
|
||||
#ifdef _WINDOWS
|
||||
@@ -217,6 +217,7 @@ int command_init(void)
|
||||
command_add("summonitem", "[itemid] [charges] - Summon an item onto your cursor. Charges are optional.", AccountStatus::GMMgmt, command_summonitem) ||
|
||||
command_add("suspend", "[name] [days] [reason] - Suspend by character name and for specificed number of days", AccountStatus::GMLeadAdmin, command_suspend) ||
|
||||
command_add("suspendmulti", "[Character Name One|Character Name Two|etc] [Days] [Reason] - Suspend multiple characters by name for specified number of days", AccountStatus::GMLeadAdmin, command_suspendmulti) ||
|
||||
command_add("takeplatinum", "[Platinum] - Takes specified amount of platinum from you or your player target", AccountStatus::GMMgmt, command_takeplatinum) ||
|
||||
command_add("task", "(subcommand) - Task system commands", AccountStatus::GMLeadAdmin, command_task) ||
|
||||
command_add("petname", "[newname] - Temporarily renames your pet. Leave name blank to restore the original name.", AccountStatus::GMAdmin, command_petname) ||
|
||||
command_add("traindisc", "[level] - Trains all the disciplines usable by the target, up to level specified. (may freeze client for a few seconds)", AccountStatus::GMLeadAdmin, command_traindisc) ||
|
||||
@@ -865,6 +866,7 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/nukebuffs.cpp"
|
||||
#include "gm_commands/nukeitem.cpp"
|
||||
#include "gm_commands/object.cpp"
|
||||
#include "gm_commands/object_manipulation.cpp"
|
||||
#include "gm_commands/path.cpp"
|
||||
#include "gm_commands/peqzone.cpp"
|
||||
#include "gm_commands/petitems.cpp"
|
||||
@@ -903,6 +905,7 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/summonitem.cpp"
|
||||
#include "gm_commands/suspend.cpp"
|
||||
#include "gm_commands/suspendmulti.cpp"
|
||||
#include "gm_commands/takeplatinum.cpp"
|
||||
#include "gm_commands/task.cpp"
|
||||
#include "gm_commands/traindisc.cpp"
|
||||
#include "gm_commands/tune.cpp"
|
||||
|
||||
@@ -168,6 +168,7 @@ void command_summonburiedplayercorpse(Client *c, const Seperator *sep);
|
||||
void command_summonitem(Client *c, const Seperator *sep);
|
||||
void command_suspend(Client *c, const Seperator *sep);
|
||||
void command_suspendmulti(Client *c, const Seperator *sep);
|
||||
void command_takeplatinum(Client* c, const Seperator* sep);
|
||||
void command_task(Client *c, const Seperator *sep);
|
||||
void command_petname(Client *c, const Seperator *sep);
|
||||
void command_traindisc(Client *c, const Seperator *sep);
|
||||
|
||||
+1
-1
@@ -277,7 +277,7 @@ void Doors::HandleClick(Client *sender, uint8 trigger)
|
||||
// enforce flags before they hit zoning process
|
||||
auto z = GetZone(m_destination_zone_name, 0);
|
||||
if (z && !z->flag_needed.empty() && Strings::IsNumber(z->flag_needed) && Strings::ToInt(z->flag_needed) == 1) {
|
||||
if (sender->Admin() < minStatusToIgnoreZoneFlags && !sender->HasZoneFlag(z->zoneidnumber)) {
|
||||
if (!sender->GetGM() && !sender->HasZoneFlag(z->zoneidnumber)) {
|
||||
LogInfo(
|
||||
"Character [{}] does not have the flag to be in this zone [{}]!",
|
||||
sender->GetCleanName(),
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "expedition.h"
|
||||
#include "string_ids.h"
|
||||
#include "worldserver.h"
|
||||
#include <fmt/format.h>
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user