From 8194d646c2586f1cce719a0428a5b1b977243d1d Mon Sep 17 00:00:00 2001 From: sruon Date: Mon, 20 Jan 2025 02:40:52 -0700 Subject: [PATCH 1/5] Captains enter ruins for free --- scripts/zones/Bhaflau_Thickets/IDs.lua | 1 + .../Bhaflau_Thickets/npcs/Hamta-Iramta.lua | 26 ++++++++++++++++--- .../npcs/Kamih_Mapokhalam.lua | 7 ++++- scripts/zones/Caedarva_Mire/IDs.lua | 1 + scripts/zones/Caedarva_Mire/npcs/Kwadaaf.lua | 9 ++++++- scripts/zones/Caedarva_Mire/npcs/Nasheefa.lua | 9 ++++++- scripts/zones/Caedarva_Mire/npcs/Nuimahn.lua | 9 ++++++- scripts/zones/Caedarva_Mire/npcs/Tyamah.lua | 9 ++++++- scripts/zones/Mount_Zhayolm/IDs.lua | 1 + scripts/zones/Mount_Zhayolm/npcs/Bapokk.lua | 25 ++++++++++++------ 10 files changed, 81 insertions(+), 16 deletions(-) diff --git a/scripts/zones/Bhaflau_Thickets/IDs.lua b/scripts/zones/Bhaflau_Thickets/IDs.lua index 42f6a56dcaa..63e56b49b4e 100644 --- a/scripts/zones/Bhaflau_Thickets/IDs.lua +++ b/scripts/zones/Bhaflau_Thickets/IDs.lua @@ -25,6 +25,7 @@ zones[xi.zone.BHAFLAU_THICKETS] = STAGING_GATE_MAMOOL = 7324, -- Mamool Ja Staging Point. CANNOT_LEAVE = 7332, -- You cannot leave this area while in the possession of . RESPONSE = 7341, -- There is no response... + YOU_HAVE_A_BADGE = 7354, -- You have a ? Let me have a closer look at that... HAND_OVER_TO_IMMORTAL = 7554, -- You hand over the % to the Immortal. YOUR_IMPERIAL_STANDING = 7555, -- Your Imperial Standing has increased! HARVESTING_IS_POSSIBLE_HERE = 7573, -- Harvesting is possible here if you have . diff --git a/scripts/zones/Bhaflau_Thickets/npcs/Hamta-Iramta.lua b/scripts/zones/Bhaflau_Thickets/npcs/Hamta-Iramta.lua index 8611b137b25..1a5f3a75d73 100644 --- a/scripts/zones/Bhaflau_Thickets/npcs/Hamta-Iramta.lua +++ b/scripts/zones/Bhaflau_Thickets/npcs/Hamta-Iramta.lua @@ -4,6 +4,8 @@ -- Type: Alzadaal Undersea Ruins -- !pos -459.942 -20.048 -4.999 52 ----------------------------------- +local ID = zones[xi.zone.BHAFLAU_THICKETS] +----------------------------------- ---@type TNpcEntity local entity = {} @@ -25,19 +27,37 @@ entity.onTrigger = function(player, npc) player:getXPos() > -459 and player:getYPos() < -16.079 then - player:startEvent(134) + if player:hasKeyItem(xi.ki.CAPTAIN_WILDCAT_BADGE) then + player:messageSpecial(ID.text.YOU_HAVE_A_BADGE, xi.ki.CAPTAIN_WILDCAT_BADGE) + player:setPos(-458, -16, 0, 189) -- using the pos method until the problem below is fixed + -- player:startEvent(135) -- << this CS goes black at the end, never fades in + else + player:startEvent(134) + end elseif player:getXPos() < -459 and player:getXPos() > -462 and player:getYPos() < -16.070 then - player:startEvent(134) + if player:hasKeyItem(xi.ki.CAPTAIN_WILDCAT_BADGE) then + player:messageSpecial(ID.text.YOU_HAVE_A_BADGE, xi.ki.CAPTAIN_WILDCAT_BADGE) + player:setPos(-458, -16, 0, 189) -- using the pos method until the problem below is fixed + -- player:startEvent(135) -- << this CS goes black at the end, never fades in + else + player:startEvent(134) + end elseif player:getXPos() < -462 and player:getXPos() > -464 and player:getYPos() < -16.071 then - player:startEvent(134) + if player:hasKeyItem(xi.ki.CAPTAIN_WILDCAT_BADGE) then + player:messageSpecial(ID.text.YOU_HAVE_A_BADGE, xi.ki.CAPTAIN_WILDCAT_BADGE) + player:setPos(-458, -16, 0, 189) -- using the pos method until the problem below is fixed + -- player:startEvent(135) -- << this CS goes black at the end, never fades in + else + player:startEvent(134) + end else player:startEvent(136) end diff --git a/scripts/zones/Bhaflau_Thickets/npcs/Kamih_Mapokhalam.lua b/scripts/zones/Bhaflau_Thickets/npcs/Kamih_Mapokhalam.lua index df331a249c8..272773b0ad1 100644 --- a/scripts/zones/Bhaflau_Thickets/npcs/Kamih_Mapokhalam.lua +++ b/scripts/zones/Bhaflau_Thickets/npcs/Kamih_Mapokhalam.lua @@ -31,7 +31,12 @@ end entity.onTrigger = function(player, npc) if player:getZPos() < 597 then - player:startEvent(120) + if player:hasKeyItem(xi.ki.CAPTAIN_WILDCAT_BADGE) then + player:messageSpecial(ID.text.YOU_HAVE_A_BADGE, xi.ki.CAPTAIN_WILDCAT_BADGE) + player:startEvent(121) + else + player:startEvent(120) + end else player:startEvent(122) end diff --git a/scripts/zones/Caedarva_Mire/IDs.lua b/scripts/zones/Caedarva_Mire/IDs.lua index 52d64305b41..49597e78462 100644 --- a/scripts/zones/Caedarva_Mire/IDs.lua +++ b/scripts/zones/Caedarva_Mire/IDs.lua @@ -25,6 +25,7 @@ zones[xi.zone.CAEDARVA_MIRE] = STAGING_GATE_DVUCCA = 7326, -- Dvucca Isle Staging Point. CANNOT_LEAVE = 7332, -- You cannot leave this area while in the possession of . RESPONSE = 7341, -- There is no response... + YOU_HAVE_A_BADGE = 7354, -- You have a ? Let me have a closer look at that... LOGGING_IS_POSSIBLE_HERE = 7355, -- Logging is possible here if you have . HAND_OVER_TO_IMMORTAL = 7436, -- You hand over the % to the Immortal. YOUR_IMPERIAL_STANDING = 7437, -- Your Imperial Standing has increased! diff --git a/scripts/zones/Caedarva_Mire/npcs/Kwadaaf.lua b/scripts/zones/Caedarva_Mire/npcs/Kwadaaf.lua index b0dc67e2ec5..937fefdd6be 100644 --- a/scripts/zones/Caedarva_Mire/npcs/Kwadaaf.lua +++ b/scripts/zones/Caedarva_Mire/npcs/Kwadaaf.lua @@ -4,6 +4,8 @@ -- Type: Entry to Alzadaal Undersea Ruins -- !pos -639.000 12.323 -260.000 79 ----------------------------------- +local ID = zones[xi.zone.CAEDARVA_MIRE] +----------------------------------- ---@type TNpcEntity local entity = {} @@ -19,7 +21,12 @@ end entity.onTrigger = function(player, npc) if player:getXPos() < -639 then - player:startEvent(222) + if player:hasKeyItem(xi.ki.CAPTAIN_WILDCAT_BADGE) then + player:messageSpecial(ID.text.YOU_HAVE_A_BADGE, xi.ki.CAPTAIN_WILDCAT_BADGE) + player:startEvent(223) + else + player:startEvent(222) + end else player:startEvent(224) end diff --git a/scripts/zones/Caedarva_Mire/npcs/Nasheefa.lua b/scripts/zones/Caedarva_Mire/npcs/Nasheefa.lua index e3a8a265acf..01af619c2c5 100644 --- a/scripts/zones/Caedarva_Mire/npcs/Nasheefa.lua +++ b/scripts/zones/Caedarva_Mire/npcs/Nasheefa.lua @@ -4,6 +4,8 @@ -- Type: Alzadaal Undersea Ruins -- !pos -440.998 0.107 -740.015 79 ----------------------------------- +local ID = zones[xi.zone.CAEDARVA_MIRE] +----------------------------------- ---@type TNpcEntity local entity = {} @@ -21,7 +23,12 @@ entity.onTrigger = function(player, npc) if player:getXPos() < -440 then player:startEvent(184) else - player:startEvent(182) + if player:hasKeyItem(xi.ki.CAPTAIN_WILDCAT_BADGE) then + player:messageSpecial(ID.text.YOU_HAVE_A_BADGE, xi.ki.CAPTAIN_WILDCAT_BADGE) + player:startEvent(183) + else + player:startEvent(182) + end end end diff --git a/scripts/zones/Caedarva_Mire/npcs/Nuimahn.lua b/scripts/zones/Caedarva_Mire/npcs/Nuimahn.lua index 25a97fdf3d3..01f390c4c63 100644 --- a/scripts/zones/Caedarva_Mire/npcs/Nuimahn.lua +++ b/scripts/zones/Caedarva_Mire/npcs/Nuimahn.lua @@ -4,6 +4,8 @@ -- Type: Alzadaal Undersea Ruins -- !pos -380 0 -381 79 ----------------------------------- +local ID = zones[xi.zone.CAEDARVA_MIRE] +----------------------------------- ---@type TNpcEntity local entity = {} @@ -21,7 +23,12 @@ entity.onTrigger = function(player, npc) if player:getZPos() < -281 then player:startEvent(204) -- leaving else - player:startEvent(202) -- entering + if player:hasKeyItem(xi.ki.CAPTAIN_WILDCAT_BADGE) then -- entering + player:messageSpecial(ID.text.YOU_HAVE_A_BADGE, xi.ki.CAPTAIN_WILDCAT_BADGE) + player:startEvent(203) + else + player:startEvent(202) + end end end diff --git a/scripts/zones/Caedarva_Mire/npcs/Tyamah.lua b/scripts/zones/Caedarva_Mire/npcs/Tyamah.lua index d674c90f90e..f55ac2843a1 100644 --- a/scripts/zones/Caedarva_Mire/npcs/Tyamah.lua +++ b/scripts/zones/Caedarva_Mire/npcs/Tyamah.lua @@ -4,6 +4,8 @@ -- Type: Alzadaal Undersea Ruins -- !pos 320.003 0.124 -700.011 79 ----------------------------------- +local ID = zones[xi.zone.CAEDARVA_MIRE] +----------------------------------- ---@type TNpcEntity local entity = {} @@ -21,7 +23,12 @@ entity.onTrigger = function(player, npc) if player:getXPos() > 320 then player:startEvent(164) else - player:startEvent(162) + if player:hasKeyItem(xi.ki.CAPTAIN_WILDCAT_BADGE) then + player:messageSpecial(ID.text.YOU_HAVE_A_BADGE, xi.ki.CAPTAIN_WILDCAT_BADGE) + player:startEvent(163) + else + player:startEvent(162) + end end end diff --git a/scripts/zones/Mount_Zhayolm/IDs.lua b/scripts/zones/Mount_Zhayolm/IDs.lua index e804d9fb065..48a506857b0 100644 --- a/scripts/zones/Mount_Zhayolm/IDs.lua +++ b/scripts/zones/Mount_Zhayolm/IDs.lua @@ -23,6 +23,7 @@ zones[xi.zone.MOUNT_ZHAYOLM] = STAGING_GATE_HALVUNG = 7325, -- Halvung Staging Point. CANNOT_LEAVE = 7332, -- You cannot leave this area while in the possession of . RESPONSE = 7341, -- There is no response... + YOU_HAVE_A_BADGE = 7354, -- You have a ? Let me have a closer look at that... HAND_OVER_TO_IMMORTAL = 7428, -- You hand over the % to the Immortal. YOUR_IMPERIAL_STANDING = 7429, -- Your Imperial Standing has increased! MINING_IS_POSSIBLE_HERE = 7430, -- Mining is possible here if you have . diff --git a/scripts/zones/Mount_Zhayolm/npcs/Bapokk.lua b/scripts/zones/Mount_Zhayolm/npcs/Bapokk.lua index d59d01c2954..40e938ec832 100644 --- a/scripts/zones/Mount_Zhayolm/npcs/Bapokk.lua +++ b/scripts/zones/Mount_Zhayolm/npcs/Bapokk.lua @@ -4,20 +4,33 @@ -- Handles access to Alzadaal Ruins -- !pos -20 -6 276 61 ----------------------------------- +local ID = zones[xi.zone.MOUNT_ZHAYOLM] +----------------------------------- ---@type TNpcEntity local entity = {} entity.onTrade = function(player, npc, trade) - if npcUtil.tradeHas(trade, xi.item.IMPERIAL_SILVER_PIECE) then - player:startEvent(163) + if + trade:getItemCount() == 1 and + trade:hasItemQty(xi.item.IMPERIAL_SILVER_PIECE, 1) + then + player:tradeComplete() + player:setPos(-20, 3.7, 316, 198) -- using the pos method until the problem below is fixed + -- player:startEvent(163) -- << this CS goes black at the end, never fades in end end entity.onTrigger = function(player, npc) - if player:getZPos() > -280 then + if player:getZPos() > 280 then player:startEvent(164) -- Ruins -> Zhayolm else - player:startEvent(162) -- Zhayolm -> Ruins + if player:hasKeyItem(xi.ki.CAPTAIN_WILDCAT_BADGE) then -- Zhayolm -> Ruins + player:messageSpecial(ID.text.YOU_HAVE_A_BADGE, xi.ki.CAPTAIN_WILDCAT_BADGE) + player:setPos(-20, 3.7, 316, 198) + -- player:startEvent(163) + else + player:startEvent(162) + end end end @@ -25,10 +38,6 @@ entity.onEventUpdate = function(player, csid, option, npc) end entity.onEventFinish = function(player, csid, option, npc) - if csid == 163 then - player:confirmTrade() - player:setPos(-20, -6, 0, 192) -- using the pos method until the problem below is fixed - end end return entity From 421371df20651611105c84fc116279719dfb1f60 Mon Sep 17 00:00:00 2001 From: sruon Date: Mon, 20 Jan 2025 04:17:10 -0700 Subject: [PATCH 2/5] Captains skip RP first menu and travel for free --- scripts/zones/Aht_Urhgan_Whitegate/IDs.lua | 1 + .../Aht_Urhgan_Whitegate/npcs/Runic_Portal.lua | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/zones/Aht_Urhgan_Whitegate/IDs.lua b/scripts/zones/Aht_Urhgan_Whitegate/IDs.lua index 3a052f02af9..7ceb7e4bafa 100644 --- a/scripts/zones/Aht_Urhgan_Whitegate/IDs.lua +++ b/scripts/zones/Aht_Urhgan_Whitegate/IDs.lua @@ -34,6 +34,7 @@ zones[xi.zone.AHT_URHGAN_WHITEGATE] = OBTAIN_SCYLDS = 1515, -- You obtain [scyld/scylds]! Current balance: [scyld/scylds]. HUNT_CANCELED = 1519, -- Hunt canceled. RUNIC_PORTAL = 4601, -- You cannot use the runic portal without the Empire's authorization. + IMPERIAL_AUTHORIZATION = 4604, -- Confirming Imperial authorization... You are authorized to use the runic portal. SUFFICIENT_IMPERIAL_STANDING = 4609, -- You do not possess sufficient Imperial Standing. CONFIRMING = 4610, -- Confirming ... RUNIC_DENIED_ASSAULT_OFFSET = 4618, -- You have not opened a path between the Chamber of Passage and the Azouph Isle staging point (Leujaoam Sanctum). Unable to use runic portal. diff --git a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Runic_Portal.lua b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Runic_Portal.lua index 15b2ae2aad8..0a649002892 100644 --- a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Runic_Portal.lua +++ b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Runic_Portal.lua @@ -43,8 +43,14 @@ entity.onTrigger = function(player, npc) local mercRank = xi.besieged.getMercenaryRank(player) local points = player:getCurrency('imperial_standing') local hasAstral = xi.besieged.getAstralCandescence() + local isCaptain = player:hasKeyItem(xi.ki.CAPTAIN_WILDCAT_BADGE) - player:startEvent(101, hasPermit and xi.ki.RUNIC_PORTAL_USE_PERMIT or 0, runicPortals, mercRank, points, 0, hasAstral, hasPermit and 1 or 0) + if isCaptain then + player:messageSpecial(ID.text.IMPERIAL_AUTHORIZATION) -- TODO: This may show in other cases + hasPermit = false -- #1 and #7 are always set to 0 for Captains + end + + player:startEvent(101, hasPermit and xi.ki.RUNIC_PORTAL_USE_PERMIT or 0, runicPortals, mercRank, points, isCaptain and 1 or 0, hasAstral, hasPermit and 1 or 0, 0) end end @@ -54,6 +60,12 @@ end entity.onEventFinish = function(player, csid, option, npc) local portalPick = { + [1] = xi.teleport.id.AZOUPH_SP, + [2] = xi.teleport.id.DVUCCA_SP, + [3] = xi.teleport.id.MAMOOL_SP, + [4] = xi.teleport.id.HALVUNG_SP, + [5] = xi.teleport.id.ILRUSI_SP, + [6] = xi.teleport.id.NYZUL_SP, [101] = xi.teleport.id.AZOUPH_SP, [102] = xi.teleport.id.DVUCCA_SP, [103] = xi.teleport.id.MAMOOL_SP, @@ -86,7 +98,8 @@ entity.onEventFinish = function(player, csid, option, npc) player:messageSpecial(ID.text.SUFFICIENT_IMPERIAL_STANDING) end end - + elseif csid == 101 and option >= 1 and option <= 6 then -- Captains dont lose permit + xi.teleport.to(player, portalPick[option]) elseif csid >= 120 and csid <= 125 and option == 1 then xi.teleport.to(player, portalPick[csid]) end From f8b0de6e6fa0a9cad9547ee70ce4eef953aae52d Mon Sep 17 00:00:00 2001 From: sruon Date: Mon, 20 Jan 2025 15:00:28 -0700 Subject: [PATCH 3/5] Update badge message comment Co-Authored-By: WinterSolstice8 <60417494+WinterSolstice8@users.noreply.github.com> --- scripts/zones/Bhaflau_Thickets/IDs.lua | 2 +- scripts/zones/Caedarva_Mire/IDs.lua | 2 +- scripts/zones/Mount_Zhayolm/IDs.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/zones/Bhaflau_Thickets/IDs.lua b/scripts/zones/Bhaflau_Thickets/IDs.lua index 63e56b49b4e..c38e0f2e137 100644 --- a/scripts/zones/Bhaflau_Thickets/IDs.lua +++ b/scripts/zones/Bhaflau_Thickets/IDs.lua @@ -25,7 +25,7 @@ zones[xi.zone.BHAFLAU_THICKETS] = STAGING_GATE_MAMOOL = 7324, -- Mamool Ja Staging Point. CANNOT_LEAVE = 7332, -- You cannot leave this area while in the possession of . RESPONSE = 7341, -- There is no response... - YOU_HAVE_A_BADGE = 7354, -- You have a ? Let me have a closer look at that... + YOU_HAVE_A_BADGE = 7354, -- You have a %? Let me have a closer look at that... HAND_OVER_TO_IMMORTAL = 7554, -- You hand over the % to the Immortal. YOUR_IMPERIAL_STANDING = 7555, -- Your Imperial Standing has increased! HARVESTING_IS_POSSIBLE_HERE = 7573, -- Harvesting is possible here if you have . diff --git a/scripts/zones/Caedarva_Mire/IDs.lua b/scripts/zones/Caedarva_Mire/IDs.lua index 49597e78462..9a85da747e5 100644 --- a/scripts/zones/Caedarva_Mire/IDs.lua +++ b/scripts/zones/Caedarva_Mire/IDs.lua @@ -25,7 +25,7 @@ zones[xi.zone.CAEDARVA_MIRE] = STAGING_GATE_DVUCCA = 7326, -- Dvucca Isle Staging Point. CANNOT_LEAVE = 7332, -- You cannot leave this area while in the possession of . RESPONSE = 7341, -- There is no response... - YOU_HAVE_A_BADGE = 7354, -- You have a ? Let me have a closer look at that... + YOU_HAVE_A_BADGE = 7354, -- You have a %? Let me have a closer look at that... LOGGING_IS_POSSIBLE_HERE = 7355, -- Logging is possible here if you have . HAND_OVER_TO_IMMORTAL = 7436, -- You hand over the % to the Immortal. YOUR_IMPERIAL_STANDING = 7437, -- Your Imperial Standing has increased! diff --git a/scripts/zones/Mount_Zhayolm/IDs.lua b/scripts/zones/Mount_Zhayolm/IDs.lua index 48a506857b0..0f6501ad8ec 100644 --- a/scripts/zones/Mount_Zhayolm/IDs.lua +++ b/scripts/zones/Mount_Zhayolm/IDs.lua @@ -23,7 +23,7 @@ zones[xi.zone.MOUNT_ZHAYOLM] = STAGING_GATE_HALVUNG = 7325, -- Halvung Staging Point. CANNOT_LEAVE = 7332, -- You cannot leave this area while in the possession of . RESPONSE = 7341, -- There is no response... - YOU_HAVE_A_BADGE = 7354, -- You have a ? Let me have a closer look at that... + YOU_HAVE_A_BADGE = 7354, -- You have a %? Let me have a closer look at that... HAND_OVER_TO_IMMORTAL = 7428, -- You hand over the % to the Immortal. YOUR_IMPERIAL_STANDING = 7429, -- Your Imperial Standing has increased! MINING_IS_POSSIBLE_HERE = 7430, -- Mining is possible here if you have . From 8fb3a4953466a01b366f2b9b5e976135e3f194b9 Mon Sep 17 00:00:00 2001 From: sruon Date: Mon, 20 Jan 2025 15:03:30 -0700 Subject: [PATCH 4/5] Comment out onEventFinish --- scripts/zones/Mount_Zhayolm/npcs/Bapokk.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/zones/Mount_Zhayolm/npcs/Bapokk.lua b/scripts/zones/Mount_Zhayolm/npcs/Bapokk.lua index 40e938ec832..bef3d4c8e4c 100644 --- a/scripts/zones/Mount_Zhayolm/npcs/Bapokk.lua +++ b/scripts/zones/Mount_Zhayolm/npcs/Bapokk.lua @@ -38,6 +38,11 @@ entity.onEventUpdate = function(player, csid, option, npc) end entity.onEventFinish = function(player, csid, option, npc) + -- Moved to onTrade to match other Ruins Entry NPCs scripts + -- if csid == 163 then + -- player:confirmTrade() + -- player:setPos(-20, -6, 0, 192) -- using the pos method until the problem below is fixed + -- end end return entity From a119f0c7313a68014f1d382c950273e15c0d82a2 Mon Sep 17 00:00:00 2001 From: sruon Date: Tue, 21 Jan 2025 19:30:11 -0700 Subject: [PATCH 5/5] Alzaadal Entry NPCs properly teleport to Ruins Co-Authored-By: Xaver-DaRed <60053999+Xaver-DaRed@users.noreply.github.com> --- .../Bhaflau_Thickets/npcs/Hamta-Iramta.lua | 52 ++++++------------- scripts/zones/Mount_Zhayolm/npcs/Bapokk.lua | 14 ++--- 2 files changed, 20 insertions(+), 46 deletions(-) diff --git a/scripts/zones/Bhaflau_Thickets/npcs/Hamta-Iramta.lua b/scripts/zones/Bhaflau_Thickets/npcs/Hamta-Iramta.lua index 1a5f3a75d73..0a915493876 100644 --- a/scripts/zones/Bhaflau_Thickets/npcs/Hamta-Iramta.lua +++ b/scripts/zones/Bhaflau_Thickets/npcs/Hamta-Iramta.lua @@ -9,52 +9,30 @@ local ID = zones[xi.zone.BHAFLAU_THICKETS] ---@type TNpcEntity local entity = {} +local function isOutsideAlzadaal(player) + if player:getYPos() <= -16.01 then + return true + end + + return false +end + entity.onTrade = function(player, npc, trade) if + isOutsideAlzadaal(player) and trade:getItemCount() == 1 and trade:hasItemQty(xi.item.IMPERIAL_SILVER_PIECE, 1) then player:tradeComplete() - player:setPos(-458, -16, 0, 189) -- using the pos method until the problem below is fixed - -- player:startEvent(135) -- << this CS goes black at the end, never fades in + player:startEvent(135) end end entity.onTrigger = function(player, npc) - -- NPC is on a slant which makes this really difficult - if - player:getXPos() < -456 and - player:getXPos() > -459 and - player:getYPos() < -16.079 - then + if isOutsideAlzadaal(player) then if player:hasKeyItem(xi.ki.CAPTAIN_WILDCAT_BADGE) then player:messageSpecial(ID.text.YOU_HAVE_A_BADGE, xi.ki.CAPTAIN_WILDCAT_BADGE) - player:setPos(-458, -16, 0, 189) -- using the pos method until the problem below is fixed - -- player:startEvent(135) -- << this CS goes black at the end, never fades in - else - player:startEvent(134) - end - elseif - player:getXPos() < -459 and - player:getXPos() > -462 and - player:getYPos() < -16.070 - then - if player:hasKeyItem(xi.ki.CAPTAIN_WILDCAT_BADGE) then - player:messageSpecial(ID.text.YOU_HAVE_A_BADGE, xi.ki.CAPTAIN_WILDCAT_BADGE) - player:setPos(-458, -16, 0, 189) -- using the pos method until the problem below is fixed - -- player:startEvent(135) -- << this CS goes black at the end, never fades in - else - player:startEvent(134) - end - elseif - player:getXPos() < -462 and - player:getXPos() > -464 and - player:getYPos() < -16.071 - then - if player:hasKeyItem(xi.ki.CAPTAIN_WILDCAT_BADGE) then - player:messageSpecial(ID.text.YOU_HAVE_A_BADGE, xi.ki.CAPTAIN_WILDCAT_BADGE) - player:setPos(-458, -16, 0, 189) -- using the pos method until the problem below is fixed - -- player:startEvent(135) -- << this CS goes black at the end, never fades in + player:startEvent(135) else player:startEvent(134) end @@ -63,10 +41,10 @@ entity.onTrigger = function(player, npc) end end -entity.onEventUpdate = function(player, csid, option, npc) -end - entity.onEventFinish = function(player, csid, option, npc) + if csid == 135 then + player:setPos(-115, -4, -620, 253, xi.zone.ALZADAAL_UNDERSEA_RUINS) + end end return entity diff --git a/scripts/zones/Mount_Zhayolm/npcs/Bapokk.lua b/scripts/zones/Mount_Zhayolm/npcs/Bapokk.lua index bef3d4c8e4c..d457a61c093 100644 --- a/scripts/zones/Mount_Zhayolm/npcs/Bapokk.lua +++ b/scripts/zones/Mount_Zhayolm/npcs/Bapokk.lua @@ -15,8 +15,7 @@ entity.onTrade = function(player, npc, trade) trade:hasItemQty(xi.item.IMPERIAL_SILVER_PIECE, 1) then player:tradeComplete() - player:setPos(-20, 3.7, 316, 198) -- using the pos method until the problem below is fixed - -- player:startEvent(163) -- << this CS goes black at the end, never fades in + player:startEvent(163) end end @@ -26,8 +25,7 @@ entity.onTrigger = function(player, npc) else if player:hasKeyItem(xi.ki.CAPTAIN_WILDCAT_BADGE) then -- Zhayolm -> Ruins player:messageSpecial(ID.text.YOU_HAVE_A_BADGE, xi.ki.CAPTAIN_WILDCAT_BADGE) - player:setPos(-20, 3.7, 316, 198) - -- player:startEvent(163) + player:startEvent(163) else player:startEvent(162) end @@ -38,11 +36,9 @@ entity.onEventUpdate = function(player, csid, option, npc) end entity.onEventFinish = function(player, csid, option, npc) - -- Moved to onTrade to match other Ruins Entry NPCs scripts - -- if csid == 163 then - -- player:confirmTrade() - -- player:setPos(-20, -6, 0, 192) -- using the pos method until the problem below is fixed - -- end + if csid == 163 then + player:setPos(100, -4, -675, 192, xi.zone.ALZADAAL_UNDERSEA_RUINS) + end end return entity