Index: zones/Bastok_Markets/npcs/Horatius.lua =================================================================== --- zones/Bastok_Markets/npcs/Horatius.lua (revision 1711) +++ 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: zones/Dangruf_Wadi/npcs/qm2.lua =================================================================== --- zones/Dangruf_Wadi/npcs/qm2.lua (revision 0) +++ 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: zones/Northern_San_dOria/npcs/Vamorcote.lua =================================================================== --- zones/Northern_San_dOria/npcs/Vamorcote.lua (revision 1711) +++ 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;