mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 09:06:46 +00:00
Compare commits
110 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 | |||
| 2237c3a056 | |||
| 4af191c593 | |||
| 0a3972deb9 | |||
| 9d2f258390 | |||
| 0b452f4ec1 | |||
| fef629e1df | |||
| a5a51fbe44 | |||
| 47db92cdb6 | |||
| 690301e80d | |||
| 1887e48b76 | |||
| af2691eb12 | |||
| 2df4289588 | |||
| 49d4d0acc3 | |||
| 5a663910a5 | |||
| b027edd21e | |||
| 0bbfcf7adc | |||
| 7962a0bd38 | |||
| 4d9b51df0a | |||
| 508ecec6ea | |||
| f0c6fa2a26 | |||
| ad6dbb7beb | |||
| 6ddbb41617 | |||
| 8a558f6a29 | |||
| 0585be0360 | |||
| 6927baef7f | |||
| 52d64781b5 | |||
| 0667fe435f | |||
| 9959070f24 | |||
| 2a91f08845 | |||
| adc64005f1 | |||
| 605480f1c4 | |||
| 3b95601c62 | |||
| a4f2ed28f1 | |||
| e19b969541 | |||
| 4241556f75 | |||
| 961332b40c | |||
| a1a861e0c4 | |||
| 4bbb1aa92f | |||
| 1212ccefef | |||
| c203fec9b4 | |||
| 16ab1839e8 | |||
| f5e4c6a127 | |||
| 166c87c931 | |||
| 345dd442dd | |||
| 565baec675 | |||
| 9884c442e9 | |||
| ad0b5d6a1c | |||
| b82b32e1d2 | |||
| 2fb72e5729 | |||
| 3791bc788f | |||
| 833fa55fdf | |||
| 4fc3c27715 | |||
| cea3ad6a42 | |||
| d8926cd5f3 | |||
| efb03164c7 | |||
| 455eb2e6d9 | |||
| b5b0e53da2 | |||
| 68cb94b39c | |||
| 3d95b6c184 | |||
| 7db7631308 | |||
| f053cd3b56 | |||
| cf27f2bc88 | |||
| 79918ebaba | |||
| 2a648507f2 | |||
| f395ee0508 |
+1
-1
@@ -15,7 +15,7 @@ volumes:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Build Linux X64
|
- name: Build Linux X64
|
||||||
image: akkadius/eqemu-server:v11
|
image: akkadius/eqemu-server:v13
|
||||||
environment:
|
environment:
|
||||||
GITHUB_TOKEN:
|
GITHUB_TOKEN:
|
||||||
from_secret: GH_RELEASE_GITHUB_API_TOKEN
|
from_secret: GH_RELEASE_GITHUB_API_TOKEN
|
||||||
|
|||||||
+305
@@ -1,3 +1,308 @@
|
|||||||
|
## [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
|
||||||
|
|
||||||
|
* Hotfix issue with blocked spells not loading properly @Akkadius 2023-10-31
|
||||||
|
|
||||||
|
## [22.31.0] - 10/29/2023
|
||||||
|
|
||||||
|
### Crash
|
||||||
|
|
||||||
|
* Fix crash when client pointer does not exist during #hotfix ([#3661](https://github.com/EQEmu/Server/pull/3661)) @Akkadius 2023-10-29
|
||||||
|
* Fix spell in AESpell related to beacons ([#3659](https://github.com/EQEmu/Server/pull/3659)) @Akkadius 2023-10-29
|
||||||
|
|
||||||
|
### Database
|
||||||
|
|
||||||
|
* Add id to variables table ([#3658](https://github.com/EQEmu/Server/pull/3658)) @Akkadius 2023-10-29
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
|
||||||
|
* Add symbols to release builds ([#3660](https://github.com/EQEmu/Server/pull/3660)) @Akkadius 2023-10-29
|
||||||
|
|
||||||
|
### Perl
|
||||||
|
|
||||||
|
* Revert " Reload perl quests on zone bootup " ([#3648](https://github.com/EQEmu/Server/pull/3648)) @Akkadius 2023-10-26
|
||||||
|
|
||||||
|
### Trading
|
||||||
|
|
||||||
|
* Fix part 3 of Issue 932. ([#3654](https://github.com/EQEmu/Server/pull/3654)) @noudess 2023-10-29
|
||||||
|
|
||||||
|
## [22.30.2] - 10/26/2023
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
Revert Perl regression in #3648 causing scripts to not reliably initialize on zone bootup. @Akkadius 2023-10-26
|
||||||
|
|
||||||
|
## [22.30.1] - 10/24/2023
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Fix empty InsertMany in bot starting items. ([#3653](https://github.com/EQEmu/Server/pull/3653)) @Kinglykrab 2023-10-24
|
||||||
|
|
||||||
|
## [22.30.0] - 10/23/2023
|
||||||
|
|
||||||
|
### API
|
||||||
|
|
||||||
|
* Implement Zone Sidecar ([#3635](https://github.com/EQEmu/Server/pull/3635)) @Akkadius 2023-10-24
|
||||||
|
|
||||||
|
### Commands
|
||||||
|
|
||||||
|
* Move #suspend from content database ([#3651](https://github.com/EQEmu/Server/pull/3651)) @joligario 2023-10-24
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Fix Bot Starting Items SQL ([#3649](https://github.com/EQEmu/Server/pull/3649)) @Kinglykrab 2023-10-23
|
||||||
|
|
||||||
|
### Perl
|
||||||
|
|
||||||
|
* Implement eqemu-perl for Linux ([#3652](https://github.com/EQEmu/Server/pull/3652)) @Akkadius 2023-10-24
|
||||||
|
* Reload perl quests on zone bootup ([#3648](https://github.com/EQEmu/Server/pull/3648)) @hgtw 2023-10-24
|
||||||
|
|
||||||
|
### Pets
|
||||||
|
|
||||||
|
* Disallow effect of alliance line when cast on pets. ([#3650](https://github.com/EQEmu/Server/pull/3650)) @noudess 2023-10-24
|
||||||
|
|
||||||
|
## [22.29.1] - 10/21/2023
|
||||||
|
|
||||||
|
### DB
|
||||||
|
|
||||||
|
* Fix manifest for blocked spells ([#3646](https://github.com/EQEmu/Server/pull/3646)) @joligario 2023-10-21
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Fix issue with subcommand settings not working ([#3643](https://github.com/EQEmu/Server/pull/3643)) @Kinglykrab 2023-10-21
|
||||||
|
* Hotfix command without hotfix name ([#3644](https://github.com/EQEmu/Server/pull/3644)) @joligario 2023-10-21
|
||||||
|
* Verifying mail keys when none exist ([#3645](https://github.com/EQEmu/Server/pull/3645)) @joligario 2023-10-21
|
||||||
|
|
||||||
|
## [22.29.0] - 10/20/2023
|
||||||
|
|
||||||
|
### Feature
|
||||||
|
|
||||||
|
* Add Expansion and Content Flag support to Blocked Spells ([#3638](https://github.com/EQEmu/Server/pull/3638)) @Kinglykrab 2023-10-20
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Fix crash when checking Bot Group/Raid membership ([#3641](https://github.com/EQEmu/Server/pull/3641)) @Aeadoin 2023-10-20
|
||||||
|
|
||||||
|
### Perl
|
||||||
|
|
||||||
|
* Static linker fix on Linux ([#3642](https://github.com/EQEmu/Server/pull/3642)) @Akkadius 2023-10-20
|
||||||
|
|
||||||
|
### Rules
|
||||||
|
|
||||||
|
* Add rule to configure max number of procs per round Combat:MaxProcs ([#3640](https://github.com/EQEmu/Server/pull/3640)) @Akkadius 2023-10-20
|
||||||
|
|
||||||
|
## [22.28.1] - 10/20/2023
|
||||||
|
|
||||||
|
### Build
|
||||||
|
|
||||||
|
* Perl Linux build fix
|
||||||
|
|
||||||
|
## [22.28.0] - 10/15/2023
|
||||||
|
|
||||||
|
### Bots
|
||||||
|
|
||||||
|
* Adjust Bot Movement Speed ([#3615](https://github.com/EQEmu/Server/pull/3615)) @Kinglykrab 2023-10-14
|
||||||
|
* Fix bot removal on zone, regression from #3611 ([#3631](https://github.com/EQEmu/Server/pull/3631)) @Akkadius 2023-10-16
|
||||||
|
|
||||||
|
### Crash
|
||||||
|
|
||||||
|
* Fix Crash with #summon ([#3618](https://github.com/EQEmu/Server/pull/3618)) @Kinglykrab 2023-10-14
|
||||||
|
* Fix crash in Mob::ShowBuffs ([#3632](https://github.com/EQEmu/Server/pull/3632)) @Akkadius 2023-10-16
|
||||||
|
* Resolve crash when assigning empty raid note. ([#3628](https://github.com/EQEmu/Server/pull/3628)) @Aeadoin 2023-10-15
|
||||||
|
|
||||||
|
### Feature
|
||||||
|
|
||||||
|
* Add Extra Kick Classes ([#3613](https://github.com/EQEmu/Server/pull/3613)) @Kinglykrab 2023-10-11
|
||||||
|
* Add Immune to Assassinate Special Ability ([#3622](https://github.com/EQEmu/Server/pull/3622)) @Kinglykrab 2023-10-14
|
||||||
|
* Add Immune to Headshot Special Ability ([#3624](https://github.com/EQEmu/Server/pull/3624)) @Kinglykrab 2023-10-14
|
||||||
|
* Update Raid Functions for Titanium and Underfoot ([#3524](https://github.com/EQEmu/Server/pull/3524)) @neckkola 2023-10-14
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Fix #cast defaulting to cast time ([#3617](https://github.com/EQEmu/Server/pull/3617)) @Kinglykrab 2023-10-14
|
||||||
|
|
||||||
|
### Parser Fix
|
||||||
|
|
||||||
|
* Fix SendIllusion Spire parsing ([#3623](https://github.com/EQEmu/Server/pull/3623)) @Kinglykrab 2023-10-14
|
||||||
|
|
||||||
|
### Quest API
|
||||||
|
|
||||||
|
* Add GrantAllAAPoints() to Perl/Lua and Modify #grantaa ([#3616](https://github.com/EQEmu/Server/pull/3616)) @Kinglykrab 2023-10-14
|
||||||
|
* Add target ID and spell exports to events ([#3620](https://github.com/EQEmu/Server/pull/3620)) @Kinglykrab 2023-10-15
|
||||||
|
|
||||||
|
### Scripts
|
||||||
|
|
||||||
|
* Update 13th Floor importer ([#3630](https://github.com/EQEmu/Server/pull/3630)) @joligario 2023-10-16
|
||||||
|
* Update 13th Floor script for legacy research tome bagtypes ([#3621](https://github.com/EQEmu/Server/pull/3621)) @joligario 2023-10-14
|
||||||
|
|
||||||
|
## [22.27.0] - 10/07/2023
|
||||||
|
|
||||||
|
### Crash
|
||||||
|
|
||||||
|
* Bot member zoned crash fix ([#3607](https://github.com/EQEmu/Server/pull/3607)) @Akkadius 2023-10-07
|
||||||
|
* Fix #summon crash ([#3608](https://github.com/EQEmu/Server/pull/3608)) @Akkadius 2023-10-07
|
||||||
|
* Fix CanUseAlternateAdvancementRank crash ([#3609](https://github.com/EQEmu/Server/pull/3609)) @Akkadius 2023-10-07
|
||||||
|
* Fix crash in #movechar ([#3612](https://github.com/EQEmu/Server/pull/3612)) @Akkadius 2023-10-07
|
||||||
|
* Fix crash in CastSpell Quest API input cast ([#3610](https://github.com/EQEmu/Server/pull/3610)) @Akkadius 2023-10-07
|
||||||
|
* Fix dangling pointer crash observed in SendHPPacketsFrom ([#3611](https://github.com/EQEmu/Server/pull/3611)) @Akkadius 2023-10-07
|
||||||
|
* Fix rarer crash with File::Makedir ([#3606](https://github.com/EQEmu/Server/pull/3606)) @Akkadius 2023-10-07
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Add Validation to #find, #set, and #show args ([#3598](https://github.com/EQEmu/Server/pull/3598)) @Kinglykrab 2023-09-18
|
||||||
|
* Ensure Linux builds report failures @Akkadius 2023-10-03
|
||||||
|
* Fix #show group_info Popup ([#3605](https://github.com/EQEmu/Server/pull/3605)) @Kinglykrab 2023-10-04
|
||||||
|
* Fix swarm pet names to use '_' instead of ' ' ([#3601](https://github.com/EQEmu/Server/pull/3601)) @noudess 2023-09-19
|
||||||
|
* Invis vs. Undead/Animal Breaks Charm for Pets ([#3587](https://github.com/EQEmu/Server/pull/3587)) @crdunwel 2023-09-19
|
||||||
|
|
||||||
|
### Logs
|
||||||
|
|
||||||
|
* Change pathing log messages from Error to Pathing. ([#3604](https://github.com/EQEmu/Server/pull/3604)) @joligario 2023-09-29
|
||||||
|
|
||||||
|
### Quest API
|
||||||
|
|
||||||
|
* Add Caster ID Parameter to FindBuff in Perl/Lua ([#3590](https://github.com/EQEmu/Server/pull/3590)) @Kinglykrab 2023-09-29
|
||||||
|
|
||||||
## [22.26.2] - 09/18/2023
|
## [22.26.2] - 09/18/2023
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|||||||
+16
-1
@@ -23,7 +23,12 @@ IF (EQEMU_BUILD_STATIC)
|
|||||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".a")
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".a")
|
||||||
MESSAGE(STATUS "Building with static linking")
|
MESSAGE(STATUS "Building with static linking")
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
|
SET(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
|
||||||
ENDIF(EQEMU_BUILD_STATIC)
|
IF (UNIX)
|
||||||
|
SET(PERL_LIBRARY "/opt/eqemu-perl/lib/5.32.1/x86_64-linux-thread-multi/CORE/libperl.so")
|
||||||
|
SET(PERL_INCLUDE_PATH "/opt/eqemu-perl/lib/5.32.1/x86_64-linux-thread-multi/CORE/")
|
||||||
|
SET(PERL_EXECUTABLE "/opt/eqemu-perl/bin/perl")
|
||||||
|
ENDIF ()
|
||||||
|
ENDIF (EQEMU_BUILD_STATIC)
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
@@ -133,6 +138,13 @@ ELSE()
|
|||||||
MESSAGE(STATUS "* mbedTLS: MISSING *")
|
MESSAGE(STATUS "* mbedTLS: MISSING *")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
MESSAGE(STATUS "PERL_INCLUDE_PATH: ${PERL_INCLUDE_PATH}")
|
||||||
|
MESSAGE(STATUS "PERL_LIBRARY: ${PERL_LIBRARY}")
|
||||||
|
MESSAGE(STATUS "PERL_INCLUDE_DIR: ${PERL_INCLUDE_DIR}")
|
||||||
|
MESSAGE(STATUS "PERL_INCLUDE_DIRS: ${PERL_INCLUDE_DIRS}")
|
||||||
|
MESSAGE(STATUS "PERL_LIBRARIES: ${PERL_LIBRARIES}")
|
||||||
|
MESSAGE(STATUS "PERL_VERSION: ${PERL_VERSION}")
|
||||||
|
|
||||||
MESSAGE(STATUS "**************************************************")
|
MESSAGE(STATUS "**************************************************")
|
||||||
|
|
||||||
#options
|
#options
|
||||||
@@ -389,6 +401,9 @@ IF(PERL_LIBRARY_ENABLED)
|
|||||||
ADD_DEFINITIONS(-DEMBPERL)
|
ADD_DEFINITIONS(-DEMBPERL)
|
||||||
ADD_DEFINITIONS(-DEMBPERL_PLUGIN)
|
ADD_DEFINITIONS(-DEMBPERL_PLUGIN)
|
||||||
ADD_DEFINITIONS(-DPERLBIND_NO_STRICT_SCALAR_TYPES)
|
ADD_DEFINITIONS(-DPERLBIND_NO_STRICT_SCALAR_TYPES)
|
||||||
|
IF (UNIX AND EQEMU_BUILD_STATIC)
|
||||||
|
SET(SERVER_LIBS ${SERVER_LIBS} libcrypt.a)
|
||||||
|
ENDIF ()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ SET(common_sources
|
|||||||
perl_eqdb.cpp
|
perl_eqdb.cpp
|
||||||
perl_eqdb_res.cpp
|
perl_eqdb_res.cpp
|
||||||
process/process.cpp
|
process/process.cpp
|
||||||
|
process.cpp
|
||||||
proc_launcher.cpp
|
proc_launcher.cpp
|
||||||
profanity_manager.cpp
|
profanity_manager.cpp
|
||||||
ptimer.cpp
|
ptimer.cpp
|
||||||
@@ -90,6 +91,7 @@ SET(common_sources
|
|||||||
timer.cpp
|
timer.cpp
|
||||||
unix.cpp
|
unix.cpp
|
||||||
platform.cpp
|
platform.cpp
|
||||||
|
json/json.hpp
|
||||||
json/jsoncpp.cpp
|
json/jsoncpp.cpp
|
||||||
zone_store.cpp
|
zone_store.cpp
|
||||||
net/console_server.cpp
|
net/console_server.cpp
|
||||||
@@ -583,12 +585,14 @@ SET(common_headers
|
|||||||
path_manager.cpp
|
path_manager.cpp
|
||||||
platform.h
|
platform.h
|
||||||
process/process.h
|
process/process.h
|
||||||
|
process.h
|
||||||
proc_launcher.h
|
proc_launcher.h
|
||||||
profanity_manager.h
|
profanity_manager.h
|
||||||
profiler.h
|
profiler.h
|
||||||
ptimer.h
|
ptimer.h
|
||||||
queue.h
|
queue.h
|
||||||
races.h
|
races.h
|
||||||
|
raid.h
|
||||||
random.h
|
random.h
|
||||||
rdtsc.h
|
rdtsc.h
|
||||||
rulesys.h
|
rulesys.h
|
||||||
|
|||||||
@@ -39,15 +39,15 @@ namespace EQEmuCommand {
|
|||||||
{
|
{
|
||||||
if (cmd[{"-d", "--debug"}]) {
|
if (cmd[{"-d", "--debug"}]) {
|
||||||
std::cout << "Positional args:\n";
|
std::cout << "Positional args:\n";
|
||||||
for (auto &pos_arg : cmd.pos_args())
|
for (auto &pos_arg: cmd.pos_args())
|
||||||
std::cout << '\t' << pos_arg << std::endl;
|
std::cout << '\t' << pos_arg << std::endl;
|
||||||
|
|
||||||
std::cout << "\nFlags:\n";
|
std::cout << "\nFlags:\n";
|
||||||
for (auto &flag : cmd.flags())
|
for (auto &flag: cmd.flags())
|
||||||
std::cout << '\t' << flag << std::endl;
|
std::cout << '\t' << flag << std::endl;
|
||||||
|
|
||||||
std::cout << "\nParameters:\n";
|
std::cout << "\nParameters:\n";
|
||||||
for (auto ¶m : cmd.params())
|
for (auto ¶m: cmd.params())
|
||||||
std::cout << '\t' << param.first << " : " << param.second << std::endl;
|
std::cout << '\t' << param.first << " : " << param.second << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,7 @@ namespace EQEmuCommand {
|
|||||||
bool arguments_filled = true;
|
bool arguments_filled = true;
|
||||||
|
|
||||||
int index = 2;
|
int index = 2;
|
||||||
for (auto &arg : arguments) {
|
for (auto &arg: arguments) {
|
||||||
if (cmd(arg).str().empty() && cmd(index).str().empty()) {
|
if (cmd(arg).str().empty() && cmd(index).str().empty()) {
|
||||||
arguments_filled = false;
|
arguments_filled = false;
|
||||||
}
|
}
|
||||||
@@ -79,12 +79,12 @@ namespace EQEmuCommand {
|
|||||||
|
|
||||||
if (!arguments_filled || (argc == 2 && !cmd[{"-h", "--help"}]) || (argc == 3 && cmd[{"-h", "--help"}])) {
|
if (!arguments_filled || (argc == 2 && !cmd[{"-h", "--help"}]) || (argc == 3 && cmd[{"-h", "--help"}])) {
|
||||||
std::string arguments_string;
|
std::string arguments_string;
|
||||||
for (auto &arg : arguments) {
|
for (auto &arg: arguments) {
|
||||||
arguments_string += " " + arg;
|
arguments_string += " " + arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string options_string;
|
std::string options_string;
|
||||||
for (auto &opt : options) {
|
for (auto &opt: options) {
|
||||||
options_string += " " + opt + "\n";
|
options_string += " " + opt + "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,14 +124,6 @@ namespace EQEmuCommand {
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
std::string description;
|
std::string description;
|
||||||
bool ran_command = false;
|
|
||||||
for (auto &it: in_function_map) {
|
|
||||||
if (it.first == argv[1]) {
|
|
||||||
(it.second)(argc, argv, cmd, description);
|
|
||||||
ran_command = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cmd[{"-h", "--help"}]) {
|
if (cmd[{"-h", "--help"}]) {
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
std::cout <<
|
std::cout <<
|
||||||
@@ -142,9 +134,7 @@ namespace EQEmuCommand {
|
|||||||
<< std::endl
|
<< std::endl
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
/**
|
// Get max command length for padding length
|
||||||
* Get max command length for padding length
|
|
||||||
*/
|
|
||||||
int max_command_length = 0;
|
int max_command_length = 0;
|
||||||
|
|
||||||
for (auto &it: in_function_map) {
|
for (auto &it: in_function_map) {
|
||||||
@@ -155,18 +145,14 @@ namespace EQEmuCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// Display command menu
|
||||||
* Display command menu
|
|
||||||
*/
|
|
||||||
std::string command_section;
|
std::string command_section;
|
||||||
for (auto &it: in_function_map) {
|
for (auto &it: in_function_map) {
|
||||||
description.clear();
|
description.clear();
|
||||||
|
|
||||||
(it.second)(argc, argv, cmd, description);
|
(it.second)(argc, argv, cmd, description);
|
||||||
|
|
||||||
/**
|
// Print section header
|
||||||
* Print section header
|
|
||||||
*/
|
|
||||||
std::string command_prefix = it.first.substr(0, it.first.find(":"));
|
std::string command_prefix = it.first.substr(0, it.first.find(":"));
|
||||||
|
|
||||||
if (command_prefix.find("test") != std::string::npos) {
|
if (command_prefix.find("test") != std::string::npos) {
|
||||||
@@ -178,9 +164,7 @@ namespace EQEmuCommand {
|
|||||||
std::cout << termcolor::reset << command_prefix << std::endl;
|
std::cout << termcolor::reset << command_prefix << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// Print commands
|
||||||
* Print commands
|
|
||||||
*/
|
|
||||||
std::stringstream command;
|
std::stringstream command;
|
||||||
command << termcolor::colorize << termcolor::yellow << it.first << termcolor::reset;
|
command << termcolor::colorize << termcolor::yellow << it.first << termcolor::reset;
|
||||||
printf(" %-*s %s\n", max_command_length, command.str().c_str(), description.c_str());
|
printf(" %-*s %s\n", max_command_length, command.str().c_str(), description.c_str());
|
||||||
@@ -191,6 +175,15 @@ namespace EQEmuCommand {
|
|||||||
std::exit(0);
|
std::exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ran_command = false;
|
||||||
|
|
||||||
|
for (auto &it: in_function_map) {
|
||||||
|
if (it.first == argv[1]) {
|
||||||
|
(it.second)(argc, argv, cmd, description);
|
||||||
|
ran_command = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ran_command) {
|
if (ran_command) {
|
||||||
std::exit(0);
|
std::exit(0);
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-17
@@ -2097,37 +2097,45 @@ void Database::ClearInvSnapshots(bool from_now) {
|
|||||||
|
|
||||||
struct TimeOfDay_Struct Database::LoadTime(time_t &realtime)
|
struct TimeOfDay_Struct Database::LoadTime(time_t &realtime)
|
||||||
{
|
{
|
||||||
|
TimeOfDay_Struct t{};
|
||||||
TimeOfDay_Struct eqTime;
|
|
||||||
std::string query = StringFormat("SELECT minute,hour,day,month,year,realtime FROM eqtime limit 1");
|
std::string query = StringFormat("SELECT minute,hour,day,month,year,realtime FROM eqtime limit 1");
|
||||||
auto results = QueryDatabase(query);
|
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");
|
LogInfo("Loading EQ time of day failed. Using defaults");
|
||||||
eqTime.minute = 0;
|
t.minute = 0;
|
||||||
eqTime.hour = 9;
|
t.hour = 9;
|
||||||
eqTime.day = 1;
|
t.day = 1;
|
||||||
eqTime.month = 1;
|
t.month = 1;
|
||||||
eqTime.year = 3100;
|
t.year = 3100;
|
||||||
realtime = time(nullptr);
|
realtime = time(nullptr);
|
||||||
|
return t;
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
|
|
||||||
eqTime.minute = Strings::ToUnsignedInt(row[0]);
|
uint8 hour = Strings::ToUnsignedInt(row[1]);
|
||||||
eqTime.hour = Strings::ToUnsignedInt(row[1]);
|
time_t realtime_ = Strings::ToBigInt(row[5]);
|
||||||
eqTime.day = Strings::ToUnsignedInt(row[2]);
|
if (RuleI(World, BootHour) > 0 && RuleI(World, BootHour) <= 24) {
|
||||||
eqTime.month = Strings::ToUnsignedInt(row[3]);
|
hour = RuleI(World, BootHour);
|
||||||
eqTime.year = Strings::ToUnsignedInt(row[4]);
|
realtime_ = time(nullptr);
|
||||||
realtime = Strings::ToBigInt(row[5]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return eqTime;
|
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)
|
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);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
return results.Success();
|
return results.Success();
|
||||||
|
|||||||
@@ -4943,7 +4943,93 @@ ALTER TABLE `aa_ability` ADD COLUMN `auto_grant_enabled` TINYINT(4) NOT NULL DEF
|
|||||||
UPDATE `aa_ability` SET `auto_grant_enabled` = 1 WHERE `grant_only` = 0 AND `charges` = 0 AND `category` = -1;
|
UPDATE `aa_ability` SET `auto_grant_enabled` = 1 WHERE `grant_only` = 0 AND `charges` = 0 AND `category` = -1;
|
||||||
)"
|
)"
|
||||||
},
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9237,
|
||||||
|
.description = "2023_10_15_import_13th_floor.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `items` LIKE 'bardeffect';",
|
||||||
|
.condition = "contains",
|
||||||
|
.match = "mediumint",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `items`
|
||||||
|
MODIFY COLUMN `scriptfileid` MEDIUMINT(6) NOT NULL DEFAULT 0,
|
||||||
|
MODIFY COLUMN `powersourcecapacity` MEDIUMINT(7) NOT NULL DEFAULT 0,
|
||||||
|
MODIFY COLUMN `augdistiller` INT(11) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
MODIFY COLUMN `scrollunk1` INT(11) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
MODIFY COLUMN `bardeffect` MEDIUMINT(6) NOT NULL DEFAULT 0;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9238,
|
||||||
|
.description = "2023_10_18_tradeskill_add_learned_by_item_id.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `tradeskill_recipe` LIKE 'learned_by_item_id'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `tradeskill_recipe`
|
||||||
|
ADD COLUMN `learned_by_item_id` int(11) NOT NULL DEFAULT 0 AFTER `must_learn`;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9239,
|
||||||
|
.description = "2023_10_18_blocked_spells_expansions_content_flags.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `blocked_spells` LIKE 'min_expansion'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `blocked_spells`
|
||||||
|
ADD COLUMN `min_expansion` tinyint(4) NOT NULL DEFAULT -1 AFTER `description`,
|
||||||
|
ADD COLUMN `max_expansion` tinyint(4) NOT NULL DEFAULT -1 AFTER `min_expansion`,
|
||||||
|
ADD COLUMN `content_flags` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL AFTER `max_expansion`,
|
||||||
|
ADD COLUMN `content_flags_disabled` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL AFTER `content_flags`;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9240,
|
||||||
|
.description = "2023_10_29_variables_id.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `variables` LIKE 'id'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `variables`
|
||||||
|
ADD COLUMN `id` int(11) NOT NULL AUTO_INCREMENT FIRST,
|
||||||
|
DROP PRIMARY KEY,
|
||||||
|
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`;
|
||||||
|
)"
|
||||||
|
},
|
||||||
// -- template; copy/paste this when you need to create a new entry
|
// -- template; copy/paste this when you need to create a new entry
|
||||||
// ManifestEntry{
|
// ManifestEntry{
|
||||||
// .version = 9228,
|
// .version = 9228,
|
||||||
|
|||||||
@@ -61,6 +61,29 @@ DROP TABLE IF EXISTS `bot_group_members`;
|
|||||||
SET FOREIGN_KEY_CHECKS = 1;
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
)",
|
)",
|
||||||
},
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9040,
|
||||||
|
.description = "2023_11_16_bot_starting_items.sql",
|
||||||
|
.check = "SHOW TABLES LIKE 'bot_starting_items'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
CREATE TABLE `bot_starting_items` (
|
||||||
|
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`races` int(11) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
`classes` int(11) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
`item_id` int(11) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
`item_charges` tinyint(3) UNSIGNED NOT NULL DEFAULT 1,
|
||||||
|
`min_status` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
`slot_id` 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) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
|
||||||
|
`content_flags_disabled` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci;
|
||||||
|
)"
|
||||||
|
}
|
||||||
// -- template; copy/paste this when you need to create a new entry
|
// -- template; copy/paste this when you need to create a new entry
|
||||||
// ManifestEntry{
|
// ManifestEntry{
|
||||||
// .version = 9228,
|
// .version = 9228,
|
||||||
|
|||||||
@@ -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/raid_members_repository.h"
|
||||||
#include "../common/repositories/respawn_times_repository.h"
|
#include "../common/repositories/respawn_times_repository.h"
|
||||||
#include "../common/repositories/spawn_condition_values_repository.h"
|
#include "../common/repositories/spawn_condition_values_repository.h"
|
||||||
|
#include "repositories/spawn2_disabled_repository.h"
|
||||||
|
|
||||||
|
|
||||||
#include "database.h"
|
#include "database.h"
|
||||||
@@ -49,6 +50,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
bool Database::AddClientToInstance(uint16 instance_id, uint32 character_id)
|
bool Database::AddClientToInstance(uint16 instance_id, uint32 character_id)
|
||||||
{
|
{
|
||||||
auto e = InstanceListPlayerRepository::NewEntity();
|
auto e = InstanceListPlayerRepository::NewEntity();
|
||||||
@@ -553,6 +555,7 @@ void Database::PurgeExpiredInstances()
|
|||||||
CharacterCorpsesRepository::BuryInstances(*this, imploded_instance_ids);
|
CharacterCorpsesRepository::BuryInstances(*this, imploded_instance_ids);
|
||||||
DynamicZoneMembersRepository::DeleteByManyInstances(*this, imploded_instance_ids);
|
DynamicZoneMembersRepository::DeleteByManyInstances(*this, imploded_instance_ids);
|
||||||
DynamicZonesRepository::DeleteWhere(*this, fmt::format("instance_id IN ({})", 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)
|
void Database::SetInstanceDuration(uint16 instance_id, uint32 new_duration)
|
||||||
|
|||||||
@@ -345,6 +345,7 @@ namespace DatabaseSchema {
|
|||||||
"respawn_times",
|
"respawn_times",
|
||||||
"saylink",
|
"saylink",
|
||||||
"server_scheduled_events",
|
"server_scheduled_events",
|
||||||
|
"spawn2_disabled",
|
||||||
"player_event_log_settings",
|
"player_event_log_settings",
|
||||||
"player_event_logs",
|
"player_event_logs",
|
||||||
"shared_task_activity_state",
|
"shared_task_activity_state",
|
||||||
|
|||||||
@@ -1052,4 +1052,27 @@ enum ScribeSpellActions
|
|||||||
Unmemorize
|
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*/
|
#endif /*COMMON_EQ_CONSTANTS_H*/
|
||||||
|
|||||||
@@ -4164,7 +4164,6 @@ struct RaidGeneral_Struct {
|
|||||||
/*68*/ uint32 unknown1;
|
/*68*/ uint32 unknown1;
|
||||||
/*72*/ char leader_name[64];
|
/*72*/ char leader_name[64];
|
||||||
/*136*/ uint32 parameter;
|
/*136*/ uint32 parameter;
|
||||||
/*200*/ char note[64];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidAddMember_Struct {
|
struct RaidAddMember_Struct {
|
||||||
@@ -4175,9 +4174,14 @@ struct RaidAddMember_Struct {
|
|||||||
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct RaidNote_Struct {
|
||||||
|
/*000*/ RaidGeneral_Struct general;
|
||||||
|
/*140*/ char note[64];
|
||||||
|
};
|
||||||
|
|
||||||
struct RaidMOTD_Struct {
|
struct RaidMOTD_Struct {
|
||||||
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
/*000*/ RaidGeneral_Struct general;
|
||||||
/*136*/ char motd[0]; // max size is 1024, but reply is variable
|
/*140*/ char motd[1024];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidLeadershipUpdate_Struct {
|
struct RaidLeadershipUpdate_Struct {
|
||||||
|
|||||||
@@ -100,6 +100,8 @@ EQEmuLogSys *EQEmuLogSys::LoadLogSettingsDefaults()
|
|||||||
log_settings[Logs::Discord].log_to_console = static_cast<uint8>(Logs::General);
|
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_gmsay = static_cast<uint8>(Logs::General);
|
||||||
log_settings[Logs::QuestErrors].log_to_console = 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
|
* RFC 5424
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ namespace Logs {
|
|||||||
PlayerEvents,
|
PlayerEvents,
|
||||||
DataBuckets,
|
DataBuckets,
|
||||||
Zoning,
|
Zoning,
|
||||||
|
EqTime,
|
||||||
MaxCategoryID /* Don't Remove this */
|
MaxCategoryID /* Don't Remove this */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -237,6 +238,7 @@ namespace Logs {
|
|||||||
"PlayerEvents",
|
"PlayerEvents",
|
||||||
"DataBuckets",
|
"DataBuckets",
|
||||||
"Zoning",
|
"Zoning",
|
||||||
|
"EqTime",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -814,6 +814,16 @@
|
|||||||
OutF(LogSys, Logs::Detail, Logs::Zoning, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
OutF(LogSys, Logs::Detail, Logs::Zoning, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
} while (0)
|
} 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 {\
|
#define Log(debug_level, log_category, message, ...) do {\
|
||||||
if (LogSys.IsLogEnabled(debug_level, log_category))\
|
if (LogSys.IsLogEnabled(debug_level, log_category))\
|
||||||
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
|||||||
+51
-7
@@ -46,16 +46,16 @@ EQTime::EQTime()
|
|||||||
timezone = 0;
|
timezone = 0;
|
||||||
memset(&eqTime, 0, sizeof(eqTime));
|
memset(&eqTime, 0, sizeof(eqTime));
|
||||||
//Defaults for time
|
//Defaults for time
|
||||||
TimeOfDay_Struct start;
|
TimeOfDay_Struct t{};
|
||||||
start.day = 1;
|
t.day = 1;
|
||||||
start.hour = 9;
|
t.hour = 9;
|
||||||
start.minute = 0;
|
t.minute = 0;
|
||||||
start.month = 1;
|
t.month = 1;
|
||||||
start.year = 3100;
|
t.year = 3100;
|
||||||
//Set default time zone
|
//Set default time zone
|
||||||
timezone = 0;
|
timezone = 0;
|
||||||
//Start EQTimer
|
//Start EQTimer
|
||||||
SetCurrentEQTimeOfDay(start, time(0));
|
SetCurrentEQTimeOfDay(t, time(nullptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
//getEQTimeOfDay - Reads timeConvert and writes the result to eqTimeOfDay
|
//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';
|
buf[127] = '\0';
|
||||||
str = buf;
|
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 getEQTimeZone() { return timezone; }
|
||||||
uint32 getEQTimeZoneHr() { return timezone/60; }
|
uint32 getEQTimeZoneHr() { return timezone/60; }
|
||||||
uint32 getEQTimeZoneMin() { return timezone%60; }
|
uint32 getEQTimeZoneMin() { return timezone%60; }
|
||||||
|
bool IsDayTime();
|
||||||
|
bool IsNightTime();
|
||||||
|
bool IsInbetweenTime(uint8 min_time, uint8 max_time);
|
||||||
|
|
||||||
//Set functions
|
//Set functions
|
||||||
int SetCurrentEQTimeOfDay(TimeOfDay_Struct start_eq, time_t start_real);
|
int SetCurrentEQTimeOfDay(TimeOfDay_Struct start_eq, time_t start_real);
|
||||||
|
|||||||
@@ -250,9 +250,7 @@ enum {
|
|||||||
commandMovecharSelfOnly = 80, //below this == only self move allowed
|
commandMovecharSelfOnly = 80, //below this == only self move allowed
|
||||||
commandMovecharToSpecials = 200, //ability to send people to cshom/load zones
|
commandMovecharToSpecials = 200, //ability to send people to cshom/load zones
|
||||||
commandCastSpecials = 100, //can cast special spells
|
commandCastSpecials = 100, //can cast special spells
|
||||||
commandInstacast = 100, //insta-cast all #casted spells
|
|
||||||
commandDoAnimOthers = 100, //can #doanim on others
|
commandDoAnimOthers = 100, //can #doanim on others
|
||||||
commandLockZones = 101, //can lock or unlock zones
|
|
||||||
commandEditPlayerCorpses = 150, //can Edit Player Corpses
|
commandEditPlayerCorpses = 150, //can Edit Player Corpses
|
||||||
commandInterrogateInv = 100, //below this == only log on error state and self-only target dump
|
commandInterrogateInv = 100, //below this == only log on error state and self-only target dump
|
||||||
commandInvSnapshot = 150 //ability to clear/restore snapshots
|
commandInvSnapshot = 150 //ability to clear/restore snapshots
|
||||||
|
|||||||
@@ -55,8 +55,14 @@ bool File::Exists(const std::string &name)
|
|||||||
*/
|
*/
|
||||||
void File::Makedir(const std::string &directory_name)
|
void File::Makedir(const std::string &directory_name)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
fs::create_directory(directory_name);
|
fs::create_directory(directory_name);
|
||||||
fs::permissions(directory_name, fs::perms::owner_all);
|
fs::permissions(directory_name, fs::perms::owner_all);
|
||||||
|
}
|
||||||
|
catch (const fs::filesystem_error &ex) {
|
||||||
|
std::cout << "Failed to create directory: " << directory_name << std::endl;
|
||||||
|
std::cout << ex.what() << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string File::FindEqemuConfigPath()
|
std::string File::FindEqemuConfigPath()
|
||||||
|
|||||||
@@ -356,6 +356,7 @@ namespace EQ
|
|||||||
struct ItemData {
|
struct ItemData {
|
||||||
// Non packet based fields
|
// Non packet based fields
|
||||||
uint8 MinStatus {};
|
uint8 MinStatus {};
|
||||||
|
char Comment[255] {};
|
||||||
|
|
||||||
// Packet based fields
|
// Packet based fields
|
||||||
uint8 ItemClass {}; // Item Type: 0=common, 1=container, 2=book
|
uint8 ItemClass {}; // Item Type: 0=common, 1=container, 2=book
|
||||||
|
|||||||
+24640
File diff suppressed because it is too large
Load Diff
+123
-76
@@ -34,6 +34,7 @@
|
|||||||
#include "../rulesys.h"
|
#include "../rulesys.h"
|
||||||
#include "../path_manager.h"
|
#include "../path_manager.h"
|
||||||
#include "../races.h"
|
#include "../races.h"
|
||||||
|
#include "../raid.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@@ -2608,88 +2609,124 @@ namespace RoF
|
|||||||
|
|
||||||
ENCODE(OP_RaidJoin)
|
ENCODE(OP_RaidJoin)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
*p = nullptr;
|
||||||
RaidCreate_Struct *raid_create = (RaidCreate_Struct*)__emu_buffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
|
RaidCreate_Struct* emu = (RaidCreate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp_create = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *general = (structs::RaidGeneral_Struct*)outapp_create->pBuffer;
|
structs::RaidGeneral_Struct* general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
general->action = 8;
|
general->action = raidCreate;
|
||||||
general->parameter = 1;
|
general->parameter = RaidCommandAcceptInvite;
|
||||||
strn0cpy(general->leader_name, raid_create->leader_name, 64);
|
strn0cpy(general->leader_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
strn0cpy(general->player_name, raid_create->leader_name, 64);
|
strn0cpy(general->player_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
|
||||||
dest->FastQueuePacket(&outapp_create);
|
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_RaidUpdate)
|
ENCODE(OP_RaidUpdate)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
*p = nullptr;
|
*p = nullptr;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
RaidGeneral_Struct *raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
RaidGeneral_Struct* raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
if (raid_gen->action == 0) // raid add has longer length than other raid updates
|
switch (raid_gen->action)
|
||||||
{
|
{
|
||||||
RaidAddMember_Struct* in_add_member = (RaidAddMember_Struct*)__emu_buffer;
|
case raidAdd:
|
||||||
|
{
|
||||||
|
RaidAddMember_Struct* emu = (RaidAddMember_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
||||||
structs::RaidAddMember_Struct *add_member = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
structs::RaidAddMember_Struct* eq = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
add_member->raidGen.action = in_add_member->raidGen.action;
|
OUT(raidGen.action);
|
||||||
add_member->raidGen.parameter = in_add_member->raidGen.parameter;
|
OUT(raidGen.parameter);
|
||||||
strn0cpy(add_member->raidGen.leader_name, in_add_member->raidGen.leader_name, 64);
|
OUT_str(raidGen.leader_name);
|
||||||
strn0cpy(add_member->raidGen.player_name, in_add_member->raidGen.player_name, 64);
|
OUT_str(raidGen.player_name);
|
||||||
add_member->_class = in_add_member->_class;
|
OUT(_class);
|
||||||
add_member->level = in_add_member->level;
|
OUT(level);
|
||||||
add_member->isGroupLeader = in_add_member->isGroupLeader;
|
OUT(isGroupLeader);
|
||||||
add_member->flags[0] = in_add_member->flags[0];
|
OUT(flags[0]);
|
||||||
add_member->flags[1] = in_add_member->flags[1];
|
OUT(flags[1]);
|
||||||
add_member->flags[2] = in_add_member->flags[2];
|
OUT(flags[2]);
|
||||||
add_member->flags[3] = in_add_member->flags[3];
|
OUT(flags[3]);
|
||||||
add_member->flags[4] = in_add_member->flags[4];
|
OUT(flags[4]);
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
else if (raid_gen->action == 35)
|
|
||||||
{
|
|
||||||
RaidMOTD_Struct *inmotd = (RaidMOTD_Struct *)__emu_buffer;
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct) +
|
|
||||||
strlen(inmotd->motd) + 1);
|
|
||||||
structs::RaidMOTD_Struct *outmotd = (structs::RaidMOTD_Struct *)outapp->pBuffer;
|
|
||||||
|
|
||||||
outmotd->general.action = inmotd->general.action;
|
|
||||||
strn0cpy(outmotd->general.player_name, inmotd->general.player_name, 64);
|
|
||||||
strn0cpy(outmotd->motd, inmotd->motd, strlen(inmotd->motd) + 1);
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (raid_gen->action == 14 || raid_gen->action == 30)
|
case raidSetMotd:
|
||||||
{
|
{
|
||||||
RaidLeadershipUpdate_Struct *inlaa = (RaidLeadershipUpdate_Struct *)__emu_buffer;
|
RaidMOTD_Struct* emu = (RaidMOTD_Struct*)__emu_buffer;
|
||||||
auto outapp =
|
|
||||||
new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct));
|
||||||
structs::RaidLeadershipUpdate_Struct *outlaa = (structs::RaidLeadershipUpdate_Struct *)outapp->pBuffer;
|
structs::RaidMOTD_Struct* eq = (structs::RaidMOTD_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(motd);
|
||||||
|
|
||||||
outlaa->action = inlaa->action;
|
|
||||||
strn0cpy(outlaa->player_name, inlaa->player_name, 64);
|
|
||||||
strn0cpy(outlaa->leader_name, inlaa->leader_name, 64);
|
|
||||||
memcpy(&outlaa->raid, &inlaa->raid, sizeof(RaidLeadershipAA_Struct));
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
case raidSetLeaderAbilities:
|
||||||
|
case raidMakeLeader:
|
||||||
{
|
{
|
||||||
RaidGeneral_Struct* in_raid_general = (RaidGeneral_Struct*)__emu_buffer;
|
RaidLeadershipUpdate_Struct* emu = (RaidLeadershipUpdate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
||||||
|
structs::RaidLeadershipUpdate_Struct* eq = (structs::RaidLeadershipUpdate_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT_str(player_name);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
memcpy(&eq->raid, &emu->raid, sizeof(RaidLeadershipAA_Struct));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
auto emu = (RaidNote_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidNote_Struct));
|
||||||
|
auto eq = (structs::RaidNote_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(note);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidNoRaid:
|
||||||
|
{
|
||||||
|
dest->QueuePacket(inapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
RaidGeneral_Struct* emu = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *raid_general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
structs::RaidGeneral_Struct* eq = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
strn0cpy(raid_general->leader_name, in_raid_general->leader_name, 64);
|
|
||||||
strn0cpy(raid_general->player_name, in_raid_general->player_name, 64);
|
|
||||||
raid_general->action = in_raid_general->action;
|
|
||||||
raid_general->parameter = in_raid_general->parameter;
|
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT(parameter);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
OUT_str(player_name);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4861,34 +4898,44 @@ namespace RoF
|
|||||||
{
|
{
|
||||||
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
||||||
|
|
||||||
// This is a switch on the RaidGeneral action
|
RaidGeneral_Struct* rgs = (RaidGeneral_Struct*)__packet->pBuffer;
|
||||||
switch (*(uint32 *)__packet->pBuffer) {
|
|
||||||
case 35: { // raidMOTD
|
switch (rgs->action)
|
||||||
// we don't have a nice macro for this
|
{
|
||||||
structs::RaidMOTD_Struct *__eq_buffer = (structs::RaidMOTD_Struct *)__packet->pBuffer;
|
case raidSetMotd:
|
||||||
__eq_buffer->motd[1023] = '\0';
|
{
|
||||||
size_t motd_size = strlen(__eq_buffer->motd) + 1;
|
SETUP_VAR_DECODE(RaidMOTD_Struct, structs::RaidMOTD_Struct, motd);
|
||||||
__packet->size = sizeof(RaidMOTD_Struct) + motd_size;
|
|
||||||
__packet->pBuffer = new unsigned char[__packet->size];
|
|
||||||
RaidMOTD_Struct *emu = (RaidMOTD_Struct *)__packet->pBuffer;
|
|
||||||
structs::RaidMOTD_Struct *eq = (structs::RaidMOTD_Struct *)__eq_buffer;
|
|
||||||
strn0cpy(emu->general.player_name, eq->general.player_name, 64);
|
|
||||||
strn0cpy(emu->motd, eq->motd, motd_size);
|
|
||||||
IN(general.action);
|
IN(general.action);
|
||||||
IN(general.parameter);
|
IN(general.parameter);
|
||||||
FINISH_DIRECT_DECODE();
|
IN_str(general.leader_name);
|
||||||
|
IN_str(general.player_name);
|
||||||
|
IN_str(motd);
|
||||||
|
|
||||||
|
FINISH_VAR_DECODE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 36: { // raidPlayerNote unhandled
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
SETUP_VAR_DECODE(RaidNote_Struct, structs::RaidNote_Struct, note);
|
||||||
|
|
||||||
|
IN(general.action);
|
||||||
|
IN(general.parameter);
|
||||||
|
IN_str(general.leader_name);
|
||||||
|
IN_str(general.player_name);
|
||||||
|
IN_str(note);
|
||||||
|
|
||||||
|
FINISH_VAR_DECODE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default:
|
||||||
DECODE_LENGTH_EXACT(structs::RaidGeneral_Struct);
|
{
|
||||||
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
||||||
strn0cpy(emu->leader_name, eq->leader_name, 64);
|
|
||||||
strn0cpy(emu->player_name, eq->player_name, 64);
|
|
||||||
IN(action);
|
IN(action);
|
||||||
IN(parameter);
|
IN(parameter);
|
||||||
|
IN_str(leader_name);
|
||||||
|
IN_str(player_name);
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
+121
-87
@@ -35,7 +35,7 @@
|
|||||||
#include "../path_manager.h"
|
#include "../path_manager.h"
|
||||||
#include "../classes.h"
|
#include "../classes.h"
|
||||||
#include "../races.h"
|
#include "../races.h"
|
||||||
#include "../../zone/raids.h"
|
#include "../raid.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@@ -2678,100 +2678,124 @@ namespace RoF2
|
|||||||
|
|
||||||
ENCODE(OP_RaidJoin)
|
ENCODE(OP_RaidJoin)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
*p = nullptr;
|
||||||
RaidCreate_Struct *raid_create = (RaidCreate_Struct*)__emu_buffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
|
RaidCreate_Struct* emu = (RaidCreate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp_create = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *general = (structs::RaidGeneral_Struct*)outapp_create->pBuffer;
|
structs::RaidGeneral_Struct* general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
general->action = 8;
|
general->action = raidCreate;
|
||||||
general->parameter = 1;
|
general->parameter = RaidCommandAcceptInvite;
|
||||||
strn0cpy(general->leader_name, raid_create->leader_name, 64);
|
strn0cpy(general->leader_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
strn0cpy(general->player_name, raid_create->leader_name, 64);
|
strn0cpy(general->player_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
|
||||||
dest->FastQueuePacket(&outapp_create);
|
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_RaidUpdate)
|
ENCODE(OP_RaidUpdate)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
*p = nullptr;
|
*p = nullptr;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
RaidGeneral_Struct *raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
RaidGeneral_Struct* raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
if (raid_gen->action == 0) // raid add has longer length than other raid updates
|
switch (raid_gen->action)
|
||||||
{
|
{
|
||||||
RaidAddMember_Struct* in_add_member = (RaidAddMember_Struct*)__emu_buffer;
|
case raidAdd:
|
||||||
|
{
|
||||||
|
RaidAddMember_Struct* emu = (RaidAddMember_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
||||||
structs::RaidAddMember_Struct *add_member = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
structs::RaidAddMember_Struct* eq = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
add_member->raidGen.action = in_add_member->raidGen.action;
|
OUT(raidGen.action);
|
||||||
add_member->raidGen.parameter = in_add_member->raidGen.parameter;
|
OUT(raidGen.parameter);
|
||||||
strn0cpy(add_member->raidGen.leader_name, in_add_member->raidGen.leader_name, 64);
|
OUT_str(raidGen.leader_name);
|
||||||
strn0cpy(add_member->raidGen.player_name, in_add_member->raidGen.player_name, 64);
|
OUT_str(raidGen.player_name);
|
||||||
add_member->_class = in_add_member->_class;
|
OUT(_class);
|
||||||
add_member->level = in_add_member->level;
|
OUT(level);
|
||||||
add_member->isGroupLeader = in_add_member->isGroupLeader;
|
OUT(isGroupLeader);
|
||||||
add_member->flags[0] = in_add_member->flags[0];
|
OUT(flags[0]);
|
||||||
add_member->flags[1] = in_add_member->flags[1];
|
OUT(flags[1]);
|
||||||
add_member->flags[2] = in_add_member->flags[2];
|
OUT(flags[2]);
|
||||||
add_member->flags[3] = in_add_member->flags[3];
|
OUT(flags[3]);
|
||||||
add_member->flags[4] = in_add_member->flags[4];
|
OUT(flags[4]);
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
else if (raid_gen->action == 35)
|
|
||||||
{
|
|
||||||
RaidMOTD_Struct *inmotd = (RaidMOTD_Struct *)__emu_buffer;
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct) +
|
|
||||||
strlen(inmotd->motd) + 1);
|
|
||||||
structs::RaidMOTD_Struct *outmotd = (structs::RaidMOTD_Struct *)outapp->pBuffer;
|
|
||||||
|
|
||||||
outmotd->general.action = inmotd->general.action;
|
|
||||||
strn0cpy(outmotd->general.player_name, inmotd->general.player_name, 64);
|
|
||||||
strn0cpy(outmotd->motd, inmotd->motd, strlen(inmotd->motd) + 1);
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (raid_gen->action == 14 || raid_gen->action == 30)
|
case raidSetMotd:
|
||||||
{
|
{
|
||||||
RaidLeadershipUpdate_Struct *inlaa = (RaidLeadershipUpdate_Struct *)__emu_buffer;
|
RaidMOTD_Struct* emu = (RaidMOTD_Struct*)__emu_buffer;
|
||||||
auto outapp =
|
|
||||||
new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct));
|
||||||
structs::RaidLeadershipUpdate_Struct *outlaa = (structs::RaidLeadershipUpdate_Struct *)outapp->pBuffer;
|
structs::RaidMOTD_Struct* eq = (structs::RaidMOTD_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(motd);
|
||||||
|
|
||||||
outlaa->action = inlaa->action;
|
|
||||||
strn0cpy(outlaa->player_name, inlaa->player_name, 64);
|
|
||||||
strn0cpy(outlaa->leader_name, inlaa->leader_name, 64);
|
|
||||||
memcpy(&outlaa->raid, &inlaa->raid, sizeof(RaidLeadershipAA_Struct));
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (raid_gen->action == raidSetNote)
|
case raidSetLeaderAbilities:
|
||||||
|
case raidMakeLeader:
|
||||||
{
|
{
|
||||||
auto in_note = (RaidGeneral_Struct*)__emu_buffer;
|
RaidLeadershipUpdate_Struct* emu = (RaidLeadershipUpdate_Struct*)__emu_buffer;
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidGeneral_Struct));
|
|
||||||
auto note = (RaidGeneral_Struct*)outapp->pBuffer;
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
||||||
note->action = raidSetNote;
|
structs::RaidLeadershipUpdate_Struct* eq = (structs::RaidLeadershipUpdate_Struct*)outapp->pBuffer;
|
||||||
strn0cpy(note->leader_name, in_note->leader_name, sizeof(note->leader_name));
|
|
||||||
strn0cpy(note->player_name, in_note->player_name, sizeof(note->leader_name));
|
OUT(action);
|
||||||
strn0cpy(note->note, in_note->note, sizeof(note->note));
|
OUT_str(player_name);
|
||||||
dest->QueuePacket(outapp);
|
OUT_str(leader_name);
|
||||||
safe_delete(outapp);
|
memcpy(&eq->raid, &emu->raid, sizeof(RaidLeadershipAA_Struct));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
case raidSetNote:
|
||||||
{
|
{
|
||||||
RaidGeneral_Struct* in_raid_general = (RaidGeneral_Struct*)__emu_buffer;
|
auto emu = (RaidNote_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidNote_Struct));
|
||||||
|
auto eq = (structs::RaidNote_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(note);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidNoRaid:
|
||||||
|
{
|
||||||
|
dest->QueuePacket(inapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
RaidGeneral_Struct* emu = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *raid_general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
structs::RaidGeneral_Struct* eq = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
strn0cpy(raid_general->leader_name, in_raid_general->leader_name, 64);
|
|
||||||
strn0cpy(raid_general->player_name, in_raid_general->player_name, 64);
|
|
||||||
raid_general->action = in_raid_general->action;
|
|
||||||
raid_general->parameter = in_raid_general->parameter;
|
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT(parameter);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
OUT_str(player_name);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5091,34 +5115,44 @@ namespace RoF2
|
|||||||
{
|
{
|
||||||
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
||||||
|
|
||||||
// This is a switch on the RaidGeneral action
|
RaidGeneral_Struct* rgs = (RaidGeneral_Struct*)__packet->pBuffer;
|
||||||
switch (*(uint32 *)__packet->pBuffer) {
|
|
||||||
case 35: { // raidMOTD
|
switch (rgs->action)
|
||||||
// we don't have a nice macro for this
|
{
|
||||||
structs::RaidMOTD_Struct *__eq_buffer = (structs::RaidMOTD_Struct *)__packet->pBuffer;
|
case raidSetMotd:
|
||||||
__eq_buffer->motd[1023] = '\0';
|
{
|
||||||
size_t motd_size = strlen(__eq_buffer->motd) + 1;
|
SETUP_VAR_DECODE(RaidMOTD_Struct, structs::RaidMOTD_Struct, motd);
|
||||||
__packet->size = sizeof(RaidMOTD_Struct) + motd_size;
|
|
||||||
__packet->pBuffer = new unsigned char[__packet->size];
|
|
||||||
RaidMOTD_Struct *emu = (RaidMOTD_Struct *)__packet->pBuffer;
|
|
||||||
structs::RaidMOTD_Struct *eq = (structs::RaidMOTD_Struct *)__eq_buffer;
|
|
||||||
strn0cpy(emu->general.player_name, eq->general.player_name, 64);
|
|
||||||
strn0cpy(emu->motd, eq->motd, motd_size);
|
|
||||||
IN(general.action);
|
IN(general.action);
|
||||||
IN(general.parameter);
|
IN(general.parameter);
|
||||||
FINISH_DIRECT_DECODE();
|
IN_str(general.leader_name);
|
||||||
|
IN_str(general.player_name);
|
||||||
|
IN_str(motd);
|
||||||
|
|
||||||
|
FINISH_VAR_DECODE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 36: { // raidPlayerNote unhandled
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
SETUP_VAR_DECODE(RaidNote_Struct, structs::RaidNote_Struct, note);
|
||||||
|
|
||||||
|
IN(general.action);
|
||||||
|
IN(general.parameter);
|
||||||
|
IN_str(general.leader_name);
|
||||||
|
IN_str(general.player_name);
|
||||||
|
IN_str(note);
|
||||||
|
|
||||||
|
FINISH_VAR_DECODE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default:
|
||||||
DECODE_LENGTH_EXACT(structs::RaidGeneral_Struct);
|
{
|
||||||
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
||||||
strn0cpy(emu->leader_name, eq->leader_name, 64);
|
|
||||||
strn0cpy(emu->player_name, eq->player_name, 64);
|
|
||||||
IN(action);
|
IN(action);
|
||||||
IN(parameter);
|
IN(parameter);
|
||||||
|
IN_str(leader_name);
|
||||||
|
IN_str(player_name);
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4198,9 +4198,14 @@ struct RaidAddMember_Struct {
|
|||||||
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct RaidNote_Struct {
|
||||||
|
/*000*/ RaidGeneral_Struct general;
|
||||||
|
/*140*/ char note[64];
|
||||||
|
};
|
||||||
|
|
||||||
struct RaidMOTD_Struct {
|
struct RaidMOTD_Struct {
|
||||||
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
/*000*/ RaidGeneral_Struct general;
|
||||||
/*140*/ char motd[0]; // max size 1024, but reply is variable
|
/*140*/ char motd[1024];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidLeadershipUpdate_Struct {
|
struct RaidLeadershipUpdate_Struct {
|
||||||
|
|||||||
@@ -4136,9 +4136,14 @@ struct RaidAddMember_Struct {
|
|||||||
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct RaidNote_Struct {
|
||||||
|
/*000*/ RaidGeneral_Struct general;
|
||||||
|
/*140*/ char note[64];
|
||||||
|
};
|
||||||
|
|
||||||
struct RaidMOTD_Struct {
|
struct RaidMOTD_Struct {
|
||||||
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
||||||
/*140*/ char motd[0]; // max size 1024, but reply is variable
|
/*140*/ char motd[1024]; // max size is 1024, but reply is variable
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidLeadershipUpdate_Struct {
|
struct RaidLeadershipUpdate_Struct {
|
||||||
|
|||||||
+123
-76
@@ -34,6 +34,7 @@
|
|||||||
#include "../rulesys.h"
|
#include "../rulesys.h"
|
||||||
#include "../path_manager.h"
|
#include "../path_manager.h"
|
||||||
#include "../races.h"
|
#include "../races.h"
|
||||||
|
#include "../raid.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@@ -1686,88 +1687,124 @@ namespace SoD
|
|||||||
|
|
||||||
ENCODE(OP_RaidJoin)
|
ENCODE(OP_RaidJoin)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
*p = nullptr;
|
||||||
RaidCreate_Struct *raid_create = (RaidCreate_Struct*)__emu_buffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
|
RaidCreate_Struct* emu = (RaidCreate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp_create = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *general = (structs::RaidGeneral_Struct*)outapp_create->pBuffer;
|
structs::RaidGeneral_Struct* general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
general->action = 8;
|
general->action = raidCreate;
|
||||||
general->parameter = 1;
|
general->parameter = RaidCommandAcceptInvite;
|
||||||
strn0cpy(general->leader_name, raid_create->leader_name, 64);
|
strn0cpy(general->leader_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
strn0cpy(general->player_name, raid_create->leader_name, 64);
|
strn0cpy(general->player_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
|
||||||
dest->FastQueuePacket(&outapp_create);
|
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_RaidUpdate)
|
ENCODE(OP_RaidUpdate)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
*p = nullptr;
|
*p = nullptr;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
RaidGeneral_Struct *raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
RaidGeneral_Struct* raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
if (raid_gen->action == 0) // raid add has longer length than other raid updates
|
switch (raid_gen->action)
|
||||||
{
|
{
|
||||||
RaidAddMember_Struct* in_add_member = (RaidAddMember_Struct*)__emu_buffer;
|
case raidAdd:
|
||||||
|
{
|
||||||
|
RaidAddMember_Struct* emu = (RaidAddMember_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
||||||
structs::RaidAddMember_Struct *add_member = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
structs::RaidAddMember_Struct* eq = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
add_member->raidGen.action = in_add_member->raidGen.action;
|
OUT(raidGen.action);
|
||||||
add_member->raidGen.parameter = in_add_member->raidGen.parameter;
|
OUT(raidGen.parameter);
|
||||||
strn0cpy(add_member->raidGen.leader_name, in_add_member->raidGen.leader_name, 64);
|
OUT_str(raidGen.leader_name);
|
||||||
strn0cpy(add_member->raidGen.player_name, in_add_member->raidGen.player_name, 64);
|
OUT_str(raidGen.player_name);
|
||||||
add_member->_class = in_add_member->_class;
|
OUT(_class);
|
||||||
add_member->level = in_add_member->level;
|
OUT(level);
|
||||||
add_member->isGroupLeader = in_add_member->isGroupLeader;
|
OUT(isGroupLeader);
|
||||||
add_member->flags[0] = in_add_member->flags[0];
|
OUT(flags[0]);
|
||||||
add_member->flags[1] = in_add_member->flags[1];
|
OUT(flags[1]);
|
||||||
add_member->flags[2] = in_add_member->flags[2];
|
OUT(flags[2]);
|
||||||
add_member->flags[3] = in_add_member->flags[3];
|
OUT(flags[3]);
|
||||||
add_member->flags[4] = in_add_member->flags[4];
|
OUT(flags[4]);
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
else if (raid_gen->action == 35)
|
|
||||||
{
|
|
||||||
RaidMOTD_Struct *inmotd = (RaidMOTD_Struct *)__emu_buffer;
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct) +
|
|
||||||
strlen(inmotd->motd) + 1);
|
|
||||||
structs::RaidMOTD_Struct *outmotd = (structs::RaidMOTD_Struct *)outapp->pBuffer;
|
|
||||||
|
|
||||||
outmotd->general.action = inmotd->general.action;
|
|
||||||
strn0cpy(outmotd->general.player_name, inmotd->general.player_name, 64);
|
|
||||||
strn0cpy(outmotd->motd, inmotd->motd, strlen(inmotd->motd) + 1);
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (raid_gen->action == 14 || raid_gen->action == 30)
|
case raidSetMotd:
|
||||||
{
|
{
|
||||||
RaidLeadershipUpdate_Struct *inlaa = (RaidLeadershipUpdate_Struct *)__emu_buffer;
|
RaidMOTD_Struct* emu = (RaidMOTD_Struct*)__emu_buffer;
|
||||||
auto outapp =
|
|
||||||
new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct));
|
||||||
structs::RaidLeadershipUpdate_Struct *outlaa = (structs::RaidLeadershipUpdate_Struct *)outapp->pBuffer;
|
structs::RaidMOTD_Struct* eq = (structs::RaidMOTD_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(motd);
|
||||||
|
|
||||||
outlaa->action = inlaa->action;
|
|
||||||
strn0cpy(outlaa->player_name, inlaa->player_name, 64);
|
|
||||||
strn0cpy(outlaa->leader_name, inlaa->leader_name, 64);
|
|
||||||
memcpy(&outlaa->raid, &inlaa->raid, sizeof(RaidLeadershipAA_Struct));
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
case raidSetLeaderAbilities:
|
||||||
|
case raidMakeLeader:
|
||||||
{
|
{
|
||||||
RaidGeneral_Struct* in_raid_general = (RaidGeneral_Struct*)__emu_buffer;
|
RaidLeadershipUpdate_Struct* emu = (RaidLeadershipUpdate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
||||||
|
structs::RaidLeadershipUpdate_Struct* eq = (structs::RaidLeadershipUpdate_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT_str(player_name);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
memcpy(&eq->raid, &emu->raid, sizeof(RaidLeadershipAA_Struct));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
auto emu = (RaidNote_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidNote_Struct));
|
||||||
|
auto eq = (structs::RaidNote_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(note);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidNoRaid:
|
||||||
|
{
|
||||||
|
dest->QueuePacket(inapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
RaidGeneral_Struct* emu = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *raid_general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
structs::RaidGeneral_Struct* eq = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
strn0cpy(raid_general->leader_name, in_raid_general->leader_name, 64);
|
|
||||||
strn0cpy(raid_general->player_name, in_raid_general->player_name, 64);
|
|
||||||
raid_general->action = in_raid_general->action;
|
|
||||||
raid_general->parameter = in_raid_general->parameter;
|
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT(parameter);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
OUT_str(player_name);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3338,34 +3375,44 @@ namespace SoD
|
|||||||
{
|
{
|
||||||
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
||||||
|
|
||||||
// This is a switch on the RaidGeneral action
|
RaidGeneral_Struct* rgs = (RaidGeneral_Struct*)__packet->pBuffer;
|
||||||
switch (*(uint32 *)__packet->pBuffer) {
|
|
||||||
case 35: { // raidMOTD
|
switch (rgs->action)
|
||||||
// we don't have a nice macro for this
|
{
|
||||||
structs::RaidMOTD_Struct *__eq_buffer = (structs::RaidMOTD_Struct *)__packet->pBuffer;
|
case raidSetMotd:
|
||||||
__eq_buffer->motd[1023] = '\0';
|
{
|
||||||
size_t motd_size = strlen(__eq_buffer->motd) + 1;
|
SETUP_VAR_DECODE(RaidMOTD_Struct, structs::RaidMOTD_Struct, motd);
|
||||||
__packet->size = sizeof(RaidMOTD_Struct) + motd_size;
|
|
||||||
__packet->pBuffer = new unsigned char[__packet->size];
|
|
||||||
RaidMOTD_Struct *emu = (RaidMOTD_Struct *)__packet->pBuffer;
|
|
||||||
structs::RaidMOTD_Struct *eq = (structs::RaidMOTD_Struct *)__eq_buffer;
|
|
||||||
strn0cpy(emu->general.player_name, eq->general.player_name, 64);
|
|
||||||
strn0cpy(emu->motd, eq->motd, motd_size);
|
|
||||||
IN(general.action);
|
IN(general.action);
|
||||||
IN(general.parameter);
|
IN(general.parameter);
|
||||||
FINISH_DIRECT_DECODE();
|
IN_str(general.leader_name);
|
||||||
|
IN_str(general.player_name);
|
||||||
|
IN_str(motd);
|
||||||
|
|
||||||
|
FINISH_VAR_DECODE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 36: { // raidPlayerNote unhandled
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
SETUP_VAR_DECODE(RaidNote_Struct, structs::RaidNote_Struct, note);
|
||||||
|
|
||||||
|
IN(general.action);
|
||||||
|
IN(general.parameter);
|
||||||
|
IN_str(general.leader_name);
|
||||||
|
IN_str(general.player_name);
|
||||||
|
IN_str(note);
|
||||||
|
|
||||||
|
FINISH_VAR_DECODE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default:
|
||||||
DECODE_LENGTH_EXACT(structs::RaidGeneral_Struct);
|
{
|
||||||
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
||||||
strn0cpy(emu->leader_name, eq->leader_name, 64);
|
|
||||||
strn0cpy(emu->player_name, eq->player_name, 64);
|
|
||||||
IN(action);
|
IN(action);
|
||||||
IN(parameter);
|
IN(parameter);
|
||||||
|
IN_str(leader_name);
|
||||||
|
IN_str(player_name);
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3592,9 +3592,14 @@ struct RaidAddMember_Struct {
|
|||||||
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct RaidNote_Struct {
|
||||||
|
/*000*/ RaidGeneral_Struct general;
|
||||||
|
/*140*/ char note[64];
|
||||||
|
};
|
||||||
|
|
||||||
struct RaidMOTD_Struct {
|
struct RaidMOTD_Struct {
|
||||||
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
||||||
/*140*/ char motd[0]; // max size 1024, but reply is variable
|
/*140*/ char motd[1024]; // max size is 1024, but reply is variable
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidLeadershipUpdate_Struct {
|
struct RaidLeadershipUpdate_Struct {
|
||||||
|
|||||||
+123
-76
@@ -33,6 +33,7 @@
|
|||||||
#include "sof_structs.h"
|
#include "sof_structs.h"
|
||||||
#include "../rulesys.h"
|
#include "../rulesys.h"
|
||||||
#include "../path_manager.h"
|
#include "../path_manager.h"
|
||||||
|
#include "../raid.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@@ -1356,88 +1357,124 @@ namespace SoF
|
|||||||
|
|
||||||
ENCODE(OP_RaidJoin)
|
ENCODE(OP_RaidJoin)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
*p = nullptr;
|
||||||
RaidCreate_Struct *raid_create = (RaidCreate_Struct*)__emu_buffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
|
RaidCreate_Struct* emu = (RaidCreate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp_create = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *general = (structs::RaidGeneral_Struct*)outapp_create->pBuffer;
|
structs::RaidGeneral_Struct* general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
general->action = 8;
|
general->action = raidCreate;
|
||||||
general->parameter = 1;
|
general->parameter = RaidCommandAcceptInvite;
|
||||||
strn0cpy(general->leader_name, raid_create->leader_name, 64);
|
strn0cpy(general->leader_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
strn0cpy(general->player_name, raid_create->leader_name, 64);
|
strn0cpy(general->player_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
|
||||||
dest->FastQueuePacket(&outapp_create);
|
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_RaidUpdate)
|
ENCODE(OP_RaidUpdate)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
*p = nullptr;
|
*p = nullptr;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
RaidGeneral_Struct *raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
RaidGeneral_Struct* raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
if (raid_gen->action == 0) // raid add has longer length than other raid updates
|
switch (raid_gen->action)
|
||||||
{
|
{
|
||||||
RaidAddMember_Struct* in_add_member = (RaidAddMember_Struct*)__emu_buffer;
|
case raidAdd:
|
||||||
|
{
|
||||||
|
RaidAddMember_Struct* emu = (RaidAddMember_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
||||||
structs::RaidAddMember_Struct *add_member = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
structs::RaidAddMember_Struct* eq = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
add_member->raidGen.action = in_add_member->raidGen.action;
|
OUT(raidGen.action);
|
||||||
add_member->raidGen.parameter = in_add_member->raidGen.parameter;
|
OUT(raidGen.parameter);
|
||||||
strn0cpy(add_member->raidGen.leader_name, in_add_member->raidGen.leader_name, 64);
|
OUT_str(raidGen.leader_name);
|
||||||
strn0cpy(add_member->raidGen.player_name, in_add_member->raidGen.player_name, 64);
|
OUT_str(raidGen.player_name);
|
||||||
add_member->_class = in_add_member->_class;
|
OUT(_class);
|
||||||
add_member->level = in_add_member->level;
|
OUT(level);
|
||||||
add_member->isGroupLeader = in_add_member->isGroupLeader;
|
OUT(isGroupLeader);
|
||||||
add_member->flags[0] = in_add_member->flags[0];
|
OUT(flags[0]);
|
||||||
add_member->flags[1] = in_add_member->flags[1];
|
OUT(flags[1]);
|
||||||
add_member->flags[2] = in_add_member->flags[2];
|
OUT(flags[2]);
|
||||||
add_member->flags[3] = in_add_member->flags[3];
|
OUT(flags[3]);
|
||||||
add_member->flags[4] = in_add_member->flags[4];
|
OUT(flags[4]);
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
else if (raid_gen->action == 35)
|
|
||||||
{
|
|
||||||
RaidMOTD_Struct *inmotd = (RaidMOTD_Struct *)__emu_buffer;
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct) +
|
|
||||||
strlen(inmotd->motd) + 1);
|
|
||||||
structs::RaidMOTD_Struct *outmotd = (structs::RaidMOTD_Struct *)outapp->pBuffer;
|
|
||||||
|
|
||||||
outmotd->general.action = inmotd->general.action;
|
|
||||||
strn0cpy(outmotd->general.player_name, inmotd->general.player_name, 64);
|
|
||||||
strn0cpy(outmotd->motd, inmotd->motd, strlen(inmotd->motd) + 1);
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (raid_gen->action == 14 || raid_gen->action == 30)
|
case raidSetMotd:
|
||||||
{
|
{
|
||||||
RaidLeadershipUpdate_Struct *inlaa = (RaidLeadershipUpdate_Struct *)__emu_buffer;
|
RaidMOTD_Struct* emu = (RaidMOTD_Struct*)__emu_buffer;
|
||||||
auto outapp =
|
|
||||||
new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct));
|
||||||
structs::RaidLeadershipUpdate_Struct *outlaa = (structs::RaidLeadershipUpdate_Struct *)outapp->pBuffer;
|
structs::RaidMOTD_Struct* eq = (structs::RaidMOTD_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(motd);
|
||||||
|
|
||||||
outlaa->action = inlaa->action;
|
|
||||||
strn0cpy(outlaa->player_name, inlaa->player_name, 64);
|
|
||||||
strn0cpy(outlaa->leader_name, inlaa->leader_name, 64);
|
|
||||||
memcpy(&outlaa->raid, &inlaa->raid, sizeof(RaidLeadershipAA_Struct));
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
case raidSetLeaderAbilities:
|
||||||
|
case raidMakeLeader:
|
||||||
{
|
{
|
||||||
RaidGeneral_Struct* in_raid_general = (RaidGeneral_Struct*)__emu_buffer;
|
RaidLeadershipUpdate_Struct* emu = (RaidLeadershipUpdate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
||||||
|
structs::RaidLeadershipUpdate_Struct* eq = (structs::RaidLeadershipUpdate_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT_str(player_name);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
memcpy(&eq->raid, &emu->raid, sizeof(RaidLeadershipAA_Struct));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
auto emu = (RaidNote_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidNote_Struct));
|
||||||
|
auto eq = (structs::RaidNote_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(note);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidNoRaid:
|
||||||
|
{
|
||||||
|
dest->QueuePacket(inapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
RaidGeneral_Struct* emu = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *raid_general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
structs::RaidGeneral_Struct* eq = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
strn0cpy(raid_general->leader_name, in_raid_general->leader_name, 64);
|
|
||||||
strn0cpy(raid_general->player_name, in_raid_general->player_name, 64);
|
|
||||||
raid_general->action = in_raid_general->action;
|
|
||||||
raid_general->parameter = in_raid_general->parameter;
|
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT(parameter);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
OUT_str(player_name);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2743,34 +2780,44 @@ namespace SoF
|
|||||||
{
|
{
|
||||||
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
||||||
|
|
||||||
// This is a switch on the RaidGeneral action
|
RaidGeneral_Struct* rgs = (RaidGeneral_Struct*)__packet->pBuffer;
|
||||||
switch (*(uint32 *)__packet->pBuffer) {
|
|
||||||
case 35: { // raidMOTD
|
switch (rgs->action)
|
||||||
// we don't have a nice macro for this
|
{
|
||||||
structs::RaidMOTD_Struct *__eq_buffer = (structs::RaidMOTD_Struct *)__packet->pBuffer;
|
case raidSetMotd:
|
||||||
__eq_buffer->motd[1023] = '\0';
|
{
|
||||||
size_t motd_size = strlen(__eq_buffer->motd) + 1;
|
SETUP_VAR_DECODE(RaidMOTD_Struct, structs::RaidMOTD_Struct, motd);
|
||||||
__packet->size = sizeof(RaidMOTD_Struct) + motd_size;
|
|
||||||
__packet->pBuffer = new unsigned char[__packet->size];
|
|
||||||
RaidMOTD_Struct *emu = (RaidMOTD_Struct *)__packet->pBuffer;
|
|
||||||
structs::RaidMOTD_Struct *eq = (structs::RaidMOTD_Struct *)__eq_buffer;
|
|
||||||
strn0cpy(emu->general.player_name, eq->general.player_name, 64);
|
|
||||||
strn0cpy(emu->motd, eq->motd, motd_size);
|
|
||||||
IN(general.action);
|
IN(general.action);
|
||||||
IN(general.parameter);
|
IN(general.parameter);
|
||||||
FINISH_DIRECT_DECODE();
|
IN_str(general.leader_name);
|
||||||
|
IN_str(general.player_name);
|
||||||
|
IN_str(motd);
|
||||||
|
|
||||||
|
FINISH_VAR_DECODE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 36: { // raidPlayerNote unhandled
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
SETUP_VAR_DECODE(RaidNote_Struct, structs::RaidNote_Struct, note);
|
||||||
|
|
||||||
|
IN(general.action);
|
||||||
|
IN(general.parameter);
|
||||||
|
IN_str(general.leader_name);
|
||||||
|
IN_str(general.player_name);
|
||||||
|
IN_str(note);
|
||||||
|
|
||||||
|
FINISH_VAR_DECODE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default:
|
||||||
DECODE_LENGTH_EXACT(structs::RaidGeneral_Struct);
|
{
|
||||||
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
||||||
strn0cpy(emu->leader_name, eq->leader_name, 64);
|
|
||||||
strn0cpy(emu->player_name, eq->player_name, 64);
|
|
||||||
IN(action);
|
IN(action);
|
||||||
IN(parameter);
|
IN(parameter);
|
||||||
|
IN_str(leader_name);
|
||||||
|
IN_str(player_name);
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3517,9 +3517,14 @@ struct RaidAddMember_Struct {
|
|||||||
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct RaidNote_Struct {
|
||||||
|
/*000*/ RaidGeneral_Struct general;
|
||||||
|
/*140*/ char note[64];
|
||||||
|
};
|
||||||
|
|
||||||
struct RaidMOTD_Struct {
|
struct RaidMOTD_Struct {
|
||||||
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
||||||
/*140*/ char motd[0]; // max size 1024, but reply is variable
|
/*140*/ char motd[1024]; // max size is 1024, but reply is variable
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidLeadershipUpdate_Struct {
|
struct RaidLeadershipUpdate_Struct {
|
||||||
|
|||||||
@@ -128,6 +128,15 @@
|
|||||||
emu_struct *emu = (emu_struct *) __packet->pBuffer; \
|
emu_struct *emu = (emu_struct *) __packet->pBuffer; \
|
||||||
eq_struct *eq = (eq_struct *) __eq_buffer;
|
eq_struct *eq = (eq_struct *) __eq_buffer;
|
||||||
|
|
||||||
|
#define SETUP_VAR_DECODE(emu_struct, eq_struct, var_field) \
|
||||||
|
unsigned char *__eq_buffer = __packet->pBuffer; \
|
||||||
|
eq_struct* in = (eq_struct*)__packet->pBuffer; \
|
||||||
|
auto size = strlen(in->var_field); \
|
||||||
|
__packet->size = sizeof(emu_struct) + size + 1; \
|
||||||
|
__packet->pBuffer = new unsigned char[__packet->size]; \
|
||||||
|
emu_struct *emu = (emu_struct *) __packet->pBuffer; \
|
||||||
|
eq_struct *eq = (eq_struct *) __eq_buffer;
|
||||||
|
|
||||||
#define MEMSET_IN(emu_struct) \
|
#define MEMSET_IN(emu_struct) \
|
||||||
memset(__packet->pBuffer, 0, sizeof(emu_struct));
|
memset(__packet->pBuffer, 0, sizeof(emu_struct));
|
||||||
|
|
||||||
@@ -146,6 +155,9 @@
|
|||||||
delete[] __eq_buffer; \
|
delete[] __eq_buffer; \
|
||||||
p->SetOpcode(OP_Unknown);
|
p->SetOpcode(OP_Unknown);
|
||||||
|
|
||||||
|
#define FINISH_VAR_DECODE() \
|
||||||
|
delete[] __eq_buffer;
|
||||||
|
|
||||||
//call to finish an encoder using SETUP_DIRECT_DECODE
|
//call to finish an encoder using SETUP_DIRECT_DECODE
|
||||||
#define FINISH_DIRECT_DECODE() \
|
#define FINISH_DIRECT_DECODE() \
|
||||||
delete[] __eq_buffer;
|
delete[] __eq_buffer;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include "../item_instance.h"
|
#include "../item_instance.h"
|
||||||
#include "titanium_structs.h"
|
#include "titanium_structs.h"
|
||||||
#include "../path_manager.h"
|
#include "../path_manager.h"
|
||||||
|
#include "../raid.h"
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
@@ -1245,6 +1246,119 @@ namespace Titanium
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_MarkRaidNPC)
|
||||||
|
{
|
||||||
|
ENCODE_LENGTH_EXACT(MarkNPC_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(MarkNPC_Struct, MarkNPC_Struct);
|
||||||
|
|
||||||
|
EQApplicationPacket* outapp = new EQApplicationPacket(OP_MarkNPC, sizeof(MarkNPC_Struct));
|
||||||
|
MarkNPC_Struct* mnpcs = (MarkNPC_Struct*)outapp->pBuffer;
|
||||||
|
mnpcs->TargetID = emu->TargetID;
|
||||||
|
mnpcs->Number = emu->Number;
|
||||||
|
dest->QueuePacket(outapp);
|
||||||
|
safe_delete(outapp);
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_RaidUpdate)
|
||||||
|
{
|
||||||
|
EQApplicationPacket* inapp = *p;
|
||||||
|
*p = nullptr;
|
||||||
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
|
RaidGeneral_Struct* raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
switch (raid_gen->action)
|
||||||
|
{
|
||||||
|
case raidAdd:
|
||||||
|
{
|
||||||
|
RaidAddMember_Struct* emu = (RaidAddMember_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
||||||
|
structs::RaidAddMember_Struct* eq = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(raidGen.action);
|
||||||
|
OUT(raidGen.parameter);
|
||||||
|
OUT_str(raidGen.leader_name);
|
||||||
|
OUT_str(raidGen.player_name);
|
||||||
|
OUT(_class);
|
||||||
|
OUT(level);
|
||||||
|
OUT(isGroupLeader);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
case raidSetMotd:
|
||||||
|
{
|
||||||
|
RaidMOTD_Struct* emu = (RaidMOTD_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct));
|
||||||
|
structs::RaidMOTD_Struct* eq = (structs::RaidMOTD_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(motd);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidSetLeaderAbilities:
|
||||||
|
case raidMakeLeader:
|
||||||
|
{
|
||||||
|
RaidLeadershipUpdate_Struct* emu = (RaidLeadershipUpdate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
||||||
|
structs::RaidLeadershipUpdate_Struct* eq = (structs::RaidLeadershipUpdate_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT_str(player_name);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
memcpy(&eq->raid, &emu->raid, sizeof(RaidLeadershipAA_Struct));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
auto emu = (RaidNote_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidNote_Struct));
|
||||||
|
auto eq = (structs::RaidNote_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(note);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidNoRaid:
|
||||||
|
{
|
||||||
|
dest->QueuePacket(inapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
RaidGeneral_Struct* emu = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
|
structs::RaidGeneral_Struct* eq = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT(parameter);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
OUT_str(player_name);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
safe_delete(inapp);
|
||||||
|
}
|
||||||
|
|
||||||
ENCODE(OP_ReadBook)
|
ENCODE(OP_ReadBook)
|
||||||
{
|
{
|
||||||
// no apparent slot translation needed
|
// no apparent slot translation needed
|
||||||
@@ -2272,6 +2386,63 @@ namespace Titanium
|
|||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DECODE(OP_RaidInvite)
|
||||||
|
{
|
||||||
|
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
||||||
|
RaidGeneral_Struct* rgs = (RaidGeneral_Struct*)__packet->pBuffer;
|
||||||
|
|
||||||
|
switch (rgs->action)
|
||||||
|
{
|
||||||
|
case raidSetMotd:
|
||||||
|
{
|
||||||
|
SETUP_VAR_DECODE(RaidMOTD_Struct, structs::RaidMOTD_Struct, motd);
|
||||||
|
|
||||||
|
IN(general.action);
|
||||||
|
IN(general.parameter);
|
||||||
|
IN_str(general.leader_name);
|
||||||
|
IN_str(general.player_name);
|
||||||
|
|
||||||
|
auto len = 0;
|
||||||
|
if (__packet->size < sizeof(structs::RaidMOTD_Struct)) {
|
||||||
|
len = __packet->size - sizeof(structs::RaidGeneral_Struct);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
len = sizeof(eq->motd);
|
||||||
|
}
|
||||||
|
|
||||||
|
strn0cpy(emu->motd, eq->motd, len > 1024 ? 1024 : len);
|
||||||
|
emu->motd[len - 1] = '\0';
|
||||||
|
|
||||||
|
FINISH_VAR_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
SETUP_VAR_DECODE(RaidNote_Struct, structs::RaidNote_Struct, note);
|
||||||
|
|
||||||
|
IN(general.action);
|
||||||
|
IN(general.parameter);
|
||||||
|
IN_str(general.leader_name);
|
||||||
|
IN_str(general.player_name);
|
||||||
|
IN_str(note);
|
||||||
|
|
||||||
|
FINISH_VAR_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
||||||
|
IN(action);
|
||||||
|
IN(parameter);
|
||||||
|
IN_str(leader_name);
|
||||||
|
IN_str(player_name);
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DECODE(OP_ReadBook)
|
DECODE(OP_ReadBook)
|
||||||
{
|
{
|
||||||
// no apparent slot translation needed
|
// no apparent slot translation needed
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ E(OP_OnLevelMessage)
|
|||||||
E(OP_PetBuffWindow)
|
E(OP_PetBuffWindow)
|
||||||
E(OP_PlayerProfile)
|
E(OP_PlayerProfile)
|
||||||
E(OP_NewSpawn)
|
E(OP_NewSpawn)
|
||||||
|
E(OP_MarkRaidNPC)
|
||||||
|
E(OP_RaidUpdate)
|
||||||
E(OP_ReadBook)
|
E(OP_ReadBook)
|
||||||
E(OP_RespondAA)
|
E(OP_RespondAA)
|
||||||
E(OP_SendCharInfo)
|
E(OP_SendCharInfo)
|
||||||
@@ -106,6 +108,7 @@ D(OP_LoadSpellSet)
|
|||||||
D(OP_LootItem)
|
D(OP_LootItem)
|
||||||
D(OP_MoveItem)
|
D(OP_MoveItem)
|
||||||
D(OP_PetCommands)
|
D(OP_PetCommands)
|
||||||
|
D(OP_RaidInvite)
|
||||||
D(OP_ReadBook)
|
D(OP_ReadBook)
|
||||||
D(OP_SetServerFilter)
|
D(OP_SetServerFilter)
|
||||||
D(OP_ShopPlayerSell)
|
D(OP_ShopPlayerSell)
|
||||||
|
|||||||
@@ -3017,23 +3017,39 @@ struct leadExpUpdateStruct {
|
|||||||
/*0028*/ uint32 unknown0028;
|
/*0028*/ uint32 unknown0028;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct RaidGeneral_Struct {
|
struct RaidGeneral_Struct {
|
||||||
/*00*/ uint32 action; //=10
|
/*000*/ uint32 action; //=10
|
||||||
/*04*/ char player_name[64]; //should both be the player's name
|
/*004*/ char player_name[64]; //should both be the player's name
|
||||||
/*04*/ char leader_name[64];
|
/*068*/ char leader_name[64];
|
||||||
/*132*/ uint32 parameter;
|
/*132*/ uint32 parameter;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidAdd_Struct {
|
struct RaidAddMember_Struct {
|
||||||
/*000*/ uint32 action; //=0
|
/*000*/ RaidGeneral_Struct raidGen;
|
||||||
/*004*/ char player_name[64]; //should both be the player's name
|
/*136*/ uint8 _class;
|
||||||
/*068*/ char leader_name[64];
|
/*137*/ uint8 level;
|
||||||
/*132*/ uint8 _class;
|
/*138*/ uint8 isGroupLeader;
|
||||||
/*133*/ uint8 level;
|
/*139*/ uint8 unknown139; //seems to be 0x42 or 0
|
||||||
/*134*/ uint8 has_group;
|
};
|
||||||
/*135*/ uint8 unknown135; //seems to be 0x42 or 0
|
|
||||||
|
struct RaidNote_Struct {
|
||||||
|
/*000*/ RaidGeneral_Struct general;
|
||||||
|
/*136*/ char note[64];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct RaidMOTD_Struct {
|
||||||
|
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
||||||
|
/*136*/ char motd[1024]; // max size is 1024, but reply is variable
|
||||||
|
};
|
||||||
|
|
||||||
|
struct RaidLeadershipUpdate_Struct {
|
||||||
|
/*000*/ uint32 action;
|
||||||
|
/*004*/ char player_name[64];
|
||||||
|
// /*068*/ uint32 Unknown068;
|
||||||
|
/*072*/ char leader_name[64];
|
||||||
|
/*136*/ GroupLeadershipAA_Struct group; //unneeded
|
||||||
|
/*200*/ RaidLeadershipAA_Struct raid;
|
||||||
|
/*264*/ char Unknown264[128];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidCreate_Struct {
|
struct RaidCreate_Struct {
|
||||||
|
|||||||
+123
-77
@@ -35,6 +35,7 @@
|
|||||||
#include "../path_manager.h"
|
#include "../path_manager.h"
|
||||||
#include "../classes.h"
|
#include "../classes.h"
|
||||||
#include "../races.h"
|
#include "../races.h"
|
||||||
|
#include "../raid.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@@ -1931,88 +1932,124 @@ namespace UF
|
|||||||
|
|
||||||
ENCODE(OP_RaidJoin)
|
ENCODE(OP_RaidJoin)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
*p = nullptr;
|
||||||
RaidCreate_Struct *raid_create = (RaidCreate_Struct*)__emu_buffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
|
RaidCreate_Struct* emu = (RaidCreate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp_create = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *general = (structs::RaidGeneral_Struct*)outapp_create->pBuffer;
|
structs::RaidGeneral_Struct* general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
general->action = 8;
|
general->action = raidCreate;
|
||||||
general->parameter = 1;
|
general->parameter = RaidCommandAcceptInvite;
|
||||||
strn0cpy(general->leader_name, raid_create->leader_name, 64);
|
strn0cpy(general->leader_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
strn0cpy(general->player_name, raid_create->leader_name, 64);
|
strn0cpy(general->player_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
|
||||||
dest->FastQueuePacket(&outapp_create);
|
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_RaidUpdate)
|
ENCODE(OP_RaidUpdate)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
*p = nullptr;
|
*p = nullptr;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
RaidGeneral_Struct *raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
RaidGeneral_Struct* raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
if (raid_gen->action == 0) // raid add has longer length than other raid updates
|
switch (raid_gen->action)
|
||||||
{
|
{
|
||||||
RaidAddMember_Struct* in_add_member = (RaidAddMember_Struct*)__emu_buffer;
|
case raidAdd:
|
||||||
|
{
|
||||||
|
RaidAddMember_Struct* emu = (RaidAddMember_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
||||||
structs::RaidAddMember_Struct *add_member = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
structs::RaidAddMember_Struct* eq = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
add_member->raidGen.action = in_add_member->raidGen.action;
|
OUT(raidGen.action);
|
||||||
add_member->raidGen.parameter = in_add_member->raidGen.parameter;
|
OUT(raidGen.parameter);
|
||||||
strn0cpy(add_member->raidGen.leader_name, in_add_member->raidGen.leader_name, 64);
|
OUT_str(raidGen.leader_name);
|
||||||
strn0cpy(add_member->raidGen.player_name, in_add_member->raidGen.player_name, 64);
|
OUT_str(raidGen.player_name);
|
||||||
add_member->_class = in_add_member->_class;
|
OUT(_class);
|
||||||
add_member->level = in_add_member->level;
|
OUT(level);
|
||||||
add_member->isGroupLeader = in_add_member->isGroupLeader;
|
OUT(isGroupLeader);
|
||||||
add_member->flags[0] = in_add_member->flags[0];
|
OUT(flags[0]);
|
||||||
add_member->flags[1] = in_add_member->flags[1];
|
OUT(flags[1]);
|
||||||
add_member->flags[2] = in_add_member->flags[2];
|
OUT(flags[2]);
|
||||||
add_member->flags[3] = in_add_member->flags[3];
|
OUT(flags[3]);
|
||||||
add_member->flags[4] = in_add_member->flags[4];
|
OUT(flags[4]);
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
else if (raid_gen->action == 35)
|
|
||||||
{
|
|
||||||
RaidMOTD_Struct *inmotd = (RaidMOTD_Struct *)__emu_buffer;
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct) +
|
|
||||||
strlen(inmotd->motd) + 1);
|
|
||||||
structs::RaidMOTD_Struct *outmotd = (structs::RaidMOTD_Struct *)outapp->pBuffer;
|
|
||||||
|
|
||||||
outmotd->general.action = inmotd->general.action;
|
|
||||||
strn0cpy(outmotd->general.player_name, inmotd->general.player_name, 64);
|
|
||||||
strn0cpy(outmotd->motd, inmotd->motd, strlen(inmotd->motd) + 1);
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (raid_gen->action == 14 || raid_gen->action == 30)
|
case raidSetMotd:
|
||||||
{
|
{
|
||||||
RaidLeadershipUpdate_Struct *inlaa = (RaidLeadershipUpdate_Struct *)__emu_buffer;
|
RaidMOTD_Struct* emu = (RaidMOTD_Struct*)__emu_buffer;
|
||||||
auto outapp =
|
|
||||||
new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct));
|
||||||
structs::RaidLeadershipUpdate_Struct *outlaa = (structs::RaidLeadershipUpdate_Struct *)outapp->pBuffer;
|
structs::RaidMOTD_Struct* eq = (structs::RaidMOTD_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(motd);
|
||||||
|
|
||||||
outlaa->action = inlaa->action;
|
|
||||||
strn0cpy(outlaa->player_name, inlaa->player_name, 64);
|
|
||||||
strn0cpy(outlaa->leader_name, inlaa->leader_name, 64);
|
|
||||||
memcpy(&outlaa->raid, &inlaa->raid, sizeof(RaidLeadershipAA_Struct));
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
case raidSetLeaderAbilities:
|
||||||
|
case raidMakeLeader:
|
||||||
{
|
{
|
||||||
RaidGeneral_Struct* in_raid_general = (RaidGeneral_Struct*)__emu_buffer;
|
RaidLeadershipUpdate_Struct* emu = (RaidLeadershipUpdate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
||||||
|
structs::RaidLeadershipUpdate_Struct* eq = (structs::RaidLeadershipUpdate_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT_str(player_name);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
memcpy(&eq->raid, &emu->raid, sizeof(RaidLeadershipAA_Struct));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
auto emu = (RaidNote_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidNote_Struct));
|
||||||
|
auto eq = (structs::RaidNote_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(note);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidNoRaid:
|
||||||
|
{
|
||||||
|
dest->QueuePacket(inapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
RaidGeneral_Struct* emu = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *raid_general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
structs::RaidGeneral_Struct* eq = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
strn0cpy(raid_general->leader_name, in_raid_general->leader_name, 64);
|
|
||||||
strn0cpy(raid_general->player_name, in_raid_general->player_name, 64);
|
|
||||||
raid_general->action = in_raid_general->action;
|
|
||||||
raid_general->parameter = in_raid_general->parameter;
|
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT(parameter);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
OUT_str(player_name);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3637,39 +3674,48 @@ namespace UF
|
|||||||
{
|
{
|
||||||
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
||||||
|
|
||||||
// This is a switch on the RaidGeneral action
|
RaidGeneral_Struct* rgs = (RaidGeneral_Struct*)__packet->pBuffer;
|
||||||
switch (*(uint32 *)__packet->pBuffer) {
|
|
||||||
case 35: { // raidMOTD
|
switch (rgs->action)
|
||||||
// we don't have a nice macro for this
|
{
|
||||||
structs::RaidMOTD_Struct *__eq_buffer = (structs::RaidMOTD_Struct *)__packet->pBuffer;
|
case raidSetMotd:
|
||||||
__eq_buffer->motd[1023] = '\0';
|
{
|
||||||
size_t motd_size = strlen(__eq_buffer->motd) + 1;
|
SETUP_VAR_DECODE(RaidMOTD_Struct, structs::RaidMOTD_Struct, motd);
|
||||||
__packet->size = sizeof(RaidMOTD_Struct) + motd_size;
|
|
||||||
__packet->pBuffer = new unsigned char[__packet->size];
|
|
||||||
RaidMOTD_Struct *emu = (RaidMOTD_Struct *)__packet->pBuffer;
|
|
||||||
structs::RaidMOTD_Struct *eq = (structs::RaidMOTD_Struct *)__eq_buffer;
|
|
||||||
strn0cpy(emu->general.player_name, eq->general.player_name, 64);
|
|
||||||
strn0cpy(emu->motd, eq->motd, motd_size);
|
|
||||||
IN(general.action);
|
IN(general.action);
|
||||||
IN(general.parameter);
|
IN(general.parameter);
|
||||||
FINISH_DIRECT_DECODE();
|
IN_str(general.leader_name);
|
||||||
|
IN_str(general.player_name);
|
||||||
|
IN_str(motd);
|
||||||
|
|
||||||
|
FINISH_VAR_DECODE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 36: { // raidPlayerNote unhandled
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
SETUP_VAR_DECODE(RaidNote_Struct, structs::RaidNote_Struct, note);
|
||||||
|
|
||||||
|
IN(general.action);
|
||||||
|
IN(general.parameter);
|
||||||
|
IN_str(general.leader_name);
|
||||||
|
IN_str(general.player_name);
|
||||||
|
IN_str(note);
|
||||||
|
|
||||||
|
FINISH_VAR_DECODE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default:
|
||||||
DECODE_LENGTH_EXACT(structs::RaidGeneral_Struct);
|
{
|
||||||
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
||||||
strn0cpy(emu->leader_name, eq->leader_name, 64);
|
|
||||||
strn0cpy(emu->player_name, eq->player_name, 64);
|
|
||||||
IN(action);
|
IN(action);
|
||||||
IN(parameter);
|
IN(parameter);
|
||||||
|
IN_str(leader_name);
|
||||||
|
IN_str(player_name);
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DECODE(OP_ReadBook)
|
DECODE(OP_ReadBook)
|
||||||
|
|||||||
@@ -3647,9 +3647,14 @@ struct RaidAddMember_Struct {
|
|||||||
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct RaidNote_Struct {
|
||||||
|
/*000*/ RaidGeneral_Struct general;
|
||||||
|
/*140*/ char note[64];
|
||||||
|
};
|
||||||
|
|
||||||
struct RaidMOTD_Struct {
|
struct RaidMOTD_Struct {
|
||||||
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
/*000*/ RaidGeneral_Struct general;
|
||||||
/*140*/ char motd[0]; // max size 1024, but reply is variable
|
/*140*/ char motd[1024];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidLeadershipUpdate_Struct {
|
struct RaidLeadershipUpdate_Struct {
|
||||||
|
|||||||
@@ -72,6 +72,8 @@ std::string GetPlatformName()
|
|||||||
return "HC";
|
return "HC";
|
||||||
case EQEmuExePlatform::ExePlatformTests:
|
case EQEmuExePlatform::ExePlatformTests:
|
||||||
return "Tests";
|
return "Tests";
|
||||||
|
case EQEmuExePlatform::ExePlatformZoneSidecar:
|
||||||
|
return "ZoneSidecar";
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -37,7 +37,8 @@ enum EQEmuExePlatform
|
|||||||
ExePlatformClientImport,
|
ExePlatformClientImport,
|
||||||
ExePlatformClientExport,
|
ExePlatformClientExport,
|
||||||
ExePlatformHC,
|
ExePlatformHC,
|
||||||
ExePlatformTests
|
ExePlatformTests,
|
||||||
|
ExePlatformZoneSidecar
|
||||||
};
|
};
|
||||||
|
|
||||||
void RegisterExecutablePlatform(EQEmuExePlatform p);
|
void RegisterExecutablePlatform(EQEmuExePlatform p);
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
#include <string>
|
||||||
|
#include <fstream>
|
||||||
|
#include <algorithm>
|
||||||
|
#include "process.h"
|
||||||
|
|
||||||
|
inline std::string random_string(size_t length)
|
||||||
|
{
|
||||||
|
auto randchar = []() -> char {
|
||||||
|
const char charset[] = "0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz";
|
||||||
|
const size_t max_index = (sizeof(charset) - 1);
|
||||||
|
return charset[static_cast<size_t>(std::rand()) % max_index];
|
||||||
|
};
|
||||||
|
std::string str(length, 0);
|
||||||
|
std::generate_n(str.begin(), length, randchar);
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Process::execute(const std::string &cmd, bool return_result)
|
||||||
|
{
|
||||||
|
std::string random = "/tmp/" + random_string(25);
|
||||||
|
const char *file_name = random.c_str();
|
||||||
|
|
||||||
|
if (return_result) {
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
std::system((cmd + " > " + file_name + " 2>&1").c_str());
|
||||||
|
#else
|
||||||
|
std::system((cmd + " > " + file_name + " 2>&1").c_str());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
std::system((cmd).c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string result;
|
||||||
|
|
||||||
|
if (return_result) {
|
||||||
|
std::ifstream file(file_name);
|
||||||
|
result = {std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>()};
|
||||||
|
std::remove(file_name);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#ifndef EQEMU_PROCESS_H
|
||||||
|
#define EQEMU_PROCESS_H
|
||||||
|
|
||||||
|
class Process {
|
||||||
|
public:
|
||||||
|
static std::string execute(const std::string &cmd, bool return_result = true);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif //EQEMU_PROCESS_H
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
/* EQEMu: Everquest Server Emulator
|
||||||
|
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemu.org)
|
||||||
|
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef RAID_H
|
||||||
|
#define RAID_H
|
||||||
|
|
||||||
|
enum { //raid packet types:
|
||||||
|
raidAdd = 0,
|
||||||
|
raidRemove2 = 1, //parameter=0
|
||||||
|
raidMemberNameChange = 2,
|
||||||
|
raidRemove1 = 3, //parameter=0xFFFFFFFF
|
||||||
|
raidNoLongerLeader = 4,
|
||||||
|
raidDisband = 5,
|
||||||
|
raidMembers = 6, //len 395+, details + members list
|
||||||
|
raidNoAssignLeadership = 7,
|
||||||
|
raidCreate = 8, //len 72
|
||||||
|
raidUnknown = 9, // unused?
|
||||||
|
raidNoRaid = 10, //parameter=0
|
||||||
|
raidChangeLootType = 11,
|
||||||
|
raidStringID = 12,
|
||||||
|
raidChangeGroupLeader = 13, //136 raid leader, new group leader, group_id?
|
||||||
|
raidSetLeaderAbilities = 14, //472
|
||||||
|
raidSetLeaderData = 15, // 14,15 SoE names, not sure on difference, 14 packet has 0x100 bytes 15 0x214 in addition to raid general
|
||||||
|
raidChangeGroup = 16, //?? len 136 old leader, new leader, 0 (preceeded with a remove2)
|
||||||
|
raidLock = 17, //len 136 leader?, leader, 0
|
||||||
|
raidUnlock = 18, //len 136 leader?, leader, 0
|
||||||
|
raidRedStringID = 19,
|
||||||
|
raidSetLeader = 20, //len 388, contains 'details' struct without members; also used for "invite to raid"
|
||||||
|
raidMakeLeader = 30,
|
||||||
|
raidSetMotd = 35,
|
||||||
|
raidSetNote = 36,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
enum { //raid command types
|
||||||
|
RaidCommandInviteIntoExisting = 0, //in use
|
||||||
|
RaidCommandAcceptInvite = 1, //in use
|
||||||
|
RaidCommandInvite = 3, //in use
|
||||||
|
RaidCommandDisband = 5, //in use
|
||||||
|
RaidCommandMoveGroup = 6, //in use
|
||||||
|
RaidCommandRemoveGroupLeader = 7,
|
||||||
|
RaidCommandRaidLock = 8, //in use
|
||||||
|
RaidCommandRaidUnlock = 9, //in use
|
||||||
|
RaidCommandLootType = 20, //in use
|
||||||
|
RaidCommandAddLooter = 21, //in use
|
||||||
|
RaidCommandRemoveLooter = 22, //in use
|
||||||
|
RaidCommandMakeLeader = 30,
|
||||||
|
RaidCommandInviteFail = 31, //already in raid, waiting on invite from other raid, etc
|
||||||
|
RaidCommandLootType2 = 32, //in use
|
||||||
|
RaidCommandAddLooter2 = 33, //in use
|
||||||
|
RaidCommandRemoveLooter2 = 34, //in use
|
||||||
|
RaidCommandSetMotd = 35,
|
||||||
|
RaidCommandSetNote = 36,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,414 @@
|
|||||||
|
/**
|
||||||
|
* 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_BOT_STARTING_ITEMS_REPOSITORY_H
|
||||||
|
#define EQEMU_BASE_BOT_STARTING_ITEMS_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../../database.h"
|
||||||
|
#include "../../strings.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
|
|
||||||
|
class BaseBotStartingItemsRepository {
|
||||||
|
public:
|
||||||
|
struct BotStartingItems {
|
||||||
|
uint32_t id;
|
||||||
|
uint32_t races;
|
||||||
|
uint32_t classes;
|
||||||
|
uint32_t item_id;
|
||||||
|
uint8_t item_charges;
|
||||||
|
int32_t slot_id;
|
||||||
|
int8_t min_expansion;
|
||||||
|
int8_t max_expansion;
|
||||||
|
std::string content_flags;
|
||||||
|
std::string content_flags_disabled;
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::string PrimaryKey()
|
||||||
|
{
|
||||||
|
return std::string("id");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> Columns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"races",
|
||||||
|
"classes",
|
||||||
|
"item_id",
|
||||||
|
"item_charges",
|
||||||
|
"slot_id",
|
||||||
|
"min_expansion",
|
||||||
|
"max_expansion",
|
||||||
|
"content_flags",
|
||||||
|
"content_flags_disabled",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"races",
|
||||||
|
"classes",
|
||||||
|
"item_id",
|
||||||
|
"item_charges",
|
||||||
|
"slot_id",
|
||||||
|
"min_expansion",
|
||||||
|
"max_expansion",
|
||||||
|
"content_flags",
|
||||||
|
"content_flags_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("bot_starting_items");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseSelect()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"SELECT {} FROM {}",
|
||||||
|
SelectColumnsRaw(),
|
||||||
|
TableName()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseInsert()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"INSERT INTO {} ({}) ",
|
||||||
|
TableName(),
|
||||||
|
ColumnsRaw()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static BotStartingItems NewEntity()
|
||||||
|
{
|
||||||
|
BotStartingItems e{};
|
||||||
|
|
||||||
|
e.id = 0;
|
||||||
|
e.races = 0;
|
||||||
|
e.classes = 0;
|
||||||
|
e.item_id = 0;
|
||||||
|
e.item_charges = 1;
|
||||||
|
e.slot_id = -1;
|
||||||
|
e.min_expansion = -1;
|
||||||
|
e.max_expansion = -1;
|
||||||
|
e.content_flags = "";
|
||||||
|
e.content_flags_disabled = "";
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BotStartingItems GetBotStartingItems(
|
||||||
|
const std::vector<BotStartingItems> &bot_starting_itemss,
|
||||||
|
int bot_starting_items_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
for (auto &bot_starting_items : bot_starting_itemss) {
|
||||||
|
if (bot_starting_items.id == bot_starting_items_id) {
|
||||||
|
return bot_starting_items;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static BotStartingItems FindOne(
|
||||||
|
Database& db,
|
||||||
|
int bot_starting_items_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE {} = {} LIMIT 1",
|
||||||
|
BaseSelect(),
|
||||||
|
PrimaryKey(),
|
||||||
|
bot_starting_items_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
auto row = results.begin();
|
||||||
|
if (results.RowCount() == 1) {
|
||||||
|
BotStartingItems e{};
|
||||||
|
|
||||||
|
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||||
|
e.races = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||||
|
e.classes = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||||
|
e.item_id = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||||
|
e.item_charges = static_cast<uint8_t>(strtoul(row[4], nullptr, 10));
|
||||||
|
e.slot_id = static_cast<int32_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;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteOne(
|
||||||
|
Database& db,
|
||||||
|
int bot_starting_items_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
PrimaryKey(),
|
||||||
|
bot_starting_items_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int UpdateOne(
|
||||||
|
Database& db,
|
||||||
|
const BotStartingItems &e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto columns = Columns();
|
||||||
|
|
||||||
|
v.push_back(columns[1] + " = " + std::to_string(e.races));
|
||||||
|
v.push_back(columns[2] + " = " + std::to_string(e.classes));
|
||||||
|
v.push_back(columns[3] + " = " + std::to_string(e.item_id));
|
||||||
|
v.push_back(columns[4] + " = " + std::to_string(e.item_charges));
|
||||||
|
v.push_back(columns[5] + " = " + std::to_string(e.slot_id));
|
||||||
|
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(
|
||||||
|
"UPDATE {} SET {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
Strings::Implode(", ", v),
|
||||||
|
PrimaryKey(),
|
||||||
|
e.id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static BotStartingItems InsertOne(
|
||||||
|
Database& db,
|
||||||
|
BotStartingItems e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.races));
|
||||||
|
v.push_back(std::to_string(e.classes));
|
||||||
|
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.slot_id));
|
||||||
|
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(
|
||||||
|
"{} 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<BotStartingItems> &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.races));
|
||||||
|
v.push_back(std::to_string(e.classes));
|
||||||
|
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.slot_id));
|
||||||
|
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) + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
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<BotStartingItems> All(Database& db)
|
||||||
|
{
|
||||||
|
std::vector<BotStartingItems> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{}",
|
||||||
|
BaseSelect()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
BotStartingItems e{};
|
||||||
|
|
||||||
|
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||||
|
e.races = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||||
|
e.classes = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||||
|
e.item_id = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||||
|
e.item_charges = static_cast<uint8_t>(strtoul(row[4], nullptr, 10));
|
||||||
|
e.slot_id = static_cast<int32_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);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<BotStartingItems> GetWhere(Database& db, const std::string &where_filter)
|
||||||
|
{
|
||||||
|
std::vector<BotStartingItems> 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) {
|
||||||
|
BotStartingItems e{};
|
||||||
|
|
||||||
|
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||||
|
e.races = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||||
|
e.classes = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||||
|
e.item_id = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||||
|
e.item_charges = static_cast<uint8_t>(strtoul(row[4], nullptr, 10));
|
||||||
|
e.slot_id = static_cast<int32_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);
|
||||||
|
}
|
||||||
|
|
||||||
|
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_BOT_STARTING_ITEMS_REPOSITORY_H
|
||||||
@@ -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 "../../strings.h"
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
|
|
||||||
class BaseSpawn2Repository {
|
class BaseSpawn2Repository {
|
||||||
public:
|
public:
|
||||||
struct Spawn2 {
|
struct Spawn2 {
|
||||||
@@ -33,7 +34,6 @@ public:
|
|||||||
int8_t path_when_zone_idle;
|
int8_t path_when_zone_idle;
|
||||||
uint32_t _condition;
|
uint32_t _condition;
|
||||||
int32_t cond_value;
|
int32_t cond_value;
|
||||||
uint8_t enabled;
|
|
||||||
uint8_t animation;
|
uint8_t animation;
|
||||||
int8_t min_expansion;
|
int8_t min_expansion;
|
||||||
int8_t max_expansion;
|
int8_t max_expansion;
|
||||||
@@ -63,7 +63,6 @@ public:
|
|||||||
"path_when_zone_idle",
|
"path_when_zone_idle",
|
||||||
"_condition",
|
"_condition",
|
||||||
"cond_value",
|
"cond_value",
|
||||||
"enabled",
|
|
||||||
"animation",
|
"animation",
|
||||||
"min_expansion",
|
"min_expansion",
|
||||||
"max_expansion",
|
"max_expansion",
|
||||||
@@ -89,7 +88,6 @@ public:
|
|||||||
"path_when_zone_idle",
|
"path_when_zone_idle",
|
||||||
"_condition",
|
"_condition",
|
||||||
"cond_value",
|
"cond_value",
|
||||||
"enabled",
|
|
||||||
"animation",
|
"animation",
|
||||||
"min_expansion",
|
"min_expansion",
|
||||||
"max_expansion",
|
"max_expansion",
|
||||||
@@ -149,7 +147,6 @@ public:
|
|||||||
e.path_when_zone_idle = 0;
|
e.path_when_zone_idle = 0;
|
||||||
e._condition = 0;
|
e._condition = 0;
|
||||||
e.cond_value = 1;
|
e.cond_value = 1;
|
||||||
e.enabled = 1;
|
|
||||||
e.animation = 0;
|
e.animation = 0;
|
||||||
e.min_expansion = -1;
|
e.min_expansion = -1;
|
||||||
e.max_expansion = -1;
|
e.max_expansion = -1;
|
||||||
@@ -180,8 +177,9 @@ public:
|
|||||||
{
|
{
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"{} WHERE id = {} LIMIT 1",
|
"{} WHERE {} = {} LIMIT 1",
|
||||||
BaseSelect(),
|
BaseSelect(),
|
||||||
|
PrimaryKey(),
|
||||||
spawn2_id
|
spawn2_id
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -204,12 +202,11 @@ public:
|
|||||||
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
||||||
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||||
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
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[14], nullptr, 10));
|
||||||
e.animation = static_cast<uint8_t>(strtoul(row[15], nullptr, 10));
|
e.min_expansion = static_cast<int8_t>(atoi(row[15]));
|
||||||
e.min_expansion = static_cast<int8_t>(atoi(row[16]));
|
e.max_expansion = static_cast<int8_t>(atoi(row[16]));
|
||||||
e.max_expansion = static_cast<int8_t>(atoi(row[17]));
|
e.content_flags = row[17] ? row[17] : "";
|
||||||
e.content_flags = row[18] ? row[18] : "";
|
e.content_flags_disabled = row[18] ? row[18] : "";
|
||||||
e.content_flags_disabled = row[19] ? row[19] : "";
|
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -256,12 +253,11 @@ public:
|
|||||||
v.push_back(columns[11] + " = " + std::to_string(e.path_when_zone_idle));
|
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[12] + " = " + std::to_string(e._condition));
|
||||||
v.push_back(columns[13] + " = " + std::to_string(e.cond_value));
|
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[14] + " = " + std::to_string(e.animation));
|
||||||
v.push_back(columns[15] + " = " + 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.min_expansion));
|
v.push_back(columns[16] + " = " + std::to_string(e.max_expansion));
|
||||||
v.push_back(columns[17] + " = " + 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) + "'");
|
v.push_back(columns[18] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
v.push_back(columns[19] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
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.path_when_zone_idle));
|
||||||
v.push_back(std::to_string(e._condition));
|
v.push_back(std::to_string(e._condition));
|
||||||
v.push_back(std::to_string(e.cond_value));
|
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.animation));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
v.push_back(std::to_string(e.max_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.path_when_zone_idle));
|
||||||
v.push_back(std::to_string(e._condition));
|
v.push_back(std::to_string(e._condition));
|
||||||
v.push_back(std::to_string(e.cond_value));
|
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.animation));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
v.push_back(std::to_string(e.max_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.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
||||||
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||||
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
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[14], nullptr, 10));
|
||||||
e.animation = static_cast<uint8_t>(strtoul(row[15], nullptr, 10));
|
e.min_expansion = static_cast<int8_t>(atoi(row[15]));
|
||||||
e.min_expansion = static_cast<int8_t>(atoi(row[16]));
|
e.max_expansion = static_cast<int8_t>(atoi(row[16]));
|
||||||
e.max_expansion = static_cast<int8_t>(atoi(row[17]));
|
e.content_flags = row[17] ? row[17] : "";
|
||||||
e.content_flags = row[18] ? row[18] : "";
|
e.content_flags_disabled = row[18] ? row[18] : "";
|
||||||
e.content_flags_disabled = row[19] ? row[19] : "";
|
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -443,12 +436,11 @@ public:
|
|||||||
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
||||||
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||||
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
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[14], nullptr, 10));
|
||||||
e.animation = static_cast<uint8_t>(strtoul(row[15], nullptr, 10));
|
e.min_expansion = static_cast<int8_t>(atoi(row[15]));
|
||||||
e.min_expansion = static_cast<int8_t>(atoi(row[16]));
|
e.max_expansion = static_cast<int8_t>(atoi(row[16]));
|
||||||
e.max_expansion = static_cast<int8_t>(atoi(row[17]));
|
e.content_flags = row[17] ? row[17] : "";
|
||||||
e.content_flags = row[18] ? row[18] : "";
|
e.content_flags_disabled = row[18] ? row[18] : "";
|
||||||
e.content_flags_disabled = row[19] ? row[19] : "";
|
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "../../strings.h"
|
#include "../../strings.h"
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
|
|
||||||
class BaseSpawnentryRepository {
|
class BaseSpawnentryRepository {
|
||||||
public:
|
public:
|
||||||
struct Spawnentry {
|
struct Spawnentry {
|
||||||
@@ -23,6 +24,8 @@ public:
|
|||||||
int32_t npcID;
|
int32_t npcID;
|
||||||
int16_t chance;
|
int16_t chance;
|
||||||
int32_t condition_value_filter;
|
int32_t condition_value_filter;
|
||||||
|
int16_t min_time;
|
||||||
|
int16_t max_time;
|
||||||
int8_t min_expansion;
|
int8_t min_expansion;
|
||||||
int8_t max_expansion;
|
int8_t max_expansion;
|
||||||
std::string content_flags;
|
std::string content_flags;
|
||||||
@@ -41,6 +44,8 @@ public:
|
|||||||
"npcID",
|
"npcID",
|
||||||
"chance",
|
"chance",
|
||||||
"condition_value_filter",
|
"condition_value_filter",
|
||||||
|
"min_time",
|
||||||
|
"max_time",
|
||||||
"min_expansion",
|
"min_expansion",
|
||||||
"max_expansion",
|
"max_expansion",
|
||||||
"content_flags",
|
"content_flags",
|
||||||
@@ -55,6 +60,8 @@ public:
|
|||||||
"npcID",
|
"npcID",
|
||||||
"chance",
|
"chance",
|
||||||
"condition_value_filter",
|
"condition_value_filter",
|
||||||
|
"min_time",
|
||||||
|
"max_time",
|
||||||
"min_expansion",
|
"min_expansion",
|
||||||
"max_expansion",
|
"max_expansion",
|
||||||
"content_flags",
|
"content_flags",
|
||||||
@@ -103,6 +110,8 @@ public:
|
|||||||
e.npcID = 0;
|
e.npcID = 0;
|
||||||
e.chance = 0;
|
e.chance = 0;
|
||||||
e.condition_value_filter = 1;
|
e.condition_value_filter = 1;
|
||||||
|
e.min_time = 0;
|
||||||
|
e.max_time = 0;
|
||||||
e.min_expansion = -1;
|
e.min_expansion = -1;
|
||||||
e.max_expansion = -1;
|
e.max_expansion = -1;
|
||||||
e.content_flags = "";
|
e.content_flags = "";
|
||||||
@@ -132,8 +141,9 @@ public:
|
|||||||
{
|
{
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"{} WHERE id = {} LIMIT 1",
|
"{} WHERE {} = {} LIMIT 1",
|
||||||
BaseSelect(),
|
BaseSelect(),
|
||||||
|
PrimaryKey(),
|
||||||
spawnentry_id
|
spawnentry_id
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -146,10 +156,12 @@ public:
|
|||||||
e.npcID = static_cast<int32_t>(atoi(row[1]));
|
e.npcID = static_cast<int32_t>(atoi(row[1]));
|
||||||
e.chance = static_cast<int16_t>(atoi(row[2]));
|
e.chance = static_cast<int16_t>(atoi(row[2]));
|
||||||
e.condition_value_filter = static_cast<int32_t>(atoi(row[3]));
|
e.condition_value_filter = static_cast<int32_t>(atoi(row[3]));
|
||||||
e.min_expansion = static_cast<int8_t>(atoi(row[4]));
|
e.min_time = static_cast<int16_t>(atoi(row[4]));
|
||||||
e.max_expansion = static_cast<int8_t>(atoi(row[5]));
|
e.max_time = static_cast<int16_t>(atoi(row[5]));
|
||||||
e.content_flags = row[6] ? row[6] : "";
|
e.min_expansion = static_cast<int8_t>(atoi(row[6]));
|
||||||
e.content_flags_disabled = row[7] ? row[7] : "";
|
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;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -187,10 +199,12 @@ public:
|
|||||||
v.push_back(columns[1] + " = " + std::to_string(e.npcID));
|
v.push_back(columns[1] + " = " + std::to_string(e.npcID));
|
||||||
v.push_back(columns[2] + " = " + std::to_string(e.chance));
|
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[3] + " = " + std::to_string(e.condition_value_filter));
|
||||||
v.push_back(columns[4] + " = " + std::to_string(e.min_expansion));
|
v.push_back(columns[4] + " = " + std::to_string(e.min_time));
|
||||||
v.push_back(columns[5] + " = " + std::to_string(e.max_expansion));
|
v.push_back(columns[5] + " = " + std::to_string(e.max_time));
|
||||||
v.push_back(columns[6] + " = '" + Strings::Escape(e.content_flags) + "'");
|
v.push_back(columns[6] + " = " + std::to_string(e.min_expansion));
|
||||||
v.push_back(columns[7] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
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(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -216,6 +230,8 @@ public:
|
|||||||
v.push_back(std::to_string(e.npcID));
|
v.push_back(std::to_string(e.npcID));
|
||||||
v.push_back(std::to_string(e.chance));
|
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.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.min_expansion));
|
||||||
v.push_back(std::to_string(e.max_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) + "'");
|
||||||
@@ -253,6 +269,8 @@ public:
|
|||||||
v.push_back(std::to_string(e.npcID));
|
v.push_back(std::to_string(e.npcID));
|
||||||
v.push_back(std::to_string(e.chance));
|
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.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.min_expansion));
|
||||||
v.push_back(std::to_string(e.max_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) + "'");
|
||||||
@@ -294,10 +312,12 @@ public:
|
|||||||
e.npcID = static_cast<int32_t>(atoi(row[1]));
|
e.npcID = static_cast<int32_t>(atoi(row[1]));
|
||||||
e.chance = static_cast<int16_t>(atoi(row[2]));
|
e.chance = static_cast<int16_t>(atoi(row[2]));
|
||||||
e.condition_value_filter = static_cast<int32_t>(atoi(row[3]));
|
e.condition_value_filter = static_cast<int32_t>(atoi(row[3]));
|
||||||
e.min_expansion = static_cast<int8_t>(atoi(row[4]));
|
e.min_time = static_cast<int16_t>(atoi(row[4]));
|
||||||
e.max_expansion = static_cast<int8_t>(atoi(row[5]));
|
e.max_time = static_cast<int16_t>(atoi(row[5]));
|
||||||
e.content_flags = row[6] ? row[6] : "";
|
e.min_expansion = static_cast<int8_t>(atoi(row[6]));
|
||||||
e.content_flags_disabled = row[7] ? row[7] : "";
|
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);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -326,10 +346,12 @@ public:
|
|||||||
e.npcID = static_cast<int32_t>(atoi(row[1]));
|
e.npcID = static_cast<int32_t>(atoi(row[1]));
|
||||||
e.chance = static_cast<int16_t>(atoi(row[2]));
|
e.chance = static_cast<int16_t>(atoi(row[2]));
|
||||||
e.condition_value_filter = static_cast<int32_t>(atoi(row[3]));
|
e.condition_value_filter = static_cast<int32_t>(atoi(row[3]));
|
||||||
e.min_expansion = static_cast<int8_t>(atoi(row[4]));
|
e.min_time = static_cast<int16_t>(atoi(row[4]));
|
||||||
e.max_expansion = static_cast<int8_t>(atoi(row[5]));
|
e.max_time = static_cast<int16_t>(atoi(row[5]));
|
||||||
e.content_flags = row[6] ? row[6] : "";
|
e.min_expansion = static_cast<int8_t>(atoi(row[6]));
|
||||||
e.content_flags_disabled = row[7] ? row[7] : "";
|
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);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
#ifndef EQEMU_BOT_STARTING_ITEMS_REPOSITORY_H
|
||||||
|
#define EQEMU_BOT_STARTING_ITEMS_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../database.h"
|
||||||
|
#include "../strings.h"
|
||||||
|
#include "base/base_bot_starting_items_repository.h"
|
||||||
|
|
||||||
|
class BotStartingItemsRepository: public BaseBotStartingItemsRepository {
|
||||||
|
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
|
||||||
|
*
|
||||||
|
* BotStartingItemsRepository::GetByZoneAndVersion(int zone_id, int zone_version)
|
||||||
|
* BotStartingItemsRepository::GetWhereNeverExpires()
|
||||||
|
* BotStartingItemsRepository::GetWhereXAndY()
|
||||||
|
* BotStartingItemsRepository::DeleteWhereXAndY()
|
||||||
|
*
|
||||||
|
* Most of the above could be covered by base methods, but if you as a developer
|
||||||
|
* find yourself re-using logic for other parts of the code, its best to just make a
|
||||||
|
* method that can be re-used easily elsewhere especially if it can use a base repository
|
||||||
|
* method and encapsulate filters there
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Custom extended repository methods here
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //EQEMU_BOT_STARTING_ITEMS_REPOSITORY_H
|
||||||
@@ -120,6 +120,7 @@ public:
|
|||||||
{.parent_command = "set", .sub_command = "title_suffix", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "titlesuffix"},
|
{.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 = "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 = "set", .sub_command = "zone", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "zclip|zcolor|zheader|zonelock|zsafecoords|zsky|zunderworld"},
|
||||||
|
{.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 = "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 = "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"},
|
{.parent_command = "show", .sub_command = "buried_corpse_count", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "getplayerburiedcorpsecount"},
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -303,6 +303,7 @@ 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, 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_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, 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_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Zone)
|
RULE_CATEGORY(Zone)
|
||||||
@@ -530,6 +531,8 @@ RULE_BOOL(Combat, BackstabIgnoresElemental, false, "Enable or disable Elemental
|
|||||||
RULE_BOOL(Combat, BackstabIgnoresBane, false, "Enable or disable Bane weapon damage affecting backstab damage, false by default.")
|
RULE_BOOL(Combat, BackstabIgnoresBane, false, "Enable or disable Bane weapon damage affecting backstab damage, false by default.")
|
||||||
RULE_BOOL(Combat, SummonMeleeRange, true, "Enable or disable summoning of a player when already in melee range of the summoner.")
|
RULE_BOOL(Combat, SummonMeleeRange, true, "Enable or disable summoning of a player when already in melee range of the summoner.")
|
||||||
RULE_BOOL(Combat, WaterMatchRequiredForAutoFireLoS, true, "Enable/Disable the requirement of both the attacker/victim being both in or out of water for AutoFire LoS to pass.")
|
RULE_BOOL(Combat, WaterMatchRequiredForAutoFireLoS, true, "Enable/Disable the requirement of both the attacker/victim being both in or out of water for AutoFire LoS to pass.")
|
||||||
|
RULE_INT(Combat, ExtraAllowedKickClassesBitmask, 0, "Bitmask for allowing extra classes beyond Warrior, Ranger, Beastlord, and Berserker to kick, No Extra Classes (0) by default")
|
||||||
|
RULE_INT(Combat, MaxProcs, 4, "Adjustable maximum number of procs per round, the hard cap is MAX_PROCS (11). Requires mob repop or client zone when changed")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(NPC)
|
RULE_CATEGORY(NPC)
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
typedef struct eq_cpu_info_s {
|
typedef struct eq_cpu_info_s {
|
||||||
std::string model;
|
std::string model;
|
||||||
|
|||||||
+3
-3
@@ -1077,7 +1077,7 @@ struct ServerRaidMessage_Struct {
|
|||||||
|
|
||||||
struct ServerRaidMOTD_Struct {
|
struct ServerRaidMOTD_Struct {
|
||||||
uint32 rid;
|
uint32 rid;
|
||||||
char motd[0];
|
char motd[1024];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ServerRaidNote_Struct {
|
struct ServerRaidNote_Struct {
|
||||||
@@ -1142,10 +1142,10 @@ struct ServerInstanceUpdateTime_Struct
|
|||||||
uint32 new_duration;
|
uint32 new_duration;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ServerSpawnStatusChange_Struct
|
struct ServerSpawnStatusChange_Struct {
|
||||||
{
|
|
||||||
uint32 id;
|
uint32 id;
|
||||||
bool new_status;
|
bool new_status;
|
||||||
|
uint32 instance_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ServerQGlobalUpdate_Struct
|
struct ServerQGlobalUpdate_Struct
|
||||||
|
|||||||
+9
-3
@@ -51,7 +51,9 @@ namespace ItemField
|
|||||||
#define F(x) x,
|
#define F(x) x,
|
||||||
#include "item_fieldlist.h"
|
#include "item_fieldlist.h"
|
||||||
#undef F
|
#undef F
|
||||||
updated
|
updated,
|
||||||
|
minstatus,
|
||||||
|
comment,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -965,7 +967,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
|||||||
#define F(x) "`"#x"`,"
|
#define F(x) "`"#x"`,"
|
||||||
#include "item_fieldlist.h"
|
#include "item_fieldlist.h"
|
||||||
#undef F
|
#undef F
|
||||||
"updated FROM items ORDER BY id";
|
"updated, minstatus, comment FROM items ORDER BY id";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
return;
|
return;
|
||||||
@@ -977,9 +979,13 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
|||||||
// Unique Identifier
|
// Unique Identifier
|
||||||
item.ID = Strings::ToUnsignedInt(row[ItemField::id]);
|
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.Name, row[ItemField::name], sizeof(item.Name));
|
||||||
strn0cpy(item.Lore, row[ItemField::lore], sizeof(item.Lore));
|
strn0cpy(item.Lore, row[ItemField::lore], sizeof(item.Lore));
|
||||||
|
strn0cpy(item.Comment, row[ItemField::comment], sizeof(item.Comment));
|
||||||
|
|
||||||
// Flags
|
// Flags
|
||||||
item.ArtifactFlag = Strings::ToBool(row[ItemField::artifactflag]);
|
item.ArtifactFlag = Strings::ToBool(row[ItemField::artifactflag]);
|
||||||
|
|||||||
+23
-16
@@ -42,10 +42,32 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <random>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
//Const char based
|
//Const char based
|
||||||
#include "strings_legacy.cpp" // legacy c functions
|
#include "strings_legacy.cpp" // legacy c functions
|
||||||
#include "strings_misc.cpp" // anything non "Strings" scoped
|
#include "strings_misc.cpp" // anything non "Strings" scoped
|
||||||
|
|
||||||
|
std::string Strings::Random(size_t length)
|
||||||
|
{
|
||||||
|
static auto &chrs = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
|
|
||||||
|
thread_local static std::mt19937 rg{std::random_device{}()};
|
||||||
|
|
||||||
|
thread_local static std::uniform_int_distribution<std::string::size_type> pick(0, sizeof(chrs) - 2);
|
||||||
|
|
||||||
|
std::string s;
|
||||||
|
|
||||||
|
s.reserve(length);
|
||||||
|
|
||||||
|
while (length--) {
|
||||||
|
s += chrs[pick(rg)];
|
||||||
|
}
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::string> Strings::Split(const std::string &str, const char delim)
|
std::vector<std::string> Strings::Split(const std::string &str, const char delim)
|
||||||
{
|
{
|
||||||
std::vector<std::string> ret;
|
std::vector<std::string> ret;
|
||||||
@@ -64,7 +86,7 @@ std::vector<std::string> Strings::Split(const std::string &str, const char delim
|
|||||||
}
|
}
|
||||||
|
|
||||||
// this one takes delimiter length into consideration
|
// this one takes delimiter length into consideration
|
||||||
std::vector<std::string> Strings::Split(const std::string& s, const std::string& delimiter)
|
std::vector<std::string> Strings::Split(const std::string &s, const std::string &delimiter)
|
||||||
{
|
{
|
||||||
size_t pos_start = 0, pos_end, delim_len = delimiter.length();
|
size_t pos_start = 0, pos_end, delim_len = delimiter.length();
|
||||||
std::string token;
|
std::string token;
|
||||||
@@ -783,21 +805,6 @@ bool Strings::ToBool(const std::string& bool_string)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns a random string of specified length
|
|
||||||
std::string Strings::Random(size_t length)
|
|
||||||
{
|
|
||||||
auto randchar = []() -> char {
|
|
||||||
const char charset[] = "0123456789"
|
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
||||||
"abcdefghijklmnopqrstuvwxyz";
|
|
||||||
const size_t max_index = (sizeof(charset) - 1);
|
|
||||||
return charset[static_cast<size_t>(std::rand()) % max_index];
|
|
||||||
};
|
|
||||||
std::string str(length, 0);
|
|
||||||
std::generate_n(str.begin(), length, randchar);
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
// a wrapper for stoi which will return a fallback if the string
|
// a wrapper for stoi which will return a fallback if the string
|
||||||
// fails to cast to a number
|
// fails to cast to a number
|
||||||
int Strings::ToInt(const std::string &s, int fallback)
|
int Strings::ToInt(const std::string &s, int fallback)
|
||||||
|
|||||||
@@ -185,7 +185,6 @@ public:
|
|||||||
value = strtod(tmp_str.data(), nullptr);
|
value = strtod(tmp_str.data(), nullptr);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::string StringFormat(const char *format, ...);
|
const std::string StringFormat(const char *format, ...);
|
||||||
|
|||||||
+3
-3
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
// Build variables
|
// Build variables
|
||||||
// these get injected during the build pipeline
|
// these get injected during the build pipeline
|
||||||
#define CURRENT_VERSION "22.26.2-dev" // always append -dev to the current version for custom-builds
|
#define CURRENT_VERSION "22.34.2-dev" // always append -dev to the current version for custom-builds
|
||||||
#define LOGIN_VERSION "0.8.0"
|
#define LOGIN_VERSION "0.8.0"
|
||||||
#define COMPILE_DATE __DATE__
|
#define COMPILE_DATE __DATE__
|
||||||
#define COMPILE_TIME __TIME__
|
#define COMPILE_TIME __TIME__
|
||||||
@@ -42,9 +42,9 @@
|
|||||||
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CURRENT_BINARY_DATABASE_VERSION 9236
|
#define CURRENT_BINARY_DATABASE_VERSION 9242
|
||||||
|
|
||||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9039
|
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9040
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -121,43 +121,25 @@ bool Database::GetLoginTokenDataFromToken(
|
|||||||
std::string &user
|
std::string &user
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
auto query = fmt::format(
|
auto query = fmt::format("SELECT login_server, username, account_id FROM login_tickets WHERE expires > NOW()"
|
||||||
"SELECT tbllogintokens.Id, tbllogintokens.IpAddress, tbllogintokenclaims.Name, tbllogintokenclaims.Value FROM tbllogintokens "
|
" AND id='{0}' AND ip_address='{1}' LIMIT 1",
|
||||||
"JOIN tbllogintokenclaims ON tbllogintokens.Id = tbllogintokenclaims.TokenId WHERE tbllogintokens.Expires > NOW() "
|
|
||||||
"AND tbllogintokens.Id='{0}' AND tbllogintokens.IpAddress='{1}'",
|
|
||||||
Strings::Escape(token),
|
Strings::Escape(token),
|
||||||
Strings::Escape(ip)
|
Strings::Escape(ip));
|
||||||
);
|
|
||||||
|
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (results.RowCount() == 0 || !results.Success()) {
|
if (results.RowCount() == 0 || !results.Success()) {
|
||||||
return false;
|
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) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
if (strcmp(row[2], "username") == 0) {
|
db_loginserver = row[0];
|
||||||
user = row[3];
|
user = row[1];
|
||||||
found_username = true;
|
db_account_id = Strings::ToUnsignedInt(row[2]);
|
||||||
continue;
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(row[2], "login_server_id") == 0) {
|
return false;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return found_username && found_login_id && found_login_server_name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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",
|
"name": "eqemu-server",
|
||||||
"version": "22.26.2",
|
"version": "22.34.2",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/EQEmu/Server.git"
|
"url": "https://github.com/EQEmu/Server.git"
|
||||||
|
|||||||
@@ -156,6 +156,11 @@ bool UCSDatabase::VerifyMailKey(const std::string& characterName, int IPAddress,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (results.RowCount() == 0) {
|
||||||
|
LogInfo("No mailkeys found for [{}].", characterName.c_str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
|
|
||||||
// The key is the client's IP address (expressed as 8 hex digits) and an 8 hex digit random string generated
|
// The key is the client's IP address (expressed as 8 hex digits) and an 8 hex digit random string generated
|
||||||
|
|||||||
@@ -423,6 +423,8 @@ OP_CancelInvite=0x0000
|
|||||||
OP_RaidJoin=0x1f21 # ShowEQ 10/27/05
|
OP_RaidJoin=0x1f21 # ShowEQ 10/27/05
|
||||||
OP_RaidInvite=0x5891 # ShowEQ 10/27/05
|
OP_RaidInvite=0x5891 # ShowEQ 10/27/05
|
||||||
OP_RaidUpdate=0x1f21 # EQEmu 06/29/05
|
OP_RaidUpdate=0x1f21 # EQEmu 06/29/05
|
||||||
|
OP_RaidDelegateAbility=0x56eb
|
||||||
|
OP_RaidClearNPCMarks=0x1794
|
||||||
|
|
||||||
OP_InspectBuffs=0x4FB6
|
OP_InspectBuffs=0x4FB6
|
||||||
|
|
||||||
|
|||||||
@@ -534,6 +534,8 @@ OP_LFGResponse=0x0000 #
|
|||||||
OP_RaidInvite=0x60b5 # C
|
OP_RaidInvite=0x60b5 # C
|
||||||
OP_RaidUpdate=0x4d8b # C
|
OP_RaidUpdate=0x4d8b # C
|
||||||
OP_RaidJoin=0x0000 #
|
OP_RaidJoin=0x0000 #
|
||||||
|
OP_RaidDelegateAbility=0x0297
|
||||||
|
OP_RaidClearNPCMarks=0x2af4
|
||||||
|
|
||||||
# Button-push commands
|
# Button-push commands
|
||||||
OP_Taunt=0x30e2 # C
|
OP_Taunt=0x30e2 # C
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -x
|
set -ex
|
||||||
|
|
||||||
sudo chown eqemu:eqemu /drone/src/ * -R
|
sudo chown eqemu:eqemu /drone/src/ * -R
|
||||||
sudo chown eqemu:eqemu /home/eqemu/.ccache/ * -R
|
sudo chown eqemu:eqemu /home/eqemu/.ccache/ * -R
|
||||||
@@ -9,7 +9,17 @@ git submodule init && git submodule update
|
|||||||
|
|
||||||
perl utils/scripts/build/tag-version.pl
|
perl utils/scripts/build/tag-version.pl
|
||||||
|
|
||||||
mkdir -p build && cd build && cmake -DEQEMU_BUILD_TESTS=ON -DEQEMU_BUILD_STATIC=ON -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_LUA=ON -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-Os" -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G 'Unix Makefiles' .. && make -j$((`nproc`-4))
|
mkdir -p build && cd build && \
|
||||||
|
cmake -DEQEMU_BUILD_TESTS=ON \
|
||||||
|
-DEQEMU_BUILD_STATIC=ON \
|
||||||
|
-DEQEMU_BUILD_LOGIN=ON \
|
||||||
|
-DEQEMU_BUILD_LUA=ON \
|
||||||
|
-DEQEMU_BUILD_PERL=ON \
|
||||||
|
-DCMAKE_CXX_FLAGS:STRING="-O1 -g" \
|
||||||
|
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-O1 -g" \
|
||||||
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||||
|
-G 'Unix Makefiles' \
|
||||||
|
.. && make -j$((`nproc`-4))
|
||||||
|
|
||||||
curl https://raw.githubusercontent.com/Akkadius/eqemu-install-v2/master/eqemu_config.json --output eqemu_config.json
|
curl https://raw.githubusercontent.com/Akkadius/eqemu-install-v2/master/eqemu_config.json --output eqemu_config.json
|
||||||
./bin/tests
|
./bin/tests
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ require (
|
|||||||
require (
|
require (
|
||||||
github.com/golang/protobuf v1.3.2 // indirect
|
github.com/golang/protobuf v1.3.2 // indirect
|
||||||
github.com/google/go-querystring v1.1.0 // indirect
|
github.com/google/go-querystring v1.1.0 // indirect
|
||||||
golang.org/x/crypto v0.1.0 // indirect
|
golang.org/x/crypto v0.14.0 // indirect
|
||||||
golang.org/x/net v0.7.0 // indirect
|
golang.org/x/net v0.17.0 // indirect
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD
|
|||||||
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
|
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU=
|
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
|
||||||
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
|
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
||||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
|
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
|
||||||
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#! /usr/bin/perl
|
#!/usr/bin/perl
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
#::: 13th floor import script
|
#::: 13th floor import script
|
||||||
@@ -9,35 +9,43 @@
|
|||||||
use DBI;
|
use DBI;
|
||||||
use DBD::mysql;
|
use DBD::mysql;
|
||||||
|
|
||||||
my $database_name = "";
|
my $db_host = "";
|
||||||
|
my $db_port = "";
|
||||||
|
my $db_name = "";
|
||||||
|
my $db_user = "";
|
||||||
|
my $db_pass = "";
|
||||||
my $total_items = 0;
|
my $total_items = 0;
|
||||||
my $read_items_file = "items.txt"; #default
|
my $read_items_file = "items.txt"; #default
|
||||||
my $dbh = LoadMysql();
|
|
||||||
|
read_eqemu_config_json();
|
||||||
|
|
||||||
|
my $dbh = DBI->connect("DBI:mysql:database=$db_name;host=$db_host;port=$db_port", $db_user, $db_pass) or die "Cannot connect to MySql.";
|
||||||
|
|
||||||
read_items_file_from_13th_floor_text();
|
read_items_file_from_13th_floor_text();
|
||||||
update_items_table();
|
update_items_table();
|
||||||
|
|
||||||
sub LoadMysql{
|
print "\n\nImport complete!\n\n";
|
||||||
#::: Config Variables
|
|
||||||
my $confile = "eqemu_config.xml";
|
sub read_eqemu_config_json {
|
||||||
open(F, "<$confile") or die "Unable to open config: $confile\n";
|
use JSON;
|
||||||
my $indb = 0;
|
my $json = new JSON();
|
||||||
while(<F>) {
|
my $config;
|
||||||
s/\r//g;
|
my $config_file = "eqemu_config.json";
|
||||||
if(/<database>/i) { $indb = 1; }
|
|
||||||
next unless($indb == 1);
|
my $content;
|
||||||
if(/<\/database>/i) { $indb = 0; last; }
|
open(my $fh, '<', $config_file) or die "cannot open file $config_file"; {
|
||||||
if(/<host>(.*)<\/host>/i) { $host = $1; }
|
local $/;
|
||||||
elsif(/<username>(.*)<\/username>/i) { $user = $1; }
|
$content = <$fh>;
|
||||||
elsif(/<password>(.*)<\/password>/i) { $pass = $1; }
|
|
||||||
elsif(/<db>(.*)<\/db>/i) { $db = $1; }
|
|
||||||
}
|
}
|
||||||
$database_name = $db;
|
close($fh);
|
||||||
#::: DATA SOURCE NAME
|
|
||||||
$dsn = "dbi:mysql:$db:localhost:3306";
|
$config = $json->decode($content);
|
||||||
#::: PERL DBI CONNECT
|
|
||||||
$connect = DBI->connect($dsn, $user, $pass);
|
$db_host = $config->{"server"}{"database"}{"host"};
|
||||||
return $connect;
|
$db_port = $config->{"server"}{"database"}{"port"};
|
||||||
|
$db_name = $config->{"server"}{"database"}{"db"};
|
||||||
|
$db_user = $config->{"server"}{"database"}{"username"};
|
||||||
|
$db_pass = $config->{"server"}{"database"}{"password"};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub read_items_file_from_13th_floor_text {
|
sub read_items_file_from_13th_floor_text {
|
||||||
@@ -56,7 +64,7 @@ sub read_items_file_from_13th_floor_text {
|
|||||||
$sth->execute();
|
$sth->execute();
|
||||||
my $has_items_floor = $sth->fetchrow_array();
|
my $has_items_floor = $sth->fetchrow_array();
|
||||||
|
|
||||||
#::: If we have items_floor
|
#::: If we don't have items_floor table
|
||||||
if ($has_items_floor eq '') {
|
if ($has_items_floor eq '') {
|
||||||
$dbh->do("CREATE TABLE `items_floor` (`" . join("` VARCHAR(64) NOT NULL DEFAULT '', `", @fields). "` VARCHAR(64) NOT NULL DEFAULT '', UNIQUE INDEX `ID` (`id`)) COLLATE='latin1_swedish_ci' ENGINE=MyISAM");
|
$dbh->do("CREATE TABLE `items_floor` (`" . join("` VARCHAR(64) NOT NULL DEFAULT '', `", @fields). "` VARCHAR(64) NOT NULL DEFAULT '', UNIQUE INDEX `ID` (`id`)) COLLATE='latin1_swedish_ci' ENGINE=MyISAM");
|
||||||
$dbh->do("ALTER TABLE `items_floor` CHANGE `id` `id` INT(11) NOT NULL DEFAULT '0'");
|
$dbh->do("ALTER TABLE `items_floor` CHANGE `id` `id` INT(11) NOT NULL DEFAULT '0'");
|
||||||
@@ -110,30 +118,34 @@ sub read_items_file_from_13th_floor_text {
|
|||||||
#::: One last processing print
|
#::: One last processing print
|
||||||
print "Processing (" . $read_items_file . ") :: (Items: " . $total_items . "/" . $total_items_file . ") \r";
|
print "Processing (" . $read_items_file . ") :: (Items: " . $total_items . "/" . $total_items_file . ") \r";
|
||||||
|
|
||||||
printf "\n" . $total_items . " items added to database... Took " . (time() - $start_time) . " second(s)... \n";
|
printf "\n" . $total_items . " items imported... Took " . (time() - $start_time) . " second(s)... \n";
|
||||||
|
|
||||||
|
#::: Process slots 21, 22
|
||||||
print "Flipping slots 21 and 22...";
|
print "Flipping slots 21 and 22...";
|
||||||
$rows_affected = $dbh->prepare("
|
$rows_affected = $dbh->prepare("
|
||||||
UPDATE `items_floor`
|
UPDATE `items_floor`
|
||||||
SET `slots` = (`slots` ^ 6291456)
|
SET `slots` = (`slots` ^ 6291456)
|
||||||
WHERE (`slots` & 6291456)
|
WHERE (`slots` & 6291456)
|
||||||
IN (2097152, 4194304)")->execute();
|
IN (2097152, 4194304)")->execute();
|
||||||
print " Rows affected (" . $rows_affected . ")\n";
|
print " :: Rows affected (" . $rows_affected . ")\n";
|
||||||
|
|
||||||
|
#::: Update idfile entries
|
||||||
|
print "Updating idfile entries...";
|
||||||
|
$rows_affected = $dbh->prepare("
|
||||||
|
UPDATE `items_floor`
|
||||||
|
SET `idfile` = CONCAT('IT', `idfile`)")->execute();
|
||||||
|
print " :: Rows affected(" . $rows_affected . ")\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
sub update_items_table {
|
sub update_items_table {
|
||||||
|
|
||||||
#::: Keep Items table sane
|
print "Updating items table...\n";
|
||||||
$query_handle = $dbh->prepare("
|
|
||||||
ALTER TABLE `items`
|
|
||||||
MODIFY COLUMN `UNK132` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL;
|
|
||||||
");
|
|
||||||
$query_handle->execute();
|
|
||||||
|
|
||||||
my @matching_table;
|
my @matching_table;
|
||||||
my @missing_items_table;
|
my @missing_items_table;
|
||||||
my @missing_items_floor_table;
|
my @missing_items_floor_table;
|
||||||
|
|
||||||
|
print "Comparing table structure...\n";
|
||||||
#::: Get columns from `items`
|
#::: Get columns from `items`
|
||||||
my $sth = $dbh->prepare("SHOW COLUMNS FROM `items`;");
|
my $sth = $dbh->prepare("SHOW COLUMNS FROM `items`;");
|
||||||
$sth->execute();
|
$sth->execute();
|
||||||
@@ -195,15 +207,16 @@ sub update_items_table {
|
|||||||
my @items_add = (
|
my @items_add = (
|
||||||
"casttime_", "endur", "range", "attuneable", "evolvinglevel", "herosforgemodel", "scrolltype",
|
"casttime_", "endur", "range", "attuneable", "evolvinglevel", "herosforgemodel", "scrolltype",
|
||||||
"scriptfileid", "powersourcecapacity", "augslot1unk2", "augslot2unk2", "augslot3unk2", "augslot4unk2",
|
"scriptfileid", "powersourcecapacity", "augslot1unk2", "augslot2unk2", "augslot3unk2", "augslot4unk2",
|
||||||
"augslot5unk2", "augslot6unk2", "recskill", "book"
|
"augslot5unk2", "augslot6unk2", "recskill", "book", "procunk1"
|
||||||
);
|
);
|
||||||
my @items_floor_add = (
|
my @items_floor_add = (
|
||||||
"foodduration", "endurance", "therange", "attunable", "evolvl", "heroforge1", "scrolleffecttype",
|
"foodduration", "endurance", "therange", "attunable", "evolvl", "heroforge1", "scrolleffecttype",
|
||||||
"rightclickscriptid", "powersourcecap", "augslot1unk", "augslot2unk", "augslot3unk", "augslot4unk",
|
"rightclickscriptid", "powersourcecap", "augslot1unk", "augslot2unk", "augslot3unk", "augslot4unk",
|
||||||
"augslot5unk", "augslot6unk", "reqskill", "booktype"
|
"augslot5unk", "augslot6unk", "reqskill", "booktype", "prockunk1"
|
||||||
);
|
);
|
||||||
|
|
||||||
#::: Match the mis-matched fields...
|
#::: Match the mis-matched fields...
|
||||||
|
print "Matching fields...\n";
|
||||||
my $spot = 0;
|
my $spot = 0;
|
||||||
foreach $value (@items_add) {
|
foreach $value (@items_add) {
|
||||||
$items_field_list .= ", `" . $value . "`";
|
$items_field_list .= ", `" . $value . "`";
|
||||||
@@ -223,15 +236,16 @@ sub update_items_table {
|
|||||||
ON DUPLICATE KEY UPDATE " . $update_fields;
|
ON DUPLICATE KEY UPDATE " . $update_fields;
|
||||||
|
|
||||||
#::: Print missing fields to file
|
#::: Print missing fields to file
|
||||||
|
print "Writing query and discrepencies to file...\n";
|
||||||
my $write_file = "missing_item_fields.txt";
|
my $write_file = "missing_item_fields.txt";
|
||||||
|
|
||||||
open(F, ">$write_file") or die "Unable to open questfile: $write_file\n";
|
open(F, ">$write_file") or die "Unable to open file: $write_file\n";
|
||||||
print F "$update_query \n\n";
|
print F "$update_query \n\n";
|
||||||
print F "EQEMU items Table missing fields\n";
|
print F "EQEMU items table extra fields:\n";
|
||||||
foreach $value (@missing_items_table) {
|
foreach $value (@missing_items_table) {
|
||||||
print F "$value\n";
|
print F "$value\n";
|
||||||
}
|
}
|
||||||
print F "\n\n13thFloor items Table missing fields\n";
|
print F "\n\n13thFloor items table extra fields:\n";
|
||||||
foreach $value (@missing_items_floor_table) {
|
foreach $value (@missing_items_floor_table) {
|
||||||
print F "$value\n";
|
print F "$value\n";
|
||||||
}
|
}
|
||||||
@@ -239,12 +253,18 @@ sub update_items_table {
|
|||||||
|
|
||||||
#::: Number of rows affected by query
|
#::: Number of rows affected by query
|
||||||
$rows = $dbh->do($update_query);
|
$rows = $dbh->do($update_query);
|
||||||
|
print "Added or updated " . $rows . " entries.\n";
|
||||||
|
|
||||||
#::: Update stackables
|
#::: Update stackables
|
||||||
|
print "Updating stackable field...\n";
|
||||||
$dbh->do("UPDATE items i SET i.stackable = 1 WHERE i.stacksize > 1");
|
$dbh->do("UPDATE items i SET i.stackable = 1 WHERE i.stacksize > 1");
|
||||||
|
|
||||||
print "Added all new items to Items table (" . $rows . ")!\n";
|
#::: 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
|
||||||
}
|
}
|
||||||
|
|
||||||
sub trim($) {
|
sub trim($) {
|
||||||
|
|||||||
+14
-6
@@ -424,12 +424,20 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (EQTimeTimer.Check()) {
|
if (EQTimeTimer.Check()) {
|
||||||
TimeOfDay_Struct tod;
|
TimeOfDay_Struct tod{};
|
||||||
zoneserver_list.worldclock.GetCurrentEQTimeOfDay(time(0), &tod);
|
zoneserver_list.worldclock.GetCurrentEQTimeOfDay(time(nullptr), &tod);
|
||||||
if (!database.SaveTime(tod.minute, tod.hour, tod.day, tod.month, tod.year))
|
if (!database.SaveTime(tod.minute, tod.hour, tod.day, tod.month, tod.year)) {
|
||||||
LogError("Failed to save eqtime");
|
LogEqTime("Failed to save eqtime");
|
||||||
else
|
}
|
||||||
LogDebug("EQTime successfully saved");
|
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();
|
zoneserver_list.Process();
|
||||||
|
|||||||
+5
-1
@@ -133,6 +133,8 @@ SET(zone_sources
|
|||||||
quest_parser_collection.cpp
|
quest_parser_collection.cpp
|
||||||
raids.cpp
|
raids.cpp
|
||||||
raycast_mesh.cpp
|
raycast_mesh.cpp
|
||||||
|
sidecar_api/sidecar_api.cpp
|
||||||
|
sidecar_api/loot_simulator_controller.cpp
|
||||||
shared_task_zone_messaging.cpp
|
shared_task_zone_messaging.cpp
|
||||||
spawn2.cpp
|
spawn2.cpp
|
||||||
spawn2.h
|
spawn2.h
|
||||||
@@ -253,6 +255,7 @@ SET(zone_headers
|
|||||||
quest_parser_collection.h
|
quest_parser_collection.h
|
||||||
raids.h
|
raids.h
|
||||||
raycast_mesh.h
|
raycast_mesh.h
|
||||||
|
sidecar_api/sidecar_api.h
|
||||||
shared_task_zone_messaging.h
|
shared_task_zone_messaging.h
|
||||||
spawn2.cpp
|
spawn2.cpp
|
||||||
spawn2.h
|
spawn2.h
|
||||||
@@ -273,8 +276,9 @@ SET(zone_headers
|
|||||||
zone_config.h
|
zone_config.h
|
||||||
zonedb.h
|
zonedb.h
|
||||||
zonedump.h
|
zonedump.h
|
||||||
|
zone_cli.h
|
||||||
zone_reload.h
|
zone_reload.h
|
||||||
)
|
zone_cli.cpp)
|
||||||
|
|
||||||
ADD_EXECUTABLE(zone ${zone_sources} ${zone_headers})
|
ADD_EXECUTABLE(zone ${zone_sources} ${zone_headers})
|
||||||
|
|
||||||
|
|||||||
+24
-22
@@ -1576,6 +1576,10 @@ bool Mob::SetAA(uint32 rank_id, uint32 new_value, uint32 charges) {
|
|||||||
|
|
||||||
|
|
||||||
bool Mob::CanUseAlternateAdvancementRank(AA::Rank *rank) {
|
bool Mob::CanUseAlternateAdvancementRank(AA::Rank *rank) {
|
||||||
|
if (!rank) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
AA::Ability *ability = rank->base_ability;
|
AA::Ability *ability = rank->base_ability;
|
||||||
|
|
||||||
if(!ability)
|
if(!ability)
|
||||||
@@ -2149,30 +2153,28 @@ void Client::AutoGrantAAPoints() {
|
|||||||
SendAlternateAdvancementStats();
|
SendAlternateAdvancementStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::GrantAllAAPoints()
|
void Client::GrantAllAAPoints(uint8 unlock_level)
|
||||||
{
|
{
|
||||||
//iterate through every AA
|
//iterate through every AA
|
||||||
for (auto& iter : zone->aa_abilities) {
|
for (auto& aa : zone->aa_abilities) {
|
||||||
auto ability = iter.second.get();
|
AA::Ability* ability = aa.second.get();
|
||||||
|
|
||||||
if (ability->charges > 0) {
|
if (ability->charges > 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto level = GetLevel();
|
const uint8 level = unlock_level ? unlock_level : GetLevel();
|
||||||
auto p = 1;
|
|
||||||
auto rank = ability->first;
|
AA::Rank* rank = ability->first;
|
||||||
while (rank != nullptr) {
|
while (rank) {
|
||||||
if (CanUseAlternateAdvancementRank(rank)) {
|
if (!CanUseAlternateAdvancementRank(rank)) {
|
||||||
if (rank->level_req <= level && !HasAlreadyPurchasedRank(rank)) {
|
|
||||||
FinishAlternateAdvancementPurchase(rank, true, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
p++;
|
if (rank->level_req <= level && !HasAlreadyPurchasedRank(rank)) {
|
||||||
|
FinishAlternateAdvancementPurchase(rank, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
rank = rank->next;
|
rank = rank->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2184,18 +2186,18 @@ void Client::GrantAllAAPoints()
|
|||||||
SendAlternateAdvancementStats();
|
SendAlternateAdvancementStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::HasAlreadyPurchasedRank(AA::Rank *rank) {
|
bool Client::HasAlreadyPurchasedRank(AA::Rank* rank) {
|
||||||
auto iter = aa_ranks.find(rank->base_ability->id);
|
const auto& aa = aa_ranks.find(rank->base_ability->id);
|
||||||
|
if (aa == aa_ranks.end()) {
|
||||||
if (iter == aa_ranks.end()) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ability_rank = zone->GetAlternateAdvancementAbilityAndRank(iter->first, iter->second.first);
|
const auto& ability_rank = zone->GetAlternateAdvancementAbilityAndRank(aa->first, aa->second.first);
|
||||||
auto ability = ability_rank.first;
|
|
||||||
auto current = ability_rank.second;
|
|
||||||
|
|
||||||
while (current != nullptr) {
|
AA::Ability* ability = ability_rank.first;
|
||||||
|
AA::Rank* current = ability_rank.second;
|
||||||
|
|
||||||
|
while (current) {
|
||||||
if (current == rank) {
|
if (current == rank) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-14
@@ -1741,8 +1741,7 @@ bool Client::Death(Mob* killerMob, int64 damage, uint16 spell, EQ::skills::Skill
|
|||||||
static_cast<int>(attack_skill)
|
static_cast<int>(attack_skill)
|
||||||
);
|
);
|
||||||
|
|
||||||
std::vector<std::any> args = { CastToMob() };
|
if (parse->EventPlayer(EVENT_DEATH, this, export_string, 0) != 0) {
|
||||||
if (parse->EventPlayer(EVENT_DEATH, this, export_string, 0, &args) != 0) {
|
|
||||||
if (GetHP() < 0) {
|
if (GetHP() < 0) {
|
||||||
SetHP(0);
|
SetHP(0);
|
||||||
}
|
}
|
||||||
@@ -2389,8 +2388,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
|||||||
static_cast<int>(attack_skill)
|
static_cast<int>(attack_skill)
|
||||||
);
|
);
|
||||||
|
|
||||||
std::vector<std::any> args = { CastToMob() };
|
if (parse->EventNPC(EVENT_DEATH, this, oos, export_string, 0) != 0) {
|
||||||
if (parse->EventNPC(EVENT_DEATH, this, oos, export_string, 0, &args) != 0) {
|
|
||||||
if (GetHP() < 0) {
|
if (GetHP() < 0) {
|
||||||
SetHP(0);
|
SetHP(0);
|
||||||
}
|
}
|
||||||
@@ -2407,9 +2405,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
|||||||
spell,
|
spell,
|
||||||
static_cast<int>(attack_skill)
|
static_cast<int>(attack_skill)
|
||||||
);
|
);
|
||||||
|
if (parse->EventBot(EVENT_DEATH, CastToBot(), oos, export_string, 0) != 0) {
|
||||||
std::vector<std::any> args = { CastToMob() };
|
|
||||||
if (parse->EventBot(EVENT_DEATH, CastToBot(), oos, export_string, 0, &args) != 0) {
|
|
||||||
if (GetHP() < 0) {
|
if (GetHP() < 0) {
|
||||||
SetHP(0);
|
SetHP(0);
|
||||||
}
|
}
|
||||||
@@ -3628,7 +3624,7 @@ int64 Mob::ReduceAllDamage(int64 damage)
|
|||||||
|
|
||||||
bool Mob::HasProcs() const
|
bool Mob::HasProcs() const
|
||||||
{
|
{
|
||||||
for (int i = 0; i < MAX_PROCS; i++) {
|
for (int i = 0; i < m_max_procs; i++) {
|
||||||
if (IsValidSpell(PermaProcs[i].spellID) || IsValidSpell(SpellProcs[i].spellID)) {
|
if (IsValidSpell(PermaProcs[i].spellID) || IsValidSpell(SpellProcs[i].spellID)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -3646,7 +3642,7 @@ bool Mob::HasProcs() const
|
|||||||
|
|
||||||
bool Mob::HasDefensiveProcs() const
|
bool Mob::HasDefensiveProcs() const
|
||||||
{
|
{
|
||||||
for (int i = 0; i < MAX_PROCS; i++) {
|
for (int i = 0; i < m_max_procs; i++) {
|
||||||
if (IsValidSpell(DefensiveProcs[i].spellID)) {
|
if (IsValidSpell(DefensiveProcs[i].spellID)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -3682,7 +3678,7 @@ bool Mob::HasSkillProcSuccess() const
|
|||||||
|
|
||||||
bool Mob::HasRangedProcs() const
|
bool Mob::HasRangedProcs() const
|
||||||
{
|
{
|
||||||
for (int i = 0; i < MAX_PROCS; i++){
|
for (int i = 0; i < m_max_procs; i++){
|
||||||
if (IsValidSpell(RangedProcs[i].spellID)) {
|
if (IsValidSpell(RangedProcs[i].spellID)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -4580,7 +4576,7 @@ void Mob::TryDefensiveProc(Mob *on, uint16 hand)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Spell Procs and Quest added procs
|
//Spell Procs and Quest added procs
|
||||||
for (int i = 0; i < MAX_PROCS; i++) {
|
for (int i = 0; i < m_max_procs; i++) {
|
||||||
if (IsValidSpell(DefensiveProcs[i].spellID)) {
|
if (IsValidSpell(DefensiveProcs[i].spellID)) {
|
||||||
if (!IsProcLimitTimerActive(DefensiveProcs[i].base_spellID, DefensiveProcs[i].proc_reuse_time, ProcType::DEFENSIVE_PROC)) {
|
if (!IsProcLimitTimerActive(DefensiveProcs[i].base_spellID, DefensiveProcs[i].proc_reuse_time, ProcType::DEFENSIVE_PROC)) {
|
||||||
float chance = proc_chance * (static_cast<float>(DefensiveProcs[i].chance) / 100.0f);
|
float chance = proc_chance * (static_cast<float>(DefensiveProcs[i].chance) / 100.0f);
|
||||||
@@ -4783,7 +4779,7 @@ void Mob::TrySpellProc(const EQ::ItemInstance *inst, const EQ::ItemData *weapon,
|
|||||||
|
|
||||||
int16 poison_slot=-1;
|
int16 poison_slot=-1;
|
||||||
|
|
||||||
for (uint32 i = 0; i < MAX_PROCS; i++) {
|
for (uint32 i = 0; i < m_max_procs; i++) {
|
||||||
if (IsPet() && hand != EQ::invslot::slotPrimary) //Pets can only proc spell procs from their primay hand (ie; beastlord pets)
|
if (IsPet() && hand != EQ::invslot::slotPrimary) //Pets can only proc spell procs from their primay hand (ie; beastlord pets)
|
||||||
continue; // If pets ever can proc from off hand, this will need to change
|
continue; // If pets ever can proc from off hand, this will need to change
|
||||||
|
|
||||||
@@ -5212,8 +5208,11 @@ bool Mob::TryFinishingBlow(Mob *defender, int64 &damage)
|
|||||||
FB_Level = itembonuses.FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX];
|
FB_Level = itembonuses.FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX];
|
||||||
|
|
||||||
// modern AA description says rank 1 (500) is 50% chance
|
// modern AA description says rank 1 (500) is 50% chance
|
||||||
int ProcChance =
|
int ProcChance = (
|
||||||
aabonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE] + spellbonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE] + spellbonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE];
|
aabonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE] +
|
||||||
|
itembonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE] +
|
||||||
|
spellbonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE]
|
||||||
|
);
|
||||||
|
|
||||||
if (FB_Level && FB_Dmg && (defender->GetLevel() <= FB_Level) &&
|
if (FB_Level && FB_Dmg && (defender->GetLevel() <= FB_Level) &&
|
||||||
(ProcChance >= zone->random.Int(1, 1000))) {
|
(ProcChance >= zone->random.Int(1, 1000))) {
|
||||||
|
|||||||
+64
-17
@@ -22,8 +22,11 @@
|
|||||||
#include "doors.h"
|
#include "doors.h"
|
||||||
#include "quest_parser_collection.h"
|
#include "quest_parser_collection.h"
|
||||||
#include "lua_parser.h"
|
#include "lua_parser.h"
|
||||||
|
#include "../common/repositories/bot_inventories_repository.h"
|
||||||
#include "../common/repositories/bot_spell_settings_repository.h"
|
#include "../common/repositories/bot_spell_settings_repository.h"
|
||||||
|
#include "../common/repositories/bot_starting_items_repository.h"
|
||||||
#include "../common/data_verification.h"
|
#include "../common/data_verification.h"
|
||||||
|
#include "../common/repositories/criteria/content_filter_criteria.h"
|
||||||
|
|
||||||
// This constructor is used during the bot create command
|
// This constructor is used during the bot create command
|
||||||
Bot::Bot(NPCType *npcTypeData, Client* botOwner) : NPC(npcTypeData, nullptr, glm::vec4(), Ground, false), rest_timer(1), ping_timer(1) {
|
Bot::Bot(NPCType *npcTypeData, Client* botOwner) : NPC(npcTypeData, nullptr, glm::vec4(), Ground, false), rest_timer(1), ping_timer(1) {
|
||||||
@@ -465,6 +468,14 @@ Bot::~Bot() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
entity_list.RemoveBot(GetID());
|
entity_list.RemoveBot(GetID());
|
||||||
|
|
||||||
|
if (GetGroup()) {
|
||||||
|
GetGroup()->MemberZoned(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GetRaid()) {
|
||||||
|
GetRaid()->MemberZoned(CastToClient());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::SetBotID(uint32 botID) {
|
void Bot::SetBotID(uint32 botID) {
|
||||||
@@ -643,7 +654,7 @@ NPCType *Bot::FillNPCTypeStruct(
|
|||||||
n->current_hp = hp;
|
n->current_hp = hp;
|
||||||
n->max_hp = hp;
|
n->max_hp = hp;
|
||||||
n->size = size;
|
n->size = size;
|
||||||
n->runspeed = 0.7f;
|
n->runspeed = 1.25f;
|
||||||
n->gender = gender;
|
n->gender = gender;
|
||||||
n->race = botRace;
|
n->race = botRace;
|
||||||
n->class_ = botClass;
|
n->class_ = botClass;
|
||||||
@@ -2219,10 +2230,10 @@ void Bot::AI_Process()
|
|||||||
// OK TO IDLE
|
// OK TO IDLE
|
||||||
|
|
||||||
// Ok to idle
|
// Ok to idle
|
||||||
if (TryIdleChecks(fm_distance)) {
|
if (TryNonCombatMovementChecks(bot_owner, follow_mob, Goal)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (TryNonCombatMovementChecks(bot_owner, follow_mob, Goal)) {
|
if (TryIdleChecks(fm_distance)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (TryBardMovementCasts()) {
|
if (TryBardMovementCasts()) {
|
||||||
@@ -2255,23 +2266,11 @@ bool Bot::TryNonCombatMovementChecks(Client* bot_owner, const Mob* follow_mob, g
|
|||||||
if ((!bot_owner->GetBotPulling() || PULLING_BOT) && (destination_distance > GetFollowDistance())) {
|
if ((!bot_owner->GetBotPulling() || PULLING_BOT) && (destination_distance > GetFollowDistance())) {
|
||||||
|
|
||||||
if (!IsRooted()) {
|
if (!IsRooted()) {
|
||||||
|
|
||||||
if (rest_timer.Enabled()) {
|
if (rest_timer.Enabled()) {
|
||||||
rest_timer.Disable();
|
rest_timer.Disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool running = true;
|
|
||||||
|
|
||||||
if (destination_distance < GetFollowDistance() + BOT_FOLLOW_DISTANCE_WALK) {
|
|
||||||
running = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (running) {
|
|
||||||
RunTo(Goal.x, Goal.y, Goal.z);
|
RunTo(Goal.x, Goal.y, Goal.z);
|
||||||
}
|
|
||||||
else {
|
|
||||||
WalkTo(Goal.x, Goal.y, Goal.z);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -3337,7 +3336,8 @@ bool Bot::Spawn(Client* botCharacterOwner) {
|
|||||||
|
|
||||||
if (auto raid = entity_list.GetRaidByBotName(GetName())) {
|
if (auto raid = entity_list.GetRaidByBotName(GetName())) {
|
||||||
// Safety Check to confirm we have a valid raid
|
// Safety Check to confirm we have a valid raid
|
||||||
if (!raid->IsRaidMember(GetBotOwner()->GetName())) {
|
auto owner = GetBotOwner();
|
||||||
|
if (owner && !raid->IsRaidMember(owner->GetCleanName())) {
|
||||||
Bot::RemoveBotFromRaid(this);
|
Bot::RemoveBotFromRaid(this);
|
||||||
} else {
|
} else {
|
||||||
SetRaidGrouped(true);
|
SetRaidGrouped(true);
|
||||||
@@ -3347,7 +3347,8 @@ bool Bot::Spawn(Client* botCharacterOwner) {
|
|||||||
}
|
}
|
||||||
else if (auto group = entity_list.GetGroupByMobName(GetName())) {
|
else if (auto group = entity_list.GetGroupByMobName(GetName())) {
|
||||||
// Safety Check to confirm we have a valid group
|
// Safety Check to confirm we have a valid group
|
||||||
if (!group->IsGroupMember(GetBotOwner()->GetName())) {
|
auto owner = GetBotOwner();
|
||||||
|
if (owner && !group->IsGroupMember(owner->GetCleanName())) {
|
||||||
Bot::RemoveBotFromGroup(this, group);
|
Bot::RemoveBotFromGroup(this, group);
|
||||||
} else {
|
} else {
|
||||||
SetGrouped(true);
|
SetGrouped(true);
|
||||||
@@ -8731,4 +8732,50 @@ bool Bot::CheckSpawnConditions(Client* c) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Bot::AddBotStartingItems(uint16 race_id, uint8 class_id)
|
||||||
|
{
|
||||||
|
if (!IsPlayerRace(race_id) || !IsPlayerClass(class_id)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint16 race_bitmask = GetPlayerRaceBit(race_id);
|
||||||
|
const uint16 class_bitmask = GetPlayerClassBit(class_id);
|
||||||
|
|
||||||
|
const auto& l = BotStartingItemsRepository::GetWhere(
|
||||||
|
content_db,
|
||||||
|
fmt::format(
|
||||||
|
"(races & {} OR races = 0) AND "
|
||||||
|
"(classes & {} OR classes = 0) {}",
|
||||||
|
race_bitmask,
|
||||||
|
class_bitmask,
|
||||||
|
ContentFilterCriteria::apply()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (l.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<BotInventoriesRepository::BotInventories> v;
|
||||||
|
|
||||||
|
for (const auto& e : l) {
|
||||||
|
if (
|
||||||
|
CanClassEquipItem(e.item_id) &&
|
||||||
|
(CanRaceEquipItem(e.item_id) || RuleB(Bots, AllowBotEquipAnyRaceGear))
|
||||||
|
) {
|
||||||
|
auto i = BotInventoriesRepository::NewEntity();
|
||||||
|
i.bot_id = GetBotID();
|
||||||
|
i.slot_id = e.slot_id;
|
||||||
|
i.item_id = e.item_id;
|
||||||
|
i.inst_charges = e.item_charges;
|
||||||
|
|
||||||
|
v.emplace_back(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!v.empty()) {
|
||||||
|
BotInventoriesRepository::InsertMany(content_db, v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uint8 Bot::spell_casting_chances[SPELL_TYPE_COUNT][PLAYER_CLASS_COUNT][EQ::constants::STANCE_TYPE_COUNT][cntHSND] = { 0 };
|
uint8 Bot::spell_casting_chances[SPELL_TYPE_COUNT][PLAYER_CLASS_COUNT][EQ::constants::STANCE_TYPE_COUNT][cntHSND] = { 0 };
|
||||||
|
|||||||
+2
-1
@@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
constexpr uint32 BOT_FOLLOW_DISTANCE_DEFAULT = 184; // as DSq value (~13.565 units)
|
constexpr uint32 BOT_FOLLOW_DISTANCE_DEFAULT = 184; // as DSq value (~13.565 units)
|
||||||
constexpr uint32 BOT_FOLLOW_DISTANCE_DEFAULT_MAX = 2500; // as DSq value (50 units)
|
constexpr uint32 BOT_FOLLOW_DISTANCE_DEFAULT_MAX = 2500; // as DSq value (50 units)
|
||||||
constexpr uint32 BOT_FOLLOW_DISTANCE_WALK = 1000; // as DSq value (~31.623 units)
|
|
||||||
|
|
||||||
constexpr uint32 BOT_KEEP_ALIVE_INTERVAL = 5000; // 5 seconds
|
constexpr uint32 BOT_KEEP_ALIVE_INTERVAL = 5000; // 5 seconds
|
||||||
|
|
||||||
@@ -461,6 +460,8 @@ public:
|
|||||||
uint8 gender
|
uint8 gender
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void AddBotStartingItems(uint16 race_id, uint8 class_id);
|
||||||
|
|
||||||
// Static Bot Group Methods
|
// Static Bot Group Methods
|
||||||
static bool AddBotToGroup(Bot* bot, Group* group);
|
static bool AddBotToGroup(Bot* bot, Group* group);
|
||||||
static bool RemoveBotFromGroup(Bot* bot, Group* group);
|
static bool RemoveBotFromGroup(Bot* bot, Group* group);
|
||||||
|
|||||||
+598
-158
File diff suppressed because it is too large
Load Diff
@@ -183,7 +183,7 @@ bool Bot::BotCastHateReduction(Mob* tar, uint8 botLevel, const BotSpell& botSpel
|
|||||||
if (tar->CanBuffStack(iter.SpellId, botLevel, true) < 0)
|
if (tar->CanBuffStack(iter.SpellId, botLevel, true) < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (IsValidSpellRange(botSpell.SpellId, tar)) {
|
if (IsValidSpellRange(iter.SpellId, tar)) {
|
||||||
casted_spell = AIDoSpellCast(iter.SpellIndex, tar, iter.ManaCost);
|
casted_spell = AIDoSpellCast(iter.SpellIndex, tar, iter.ManaCost);
|
||||||
}
|
}
|
||||||
if (casted_spell) {
|
if (casted_spell) {
|
||||||
@@ -328,7 +328,7 @@ bool Bot::BotCastSlow(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpe
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsValidSpellRange(botSpell.SpellId, tar)) {
|
if (IsValidSpellRange(iter.SpellId, tar)) {
|
||||||
casted_spell = AIDoSpellCast(iter.SpellIndex, tar, iter.ManaCost);
|
casted_spell = AIDoSpellCast(iter.SpellIndex, tar, iter.ManaCost);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -447,7 +447,7 @@ bool Bot::BotCastDOT(Mob* tar, uint8 botLevel, const BotSpell& botSpell, const b
|
|||||||
|
|
||||||
uint32 TempDontDotMeBefore = tar->DontDotMeBefore();
|
uint32 TempDontDotMeBefore = tar->DontDotMeBefore();
|
||||||
|
|
||||||
if (IsValidSpellRange(botSpell.SpellId, tar)) {
|
if (IsValidSpellRange(s.SpellId, tar)) {
|
||||||
casted_spell = AIDoSpellCast(s.SpellIndex, tar, s.ManaCost, &TempDontDotMeBefore);
|
casted_spell = AIDoSpellCast(s.SpellIndex, tar, s.ManaCost, &TempDontDotMeBefore);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#include "../../common/http/httplib.h"
|
||||||
|
#include "../../common/eqemu_logsys.h"
|
||||||
|
#include "../sidecar_api/sidecar_api.h"
|
||||||
|
#include "../../common/platform.h"
|
||||||
|
|
||||||
|
void ZoneCLI::SidecarServeHttp(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||||
|
{
|
||||||
|
if (cmd[{"-h", "--help"}]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RegisterExecutablePlatform(EQEmuExePlatform::ExePlatformZoneSidecar);
|
||||||
|
|
||||||
|
int port = 0;
|
||||||
|
std::string key;
|
||||||
|
if (!cmd("--port").str().empty()) {
|
||||||
|
port = strtoll(cmd("--port").str().c_str(), nullptr, 10);
|
||||||
|
}
|
||||||
|
if (!cmd("--key").str().empty()) {
|
||||||
|
key = cmd("--key").str();
|
||||||
|
}
|
||||||
|
|
||||||
|
SidecarApi::BootWebserver(port, key);
|
||||||
|
}
|
||||||
+23
-21
@@ -2262,10 +2262,10 @@ void Client::QuestReadBook(const char* text, uint8 type) {
|
|||||||
|
|
||||||
uint32 Client::GetCarriedPlatinum() {
|
uint32 Client::GetCarriedPlatinum() {
|
||||||
return (
|
return (
|
||||||
GetMoney(3, 0) +
|
GetMoney(MoneyTypes::Platinum, MoneySubtypes::Personal) +
|
||||||
(GetMoney(2, 0) / 10) +
|
(GetMoney(MoneyTypes::Gold, MoneySubtypes::Personal) / 10) +
|
||||||
(GetMoney(1, 0) / 100) +
|
(GetMoney(MoneyTypes::Silver, MoneySubtypes::Personal) / 100) +
|
||||||
(GetMoney(0, 0) / 1000)
|
(GetMoney(MoneyTypes::Copper, MoneySubtypes::Personal) / 1000)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8119,16 +8119,17 @@ void Client::SendHPUpdateMarquee(){
|
|||||||
|
|
||||||
uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
||||||
uint32 value = 0;
|
uint32 value = 0;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 0: {
|
case MoneyTypes::Copper: {
|
||||||
switch (subtype) {
|
switch (subtype) {
|
||||||
case 0:
|
case MoneySubtypes::Personal:
|
||||||
value = static_cast<uint32>(m_pp.copper);
|
value = static_cast<uint32>(m_pp.copper);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case MoneySubtypes::Bank:
|
||||||
value = static_cast<uint32>(m_pp.copper_bank);
|
value = static_cast<uint32>(m_pp.copper_bank);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case MoneySubtypes::Cursor:
|
||||||
value = static_cast<uint32>(m_pp.copper_cursor);
|
value = static_cast<uint32>(m_pp.copper_cursor);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -8136,15 +8137,15 @@ uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1: {
|
case MoneyTypes::Silver: {
|
||||||
switch (subtype) {
|
switch (subtype) {
|
||||||
case 0:
|
case MoneySubtypes::Personal:
|
||||||
value = static_cast<uint32>(m_pp.silver);
|
value = static_cast<uint32>(m_pp.silver);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case MoneySubtypes::Bank:
|
||||||
value = static_cast<uint32>(m_pp.silver_bank);
|
value = static_cast<uint32>(m_pp.silver_bank);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case MoneySubtypes::Cursor:
|
||||||
value = static_cast<uint32>(m_pp.silver_cursor);
|
value = static_cast<uint32>(m_pp.silver_cursor);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -8152,15 +8153,15 @@ uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2: {
|
case MoneyTypes::Gold: {
|
||||||
switch (subtype) {
|
switch (subtype) {
|
||||||
case 0:
|
case MoneySubtypes::Personal:
|
||||||
value = static_cast<uint32>(m_pp.gold);
|
value = static_cast<uint32>(m_pp.gold);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case MoneySubtypes::Bank:
|
||||||
value = static_cast<uint32>(m_pp.gold_bank);
|
value = static_cast<uint32>(m_pp.gold_bank);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case MoneySubtypes::Cursor:
|
||||||
value = static_cast<uint32>(m_pp.gold_cursor);
|
value = static_cast<uint32>(m_pp.gold_cursor);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -8168,18 +8169,18 @@ uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3: {
|
case MoneyTypes::Platinum: {
|
||||||
switch (subtype) {
|
switch (subtype) {
|
||||||
case 0:
|
case MoneySubtypes::Personal:
|
||||||
value = static_cast<uint32>(m_pp.platinum);
|
value = static_cast<uint32>(m_pp.platinum);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case MoneySubtypes::Bank:
|
||||||
value = static_cast<uint32>(m_pp.platinum_bank);
|
value = static_cast<uint32>(m_pp.platinum_bank);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case MoneySubtypes::Cursor:
|
||||||
value = static_cast<uint32>(m_pp.platinum_cursor);
|
value = static_cast<uint32>(m_pp.platinum_cursor);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case MoneySubtypes::SharedBank:
|
||||||
value = static_cast<uint32>(m_pp.platinum_shared);
|
value = static_cast<uint32>(m_pp.platinum_shared);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -8190,6 +8191,7 @@ uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -906,7 +906,7 @@ public:
|
|||||||
int GetSpentAA() { return m_pp.aapoints_spent; }
|
int GetSpentAA() { return m_pp.aapoints_spent; }
|
||||||
uint32 GetRequiredAAExperience();
|
uint32 GetRequiredAAExperience();
|
||||||
void AutoGrantAAPoints();
|
void AutoGrantAAPoints();
|
||||||
void GrantAllAAPoints();
|
void GrantAllAAPoints(uint8 unlock_level = 0);
|
||||||
bool HasAlreadyPurchasedRank(AA::Rank* rank);
|
bool HasAlreadyPurchasedRank(AA::Rank* rank);
|
||||||
|
|
||||||
bool SendGMCommand(std::string message, bool ignore_status = false);
|
bool SendGMCommand(std::string message, bool ignore_status = false);
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include "../common/global_define.h"
|
#include "../common/global_define.h"
|
||||||
#include "../common/eqemu_logsys.h"
|
#include "../common/eqemu_logsys.h"
|
||||||
#include "../common/opcodemgr.h"
|
#include "../common/opcodemgr.h"
|
||||||
|
#include "../common/raid.h"
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
@@ -12578,8 +12580,8 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket* app)
|
|||||||
if (!raid) {
|
if (!raid) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
RaidNote_Struct* note = (RaidNote_Struct*)app->pBuffer;
|
||||||
raid->SaveRaidNote(raid_command_packet->leader_name, raid_command_packet->note);
|
raid->SaveRaidNote(raid_command_packet->leader_name, note->note);
|
||||||
raid->SendRaidNotesToWorld();
|
raid->SendRaidNotesToWorld();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-14
@@ -137,7 +137,7 @@ int command_init(void)
|
|||||||
command_add("givemoney", "[Platinum] [Gold] [Silver] [Copper] - Gives specified amount of money to you or your player target", AccountStatus::GMMgmt, command_givemoney) ||
|
command_add("givemoney", "[Platinum] [Gold] [Silver] [Copper] - Gives specified amount of money to you or your player target", AccountStatus::GMMgmt, command_givemoney) ||
|
||||||
command_add("gmzone", "[Zone ID|Zone Short Name] [Version] [Instance Identifier] - Zones to a private GM instance (Version defaults to 0 and Instance Identifier defaults to 'gmzone' if not used)", AccountStatus::GMAdmin, command_gmzone) ||
|
command_add("gmzone", "[Zone ID|Zone Short Name] [Version] [Instance Identifier] - Zones to a private GM instance (Version defaults to 0 and Instance Identifier defaults to 'gmzone' if not used)", AccountStatus::GMAdmin, command_gmzone) ||
|
||||||
command_add("goto", "[playername] or [x y z] [h] - Teleport to the provided coordinates or to your target", AccountStatus::Steward, command_goto) ||
|
command_add("goto", "[playername] or [x y z] [h] - Teleport to the provided coordinates or to your target", AccountStatus::Steward, command_goto) ||
|
||||||
command_add("grantaa", "Grants a player all available AA points for their level.", AccountStatus::GMMgmt, command_grantaa) ||
|
command_add("grantaa", "[level] - Grants a player all available AA points up the specified level, all AAs are granted if no level is specified.", AccountStatus::GMMgmt, command_grantaa) ||
|
||||||
command_add("grid", "[add/delete] [grid_num] [wandertype] [pausetype] - Create/delete a wandering grid", AccountStatus::GMAreas, command_grid) ||
|
command_add("grid", "[add/delete] [grid_num] [wandertype] [pausetype] - Create/delete a wandering grid", AccountStatus::GMAreas, command_grid) ||
|
||||||
command_add("guild", "Guild manipulation commands. Use argument help for more info.", AccountStatus::Steward, command_guild) ||
|
command_add("guild", "Guild manipulation commands. Use argument help for more info.", AccountStatus::Steward, command_guild) ||
|
||||||
command_add("help", "[Search Criteria] - List available commands and their description, specify partial command as argument to search", AccountStatus::Player, command_help) ||
|
command_add("help", "[Search Criteria] - List available commands and their description, specify partial command as argument to search", AccountStatus::Player, command_help) ||
|
||||||
@@ -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("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("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("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("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("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) ||
|
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) ||
|
||||||
@@ -437,13 +438,13 @@ int command_realdispatch(Client *c, std::string message, bool ignore_status)
|
|||||||
{
|
{
|
||||||
Seperator sep(message.c_str(), ' ', 10, 100, true); // "three word argument" should be considered 1 arg
|
Seperator sep(message.c_str(), ' ', 10, 100, true); // "three word argument" should be considered 1 arg
|
||||||
|
|
||||||
std::string cstr(sep.arg[0] + 1);
|
std::string command(sep.arg[0] + 1);
|
||||||
|
|
||||||
if (commandlist.count(cstr) != 1) {
|
if (commandlist.count(command) != 1) {
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto cur = commandlist[cstr];
|
const CommandRecord* current_command = commandlist[command];
|
||||||
|
|
||||||
bool is_subcommand = false;
|
bool is_subcommand = false;
|
||||||
bool can_use_subcommand = false;
|
bool can_use_subcommand = false;
|
||||||
@@ -451,11 +452,11 @@ int command_realdispatch(Client *c, std::string message, bool ignore_status)
|
|||||||
|
|
||||||
const auto arguments = sep.argnum;
|
const auto arguments = sep.argnum;
|
||||||
|
|
||||||
if (arguments >= 2) {
|
if (arguments) {
|
||||||
const std::string& sub_command = sep.arg[1];
|
const std::string& sub_command = sep.arg[1];
|
||||||
|
|
||||||
for (const auto &e : command_subsettings) {
|
for (const auto &e : command_subsettings) {
|
||||||
if (e.sub_command == sub_command) {
|
if (e.parent_command == command && e.sub_command == sub_command) {
|
||||||
can_use_subcommand = c->Admin() >= static_cast<int16>(e.access_level);
|
can_use_subcommand = c->Admin() >= static_cast<int16>(e.access_level);
|
||||||
is_subcommand = true;
|
is_subcommand = true;
|
||||||
found_subcommand_setting = true;
|
found_subcommand_setting = true;
|
||||||
@@ -465,7 +466,7 @@ int command_realdispatch(Client *c, std::string message, bool ignore_status)
|
|||||||
|
|
||||||
if (!found_subcommand_setting) {
|
if (!found_subcommand_setting) {
|
||||||
for (const auto &e: command_subsettings) {
|
for (const auto &e: command_subsettings) {
|
||||||
if (e.sub_command == sub_command) {
|
if (e.parent_command == command && e.sub_command == sub_command) {
|
||||||
can_use_subcommand = c->Admin() >= static_cast<int16>(e.access_level);
|
can_use_subcommand = c->Admin() >= static_cast<int16>(e.access_level);
|
||||||
is_subcommand = true;
|
is_subcommand = true;
|
||||||
break;
|
break;
|
||||||
@@ -475,7 +476,7 @@ int command_realdispatch(Client *c, std::string message, bool ignore_status)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!ignore_status) {
|
if (!ignore_status) {
|
||||||
if (!is_subcommand && c->Admin() < cur->admin) {
|
if (!is_subcommand && c->Admin() < current_command->admin) {
|
||||||
c->Message(Chat::White, "Your status is not high enough to use this command.");
|
c->Message(Chat::White, "Your status is not high enough to use this command.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -497,7 +498,7 @@ int command_realdispatch(Client *c, std::string message, bool ignore_status)
|
|||||||
QServ->PlayerLogEvent(Player_Log_Issued_Commands, c->CharacterID(), event_desc);
|
QServ->PlayerLogEvent(Player_Log_Issued_Commands, c->CharacterID(), event_desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cur->admin >= COMMANDS_LOGGING_MIN_STATUS) {
|
if (current_command->admin >= COMMANDS_LOGGING_MIN_STATUS) {
|
||||||
LogCommands(
|
LogCommands(
|
||||||
"[{}] ([{}]) used command: [{}] (target=[{}])",
|
"[{}] ([{}]) used command: [{}] (target=[{}])",
|
||||||
c->GetName(),
|
c->GetName(),
|
||||||
@@ -507,8 +508,8 @@ int command_realdispatch(Client *c, std::string message, bool ignore_status)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cur->function) {
|
if (!current_command->function) {
|
||||||
LogError("Command [{}] has a null function", cstr);
|
LogError("Command [{}] has a null function", command);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,7 +526,7 @@ int command_realdispatch(Client *c, std::string message, bool ignore_status)
|
|||||||
RecordPlayerEventLogWithClient(c, PlayerEvent::GM_COMMAND, e);
|
RecordPlayerEventLogWithClient(c, PlayerEvent::GM_COMMAND, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
cur->function(c, &sep); // Dispatch C++ Command
|
current_command->function(c, &sep); // Dispatch C++ Command
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -665,7 +666,7 @@ void command_hotfix(Client *c, const Seperator *sep)
|
|||||||
hotfix_command = fmt::format("\"{}\" -hotfix={}", shared_memory_path, hotfix_name);
|
hotfix_command = fmt::format("\"{}\" -hotfix={}", shared_memory_path, hotfix_name);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
hotfix_command = fmt::format("\"{}\"", shared_memory_path, hotfix_name);
|
hotfix_command = fmt::format("\"{}\"", shared_memory_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogInfo("Running hotfix command [{}]", hotfix_command);
|
LogInfo("Running hotfix command [{}]", hotfix_command);
|
||||||
@@ -691,7 +692,7 @@ void command_hotfix(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
worldserver.SendPacket(&pack);
|
worldserver.SendPacket(&pack);
|
||||||
|
|
||||||
if (c) { c->Message(Chat::White, "Hotfix applied"); }
|
worldserver.SendEmoteMessage(0, 0, AccountStatus::ApprenticeGuide, Chat::Yellow, "Hotfix applied");
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -903,6 +904,7 @@ void command_bot(Client *c, const Seperator *sep)
|
|||||||
#include "gm_commands/summonitem.cpp"
|
#include "gm_commands/summonitem.cpp"
|
||||||
#include "gm_commands/suspend.cpp"
|
#include "gm_commands/suspend.cpp"
|
||||||
#include "gm_commands/suspendmulti.cpp"
|
#include "gm_commands/suspendmulti.cpp"
|
||||||
|
#include "gm_commands/takeplatinum.cpp"
|
||||||
#include "gm_commands/task.cpp"
|
#include "gm_commands/task.cpp"
|
||||||
#include "gm_commands/traindisc.cpp"
|
#include "gm_commands/traindisc.cpp"
|
||||||
#include "gm_commands/tune.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_summonitem(Client *c, const Seperator *sep);
|
||||||
void command_suspend(Client *c, const Seperator *sep);
|
void command_suspend(Client *c, const Seperator *sep);
|
||||||
void command_suspendmulti(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_task(Client *c, const Seperator *sep);
|
||||||
void command_petname(Client *c, const Seperator *sep);
|
void command_petname(Client *c, const Seperator *sep);
|
||||||
void command_traindisc(Client *c, const Seperator *sep);
|
void command_traindisc(Client *c, const Seperator *sep);
|
||||||
|
|||||||
@@ -207,6 +207,8 @@ enum {
|
|||||||
MODIFY_AVOID_DAMAGE = 51, //Modify by percent the NPCs chance to riposte, block, parry or dodge individually, or for all skills
|
MODIFY_AVOID_DAMAGE = 51, //Modify by percent the NPCs chance to riposte, block, parry or dodge individually, or for all skills
|
||||||
IMMUNE_FADING_MEMORIES = 52,
|
IMMUNE_FADING_MEMORIES = 52,
|
||||||
IMMUNE_OPEN = 53,
|
IMMUNE_OPEN = 53,
|
||||||
|
IMMUNE_ASSASSINATE = 54,
|
||||||
|
IMMUNE_HEADSHOT = 55,
|
||||||
MAX_SPECIAL_ATTACK
|
MAX_SPECIAL_ATTACK
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+70
-33
@@ -1440,7 +1440,7 @@ void PerlembParser::ExportZoneVariables(std::string &package_name)
|
|||||||
ExportVar(package_name.c_str(), "zonesn", zone->GetShortName());
|
ExportVar(package_name.c_str(), "zonesn", zone->GetShortName());
|
||||||
ExportVar(package_name.c_str(), "instanceid", zone->GetInstanceID());
|
ExportVar(package_name.c_str(), "instanceid", zone->GetInstanceID());
|
||||||
ExportVar(package_name.c_str(), "instanceversion", zone->GetInstanceVersion());
|
ExportVar(package_name.c_str(), "instanceversion", zone->GetInstanceVersion());
|
||||||
TimeOfDay_Struct eqTime;
|
TimeOfDay_Struct eqTime{};
|
||||||
zone->zone_time.GetCurrentEQTimeOfDay(time(0), &eqTime);
|
zone->zone_time.GetCurrentEQTimeOfDay(time(0), &eqTime);
|
||||||
ExportVar(package_name.c_str(), "zonehour", eqTime.hour - 1);
|
ExportVar(package_name.c_str(), "zonehour", eqTime.hour - 1);
|
||||||
ExportVar(package_name.c_str(), "zonemin", eqTime.minute);
|
ExportVar(package_name.c_str(), "zonemin", eqTime.minute);
|
||||||
@@ -1560,6 +1560,7 @@ void PerlembParser::ExportEventVariables(
|
|||||||
if (extra_pointers && extra_pointers->size() == 1) {
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
ExportVar(package_name.c_str(), "target", "Mob", std::any_cast<Mob*>(extra_pointers->at(0)));
|
ExportVar(package_name.c_str(), "target", "Mob", std::any_cast<Mob*>(extra_pointers->at(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1606,9 +1607,11 @@ void PerlembParser::ExportEventVariables(
|
|||||||
case EVENT_CLICK_DOOR: {
|
case EVENT_CLICK_DOOR: {
|
||||||
ExportVar(package_name.c_str(), "doorid", data);
|
ExportVar(package_name.c_str(), "doorid", data);
|
||||||
ExportVar(package_name.c_str(), "version", zone->GetInstanceVersion());
|
ExportVar(package_name.c_str(), "version", zone->GetInstanceVersion());
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() == 1) {
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
ExportVar(package_name.c_str(), "door", "Doors", std::any_cast<Doors*>(extra_pointers->at(0)));
|
ExportVar(package_name.c_str(), "door", "Doors", std::any_cast<Doors*>(extra_pointers->at(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1649,6 +1652,16 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "spell_id", sep.arg[0]);
|
ExportVar(package_name.c_str(), "spell_id", sep.arg[0]);
|
||||||
ExportVar(package_name.c_str(), "caster_id", sep.arg[1]);
|
ExportVar(package_name.c_str(), "caster_id", sep.arg[1]);
|
||||||
ExportVar(package_name.c_str(), "caster_level", sep.arg[2]);
|
ExportVar(package_name.c_str(), "caster_level", sep.arg[2]);
|
||||||
|
ExportVar(package_name.c_str(), "target_id", sep.arg[3]);
|
||||||
|
|
||||||
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
|
ExportVar(package_name.c_str(), "target", "Mob", std::any_cast<Mob*>(extra_pointers->at(0)));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsValidSpell(Strings::ToUnsignedInt(sep.arg[0]))) {
|
||||||
|
ExportVar(package_name.c_str(), "spell", "Spell", (void*)&spells[Strings::ToUnsignedInt(sep.arg[0])]);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1683,9 +1696,11 @@ void PerlembParser::ExportEventVariables(
|
|||||||
case EVENT_PLAYER_PICKUP: {
|
case EVENT_PLAYER_PICKUP: {
|
||||||
ExportVar(package_name.c_str(), "picked_up_id", data);
|
ExportVar(package_name.c_str(), "picked_up_id", data);
|
||||||
ExportVar(package_name.c_str(), "picked_up_entity_id", extradata);
|
ExportVar(package_name.c_str(), "picked_up_entity_id", extradata);
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() == 1) {
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0)));
|
ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1731,12 +1746,18 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "itemname", item_inst->GetItem()->Name);
|
ExportVar(package_name.c_str(), "itemname", item_inst->GetItem()->Name);
|
||||||
ExportVar(package_name.c_str(), "slotid", extradata);
|
ExportVar(package_name.c_str(), "slotid", extradata);
|
||||||
ExportVar(package_name.c_str(), "spell_id", item_inst->GetItem()->Click.Effect);
|
ExportVar(package_name.c_str(), "spell_id", item_inst->GetItem()->Click.Effect);
|
||||||
|
|
||||||
|
if (IsValidSpell(item_inst->GetItem()->Click.Effect)) {
|
||||||
|
ExportVar(package_name.c_str(), "spell", "Spell", (void*)&spells[item_inst->GetItem()->Click.Effect]);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EVENT_ITEM_CLICK_CAST_CLIENT:
|
case EVENT_ITEM_CLICK_CAST_CLIENT:
|
||||||
case EVENT_ITEM_CLICK_CLIENT: {
|
case EVENT_ITEM_CLICK_CLIENT: {
|
||||||
ExportVar(package_name.c_str(), "slot_id", data);
|
ExportVar(package_name.c_str(), "slot_id", data);
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() == 1) {
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
auto* item = std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0));
|
auto* item = std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0));
|
||||||
if (item) {
|
if (item) {
|
||||||
@@ -1744,8 +1765,13 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "item_name", item->GetItem()->Name);
|
ExportVar(package_name.c_str(), "item_name", item->GetItem()->Name);
|
||||||
ExportVar(package_name.c_str(), "spell_id", item->GetItem()->Click.Effect);
|
ExportVar(package_name.c_str(), "spell_id", item->GetItem()->Click.Effect);
|
||||||
ExportVar(package_name.c_str(), "item", "QuestItem", item);
|
ExportVar(package_name.c_str(), "item", "QuestItem", item);
|
||||||
|
|
||||||
|
if (IsValidSpell(item->GetItem()->Click.Effect)) {
|
||||||
|
ExportVar(package_name.c_str(), "spell", "Spell", (void*)&spells[item->GetItem()->Click.Effect]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1776,6 +1802,11 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "tics_remaining", sep.arg[1]);
|
ExportVar(package_name.c_str(), "tics_remaining", sep.arg[1]);
|
||||||
ExportVar(package_name.c_str(), "caster_level", sep.arg[2]);
|
ExportVar(package_name.c_str(), "caster_level", sep.arg[2]);
|
||||||
ExportVar(package_name.c_str(), "buff_slot", sep.arg[3]);
|
ExportVar(package_name.c_str(), "buff_slot", sep.arg[3]);
|
||||||
|
|
||||||
|
if (IsValidSpell(objid)) {
|
||||||
|
ExportVar(package_name.c_str(), "spell", "Spell", (void*)&spells[objid]);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1789,34 +1820,42 @@ void PerlembParser::ExportEventVariables(
|
|||||||
|
|
||||||
case EVENT_FORAGE_SUCCESS: {
|
case EVENT_FORAGE_SUCCESS: {
|
||||||
ExportVar(package_name.c_str(), "foraged_item", extradata);
|
ExportVar(package_name.c_str(), "foraged_item", extradata);
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() == 1) {
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0)));
|
ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EVENT_FISH_SUCCESS: {
|
case EVENT_FISH_SUCCESS: {
|
||||||
ExportVar(package_name.c_str(), "fished_item", extradata);
|
ExportVar(package_name.c_str(), "fished_item", extradata);
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() == 1) {
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0)));
|
ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EVENT_CLICK_OBJECT: {
|
case EVENT_CLICK_OBJECT: {
|
||||||
ExportVar(package_name.c_str(), "objectid", data);
|
ExportVar(package_name.c_str(), "objectid", data);
|
||||||
ExportVar(package_name.c_str(), "clicker_id", extradata);
|
ExportVar(package_name.c_str(), "clicker_id", extradata);
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() == 1) {
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
ExportVar(package_name.c_str(), "object", "Object", std::any_cast<Object*>(extra_pointers->at(0)));
|
ExportVar(package_name.c_str(), "object", "Object", std::any_cast<Object*>(extra_pointers->at(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EVENT_DISCOVER_ITEM: {
|
case EVENT_DISCOVER_ITEM: {
|
||||||
ExportVar(package_name.c_str(), "itemid", extradata);
|
ExportVar(package_name.c_str(), "itemid", extradata);
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() == 1) {
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0)));
|
ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1836,47 +1875,27 @@ void PerlembParser::ExportEventVariables(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EVENT_DEATH: {
|
|
||||||
Seperator sep(data);
|
|
||||||
ExportVar(package_name.c_str(), "killer_id", sep.arg[0]);
|
|
||||||
ExportVar(package_name.c_str(), "killer_damage", sep.arg[1]);
|
|
||||||
ExportVar(package_name.c_str(), "killer_spell", sep.arg[2]);
|
|
||||||
ExportVar(package_name.c_str(), "killer_skill", sep.arg[3]);
|
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() == 1) {
|
|
||||||
Mob* killed = std::any_cast<Mob*>(extra_pointers->at(0));
|
|
||||||
if (killed) {
|
|
||||||
ExportVar(package_name.c_str(), "killed_entity_id", killed->GetID());
|
|
||||||
ExportVar(package_name.c_str(), "killed_bot_id", killed->IsBot() ? killed->CastToBot()->GetBotID() : 0);
|
|
||||||
ExportVar(package_name.c_str(), "killed_npc_id", killed->IsNPC() ? killed->GetNPCTypeID() : 0);
|
|
||||||
ExportVar(package_name.c_str(), "killed_x", killed->GetX());
|
|
||||||
ExportVar(package_name.c_str(), "killed_y", killed->GetY());
|
|
||||||
ExportVar(package_name.c_str(), "killed_z", killed->GetZ());
|
|
||||||
ExportVar(package_name.c_str(), "killed_h", killed->GetHeading());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case EVENT_DEATH_ZONE:
|
case EVENT_DEATH_ZONE:
|
||||||
|
case EVENT_DEATH:
|
||||||
case EVENT_DEATH_COMPLETE: {
|
case EVENT_DEATH_COMPLETE: {
|
||||||
Seperator sep(data);
|
Seperator sep(data);
|
||||||
ExportVar(package_name.c_str(), "killer_id", sep.arg[0]);
|
ExportVar(package_name.c_str(), "killer_id", sep.arg[0]);
|
||||||
ExportVar(package_name.c_str(), "killer_damage", sep.arg[1]);
|
ExportVar(package_name.c_str(), "killer_damage", sep.arg[1]);
|
||||||
ExportVar(package_name.c_str(), "killer_spell", sep.arg[2]);
|
ExportVar(package_name.c_str(), "killer_spell", sep.arg[2]);
|
||||||
ExportVar(package_name.c_str(), "killer_skill", sep.arg[3]);
|
ExportVar(package_name.c_str(), "killer_skill", sep.arg[3]);
|
||||||
|
if (extra_pointers && extra_pointers->size() >= 1)
|
||||||
if (extra_pointers && extra_pointers->size() >= 1) {
|
{
|
||||||
Corpse* corpse = std::any_cast<Corpse*>(extra_pointers->at(0));
|
Corpse* corpse = std::any_cast<Corpse*>(extra_pointers->at(0));
|
||||||
if (corpse) {
|
if (corpse)
|
||||||
|
{
|
||||||
ExportVar(package_name.c_str(), "killed_corpse_id", corpse->GetID());
|
ExportVar(package_name.c_str(), "killed_corpse_id", corpse->GetID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (extra_pointers && extra_pointers->size() >= 2)
|
||||||
if (extra_pointers && extra_pointers->size() >= 2) {
|
{
|
||||||
NPC* killed = std::any_cast<NPC*>(extra_pointers->at(1));
|
NPC* killed = std::any_cast<NPC*>(extra_pointers->at(1));
|
||||||
if (killed) {
|
if (killed)
|
||||||
|
{
|
||||||
ExportVar(package_name.c_str(), "killed_entity_id", killed->GetID());
|
ExportVar(package_name.c_str(), "killed_entity_id", killed->GetID());
|
||||||
ExportVar(package_name.c_str(), "killed_bot_id", killed->IsBot() ? killed->CastToBot()->GetBotID() : 0);
|
ExportVar(package_name.c_str(), "killed_bot_id", killed->IsBot() ? killed->CastToBot()->GetBotID() : 0);
|
||||||
ExportVar(package_name.c_str(), "killed_npc_id", killed->IsNPC() ? killed->GetNPCTypeID() : 0);
|
ExportVar(package_name.c_str(), "killed_npc_id", killed->IsNPC() ? killed->GetNPCTypeID() : 0);
|
||||||
@@ -1886,7 +1905,6 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "killed_h", killed->GetHeading());
|
ExportVar(package_name.c_str(), "killed_h", killed->GetHeading());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1909,6 +1927,7 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "slot_id", extradata);
|
ExportVar(package_name.c_str(), "slot_id", extradata);
|
||||||
ExportVar(package_name.c_str(), "item", "QuestItem", item_instance);
|
ExportVar(package_name.c_str(), "item", "QuestItem", item_instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1936,8 +1955,7 @@ void PerlembParser::ExportEventVariables(
|
|||||||
std::string tradeskill_id = "-1";
|
std::string tradeskill_id = "-1";
|
||||||
if (strcmp(sep.arg[0], "check_zone") == 0) {
|
if (strcmp(sep.arg[0], "check_zone") == 0) {
|
||||||
zone_id = sep.arg[1];
|
zone_id = sep.arg[1];
|
||||||
}
|
} else if (strcmp(sep.arg[0], "check_tradeskill") == 0) {
|
||||||
else if (strcmp(sep.arg[0], "check_tradeskill") == 0) {
|
|
||||||
tradeskill_id = sep.arg[1];
|
tradeskill_id = sep.arg[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1966,17 +1984,21 @@ void PerlembParser::ExportEventVariables(
|
|||||||
|
|
||||||
case EVENT_CONSIDER: {
|
case EVENT_CONSIDER: {
|
||||||
ExportVar(package_name.c_str(), "entity_id", Strings::ToInt(data));
|
ExportVar(package_name.c_str(), "entity_id", Strings::ToInt(data));
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() == 1) {
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
ExportVar(package_name.c_str(), "target", "Mob", std::any_cast<Mob*>(extra_pointers->at(0)));
|
ExportVar(package_name.c_str(), "target", "Mob", std::any_cast<Mob*>(extra_pointers->at(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EVENT_CONSIDER_CORPSE: {
|
case EVENT_CONSIDER_CORPSE: {
|
||||||
ExportVar(package_name.c_str(), "corpse_entity_id", Strings::ToInt(data));
|
ExportVar(package_name.c_str(), "corpse_entity_id", Strings::ToInt(data));
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() == 1) {
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
ExportVar(package_name.c_str(), "corpse", "Corpse", std::any_cast<Corpse*>(extra_pointers->at(0)));
|
ExportVar(package_name.c_str(), "corpse", "Corpse", std::any_cast<Corpse*>(extra_pointers->at(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1991,9 +2013,11 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "item_id", extradata);
|
ExportVar(package_name.c_str(), "item_id", extradata);
|
||||||
ExportVar(package_name.c_str(), "item_quantity", sep.arg[0]);
|
ExportVar(package_name.c_str(), "item_quantity", sep.arg[0]);
|
||||||
ExportVar(package_name.c_str(), "slot_id", sep.arg[1]);
|
ExportVar(package_name.c_str(), "slot_id", sep.arg[1]);
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() == 1) {
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0)));
|
ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2003,9 +2027,11 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "item_id", extradata);
|
ExportVar(package_name.c_str(), "item_id", extradata);
|
||||||
ExportVar(package_name.c_str(), "item_quantity", sep.arg[0]);
|
ExportVar(package_name.c_str(), "item_quantity", sep.arg[0]);
|
||||||
ExportVar(package_name.c_str(), "slot_id", sep.arg[1]);
|
ExportVar(package_name.c_str(), "slot_id", sep.arg[1]);
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() == 1) {
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0)));
|
ExportVar(package_name.c_str(), "item", "QuestItem", std::any_cast<EQ::ItemInstance*>(extra_pointers->at(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2111,9 +2137,11 @@ void PerlembParser::ExportEventVariables(
|
|||||||
|
|
||||||
case EVENT_INSPECT: {
|
case EVENT_INSPECT: {
|
||||||
ExportVar(package_name.c_str(), "target_id", extradata);
|
ExportVar(package_name.c_str(), "target_id", extradata);
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() == 1) {
|
if (extra_pointers && extra_pointers->size() == 1) {
|
||||||
ExportVar(package_name.c_str(), "target", "Mob", std::any_cast<Mob*>(extra_pointers->at(0)));
|
ExportVar(package_name.c_str(), "target", "Mob", std::any_cast<Mob*>(extra_pointers->at(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2138,6 +2166,7 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "area_id", *std::any_cast<int*>(extra_pointers->at(0)));
|
ExportVar(package_name.c_str(), "area_id", *std::any_cast<int*>(extra_pointers->at(0)));
|
||||||
ExportVar(package_name.c_str(), "area_type", *std::any_cast<int*>(extra_pointers->at(1)));
|
ExportVar(package_name.c_str(), "area_type", *std::any_cast<int*>(extra_pointers->at(1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2177,6 +2206,11 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "buff_slot", sep.arg[6]);
|
ExportVar(package_name.c_str(), "buff_slot", sep.arg[6]);
|
||||||
ExportVar(package_name.c_str(), "is_buff_tic", sep.arg[7]);
|
ExportVar(package_name.c_str(), "is_buff_tic", sep.arg[7]);
|
||||||
ExportVar(package_name.c_str(), "special_attack", sep.arg[8]);
|
ExportVar(package_name.c_str(), "special_attack", sep.arg[8]);
|
||||||
|
|
||||||
|
if (IsValidSpell(Strings::ToUnsignedInt(sep.arg[2]))) {
|
||||||
|
ExportVar(package_name.c_str(), "spell", "Spell", (void*)&spells[Strings::ToUnsignedInt(sep.arg[2])]);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2188,6 +2222,7 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "quantity", inst->IsStackable() ? inst->GetCharges() : 1);
|
ExportVar(package_name.c_str(), "quantity", inst->IsStackable() ? inst->GetCharges() : 1);
|
||||||
ExportVar(package_name.c_str(), "item", "QuestItem", inst);
|
ExportVar(package_name.c_str(), "item", "QuestItem", inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2198,9 +2233,11 @@ void PerlembParser::ExportEventVariables(
|
|||||||
Seperator sep(data);
|
Seperator sep(data);
|
||||||
ExportVar(package_name.c_str(), "slot_id", sep.arg[0]);
|
ExportVar(package_name.c_str(), "slot_id", sep.arg[0]);
|
||||||
ExportVar(package_name.c_str(), "spell_id", sep.arg[1]);
|
ExportVar(package_name.c_str(), "spell_id", sep.arg[1]);
|
||||||
|
|
||||||
if (IsValidSpell(Strings::ToUnsignedInt(sep.arg[1]))) {
|
if (IsValidSpell(Strings::ToUnsignedInt(sep.arg[1]))) {
|
||||||
ExportVar(package_name.c_str(), "spell", "Spell", (void*)&spells[Strings::ToUnsignedInt(sep.arg[1])]);
|
ExportVar(package_name.c_str(), "spell", "Spell", (void*)&spells[Strings::ToUnsignedInt(sep.arg[1])]);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+20
-35
@@ -1433,6 +1433,16 @@ void Perl__removeitem(uint32_t item_id, int quantity)
|
|||||||
quest_manager.removeitem(item_id, quantity);
|
quest_manager.removeitem(item_id, quantity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Perl__getitemcomment(uint32 item_id)
|
||||||
|
{
|
||||||
|
return quest_manager.getitemcomment(item_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Perl__getitemlore(uint32 item_id)
|
||||||
|
{
|
||||||
|
return quest_manager.getitemlore(item_id);
|
||||||
|
}
|
||||||
|
|
||||||
std::string Perl__getitemname(uint32 item_id)
|
std::string Perl__getitemname(uint32 item_id)
|
||||||
{
|
{
|
||||||
return quest_manager.getitemname(item_id);
|
return quest_manager.getitemname(item_id);
|
||||||
@@ -3506,14 +3516,7 @@ void Perl__crosszonemoveplayerbycharid(uint32 character_id, std::string zone_sho
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__crosszonemoveplayerbycharid(
|
void Perl__crosszonemoveplayerbycharid(uint32 character_id, std::string zone_short_name, float x, float y, float z, float heading)
|
||||||
uint32 character_id,
|
|
||||||
std::string zone_short_name,
|
|
||||||
float x,
|
|
||||||
float y,
|
|
||||||
float z,
|
|
||||||
float heading
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
quest_manager.CrossZoneMove(
|
quest_manager.CrossZoneMove(
|
||||||
CZMove_Struct{
|
CZMove_Struct{
|
||||||
@@ -3551,14 +3554,7 @@ void Perl__crosszonemoveplayerbygroupid(uint32 group_id, std::string zone_short_
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__crosszonemoveplayerbygroupid(
|
void Perl__crosszonemoveplayerbygroupid(uint32 group_id, std::string zone_short_name, float x, float y, float z, float heading)
|
||||||
uint32 group_id,
|
|
||||||
std::string zone_short_name,
|
|
||||||
float x,
|
|
||||||
float y,
|
|
||||||
float z,
|
|
||||||
float heading
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
quest_manager.CrossZoneMove(
|
quest_manager.CrossZoneMove(
|
||||||
CZMove_Struct{
|
CZMove_Struct{
|
||||||
@@ -3634,14 +3630,7 @@ void Perl__crosszonemoveplayerbyguildid(uint32 guild_id, std::string zone_short_
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__crosszonemoveplayerbyguildid(
|
void Perl__crosszonemoveplayerbyguildid(uint32 guild_id, std::string zone_short_name, float x, float y, float z, float heading)
|
||||||
uint32 guild_id,
|
|
||||||
std::string zone_short_name,
|
|
||||||
float x,
|
|
||||||
float y,
|
|
||||||
float z,
|
|
||||||
float heading
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
quest_manager.CrossZoneMove(
|
quest_manager.CrossZoneMove(
|
||||||
CZMove_Struct{
|
CZMove_Struct{
|
||||||
@@ -3679,14 +3668,7 @@ void Perl__crosszonemoveplayerbyexpeditionid(uint32 expedition_id, std::string z
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__crosszonemoveplayerbyexpeditionid(
|
void Perl__crosszonemoveplayerbyexpeditionid(uint32 expedition_id, std::string zone_short_name, float x, float y, float z, float heading)
|
||||||
uint32 expedition_id,
|
|
||||||
std::string zone_short_name,
|
|
||||||
float x,
|
|
||||||
float y,
|
|
||||||
float z,
|
|
||||||
float heading
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
quest_manager.CrossZoneMove(
|
quest_manager.CrossZoneMove(
|
||||||
CZMove_Struct{
|
CZMove_Struct{
|
||||||
@@ -5860,8 +5842,8 @@ void perl_register_quest()
|
|||||||
package.add("GetZoneFogRed", (uint8(*)(uint32))&Perl__GetZoneFogRed);
|
package.add("GetZoneFogRed", (uint8(*)(uint32))&Perl__GetZoneFogRed);
|
||||||
package.add("GetZoneFogRed", (uint8(*)(uint32, uint8))&Perl__GetZoneFogRed);
|
package.add("GetZoneFogRed", (uint8(*)(uint32, uint8))&Perl__GetZoneFogRed);
|
||||||
package.add("GetZoneFogRed", (uint8(*)(uint32, uint8, int))&Perl__GetZoneFogRed);
|
package.add("GetZoneFogRed", (uint8(*)(uint32, uint8, int))&Perl__GetZoneFogRed);
|
||||||
package.add("GetZoneGravity", (float(*)(uint32))&Perl__GetZoneMaximumClip);
|
package.add("GetZoneGravity", (float(*)(uint32))&Perl__GetZoneGravity);
|
||||||
package.add("GetZoneGravity", (float(*)(uint32, int))&Perl__GetZoneMaximumClip);
|
package.add("GetZoneGravity", (float(*)(uint32, int))&Perl__GetZoneGravity);
|
||||||
package.add("GetZoneMaximumClip", (float(*)(uint32))&Perl__GetZoneMaximumClip);
|
package.add("GetZoneMaximumClip", (float(*)(uint32))&Perl__GetZoneMaximumClip);
|
||||||
package.add("GetZoneMaximumClip", (float(*)(uint32, int))&Perl__GetZoneMaximumClip);
|
package.add("GetZoneMaximumClip", (float(*)(uint32, int))&Perl__GetZoneMaximumClip);
|
||||||
package.add("GetZoneMaximumExpansion", (int8(*)(uint32))&Perl__GetZoneMaximumExpansion);
|
package.add("GetZoneMaximumExpansion", (int8(*)(uint32))&Perl__GetZoneMaximumExpansion);
|
||||||
@@ -6033,6 +6015,7 @@ void perl_register_quest()
|
|||||||
package.add("IsTargetRequiredForSpell", &Perl__IsTargetRequiredForSpell);
|
package.add("IsTargetRequiredForSpell", &Perl__IsTargetRequiredForSpell);
|
||||||
package.add("IsTeleportSpell", &Perl__IsTeleportSpell);
|
package.add("IsTeleportSpell", &Perl__IsTeleportSpell);
|
||||||
package.add("IsTranslocateSpell", &Perl__IsTranslocateSpell);
|
package.add("IsTranslocateSpell", &Perl__IsTranslocateSpell);
|
||||||
|
package.add("IsTGBCompatibleSpell", &Perl__IsTGBCompatibleSpell);
|
||||||
package.add("IsVeryFastHealSpell", &Perl__IsVeryFastHealSpell);
|
package.add("IsVeryFastHealSpell", &Perl__IsVeryFastHealSpell);
|
||||||
package.add("IsVirusSpell", &Perl__IsVirusSpell);
|
package.add("IsVirusSpell", &Perl__IsVirusSpell);
|
||||||
package.add("IsValidSpell", &Perl__IsValidSpell);
|
package.add("IsValidSpell", &Perl__IsValidSpell);
|
||||||
@@ -6315,7 +6298,7 @@ void perl_register_quest()
|
|||||||
package.add("worldwideremovespell", (void(*)(uint32, uint8))&Perl__worldwideremovespell);
|
package.add("worldwideremovespell", (void(*)(uint32, uint8))&Perl__worldwideremovespell);
|
||||||
package.add("worldwideremovespell", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovespell);
|
package.add("worldwideremovespell", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovespell);
|
||||||
package.add("worldwideremovetask", (void(*)(uint32))&Perl__worldwideremovetask);
|
package.add("worldwideremovetask", (void(*)(uint32))&Perl__worldwideremovetask);
|
||||||
package.add("worldwideremovetask", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovetask);
|
package.add("worldwideremovetask", (void(*)(uint32, uint8))&Perl__worldwideremovetask);
|
||||||
package.add("worldwideremovetask", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovetask);
|
package.add("worldwideremovetask", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovetask);
|
||||||
package.add("worldwideresetactivity", (void(*)(uint32, int))&Perl__worldwideresetactivity);
|
package.add("worldwideresetactivity", (void(*)(uint32, int))&Perl__worldwideresetactivity);
|
||||||
package.add("worldwideresetactivity", (void(*)(uint32, int, uint8))&Perl__worldwideresetactivity);
|
package.add("worldwideresetactivity", (void(*)(uint32, int, uint8))&Perl__worldwideresetactivity);
|
||||||
@@ -6404,6 +6387,8 @@ void perl_register_quest()
|
|||||||
package.add("get_expedition_lockouts_by_char_id", (perl::reference(*)(uint32, std::string))&Perl__get_expedition_lockouts_by_char_id);
|
package.add("get_expedition_lockouts_by_char_id", (perl::reference(*)(uint32, std::string))&Perl__get_expedition_lockouts_by_char_id);
|
||||||
package.add("getfactionname", &Perl__getfactionname);
|
package.add("getfactionname", &Perl__getfactionname);
|
||||||
package.add("getinventoryslotid", &Perl__getinventoryslotid);
|
package.add("getinventoryslotid", &Perl__getinventoryslotid);
|
||||||
|
package.add("getitemcomment", &Perl__getitemcomment);
|
||||||
|
package.add("getitemlore", &Perl__getitemlore);
|
||||||
package.add("getitemname", &Perl__getitemname);
|
package.add("getitemname", &Perl__getitemname);
|
||||||
package.add("getitemstat", &Perl__getitemstat);
|
package.add("getitemstat", &Perl__getitemstat);
|
||||||
package.add("getlanguagename", &Perl__getlanguagename);
|
package.add("getlanguagename", &Perl__getlanguagename);
|
||||||
|
|||||||
+8
-2
@@ -210,7 +210,7 @@ void Embperl::init_eval_file(void)
|
|||||||
"} else {"
|
"} else {"
|
||||||
// we 'my' $filename,$mtime,$package,$sub to prevent them from changing our state up here.
|
// we 'my' $filename,$mtime,$package,$sub to prevent them from changing our state up here.
|
||||||
" eval(\"package $package; my(\\$filename,\\$mtime,\\$package,\\$sub); \\$isloaded = 1; require './$filename'; \");"
|
" eval(\"package $package; my(\\$filename,\\$mtime,\\$package,\\$sub); \\$isloaded = 1; require './$filename'; \");"
|
||||||
// " print $@ if $@;"
|
" print $@ if $@;"
|
||||||
/* "local *FH;open FH, $filename or die \"open '$filename' $!\";"
|
/* "local *FH;open FH, $filename or die \"open '$filename' $!\";"
|
||||||
"local($/) = undef;my $sub = <FH>;close FH;"
|
"local($/) = undef;my $sub = <FH>;close FH;"
|
||||||
"my $eval = qq{package $package; sub handler { $sub; }};"
|
"my $eval = qq{package $package; sub handler { $sub; }};"
|
||||||
@@ -277,8 +277,14 @@ int Embperl::dosub(const char * subname, const std::vector<std::string> * args,
|
|||||||
std::string sub = subname;
|
std::string sub = subname;
|
||||||
if (sub == "main::eval_file" && !filename.empty() && File::Exists(filename)) {
|
if (sub == "main::eval_file" && !filename.empty() && File::Exists(filename)) {
|
||||||
BenchTimer benchmark;
|
BenchTimer benchmark;
|
||||||
|
|
||||||
|
std::string perl = "perl";
|
||||||
|
if (File::Exists("/opt/eqemu-perl/bin/perl")) {
|
||||||
|
perl = "/opt/eqemu-perl/bin/perl";
|
||||||
|
}
|
||||||
|
|
||||||
std::string syntax_error = Process::execute(
|
std::string syntax_error = Process::execute(
|
||||||
fmt::format("perl -c {} 2>&1", filename)
|
fmt::format("{} -c {} 2>&1", perl, filename)
|
||||||
);
|
);
|
||||||
LogQuests("Perl eval [{}] took [{}]", filename, benchmark.elapsed());
|
LogQuests("Perl eval [{}] took [{}]", filename, benchmark.elapsed());
|
||||||
syntax_error = Strings::Trim(syntax_error);
|
syntax_error = Strings::Trim(syntax_error);
|
||||||
|
|||||||
@@ -31,12 +31,7 @@ void command_castspell(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool can_instant_cast = c->Admin() >= commandInstacast;
|
const bool instant_cast = sep->IsNumber(2) ? Strings::ToBool(sep->arg[2]) : true;
|
||||||
bool instant_cast = false;
|
|
||||||
if (can_instant_cast && sep->IsNumber(2)) {
|
|
||||||
instant_cast = Strings::ToBool(sep->arg[2]);
|
|
||||||
}
|
|
||||||
|
|
||||||
const uint16 target_id = t->GetID();
|
const uint16 target_id = t->GetID();
|
||||||
|
|
||||||
if (instant_cast) {
|
if (instant_cast) {
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
void command_giveitem(Client *c, const Seperator *sep)
|
void command_giveitem(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
|
if (!c->GetTarget() || !c->GetTarget()->IsClient()) {
|
||||||
|
c->Message(Chat::White, "You must target a player to use this command.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint32 item_id = 0;
|
uint32 item_id = 0;
|
||||||
int16 charges = -1;
|
int16 charges = -1;
|
||||||
uint32 augment_one = 0;
|
uint32 augment_one = 0;
|
||||||
@@ -10,21 +15,17 @@ void command_giveitem(Client *c, const Seperator *sep)
|
|||||||
uint32 augment_four = 0;
|
uint32 augment_four = 0;
|
||||||
uint32 augment_five = 0;
|
uint32 augment_five = 0;
|
||||||
uint32 augment_six = 0;
|
uint32 augment_six = 0;
|
||||||
int arguments = sep->argnum;
|
const uint16 arguments = sep->argnum;
|
||||||
std::string cmd_msg = sep->msg;
|
std::string cmd_msg = sep->msg;
|
||||||
size_t link_open = cmd_msg.find('\x12');
|
size_t link_open = cmd_msg.find('\x12');
|
||||||
size_t link_close = cmd_msg.find_last_of('\x12');
|
size_t link_close = cmd_msg.find_last_of('\x12');
|
||||||
if (c->GetTarget()) {
|
|
||||||
if (!c->GetTarget()->IsClient()) {
|
|
||||||
c->Message(Chat::Red, "You can only give items to players with this command.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (link_open != link_close && (cmd_msg.length() - link_open) > EQ::constants::SAY_LINK_BODY_SIZE) {
|
if (link_open != link_close && (cmd_msg.length() - link_open) > EQ::constants::SAY_LINK_BODY_SIZE) {
|
||||||
EQ::SayLinkBody_Struct link_body;
|
EQ::SayLinkBody_Struct link_body;
|
||||||
EQ::saylink::DegenerateLinkBody(
|
EQ::saylink::DegenerateLinkBody(
|
||||||
link_body,
|
link_body,
|
||||||
cmd_msg.substr(link_open + 1, EQ::constants::SAY_LINK_BODY_SIZE));
|
cmd_msg.substr(link_open + 1, EQ::constants::SAY_LINK_BODY_SIZE)
|
||||||
|
);
|
||||||
item_id = link_body.item_id;
|
item_id = link_body.item_id;
|
||||||
augment_one = link_body.augment_1;
|
augment_one = link_body.augment_1;
|
||||||
augment_two = link_body.augment_2;
|
augment_two = link_body.augment_2;
|
||||||
@@ -32,26 +33,35 @@ void command_giveitem(Client *c, const Seperator *sep)
|
|||||||
augment_four = link_body.augment_4;
|
augment_four = link_body.augment_4;
|
||||||
augment_five = link_body.augment_5;
|
augment_five = link_body.augment_5;
|
||||||
augment_six = link_body.augment_6;
|
augment_six = link_body.augment_6;
|
||||||
}
|
} else if (sep->IsNumber(1)) {
|
||||||
else if (sep->IsNumber(1)) {
|
item_id = Strings::ToUnsignedInt(sep->arg[1]);
|
||||||
item_id = Strings::ToInt(sep->arg[1]);
|
} else if (!sep->IsNumber(1)) {
|
||||||
}
|
|
||||||
else if (!sep->IsNumber(1)) {
|
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::Red,
|
Chat::Red,
|
||||||
"Usage: #giveitem [item id | link] [charges] [augment_one_id] [augment_two_id] [augment_three_id] [augment_four_id] [augment_five_id] [augment_six_id] (Charges are optional.)"
|
"Usage: #giveitem [item id | link] [charges] [augment_one_id] [augment_two_id] [augment_three_id] [augment_four_id] [augment_five_id] [augment_six_id] (Charges and augments are optional.)"
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Client *client_target = c->GetTarget()->CastToClient();
|
Client* t = c->GetTarget()->CastToClient();
|
||||||
|
|
||||||
uint8 item_status = 0;
|
uint8 item_status = 0;
|
||||||
uint8 current_status = c->Admin();
|
const uint8 current_status = c->Admin();
|
||||||
const EQ::ItemData *item = database.GetItem(item_id);
|
|
||||||
if (item) {
|
const auto *item = database.GetItem(item_id);
|
||||||
item_status = item->MinStatus;
|
if (!item) {
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Item ID {} does not exist.",
|
||||||
|
item_id
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item_status = item->MinStatus;
|
||||||
|
|
||||||
if (item_status > current_status) {
|
if (item_status > current_status) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
@@ -65,34 +75,34 @@ void command_giveitem(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 2 && sep->IsNumber(2)) {
|
if (arguments >= 2 && sep->IsNumber(2)) {
|
||||||
charges = Strings::ToInt(sep->arg[2]);
|
charges = static_cast<int16>(Strings::ToInt(sep->arg[2]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 3 && sep->IsNumber(3)) {
|
if (arguments >= 3 && sep->IsNumber(3)) {
|
||||||
augment_one = Strings::ToInt(sep->arg[3]);
|
augment_one = Strings::ToUnsignedInt(sep->arg[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 4 && sep->IsNumber(4)) {
|
if (arguments >= 4 && sep->IsNumber(4)) {
|
||||||
augment_two = Strings::ToInt(sep->arg[4]);
|
augment_two = Strings::ToUnsignedInt(sep->arg[4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 5 && sep->IsNumber(5)) {
|
if (arguments >= 5 && sep->IsNumber(5)) {
|
||||||
augment_three = Strings::ToInt(sep->arg[5]);
|
augment_three = Strings::ToUnsignedInt(sep->arg[5]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 6 && sep->IsNumber(6)) {
|
if (arguments >= 6 && sep->IsNumber(6)) {
|
||||||
augment_four = Strings::ToInt(sep->arg[6]);
|
augment_four = Strings::ToUnsignedInt(sep->arg[6]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 7 && sep->IsNumber(7)) {
|
if (arguments >= 7 && sep->IsNumber(7)) {
|
||||||
augment_five = Strings::ToInt(sep->arg[7]);
|
augment_five = Strings::ToUnsignedInt(sep->arg[7]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments == 8 && sep->IsNumber(8)) {
|
if (arguments == 8 && sep->IsNumber(8)) {
|
||||||
augment_six = Strings::ToInt(sep->arg[8]);
|
augment_six = Strings::ToUnsignedInt(sep->arg[8]);
|
||||||
}
|
}
|
||||||
|
|
||||||
client_target->SummonItem(
|
t->SummonItem(
|
||||||
item_id,
|
item_id,
|
||||||
charges,
|
charges,
|
||||||
augment_one,
|
augment_one,
|
||||||
@@ -102,10 +112,30 @@ void command_giveitem(Client *c, const Seperator *sep)
|
|||||||
augment_five,
|
augment_five,
|
||||||
augment_six
|
augment_six
|
||||||
);
|
);
|
||||||
}
|
|
||||||
else {
|
|
||||||
c->Message(Chat::Red, "You must target a client to give the item to.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
const auto *new_item = database.CreateItem(
|
||||||
|
item_id,
|
||||||
|
charges,
|
||||||
|
augment_one,
|
||||||
|
augment_two,
|
||||||
|
augment_three,
|
||||||
|
augment_four,
|
||||||
|
augment_five,
|
||||||
|
augment_six
|
||||||
|
);
|
||||||
|
|
||||||
|
EQ::SayLinkEngine linker;
|
||||||
|
linker.SetLinkType(EQ::saylink::SayLinkItemInst);
|
||||||
|
linker.SetItemInst(new_item);
|
||||||
|
|
||||||
|
const std::string &item_link = linker.GenerateLink();
|
||||||
|
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"You have given {} to {}.",
|
||||||
|
item_link,
|
||||||
|
c->GetTargetDescription(t)
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ void command_givemoney(Client *c, const Seperator *sep)
|
|||||||
{
|
{
|
||||||
int arguments = sep->argnum;
|
int arguments = sep->argnum;
|
||||||
if (!arguments || !sep->IsNumber(1)) { //as long as the first one is a number, we'll just let atoi convert the rest to 0 or a number
|
if (!arguments || !sep->IsNumber(1)) { //as long as the first one is a number, we'll just let atoi convert the rest to 0 or a number
|
||||||
c->Message(Chat::Red, "Usage: #Usage: #givemoney [Platinum] [Gold] [Silver] [Copper]");
|
c->Message(Chat::Red, "Usage: #givemoney [Platinum] [Gold] [Silver] [Copper]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ void command_givemoney(Client *c, const Seperator *sep)
|
|||||||
uint32 silver = sep->IsNumber(3) ? Strings::ToUnsignedInt(sep->arg[3]) : 0;
|
uint32 silver = sep->IsNumber(3) ? Strings::ToUnsignedInt(sep->arg[3]) : 0;
|
||||||
uint32 copper = sep->IsNumber(4) ? Strings::ToUnsignedInt(sep->arg[4]) : 0;
|
uint32 copper = sep->IsNumber(4) ? Strings::ToUnsignedInt(sep->arg[4]) : 0;
|
||||||
if (!platinum && !gold && !silver && !copper) {
|
if (!platinum && !gold && !silver && !copper) {
|
||||||
c->Message(Chat::Red, "Usage: #Usage: #givemoney [Platinum] [Gold] [Silver] [Copper]");
|
c->Message(Chat::Red, "Usage: #givemoney [Platinum] [Gold] [Silver] [Copper]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,24 @@ void command_grantaa(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const uint8 unlock_level = sep->IsNumber(1) ? static_cast<uint8>(Strings::ToUnsignedInt(sep->arg[1])) : 0;
|
||||||
|
|
||||||
auto t = c->GetTarget()->CastToClient();
|
auto t = c->GetTarget()->CastToClient();
|
||||||
t->GrantAllAAPoints();
|
t->GrantAllAAPoints(unlock_level);
|
||||||
|
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"Successfully granted all Alternate Advancements for {}.",
|
"Successfully granted all Alternate Advancements for {}{}.",
|
||||||
c->GetTargetDescription(t)
|
c->GetTargetDescription(t),
|
||||||
|
(
|
||||||
|
unlock_level ?
|
||||||
|
fmt::format(
|
||||||
|
" up to level {}",
|
||||||
|
unlock_level
|
||||||
|
) :
|
||||||
|
""
|
||||||
|
)
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,12 @@ void command_movechar(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto zone_id = ZoneID(zone_short_name);
|
auto zone_id = ZoneID(zone_short_name);
|
||||||
std::string zone_long_name = ZoneLongName(zone_id);
|
auto z = GetZone(zone_id);
|
||||||
|
|
||||||
|
if (!z) {
|
||||||
|
c->Message(Chat::Red, "Invalid zone.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool is_special_zone = (
|
bool is_special_zone = (
|
||||||
zone_short_name.find("cshome") != std::string::npos ||
|
zone_short_name.find("cshome") != std::string::npos ||
|
||||||
@@ -59,7 +64,7 @@ void command_movechar(Client *c, const Seperator *sep)
|
|||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"{} ({}) is a special zone and you cannot move someone there.",
|
"{} ({}) is a special zone and you cannot move someone there.",
|
||||||
zone_long_name,
|
z->long_name,
|
||||||
zone_short_name
|
zone_short_name
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
@@ -91,7 +96,7 @@ void command_movechar(Client *c, const Seperator *sep)
|
|||||||
fmt::format(
|
fmt::format(
|
||||||
"Character Move {} | Zone: {} ({}) ID: {}",
|
"Character Move {} | Zone: {} ({}) ID: {}",
|
||||||
moved_string,
|
moved_string,
|
||||||
zone_long_name,
|
z->long_name,
|
||||||
zone_short_name,
|
zone_short_name,
|
||||||
zone_id
|
zone_id
|
||||||
).c_str()
|
).c_str()
|
||||||
|
|||||||
@@ -14,14 +14,14 @@ void SetDate(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeOfDay_Struct eq_time;
|
TimeOfDay_Struct t{};
|
||||||
zone->zone_time.GetCurrentEQTimeOfDay(time(0), &eq_time);
|
zone->zone_time.GetCurrentEQTimeOfDay(time(0), &t);
|
||||||
|
|
||||||
const uint16 year = Strings::ToUnsignedInt(sep->arg[2]);
|
const uint16 year = Strings::ToUnsignedInt(sep->arg[2]);
|
||||||
const uint8 month = Strings::ToUnsignedInt(sep->arg[3]);
|
const uint8 month = Strings::ToUnsignedInt(sep->arg[3]);
|
||||||
const uint8 day = Strings::ToUnsignedInt(sep->arg[4]);
|
const uint8 day = Strings::ToUnsignedInt(sep->arg[4]);
|
||||||
const uint8 hour = !sep->IsNumber(5) ? eq_time.hour : Strings::ToUnsignedInt(sep->arg[5]) + 1;
|
const uint8 hour = !sep->IsNumber(5) ? t.hour : Strings::ToUnsignedInt(sep->arg[5]) + 1;
|
||||||
const uint8 minute = !sep->IsNumber(6) ? eq_time.minute : Strings::ToUnsignedInt(sep->arg[6]);
|
const uint8 minute = !sep->IsNumber(6) ? t.minute : Strings::ToUnsignedInt(sep->arg[6]);
|
||||||
|
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ void SetTime(Client *c, const Seperator *sep)
|
|||||||
if (arguments < 2 || !sep->IsNumber(2)) {
|
if (arguments < 2 || !sep->IsNumber(2)) {
|
||||||
c->Message(Chat::White, "Usage: #set time [Hour] [Minute]");
|
c->Message(Chat::White, "Usage: #set time [Hour] [Minute]");
|
||||||
|
|
||||||
TimeOfDay_Struct world_time;
|
TimeOfDay_Struct world_time{};
|
||||||
zone->zone_time.GetCurrentEQTimeOfDay(time(0), &world_time);
|
zone->zone_time.GetCurrentEQTimeOfDay(time(0), &world_time);
|
||||||
|
|
||||||
auto time_string = fmt::format(
|
auto time_string = fmt::format(
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "../client.h"
|
#include "../client.h"
|
||||||
|
#include "show/aa_points.cpp"
|
||||||
#include "show/aggro.cpp"
|
#include "show/aggro.cpp"
|
||||||
#include "show/buffs.cpp"
|
#include "show/buffs.cpp"
|
||||||
#include "show/buried_corpse_count.cpp"
|
#include "show/buried_corpse_count.cpp"
|
||||||
@@ -55,6 +56,7 @@ void command_show(Client *c, const Seperator *sep)
|
|||||||
};
|
};
|
||||||
|
|
||||||
std::vector<Cmd> commands = {
|
std::vector<Cmd> commands = {
|
||||||
|
Cmd{.cmd = "aa_points", .u = "aa_points", .fn = ShowAAPoints, .a = {"#showaapoints", "#showaapts"}},
|
||||||
Cmd{.cmd = "aggro", .u = "aggro [Distance] [-v] (-v is verbose Faction Information)", .fn = ShowAggro, .a = {"#aggro"}},
|
Cmd{.cmd = "aggro", .u = "aggro [Distance] [-v] (-v is verbose Faction Information)", .fn = ShowAggro, .a = {"#aggro"}},
|
||||||
Cmd{.cmd = "buffs", .u = "buffs", .fn = ShowBuffs, .a = {"#showbuffs"}},
|
Cmd{.cmd = "buffs", .u = "buffs", .fn = ShowBuffs, .a = {"#showbuffs"}},
|
||||||
Cmd{.cmd = "buried_corpse_count", .u = "buried_corpse_count", .fn = ShowBuriedCorpseCount, .a = {"#getplayerburiedcorpsecount"}},
|
Cmd{.cmd = "buried_corpse_count", .u = "buried_corpse_count", .fn = ShowBuriedCorpseCount, .a = {"#getplayerburiedcorpsecount"}},
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
#include "../../client.h"
|
||||||
|
#include "../../dialogue_window.h"
|
||||||
|
|
||||||
|
void ShowAAPoints(Client *c, const Seperator *sep)
|
||||||
|
{
|
||||||
|
Client *t = c;
|
||||||
|
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||||
|
t = c->GetTarget()->CastToClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
const int aa_points = t->GetAAPoints();
|
||||||
|
const int spent_aa_points = t->GetSpentAA();
|
||||||
|
const int total_aa_points = (aa_points + spent_aa_points);
|
||||||
|
|
||||||
|
if (!total_aa_points) {
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"{} {} no AA Points.",
|
||||||
|
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||||
|
c == t ? "have" : "has"
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"AA Points for {} | Current: {} Spent: {} Total: {}",
|
||||||
|
c->GetTargetDescription(t, TargetDescriptionType::UCSelf),
|
||||||
|
Strings::Commify(aa_points),
|
||||||
|
Strings::Commify(spent_aa_points),
|
||||||
|
Strings::Commify(total_aa_points)
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -3,34 +3,34 @@
|
|||||||
|
|
||||||
void ShowCurrencies(Client *c, const Seperator *sep)
|
void ShowCurrencies(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
auto t = c;
|
Client *t = c;
|
||||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||||
t = c->GetTarget()->CastToClient();
|
t = c->GetTarget()->CastToClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint32 platinum = (
|
const uint64 platinum = (
|
||||||
t->GetMoney(3, 0) +
|
t->GetMoney(MoneyTypes::Platinum, MoneySubtypes::Personal) +
|
||||||
t->GetMoney(3, 1) +
|
t->GetMoney(MoneyTypes::Platinum, MoneySubtypes::Bank) +
|
||||||
t->GetMoney(3, 2) +
|
t->GetMoney(MoneyTypes::Platinum, MoneySubtypes::Cursor) +
|
||||||
t->GetMoney(3, 3)
|
t->GetMoney(MoneyTypes::Platinum, MoneySubtypes::SharedBank)
|
||||||
);
|
);
|
||||||
|
|
||||||
const uint32 gold = (
|
const uint64 gold = (
|
||||||
t->GetMoney(2, 0) +
|
t->GetMoney(MoneyTypes::Gold, MoneySubtypes::Personal) +
|
||||||
t->GetMoney(2, 1) +
|
t->GetMoney(MoneyTypes::Gold, MoneySubtypes::Bank) +
|
||||||
t->GetMoney(2, 2)
|
t->GetMoney(MoneyTypes::Gold, MoneySubtypes::Cursor)
|
||||||
);
|
);
|
||||||
|
|
||||||
const uint32 silver = (
|
const uint64 silver = (
|
||||||
t->GetMoney(1, 0) +
|
t->GetMoney(MoneyTypes::Silver, MoneySubtypes::Personal) +
|
||||||
t->GetMoney(1, 1) +
|
t->GetMoney(MoneyTypes::Silver, MoneySubtypes::Bank) +
|
||||||
t->GetMoney(1, 2)
|
t->GetMoney(MoneyTypes::Silver, MoneySubtypes::Cursor)
|
||||||
);
|
);
|
||||||
|
|
||||||
const uint32 copper = (
|
const uint64 copper = (
|
||||||
t->GetMoney(0, 0) +
|
t->GetMoney(MoneyTypes::Copper, MoneySubtypes::Personal) +
|
||||||
t->GetMoney(0, 1) +
|
t->GetMoney(MoneyTypes::Copper, MoneySubtypes::Bank) +
|
||||||
t->GetMoney(0, 2)
|
t->GetMoney(MoneyTypes::Copper, MoneySubtypes::Cursor)
|
||||||
);
|
);
|
||||||
|
|
||||||
std::string currency_table;
|
std::string currency_table;
|
||||||
@@ -79,9 +79,9 @@ void ShowCurrencies(Client *c, const Seperator *sep)
|
|||||||
for (const auto& a : zone->AlternateCurrencies) {
|
for (const auto& a : zone->AlternateCurrencies) {
|
||||||
const uint32 currency_value = t->GetAlternateCurrencyValue(a.id);
|
const uint32 currency_value = t->GetAlternateCurrencyValue(a.id);
|
||||||
if (currency_value) {
|
if (currency_value) {
|
||||||
const auto* d = database.GetItem(a.item_id);
|
const auto *item = database.GetItem(a.item_id);
|
||||||
currency_table += DialogueWindow::TableRow(
|
currency_table += DialogueWindow::TableRow(
|
||||||
DialogueWindow::TableCell(d->Name) +
|
DialogueWindow::TableCell(item->Name) +
|
||||||
DialogueWindow::TableCell(Strings::Commify(currency_value))
|
DialogueWindow::TableCell(Strings::Commify(currency_value))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ void ShowGroupInfo(Client *c, const Seperator *sep)
|
|||||||
);
|
);
|
||||||
|
|
||||||
const std::string yes = DialogueWindow::ColorMessage("forest_green", "Y");
|
const std::string yes = DialogueWindow::ColorMessage("forest_green", "Y");
|
||||||
const std::string no = DialogueWindow::ColorMessage("red1", "N");
|
const std::string no = DialogueWindow::ColorMessage("red_1", "N");
|
||||||
|
|
||||||
for (int group_member = 0; group_member < MAX_GROUP_MEMBERS; group_member++) {
|
for (int group_member = 0; group_member < MAX_GROUP_MEMBERS; group_member++) {
|
||||||
if (g->membername[group_member][0] == '\0') {
|
if (g->membername[group_member][0] == '\0') {
|
||||||
@@ -60,8 +60,8 @@ void ShowGroupInfo(Client *c, const Seperator *sep)
|
|||||||
popup_table += DialogueWindow::TableRow(
|
popup_table += DialogueWindow::TableRow(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"{}{}{}{}{}{}",
|
"{}{}{}{}{}{}",
|
||||||
group_member,
|
DialogueWindow::TableCell(std::to_string(group_member)),
|
||||||
(
|
DialogueWindow::TableCell(
|
||||||
strcmp(g->membername[group_member], c->GetCleanName()) ?
|
strcmp(g->membername[group_member], c->GetCleanName()) ?
|
||||||
g->membername[group_member] :
|
g->membername[group_member] :
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -69,10 +69,10 @@ void ShowGroupInfo(Client *c, const Seperator *sep)
|
|||||||
g->membername[group_member]
|
g->membername[group_member]
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
g->members[group_member] ? yes : no,
|
DialogueWindow::TableCell(g->members[group_member] ? yes : no),
|
||||||
is_assist ? yes : no,
|
DialogueWindow::TableCell(is_assist ? yes : no),
|
||||||
is_puller ? yes : no,
|
DialogueWindow::TableCell(is_puller ? yes : no),
|
||||||
is_tank ? yes : no
|
DialogueWindow::TableCell(is_tank ? yes : no)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ void ShowZoneData(Client *c, const Seperator *sep)
|
|||||||
fmt::format(
|
fmt::format(
|
||||||
"{} {} {}",
|
"{} {} {}",
|
||||||
DialogueWindow::ColorMessage(
|
DialogueWindow::ColorMessage(
|
||||||
"red1",
|
"red_1",
|
||||||
std::to_string(zone->newzone_data.fog_red[fog_index])
|
std::to_string(zone->newzone_data.fog_red[fog_index])
|
||||||
),
|
),
|
||||||
DialogueWindow::ColorMessage(
|
DialogueWindow::ColorMessage(
|
||||||
@@ -206,7 +206,7 @@ void ShowZoneData(Client *c, const Seperator *sep)
|
|||||||
DialogueWindow::TableCell(
|
DialogueWindow::TableCell(
|
||||||
zone->newzone_data.suspend_buffs ?
|
zone->newzone_data.suspend_buffs ?
|
||||||
DialogueWindow::ColorMessage("forest_green", "Y") :
|
DialogueWindow::ColorMessage("forest_green", "Y") :
|
||||||
DialogueWindow::ColorMessage("red1", "N")
|
DialogueWindow::ColorMessage("red_1", "N")
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
+15
-10
@@ -15,7 +15,7 @@ void command_summon(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mob* target;
|
Mob* t = c;
|
||||||
|
|
||||||
if (arguments == 1) {
|
if (arguments == 1) {
|
||||||
std::string character_name = sep->arg[1];
|
std::string character_name = sep->arg[1];
|
||||||
@@ -33,7 +33,7 @@ void command_summon(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
auto search_client = entity_list.GetClientByName(character_name.c_str());
|
auto search_client = entity_list.GetClientByName(character_name.c_str());
|
||||||
if (search_client) {
|
if (search_client) {
|
||||||
target = search_client->CastToMob();
|
t = search_client->CastToMob();
|
||||||
} else {
|
} else {
|
||||||
if (!worldserver.Connected()) {
|
if (!worldserver.Connected()) {
|
||||||
c->Message(Chat::White, "World server is currently disconnected.");
|
c->Message(Chat::White, "World server is currently disconnected.");
|
||||||
@@ -56,19 +56,24 @@ void command_summon(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (c->GetTarget()) {
|
} else if (c->GetTarget()) {
|
||||||
target = c->GetTarget();
|
t = c->GetTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c == target) {
|
if (c == t) {
|
||||||
c->Message(Chat::White, "You cannot summon yourself.");
|
c->Message(Chat::White, "You cannot summon yourself.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!t) {
|
||||||
|
c->Message(Chat::White, "You must have a target to summon.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"Summoning {} to {:.2f}, {:.2f}, {:.2f} in {} ({}).",
|
"Summoning {} to {:.2f}, {:.2f}, {:.2f} in {} ({}).",
|
||||||
c->GetTargetDescription(target),
|
c->GetTargetDescription(t),
|
||||||
c->GetX(),
|
c->GetX(),
|
||||||
c->GetY(),
|
c->GetY(),
|
||||||
c->GetZ(),
|
c->GetZ(),
|
||||||
@@ -77,8 +82,8 @@ void command_summon(Client *c, const Seperator *sep)
|
|||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (target->IsClient()) {
|
if (t->IsClient()) {
|
||||||
target->CastToClient()->MovePC(
|
t->CastToClient()->MovePC(
|
||||||
zone->GetZoneID(),
|
zone->GetZoneID(),
|
||||||
zone->GetInstanceID(),
|
zone->GetInstanceID(),
|
||||||
c->GetX(),
|
c->GetX(),
|
||||||
@@ -91,10 +96,10 @@ void command_summon(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
target->GMMove(c->GetPosition());
|
t->GMMove(c->GetPosition());
|
||||||
|
|
||||||
if (target->IsNPC()) {
|
if (t->IsNPC()) {
|
||||||
target->CastToNPC()->SaveGuardSpot(glm::vec4(0.0f));
|
t->CastToNPC()->SaveGuardSpot(glm::vec4(0.0f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,11 @@ void command_summonitem(Client *c, const Seperator *sep)
|
|||||||
uint32 augment_four = 0;
|
uint32 augment_four = 0;
|
||||||
uint32 augment_five = 0;
|
uint32 augment_five = 0;
|
||||||
uint32 augment_six = 0;
|
uint32 augment_six = 0;
|
||||||
int arguments = sep->argnum;
|
const uint16 arguments = sep->argnum;
|
||||||
std::string cmd_msg = sep->msg;
|
std::string cmd_msg = sep->msg;
|
||||||
size_t link_open = cmd_msg.find('\x12');
|
size_t link_open = cmd_msg.find('\x12');
|
||||||
size_t link_close = cmd_msg.find_last_of('\x12');
|
size_t link_close = cmd_msg.find_last_of('\x12');
|
||||||
|
|
||||||
if (link_open != link_close && (cmd_msg.length() - link_open) > EQ::constants::SAY_LINK_BODY_SIZE) {
|
if (link_open != link_close && (cmd_msg.length() - link_open) > EQ::constants::SAY_LINK_BODY_SIZE) {
|
||||||
EQ::SayLinkBody_Struct link_body;
|
EQ::SayLinkBody_Struct link_body;
|
||||||
EQ::saylink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EQ::constants::SAY_LINK_BODY_SIZE));
|
EQ::saylink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EQ::constants::SAY_LINK_BODY_SIZE));
|
||||||
@@ -24,16 +25,14 @@ void command_summonitem(Client *c, const Seperator *sep)
|
|||||||
augment_four = link_body.augment_4;
|
augment_four = link_body.augment_4;
|
||||||
augment_five = link_body.augment_5;
|
augment_five = link_body.augment_5;
|
||||||
augment_six = link_body.augment_6;
|
augment_six = link_body.augment_6;
|
||||||
}
|
} else if (!sep->IsNumber(1)) {
|
||||||
else if (!sep->IsNumber(1)) {
|
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
"Usage: #summonitem [item id | link] [charges] [augment_one_id] [augment_two_id] [augment_three_id] [augment_four_id] [augment_five_id] [augment_six_id] (Charges are optional.)"
|
"Usage: #summonitem [item id | link] [charges] [augment_one_id] [augment_two_id] [augment_three_id] [augment_four_id] [augment_five_id] [augment_six_id] (Charges and augments are optional.)"
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
} else {
|
||||||
else {
|
item_id = Strings::ToUnsignedInt(sep->arg[1]);
|
||||||
item_id = Strings::ToInt(sep->arg[1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!item_id) {
|
if (!item_id) {
|
||||||
@@ -42,12 +41,22 @@ void command_summonitem(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8 item_status = 0;
|
uint8 item_status = 0;
|
||||||
uint8 current_status = c->Admin();
|
const uint8 current_status = c->Admin();
|
||||||
const EQ::ItemData *item = database.GetItem(item_id);
|
|
||||||
if (item) {
|
const auto *item = database.GetItem(item_id);
|
||||||
item_status = item->MinStatus;
|
if (!item) {
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Item ID {} does not exist.",
|
||||||
|
item_id
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item_status = item->MinStatus;
|
||||||
|
|
||||||
if (item_status > current_status) {
|
if (item_status > current_status) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
@@ -57,36 +66,70 @@ void command_summonitem(Client *c, const Seperator *sep)
|
|||||||
item_status
|
item_status
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 2 && sep->IsNumber(2)) {
|
if (arguments >= 2 && sep->IsNumber(2)) {
|
||||||
charges = Strings::ToInt(sep->arg[2]);
|
charges = static_cast<int16>(Strings::ToInt(sep->arg[2]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 3 && sep->IsNumber(3)) {
|
if (arguments >= 3 && sep->IsNumber(3)) {
|
||||||
augment_one = Strings::ToInt(sep->arg[3]);
|
augment_one = Strings::ToUnsignedInt(sep->arg[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 4 && sep->IsNumber(4)) {
|
if (arguments >= 4 && sep->IsNumber(4)) {
|
||||||
augment_two = Strings::ToInt(sep->arg[4]);
|
augment_two = Strings::ToUnsignedInt(sep->arg[4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 5 && sep->IsNumber(5)) {
|
if (arguments >= 5 && sep->IsNumber(5)) {
|
||||||
augment_three = Strings::ToInt(sep->arg[5]);
|
augment_three = Strings::ToUnsignedInt(sep->arg[5]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 6 && sep->IsNumber(6)) {
|
if (arguments >= 6 && sep->IsNumber(6)) {
|
||||||
augment_four = Strings::ToInt(sep->arg[6]);
|
augment_four = Strings::ToUnsignedInt(sep->arg[6]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 7 && sep->IsNumber(7)) {
|
if (arguments >= 7 && sep->IsNumber(7)) {
|
||||||
augment_five = Strings::ToInt(sep->arg[7]);
|
augment_five = Strings::ToUnsignedInt(sep->arg[7]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments == 8 && sep->IsNumber(8)) {
|
if (arguments == 8 && sep->IsNumber(8)) {
|
||||||
augment_six = Strings::ToInt(sep->arg[8]);
|
augment_six = Strings::ToUnsignedInt(sep->arg[8]);
|
||||||
}
|
}
|
||||||
|
|
||||||
c->SummonItem(item_id, charges, augment_one, augment_two, augment_three, augment_four, augment_five, augment_six);
|
c->SummonItem(
|
||||||
}
|
item_id,
|
||||||
|
charges,
|
||||||
|
augment_one,
|
||||||
|
augment_two,
|
||||||
|
augment_three,
|
||||||
|
augment_four,
|
||||||
|
augment_five,
|
||||||
|
augment_six
|
||||||
|
);
|
||||||
|
|
||||||
|
const auto *new_item = database.CreateItem(
|
||||||
|
item_id,
|
||||||
|
charges,
|
||||||
|
augment_one,
|
||||||
|
augment_two,
|
||||||
|
augment_three,
|
||||||
|
augment_four,
|
||||||
|
augment_five,
|
||||||
|
augment_six
|
||||||
|
);
|
||||||
|
|
||||||
|
EQ::SayLinkEngine linker;
|
||||||
|
linker.SetLinkType(EQ::saylink::SayLinkItemInst);
|
||||||
|
linker.SetItemInst(new_item);
|
||||||
|
|
||||||
|
const std::string &item_link = linker.GenerateLink();
|
||||||
|
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"You have summoned {}.",
|
||||||
|
item_link
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ void command_suspend(Client *c, const Seperator *sep)
|
|||||||
const std::string reason = sep->arg[3] ? sep->argplus[3] : "";
|
const std::string reason = sep->arg[3] ? sep->argplus[3] : "";
|
||||||
|
|
||||||
auto l = AccountRepository::GetWhere(
|
auto l = AccountRepository::GetWhere(
|
||||||
content_db,
|
database,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"LOWER(charname) = '{}'",
|
"LOWER(charname) = '{}'",
|
||||||
Strings::Escape(character_name)
|
Strings::Escape(character_name)
|
||||||
@@ -41,7 +41,7 @@ void command_suspend(Client *c, const Seperator *sep)
|
|||||||
l[0].suspendeduntil = std::time(nullptr) + (days * 86400);
|
l[0].suspendeduntil = std::time(nullptr) + (days * 86400);
|
||||||
l[0].suspend_reason = reason;
|
l[0].suspend_reason = reason;
|
||||||
|
|
||||||
if (!AccountRepository::UpdateOne(content_db, l[0])) {
|
if (!AccountRepository::UpdateOne(database, l[0])) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
#include "../client.h"
|
||||||
|
|
||||||
|
void command_takeplatinum(Client *c, const Seperator *sep)
|
||||||
|
{
|
||||||
|
int arguments = sep->argnum;
|
||||||
|
if (!arguments || !sep->IsNumber(1)) { //must be a number
|
||||||
|
c->Message(Chat::Red, "Usage: #takeplatinum [Platinum]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Client *target = c;
|
||||||
|
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||||
|
target = c->GetTarget()->CastToClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 platinum = Strings::ToUnsignedInt(sep->arg[1]);
|
||||||
|
if (!platinum) {
|
||||||
|
c->Message(Chat::Red, "Usage: #takeplatinum [Platinum]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool success = target->TakePlatinum(
|
||||||
|
platinum,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
if (success) {
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Subtracted {} from {}.",
|
||||||
|
Strings::Money(
|
||||||
|
platinum,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
),
|
||||||
|
c->GetTargetDescription(target)
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
c->Message(
|
||||||
|
Chat::Red,
|
||||||
|
fmt::format(
|
||||||
|
"Unable to subtract {} from {}.",
|
||||||
|
Strings::Money(
|
||||||
|
platinum,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
),
|
||||||
|
c->GetTargetDescription(target)
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
+6
-1
@@ -555,9 +555,14 @@ void Group::MemberZoned(Mob* removemob) {
|
|||||||
|
|
||||||
//should NOT clear the name, it is used for world communication.
|
//should NOT clear the name, it is used for world communication.
|
||||||
for (auto & m : members) {
|
for (auto & m : members) {
|
||||||
if (m && (m == removemob || (m->IsBot() && m->CastToBot()->GetBotOwner() == removemob))) {
|
if (m) {
|
||||||
|
if (m->IsBot() && m->CastToBot()->GetBotOwner() && m->CastToBot()->GetBotOwner() == removemob) {
|
||||||
m = nullptr;
|
m = nullptr;
|
||||||
}
|
}
|
||||||
|
else if (m == removemob) {
|
||||||
|
m = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (removemob->IsClient() && HasRole(removemob, RoleAssist)) {
|
if (removemob->IsClient() && HasRole(removemob, RoleAssist)) {
|
||||||
|
|||||||
+17
-10
@@ -42,15 +42,21 @@ HateList::~HateList()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void HateList::WipeHateList()
|
void HateList::WipeHateList(bool npc_only) {
|
||||||
{
|
|
||||||
auto iterator = list.begin();
|
auto iterator = list.begin();
|
||||||
|
while (iterator != list.end()) {
|
||||||
while (iterator != list.end())
|
Mob *m = (*iterator)->entity_on_hatelist;
|
||||||
{
|
if (
|
||||||
Mob* m = (*iterator)->entity_on_hatelist;
|
m &&
|
||||||
if (m)
|
(
|
||||||
{
|
m->IsOfClientBotMerc() ||
|
||||||
|
(m->IsPet() && m->GetOwner() && m->GetOwner()->IsOfClientBotMerc())
|
||||||
|
) &&
|
||||||
|
npc_only
|
||||||
|
) {
|
||||||
|
iterator++;
|
||||||
|
} else {
|
||||||
|
if (m) {
|
||||||
if (parse->HasQuestSub(hate_owner->GetNPCTypeID(), EVENT_HATE_LIST)) {
|
if (parse->HasQuestSub(hate_owner->GetNPCTypeID(), EVENT_HATE_LIST)) {
|
||||||
parse->EventNPC(EVENT_HATE_LIST, hate_owner->CastToNPC(), m, "0", 0);
|
parse->EventNPC(EVENT_HATE_LIST, hate_owner->CastToNPC(), m, "0", 0);
|
||||||
}
|
}
|
||||||
@@ -59,10 +65,11 @@ void HateList::WipeHateList()
|
|||||||
m->CastToClient()->DecrementAggroCount();
|
m->CastToClient()->DecrementAggroCount();
|
||||||
m->CastToClient()->RemoveXTarget(hate_owner, true);
|
m->CastToClient()->RemoveXTarget(hate_owner, true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
delete (*iterator);
|
delete (*iterator);
|
||||||
iterator = list.erase(iterator);
|
iterator = list.erase(iterator);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user