Index: scripts/globals/quests.lua =================================================================== --- scripts/globals/quests.lua (revision 2115) +++ scripts/globals/quests.lua (working copy) @@ -275,7 +275,7 @@ PAYING_LIP_SERVICE = 60; -- + -- THE_AMAZIN_SCORPIO = 61; -- + -- TWINSTONE_BONDING = 62; -- + -- -CURSES_FOILED_A_GOLEM = 63; +CURSES_FOILED_A_GOLEM = 63; -- + -- ACTING_IN_GOOD_FAITH = 64; -- ± -- FLOWER_CHILD = 65; -- ± -- THE_THREE_MAGI = 66; -- ± -- @@ -404,7 +404,7 @@ SHADOWS_OF_THE_DEPARTED = 88; APOCALYPSE_NIGH = 89; LURE_OF_THE_WILDCAT_JEUNO = 90; -THE_ROAD_TO_AHT_URHGAN = 91; +THE_ROAD_TO_AHT_URHGAN = 91; -- + -- CHOCOBO_ON_THE_LOOSE = 92; THE_GOBBIEBAG_PART_VII = 93; -- + -- THE_GOBBIEBAG_PART_VIII = 94; -- + -- @@ -603,4 +603,4 @@ ----------------------------------- -- Abyssea ------------------------------------ \ No newline at end of file +----------------------------------- Index: scripts/zones/Beaucedine_Glacier/npcs/Torino-Samarino.lua =================================================================== --- scripts/zones/Beaucedine_Glacier/npcs/Torino-Samarino.lua (revision 2015) +++ scripts/zones/Beaucedine_Glacier/npcs/Torino-Samarino.lua (working copy) @@ -1,13 +1,16 @@ ----------------------------------- -- Area: Beaucedine Glacier --- NPC: Torino-Samarino +-- NPC: Torino-Samarino -- Type: Quest NPC --- @zone: 111 --- @pos: 106.090 -21.249 142.194 --- --- Auto-Script: Requires Verification (Verified by Brawndo) +-- @zone: 111 +-- @pos: 105 -20 140 +-- Involved in Quests: Curses, Foiled A-Golem!?, Tuning Out ----------------------------------- package.loaded["scripts/zones/Beaucedine_Glacier/TextIDs"] = nil; +require("scripts/globals/quests"); +require("scripts/globals/settings"); +require("scripts/zones/Beaucedine_Glacier/TextIDs"); +require("scripts/globals/keyitems"); ----------------------------------- ----------------------------------- @@ -22,7 +25,32 @@ ----------------------------------- function onTrigger(player,npc) - player:startEvent(0x0065); + +FoiledAGolem = player:getQuestStatus(WINDURST,CURSES_FOILED_A_GOLEM); + + -- Curses, Foiled A_Golem!? + + if(player:hasKeyItem(SHANTOTTOS_EXSPELL) and FoiledAGolem == QUEST_ACCEPTED) then + player:startEvent(0x006C); -- key item taken, wait one game day for new spell + elseif(player:getVar("golemwait") == 1 and FoiledAGolem == QUEST_ACCEPTED) then + gDay = VanadielDayOfTheYear(); + gYear = VanadielYear(); + dFinished = player:getVar("golemday"); + yFinished = player:getVar("golemyear"); + if(gDay == dFinished and gYear == yFinished) then + player:startEvent(0x0071); -- re-write reminder + elseif(gDay == dFinished + 1 and gYear == yFinished) then + player:startEvent(0x006D); -- re-write done + end + elseif(player:getVar("foiledagolemdeliverycomplete") == 1) then + player:startEvent(0x006E); -- talk to Shantotto reminder + elseif (FoiledAGolem == QUEST_ACCEPTED) then + player:startEvent(0x0068); -- receive key item + + -- standard dialog + else + player:startEvent(0x0065); + end end; ----------------------------------- @@ -41,5 +69,22 @@ function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); + + -- Curses, Foiled A_Golem!? + if (csid == 0x0068 and option == 1) then + player:addKeyItem(SHANTOTTOS_NEW_SPELL); + player:messageSpecial(KEYITEM_OBTAINED,SHANTOTTOS_NEW_SPELL); -- add new spell key item + elseif (csid == 0x006C) then -- start wait for new scroll + player:delKeyItem(SHANTOTTOS_EXSPELL); + player:setVar("golemday",VanadielDayOfTheYear()); + player:setVar("golemyear",VanadielYear()); + player:setVar("golemwait",1) + elseif (csid == 0x006D) then + player:addKeyItem(SHANTOTTOS_NEW_SPELL); + player:messageSpecial(KEYITEM_OBTAINED,SHANTOTTOS_NEW_SPELL); -- add new spell key item + player:setVar("golemday",0); + player:setVar("golemyear",0); + player:setVar("golemwait",0) + end end; Index: scripts/zones/FeiYin/mobs/Clockwork_Pod.lua =================================================================== --- scripts/zones/FeiYin/mobs/Clockwork_Pod.lua (revision 0) +++ scripts/zones/FeiYin/mobs/Clockwork_Pod.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------- +-- Area: FeiYin +-- NPC: Clockwork Pod +----------------------------------- +----------------------------------- + +require("scripts/globals/keyitems"); + +----------------------------------- +-- onMobSpawn Action +----------------------------------- + +function OnMobSpawn(mob) +end; + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob, killer) + + -- Curses, Foiled A-Golem!? + if(killer:hasKeyItem(SHANTOTTOS_NEW_SPELL)) then + killer:delKeyItem(SHANTOTTOS_NEW_SPELL); + killer:addKeyItem(SHANTOTTOS_EXSPELL); + end + +end; \ No newline at end of file Index: scripts/zones/FeiYin/mobs/Colossus.lua =================================================================== --- scripts/zones/FeiYin/mobs/Colossus.lua (revision 0) +++ scripts/zones/FeiYin/mobs/Colossus.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------- +-- Area: FeiYin +-- NPC: Colossus +----------------------------------- +----------------------------------- + +require("scripts/globals/keyitems"); + +----------------------------------- +-- onMobSpawn Action +----------------------------------- + +function OnMobSpawn(mob) +end; + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob, killer) + + -- Curses, Foiled A-Golem!? + if(killer:hasKeyItem(SHANTOTTOS_NEW_SPELL)) then + killer:delKeyItem(SHANTOTTOS_NEW_SPELL); + killer:addKeyItem(SHANTOTTOS_EXSPELL); + end + +end; \ No newline at end of file Index: scripts/zones/FeiYin/mobs/Droma.lua =================================================================== --- scripts/zones/FeiYin/mobs/Droma.lua (revision 0) +++ scripts/zones/FeiYin/mobs/Droma.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------- +-- Area: FeiYin +-- NPC: Droma +----------------------------------- +----------------------------------- + +require("scripts/globals/keyitems"); + +----------------------------------- +-- onMobSpawn Action +----------------------------------- + +function OnMobSpawn(mob) +end; + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob, killer) + + -- Curses, Foiled A-Golem!? + if(killer:hasKeyItem(SHANTOTTOS_NEW_SPELL)) then + killer:delKeyItem(SHANTOTTOS_NEW_SPELL); + killer:addKeyItem(SHANTOTTOS_EXSPELL); + end + +end; \ No newline at end of file Index: scripts/zones/FeiYin/mobs/Drone.lua =================================================================== --- scripts/zones/FeiYin/mobs/Drone.lua (revision 0) +++ scripts/zones/FeiYin/mobs/Drone.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------- +-- Area: FeiYin +-- NPC: Drone +----------------------------------- +----------------------------------- + +require("scripts/globals/keyitems"); + +----------------------------------- +-- onMobSpawn Action +----------------------------------- + +function OnMobSpawn(mob) +end; + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob, killer) + + -- Curses, Foiled A-Golem!? + if(killer:hasKeyItem(SHANTOTTOS_NEW_SPELL)) then + killer:delKeyItem(SHANTOTTOS_NEW_SPELL); + killer:addKeyItem(SHANTOTTOS_EXSPELL); + end + +end; \ No newline at end of file Index: scripts/zones/FeiYin/mobs/Goliath.lua =================================================================== --- scripts/zones/FeiYin/mobs/Goliath.lua (revision 2015) +++ scripts/zones/FeiYin/mobs/Goliath.lua (working copy) @@ -1,5 +1,5 @@ ----------------------------------- --- Area: +-- Area: Fei'Yin -- NPC: Goliath ----------------------------------- ----------------------------------- @@ -19,5 +19,11 @@ function onMobDeath(mob, killer) killer:addTitle(GOLIATH_KILLER); + + -- Curses, Foiled A-Golem!? + if(killer:hasKeyItem(SHANTOTTOS_NEW_SPELL)) then + killer:delKeyItem(SHANTOTTOS_NEW_SPELL); + killer:addKeyItem(SHANTOTTOS_EX_SPELL); + end end; \ No newline at end of file Index: scripts/zones/FeiYin/mobs/Jenglot.lua =================================================================== --- scripts/zones/FeiYin/mobs/Jenglot.lua (revision 0) +++ scripts/zones/FeiYin/mobs/Jenglot.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------- +-- Area: Fei'Yin +-- NPC: Jenglot +----------------------------------- +----------------------------------- + +require("scripts/globals/titles"); + +----------------------------------- +-- onMobSpawn Action +----------------------------------- + +function OnMobSpawn(mob) +end; + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob, killer) + + -- Curses, Foiled A-Golem!? + if(killer:hasKeyItem(SHANTOTTOS_NEW_SPELL)) then + killer:delKeyItem(SHANTOTTOS_NEW_SPELL); + killer:addKeyItem(SHANTOTTOS_EXSPELL); + end + +end; \ No newline at end of file Index: scripts/zones/FeiYin/mobs/Mind_Hoarder.lua =================================================================== --- scripts/zones/FeiYin/mobs/Mind_Hoarder.lua (revision 0) +++ scripts/zones/FeiYin/mobs/Mind_Hoarder.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------- +-- Area: Fei'Yin +-- NPC: Mind Hoarder +----------------------------------- +----------------------------------- + +require("scripts/globals/titles"); + +----------------------------------- +-- onMobSpawn Action +----------------------------------- + +function OnMobSpawn(mob) +end; + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob, killer) + + -- Curses, Foiled A-Golem!? + if(killer:hasKeyItem(SHANTOTTOS_NEW_SPELL)) then + killer:delKeyItem(SHANTOTTOS_NEW_SPELL); + killer:addKeyItem(SHANTOTTOS_EXSPELL); + end + +end; \ No newline at end of file Index: scripts/zones/FeiYin/mobs/Ore_Golem.lua =================================================================== --- scripts/zones/FeiYin/mobs/Ore_Golem.lua (revision 0) +++ scripts/zones/FeiYin/mobs/Ore_Golem.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------- +-- Area: FeiYin +-- NPC: Ore Golem +----------------------------------- +----------------------------------- + +require("scripts/globals/keyitems"); + +----------------------------------- +-- onMobSpawn Action +----------------------------------- + +function OnMobSpawn(mob) +end; + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob, killer) + + -- Curses, Foiled A-Golem!? + if(killer:hasKeyItem(SHANTOTTOS_NEW_SPELL)) then + killer:delKeyItem(SHANTOTTOS_NEW_SPELL); + killer:addKeyItem(SHANTOTTOS_EXSPELL); + end + +end; \ No newline at end of file Index: scripts/zones/FeiYin/mobs/Talos.lua =================================================================== --- scripts/zones/FeiYin/mobs/Talos.lua (revision 0) +++ scripts/zones/FeiYin/mobs/Talos.lua (working copy) @@ -0,0 +1,28 @@ +----------------------------------- +-- Area: FeiYin +-- NPC: Talos +----------------------------------- +----------------------------------- + +require("scripts/globals/keyitems"); + +----------------------------------- +-- onMobSpawn Action +----------------------------------- + +function OnMobSpawn(mob) +end; + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob, killer) + + -- Curses, Foiled A-Golem!? + if(killer:hasKeyItem(SHANTOTTOS_NEW_SPELL)) then + killer:delKeyItem(SHANTOTTOS_NEW_SPELL); + killer:addKeyItem(SHANTOTTOS_EXSPELL); + end + +end; \ No newline at end of file Index: scripts/zones/FeiYin/npcs/_no4.lua =================================================================== --- scripts/zones/FeiYin/npcs/_no4.lua (revision 0) +++ scripts/zones/FeiYin/npcs/_no4.lua (working copy) @@ -0,0 +1,66 @@ +----------------------------------- +-- Area: Fei'Yin +-- NPC: Cermet Door (triggers Rukususu dialog) +-- Type: Quest NPC +-- @zone: 204 +-- @pos: -183 0 190 +-- Involved in quests: Curses, Foiled A-Golem!?,SMN AF2: Class Reunion, SMN AF3: Carbuncle Debacle +-- Involved in Missions: Windurst 5-1/7-2/8-2 +----------------------------------- +package.loaded["scripts/zones/FeiYin/TextIDs"] = nil; +require("scripts/globals/quests"); +require("scripts/globals/settings"); +require("scripts/zones/FeiYin/TextIDs"); +require("scripts/globals/keyitems"); +----------------------------------- + +----------------------------------- +-- onTrade Action +----------------------------------- + +function onTrade(player,npc,trade) +end; + +----------------------------------- +-- onTrigger Action +----------------------------------- + +function onTrigger(player,npc) + + + -- Curses, Foiled A_Golem!? + if(player:hasKeyItem(SHANTOTTOS_NEW_SPELL)) then + player:startEvent(0x000E); -- deliver spell + elseif(player:hasKeyItem(SHANTOTTOS_EXSPELL)) then + player:startEvent(0x000D); -- spell erased, try again! + + -- standard dialog + else + player:startEvent(0x000f); + end + return 1; +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); + + -- Curses, Foiled A_Golem!? + if(csid == 0x000E) then + player:setVar("foiledagolemdeliverycomplete",1); + player:delKeyItem(SHANTOTTOS_NEW_SPELL); -- remove key item + end +end; Index: scripts/zones/FeiYin/npcs/Rukususu.lua =================================================================== --- scripts/zones/FeiYin/npcs/Rukususu.lua (revision 2015) +++ scripts/zones/FeiYin/npcs/Rukususu.lua (working copy) @@ -1,13 +1,17 @@ ----------------------------------- -- Area: Fei'Yin --- NPC: Rukususu +-- NPC: Rukususu (talk to Cermet Door _no5 to trigger) -- Type: Quest NPC --- @zone: 204 +-- @zone: 204 -- @pos: -194.133 -0.986 191.077 --- --- Auto-Script: Requires Verification (Verified by Brawndo) +-- Involved in quests: Curses, Foiled A-Golem!?,SMN AF2: Class Reunion, SMN AF3: Carbuncle Debacle +-- Involved in Missions: Windurst 5-1/7-2/8-2 ----------------------------------- package.loaded["scripts/zones/FeiYin/TextIDs"] = nil; +require("scripts/globals/quests"); +require("scripts/globals/settings"); +require("scripts/zones/FeiYin/TextIDs"); +require("scripts/globals/keyitems"); ----------------------------------- ----------------------------------- @@ -22,7 +26,18 @@ ----------------------------------- function onTrigger(player,npc) - player:startEvent(0x000f); + + + -- Curses, Foiled A_Golem!? + if(player:hasKeyItem(SHANTOTTOS_NEW_SPELL)) then + player:startEvent(0x000E); -- deliver spell + elseif(player:hasKeyItem(SHANTOTTOS_EXSPELL)) then + player:startEvent(0x000D); -- spell erased, try again! + + -- standard dialog + else + player:startEvent(0x000f); + end end; ----------------------------------- @@ -41,5 +56,11 @@ function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); + + -- Curses, Foiled A_Golem!? + if(csid == 0x000E) then + player:setVar("foiledagolemdeliverycomplete",1); + player:delKeyItem(SHANTOTTOS_NEW_SPELL); -- remove key item + end end; Index: scripts/zones/Windurst_Walls/npcs/Hiwon-Biwon.lua =================================================================== --- scripts/zones/Windurst_Walls/npcs/Hiwon-Biwon.lua (revision 2015) +++ scripts/zones/Windurst_Walls/npcs/Hiwon-Biwon.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- -- Area: Windurst Walls -- NPC: Hiwon-Biwon --- Involved In Quest: Making Headlines +-- Involved In Quest: Making Headlines, Curses, Foiled...Again!? -- Working 100% ----------------------------------- package.loaded["scripts/zones/Windurst_Walls/TextIDs"] = nil; @@ -27,8 +27,18 @@ function testflag(set,flag) return (set % (2*flag) >= flag) end + MakingHeadlines = player:getQuestStatus(WINDURST,MAKING_HEADLINES); - if (MakingHeadlines == 1) then + CFA2 = player:getQuestStatus(WINDURST,CURSES_FOILED_AGAIN_2); + + -- Curses,Foiled ... Again!? + if (CFA2 == QUEST_ACCEPTED) then + player:startEvent(0x00B6); -- get Hiwon's hair + elseif (CFA2 == QUEST_COMPLETED and MakingHeadlines ~= QUEST_ACCEPTED) then + player:startEvent(0x00B9); -- New Dialog after CFA2 + + -- Making Headlines + elseif (MakingHeadlines == 1) then prog = player:getVar("QuestMakingHeadlines_var"); -- Variable to track if player has talked to 4 NPCs and a door -- 1 = Kyume @@ -88,11 +98,22 @@ function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); + + -- Making Headlines if (csid == 0x0119 or csid == 0x011b or csid == 0x011c) then prog = player:getVar("QuestMakingHeadlines_var"); player:addKeyItem(WINDURST_WALLS_SCOOP); player:messageSpecial(KEYITEM_OBTAINED,WINDURST_WALLS_SCOOP); player:setVar("QuestMakingHeadlines_var",prog+4); + + -- Curses,Foiled...Again!? + elseif (csid == 0x00B6) then + if (player:getFreeSlotsCount() == 0) then + player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,552); -- Hiwon's hair + else + player:addItem(552); + player:messageSpecial(ITEM_OBTAINED,552); -- Hiwon's hair + end end end; Index: scripts/zones/Windurst_Walls/npcs/Shantotto.lua =================================================================== --- scripts/zones/Windurst_Walls/npcs/Shantotto.lua (revision 2015) +++ scripts/zones/Windurst_Walls/npcs/Shantotto.lua (working copy) @@ -2,7 +2,9 @@ -- Area: Windurst Walls -- NPC: Shantotto -- Working 100% --- CSID's misisng in autoEventID please check the old forums under resources for all of shantotto's csid's. I found them all manually. +-- @zone 239 +-- @pos x:122 y:-2 z:112 +-- CSID's missing in autoEventID please check the old forums under resources for all of shantotto's csid's. I found them all manually. ----------------------------------- require("scripts/globals/settings"); @@ -16,9 +18,27 @@ function onTrade(player,npc,trade) foiledAgain = player:getQuestStatus(WINDURST,CURSES_FOILED_AGAIN_1); - if(foiledAgain == QUEST_ACCEPTED and trade:hasItemQty(928,1) and trade:hasItemQty(880,2)) then - player:startEvent(0xad,0,0,0,0,0,0,928,880); + CFA2 = player:getQuestStatus(WINDURST,CURSES_FOILED_AGAIN_2); + + -- Curses Foiled Again! + if(foiledAgain == QUEST_ACCEPTED) then + count = trade:getItemCount(); + if(trade:hasItemQty(928,1) and trade:hasItemQty(880,2) and count == 3) then + player:startEvent(0xad,0,0,0,0,0,0,928,880); -- Correct items given, complete quest. + else + player:startEvent(0x00AC,0,0,0,0,0,0,928,880); -- Incorrect or not enough items + end + -- Curses,Foiled ... Again!? + elseif (CFA2 == QUEST_ACCEPTED) then + count = trade:getItemCount(); + if(trade:hasItemQty(17316,2) and trade:hasItemQty(940,1) and trade:hasItemQty(552,1) and count == 4) then + player:startEvent(0x00B7); -- Correct items given, complete quest. + else + player:startEvent(0x00B5,0,0,0,0,0,0,17316,940); -- Incorrect or not enough items + end + + end end; @@ -28,25 +48,53 @@ function onTrigger(player,npc) foiledAgain = player:getQuestStatus(WINDURST,CURSES_FOILED_AGAIN_1); + CFA2 = player:getQuestStatus(WINDURST,CURSES_FOILED_AGAIN_2); + CFAtimer = player:getVar("Curses,FoiledAgain!?"); + FoiledAGolem = player:getQuestStatus(WINDURST,CURSES_FOILED_A_GOLEM); + golemdelivery = player:getVar("foiledagolemdeliverycomplete"); + -- Curses Foiled Again! if(foiledAgain == QUEST_AVAILABLE) then player:startEvent(0xab,0,0,0,0,0,0,928,880); - elseif(foiledAgain == QUEST_COMPLETED) then + elseif(foiledAgain == QUEST_ACCEPTED) then + player:startEvent(0xac,0,0,0,0,0,0,928,880); + elseif(foiledAgain == QUEST_COMPLETED and CFA2 == QUEST_AVAILABLE and CFAtimer == 0) then cDay = VanadielDayOfTheYear(); cYear = VanadielYear(); - dFinished = player:getVar("Curses,FoiledAgain!DayFinished"); - yFinished = player:getVar("Curses,FoiledAgain!YearFinished"); + dFinished = player:getVar("Curses,FoiledAgain!Day"); + yFinished = player:getVar("Curses,FoiledAgain!Year"); if(cDay == dFinished and cYear == yFinished) then player:startEvent(0xae); elseif(cDay == dFinished + 1 and cYear == yFinished) then player:startEvent(0xb2); elseif(cDay >= dFinished + 2 and cYear == yFinished) then player:startEvent(0xb3); - - - end - elseif(foiledAgain == QUEST_ACCEPTED) then - player:startEvent(0xac,0,0,0,0,0,0,928,880); + end + + + -- Curses,Foiled...Again!? + elseif (foiledAgain == QUEST_COMPLETED and CFA2 == QUEST_AVAILABLE and player:getFameLevel (WINDURST) >= 2 and player:getMainLvl() >= 5 and CFAtimer == 1) then + player:startEvent(0x00B4,0,0,0,0,928,880,17316,940); -- Quest Start + elseif (CFA2 == QUEST_ACCEPTED) then + player:startEvent(0x00B5,0,0,0,0,0,0,17316,940); -- Reminder dialog + + + -- Curses,Foiled A-Golem!? + elseif (CFA2 == QUEST_COMPLETED and FoiledAGolem == QUEST_AVAILABLE and player:getFameLevel (WINDURST) >= 4 and player:getMainLvl() >= 10) then + player:startEvent(0x0154); --quest start + elseif (golemdelivery == 1) then + player:startEvent(0x0156); -- finish + elseif (FoiledAGolem == QUEST_ACCEPTED) then + player:startEvent(0x0155); -- reminder dialog + + + -- Standard dialog + elseif (FoiledAGolem == QUEST_COMPLETED) then + player:startEvent(0x0157); -- new standard dialog after Curses,Foiled A-Golem!? + + elseif (CFA2 == QUEST_COMPLETED) then + player:startEvent(0x00B8); -- New standard dialog after CFA2 + else player:startEvent(0xa4); end @@ -71,24 +119,65 @@ function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); + + -- Curses Foiled Again! if(csid == 0xad) then + if (player:getFreeSlotsCount() == 0) then + player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,17081); -- Brass rod + else player:tradeComplete(); player:setVar("Curses,FoiledAgain!Day",VanadielDayOfTheYear()); player:setVar("Curses,FoiledAgain!Year",VanadielYear()); player:addFame(WINDURST,WIN_FAME*80); player:addItem(17081); - player:messageSpecial(ITEM_OBTAINED,17081); + player:messageSpecial(ITEM_OBTAINED,17081); -- Brass Rod player:completeQuest(WINDURST,CURSES_FOILED_AGAIN_1); - + end + elseif(csid == 0xab and option ~= 1) then player:addQuest(WINDURST,CURSES_FOILED_AGAIN_1); elseif(csid == 0xb3) then - player:setVar("Curses,FoiledAgain!DayFinished",0); - player:setVar("Curses,FoiledAgain!YearFinished",0); + player:setVar("Curses,FoiledAgain!Day",0); + player:setVar("Curses,FoiledAgain!Year",0); player:needToZone(true); player:setVar("Curses,FoiledAgain!?",1); -- Used to acknowledge that the two days have passed, Use this to initiate next quest + -- Curses,Foiled...Again!? + elseif(csid == 0x00B4 and option ~= 1) then -- start CFA2 + player:addQuest(WINDURST,CURSES_FOILED_AGAIN_2); + player:addTitle(TARUTARU_MURDER_SUSPECT); + elseif(csid == 0x00B7) then -- end CFA2 + if (player:getFreeSlotsCount() == 0) then + player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,17116); -- Misery Staff + else + player:tradeComplete(); + player:addFame(WINDURST,WIN_FAME*80); + player:addItem(17116); + player:messageSpecial(ITEM_OBTAINED,17116); -- Misery Staff + player:addTitle(HEXER_VEXER); + player:completeQuest(WINDURST,CURSES_FOILED_AGAIN_2); + player:needToZone(true); + player:setVar("Curses,FoiledAgain!?",0); -- finish clean up of CFA1 vars + end + + -- Curses,Foiled A-Golem!? + elseif (csid == 0x0154 and option ~= 1) then + player:addTitle(TOTAL_LOSER); -- obtained after declining quest + elseif (csid == 0x0154 and option ~= 2) then + player:addQuest(WINDURST,CURSES_FOILED_A_GOLEM); -- quest start + elseif (csid == 0x0156) then -- end quest + if (player:getFreeSlotsCount() == 0) then + player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,4870); -- Scroll of Warp II + else + player:addFame(WINDURST,WIN_FAME*80); + player:addItem(4870); + player:messageSpecial(ITEM_OBTAINED,4870); -- Scroll of Warp II + player:addTitle(DOCTOR_SHANTOTTOS_FLAVOR_OF_THE_MONTH); + player:completeQuest(WINDURST,CURSES_FOILED_A_GOLEM); + player:setVar("foiledagolemdeliverycomplete",0); -- clean up variables + end + end end; \ No newline at end of file Index: scripts/zones/Windurst_Woods/npcs/Apururu.lua =================================================================== --- scripts/zones/Windurst_Woods/npcs/Apururu.lua (revision 2015) +++ scripts/zones/Windurst_Woods/npcs/Apururu.lua (working copy) @@ -1,13 +1,14 @@ ----------------------------------- -- Area: Windurst Woods -- NPC: Apururu --- Involved in Quests: The kind cardian --- @pos -11 -2 13 241 +-- Involved in Quests: The Kind Cardian, Can Cardians Cry? +-- @zone 241 +-- @pos -11 -2 13 ----------------------------------- package.loaded["scripts/zones/Windurst_Woods/TextIDs"] = nil; package.loaded["scripts/globals/missions"] = nil; ------------------------------------ - +package.loaded["scripts/globals/quests"] = nil; +require("scripts/globals/titles"); require("scripts/globals/settings"); require("scripts/globals/keyitems"); require("scripts/globals/missions"); @@ -19,10 +20,23 @@ ----------------------------------- function onTrade(player,npc,trade) - if(player:getQuestStatus(JEUNO,THE_KIND_CARDIAN) == QUEST_ACCEPTED) then + +local TKC = player:getQuestStatus(JEUNO,THE_KIND_CARDIAN); +local C3 = player:getQuestStatus(WINDURST,CAN_CARDIANS_CRY); + + -- The Kind Cardian + if(TKC == QUEST_ACCEPTED) then if(trade:hasItemQty(969,1) == true and trade:getGil() == 0 and trade:getItemCount() == 1) then player:startEvent(0x018d); end + + -- Can Cardians Cry? + elseif(C3 == QUEST_ACCEPTED) then + count = trade:getItemCount(); + if(trade:hasItemQty(551,1) and count == 1) then + player:startEvent(0x0145,0,6000,5000); -- finish C3 + end + end end; @@ -31,6 +45,10 @@ ----------------------------------- function onTrigger(player,npc) + +local ANC3K = player:getQuestStatus(WINDURST,THE_ALL_NEW_C_3000); -- previous quest in line +local C3 = player:getQuestStatus(WINDURST,CAN_CARDIANS_CRY); +local TKC = player:getQuestStatus(JEUNO,THE_KIND_CARDIAN); -- Check if we are on Windurst Mission 1-2 if(player:getCurrentMission(WINDURST) == THE_HEART_OF_THE_MATTER) then @@ -46,8 +64,9 @@ -- Mission's over - Good end (you came back with the orbs) player:startEvent(0x0091); end - else - if(player:getQuestStatus(JEUNO,THE_KIND_CARDIAN) == QUEST_ACCEPTED) then + + -- The Kind Cardian + elseif (TKC == QUEST_ACCEPTED) then if(player:getVar("theKindCardianVar") == 0) then player:startEvent(0x0188); elseif(player:getVar("theKindCardianVar") == 1) then @@ -55,9 +74,18 @@ elseif(player:getVar("theKindCardianVar") == 2) then player:startEvent(0x018e); end - else - player:startEvent(0x0112); - end + + -- Can Cardians Cry? + elseif (ANC3K == QUEST_COMPLETED and C3 == QUEST_AVAILABLE and player:getFameLevel (WINDURST) >= 5) then + player:startEvent(0x013F,0,6000); -- start C3 + elseif (C3 == QUEST_ACCEPTED) then + player:startEvent(0x0140,0,6000); -- C3 reminder + elseif (C3 == QUEST_COMPLETED) then + player:startEvent(0x014A); -- new dialog after C3 + + -- standard dialog + else + player:startEvent(0x0112); end end; @@ -78,24 +106,25 @@ --printf("CSID: %u",csid); --printf("RESULT: %u",option); - if(csid == 0x0089) then -- Windurst mission 1-2 start + -- Windurst mission 1-2 start + if(csid == 0x0089) then player:setVar("MissionStatus",1); - -- Give the player the key items - player:addKeyItem(FIRST_DARK_MANA_ORB); + + player:addKeyItem(FIRST_DARK_MANA_ORB); -- Give the player the key items player:addKeyItem(SECOND_DARK_MANA_ORB); player:addKeyItem(THIRD_DARK_MANA_ORB); player:addKeyItem(FOURTH_DARK_MANA_ORB); player:addKeyItem(FIFTH_DARK_MANA_ORB); player:addKeyItem(SIXTH_DARK_MANA_ORB); - -- Display the key item messages - player:messageSpecial(KEYITEM_OBTAINED,FIRST_DARK_MANA_ORB); + + player:messageSpecial(KEYITEM_OBTAINED,FIRST_DARK_MANA_ORB); -- Display the key item messages player:messageSpecial(KEYITEM_OBTAINED,SECOND_DARK_MANA_ORB); player:messageSpecial(KEYITEM_OBTAINED,THIRD_DARK_MANA_ORB); player:messageSpecial(KEYITEM_OBTAINED,FOURTH_DARK_MANA_ORB); player:messageSpecial(KEYITEM_OBTAINED,FIFTH_DARK_MANA_ORB); player:messageSpecial(KEYITEM_OBTAINED,SIXTH_DARK_MANA_ORB); - -- Set the orb variables; 1 = not handled; 2 = handled; - player:setVar("MissionStatus_orb1",1); + + player:setVar("MissionStatus_orb1",1); -- Set the orb variables; 1 = not handled; 2 = handled; player:setVar("MissionStatus_orb2",1); player:setVar("MissionStatus_orb3",1); player:setVar("MissionStatus_orb4",1); @@ -112,13 +141,15 @@ player:setVar("MissionStatus_orb5",0); player:setVar("MissionStatus_orb6",0); - -- Remove the glowing orb key items - player:delKeyItem(FIRST_GLOWING_MANA_ORB); + + player:delKeyItem(FIRST_GLOWING_MANA_ORB); -- Remove the glowing orb key items player:delKeyItem(SECOND_GLOWING_MANA_ORB); player:delKeyItem(THIRD_GLOWING_MANA_ORB); player:delKeyItem(FOURTH_GLOWING_MANA_ORB); player:delKeyItem(FIFTH_GLOWING_MANA_ORB); player:delKeyItem(SIXTH_GLOWING_MANA_ORB); + + -- The Kind Cardian elseif(csid == 0x0188 and option == 1) then player:setVar("theKindCardianVar",1); elseif(csid == 0x018d) then @@ -126,6 +157,17 @@ player:setVar("theKindCardianVar",2); player:addFame(WINDURST,WIN_FAME*30); player:tradeComplete(); + + -- Can Cardians Cry? + elseif (csid == 0x013F) then + player:addQuest(WINDURST,CAN_CARDIANS_CRY); -- start C3 + + elseif (csid == 0x0145) then -- finish C3 + player:tradeComplete(); + player:addFame(WINDURST,WIN_FAME*80); + player:addTitle(DELIVERER_OF_TEARFUL_NEWS); + player:addGil(GIL_RATE*5000); + player:completeQuest(WINDURST,CAN_CARDIANS_CRY); end end; \ No newline at end of file