[Feature] Corpse Overhaul (#3938)

# Corpse Overhaul

Changelog:

- Player corpses now have two timers, one specific to the rezability of the corpse and the other to cover the overall rot timer of the player corpse.
- The rezability timer is based on the online presence of the player/account and is not affected by being offline.
- The rot timer is not affected by offline/online status and will count to the rot status of the corpse.
- Corpses can be rezzed multiple times, however only the first rez that yeilds returned xp will be counted. Not other rez will return any xp. This allows for a "Poor mans COTH" as was used many times in the early eras.
- All Corpse class private/protected member variables are all now prefixed with m_
- Added Corpses logging category along with many debug logs
- Removed LoadCharacterCorpseData
- Removed LoadCharacterCorpseEntity
- Added LoadCharacterCorpse(const CharacterCorpsesRepository::CharacterCorpses, const glm::vec4 &position) which simplifies areas of consumption and reduces double queries from removing LoadCharacterCorpseData and replacing LoadCharacterCorpseEntity
- All parameters that were prefixed with in_ have been dropped
- Removed two queries from CheckIsOwnerOnline and have it query the world's CLE by account_id since that is how live works
- Regenerated repository character_corpses
- Cleaned up many list iterators to use range based for loops
- Rate limit Corpse::Process m_is_rezzable with a 1 second check timer
- General code cleanup
- Added a Server Up check to bury all corpses in instances to prevent lost corpses if an instance is released during server down. This facilitates player recovery via shadowrest or priests of luclin.


This PR also now fixes a long standing issue with HasItem performance in our script plugins. It is significantly faster, we will need to coordinate quest changes and comms with operators.

```lua
    if ($client->HasItemOnCorpse($item_id)) {
        return 1;
    }
```

```lua
    --corpse
    if self:HasItemOnCorpse(itemid) then
        return true
    end
```


Testing Completed:

- Create a Corpse
- Standard rezzing
- Ghetto Coth (No Extra XP)
- Rezzing after graveyard move
- Divine Rez works as intended
- No XP Rez (Corpse Call) does not give XP
- Corpse Burying
- Cross Instance Graveyard Corpse movement/Rezzing
- DZ End/Quit Corpse Movement/Rezzing
- Server Shutdown/Reinit DZ Corpse Movement/Rezzing


---------

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
Fryguy
2024-02-07 23:02:30 -05:00
committed by GitHub
parent 331e04fbf8
commit 772fed5e30
35 changed files with 1783 additions and 1289 deletions
+5 -1
View File
@@ -171,7 +171,11 @@
#define PET_REPORT_HP 488 //I have %1 percent of my hit points left.
#define PET_NO_TAUNT 489 //No longer taunting attackers, Master.
#define PET_DO_TAUNT 490 //Taunting attackers as normal, Master.
#define CORPSE_DECAY1 495 //This corpse will decay in %1 minute(s) %2 seconds.
#define CORPSE_REZ_TIME_HOUR 491 //This corpse's resurrection time will expire in %1 hour(s) %2 minute(s) %3 seconds.
#define CORPSE_REZ_TIME_MINUTE 492 //This corpse's resurrection time will expire in %1 minute(s) %2 seconds.
#define CORPSE_DECAY_TIME_DAY 493 //This corpse will decay in %1 day(s) %2 hour(s) %3 minute(s) %4 seconds.
#define CORPSE_DECAY_TIME_HOUR 494 //This corpse will decay in %1 hour(s) %2 minute(s) %3 seconds.
#define CORPSE_DECAY_TIME_MINUTE 495 //This corpse will decay in %1 minute(s) %2 seconds.
#define DISC_LEVEL_ERROR 503 //You must be a level %1 ... to use this discipline.
#define DISCIPLINE_CANUSEIN 504 //You can use a new discipline in %1 minutes %2 seconds.
#define PVP_ON 552 //You are now player kill and follow the ways of Discord.