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)
This commit is contained in:
hondacrx
2021-12-22 20:33:47 -05:00
parent 8b23a77c5f
commit f21472958d
+3 -3
View File
@@ -4285,15 +4285,15 @@ namespace Game.Spells
// end time of range when possible catch fish (FISHING_BOBBER_READY_TIME..GetDuration(m_spellInfo)) // 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) // start time == fish-FISHING_BOBBER_READY_TIME (0..GetDuration(m_spellInfo)-FISHING_BOBBER_READY_TIME)
int lastSec = 0; int lastSec = 0;
switch (RandomHelper.IRand(0, 3)) switch (RandomHelper.IRand(0, 2))
{ {
case 0: lastSec = 3; break; case 0: lastSec = 3; break;
case 1: lastSec = 7; break; case 1: lastSec = 7; break;
case 2: lastSec = 13; 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; break;
} }
case GameObjectTypes.Ritual: case GameObjectTypes.Ritual: