Skip to content

Commit

Permalink
Merge pull request #4569 from LandSandBoat/4527-nexus-cape-unique
Browse files Browse the repository at this point in the history
Use Unique Event for tracking initial Nexus Cape received
  • Loading branch information
claywar authored Sep 30, 2023
2 parents be773fd + 7aa8056 commit b64aa58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions scripts/enum/unique_event.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ xi = xi or {}
xi.uniqueEvent =
{
EKOKOKO_INTRODUCTION = 0,
RECEIVED_NEXUS_CAPE = 1,
}
8 changes: 4 additions & 4 deletions scripts/zones/Lower_Jeuno/npcs/Treasure_Coffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1873,7 +1873,7 @@ entity.onTrigger = function(player, npc)
xi.settings.main.ENABLE_ASA == 1 and
not player:hasItem(xi.item.NEXUS_CAPE)

local receivedNexusCape = player:getCharVar('receivedNexusCape') == 1
local receivedNexusCape = player:hasCompletedUniqueEvent(xi.uniqueEvent.RECEIVED_NEXUS_CAPE)
local kiArgs = { 0, 0, 0, 0 }

-- Reminder that a "true" here removes the option from the player's menu
Expand Down Expand Up @@ -1922,13 +1922,13 @@ entity.onEventFinish = function(player, csid, option, npc)
if csid == 10099 then
if
option == 16777216 and
player:getCharVar('receivedNexusCape') == 0 and
not player:hasCompletedUniqueEvent(xi.uniqueEvent.RECEIVED_NEXUS_CAPE) and
npcUtil.giveItem(player, xi.item.NEXUS_CAPE)
then
player:setCharVar('receivedNexusCape', 1)
player:setUniqueEvent(xi.uniqueEvent.RECEIVED_NEXUS_CAPE)
elseif
option == 33554432 or
(option == 16777216 and player:getCharVar('receivedNexusCape') == 1)
(option == 16777216 and player:hasCompletedUniqueEvent(xi.uniqueEvent.RECEIVED_NEXUS_CAPE))
then
player:addUsedItem(xi.item.NEXUS_CAPE)
elseif option >= 1 and option <= 20 then
Expand Down

0 comments on commit b64aa58

Please sign in to comment.