[Feature] Evolving Item Support for RoF2 (#4496)

* basic evolving items framework created

* Implement evolving tab in the inventory window

* Implement experience and number of kills

* Move zone evolving map to a evolvingitemsmanager class

* rework gm commands

* rework GetInventory

* wip

* wip loot testing

* Fix Duplicate Message

* reworked evolving item looting, swapping, etc

* reworked const functions for evolving methods

* Functioning Player Trade of evolving items test item_id is 89550

* First pass of Final Result link working

* First pass of item upgrading when reaching 100%

* Add strings and logic for displaying the evolving item xp transfer window in Corathus

* Prototype of xp transfer window sending items

* WIP for evolve xp transfer

* WIP for evolve xp transfer.  First tests passed

* XP Transfer Cleanup

* XP Transfer Cleanup

* Add Rule for evolving items equip timer/  default is 30 secs

* Add logging and player events

Add logging and player events

* Formatting

* Database updates

* Updates for linux build

* Perl/Cleanup

* Command cleanup

* Lua

* Added a crash condition check if final item id is blank or not found.

* Review Changes

Updates to resolve review comments and a rebase.

* migrate to content_db for items_evolving_details

migrate to content_db for items_evolving_details

* Simplify, don't hit database unless evolving

* Update 2025_01_19_items_evolving_details.sql

* Update client.cpp

* Update manifest with items_evolving_details

* character_id vs char_id

* Remove _Struct from structs

* Remove license header in evolving.cpp

* Move evolving constants from eq_constants.h to evolving.h since it is more specific

* Update database_schema.h

* General cleanup

* Be more specific with `evolving_items` vs `evolving`

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
Mitch Freeman
2025-01-19 20:10:19 -04:00
committed by GitHub
parent d47bf687d0
commit f21cc170df
53 changed files with 3569 additions and 183 deletions
+42 -3
View File
@@ -80,7 +80,6 @@ extern PetitionList petition_list;
extern EntityList entity_list;
typedef void (Client::*ClientPacketProc)(const EQApplicationPacket *app);
//Use a map for connecting opcodes since it dosent get used a lot and is sparse
std::map<uint32, ClientPacketProc> ConnectingOpcodes;
//Use a static array for connected, for speed
@@ -208,6 +207,7 @@ void MapOpcodes()
ConnectedOpcodes[OP_Emote] = &Client::Handle_OP_Emote;
ConnectedOpcodes[OP_EndLootRequest] = &Client::Handle_OP_EndLootRequest;
ConnectedOpcodes[OP_EnvDamage] = &Client::Handle_OP_EnvDamage;
ConnectedOpcodes[OP_EvolveItem] = &Client::Handle_OP_EvolveItem;
ConnectedOpcodes[OP_FaceChange] = &Client::Handle_OP_FaceChange;
ConnectedOpcodes[OP_FeignDeath] = &Client::Handle_OP_FeignDeath;
ConnectedOpcodes[OP_FindPersonRequest] = &Client::Handle_OP_FindPersonRequest;
@@ -1309,7 +1309,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
// set to full support in case they're a gm with items in disabled expansion slots...but, have their gm flag off...
// item loss will occur when they use the 'empty' slots, if this is not done
m_inv.SetGMInventory(true);
loaditems = database.GetInventory(cid, &m_inv); /* Load Character Inventory */
loaditems = database.GetInventory(this); /* Load Character Inventory */
database.LoadCharacterBandolier(cid, &m_pp); /* Load Character Bandolier */
database.LoadCharacterBindPoint(cid, &m_pp); /* Load Character Bind */
database.LoadCharacterMaterialColor(cid, &m_pp); /* Load Character Material */
@@ -10748,7 +10748,12 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
InterrogateInventory(this, true, false, true, error);
}
return;
for (int slot : {mi->to_slot, mi->from_slot}) {
auto item = GetInv().GetItem(slot);
if (item && item->IsEvolving()) {
CharacterEvolvingItemsRepository::UpdateOne(database, item->GetEvolvingDetails());
}
}
}
void Client::Handle_OP_MoveMultipleItems(const EQApplicationPacket *app)
@@ -17165,3 +17170,37 @@ void Client::Handle_OP_ShopRetrieveParcel(const EQApplicationPacket *app)
auto parcel_in = (ParcelRetrieve_Struct *)app->pBuffer;
DoParcelRetrieve(*parcel_in);
}
void Client::Handle_OP_EvolveItem(const EQApplicationPacket *app)
{
if (app->size != sizeof(EvolveItemToggle)) {
LogError(
"Received Handle_OP_EvolveItem packet. Expected size {}, received size {}.",
sizeof(EvolveItemToggle),
app->size
);
return;
}
auto in = reinterpret_cast<EvolveItemToggle *>(app->pBuffer);
switch (in->action) {
case EvolvingItems::Actions::UPDATE_ITEMS: {
DoEvolveItemToggle(app);
break;
}
case EvolvingItems::Actions::FINAL_RESULT: {
DoEvolveItemDisplayFinalResult(app);
break;
}
case EvolvingItems::Actions::TRANSFER_XP: {
DoEvolveTransferXP(app);
break;
}
case EvolvingItems::Actions::TRANSFER_WINDOW_DETAILS: {
SendEvolveXPWindowDetails(app);
}
default: {
}
}
}