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/Nadeey.lua =================================================================== --- npcs/Nadeey.lua (revision 3296) +++ npcs/Nadeey.lua (working copy) @@ -16,7 +16,11 @@ ----------------------------------- function onTrigger(player,npc) +if(player:getVar("TOAUM4") == 3)then +player:startEvent(0x0Bd1,0,0,0,0,0,0,0,0,0); +else player:startEvent(0x00FB); +end end; ----------------------------------- Index: npcs/Naja_Salaheem.lua =================================================================== --- npcs/Naja_Salaheem.lua (revision 3296) +++ npcs/Naja_Salaheem.lua (working copy) @@ -1,45 +1,79 @@ ------------------------------------ --- 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); + +if(player:getCurrentMission(TOAU) == KNIGHT_OF_GOLD and player:getVar("TOAUM4") == 0)then +player:startEvent(0x0Bcd,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); +end +end; + Index: npcs/Rytaal.lua =================================================================== --- npcs/Rytaal.lua (revision 3296) +++ npcs/Rytaal.lua (working copy) @@ -1,110 +1,125 @@ ------------------------------------ --- Area: Aht Urhgan Whitegate --- NPC: Rytaal --- Type: Standard NPC --- @zone: 50 --- @pos: 112.002 -1.338 -45.038 --- --- Auto-Script: Requires Verification (Verified by Brawndo) ------------------------------------ -package.loaded["scripts/zones/Aht_Urhgan_Whitegate/TextIDs"] = nil; -require("scripts/globals/keyitems"); -require("scripts/zones/Aht_Urhgan_Whitegate/TextIDs"); ------------------------------------ - ------------------------------------ --- onTrade Action ------------------------------------ - -function onTrade(player,npc,trade) -end; - ------------------------------------ --- onTrigger Action ------------------------------------ - -function onTrigger(player,npc) - local currentday = tonumber(os.date("%j")); - local lastarmyIDtag = player:getVar("TIME_IMPERIAL_ARMY_ID_TAG"); - local currenttagnummber = player:getVar("REMAINING_IMPERIAL_ARMY_ID_TAG"); - local diffday = currentday - lastarmyIDtag ; - local currentassault = player:getCurrentMission(ASSAULT); - local haveimperialIDtag; - - --------------------------------------------------------------------- - if (lastarmyIDtag == 0 )then -- first time you get the tag - player:setVar("REMAINING_IMPERIAL_ARMY_ID_TAG",3); currenttagnummber =3; - player:setVar("TIME_IMPERIAL_ARMY_ID_TAG",currentday); - elseif ( diffday > 0 )then - currenttagnummber = currenttagnummber + diffday ; - if (currenttagnummber > 3)then -- store 3 TAG max - currenttagnummber = 3; - end - player:setVar("REMAINING_IMPERIAL_ARMY_ID_TAG",currenttagnummber); - player:setVar("TIME_IMPERIAL_ARMY_ID_TAG",currentday); - end ---------------------------------------------------------------------------- - - if (player:getMainLvl() >= 50)then - if(player:hasKeyItem(IMPERIAL_ARMY_ID_TAG))then - haveimperialIDtag = 1; - else - haveimperialIDtag = 0; - end - player:startEvent(0x010C,IMPERIAL_ARMY_ID_TAG,currenttagnummber,currentassault,haveimperialIDtag); - else - player:startEvent(0x010e); - end -end; - - - - - - ------------------------------------ --- onEventUpdate ------------------------------------ - -function onEventUpdate(player,csid,option) - -- printf("CSID: %u",csid); - -- printf("RESULT: %u",option); -end; - ------------------------------------ --- onEventFinish ------------------------------------ - -function onEventFinish(player,csid,option) -local currenttagnummber = player:getVar("REMAINING_IMPERIAL_ARMY_ID_TAG"); -local CurrentAssault = player:getCurrentMission(ASSAULT); - - - - -- printf("CSID: %u",csid); - printf("RESULT: %u",option); - if(csid == 0x010C and option == 1 and player:hasKeyItem(IMPERIAL_ARMY_ID_TAG)==false and currenttagnummber > 0)then - player:addKeyItem(IMPERIAL_ARMY_ID_TAG); - player:messageSpecial(KEYITEM_OBTAINED,IMPERIAL_ARMY_ID_TAG); - player:setVar("REMAINING_IMPERIAL_ARMY_ID_TAG",currenttagnummber - 1); - elseif(csid == 0x010C and option == 2 and player:hasKeyItem(IMPERIAL_ARMY_ID_TAG)==false )then - if(player:hasKeyItem(LEUJAOAM_ASSUALT_ORDERS))then - player:delKeyItem(LEUJAOAM_ASSUALT_ORDERS); - elseif(player:hasKeyItem(MAMMOOL_JA_ASSAULT_ORDERS))then - player:delKeyItem(MAMMOOL_JA_ASSAULT_ORDERS); - elseif(player:hasKeyItem(LEBROS_ASSUALT_ORDERS))then - player:delKeyItem(LEBROS_ASSUALT_ORDERS); - elseif(player:hasKeyItem(PERIQIA_ASSUALT_ORDERS))then - player:delKeyItem(PERIQIA_ASSUALT_ORDERS); - elseif(player:hasKeyItem(ILRUSI_ASSUALT_ORDERS ))then - player:delKeyItem(ILRUSI_ASSUALT_ORDERS); - elseif(player:hasKeyItem(NYZUL_ISLE_ASSAULT_ORDERS))then - player:delKeyItem(NYZUL_ISLE_ASSAULT_ORDERS); - end - player:addKeyItem(IMPERIAL_ARMY_ID_TAG); - player:messageSpecial(KEYITEM_OBTAINED,IMPERIAL_ARMY_ID_TAG); - player:delMission(ASSAULT,CurrentAssault); - end - -end; - +----------------------------------- +-- Area: Aht Urhgan Whitegate +-- NPC: Rytaal +-- Type: Standard NPC +-- @zone: 50 +-- @pos: 112.002 -1.338 -45.038 +-- +-- Auto-Script: Requires Verification (Verified by Brawndo) +----------------------------------- +package.loaded["scripts/zones/Aht_Urhgan_Whitegate/TextIDs"] = nil; +require("scripts/globals/keyitems"); +require("scripts/zones/Aht_Urhgan_Whitegate/TextIDs"); +----------------------------------- + +----------------------------------- +-- onTrade Action +----------------------------------- + +function onTrade(player,npc,trade) +end; + +----------------------------------- +-- onTrigger Action +----------------------------------- + +function onTrigger(player,npc) + local currentday = tonumber(os.date("%j")); + local lastarmyIDtag = player:getVar("TIME_IMPERIAL_ARMY_ID_TAG"); + local currenttagnummber = player:getVar("REMAINING_IMPERIAL_ARMY_ID_TAG"); + local diffday = currentday - lastarmyIDtag ; + local currentassault = player:getCurrentMission(ASSAULT); + local haveimperialIDtag; + + --------------------------------------------------------------------- + if(player:getCurrentMission(TOAU) == PRESIDENT_SALAHEEM and player:getVar("TOAUM3") == 0)then + player:startEvent(0x010D,0,0,0,0,0,0,0,0,0); + elseif(player:getCurrentMission(TOAU) <= IMMORTAL_SENTRIES) + then player:startEvent(0x010E); + elseif(player:getMainLvl() <= 50) + then player:startEvent(0x010E); + + elseif((player:getCurrentMission(TOAU) > PRESIDENT_SALAHEEM) or (player:getCurrentMission(TOAU) == PRESIDENT_SALAHEEM and player:getVar("TOAUM3") ==1))then + + if (lastarmyIDtag == 0 )then -- first time you get the tag + player:setVar("REMAINING_IMPERIAL_ARMY_ID_TAG",3); currenttagnummber =3; + player:setVar("TIME_IMPERIAL_ARMY_ID_TAG",currentday); + elseif ( diffday > 0 )then + currenttagnummber = currenttagnummber + diffday ; + if (currenttagnummber > 3)then -- store 3 TAG max + currenttagnummber = 3; + end + player:setVar("REMAINING_IMPERIAL_ARMY_ID_TAG",currenttagnummber); + player:setVar("TIME_IMPERIAL_ARMY_ID_TAG",currentday); + end +--------------------------------------------------------------------------- + + if (player:getMainLvl() >= 50)then + if(player:hasKeyItem(IMPERIAL_ARMY_ID_TAG))then + haveimperialIDtag = 1; + else + haveimperialIDtag = 0; + end + player:startEvent(0x010C,IMPERIAL_ARMY_ID_TAG,currenttagnummber,currentassault,haveimperialIDtag); + else + player:startEvent(0x010e); + end + end +end; + + + + + + +----------------------------------- +-- onEventUpdate +----------------------------------- + +function onEventUpdate(player,csid,option) + -- printf("CSID: %u",csid); + -- printf("RESULT: %u",option); +end; + +----------------------------------- +-- onEventFinish +----------------------------------- + +function onEventFinish(player,csid,option) +local currenttagnummber = player:getVar("REMAINING_IMPERIAL_ARMY_ID_TAG"); +local CurrentAssault = player:getCurrentMission(ASSAULT); + + + + -- printf("CSID: %u",csid); + printf("RESULT: %u",option); + if(csid == 0x010D)then + player:setVar("TOAUM3",1); + player:addKeyItem(IMPERIAL_ARMY_ID_TAG); + player:messageSpecial(KEYITEM_OBTAINED,IMPERIAL_ARMY_ID_TAG); + elseif(csid == 0x010C and option == 1 and player:hasKeyItem(IMPERIAL_ARMY_ID_TAG)==false and currenttagnummber > 0)then + player:addKeyItem(IMPERIAL_ARMY_ID_TAG); + player:messageSpecial(KEYITEM_OBTAINED,IMPERIAL_ARMY_ID_TAG); + player:setVar("REMAINING_IMPERIAL_ARMY_ID_TAG",currenttagnummber - 1); + elseif(csid == 0x010C and option == 2 and player:hasKeyItem(IMPERIAL_ARMY_ID_TAG)==false )then + if(player:hasKeyItem(LEUJAOAM_ASSUALT_ORDERS))then + player:delKeyItem(LEUJAOAM_ASSUALT_ORDERS); + elseif(player:hasKeyItem(MAMMOOL_JA_ASSAULT_ORDERS))then + player:delKeyItem(MAMMOOL_JA_ASSAULT_ORDERS); + elseif(player:hasKeyItem(LEBROS_ASSUALT_ORDERS))then + player:delKeyItem(LEBROS_ASSUALT_ORDERS); + elseif(player:hasKeyItem(PERIQIA_ASSUALT_ORDERS))then + player:delKeyItem(PERIQIA_ASSUALT_ORDERS); + elseif(player:hasKeyItem(ILRUSI_ASSUALT_ORDERS ))then + player:delKeyItem(ILRUSI_ASSUALT_ORDERS); + elseif(player:hasKeyItem(NYZUL_ISLE_ASSAULT_ORDERS))then + player:delKeyItem(NYZUL_ISLE_ASSAULT_ORDERS); + + end + player:addKeyItem(IMPERIAL_ARMY_ID_TAG); + player:messageSpecial(KEYITEM_OBTAINED,IMPERIAL_ARMY_ID_TAG); + player:delMission(ASSAULT,CurrentAssault); + 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,23 @@ 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); + + 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); + end + end, + + } end; @@ -96,19 +120,35 @@ function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); - if(csid == 0x00c9)then +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); +end end;