LandSandBoat / server

:sailboat: LandSandBoat - a server emulator for Final Fantasy XI
https://landsandboat.github.io/server/
GNU General Public License v3.0
295 stars 595 forks source link

🐛 [CoP] Timers of spawn ???s for Jailer of Faith and Ix'aern (DRK) are wrong #3632

Open DiscipleOfEris opened 1 year ago

DiscipleOfEris commented 1 year ago

I affirm:

OS / platform the server is running (if known)

Windows10

Branch affected by issue

base

Steps to reproduce

  1. Find the ??? for JoF or Ix'DRK (or go to it with a command).
  2. Mark time down when ??? disappears.
  3. Find it again.
  4. Mark down time when it disappears.
  5. For JoF ???, the time varies dramatically, from 2:34 (a single in-game hour) to pretty much any other multiple of in-game hours.
  6. For Ix'DRK, the duration is almost correct, but it always an in-game hour that's a multiple of 12.

The code really raises some eyebrows: https://github.com/LandSandBoat/server/blob/base/scripts/zones/The_Garden_of_RuHmet/Zone.lua#L88

local vanadielHour = VanadielHour()
local qmDrk = GetNPCByID(ID.npc.QM_IXAERN_DRK) -- Ix'aern drk
local s = math.random(6, 12) -- wait time till change to next spawn pos, random 15~30 mins.

-- Jailer of Faith spawn randomiser
if vanadielHour % s == 0 then
    local qmFaith = GetNPCByID(ID.npc.QM_JAILER_OF_FAITH) -- Jailer of Faith
    qmFaith:hideNPC(60) -- Hide it for 60 seconds
    qmFaith:setPos(unpack(ID.npc.QM_JAILER_OF_FAITH_POS[math.random(1, 5)])) -- Set the new position
end

So for every in-game hour divisible by the numbers 6-12 (which includes 0, 14, 16, 18, 20, 21), it has a chance to move the JoF ???.

Expected behavior

  1. JoF ??? should vanish exactly 30 minutes after it reappears (which is exactly one minute after it disappears). There are some reports on the wiki of 15 minutes as well, so it's possible it's either exactly 15 or exactly 30 minutes (random), but I haven't observed the 15 minutes.
  2. For Ix'DRK ???, it should be exactly 30 minutes after it re-appears (which is exactly 30 seconds after it disappears).
DiscipleOfEris commented 1 year ago

A potential PR (such as the fix I have on my server) would need to look out for merge conflicts with (stale for a few months) PR #1965