diff --git a/scripts/globals/abyssea/conflux.lua b/scripts/globals/abyssea/conflux.lua index f1d110ed67d..4ccd776e4c1 100644 --- a/scripts/globals/abyssea/conflux.lua +++ b/scripts/globals/abyssea/conflux.lua @@ -222,7 +222,7 @@ xi.conflux.confluxEventFinish = function(player, csid, option, npc) if option ~= 0 and option ~= 9 and -- Conflux 0 option, always free - option ~= 1073741824 and + option ~= utils.EVENT_CANCELLED_OPTION and utils.mask.getBit(activatedMask, confluxInfo[1]) then player:delCurrency('cruor', confluxInfo[3][option]) diff --git a/scripts/globals/crafting.lua b/scripts/globals/crafting.lua index 349bb59d230..02571d29a3e 100644 --- a/scripts/globals/crafting.lua +++ b/scripts/globals/crafting.lua @@ -526,7 +526,10 @@ xi.crafting.guildPointOnEventFinish = function(player, option, target, guildId) end -- HQ crystal Option. - elseif category == 0 and option ~= 1073741824 then + elseif + category == 0 and + option ~= utils.EVENT_CANCELLED_OPTION + then local crystal = hqCrystals[bit.band(bit.rshift(option, 5), 15)] local quantity = bit.rshift(option, 9) local cost = quantity * crystal.cost diff --git a/scripts/globals/teleports/eschan_portals.lua b/scripts/globals/teleports/eschan_portals.lua index 7754b276df2..f9ad7a3d9a5 100644 --- a/scripts/globals/teleports/eschan_portals.lua +++ b/scripts/globals/teleports/eschan_portals.lua @@ -119,7 +119,7 @@ xi.escha.portals.eschanPortalEventFinish = function(player, csid, option, npc) elseif option ~= 0 and option ~= 4 and -- Scintillating Rhapsody usage. - option ~= 1073741824 + option ~= utils.EVENT_CANCELLED_OPTION then player:delCurrency('escha_silt', portalCost) end diff --git a/scripts/missions/wotg/54_Lest_We_Forget.lua b/scripts/missions/wotg/54_Lest_We_Forget.lua index ffb879ec46b..4e71d040cb1 100644 --- a/scripts/missions/wotg/54_Lest_We_Forget.lua +++ b/scripts/missions/wotg/54_Lest_We_Forget.lua @@ -98,7 +98,7 @@ mission.sections = onEventFinish = { [39] = function(player, csid, option, npc) - if option ~= 1073741824 then + if option ~= utils.EVENT_CANCELLED_OPTION then local ID = zones[player:getZoneID()] local firstAugSel = bit.band(bit.rshift(option, 1), 0xF) local secondAugSel = bit.band(bit.rshift(option, 17), 0xF) diff --git a/scripts/zones/Alzadaal_Undersea_Ruins/npcs/_20m.lua b/scripts/zones/Alzadaal_Undersea_Ruins/npcs/_20m.lua index 8155bebccf7..2966ec3a809 100644 --- a/scripts/zones/Alzadaal_Undersea_Ruins/npcs/_20m.lua +++ b/scripts/zones/Alzadaal_Undersea_Ruins/npcs/_20m.lua @@ -33,7 +33,7 @@ entity.onEventFinish = function(player, csid, option, npc) -- here as a special case if csid == 405 and - option == 1073741824 and + option == utils.EVENT_CANCELLED_OPTION and player:getLocalVar('NYZUL_INSTANCE') == 1 then player:startEvent(116, 2) -- This means the event was force terminated. Loop into the entrance animation. diff --git a/scripts/zones/Nashmau/npcs/Kilusha.lua b/scripts/zones/Nashmau/npcs/Kilusha.lua index c9afb9bd6d0..466285febcc 100644 --- a/scripts/zones/Nashmau/npcs/Kilusha.lua +++ b/scripts/zones/Nashmau/npcs/Kilusha.lua @@ -66,7 +66,11 @@ end entity.onEventFinish = function(player, csid, option, npc) if csid == 23 then player:setCharVar('EinherjarIntro', 0) -- deletes CharVar set at character creation - elseif csid == 24 and option ~= 1073741824 and option ~= 0 then + elseif + csid == 24 and + option ~= utils.EVENT_CANCELLED_OPTION and + option ~= 0 + then local kilushaItems = { [1] = { item = xi.item.ANIMATOR_P1, cost = 15000 }, diff --git a/scripts/zones/Norg/npcs/Fouvia.lua b/scripts/zones/Norg/npcs/Fouvia.lua index 7b27ef379f4..6ed50976bb4 100644 --- a/scripts/zones/Norg/npcs/Fouvia.lua +++ b/scripts/zones/Norg/npcs/Fouvia.lua @@ -25,7 +25,10 @@ entity.onEventUpdate = function(player, csid, option, npc) end entity.onEventFinish = function(player, csid, option, npc) - if csid == 130 and option ~= 1073741824 then -- Player didn't cancel out + if + csid == 130 and + option ~= utils.EVENT_CANCELLED_OPTION + then player:delGil(9800) player:setCharVar('ChangedWyvernName', 1) player:setPetName(xi.petType.WYVERN, option + 1) diff --git a/scripts/zones/Nyzul_Isle/npcs/Rune_of_Transfer.lua b/scripts/zones/Nyzul_Isle/npcs/Rune_of_Transfer.lua index 53c364f854a..70326009d5b 100644 --- a/scripts/zones/Nyzul_Isle/npcs/Rune_of_Transfer.lua +++ b/scripts/zones/Nyzul_Isle/npcs/Rune_of_Transfer.lua @@ -30,7 +30,7 @@ entity.onEventUpdate = function(player, csid, option, npc) if csid == 201 and - option ~= 1073741824 and + option ~= utils.EVENT_CANCELLED_OPTION and instance:getLocalVar('runeHandler') == 0 then local chars = instance:getChars() @@ -57,7 +57,7 @@ entity.onEventFinish = function(player, csid, option, npc) end elseif csid == 201 and - option ~= 1073741824 and + option ~= utils.EVENT_CANCELLED_OPTION and instance:getLocalVar('runeHandler') == player:getID() then -- Leave Assault diff --git a/scripts/zones/Port_Jeuno/npcs/Shami.lua b/scripts/zones/Port_Jeuno/npcs/Shami.lua index f7022f03eb3..f7a81d89a1a 100644 --- a/scripts/zones/Port_Jeuno/npcs/Shami.lua +++ b/scripts/zones/Port_Jeuno/npcs/Shami.lua @@ -128,8 +128,11 @@ entity.onEventFinish = function(player, csid, option, npc) if csid == 22 then player:confirmTrade() - -- Retrieving Seals (Option 1073741824 is escaping out of cutscene, and we do not process on this) - elseif option >= 508 and option ~= 1073741824 then + -- Retrieving Seals + elseif + option >= 508 and + option ~= utils.EVENT_CANCELLED_OPTION + then local itemID, sealID, retrievedSealCount = convertSealRetrieveOption(option) if npcUtil.giveItem(player, { { itemID, retrievedSealCount } }) then diff --git a/scripts/zones/RuLude_Gardens/npcs/Splintery_Chest.lua b/scripts/zones/RuLude_Gardens/npcs/Splintery_Chest.lua index b41b092ebbc..95c27e4271c 100644 --- a/scripts/zones/RuLude_Gardens/npcs/Splintery_Chest.lua +++ b/scripts/zones/RuLude_Gardens/npcs/Splintery_Chest.lua @@ -74,7 +74,7 @@ entity.onEventFinish = function(player, csid, option, npc) local itemId = optionTable[option] and optionTable[option] or nil - if option ~= 1073741824 then + if option ~= utils.EVENT_CANCELLED_OPTION then if not itemId then -- How did you get here?? player:PrintToPlayer('itemId or OptionID related script error!')