[Quest API] Add HasItemOnCorpse() to Perl/Lua (#3824)

# Perl
- Add `$client->HasItemOnCorpse(item_id)`.

# Lua
- Add `client:HasItemOnCorpse(item_id)`.

# Notes
- Allows operators to see if a player has an item on any of their corpses.
- May need to address having to allocate and deallocate memory for every corpse that could possibly exist for a player.
This commit is contained in:
Alex King
2023-12-30 23:09:48 -05:00
committed by GitHub
parent 87e63e1e36
commit 6c18cd0bee
7 changed files with 52 additions and 8 deletions
+8 -7
View File
@@ -4123,15 +4123,16 @@ uint32 ZoneDatabase::GetCharacterCorpseID(uint32 char_id, uint8 corpse) {
return 0;
}
uint32 ZoneDatabase::GetCharacterCorpseItemAt(uint32 corpse_id, uint16 slotid) {
Corpse* tmp = LoadCharacterCorpse(corpse_id);
uint32 itemid = 0;
uint32 ZoneDatabase::GetCharacterCorpseItemAt(uint32 corpse_id, uint16 slot_id) {
Corpse* c = LoadCharacterCorpse(corpse_id);
uint32 item_id = 0;
if (tmp) {
itemid = tmp->GetWornItem(slotid);
tmp->DepopPlayerCorpse();
if (c) {
item_id = c->GetWornItem(slot_id);
c->DepopPlayerCorpse();
}
return itemid;
return item_id;
}
bool ZoneDatabase::LoadCharacterCorpseData(uint32 corpse_id, CharacterCorpseEntry& corpse){