diff --git a/scripts/zones/Chateau_dOraguille/npcs/Halver.lua b/scripts/zones/Chateau_dOraguille/npcs/Halver.lua index af24f6c0712..70ebb03ab6b 100644 --- a/scripts/zones/Chateau_dOraguille/npcs/Halver.lua +++ b/scripts/zones/Chateau_dOraguille/npcs/Halver.lua @@ -144,7 +144,7 @@ function onEventFinish(player,csid,option) elseif (csid == 503) then player:setVar("MissionStatus",9) elseif (csid == 508) then - player:setVar("MissionStatus",2) + player:setVar("MissionStatus",1) elseif (csid == 505) then player:setVar("MissionStatus",2) player:addKeyItem(dsp.ki.LETTER_TO_THE_CONSULS_SANDORIA) diff --git a/scripts/zones/Chateau_dOraguille/npcs/_6h4.lua b/scripts/zones/Chateau_dOraguille/npcs/_6h4.lua index 532d929f4f9..287b08e4c0d 100644 --- a/scripts/zones/Chateau_dOraguille/npcs/_6h4.lua +++ b/scripts/zones/Chateau_dOraguille/npcs/_6h4.lua @@ -40,7 +40,7 @@ function onTrigger(player,npc) elseif (currentMission == dsp.mission.id.sandoria.THE_SHADOW_LORD and MissionStatus == 5) then player:startEvent(61); -- Mission San D'Oria 3-3 Appointment to Jeuno - elseif (currentMission == dsp.mission.id.sandoria.APPOINTMENT_TO_JEUNO and MissionStatus == 2) then + elseif (currentMission == dsp.mission.id.sandoria.APPOINTMENT_TO_JEUNO and MissionStatus == 1) then player:startEvent(537); else player:startEvent(514); @@ -56,7 +56,7 @@ end; function onEventFinish(player,csid,option) if (csid == 537) then - player:setVar("MissionStatus",3); + player:setVar("MissionStatus",2); player:addKeyItem(dsp.ki.LETTER_TO_THE_AMBASSADOR); player:messageSpecial(ID.text.KEYITEM_OBTAINED,dsp.ki.LETTER_TO_THE_AMBASSADOR); elseif (csid == 61) then diff --git a/scripts/zones/Heavens_Tower/npcs/_6q2.lua b/scripts/zones/Heavens_Tower/npcs/_6q2.lua index c603a1002d2..636333f40e7 100644 --- a/scripts/zones/Heavens_Tower/npcs/_6q2.lua +++ b/scripts/zones/Heavens_Tower/npcs/_6q2.lua @@ -17,7 +17,7 @@ function onTrigger(player,npc) local CurrentMission = player:getCurrentMission(WINDURST); local MissionStatus = player:getVar("MissionStatus"); - if (CurrentMission == dsp.mission.id.windurst.A_NEW_JOURNEY and MissionStatus == 0) then + if (CurrentMission == dsp.mission.id.windurst.A_NEW_JOURNEY and player:hasKeyItem(dsp.ki.STAR_CRESTED_SUMMONS) and MissionStatus == 0) then player:startEvent(153); elseif (player:hasKeyItem(dsp.ki.MESSAGE_TO_JEUNO_WINDURST)) then player:startEvent(166); @@ -44,7 +44,7 @@ function onTrigger(player,npc) elseif (CurrentMission == dsp.mission.id.windurst.MOON_READING and MissionStatus == 4) then if (player:getFreeSlotsCount() == 0) then player:messageSpecial(ID.text.ITEM_CANNOT_BE_OBTAINED,183); - else + else player:startEvent(407); end else diff --git a/scripts/zones/Lower_Delkfutts_Tower/npcs/_541.lua b/scripts/zones/Lower_Delkfutts_Tower/npcs/_541.lua index e50c6f56eaa..3f80efc606b 100644 --- a/scripts/zones/Lower_Delkfutts_Tower/npcs/_541.lua +++ b/scripts/zones/Lower_Delkfutts_Tower/npcs/_541.lua @@ -14,7 +14,7 @@ require("scripts/globals/npc_util") function onTrade(player, npc, trade) if player:getCurrentMission(SANDORIA) == dsp.mission.id.sandoria.APPOINTMENT_TO_JEUNO and - player:getVar("MissionStatus") == 4 and + player:getVar("MissionStatus") == 3 and npcUtil.tradeHas(trade, 549) -- Delkfutt Key then player:startEvent(0) @@ -24,9 +24,9 @@ end function onTrigger(player, npc) local currentMission = player:getCurrentMission(SANDORIA) - if currentMission == dsp.mission.id.sandoria.APPOINTMENT_TO_JEUNO and player:getVar("MissionStatus") == 4 and not player:hasKeyItem(dsp.ki.DELKFUTT_KEY) then + if currentMission == dsp.mission.id.sandoria.APPOINTMENT_TO_JEUNO and player:getVar("MissionStatus") == 3 and not player:hasKeyItem(dsp.ki.DELKFUTT_KEY) then player:messageSpecial(ID.text.THE_DOOR_IS_FIRMLY_SHUT_OPEN_KEY) - elseif currentMission == dsp.mission.id.sandoria.APPOINTMENT_TO_JEUNO and player:getVar("MissionStatus") == 4 and player:hasKeyItem(dsp.ki.DELKFUTT_KEY) then + elseif currentMission == dsp.mission.id.sandoria.APPOINTMENT_TO_JEUNO and player:getVar("MissionStatus") == 3 and player:hasKeyItem(dsp.ki.DELKFUTT_KEY) then player:startEvent(0) else player:messageSpecial(ID.text.DOOR_FIRMLY_SHUT) @@ -38,7 +38,7 @@ end function onEventFinish(player, csid, option) if csid == 0 then - player:setVar("MissionStatus", 5) + player:setVar("MissionStatus", 4) if not player:hasKeyItem(dsp.ki.DELKFUTT_KEY) then npcUtil.giveKeyItem(player, dsp.ki.DELKFUTT_KEY) diff --git a/scripts/zones/RuLude_Gardens/IDs.lua b/scripts/zones/RuLude_Gardens/IDs.lua index 202dd31acc1..0f9f34e7898 100644 --- a/scripts/zones/RuLude_Gardens/IDs.lua +++ b/scripts/zones/RuLude_Gardens/IDs.lua @@ -44,6 +44,8 @@ zones[dsp.zone.RULUDE_GARDENS] = YOUR_LEVEL_LIMIT_IS_NOW_90 = 12335, -- Your level limit is now 90! YOUR_LEVEL_LIMIT_IS_NOW_95 = 12436, -- Your level limit is now 95! WINDURST_EMBASSY = 12437, -- I have a letter for you here from none other than Atori-Tutori. It reads, ahem... + EMBASSY_DOOR_RESTRICTION = 10094, -- It reads, “Restricted Area.” + EMBASSY_DOOR_NO_LETTER = 10095, -- You have no letter of introduction. YOUR_LEVEL_LIMIT_IS_NOW_99 = 12516, -- Your level limit is now 99! TEAR_IN_FABRIC_OF_SPACE = 15937, -- There appears to be a tear in the fabric of space... }, diff --git a/scripts/zones/RuLude_Gardens/npcs/Goggehn.lua b/scripts/zones/RuLude_Gardens/npcs/Goggehn.lua index 3863fed16a0..0749905dfe2 100644 --- a/scripts/zones/RuLude_Gardens/npcs/Goggehn.lua +++ b/scripts/zones/RuLude_Gardens/npcs/Goggehn.lua @@ -15,59 +15,49 @@ end function onTrigger(player,npc) local pNation = player:getNation() - local currentMission = player:getCurrentMission(BASTOK) - local missionStatus = player:getVar("MissionStatus") - if currentMission == dsp.mission.id.bastok.JEUNO_MISSION and missionStatus == 1 then - player:startEvent(41) - elseif currentMission == dsp.mission.id.bastok.JEUNO_MISSION and missionStatus == 2 then - player:startEvent(66) - elseif currentMission == dsp.mission.id.bastok.JEUNO_MISSION and missionStatus == 3 then - player:startEvent(38) - elseif - pNation == dsp.nation.BASTOK and player:getRank() == 4 and - currentMission == dsp.mission.id.bastok.NONE and - getMissionRankPoints(player, 13) == 1 - then - if player:hasKeyItem(dsp.ki.ARCHDUCAL_AUDIENCE_PERMIT) then - player:startEvent(129,1) + if pNation == dsp.nation.BASTOK then + local currentMission = player:getCurrentMission(BASTOK) + local missionStatus = player:getVar("MissionStatus") + + if currentMission == dsp.mission.id.bastok.JEUNO and missionStatus == 1 then + player:startEvent(41) + elseif currentMission == dsp.mission.id.bastok.JEUNO and missionStatus == 2 then + player:startEvent(66) + elseif currentMission == dsp.mission.id.bastok.JEUNO and missionStatus >= 3 then + player:startEvent(139) + elseif player:getRank() == 4 and currentMission == dsp.mission.id.bastok.NONE and getMissionRankPoints(player, 13) == 1 then + player:startEvent(0) + elseif currentMission == dsp.mission.id.bastok.MAGICITE and missionStatus == 1 then + player:startEvent(132) + elseif currentMission == dsp.mission.id.bastok.MAGICITE and missionStatus <= 5 then + player:startEvent(135) + elseif currentMission == dsp.mission.id.bastok.MAGICITE and missionStatus == 6 then + player:startEvent(35) + elseif player:hasKeyItem(dsp.ki.MESSAGE_TO_JEUNO_BASTOK) then + player:startEvent(55) + elseif player:getRank() == 10 then + player:startEvent(105) else - player:startEvent(129) -- Start Mission 4-1 Magicite + player:startEvent(4) end - elseif currentMission == dsp.mission.id.bastok.MAGICITE_BASTOK and missionStatus == 1 then - player:startEvent(132) - elseif currentMission == dsp.mission.id.bastok.MAGICITE_BASTOK and missionStatus <= 5 then - player:startEvent(135) - elseif currentMission == dsp.mission.id.bastok.MAGICITE_BASTOK and missionStatus == 6 then - player:startEvent(35) - elseif player:hasKeyItem(dsp.ki.MESSAGE_TO_JEUNO_BASTOK) then - player:startEvent(55) elseif pNation == dsp.nation.WINDURST then - player:startEvent(4) - elseif pNation == dsp.nation.SANDORIA then player:startEvent(2) - else - player:startEvent(101) + elseif pNation == dsp.nation.SANDORIA then + player:startEvent(1) end - end function onEventUpdate(player,csid,option) end function onEventFinish(player,csid,option) - if csid == 41 then player:setVar("MissionStatus",2) player:delKeyItem(dsp.ki.LETTER_TO_THE_AMBASSADOR) - elseif csid == 129 and option == 1 then - player:setVar("MissionStatus",1) - if player:hasKeyItem(dsp.ki.ARCHDUCAL_AUDIENCE_PERMIT) == false then - player:addKeyItem(dsp.ki.ARCHDUCAL_AUDIENCE_PERMIT) - player:messageSpecial(ID.text.KEYITEM_OBTAINED,dsp.ki.ARCHDUCAL_AUDIENCE_PERMIT) - end - elseif csid == 38 or csid == 35 then + elseif csid == 139 then + player:setVar("MissionStatus", 4) + elseif csid == 35 then finishMissionTimeline(player,1,csid,option) end - end \ No newline at end of file diff --git a/scripts/zones/RuLude_Gardens/npcs/Nelcabrit.lua b/scripts/zones/RuLude_Gardens/npcs/Nelcabrit.lua index 8eb2868242d..e35332aa3ba 100644 --- a/scripts/zones/RuLude_Gardens/npcs/Nelcabrit.lua +++ b/scripts/zones/RuLude_Gardens/npcs/Nelcabrit.lua @@ -15,37 +15,37 @@ end function onTrigger(player,npc) local pNation = player:getNation() - local currentMission = player:getCurrentMission(SANDORIA) - local missionStatus = player:getVar("MissionStatus") - if currentMission == dsp.mission.id.sandoria.APPOINTMENT_TO_JEUNO and missionStatus == 3 then - player:startEvent(42) - elseif currentMission == dsp.mission.id.sandoria.APPOINTMENT_TO_JEUNO and missionStatus == 4 then - player:startEvent(67) - elseif currentMission == dsp.mission.id.sandoria.APPOINTMENT_TO_JEUNO and missionStatus == 5 then - player:startEvent(39) - elseif - pNation == dsp.nation.SANDORIA and player:getRank() == 4 and - currentMission == dsp.mission.id.sandoria.NONE and - getMissionRankPoints(player, 13) == 1 - then - player:startEvent(130) -- Start Mission 4-1 Magicite - elseif currentMission == dsp.mission.id.sandoria.MAGICITE_SAN_D_ORIA and missionStatus == 1 then - player:startEvent(133) - elseif currentMission == dsp.mission.id.sandoria.MAGICITE_SAN_D_ORIA and missionStatus <= 5 then - player:startEvent(136) - elseif currentMission == dsp.mission.id.sandoria.MAGICITE_SAN_D_ORIA and missionStatus == 6 then - player:startEvent(36) - elseif player:hasKeyItem(dsp.ki.MESSAGE_TO_JEUNO_SANDORIA) then - player:startEvent(56) + if pNation == dsp.nation.SANDORIA then + local currentMission = player:getCurrentMission(SANDORIA) + local missionStatus = player:getVar("MissionStatus") + + if currentMission == dsp.mission.id.sandoria.APPOINTMENT_TO_JEUNO and missionStatus == 2 then + player:startEvent(42) + elseif currentMission == dsp.mission.id.sandoria.APPOINTMENT_TO_JEUNO and missionStatus == 3 then + player:startEvent(67) + elseif currentMission == dsp.mission.id.sandoria.APPOINTMENT_TO_JEUNO and missionStatus >= 4 then + player:startEvent(140) + elseif player:getRank() == 4 and currentMission == dsp.mission.id.sandoria.NONE and getMissionRankPoints(player, 13) == 1 then + player:startEvent(45) + elseif currentMission == dsp.mission.id.sandoria.MAGICITE and missionStatus == 1 then + player:startEvent(133) + elseif currentMission == dsp.mission.id.sandoria.MAGICITE and missionStatus <= 5 then + player:startEvent(136) + elseif currentMission == dsp.mission.id.sandoria.MAGICITE and missionStatus == 6 then + player:startEvent(36) + elseif player:hasKeyItem(dsp.ki.MESSAGE_TO_JEUNO_SANDORIA) then + player:startEvent(56) + elseif player:getRank() == 10 then + player:startEvent(106) + else + player:startEvent(49) + end elseif pNation == dsp.nation.WINDURST then player:startEvent(47) elseif pNation == dsp.nation.BASTOK then player:startEvent(46) - else - player:startEvent(102) end - end function onEventUpdate(player,csid,option) @@ -53,13 +53,11 @@ end function onEventFinish(player,csid,option) if csid == 42 then - player:setVar("MissionStatus",4) + player:setVar("MissionStatus",3) player:delKeyItem(dsp.ki.LETTER_TO_THE_AMBASSADOR) - elseif csid == 130 and option == 1 then - player:setVar("MissionStatus",1) - player:addKeyItem(dsp.ki.ARCHDUCAL_AUDIENCE_PERMIT) - player:messageSpecial(ID.text.KEYITEM_OBTAINED, dsp.ki.ARCHDUCAL_AUDIENCE_PERMIT) - elseif csid == 39 or csid == 36 then + elseif csid == 140 then + player:setVar("MissionStatus", 5) + elseif csid == 36 then finishMissionTimeline(player, 3, csid, option) end -end +end \ No newline at end of file diff --git a/scripts/zones/RuLude_Gardens/npcs/Pakh_Jatalfih.lua b/scripts/zones/RuLude_Gardens/npcs/Pakh_Jatalfih.lua index 36a5b914f8c..352510ec763 100644 --- a/scripts/zones/RuLude_Gardens/npcs/Pakh_Jatalfih.lua +++ b/scripts/zones/RuLude_Gardens/npcs/Pakh_Jatalfih.lua @@ -1,8 +1,11 @@ ----------------------------------- -- Area: Ru'Lud Gardens -- NPC: Pakh Jatalfih +-- Involved in Mission: Windurst 3-3, 4-1 -- !pos 34 8 -35 243 ----------------------------------- +local ID = require("scripts/zones/RuLude_Gardens/IDs") +require("scripts/globals/settings") require("scripts/globals/keyitems") require("scripts/globals/missions") ----------------------------------- @@ -21,26 +24,22 @@ function onTrigger(player,npc) player:startEvent(43) elseif currentMission == dsp.mission.id.windurst.A_NEW_JOURNEY and MissionStatus == 2 then player:startEvent(68) - elseif currentMission == dsp.mission.id.windurst.A_NEW_JOURNEY and MissionStatus == 3 then + elseif currentMission == dsp.mission.id.windurst.A_NEW_JOURNEY and MissionStatus >= 3 then player:startEvent(141) - elseif player:getRank() == 4 and MissionStatus == 0 then - if getMissionRankPoints(player, 13) == 1 then - player:startEvent(50) - else - player:startEvent(54) - end - elseif player:getRank() == 4 and currentMission == dsp.mission.id.windurst.NONE and MissionStatus ~= 0 and getMissionRankPoints(player, 13) == 1 then + elseif player:getRank() == 4 and currentMission == dsp.mission.id.windurst.NONE and getMissionRankPoints(player, 13) == 1 then + player:startEvent(50) + elseif currentMission == dsp.mission.id.windurst.MAGICITE and missionStatus == 1 then player:startEvent(134) - elseif currentMission == dsp.mission.id.windurst.MAGICITE and MissionStatus == 2 then + elseif currentMission == dsp.mission.id.windurst.MAGICITE and MissionStatus <= 5 then player:startEvent(137) elseif currentMission == dsp.mission.id.windurst.MAGICITE and MissionStatus == 6 then player:startEvent(37) elseif player:hasKeyItem(dsp.ki.MESSAGE_TO_JEUNO_WINDURST) then player:startEvent(57) - elseif player:getRank() >= 5 then - player:startEvent(57) - else + elseif player:getRank() == 10 then player:startEvent(107) + else + player:startEvent(54) end elseif pNation == dsp.nation.SANDORIA then player:startEvent(52) @@ -55,9 +54,10 @@ end function onEventFinish(player,csid,option) if csid == 43 then player:setVar("MissionStatus", 2) + player:delKeyItem(dsp.ki.LETTER_TO_THE_AMBASSADOR) elseif csid == 141 then player:setVar("MissionStatus", 4) elseif csid == 37 then finishMissionTimeline(player, 1, csid, option) end -end +end \ No newline at end of file diff --git a/scripts/zones/RuLude_Gardens/npcs/_6r2.lua b/scripts/zones/RuLude_Gardens/npcs/_6r2.lua new file mode 100644 index 00000000000..07ce4b6a087 --- /dev/null +++ b/scripts/zones/RuLude_Gardens/npcs/_6r2.lua @@ -0,0 +1,53 @@ +----------------------------------- +-- Area: Ru'Lud Gardens +-- Door: Bastokian Ambassador +-- Bastok Missions 3.3 "Jeuno" and 4.1 "Magicite" +-- !pos 17 9 -75 243 +----------------------------------- +local ID = require("scripts/zones/RuLude_Gardens/IDs"); +require("scripts/globals/keyitems"); +require("scripts/globals/missions"); +----------------------------------- + +function onTrade(player,npc,trade) +end; + +function onTrigger(player,npc) + pNation = player:getNation(); + currentMission = player:getCurrentMission(pNation); + MissionStatus = player:getVar("MissionStatus"); + + if (currentMission == dsp.mission.id.bastok.JEUNO and MissionStatus == 4) then + player:startEvent(38); + elseif (player:getRank() == 4 and MissionStatus == 0 and player:getCurrentMission(BASTOK) == dsp.mission.id.bastok.NONE and getMissionRankPoints(player,13) == 1) then + if (player:hasKeyItem(dsp.ki.ARCHDUCAL_AUDIENCE_PERMIT)) then + player:startEvent(129,1); + else + player:startEvent(129); + end + elseif (player:getRank() >= 4) then + player:messageSpecial(ID.text.EMBASSY_DOOR_RESTRICTION); -- restricted area + else + player:messageSpecial(ID.text.EMBASSY_DOOR_NO_LETTER); -- you have no letter of introduction + end + + return 1; + +end; + +function onEventUpdate(player,csid,option) +end; + +function onEventFinish(player,csid,option) + + if (csid == 38) then + finishMissionTimeline(player,1,csid,option); + elseif (csid == 129 and option == 1) then + player:setVar("MissionStatus",1); + if (player:hasKeyItem(dsp.ki.ARCHDUCAL_AUDIENCE_PERMIT) == false) then + player:addKeyItem(dsp.ki.ARCHDUCAL_AUDIENCE_PERMIT); + player:messageSpecial(ID.text.KEYITEM_OBTAINED,dsp.ki.ARCHDUCAL_AUDIENCE_PERMIT); + end + end + +end; \ No newline at end of file diff --git a/scripts/zones/RuLude_Gardens/npcs/_6r5.lua b/scripts/zones/RuLude_Gardens/npcs/_6r5.lua new file mode 100644 index 00000000000..93162ac6ae1 --- /dev/null +++ b/scripts/zones/RuLude_Gardens/npcs/_6r5.lua @@ -0,0 +1,53 @@ +----------------------------------- +-- Area: Ru'Lud Gardens +-- Door: Sandorian Ambassador +-- Sandoria Missions 3.3 "Appointment to Jeuno" and 4.1 "Magicite" +-- !pos 32 9 -63 243 +----------------------------------- +local ID = require("scripts/zones/RuLude_Gardens/IDs"); +require("scripts/globals/keyitems"); +require("scripts/globals/missions"); +----------------------------------- + +function onTrade(player,npc,trade) +end; + +function onTrigger(player,npc) + pNation = player:getNation(); + currentMission = player:getCurrentMission(pNation); + MissionStatus = player:getVar("MissionStatus"); + + if (currentMission == dsp.mission.id.sandoria.APPOINTMENT_TO_JEUNO and MissionStatus == 5) then + player:startEvent(39); + elseif (player:getRank() == 4 and MissionStatus == 0 and player:getCurrentMission(SANDORIA) == dsp.mission.id.sandoria.NONE and getMissionRankPoints(player,13) == 1) then + if (player:hasKeyItem(dsp.ki.ARCHDUCAL_AUDIENCE_PERMIT)) then + player:startEvent(130,1); + else + player:startEvent(130); + end + elseif (player:getRank() >= 4) then + player:messageSpecial(ID.text.EMBASSY_DOOR_RESTRICTION); -- restricted area + else + player:messageSpecial(ID.text.EMBASSY_DOOR_NO_LETTER); -- you have no letter of introduction + end + + return 1; + +end; + +function onEventUpdate(player,csid,option) +end; + +function onEventFinish(player,csid,option) + + if (csid == 39) then + finishMissionTimeline(player,1,csid,option); + elseif csid == 130 and option == 1 then + player:setVar("MissionStatus",1) + if player:hasKeyItem(dsp.ki.ARCHDUCAL_AUDIENCE_PERMIT) == false then + player:addKeyItem(dsp.ki.ARCHDUCAL_AUDIENCE_PERMIT) + player:messageSpecial(ID.text.KEYITEM_OBTAINED, dsp.ki.ARCHDUCAL_AUDIENCE_PERMIT) + end + end + +end; \ No newline at end of file diff --git a/scripts/zones/RuLude_Gardens/npcs/_6r8.lua b/scripts/zones/RuLude_Gardens/npcs/_6r8.lua index b7a97b6996c..c1e8f8d19d2 100644 --- a/scripts/zones/RuLude_Gardens/npcs/_6r8.lua +++ b/scripts/zones/RuLude_Gardens/npcs/_6r8.lua @@ -26,9 +26,9 @@ function onTrigger(player,npc) player:startEvent(131); end elseif (player:getRank() >= 4) then - player:messageSpecial(ID.text.WINDURST_EMBASSY); -- restricted area + player:messageSpecial(ID.text.EMBASSY_DOOR_RESTRICTION); -- restricted area else - player:messageSpecial(ID.text.WINDURST_EMBASSY + 1); -- you have no letter of introduction + player:messageSpecial(ID.text.EMBASSY_DOOR_NO_LETTER); -- you have no letter of introduction end return 1; @@ -48,8 +48,6 @@ function onEventFinish(player,csid,option) player:addKeyItem(dsp.ki.ARCHDUCAL_AUDIENCE_PERMIT); player:messageSpecial(ID.text.KEYITEM_OBTAINED,dsp.ki.ARCHDUCAL_AUDIENCE_PERMIT); end - elseif (csid == 38 or csid == 35) then - finishMissionTimeline(player,1,csid,option); end end; \ No newline at end of file