Index: npcs/Cacaroon.lua =================================================================== --- npcs/Cacaroon.lua (revision 3296) +++ npcs/Cacaroon.lua (working copy) @@ -13,8 +13,13 @@ ----------------------------------- function onTrade(player,npc,trade) - - if(player:getQuestStatus(AHT_URHGAN,RAT_RACE) == QUEST_ACCEPTED and player:getVar("ratraceCS") == 2) then + + if (player:getVar("TOAUM4") == 1)then + if((trade:getGil() == 1000 and trade:getItemCount() == 1) or(trade:hasItemQty(2184,1) and trade:getItemCount() == 1))then + player:startEvent(0x0bce,0,0,0,0,0,0,0,0,0); + return cs; + end + elseif(player:getQuestStatus(AHT_URHGAN,RAT_RACE) == QUEST_ACCEPTED and player:getVar("ratraceCS") == 2) then if(trade:hasItemQty(2184,1) and trade:getItemCount() == 1) then player:startEvent(0x0352); end @@ -27,8 +32,16 @@ function onTrigger(player,npc) printf("Prog = %u",player:getVar("ratraceCS")); - if(player:getVar("ratraceCS") == 2) then + + if(player:getCurrentMission(TOAU) == KNIGHT_OF_GOLD and player:getVar("TOAUM4") == 0)then + player:startEvent(0x0Bdb,0,0,0,0,0,0,0,0,0); + return cs; + elseif (player:getVar("TOAUM4") == 1)then + player:startEvent(0x0Bdc,0,0,0,0,0,0,0,0,0); + elseif(player:getVar("ratraceCS") == 2) then player:startEvent(0x0355); + + elseif(player:getVar("ratraceCS") >= 3) then player:startEvent(0x0356); else @@ -50,11 +63,16 @@ ----------------------------------- function onEventFinish(player,csid,option) ---printf("CSID: %u",csid); ---printf("RESULT: %u",option); +printf("CSID: %u",csid); +printf("RESULT: %u",option); if(csid == 0x0352) then player:tradeComplete(); player:setVar("ratraceCS",3); + + elseif(csid == 0x0bdb and option == 1) then + player:setVar("TOAUM4",1); + elseif(csid == 0x0bce)then + player:setVar("TOAUM4",2); end end; Index: npcs/Naja_Salaheem.lua =================================================================== --- npcs/Naja_Salaheem.lua (revision 3296) +++ npcs/Naja_Salaheem.lua (working copy) @@ -1,45 +1,106 @@ ------------------------------------ --- Area: Aht Urhgan Whitegate --- NPC: Naja Salaheem --- Type: Standard NPC --- @zone: 50 --- @pos: 22.700 -8.804 -45.591 --- --- Auto-Script: Requires Verification (Verified by Brawndo) ------------------------------------ -package.loaded["scripts/zones/Aht_Urhgan_Whitegate/TextIDs"] = nil; ------------------------------------ - ------------------------------------ --- onTrade Action ------------------------------------ - -function onTrade(player,npc,trade) -end; - ------------------------------------ --- onTrigger Action ------------------------------------ - -function onTrigger(player,npc) - player:startEvent(0x13c3); -end; - ------------------------------------ --- onEventUpdate ------------------------------------ - -function onEventUpdate(player,csid,option) - -- printf("CSID: %u",csid); - -- printf("RESULT: %u",option); -end; - ------------------------------------ --- onEventFinish ------------------------------------ - -function onEventFinish(player,csid,option) - -- printf("CSID: %u",csid); - -- printf("RESULT: %u",option); -end; - +----------------------------------- +-- Area: Aht Urhgan Whitegate +-- NPC: Naja Salaheem +-- Type: Standard NPC +-- @zone: 50 +-- @pos: 22.700 -8.804 -45.591 +-- +-- Auto-Script: Requires Verification (Verified by Brawndo) +----------------------------------- +package.loaded["scripts/zones/Aht_Urhgan_Whitegate/TextIDs"] = nil; +require("scripts/globals/missions"); +require("scripts/zones/Aht_Urhgan_Whitegate/TextIDs"); +require("scripts/globals/titles"); +require("scripts/globals/keyitems"); +require("scripts/globals/settings"); + + +----------------------------------- + +----------------------------------- +-- onTrade Action +----------------------------------- + +function onTrade(player,npc,trade) +end; + +----------------------------------- +-- onTrigger Action +----------------------------------- + +function onTrigger(player,npc) +if(player:getCurrentMission(TOAU) == IMMORTAL_SENTRIES and player:getVar("TOAUM2") == 1) then +player:startEvent(0x0BBA,0,0,0,0,0,0,0,0,0); + +elseif(player:getCurrentMission(TOAU) == PRESIDENT_SALAHEEM and player:getVar("TOAUM3") == 1)then +player:startEvent(0x0049,0,0,0,0,0,0,0,0,0); +player:setVar("TOAUM3",2); + +elseif(player:getCurrentMission(TOAU) == PRESIDENT_SALAHEEM and player:getVar("TOAUM3") == 2)then +player:startEvent(0x0bcc,0,0,0,0,0,0,0,0,0); + +elseif(player:getCurrentMission(TOAU) == KNIGHT_OF_GOLD and player:getVar("TOAUM4") == 0)then +player:startEvent(0x0Bcd,0,0,0,0,0,0,0,0,0); + +elseif(player:getCurrentMission(TOAU) == WESTERLY_WINDS and player:getVar("TOAUM7") == 1)then +player:startEvent(0x0Bd4,0,0,0,0,0,0,0,0,0); +elseif(player:getCurrentMission(TOAU) == UNDERSEA_SCOUTING)then +player:startEvent(0x0beb,0,0,0,0,0,0,0,0,0); +elseif(player:getCurrentMission(TOAU) == ASTRAL_WAVES)then +player:startEvent(0x0bec,0,0,0,0,0,0,0,0,0); +elseif(player:getCurrentMission(TOAU) == IMPERIAL_SCHEMES)then +player:startEvent(0x0bfe,0,0,0,0,0,0,0,0,0); +elseif(player:getCurrentMission(TOAU) == ROYAL_PUPPETEER)then +player:startEvent(0x0bff,0,0,0,0,0,0,0,0,0); +elseif(player:getCurrentMission(TOAU) == THE_DOLPHIN_CREST)then +player:startEvent(0x0c00,0,0,0,0,0,0,0,0,0); +elseif(player:getCurrentMission(TOAU) == THE_BLACK_COFFIN)then +player:startEvent(0x0c01,0,0,0,0,0,0,0,0,0); +else +player:startEvent(0x0bbb,1,0,0,0,0,0,0,1,0); +end +end; + +----------------------------------- +-- onEventUpdate +----------------------------------- + +function onEventUpdate(player,csid,option) + -- printf("CSID: %u",csid); + -- printf("RESULT: %u",option); +end; + +----------------------------------- +-- onEventFinish +----------------------------------- + +function onEventFinish(player,csid,option) +printf("CSID: %u",csid); +printf("RESULT: %u",option); + +if(csid == 0x0BBA)then +player:setVar("TOAUM2",0); +player:completeMission(TOAU,IMMORTAL_SENTRIES); +player:addMission(TOAU,PRESIDENT_SALAHEEM); +elseif(csid == 0x0Bcc)then +player:completeMission(TOAU,PRESIDENT_SALAHEEM); +player:addMission(TOAU,KNIGHT_OF_GOLD); +player:setVar("TOAUM3",0); +elseif(csid == 0x0bd4)then +player:setVar("TOAUM7",0); +player:completeMission(TOAU,WESTERLY_WINDS); +player:addItem(2185,1); +player:messageSpecial(ITEM_OBTAINED,2185); +player:addMission(TOAU,A_MERCENARY_LIFE); +elseif(csid == 0x0bec)then +player:completeMission(TOAU,ASTRAL_WAVES); +player:addMission(TOAU,IMPERIAL_SCHEMES); +elseif(csid == 0x0bfe)then +player:completeMission(TOAU,IMPERIAL_SCHEMES); +player:addMission(TOAU,ROYAL_PUPPETEER); +elseif(csid == 0x0c00)then +player:completeMission(TOAU,THE_DOLPHIN_CREST); +player:addMission(TOAU,THE_BLACK_COFFIN); +end +end; + Index: Zone.lua =================================================================== --- Zone.lua (revision 3296) +++ Zone.lua (working copy) @@ -7,6 +7,9 @@ package.loaded["scripts/zones/Aht_Urhgan_Whitegate/TextIDs"] = nil; require("scripts/globals/settings"); require("scripts/zones/Aht_Urhgan_Whitegate/TextIDs"); +require("scripts/globals/titles"); +require("scripts/globals/keyitems"); +require("scripts/globals/missions"); ----------------------------------- -- onInitialize @@ -15,6 +18,10 @@ function onInitialize(zone) zone:registerRegion(1,57,-1,-70,62,1,-65); -- Sets Mark for "Got It All" Quest cutscene. zone:registerRegion(2,-96,-7,121,-64,-5,137); -- Sets Mark for "Vanishing Act" Quest cutscene. + + zone:registerRegion(3,14,-7,-65,37,-2,-41); + zone:registerRegion(4,75,-3,25,90,1,59); + zone:registerRegion(5,73,-7,-137,95,-3,-115); end; ----------------------------------- @@ -58,6 +65,28 @@ player:startEvent(0x002c); end end, + [3] = function (x) -- AH mission + if(player:getCurrentMission(TOAU)== LAND_OF_SACRED_SERPENTS) then player:startEvent(0x0BB8,0,0,0,0,0,0,0,0,0); + elseif(player:getCurrentMission(TOAU) == A_MERCENARY_LIFE) then + if(prevZone ~= 50)then + player:startEvent(0x0Bea,3,3,3,3,3,3,3,3,0); + end + end + end, + + [4] = function (x) -- AH mission + if(player:getCurrentMission(TOAU)== KNIGHT_OF_GOLD and player:getVar("TOAUM4") == 2) then player:startEvent(0x0Bd0,0,0,0,0,0,0,0,0,0); + end + end, + + [5] = function (x) -- AH mission + if(player:getCurrentMission(TOAU)== KNIGHT_OF_GOLD and player:getVar("TOAUM4") == 3) then player:startEvent(0x0Bd2,0,0,0,0,0,0,0,0,0); + elseif(player:getCurrentMission(TOAU) == WESTERLY_WINDS and player:getVar("TOAUM7") == 0)then + player:startEvent(0x0BD3,0,0,0,0,0,0,0,0,0); + end + end, + + } end; @@ -73,6 +102,7 @@ ----------------------------------- function onTransportEvent(player,transport) +printf("transport: %u",transport); if ((transport == 46) or (transport == 47)) then player:startEvent(0x00c8); elseif (transport == 58) or (transport == 59) then @@ -84,9 +114,10 @@ -- onEventUpdate ----------------------------------- -function onEventUpdate(player,csid,option) ---printf("CSID: %u",csid); ---printf("RESULT: %u",option); +function onEventUpdate(player,csid,option) +printf("transport: %u",transport); +printf("CSID: %u",csid); +printf("RESULT: %u",option); end; ----------------------------------- @@ -94,21 +125,47 @@ ----------------------------------- function onEventFinish(player,csid,option) ---printf("CSID: %u",csid); ---printf("RESULT: %u",option); - if(csid == 0x00c9)then +printf("CSID: %u",csid); +printf("RESULT: %u",option); +if(csid == 0x00c9)then player:setPos(-11,2,-142,192); - elseif(csid == 0x00cc)then +elseif(csid == 0x00cc)then player:setPos(11,2,142,64); - elseif(csid == 0x00c8) then +elseif(csid == 0x00c8) then player:setPos(0,-2,0,0,47); - elseif(csid == 0x00cb) then +elseif(csid == 0x00cb) then player:setPos(0,-2,0,0,58); - elseif(csid == 0x002c)then +elseif(csid == 0x002c)then player:setVar("vanishingactCS",4); player:setPos(-80,-6,122,5); - elseif(csid == 0x020e)then +elseif(csid == 0x020e)then player:setVar("gotitallCS",6); player:setPos(60,0,-71,38); - end + +elseif(csid == 0x0bd0)then +player:setVar("TOAUM4",3); + +elseif(csid == 0x0bd2)then +player:setVar("TOAUM4",4); +player:addKeyItem(RAILLEFALS_LETTER); +player:messageSpecial(KEYITEM_OBTAINED,RAILLEFALS_LETTER); +player:completeMission(TOAU,KNIGHT_OF_GOLD); +player:addMission(TOAU,CONFESSIONS_OF_ROYALTY); + +elseif(csid == 0x0BB8) then +player:completeMission(TOAU,LAND_OF_SACRED_SERPENTS); +player:addMission(TOAU,IMMORTAL_SENTRIES); +player:addKeyItem(SUPPLIES_PACKAGE); +player:messageSpecial(KEYITEM_OBTAINED,SUPPLIES_PACKAGE); + +elseif(csid ==0x0BD3)then +player:setVar("TOAUM7",1) +player:addKeyItem(RAILLEFALS_NOTE); +player:messageSpecial(KEYITEM_OBTAINED,RAILLEFALS_NOTE); +player:addItem(2185,1); +player:messageSpecial(ITEM_OBTAINED,2185); +elseif(csid == 0x0bea)then +player:completeMission(TOAU,A_MERCENARY_LIFE); +player:addMission(TOAU,UNDERSEA_SCOUTING); +end end;