Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
zach2good committed Sep 1, 2024
1 parent 59f96ac commit faf9926
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions scripts/globals/synergy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ xi.synergy.relinquishFurnaceClaim = function(player)
setFurnaceOpen(npc)

npc:setLocalVar(vars.SYNERGY_FURNACE_STATE, furnaceStates.AVAILABLE)

player:messageSpecial(synergyMessages.CLAIM_RELINQUISHED)
end

xi.synergy.synergyDistanceChecker = function(player)
Expand Down Expand Up @@ -237,29 +239,50 @@ xi.synergy.synergyFurnaceOnTrigger = function(player, npc)
local lightFewell = 99
local darkFewell = 99

local claimedByYou = npc:getLocalVar(vars.SYNERGY_FURNACE_PLAYER_ID) == player:getID()

local furnaceState = npc:getLocalVar(vars.SYNERGY_FURNACE_STATE)
print('Furnace state:', furnaceState)

local handleFurnaceState =
{
[furnaceStates.AVAILABLE] = function()
-- (White) {Synergy crucible} set. Please deposit your ingredients inside the furnace and initiate the synergy process within 0 minutes.
player:messageSpecial(synergyMessages.CLAIM_SET, 1234, 1)
player:messageSpecial(synergyMessages.CLAIM_SET, xi.ki.SYNERGY_CRUCIBLE, 1)

xi.synergy.attachToSynergyFurnace(player, npc)
end,

[furnaceStates.CLAIMED] = function()
if not claimedByYou then
-- TODO: Message
return
end

player:startEvent(4520,
fireFewell, iceFewell, windFewell, earthFewell,
lightningFewell, waterFewell, lightFewell, darkFewell)
end,

[furnaceStates.ACTIVE] = function()
if not claimedByYou then
-- TODO: Message
return
end

if player:checkDistance(npc) > 1.5 then
player:messageSpecial(synergyMessages.TOO_FAR_AWAY)
return
end

player:startEvent(4518, 0, 1, 0, 0, 0, 0, 0, 0)
end,

[furnaceStates.COMPLETED] = function()
if not claimedByYou then
-- TODO: Message
return
end

local recipeId = npc:getLocalVar(vars.SYNERGY_FURNACE_CURRENT_RECIPE)
local recipe = GetSynergyRecipeByID(recipeId)
if recipe == nil then
Expand Down Expand Up @@ -471,7 +494,7 @@ xi.synergy.synergyFurnaceOnEventFinish = function(player, csid, option, npc)
elseif csid == 4521 and option == 150 then -- Commence synergy (150 yes, 151 no)
print('Commence synergy')

-- TODO message: commencing synergy process
player:messageSpecial(synergyMessages.SYNERGY_COMMENCE)

player:confirmTrade() -- items are taken!

Expand Down Expand Up @@ -506,6 +529,9 @@ xi.synergy.synergyFurnaceOnEventFinish = function(player, csid, option, npc)
return
end

player:messageSpecial(synergyMessages.SMOOTH_SYNERGIZING, recipeId)
player:messageSpecial(synergyMessages.OBTAIN_PONZES, 1, 1)

setFurnaceOpen(npc)

npc:setLocalVar(vars.SYNERGY_FURNACE_STATE, furnaceStates.COMPLETED)
Expand Down

0 comments on commit faf9926

Please sign in to comment.