Skip to content
This repository was archived by the owner on Apr 29, 2020. It is now read-only.

Commit cdebef1

Browse files
committed
PR: Updated the Chocobo Digging script
Added the lua function bound to the call for luautils::UpdateDigZones() Tweaked zoneItemsDug to have a higher level
1 parent 98b6140 commit cdebef1

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

scripts/globals/chocobo_digging.lua

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -842,10 +842,11 @@ local function canDig(player)
842842
updatePlayerDigCount(player, 0)
843843
digCount = 0
844844
end
845-
846845
-- neither player nor zone have reached their dig limit
847846

848-
if (digCount < 100 and zoneItemsDug < 20) or DIG_FATIGUE == 0 then
847+
-- https://ffxiclopedia.fandom.com/wiki/Chocobo_Digging_Guide
848+
-- states 20-50... lets just go with 50?
849+
if (digCount < 100 and zoneItemsDug < 50) or DIG_FATIGUE == 0 then
849850
-- pesky delays
850851
if (zoneInTime + areaDigDelay) <= currentTime and (lastDigTime + digDelay) <= currentTime then
851852
return true
@@ -986,12 +987,31 @@ dsp.chocoboDig.start = function(player, precheck)
986987
end
987988

988989
updatePlayerDigCount(player, 1)
989-
-- updateZoneDigCount(zoneId, 1) -- TODO: implement mechanic for resetting zone dig count. until then, leave this commented out
990+
updateZoneDigCount(zoneId, 1)
990991
-- TODO: learn abilities from chocobo raising
991992
end
992993

993994
calculateSkillUp(player)
994995

995996
return true
996997
end
998+
end
999+
1000+
-- https://ffxiclopedia.fandom.com/wiki/Chocobo_Digging_Guide
1001+
-- 2 - 8 items depending on MoonPhase
1002+
function updateDigZones()
1003+
for zoneId, _ in pairs(digInfo) do
1004+
local serverVar = '[DIG]ZONE' .. zoneId .. '_ITEMS'
1005+
local zoneItemsDug = GetServerVariable(serverVar)
1006+
1007+
if zoneItemsDug ~= 0 then
1008+
local newItems = 2 + (6*(VanadielMoonPhase()/100))
1009+
1010+
zoneItemsDug = zoneItemsDug - newItems
1011+
if zoneItemsDug < 0 then
1012+
zoneItemsDug = 0
1013+
end
1014+
SetServerVariable(serverVar, zoneItemsDug)
1015+
end
1016+
end
9971017
end

0 commit comments

Comments
 (0)