Index: scripts/globals/quests.lua =================================================================== --- scripts/globals/quests.lua (revision 1711) +++ scripts/globals/quests.lua (working copy) @@ -60,7 +60,7 @@ TRIAL_BY_ICE = 59; -- + -- THE_GENERAL_S_SECRET = 60; -- ± -- THE_RUMOR = 61; -- ± -- -HER_MAKESTY_S_GARDEN = 62; +HER_MAKESTY_S_GARDEN = 62; -- ± -- INGRODUCTION_TO_TEAMWORK = 63; INTERMEDIATE_TEAMWORK = 64; ADVANCED_TEAMWORK = 65; @@ -70,7 +70,7 @@ THE_MERCHANT_S_BIDDING = 69; -- ± -- UNEXPECTED_TREASURE = 70; BLACKMAIL = 71; -THE_SETTING_SUN = 72; +THE_SETTING_SUN = 72; -- ± -- DISTANT_LOYALTIES = 74; THE_RIVALRY = 75; -- ± -- @@ -131,7 +131,7 @@ THE_ELEVENTH_S_HOUR = 7; -- ± -- SHADY_BUSINESS = 8; -- ± -- A_FOREMAN_S_BEST_FRIEND = 9; -- ± -- -BREAKING_STONES = 10; +BREAKING_STONES = 10; -- ± -- THE_COLD_LIGHT_OF_DAY = 11; GOURMET = 12; -- ± -- THE_ELVAAN_GOLDSMITH = 13; -- ± -- @@ -145,7 +145,7 @@ MOM_THE_ADVENTURER = 21; THE_SIGNPOST_MARKS_THE_SPOT = 22; PAST_PERFECT = 23; -- ± -- -STARDUST = 24; +STARDUST = 24; -- ± -- MEAN_MACHINE = 25; -- ± -- CID_S_SECRET = 26; -- ± -- THE_USUAL = 27; -- ± -- Index: scripts/zones/Bastok_Markets/npcs/Horatius.lua =================================================================== --- scripts/zones/Bastok_Markets/npcs/Horatius.lua (revision 1711) +++ scripts/zones/Bastok_Markets/npcs/Horatius.lua (working copy) @@ -12,12 +12,33 @@ package.loaded["scripts/zones/Bastok_Markets/TextIDs"] = nil; require("scripts/zones/Bastok_Markets/TextIDs"); +require("scripts/globals/quests"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) + breakingStones = player:getQuestStatus(BASTOK,BREAKING_STONES); + + if (breakingStones == QUEST_ACCEPTED) then + count = trade:getItemCount(); + DangrufStone = trade:hasItemQty(553,1); + + if (DangrufStone == true and count == 1) then + player:startEvent(0x0065); + player:tradeComplete(); + end + elseif (breakingStones == QUEST_COMPLETED) then + count = trade:getItemCount(); + DangrufStone = trade:hasItemQty(553,1); + + if (DangrufStone == true and count == 1) then + player:startEvent(0x0065); + player:tradeComplete(); + end + end + end; ----------------------------------- @@ -25,7 +46,13 @@ ----------------------------------- function onTrigger(player,npc) - player:startEvent(0x006e); + breakingStones = player:getQuestStatus(BASTOK,BREAKING_STONES); + + if (breakingStones == QUEST_AVAILABLE) then + player:startEvent(0x0064); + else + player:startEvent(0x006e); + end end; ----------------------------------- @@ -42,7 +69,20 @@ ----------------------------------- function onEventFinish(player,csid,option) - -- printf("CSID: %u",csid); - -- printf("RESULT: %u",option); + --printf("CSID: %u",csid); + --printf("RESULT: %u",option); + + if (csid == 100 and option == 0) then + player:addQuest(BASTOK,BREAKING_STONES); + end + if (csid == 0x0065) then + --player:completeQuest(BASTOK,BREAKING_STONES); + player:messageSpecial(GIL_OBTAINED,400); + player:addGil(400); + elseif (csid == 0x0065 and player:getQuestStatus(BASTOK,BREAKING_STONES) == QUEST_COMPLETED) then + player:messageSpecial(GIL_OBTAINED,400); + player:addGil(400); + end + end; Index: scripts/zones/Chateau_dOraguille/npcs/Chalvatot.lua =================================================================== --- scripts/zones/Chateau_dOraguille/npcs/Chalvatot.lua (revision 1711) +++ scripts/zones/Chateau_dOraguille/npcs/Chalvatot.lua (working copy) @@ -17,11 +17,23 @@ ----------------------------------- function onTrade(player,npc,trade) + herMajestysGarden = player:getQuestStatus(SANDORIA,HER_MAKESTY_S_GARDEN); if(player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE) == QUEST_ACCEPTED) then if(trade:hasItemQty(532,1) and trade:getItemCount() == 1) then -- Trade Magicmart_flyer player:messageSpecial(FLYER_REFUSED); end + elseif (herMajestysGarden == QUEST_ACCEPTED and player:getFameLevel(SANDORIA) >= 4) then + count = trade:getItemCount(); + DurflandHumus = trade:hasItemQty(533,1); + if (DurflandHumus == true and count == 1) then + if (player:getFreeSlotsCount() == 0) then + player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,390) + else + player:tradeComplete(); + player:startEvent(0x0053); + end + end end end; @@ -58,9 +70,14 @@ ----------------------------------- function onTrigger(player,npc) + herMajestysGarden = player:getQuestStatus(SANDORIA,HER_MAKESTY_S_GARDEN); if(player:getQuestStatus(SANDORIA,LURE_OF_THE_WILDCAT_SAN_D_ORIA) == QUEST_ACCEPTED and alreadyCheckedNPC(player,20) == false) then player:startEvent(0x0231); + elseif (herMajestysGarden == QUEST_AVAILABLE) then + player:startEvent(0x0054); + elseif (herMajestysGarden == QUEST_ACCEPTED) then + player:startEvent(0x0052); elseif(player:getCurrentMission(SANDORIA) == THE_CRYSTAL_SPRING and player:getVar("MissionStatus") == 3) then player:startEvent(0x022c); else @@ -83,13 +100,21 @@ ----------------------------------- function onEventFinish(player,csid,option) ---printf("CSID: %u",csid); ---printf("RESULT: %u",option); +printf("CSID: %u",csid); +printf("RESULT: %u",option); if(csid == 0x022c) then finishMissionTimeline(player,3,csid,option); elseif(csid == 0x0231) then player:setVar("wildcatSandy_var",player:getVar("wildcatSandy_var") + 524288); + elseif (csid == 0x0054 and option == 1) then + player:addQuest(SANDORIA,HER_MAKESTY_S_GARDEN); + elseif (csid == 0x0053) then + if (player:getFreeSlotsCount() ~= 0) then + player:completeQuest(SANDORIA,HER_MAKESTY_S_GARDEN); + player:addKeyItem(390); + player:messageSpecial(KEYITEM_OBTAINED,390); + end end end; \ No newline at end of file Index: scripts/zones/Dangruf_Wadi/npcs/qm2.lua =================================================================== --- scripts/zones/Dangruf_Wadi/npcs/qm2.lua (revision 0) +++ scripts/zones/Dangruf_Wadi/npcs/qm2.lua (working copy) @@ -0,0 +1,65 @@ +----------------------------------- +-- Area: Bastok Markets +-- NPC: ??? (QM2) +-- Type: Item Giver +-- @zone: 191 +-- @pos: -120.041 2.621 415.989 +-- +-- Starts and Finishes: Breaking Stones +-- +-- Auto-Script: Requires Verification. Verfied standard dialog - thrydwolf 12/8/2011 +-- Only spawns if the weather is SUNNY +----------------------------------- + +package.loaded["scripts/zones/Dangruf_Wadi/TextIDs"] = nil; +require("scripts/zones/Dangruf_Wadi/TextIDs"); +require("scripts/globals/quests"); + +----------------------------------- +-- onTrade Action +----------------------------------- + +function onTrade(player,npc,trade) +end; + +----------------------------------- +-- onTrigger Action +----------------------------------- + +function onTrigger(player,npc) + breakingStones = player:getQuestStatus(BASTOK,BREAKING_STONES); + + if (breakingStones == QUEST_ACCEPTED) then + player:startEvent(0x006E); + 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); + + DangrufStone = player:hasItem(553); + + if (csid == 0x006E and option == 0) then + if (DangrufStone ~= true) then + player:addItem(553,1); + player:messageSpecial(ITEM_OBTAINED,553); + else + player:addItem(553,1); + end + end +end; + Index: scripts/zones/Metalworks/npcs/Baldric.lua =================================================================== --- scripts/zones/Metalworks/npcs/Baldric.lua (revision 1711) +++ scripts/zones/Metalworks/npcs/Baldric.lua (working copy) @@ -16,6 +16,26 @@ ----------------------------------- function onTrade(player,npc,trade) + starDust = player:getQuestStatus(BASTOK,STARDUST); + + if (starDust == QUEST_ACCEPTED) then + count = trade:getItemCount(); + sunSand = trade:hasItemQty(503,1); + + if (sunSand == true and count == 1) then + player:tradeComplete(); + player:startEvent(0x022B); + end + elseif (starDust == QUEST_COMPLETED) then + count = trade:getItemCount(); + sunSand = trade:hasItemQty(503,1); + + if (sunSand == true and count == 1) then + player:tradeComplete(); + player:startEvent(0x022B); + end + end + end; ----------------------------------- @@ -23,7 +43,14 @@ ----------------------------------- function onTrigger(player,npc) - player:startEvent(0x0228); + starDust = player:getQuestStatus(BASTOK,STARDUST); + + if (starDust == QUEST_AVAILABLE and player:getFameLevel(BASTOK) >= 2) then + player:startEvent(0x022A); + player:addQuest(BASTOK,STARDUST); + else + player:startEvent(0x0228); + end end; ----------------------------------- @@ -40,7 +67,17 @@ ----------------------------------- function onEventFinish(player,csid,option) - -- printf("CSID: %u",csid); - -- printf("RESULT: %u",option); + --printf("CSID: %u",csid); + --printf("RESULT: %u",option); + + if (csid == 0x022B) then + if (starDust == QUEST_ACCEPTED) then + player:completeQuest(BASTOK,STARDUST); + end + player:messageSpecial(GIL_OBTAINED,GIL_RATE*300); + player:addGil(300); + end + + end; Index: scripts/zones/Northern_San_dOria/npcs/Maloquedil.lua =================================================================== --- scripts/zones/Northern_San_dOria/npcs/Maloquedil.lua (revision 1711) +++ scripts/zones/Northern_San_dOria/npcs/Maloquedil.lua (working copy) @@ -20,6 +20,7 @@ ----------------------------------- function onTrade(player,npc,trade) + wardingVampires = player:getQuestStatus(SANDORIA,WARDING_VAMPIRES); if(player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE) == QUEST_ACCEPTED) then if(trade:hasItemQty(532,1) and trade:getItemCount() == 1) then -- Trade Magicmart Flyer @@ -27,10 +28,22 @@ end end - if(player:getQuestStatus(SANDORIA,MIRROR_MIRROR) == QUEST_COMPLETED or player:getVar("QuestVampireVar") == 1) then - if(trade:hasItemQty(1018,2) and trade:getItemCount() == 2) then -- Trade Shaman Garlic + if(wardingVampires == QUEST_ACCEPTED) then + count = trade:getItemCount(); + garlicBulb = trade:hasItemQty(1018,2); + + if (garlicBulb == true) then + player:tradeComplete(); player:startEvent(0x0017); end + elseif (wardingVampires == QUEST_COMPLETED) then + count = trade:getItemCount(); + garlicBulb = trade:hasItemQty(1018,2); + + if (garlicBulb == true) then + player:tradeComplete(); + player:startEvent(0x0017); + end end if(player:getQuestStatus(JEUNO,RIDING_ON_THE_CLOUDS) == QUEST_ACCEPTED and player:getVar("ridingOnTheClouds_1") == 4) then @@ -49,19 +62,14 @@ ----------------------------------- function onTrigger(player,npc) - - mirrorMirror = player:getQuestStatus(SANDORIA,MIRROR_MIRROR); - - if(mirrorMirror == QUEST_AVAILABLE and player:getFameLevel(SANDORIA) >= 3) then + wardingVampires = player:getQuestStatus(SANDORIA,WARDING_VAMPIRES); + + if (wardingVampires == QUEST_AVAILABLE) then player:startEvent(0x0018); - elseif(player:getVar("QuestVampireVar") == 1) then + elseif (wardingVampires == QUEST_ACCEPTED) then player:startEvent(0x0016); - elseif(mirrorMirror == QUEST_COMPLETED) then - player:startEvent(0x0016); - else - player:startEvent(0x0015); - end - + end + end; ----------------------------------- @@ -81,24 +89,18 @@ --printf("CSID: %u",csid); --printf("RESULT: %u",option); - if(csid == 0x0018 and option == 1) then - player:addQuest(SANDORIA,MIRROR_MIRROR); - player:setVar("QuestVampireVar",1); - elseif(csid == 0x0017) then - if(player:getVar("QuestVampireVar") == 1) then - player:tradeComplete(); - player:setTitle(43); - player:addGil(GIL_RATE*900); - player:messageSpecial(GIL_OBTAINED,GIL_RATE*900); - player:setVar("QuestVampireVar",0); - player:addFame(SANDORIA,SAN_FAME*30); - player:completeQuest(SANDORIA,MIRROR_MIRROR); - else - player:tradeComplete(); - player:addGil(GIL_RATE*900); - player:messageSpecial(GIL_OBTAINED,GIL_RATE*900); - player:addFame(SANDORIA,SAN_FAME*5); - end + if (csid == 0x0018 and option == 1) then + player:addQuest(SANDORIA,WARDING_VAMPIRES); end + if (csid == 0x0017 and player:getQuestStatus(SANDORIA,WARDING_VAMPIRES) == QUEST_COMPLETED) then + player:addGil(900); + player:messageSpecial(GIL_OBTAINED,900); + else + player:completeQuest(SANDORIA,WARDING_VAMPIRES); + player:setTitle(VAMPIRE_HUNTER_DMINUS); + player:addGil(900); + player:messageSpecial(GIL_OBTAINED,900); + end + end; \ No newline at end of file Index: scripts/zones/Northern_San_dOria/npcs/Vamorcote.lua =================================================================== --- scripts/zones/Northern_San_dOria/npcs/Vamorcote.lua (revision 1711) +++ scripts/zones/Northern_San_dOria/npcs/Vamorcote.lua (working copy) @@ -8,6 +8,7 @@ -- Auto-Script: Requires Verification (Verified by Brawndo) ----------------------------------- package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil; +require("scripts/globals/quests"); ----------------------------------- ----------------------------------- @@ -15,6 +16,19 @@ ----------------------------------- function onTrade(player,npc,trade) + theSettingSun = player:getQuestStatus(SANDORIA,THE_SETTING_SUN); + + if (theSettingSun == QUEST_ACCEPTED) then + count = trade:getItemCount(); + EngravedKey = trade:hasItemQty(535,1); + + if (EngravedKey == true and count == 1) then + player:tradeComplete(); + player:startEvent(0x0292); + end + end + + end; ----------------------------------- @@ -22,7 +36,17 @@ ----------------------------------- function onTrigger(player,npc) - player:startEvent(0x028b); + theSettingSun = player:getQuestStatus(SANDORIA,THE_SETTING_SUN); + + if (theSettingSun == QUEST_AVAILABLE) then + player:startEvent(0x028E,0,535,535); -- For some reason, I needed to pass 0 and two 535's for the text in the event to fill out correctly or it would be blank + elseif (theSettingSun == QUEST_ACCEPTED) then + player:startEvent(0x028F); + else + player:startEvent(0x028B); + end + + end; ----------------------------------- @@ -41,5 +65,17 @@ function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); + + if (csid == 0x028E and option == 2) then + player:addQuest(SANDORIA,THE_SETTING_SUN); + end + + if (csid == 0x0292) then + player:addFame(SANDORIA,SAN_FAME*30); + player:messageSpecial(GIL_OBTAINED,10000); + player:addGil(10000); + player:completeQuest(SANDORIA,THE_SETTING_SUN); + end + end;