mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-02 12:36:36 +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:
+17
-4
@@ -3333,11 +3333,24 @@ void ZoneDatabase::RemoveTempFactions(Client *client) {
|
||||
QueryDatabase(query);
|
||||
}
|
||||
|
||||
void ZoneDatabase::UpdateItemRecastTimestamps(uint32 char_id, uint32 recast_type, uint32 timestamp)
|
||||
void ZoneDatabase::UpdateItemRecast(uint32 character_id, uint32 recast_type, uint32 timestamp)
|
||||
{
|
||||
std::string query =
|
||||
StringFormat("REPLACE INTO character_item_recast (id, recast_type, timestamp) VALUES (%u, %u, %u)", char_id,
|
||||
recast_type, timestamp);
|
||||
const auto query = fmt::format(
|
||||
"REPLACE INTO character_item_recast (id, recast_type, timestamp) VALUES ({}, {}, {})",
|
||||
character_id,
|
||||
recast_type,
|
||||
timestamp
|
||||
);
|
||||
QueryDatabase(query);
|
||||
}
|
||||
|
||||
void ZoneDatabase::DeleteItemRecast(uint32 character_id, uint32 recast_type)
|
||||
{
|
||||
const auto query = fmt::format(
|
||||
"DELETE FROM character_item_recast WHERE id = {} AND recast_type = {}",
|
||||
character_id,
|
||||
recast_type
|
||||
);
|
||||
QueryDatabase(query);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user