[Items] Overhaul Item Hand-in System (#4593)

* [Items] Overhaul Item Hand-in System

* Edge case lua fix

* Merge fix

* I'm going to be amazed if this works first try

* Update linux-build.sh

* Update linux-build.sh

* Update linux-build.sh

* Update linux-build.sh

* Update linux-build.sh

* Update linux-build.sh

* Update linux-build.sh

* Update linux-build.sh

* Add protections against scripts that hand back items themselves

* Remove EVENT_ITEM_ScriptStopReturn

* test

* Update npc_handins.cpp

* Add Items:AlwaysReturnHandins

* Update spdat.cpp

* Bypass update prompt on CI
This commit is contained in:
Chris Miles
2025-02-03 16:51:09 -06:00
committed by GitHub
parent d1d6db3a09
commit 6fb919a16f
40 changed files with 2254 additions and 473 deletions
+19 -2
View File
@@ -255,6 +255,7 @@ public:
#include "client_packet.h"
Client(EQStreamInterface * ieqs);
Client(); // mocking / testing
~Client();
void ReconnectUCS();
@@ -1101,7 +1102,6 @@ public:
// Item methods
void UseAugmentContainer(int container_slot);
void EVENT_ITEM_ScriptStopReturn();
uint32 NukeItem(uint32 itemnum, uint8 where_to_check =
(invWhereWorn | invWherePersonal | invWhereBank | invWhereSharedBank | invWhereTrading | invWhereCursor));
void SetTint(int16 slot_id, uint32 color);
@@ -1868,6 +1868,24 @@ public:
uint32 GetBandolierItemID(uint8 bandolier_slot, uint8 slot_id);
std::string GetBandolierItemName(uint8 bandolier_slot, uint8 slot_id);
// External handin tracking
// this is used to prevent things like quest::givecash and AddMoneyToPP
// from double giving money back to players in scripts when return_items
// also gives money back to players
struct ExternalHandinMoneyReturned {
uint64 copper;
uint64 silver;
uint64 gold;
uint64 platinum;
std::string return_source;
};
private:
ExternalHandinMoneyReturned m_external_handin_money_returned = {};
std::vector<uint32_t> m_external_handin_items_returned = {};
public:
ExternalHandinMoneyReturned GetExternalHandinMoneyReturned() { return m_external_handin_money_returned; }
std::vector<uint32_t> GetExternalHandinItemsReturned() { return m_external_handin_items_returned; }
protected:
friend class Mob;
void CalcEdibleBonuses(StatBonuses* newbon);
@@ -2317,7 +2335,6 @@ private:
bool CanTradeFVNoDropItem();
void SendMobPositions();
void PlayerTradeEventLog(Trade *t, Trade *t2);
void NPCHandinEventLog(Trade* t, NPC* n);
// full and partial mail key cache
std::string m_mail_key_full;