mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Code/Fishing): improve timing of fishing (#4733)
This commit is contained in:
@@ -5497,7 +5497,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
|
|||||||
// 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)
|
||||||
int32 lastSec = 0;
|
int32 lastSec = 0;
|
||||||
switch (urand(0, 3))
|
switch (urand(0, 2))
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
lastSec = 3;
|
lastSec = 3;
|
||||||
@@ -5508,12 +5508,11 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
|
|||||||
case 2:
|
case 2:
|
||||||
lastSec = 13;
|
lastSec = 13;
|
||||||
break;
|
break;
|
||||||
case 3:
|
|
||||||
lastSec = 17;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
duration = duration - lastSec * IN_MILLISECONDS + FISHING_BOBBER_READY_TIME * IN_MILLISECONDS;
|
// Duration of the fishing bobber can't be higher than the Fishing channeling duration
|
||||||
|
duration = std::min(duration, duration - lastSec*IN_MILLISECONDS + FISHING_BOBBER_READY_TIME*IN_MILLISECONDS);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GAMEOBJECT_TYPE_SUMMONING_RITUAL:
|
case GAMEOBJECT_TYPE_SUMMONING_RITUAL:
|
||||||
|
|||||||
Reference in New Issue
Block a user