Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Unique Event for tracking initial Nexus Cape received #4569

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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