mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
[Feature] ResetItemCooldown added to lua/perl and fix item re-cast times to show properly (#2793)
* Testing. * Add ResetItemCooldown and port it over to perl * This flag needs to be set for updating shared item cooldowns * Properly set item recast for all item types, on corpses, on looting * SummonItem properly sets recast timers of summoned items * Rename variable to avoid confusion and change manifest to be more specific * Sanity check item_d * Recast -1 added as RECAST_TYPE_UNLINKED_ITEM ResetItemCooldown will still remove cooldown of item that we don't have so when we acquire it the cooldown is reset * change magic numbers * more magic numbers * More constants yay * Remove unneeded export DeleteItemRecastTimer * Remove duplicate message, this is handled by the client in this part of the code Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
This commit is contained in:
@@ -714,6 +714,15 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
// in any other situation just use charges as passed
|
||||
|
||||
EQ::ItemInstance* inst = database.CreateItem(item, charges);
|
||||
auto timestamps = database.GetItemRecastTimestamps(CharacterID());
|
||||
const auto* d = inst->GetItem();
|
||||
if (d->RecastDelay) {
|
||||
if (d->RecastType != RECAST_TYPE_UNLINKED_ITEM) {
|
||||
inst->SetRecastTimestamp(timestamps.count(d->RecastType) ? timestamps.at(d->RecastType) : 0);
|
||||
} else {
|
||||
inst->SetRecastTimestamp(timestamps.count(d->ID) ? timestamps.at(d->ID) : 0);
|
||||
}
|
||||
}
|
||||
|
||||
if(inst == nullptr) {
|
||||
Message(Chat::Red, "An unknown server error has occurred and your item was not created.");
|
||||
|
||||
Reference in New Issue
Block a user