Index: scripts/zones/Metalworks/npcs/Izabele.lua =================================================================== --- scripts/zones/Metalworks/npcs/Izabele.lua (revision 3100) +++ scripts/zones/Metalworks/npcs/Izabele.lua (working copy) @@ -1,11 +1,13 @@ ----------------------------------- -- Area: Metalworks -- NPC: Izabele --- Standard Info NPC +-- Type: Quest Giver +-- Involved in Quest: The Gustaberg Tour ----------------------------------- package.loaded["scripts/zones/Metalworks/TextIDs"] = nil; require("scripts/zones/Metalworks/TextIDs"); +require("scripts/globals/quests"); ----------------------------------- -- onTrade Action @@ -19,7 +21,14 @@ ----------------------------------- function onTrigger(player,npc) -player:startEvent(0x02E9); + local TheGustabergTour = player:getQuestStatus(BASTOK,THE_GUSTABERG_TOUR); + if (TheGustabergTour == QUEST_AVAILABLE) then + player:startEvent(0x02E9); + elseif (TheGustabergTour == QUEST_ACCEPTED) then + player:startEvent(0x02ea); + else + player:startEvent(0x02eb); -- final dialog; after quest is complete + end end; ----------------------------------- @@ -38,6 +47,9 @@ function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); + if (csid == 0x02E9) then + player:addQuest(BASTOK, THE_GUSTABERG_TOUR); + end end; Index: scripts/zones/North_Gustaberg/npcs/Hunting_Bear.lua =================================================================== --- scripts/zones/North_Gustaberg/npcs/Hunting_Bear.lua (revision 3100) +++ scripts/zones/North_Gustaberg/npcs/Hunting_Bear.lua (working copy) @@ -2,12 +2,16 @@ -- Area: North Gustaberg -- NPC: Hunting Bear -- Type: NPC Quest +-- Involved in Quest: The Gustaberg Tour -- @zone: 106 -- @pos: -232.415 40.465 426.495 -- -- Auto-Script: Requires Verification (Verified by Brawndo) ----------------------------------- package.loaded["scripts/zones/North_Gustaberg/TextIDs"] = nil; +require("scripts/zones/North_Gustaberg/TextIDs"); +require("scripts/globals/quests"); +require("scripts/globals/titles"); ----------------------------------- ----------------------------------- @@ -22,7 +26,32 @@ ----------------------------------- function onTrigger(player,npc) - player:startEvent(0x0014); + local TheGustabergTour = player:getQuestStatus(BASTOK, THE_GUSTABERG_TOUR); + if (TheGustabergTour == QUEST_COMPLETED) then + player:startEvent(0x0017); -- final dialog if quest complete + elseif (TheGustabergTour == QUEST_ACCEPTED) then + if (player:getPartySize() == 6) then + --nil if player is not in party; this works fine + --check that all player's levels are <= 5 (or actually just < 6) + --also check that they are in zone + local questreq = true; + local pmemb; + for pmemb = 0, 5, 1 do + local memb = player:getPartyMember(pmemb, 0); + questreq = questreq and (memb:getMainLvl() < 6 and memb:getZone() == 106); -- North Gustaberg is 106 pre-Adoulin, at least + end + + if (questreq) then + player:startEvent(0x0016); + else + player:startEvent(0x0015); + end + else + player:startEvent(0x0015); + end + else + player:startEvent(0x0014); + end end; ----------------------------------- @@ -41,5 +70,12 @@ function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); + if (csid == 0x0016) then + player:addGil(GIL_RATE*500); + player:messageSpecial(GIL_OBTAINED,GIL_RATE*500); + player:addFame(BASTOK,BAS_FAME*30); + player:completeQuest(BASTOK,THE_GUSTABERG_TOUR); + player:addTitle(GUSTABERG_TOURIST); + end end;