From 1cdb1816a2c34de9f6e0a8c2dc6b7eebc2120106 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Sat, 6 Nov 2021 23:14:36 -0400 Subject: [PATCH] [Bug Fix] SOF+ clients item click recast timer not met check (#1682) * Update client_packet.cpp * Update spells.cpp * augs working too --- zone/client_packet.cpp | 17 +++++++++++++++++ zone/spells.cpp | 7 +++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index ab8fa7b0f..6fa07623f 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -8959,6 +8959,14 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } if (GetLevel() >= item->Click.Level2) { + if (item->RecastDelay > 0) + { + if (!GetPTimers().Expired(&database, (pTimerItemStart + item->RecastType), false)) { + LogSpells("Casting of [{}] canceled: item spell reuse timer not expired", spell_id); + return; + } + } + int i = parse->EventItem(EVENT_ITEM_CLICK_CAST, this, p_inst, nullptr, "", slot_id); inst = m_inv[slot_id]; if (!inst) @@ -8988,6 +8996,15 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } if (GetLevel() >= augitem->Click.Level2) { + if (augitem->RecastDelay > 0) + { + if (!GetPTimers().Expired(&database, (pTimerItemStart + augitem->RecastType), false)) { + LogSpells("Casting of [{}] canceled: item spell reuse timer from augment not expired", spell_id); + MessageString(Chat::Red, SPELL_RECAST); + return; + } + } + int i = parse->EventItem(EVENT_ITEM_CLICK_CAST, this, clickaug, nullptr, "", slot_id); inst = m_inv[slot_id]; if (!inst) diff --git a/zone/spells.cpp b/zone/spells.cpp index 76769da93..4d6446fc5 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -1020,7 +1020,10 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo return; } } - + /* + Titanium client will prevent item recast on its own. This is only used to enforce. Titanium items are cast from Handle_OP_CastSpell. + SOF+ client does not prevent item recast on its own. We enforce this in Handle_OP_ItemVerifyRequest where items are cast from. + */ if(IsClient() && (slot == CastingSlot::Item || slot == CastingSlot::PotionBelt)) { IsFromItem = true; @@ -6287,4 +6290,4 @@ int Client::GetNextAvailableDisciplineSlot(int starting_slot) { } return -1; // Return -1 if No Slots open -} \ No newline at end of file +}