mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[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:
+18
-8
@@ -25,6 +25,7 @@
|
||||
#include "zonedb.h"
|
||||
#include "../common/events/player_event_logs.h"
|
||||
#include "bot.h"
|
||||
#include "../common/evolving_items.h"
|
||||
#include "../common/repositories/character_corpse_items_repository.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
@@ -1091,7 +1092,11 @@ void Client::DeleteItemInInventory(int16 slot_id, int16 quantity, bool client_up
|
||||
}
|
||||
// end QS code
|
||||
|
||||
bool isDeleted = m_inv.DeleteItem(slot_id, quantity);
|
||||
uint64 evolve_id = m_inv[slot_id]->GetEvolveUniqueID();
|
||||
bool isDeleted = m_inv.DeleteItem(slot_id, quantity);
|
||||
if (isDeleted && evolve_id && (slot_id > EQ::invslot::TRADE_END || slot_id < EQ::invslot::TRADE_BEGIN)) {
|
||||
CharacterEvolvingItemsRepository::SoftDelete(database, evolve_id);
|
||||
}
|
||||
|
||||
const EQ::ItemInstance* inst = nullptr;
|
||||
if (slot_id == EQ::invslot::slotCursor) {
|
||||
@@ -1143,6 +1148,8 @@ void Client::DeleteItemInInventory(int16 slot_id, int16 quantity, bool client_up
|
||||
bool Client::PushItemOnCursor(const EQ::ItemInstance& inst, bool client_update)
|
||||
{
|
||||
LogInventory("Putting item [{}] ([{}]) on the cursor", inst.GetItem()->Name, inst.GetItem()->ID);
|
||||
|
||||
evolving_items_manager.DoLootChecks(CharacterID(), EQ::invslot::slotCursor, inst);
|
||||
m_inv.PushCursor(inst);
|
||||
|
||||
if (client_update) {
|
||||
@@ -1163,9 +1170,9 @@ bool Client::PutItemInInventory(int16 slot_id, const EQ::ItemInstance& inst, boo
|
||||
if (slot_id == EQ::invslot::slotCursor) { // don't trust macros before conditional statements...
|
||||
return PushItemOnCursor(inst, client_update);
|
||||
}
|
||||
else {
|
||||
m_inv.PutItem(slot_id, inst);
|
||||
}
|
||||
|
||||
evolving_items_manager.DoLootChecks(CharacterID(), slot_id, inst);
|
||||
m_inv.PutItem(slot_id, inst);
|
||||
|
||||
if (client_update)
|
||||
{
|
||||
@@ -1173,15 +1180,16 @@ bool Client::PutItemInInventory(int16 slot_id, const EQ::ItemInstance& inst, boo
|
||||
//SendWearChange(EQ::InventoryProfile::CalcMaterialFromSlot(slot_id));
|
||||
}
|
||||
|
||||
CalcBonuses();
|
||||
|
||||
if (slot_id == EQ::invslot::slotCursor) {
|
||||
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
|
||||
return database.SaveCursor(CharacterID(), s, e);
|
||||
}
|
||||
else {
|
||||
return database.SaveInventory(CharacterID(), &inst, slot_id);
|
||||
}
|
||||
|
||||
CalcBonuses();
|
||||
return database.SaveInventory(CharacterID(), &inst, slot_id);
|
||||
|
||||
//CalcBonuses(); // this never fires??
|
||||
// a lot of wasted checks and calls coded above...
|
||||
}
|
||||
|
||||
@@ -1191,6 +1199,8 @@ void Client::PutLootInInventory(int16 slot_id, const EQ::ItemInstance &inst, Loo
|
||||
|
||||
bool cursor_empty = m_inv.CursorEmpty();
|
||||
|
||||
evolving_items_manager.DoLootChecks(CharacterID(), slot_id, inst);
|
||||
|
||||
if (slot_id == EQ::invslot::slotCursor) {
|
||||
m_inv.PushCursor(inst);
|
||||
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
|
||||
|
||||
Reference in New Issue
Block a user