Index: scripts/globals/quests.lua =================================================================== --- scripts/globals/quests.lua (revision 1602) +++ scripts/globals/quests.lua (working copy) @@ -49,7 +49,7 @@ TIGER_S_TEETH = 23; -- ± -- -UNDYING_FLAMES = 26; +UNDYING_FLAMES = 26; -- + -- A_PURCHASE_OF_ARMS = 27; -- + -- A_KNIGHT_S_TEST = 29; -- + -- @@ -64,7 +64,7 @@ INGRODUCTION_TO_TEAMWORK = 63; INTERMEDIATE_TEAMWORK = 64; ADVANCED_TEAMWORK = 65; -GRIMY_SIGNPOSTS = 66; +GRIMY_SIGNPOSTS = 66; -- + -- A_JOB_FOR_THE_CONSORTIUM = 67; TROUBLE_AT_THE_SLUICE = 68; -- + -- THE_MERCHANT_S_BIDDING = 69; -- ± -- @@ -76,8 +76,8 @@ THE_RIVALRY = 75; -- ± -- THE_COMPETITION = 76; -- ± -- STARTING_A_FLAME = 77; -- ± -- -FEAR_OF_THE_DARK = 78; -WARDING_VAMPIRES = 79; +FEAR_OF_THE_DARK = 78; -- ± -- +WARDING_VAMPIRES = 79; -- ± -- SLEEPLESS_NIGHTS = 80; -- ± -- LUFET_S_LAKE_SALT = 81; -- ± -- HEALING_THE_LAND = 82; -- ± -- Index: scripts/zones/Jugner_Forest/npcs/Signpost.lua =================================================================== --- scripts/zones/Jugner_Forest/npcs/Signpost.lua (revision 0) +++ scripts/zones/Jugner_Forest/npcs/Signpost.lua (working copy) @@ -0,0 +1,88 @@ +----------------------------------- +-- Area: Jugner Forest +-- NPC: Singpost +-- General Info NPC +------------------------------------- + +require("/scripts/globals/settings"); +package.loaded["/scripts/globals/quests"] = nil; +require("/scripts/globals/quests"); + +----------------------------------- +-- onTrade Action +----------------------------------- + +function onTrade(player,npc,trade) + +end; + +----------------------------------- +-- onTrigger Action +----------------------------------- + +function onTrigger(player,npc) + cleanedSignPost = player:getVar("CleanSignPost"); + + if (npc:getID() == 17203803) then + if (player:getQuestStatus(SANDORIA,GRIMY_SIGNPOSTS) == QUEST_ACCEPTED and (tonumber(cleanedSignPost) % 2 < 1)) then + player:startEvent(0x0006,1); + else + player:startEvent(0x0001); + end + elseif (npc:getID() == 17203804) then + if (player:getQuestStatus(SANDORIA,GRIMY_SIGNPOSTS) == QUEST_ACCEPTED and (tonumber(cleanedSignPost) % 4 < 2)) then + player:startEvent(0x0007,1); + else + player:startEvent(0x0002); + end + elseif (npc:getID() == 17203805) then + if (player:getQuestStatus(SANDORIA,GRIMY_SIGNPOSTS) == QUEST_ACCEPTED and (tonumber(cleanedSignPost) % 8 < 4)) then + player:startEvent(0x0008,1); + else + player:startEvent(0x0003); + end + elseif (npc:getID() == 17203806) then + if (player:getQuestStatus(SANDORIA,GRIMY_SIGNPOSTS) == QUEST_ACCEPTED and (tonumber(cleanedSignPost) % 16 < 8)) then + player:startEvent(0x0009,1); + else + player:startEvent(0x0004); + end + else + printf("Unknown Signpost"); + end + +end; + +----------------------------------- +-- onEventUpdate +----------------------------------- + +function onEventUpdate(player,csid,option) +--printf("CSID: %u",csid); +--printf("RESULT: %u",option); +end; + +----------------------------------- +-- onEventFinish +----------------------------------- + +function onEventFinish(player,csid,option) +printf("fCSID: %u",csid); +printf("fRESULT: %u",option); + + if (option == 1) then + cleanedPost = player:getVar("CleanSignPost"); + if (csid == 6) then + player:setVar("CleanSignPost",cleanedPost + 1); + end + if (csid == 7) then + player:setVar("CleanSignPost",cleanedPost + 2); + end + if (csid == 8) then + player:setVar("CleanSignPost",cleanedPost + 4); + end + if (csid == 9) then + player:setVar("CleanSignPost",cleanedPost + 8); + end + end +end; Index: scripts/zones/Southern_San_dOria/npcs/Maugie.lua =================================================================== --- scripts/zones/Southern_San_dOria/npcs/Maugie.lua (revision 1602) +++ scripts/zones/Southern_San_dOria/npcs/Maugie.lua (working copy) @@ -1,16 +1,16 @@ ----------------------------------- --- Area: Southern San d'Oria --- NPC: Maugie +-- Area: Southern San d'Oria +-- NPC: Maugie -- General Info NPC ------------------------------------- -package.loaded["scripts/zones/Southern_San_dOria/TextIDs"] = nil; ------------------------------------ -require("scripts/globals/settings"); -require("scripts/zones/Southern_San_dOria/TextIDs"); +package.loaded["/scripts/zones/Southern_San_dOria/TextIDs"] = nil; +require("/scripts/zones/Southern_San_dOria/TextIDs"); +require("/scripts/globals/settings"); +require("/scripts/globals/quests"); ----------------------------------- --- onTrade Action +-- onTrade Action ----------------------------------- function onTrade(player,npc,trade) @@ -21,9 +21,21 @@ -- onTrigger Action ----------------------------------- -function onTrigger(player,npc) - player:startEvent(0x02E); -end; +function onTrigger(player,npc) + if (player:getFameLevel(SANDORIA) < 2) then + player:startEvent(0x002e); + elseif (player:getQuestStatus(SANDORIA,GRIMY_SIGNPOSTS) == QUEST_AVAILABLE) then + player:startEvent(0x002d); + elseif (player:getQuestStatus(SANDORIA,GRIMY_SIGNPOSTS) == QUEST_ACCEPTED and player:getVar("CleanSignPost") < 15) then + player:startEvent(0x002b); + elseif (player:getQuestStatus(SANDORIA,GRIMY_SIGNPOSTS) == QUEST_ACCEPTED and player:getVar("CleanSignPost") == 15) then + player:startEvent(0x002c); + elseif (player:getQuestStatus(SANDORIA,GRIMY_SIGNPOSTS) == QUEST_COMPLETED) then + player:startEvent(0x002a); + else + --printf("Unknown Event Condidtions"); + end +end; ----------------------------------- -- onEventUpdate @@ -41,6 +53,14 @@ function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); + if (csid == 45 and option == 0) then + player:addQuest(SANDORIA,GRIMY_SIGNPOSTS); + elseif (csid == 42) then + player:addFame(SANDORIA,SAN_FAME*30); + player:addGil(GIL_RATE*1500); + player:messageSpecial(GIL_OBTAINED,GIL_RATE*1500); + player:completeQuest(SANDORIA,GRIMY_SIGNPOSTS); + end end;