From f21472958de68261eb5ff5f9e34a1418226202e7 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 22 Dec 2021 20:33:47 -0500 Subject: [PATCH] Spell/Fishing: ensure that the fishing bobber expires when the Fishing channeling ends, and don't allow fish to be hooked in the instant the spell is cast. Port From (https://github.com/TrinityCore/TrinityCore/commit/07dcb28f80b958e7dd5784a074f7ed013527d92f) --- Source/Game/Spells/SpellEffects.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Game/Spells/SpellEffects.cs b/Source/Game/Spells/SpellEffects.cs index 7fdc75696..672a08da5 100644 --- a/Source/Game/Spells/SpellEffects.cs +++ b/Source/Game/Spells/SpellEffects.cs @@ -4285,15 +4285,15 @@ namespace Game.Spells // end time of range when possible catch fish (FISHING_BOBBER_READY_TIME..GetDuration(m_spellInfo)) // start time == fish-FISHING_BOBBER_READY_TIME (0..GetDuration(m_spellInfo)-FISHING_BOBBER_READY_TIME) int lastSec = 0; - switch (RandomHelper.IRand(0, 3)) + switch (RandomHelper.IRand(0, 2)) { case 0: lastSec = 3; break; case 1: lastSec = 7; break; case 2: lastSec = 13; break; - case 3: lastSec = 17; break; } - duration = duration - lastSec * Time.InMilliseconds + 5 * Time.InMilliseconds; + // Duration of the fishing bobber can't be higher than the Fishing channeling duration + duration = Math.Min(duration, duration - lastSec * Time.InMilliseconds + 5 * Time.InMilliseconds); break; } case GameObjectTypes.Ritual: