From ca738be765210ef702e2e9aab317f5f3ac015409 Mon Sep 17 00:00:00 2001 From: kaincenteno Date: Tue, 28 Apr 2020 18:06:08 -0700 Subject: [PATCH 1/3] Blue Mage Transformations quest + other 3 armor pieces Only thing missing are set the onRegionEnter zone correctly and add 2 mob skills that are missing from soulflayers (and this nm too) --- scripts/globals/mobskills/reprobation.lua | 33 +++++ scripts/globals/quests.lua | 2 +- scripts/zones/Aht_Urhgan_Whitegate/IDs.lua | 1 + .../npcs/Imperial_Whitegate.lua | 15 ++- .../Aht_Urhgan_Whitegate/npcs/Lathuya.lua | 126 +++++++++++++++++- .../zones/Aht_Urhgan_Whitegate/npcs/Waoud.lua | 31 ++++- scripts/zones/Alzadaal_Undersea_Ruins/IDs.lua | 3 + .../zones/Alzadaal_Undersea_Ruins/Zone.lua | 22 ++- .../mobs/Nepionic_Soulflayer.lua | 19 ++- .../zones/Alzadaal_Undersea_Ruins/npcs/21.lua | 37 +++++ sql/mob_pools.sql | 2 +- sql/mob_skill_lists.sql | 7 + sql/mob_skills.sql | 2 +- 13 files changed, 285 insertions(+), 15 deletions(-) create mode 100644 scripts/globals/mobskills/reprobation.lua create mode 100644 scripts/zones/Alzadaal_Undersea_Ruins/npcs/21.lua diff --git a/scripts/globals/mobskills/reprobation.lua b/scripts/globals/mobskills/reprobation.lua new file mode 100644 index 00000000000..602f072c0e1 --- /dev/null +++ b/scripts/globals/mobskills/reprobation.lua @@ -0,0 +1,33 @@ +--------------------------------------------- +-- Reprobation +-- +-- Description: Dispels all buffs from targets in area of effect, including food. +-- Type: Enfeebling +-- Utsusemi/Blink absorb: Dispels shadows +-- Range: Area of Effect +-- Notes: +--------------------------------------------- +require("scripts/globals/monstertpmoves") +require("scripts/globals/settings") +require("scripts/globals/status") +require("scripts/globals/msg") +--------------------------------------------- + +function onMobSkillCheck(target,mob,skill) + return 0 +end + +function onMobWeaponSkill(target, mob, skill) + local dispel = target:dispelAllStatusEffect(bit.bor(tpz.effectFlag.DISPELABLE, tpz.effectFlag.FOOD)) + local msg -- to be set later + + if (dispel == 0) then + msg = tpz.msg.basic.SKILL_NO_EFFECT -- no effect + else + msg = tpz.msg.basic.DISAPPEAR_NUM + end + + skill:setMsg(msg) + + return dispel +end diff --git a/scripts/globals/quests.lua b/scripts/globals/quests.lua index 5419fc26142..b738a193228 100644 --- a/scripts/globals/quests.lua +++ b/scripts/globals/quests.lua @@ -656,7 +656,7 @@ tpz.quest.id = ROCK_BOTTOM = 20, BEGINNINGS = 21, -- + -- OMENS = 22, -- + -- - TRANSFORMATIONS = 23, + TRANSFORMATIONS = 23, -- + -- EQUIPPED_FOR_ALL_OCCASIONS = 24, -- + -- NAVIGATING_THE_UNFRIENDLY_SEAS = 25, -- + -- AGAINST_ALL_ODDS = 26, diff --git a/scripts/zones/Aht_Urhgan_Whitegate/IDs.lua b/scripts/zones/Aht_Urhgan_Whitegate/IDs.lua index 8bf9f335c14..79a11e9cf1e 100644 --- a/scripts/zones/Aht_Urhgan_Whitegate/IDs.lua +++ b/scripts/zones/Aht_Urhgan_Whitegate/IDs.lua @@ -21,6 +21,7 @@ zones[tpz.zone.AHT_URHGAN_WHITEGATE] = HOMEPOINT_SET = 1366, -- Home point set! IMAGE_SUPPORT_ACTIVE = 1405, -- You have to wait a bit longer before asking for synthesis image support again. IMAGE_SUPPORT = 1407, -- Your [fishing/woodworking/smithing/goldsmithing/clothcraft/leatherworking/bonecraft/alchemy/cooking] skills went up [a little/ever so slightly/ever so slightly]. + GATE_IS_FIRMLY_CLOSED = 1424, -- The gate is firmly closed... ITEM_OBTAINEDX = 1497, -- You obtain ! RUNIC_PORTAL = 4584, -- You cannot use the runic portal without the Empire's authorization. UGRIHD_PURCHASE_DIALOGUE = 4645, -- Salaheem's Sentinels values your contribution to the success of the company. Please come again! diff --git a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Imperial_Whitegate.lua b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Imperial_Whitegate.lua index 44af7ca588a..e5a212fc3c7 100644 --- a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Imperial_Whitegate.lua +++ b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Imperial_Whitegate.lua @@ -18,15 +18,15 @@ end function onTrigger(player,npc) if player:getEquipID(tpz.slot.MAIN) == 0 and player:getEquipID(tpz.slot.SUB) == 0 then if player:getCurrentMission(TOAU) == tpz.mission.id.toau.GUESTS_OF_THE_EMPIRE and player:getCharVar("AhtUrganStatus") == 1 and - doRoyalPalaceArmorCheck(player) == true then + doRoyalPalaceArmorCheck(player) == true then player:startEvent(3078,0,1,0,0,0,0,0,1,0) elseif player:getCurrentMission(TOAU) == tpz.mission.id.toau.SEAL_OF_THE_SERPENT then player:startEvent(3111) elseif player:getCurrentMission(TOAU) == tpz.mission.id.toau.IMPERIAL_CORONATION and - doRoyalPalaceArmorCheck(player) == true then + doRoyalPalaceArmorCheck(player) == true then player:startEvent(3140,tpz.besieged.getMercenaryRank(player),player:getTitle(),0,0,0,0,0,0,0) elseif player:getCurrentMission(TOAU) >= tpz.mission.id.toau.IMPERIAL_CORONATION and - doRoyalPalaceArmorCheck(player) == true then + doRoyalPalaceArmorCheck(player) == true then local ring = player:getCharVar("TOAU_RINGTIME") local standard = player:hasItem(129) @@ -46,6 +46,12 @@ function onTrigger(player,npc) player:startEvent(3155,standardParam,ringParam,0,0,0,0,0,0,0) end end + + -- TRANSFORMATIONS + elseif player:getCharVar("TransformationsProgress") == 1 then + player:startEvent(722) + else + player:messageSpecial(ID.text.GATE_IS_FIRMLY_CLOSED) end end @@ -85,5 +91,8 @@ function onEventFinish(player,csid,option) player:setCharVar("TOAU_RINGRECV", 0) elseif csid == 3155 and option == 6 then npcUtil.giveItem(player,129) + elseif csid == 722 then + player:addQuest(AHT_URHGAN, tpz.quest.id.ahtUrhgan.TRANSFORMATIONS) + player:setCharVar("TransformationsProgress", 2) end end diff --git a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Lathuya.lua b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Lathuya.lua index 54438aea112..2d997123f7f 100644 --- a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Lathuya.lua +++ b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Lathuya.lua @@ -1,4 +1,4 @@ ------------------------------------ + ----------------------------------- -- Area: Aht Urhgan Whitegate -- NPC: Lathuya -- Standard Info NPC @@ -9,25 +9,81 @@ require("scripts/globals/quests") require("scripts/globals/npc_util") ----------------------------------- +local craftingItems = { +-- itemBit = {firstItem, secondItem, thirdItem, fourthItem, coinType, coinAmmount, craftedItem, optionId} + [1] = {754, 828, 879, 4158, 2186, 2, 14928, 1}, -- magus bazubands + [2] = {761, 828, 2175, 2340, 2186, 2, 15600, 2}, -- magus shalwar + [4] = {828, 2229, 2288, 2340, 2186, 4, 14521, 3} -- magus jubbah +} + function onTrade(player, npc, trade) + local currentTask = player:getCharVar("LathuyaCurrentTask_Mask") + local craftingBluArmor = player:getCharVar("CraftingBluArmor") + local totalCraftedPieces = player:countMaskBits(player:getCharVar("LathuyaCraftingList_Mask")) + local csOffset = 8 * totalCraftedPieces + + if craftingBluArmor == 0 and npcUtil.tradeHasExactly(trade, { + craftingItems[currentTask][1], craftingItems[currentTask][2], craftingItems[currentTask][3], craftingItems[currentTask][4] + }) then + player:startEvent(732 + csOffset, craftingItems[currentTask][7], craftingItems[currentTask][5], craftingItems[currentTask][6]) + elseif craftingBluArmor == 1 and npcUtil.tradeHasExactly(trade, { + {craftingItems[currentTask][5], craftingItems[currentTask][6]} + }) then + player:startEvent(734 + csOffset, 0, craftingItems[currentTask][5], craftingItems[currentTask][6]) + end end function onTrigger(player, npc) local omensProgress = player:getCharVar("OmensProgress") local omens = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.OMENS) + local transformations = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.TRANSFORMATIONS) + local craftingBluArmor = player:getCharVar("CraftingBluArmor") + local craftedPieces = player:getCharVar("LathuyaCraftingList_Mask") + local totalCraftedPieces = player:countMaskBits(player:getCharVar("LathuyaCraftingList_Mask")) + local currentTask = player:getCharVar("LathuyaCurrentTask_Mask") + local pickupReady = vanaDay() > player:getCharVar("BluPaymentDay") + local craftmanAwake = vanaDay() > player:getCharVar("BluRestingDay") + local csOffset = 8 * totalCraftedPieces -- OMENS - if omens >= QUEST_ACCEPTED then + if omens == QUEST_ACCEPTED then if omensProgress == 3 then player:startEvent(714) -- Tells Master location elseif omensProgress == 4 then player:startEvent(715) -- Reminder of master location elseif omensProgress == 5 then player:startEvent(716) -- Master spoken to - elseif omens == QUEST_COMPLETED then - player:startEvent(771) -- Default dialog end + -- CRAFTING OTHER 3 BLUE MAGE ARMOR PIECES + elseif transformations >= QUEST_ACCEPTED then + if currentTask == 0 and totalCraftedPieces ~= 3 then + if craftmanAwake then + if totalCraftedPieces == 2 then + currentTask = 7 - craftedPieces + player:startEvent(746, 0, 0, 0, 0, 0, 0, 0, craftingItems[currentTask][8]) -- 8th param is response + else + player:startEvent(730 + csOffset, craftedPieces) -- Will prompt for choosing which armor to work on + end + else + player:startEvent(737 + (csOffset - 8)) -- Asleep message, wait until 1 day passes + end + elseif player:countMaskBits(player:getCharVar("LathuyaCurrentTask_Mask")) == 1 then + if craftingBluArmor == 0 then + player:startEvent(731 + csOffset , 0, craftingItems[currentTask][5], craftingItems[currentTask][6]) + elseif craftingBluArmor == 1 then + player:startEvent(733 + csOffset , craftingItems[currentTask][7], craftingItems[currentTask][5], craftingItems[currentTask][6]) + elseif craftingBluArmor == 2 and not pickupReady then + player:startEvent(735 + csOffset) + elseif craftingBluArmor == 2 and pickupReady then + player:startEvent(736 + csOffset, craftingItems[currentTask][7]) + end + elseif totalCraftedPieces == 3 then + player:startEvent(753) -- Default dialog after completing questline. + end + + elseif omens == QUEST_COMPLETED then + player:startEvent(718) -- Default dialog -- DEFAULT DIALOG else player:startEvent(770) @@ -35,10 +91,47 @@ function onTrigger(player, npc) end function onEventUpdate(player, csid, option) + local totalCraftedPieces = player:countMaskBits(player:getCharVar("LathuyaCraftingList_Mask")) + local csOffset = 8 * totalCraftedPieces + + if csid == 730 + csOffset then + local currentTask = player:getCharVar("LathuyaCurrentTask_Mask") + + -- MAGUS BASUBANDS + if option == 2 then + player:setCharVar("LathuyaCurrentTask_Mask", 0) + player:setMaskBit(player:getCharVar("LathuyaCurrentTask_Mask"), "LathuyaCurrentTask_Mask", 0, true) + local currentTask = player:getCharVar("LathuyaCurrentTask_Mask") + player:updateEvent(0, craftingItems[currentTask][1], craftingItems[currentTask][2], craftingItems[currentTask][3], craftingItems[currentTask][4]) + elseif option == 3 then + player:updateEvent(0, craftingItems[currentTask][5], craftingItems[currentTask][6]) + + -- MAGUS SHALWAR + elseif option == 5 then + player:setCharVar("LathuyaCurrentTask_Mask", 0) + player:setMaskBit(player:getCharVar("LathuyaCurrentTask_Mask"), "LathuyaCurrentTask_Mask", 1, true) + local currentTask = player:getCharVar("LathuyaCurrentTask_Mask") + player:updateEvent(0, craftingItems[currentTask][1], craftingItems[currentTask][2], craftingItems[currentTask][3], craftingItems[currentTask][4]) + elseif option == 6 then + player:updateEvent(0, craftingItems[currentTask][5], craftingItems[currentTask][6]) + + -- MAGUS JUBBAH + elseif option == 8 then + player:setCharVar("LathuyaCurrentTask_Mask", 0) + player:setMaskBit(player:getCharVar("LathuyaCurrentTask_Mask"), "LathuyaCurrentTask_Mask", 2, true) + local currentTask = player:getCharVar("LathuyaCurrentTask_Mask") + player:updateEvent(0, craftingItems[currentTask][1], craftingItems[currentTask][2], craftingItems[currentTask][3], craftingItems[currentTask][4]) + elseif option == 9 then + player:updateEvent(0, craftingItems[currentTask][5], craftingItems[currentTask][6]) + end + end end function onEventFinish(player, csid, option) + local totalCraftedPieces = player:countMaskBits(player:getCharVar("LathuyaCraftingList_Mask")) local omensProgress = player:getCharVar("OmensProgress") + local currentTask = player:getCharVar("LathuyaCurrentTask_Mask") + local csOffset = 8 * totalCraftedPieces -- OMENS if csid == 714 and omensProgress == 3 then @@ -50,5 +143,30 @@ function onEventFinish(player, csid, option) var = { OmensProgress } }) player:delKeyItem(tpz.ki.SEALED_IMMORTAL_ENVELOPE) + + -- TRANSFORMATIONS + elseif csid == 732 + csOffset then + player:setCharVar("CraftingBluArmor", 1) + player:confirmTrade() + elseif csid == 734 + csOffset then + player:setCharVar("CraftingBluArmor", 2) + npcUtil.giveKeyItem(player, tpz.ki.MAGUS_ORDER_SLIP) + player:setCharVar("BluPaymentDay", vanaDay()) + player:confirmTrade() + elseif csid == 736 + csOffset then + if npcUtil.giveItem(player, craftingItems[currentTask][7]) then + if currentTask == 1 then + player:setMaskBit(player:getCharVar("LathuyaCraftingList_Mask"), "LathuyaCraftingList_Mask", 0, true) + elseif currentTask == 2 then + player:setMaskBit(player:getCharVar("LathuyaCraftingList_Mask"), "LathuyaCraftingList_Mask", 1, true) + elseif currentTask == 4 then + player:setMaskBit(player:getCharVar("LathuyaCraftingList_Mask"), "LathuyaCraftingList_Mask", 2, true) + end + player:setCharVar("BluPaymentDay", 0) + player:setCharVar("CraftingBluArmor", 0) + player:setCharVar("LathuyaCurrentTask_Mask", 0) + player:setCharVar("BluRestingDay", vanaDay()) + player:delKeyItem(tpz.ki.MAGUS_ORDER_SLIP) + end end end \ No newline at end of file diff --git a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Waoud.lua b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Waoud.lua index e67099c3558..e129ebbdec1 100644 --- a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Waoud.lua +++ b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Waoud.lua @@ -30,6 +30,8 @@ function onTrigger(player, npc) local divinationReady = vanaDay() > player:getCharVar("LastDivinationDay") local beginnings = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.BEGINNINGS) local omens = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.OMENS) + local transformations = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.TRANSFORMATIONS) + local currentJob = player:getMainJob() local waoudNeedToZone = player:getLocalVar("WaoudNeedToZone") -- AN EMPTY VESSEL @@ -54,7 +56,7 @@ function onTrigger(player, npc) -- BEGINNINGS elseif anEmptyVessel == QUEST_COMPLETED and beginnings == QUEST_AVAILABLE and player:getCurrentMission(TOAU) > tpz.mission.id.toau.IMMORTAL_SENTRIES - and player:getMainJob() == tpz.job.BLU and player:getMainLvl() >= AF1_QUEST_LEVEL then + and currentJob == tpz.job.BLU and player:getMainLvl() >= AF1_QUEST_LEVEL then if not divinationReady then player:startEvent(63) elseif waoudNeedToZone == 1 then @@ -75,7 +77,7 @@ function onTrigger(player, npc) end -- OMENS - elseif beginnings == QUEST_COMPLETED and omens == QUEST_AVAILABLE and player:getMainJob() == tpz.job.BLU and player:getMainLvl() >= AF2_QUEST_LEVEL then + elseif beginnings == QUEST_COMPLETED and omens == QUEST_AVAILABLE and currentJob == tpz.job.BLU and player:getMainLvl() >= AF2_QUEST_LEVEL then if not divinationReady then player:startEvent(63) elseif waoudNeedToZone == 1 then @@ -92,6 +94,20 @@ function onTrigger(player, npc) player:startEvent(713, player:getGil()) -- clue about location of armour piece, costs you 1000 gil end + -- TRANSFORMATIONS + elseif omens == QUEST_COMPLETED and transformations == QUEST_AVAILABLE and currentJob == tpz.job.BLU then + if not divinationReady then + player:startEvent(63) + elseif waoudNeedToZone == 1 then + player:startEvent(78, player:getGil()) -- dummy questions, costs you 1000 gil + else + player:startEvent(721, player:getGil()) -- starts Transformations + end + elseif transformations == QUEST_ACCEPTED then + if player:getCharVar("TransformationsProgress") == 2 then + player:startEvent(723, player:getGil()) -- clue about possible route to take, costs you 1000 gil + end + -- DEFAULT DIALOG else player:startEvent(61) @@ -144,7 +160,9 @@ end function onEventFinish(player, csid, option) local beginnings = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.BEGINNINGS) + local omens = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.OMENS) local omensProgress = player:getCharVar("OmensProgress") + local transformationsProgress = player:getCharVar("TransformationsProgress") -- AN EMPTY VESSEL if csid == 60 then @@ -195,5 +213,14 @@ function onEventFinish(player, csid, option) elseif csid == 713 and option == 1 and omensProgress == 3 and player:getGil() >= 1000 then player:delGil(1000) player:messageSpecial(ID.text.PAY_DIVINATION) -- You pay 1000 gil for the divination. + + -- TRANSFORMATIONS + elseif csid == 721 and option == 1 and player:getGil() >= 1000 then + player:setCharVar("TransformationsProgress", 1) + player:delGil(1000) + player:messageSpecial(ID.text.PAY_DIVINATION) -- You pay 1000 gil for the divination. + elseif csid == 723 and option == 1 and TransformationsProgress == 2 and player:getGil() >= 1000 then + player:delGil(1000) + player:messageSpecial(ID.text.PAY_DIVINATION) -- You pay 1000 gil for the divination. end end \ No newline at end of file diff --git a/scripts/zones/Alzadaal_Undersea_Ruins/IDs.lua b/scripts/zones/Alzadaal_Undersea_Ruins/IDs.lua index 14b95d794e6..9d93ec61016 100644 --- a/scripts/zones/Alzadaal_Undersea_Ruins/IDs.lua +++ b/scripts/zones/Alzadaal_Undersea_Ruins/IDs.lua @@ -21,6 +21,7 @@ zones[tpz.zone.ALZADAAL_UNDERSEA_RUINS] = CANNOT_LEAVE = 7220, -- You cannot leave this area while in the possession of . RESPONSE = 7229, -- There is no response... DEVICE_MALFUNCTIONING = 7245, -- The device appears to be malfunctioning... + NOTHING_OUT_OF_ORDINARY = 7425, -- There is nothing out of the ordinary here. CANNOT_ENTER = 7441, -- You cannot enter at this time. Please wait a while before trying again. AREA_FULL = 7442, -- This area is fully occupied. You were unable to enter. MEMBER_NO_REQS = 7446, -- Not all of your party members meet the requirements for this objective. Unable to enter area. @@ -34,6 +35,7 @@ zones[tpz.zone.ALZADAAL_UNDERSEA_RUINS] = }, mob = { + NEPIONIC_SOULFLAYER = 17072129, COOKIEDUSTER_LIPIROON_PH = { [17072142] = 17072150, @@ -43,6 +45,7 @@ zones[tpz.zone.ALZADAAL_UNDERSEA_RUINS] = CHEESE_HOARDER_GIGIROON = 17072172, ARMED_GEARS = 17072178, WULGARU = 17072179, + }, npc = { diff --git a/scripts/zones/Alzadaal_Undersea_Ruins/Zone.lua b/scripts/zones/Alzadaal_Undersea_Ruins/Zone.lua index b95b2c24f80..627b4c50e8f 100644 --- a/scripts/zones/Alzadaal_Undersea_Ruins/Zone.lua +++ b/scripts/zones/Alzadaal_Undersea_Ruins/Zone.lua @@ -34,7 +34,9 @@ function onInitialize(zone) zone:registerRegion(20, 550, -2, 522, 557, 0, 529) -- map 11 west porter (white) zone:registerRegion(21,-556, -2,-489,-550, 0,-483) -- map 12 east porter (white) zone:registerRegion(22,-610, -2,-489,-603, 0,-483) -- map 12 west porter (blue) - zone:registerRegion(23,382, -1,-582,399, 1,-572) -- mission 9 TOAU + zone:registerRegion(23, 382, -1,-582, 399, 1,-572) -- mission 9 TOAU + zone:registerRegion(24,-495, 0, 675,-505, 0, 665) -- transformations (quest) TODO: NEEDS CORRECT COORDINATES plz halp + zone:registerRegion(25,-493, 0, 664,-505, 0, 653) -- transformations (quest) TODO: NEEDS CORRECT COORDINATES plz halp end function onZoneIn(player,prevZone) @@ -63,6 +65,8 @@ function afterZoneIn(player) end function onRegionEnter(player,region) + local transformationsProgress = player:getCharVar("TransformationsProgress") + switch (region:GetRegionID()): caseof { [1] = function (x) @@ -136,6 +140,16 @@ function onRegionEnter(player,region) player:startEvent(1, tpz.besieged.getMercenaryRank(player)) end end, + [24] = function (x) + if transformationsProgress == 2 then + player:startEvent(2) + end + end, + [25] = function (x) + if transformationsProgress <= 2 then + player:startEvent(3) + end + end, } end @@ -158,11 +172,17 @@ function onEventUpdate(player,csid,option) end function onEventFinish(player,csid,option) + local transformationsProgress = player:getCharVar("TransformationsProgress") + if csid == 1 then player:addKeyItem(tpz.ki.ASTRAL_COMPASS) player:completeMission(TOAU,tpz.mission.id.toau.UNDERSEA_SCOUTING) player:addMission(TOAU,tpz.mission.id.toau.ASTRAL_WAVES) player:messageSpecial(ID.text.KEYITEM_OBTAINED,tpz.ki.ASTRAL_COMPASS) + elseif csid == 2 then + player:setCharVar("TransformationsProgress", 3) + elseif csid == 3 then + player:setCharVar("TransformationsProgress", 4) elseif csid == 7 then player:completeMission(TOAU,tpz.mission.id.toau.PATH_OF_DARKNESS) player:setTitle(tpz.title.NAJAS_COMRADEINARMS) diff --git a/scripts/zones/Alzadaal_Undersea_Ruins/mobs/Nepionic_Soulflayer.lua b/scripts/zones/Alzadaal_Undersea_Ruins/mobs/Nepionic_Soulflayer.lua index 872a05100eb..8bbbfecc400 100644 --- a/scripts/zones/Alzadaal_Undersea_Ruins/mobs/Nepionic_Soulflayer.lua +++ b/scripts/zones/Alzadaal_Undersea_Ruins/mobs/Nepionic_Soulflayer.lua @@ -2,7 +2,22 @@ -- Area: Alzadaal Undersea Ruins (72) -- Mob: Nepionic Soulflayer ----------------------------------- -mixins = {require("scripts/mixins/job_special")}; +mixins = {require("scripts/mixins/job_special")} +----------------------------------- + +--TODO: Immortal Shield - Magic Shield (Only prevents direct damage from spells) +--TODO: Immortal Mind - Magic Atk Boost + +function onMobInitialize(mob) + mob:setMobMod(tpz.mobMod.IDLE_DESPAWN, 180) +end + +function onMobSpawn(mob) + DespawnMob(mob:getID(), 180) +end function onMobDeath(mob, player, isKiller) -end; + if player:getCharVar("TransformationsProgress") >= 2 then + player:setCharVar("TransformationsProgress", 5) + end +end diff --git a/scripts/zones/Alzadaal_Undersea_Ruins/npcs/21.lua b/scripts/zones/Alzadaal_Undersea_Ruins/npcs/21.lua new file mode 100644 index 00000000000..73f02cbad1f --- /dev/null +++ b/scripts/zones/Alzadaal_Undersea_Ruins/npcs/21.lua @@ -0,0 +1,37 @@ +----------------------------------- +-- Area: Alzadaal Undersea Ruins +-- NPC: 21 (no name) +----------------------------------- +local ID = require("scripts/zones/Alzadaal_Undersea_Ruins/IDs") +require("scripts/globals/npc_util") +----------------------------------- + +function onTrade(player,npc,trade) +end; + +function onTrigger(player,npc) + local transformationsProgress = player:getCharVar("TransformationsProgress") + -- TRANSFORMATIONS + if transformationsProgress >= 2 and transformationsProgress <= 4 and not GetMobByID(ID.mob.NEPIONIC_SOULFLAYER):isSpawned() then + player:startEvent(4) + elseif player:getCharVar("TransformationsProgress") == 5 then + player:startEvent(5) + else + player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY) + end +end + +function onEventUpdate(player,csid,option) +end + +function onEventFinish(player,csid,option) + if csid == 4 then + SpawnMob(ID.mob.NEPIONIC_SOULFLAYER) + elseif csid == 5 then + npcUtil.completeQuest(player, AHT_URHGAN, TRANSFORMATIONS, { + item = 15265, + title = tpz.title.PARAGON_OF_BLUE_MAGE_EXCELLENCE, + var = {"TransformationsProgress"} + }) + end +end \ No newline at end of file diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index d53bc277147..ece30cd2038 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -2891,7 +2891,7 @@ INSERT INTO `mob_pools` VALUES (2830,'Nephiyl_Pinnacletosser','Nephiyl_Pinnaclet INSERT INTO `mob_pools` VALUES (2831,'Nephiyl_Rampartbreacher','Nephiyl_Rampartbreacher',126,0x0000BF0200000000000000000000000000000000,1,1,5,240,100,0,1,1,1,18,0,0,4216,131,0,0,0,1,0,126); INSERT INTO `mob_pools` VALUES (2832,'Nepionic_Bladmall','Nepionic_Bladmall',251,0x0000510500000000000000000000000000000000,1,1,7,290,100,0,1,1,1,0,0,0,3253,129,0,0,0,1,0,251); INSERT INTO `mob_pools` VALUES (2833,'Nepionic_Parata','Nepionic_Parata',251,0x0000510500000000000000000000000000000000,1,1,7,290,100,0,1,1,1,0,0,0,1247,129,0,0,0,1,0,251); -INSERT INTO `mob_pools` VALUES (2834,'Nepionic_Soulflayer','Nepionic_Soulflayer',233,0x0000EF0600000000000000000000000000000000,4,4,5,240,100,0,1,1,1,2,0,0,0,131,0,0,28,1,0,233); +INSERT INTO `mob_pools` VALUES (2834,'Nepionic_Soulflayer','Nepionic_Soulflayer',233,0x0000EF0600000000000000000000000000000000,4,4,5,240,100,0,1,1,1,2,0,0,0,131,0,0,28,1,0,1011); INSERT INTO `mob_pools` VALUES (2835,'Nest_Beetle','Nest_Beetle',49,0x0000980100000000000000000000000000000000,7,7,8,240,100,0,0,0,1,0,0,0,344,129,0,0,0,1,0,49); INSERT INTO `mob_pools` VALUES (2836,'Nguruvilu','Nguruvilu',198,0x0000D00600000000000000000000000000000000,1,4,6,240,100,0,0,0,0,2,0,0,0,0,0,0,0,1,0,823); INSERT INTO `mob_pools` VALUES (2837,'Nickel_Quadav_both','Nickel_Quadav_both',202,0x00004F0800000000000000000000000000000000,7,7,3,265,100,0,1,0,1,0,0,0,1,131,0,0,4,1,0,202); diff --git a/sql/mob_skill_lists.sql b/sql/mob_skill_lists.sql index 0bf1552a835..ab90c5a2714 100644 --- a/sql/mob_skill_lists.sql +++ b/sql/mob_skill_lists.sql @@ -3461,3 +3461,10 @@ INSERT INTO `mob_skill_lists` VALUES ('Siren',1010,3512); -- Sonic Buffet INSERT INTO `mob_skill_lists` VALUES ('Siren',1010,3513); -- Entice INSERT INTO `mob_skill_lists` VALUES ('Siren',1010,3514); -- Hysteric Assault INSERT INTO `mob_skill_lists` VALUES ('Siren',1010,3515); -- Clarsach Call +INSERT INTO `mob_skill_lists` VALUES ('Nepionic_Soulflayer',1011,1963); +-- INSERT INTO `mob_skill_lists` VALUES ('Nepionic_Soulflayer',1011,1964); +-- INSERT INTO `mob_skill_lists` VALUES ('Nepionic_Soulflayer',1011,1965); +INSERT INTO `mob_skill_lists` VALUES ('Nepionic_Soulflayer',1011,1966); +INSERT INTO `mob_skill_lists` VALUES ('Nepionic_Soulflayer',1011,1967); +INSERT INTO `mob_skill_lists` VALUES ('Nepionic_Soulflayer',1011,1968); +INSERT INTO `mob_skill_lists` VALUES ('Nepionic_Soulflayer',1011,1969); -- Reprobation diff --git a/sql/mob_skills.sql b/sql/mob_skills.sql index 5730f633c16..a497f2495b1 100644 --- a/sql/mob_skills.sql +++ b/sql/mob_skills.sql @@ -1789,7 +1789,7 @@ INSERT INTO `mob_skills` VALUES (1965,1329,'immortal_shield',0,7.0,2000,1500,1,0 INSERT INTO `mob_skills` VALUES (1966,1330,'mind_purge',0,7.0,2000,1000,4,0,0,0,0,0,0); INSERT INTO `mob_skills` VALUES (1967,1331,'tribulation',1,15.0,2000,1000,4,0,0,0,0,0,0); INSERT INTO `mob_skills` VALUES (1968,1332,'immortal_anathema',1,15.0,2000,1000,4,0,0,0,0,0,0); --- INSERT INTO `mob_skills` VALUES (1969,1713,'reprobation',0,7.0,2000,1500,4,0,0,0,0,0,0); +INSERT INTO `mob_skills` VALUES (1969,1713,'reprobation',1,7.0,2000,1500,4,0,0,0,0,0,0); -- INSERT INTO `mob_skills` VALUES (1970,1714,'eclosion',0,7.0,2000,1500,4,0,0,0,0,0,0); -- INSERT INTO `mob_skills` VALUES (1971,1715,'.',0,7.0,2000,1500,4,0,0,0,0,0,0); -- INSERT INTO `mob_skills` VALUES (1972,1716,'.',0,7.0,2000,1500,4,0,0,0,0,0,0); From 0cf58e544ce56e77f2d911e21126dc9df8f6f392 Mon Sep 17 00:00:00 2001 From: ibm2431 Date: Sun, 10 May 2020 18:36:50 -0700 Subject: [PATCH 2/3] Adjust BLU AF crafting var orientation to "bring vars toward 0" --- .../npcs/Imperial_Whitegate.lua | 1 + .../Aht_Urhgan_Whitegate/npcs/Lathuya.lua | 205 ++++++++++-------- 2 files changed, 111 insertions(+), 95 deletions(-) diff --git a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Imperial_Whitegate.lua b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Imperial_Whitegate.lua index e5a212fc3c7..a2943b93ea6 100644 --- a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Imperial_Whitegate.lua +++ b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Imperial_Whitegate.lua @@ -94,5 +94,6 @@ function onEventFinish(player,csid,option) elseif csid == 722 then player:addQuest(AHT_URHGAN, tpz.quest.id.ahtUrhgan.TRANSFORMATIONS) player:setCharVar("TransformationsProgress", 2) + player:setCharVar("[BLUAF]Remaining", 7) -- Player can now craft BLU armor end end diff --git a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Lathuya.lua b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Lathuya.lua index 2d997123f7f..811303942bc 100644 --- a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Lathuya.lua +++ b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Lathuya.lua @@ -10,26 +10,45 @@ require("scripts/globals/npc_util") ----------------------------------- local craftingItems = { --- itemBit = {firstItem, secondItem, thirdItem, fourthItem, coinType, coinAmmount, craftedItem, optionId} - [1] = {754, 828, 879, 4158, 2186, 2, 14928, 1}, -- magus bazubands - [2] = {761, 828, 2175, 2340, 2186, 2, 15600, 2}, -- magus shalwar - [4] = {828, 2229, 2288, 2340, 2186, 4, 14521, 3} -- magus jubbah + [1] = -- magus bazubands + { + materials = {754, 828, 879, 4158}, + currency = 2186, + currencyAmt = 2, + result = 14928 + }, + [2] = -- magus shalwar + { + materials = {761, 828, 2175, 2340}, + currency = 2186, + currencyAmt = 2, + result = 15600 + }, + [3] = -- magus jubbah + { + materials = {828, 2229, 2288, 2340}, + currency = 2186, + currencyAmt = 4, + result = 14521 + } } function onTrade(player, npc, trade) - local currentTask = player:getCharVar("LathuyaCurrentTask_Mask") - local craftingBluArmor = player:getCharVar("CraftingBluArmor") - local totalCraftedPieces = player:countMaskBits(player:getCharVar("LathuyaCraftingList_Mask")) - local csOffset = 8 * totalCraftedPieces - - if craftingBluArmor == 0 and npcUtil.tradeHasExactly(trade, { - craftingItems[currentTask][1], craftingItems[currentTask][2], craftingItems[currentTask][3], craftingItems[currentTask][4] - }) then - player:startEvent(732 + csOffset, craftingItems[currentTask][7], craftingItems[currentTask][5], craftingItems[currentTask][6]) - elseif craftingBluArmor == 1 and npcUtil.tradeHasExactly(trade, { - {craftingItems[currentTask][5], craftingItems[currentTask][6]} - }) then - player:startEvent(734 + csOffset, 0, craftingItems[currentTask][5], craftingItems[currentTask][6]) + local remainingBLUAF = player:getCharVar("[BLUAF]Remaining") -- Bitmask of AF the player has NOT crafted + if remainingBLUAF >= 1 then + local currentTask = player:getCharVar("LathuyaCurrentTask_Mask") + local craftingStage = player:getCharVar("[BLUAF]CraftingStage") + local totalCraftedPieces = 3 - player:countMaskBits(remainingBLUAF) + local AFoffset = 8 * totalCraftedPieces + + local item = craftingItems[player:getCharVar("[BLUAF]Current")] + if item then + if craftingStage == 0 and npcUtil.tradeHasExactly(trade, item.materials) then + player:startEvent(732 + AFoffset, item.result, item.currency, item.currencyAmt) + elseif craftingStage == 1 and npcUtil.tradeHasExactly(trade, {{item.currency, item.currencyAmt}}) then + player:startEvent(734 + AFoffset, 0, item.currency, item.currencyAmt) + end + end end end @@ -37,13 +56,6 @@ function onTrigger(player, npc) local omensProgress = player:getCharVar("OmensProgress") local omens = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.OMENS) local transformations = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.TRANSFORMATIONS) - local craftingBluArmor = player:getCharVar("CraftingBluArmor") - local craftedPieces = player:getCharVar("LathuyaCraftingList_Mask") - local totalCraftedPieces = player:countMaskBits(player:getCharVar("LathuyaCraftingList_Mask")) - local currentTask = player:getCharVar("LathuyaCurrentTask_Mask") - local pickupReady = vanaDay() > player:getCharVar("BluPaymentDay") - local craftmanAwake = vanaDay() > player:getCharVar("BluRestingDay") - local csOffset = 8 * totalCraftedPieces -- OMENS if omens == QUEST_ACCEPTED then @@ -57,81 +69,82 @@ function onTrigger(player, npc) -- CRAFTING OTHER 3 BLUE MAGE ARMOR PIECES elseif transformations >= QUEST_ACCEPTED then + local remainingBLUAF = player:getCharVar("[BLUAF]Remaining") -- Bitmask of AF the player has NOT crafted + local totalCraftedPieces = 3 - player:countMaskBits(remainingBLUAF) + local currentTask = player:getCharVar("[BLUAF]Current") + local craftingStage = player:getCharVar("[BLUAF]CraftingStage") + local AFoffset = 8 * totalCraftedPieces + if currentTask == 0 and totalCraftedPieces ~= 3 then - if craftmanAwake then + if vanaDay() > player:getCharVar("[BLUAF]RestingDay") then if totalCraftedPieces == 2 then - currentTask = 7 - craftedPieces - player:startEvent(746, 0, 0, 0, 0, 0, 0, 0, craftingItems[currentTask][8]) -- 8th param is response + currentTask = math.floor(player:getCharVar("[BLUAF]Remaining") / 2) + 1 + player:startEvent(746, 0, 0, 0, 0, 0, 0, 0, currentTask) else - player:startEvent(730 + csOffset, craftedPieces) -- Will prompt for choosing which armor to work on + -- Will prompt for choosing which armor to work on + player:startEvent(730 + AFoffset, 7 - player:getCharVar("[BLUAF]Remaining")) end else - player:startEvent(737 + (csOffset - 8)) -- Asleep message, wait until 1 day passes + player:startEvent(737 + (AFoffset - 8)) -- Asleep message, wait until 1 day passes end - elseif player:countMaskBits(player:getCharVar("LathuyaCurrentTask_Mask")) == 1 then - if craftingBluArmor == 0 then - player:startEvent(731 + csOffset , 0, craftingItems[currentTask][5], craftingItems[currentTask][6]) - elseif craftingBluArmor == 1 then - player:startEvent(733 + csOffset , craftingItems[currentTask][7], craftingItems[currentTask][5], craftingItems[currentTask][6]) - elseif craftingBluArmor == 2 and not pickupReady then - player:startEvent(735 + csOffset) - elseif craftingBluArmor == 2 and pickupReady then - player:startEvent(736 + csOffset, craftingItems[currentTask][7]) + elseif currentTask > 0 then + local pickupReady = vanaDay() > player:getCharVar("[BLUAF]PaymentDay") + local item = craftingItems[currentTask] + if craftingStage == 0 then + player:startEvent(731 + AFoffset, 0, item.currency, item.currencyAmt) + elseif craftingStage == 1 then + player:startEvent(733 + AFoffset, item.result, item.currency, item.currencyAmt) + elseif craftingStage == 2 and not pickupReady then + player:startEvent(735 + AFoffset) + elseif craftingStage == 2 and pickupReady then + player:startEvent(736 + AFoffset, item.result) end elseif totalCraftedPieces == 3 then - player:startEvent(753) -- Default dialog after completing questline. + player:startEvent(753) -- Dialogue after crafting all BLU AF end elseif omens == QUEST_COMPLETED then - player:startEvent(718) -- Default dialog - -- DEFAULT DIALOG + player:startEvent(718) else - player:startEvent(770) + player:startEvent(770) -- Default dialogue end end function onEventUpdate(player, csid, option) - local totalCraftedPieces = player:countMaskBits(player:getCharVar("LathuyaCraftingList_Mask")) - local csOffset = 8 * totalCraftedPieces + local remainingBLUAF = player:getCharVar("[BLUAF]Remaining") -- Bitmask of AF the player has NOT crafted + local totalCraftedPieces = 3 - player:countMaskBits(remainingBLUAF) + local AFoffset = 8 * totalCraftedPieces - if csid == 730 + csOffset then - local currentTask = player:getCharVar("LathuyaCurrentTask_Mask") - - -- MAGUS BASUBANDS - if option == 2 then - player:setCharVar("LathuyaCurrentTask_Mask", 0) - player:setMaskBit(player:getCharVar("LathuyaCurrentTask_Mask"), "LathuyaCurrentTask_Mask", 0, true) - local currentTask = player:getCharVar("LathuyaCurrentTask_Mask") - player:updateEvent(0, craftingItems[currentTask][1], craftingItems[currentTask][2], craftingItems[currentTask][3], craftingItems[currentTask][4]) - elseif option == 3 then - player:updateEvent(0, craftingItems[currentTask][5], craftingItems[currentTask][6]) - - -- MAGUS SHALWAR - elseif option == 5 then - player:setCharVar("LathuyaCurrentTask_Mask", 0) - player:setMaskBit(player:getCharVar("LathuyaCurrentTask_Mask"), "LathuyaCurrentTask_Mask", 1, true) - local currentTask = player:getCharVar("LathuyaCurrentTask_Mask") - player:updateEvent(0, craftingItems[currentTask][1], craftingItems[currentTask][2], craftingItems[currentTask][3], craftingItems[currentTask][4]) - elseif option == 6 then - player:updateEvent(0, craftingItems[currentTask][5], craftingItems[currentTask][6]) - - -- MAGUS JUBBAH - elseif option == 8 then - player:setCharVar("LathuyaCurrentTask_Mask", 0) - player:setMaskBit(player:getCharVar("LathuyaCurrentTask_Mask"), "LathuyaCurrentTask_Mask", 2, true) - local currentTask = player:getCharVar("LathuyaCurrentTask_Mask") - player:updateEvent(0, craftingItems[currentTask][1], craftingItems[currentTask][2], craftingItems[currentTask][3], craftingItems[currentTask][4]) - elseif option == 9 then - player:updateEvent(0, craftingItems[currentTask][5], craftingItems[currentTask][6]) + if csid == 730 + AFoffset then + if option >= 2 and option <= 9 then + local currentTask = player:getCharVar("[BLUAF]Current") + local updateType = option % 3 + if updateType == 2 then + -- Choosing a piece + local piece = math.floor(option / 4) + 1 + local pieceMask = math.pow(2, (piece - 1)) + -- Make sure the player isn't trying to cheat somehow + if bit.band(pieceMask, player:getCharVar("[BLUAF]Remaining")) > 0 then + player:setCharVar("[BLUAF]Current", piece) + local item = craftingItems[piece] + player:updateEvent(0, unpack(item.materials)) + end + else + -- Needs payment + local item = craftingItems[currentTask] + player:updateEvent(0, item.currency, item.currencyAmt) + end end end end function onEventFinish(player, csid, option) - local totalCraftedPieces = player:countMaskBits(player:getCharVar("LathuyaCraftingList_Mask")) local omensProgress = player:getCharVar("OmensProgress") - local currentTask = player:getCharVar("LathuyaCurrentTask_Mask") - local csOffset = 8 * totalCraftedPieces + + local remainingBLUAF = player:getCharVar("[BLUAF]Remaining") -- Bitmask of AF the player has NOT crafted + local totalCraftedPieces = 3 - player:countMaskBits(remainingBLUAF) + local currentTask = player:getCharVar("[BLUAF]Current") + local AFoffset = 8 * totalCraftedPieces -- OMENS if csid == 714 and omensProgress == 3 then @@ -144,28 +157,30 @@ function onEventFinish(player, csid, option) }) player:delKeyItem(tpz.ki.SEALED_IMMORTAL_ENVELOPE) - -- TRANSFORMATIONS - elseif csid == 732 + csOffset then - player:setCharVar("CraftingBluArmor", 1) + -- BLU AF CRAFTING + elseif csid == 732 + AFoffset then + player:setCharVar("[BLUAF]CraftingStage", 1) player:confirmTrade() - elseif csid == 734 + csOffset then - player:setCharVar("CraftingBluArmor", 2) - npcUtil.giveKeyItem(player, tpz.ki.MAGUS_ORDER_SLIP) - player:setCharVar("BluPaymentDay", vanaDay()) + elseif csid == 734 + AFoffset then player:confirmTrade() - elseif csid == 736 + csOffset then - if npcUtil.giveItem(player, craftingItems[currentTask][7]) then - if currentTask == 1 then - player:setMaskBit(player:getCharVar("LathuyaCraftingList_Mask"), "LathuyaCraftingList_Mask", 0, true) - elseif currentTask == 2 then - player:setMaskBit(player:getCharVar("LathuyaCraftingList_Mask"), "LathuyaCraftingList_Mask", 1, true) - elseif currentTask == 4 then - player:setMaskBit(player:getCharVar("LathuyaCraftingList_Mask"), "LathuyaCraftingList_Mask", 2, true) + player:setCharVar("[BLUAF]CraftingStage", 2) + player:setCharVar("[BLUAF]PaymentDay", vanaDay()) + npcUtil.giveKeyItem(player, tpz.ki.MAGUS_ORDER_SLIP) + elseif csid == 736 + AFoffset then + if npcUtil.giveItem(player, craftingItems[currentTask].result) then + remainingBLUAF = remainingBLUAF - math.pow(2, (currentTask - 1)) + player:setCharVar("[BLUAF]Remaining", remainingBLUAF) + player:setCharVar("[BLUAF]PaymentDay", 0) + player:setCharVar("[BLUAF]CraftingStage", 0) + player:setCharVar("[BLUAF]Current", 0) + + if player:getCharVar("[BLUAF]Remaining") == 0 then + -- Player is finished with Lathuya + player:setCharVar("[BLUAF]RestingDay", 0) + else + player:setCharVar("[BLUAF]RestingDay", vanaDay()) end - player:setCharVar("BluPaymentDay", 0) - player:setCharVar("CraftingBluArmor", 0) - player:setCharVar("LathuyaCurrentTask_Mask", 0) - player:setCharVar("BluRestingDay", vanaDay()) + player:delKeyItem(tpz.ki.MAGUS_ORDER_SLIP) end end From 1f500fc2b24a92941058b4df626b259d3283ab2b Mon Sep 17 00:00:00 2001 From: ibm2431 Date: Mon, 11 May 2020 17:44:43 -0700 Subject: [PATCH 3/3] Transformations fixes + cleanup --- scripts/globals/mobskills/reprobation.lua | 6 +- .../npcs/Imperial_Whitegate.lua | 47 ++++++++------- .../Aht_Urhgan_Whitegate/npcs/Lathuya.lua | 3 +- .../zones/Aht_Urhgan_Whitegate/npcs/Waoud.lua | 58 ++++++++++++------- scripts/zones/Alzadaal_Undersea_Ruins/IDs.lua | 1 + .../zones/Alzadaal_Undersea_Ruins/Zone.lua | 9 ++- .../mobs/Nepionic_Soulflayer.lua | 6 +- .../zones/Alzadaal_Undersea_Ruins/npcs/21.lua | 6 +- sql/mob_pools.sql | 2 +- sql/mob_skill_lists.sql | 9 +-- 10 files changed, 74 insertions(+), 73 deletions(-) diff --git a/scripts/globals/mobskills/reprobation.lua b/scripts/globals/mobskills/reprobation.lua index 602f072c0e1..05b6169ea36 100644 --- a/scripts/globals/mobskills/reprobation.lua +++ b/scripts/globals/mobskills/reprobation.lua @@ -19,11 +19,9 @@ end function onMobWeaponSkill(target, mob, skill) local dispel = target:dispelAllStatusEffect(bit.bor(tpz.effectFlag.DISPELABLE, tpz.effectFlag.FOOD)) - local msg -- to be set later + local msg = tpz.msg.basic.SKILL_NO_EFFECT - if (dispel == 0) then - msg = tpz.msg.basic.SKILL_NO_EFFECT -- no effect - else + if dispel > 0 then msg = tpz.msg.basic.DISAPPEAR_NUM end diff --git a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Imperial_Whitegate.lua b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Imperial_Whitegate.lua index a2943b93ea6..9ee17219f85 100644 --- a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Imperial_Whitegate.lua +++ b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Imperial_Whitegate.lua @@ -16,35 +16,34 @@ function onTrade(player,npc,trade) end function onTrigger(player,npc) - if player:getEquipID(tpz.slot.MAIN) == 0 and player:getEquipID(tpz.slot.SUB) == 0 then - if player:getCurrentMission(TOAU) == tpz.mission.id.toau.GUESTS_OF_THE_EMPIRE and player:getCharVar("AhtUrganStatus") == 1 and - doRoyalPalaceArmorCheck(player) == true then - player:startEvent(3078,0,1,0,0,0,0,0,1,0) - elseif player:getCurrentMission(TOAU) == tpz.mission.id.toau.SEAL_OF_THE_SERPENT then - player:startEvent(3111) - elseif player:getCurrentMission(TOAU) == tpz.mission.id.toau.IMPERIAL_CORONATION and - doRoyalPalaceArmorCheck(player) == true then - player:startEvent(3140,tpz.besieged.getMercenaryRank(player),player:getTitle(),0,0,0,0,0,0,0) - elseif player:getCurrentMission(TOAU) >= tpz.mission.id.toau.IMPERIAL_CORONATION and - doRoyalPalaceArmorCheck(player) == true then - local ring = player:getCharVar("TOAU_RINGTIME") - local standard = player:hasItem(129) + local noWeapons = player:getEquipID(tpz.slot.MAIN) == 0 and player:getEquipID(tpz.slot.SUB) == 0 + if player:getCurrentMission(TOAU) == tpz.mission.id.toau.GUESTS_OF_THE_EMPIRE and player:getCharVar("AhtUrganStatus") == 1 and + doRoyalPalaceArmorCheck(player) and noWeapons then + player:startEvent(3078,0,1,0,0,0,0,0,1,0) + elseif player:getCurrentMission(TOAU) == tpz.mission.id.toau.SEAL_OF_THE_SERPENT and noWeapons then + player:startEvent(3111) + elseif player:getCurrentMission(TOAU) == tpz.mission.id.toau.IMPERIAL_CORONATION and + doRoyalPalaceArmorCheck(player) and noWeapons then + player:startEvent(3140,tpz.besieged.getMercenaryRank(player),player:getTitle(),0,0,0,0,0,0,0) + elseif player:getCurrentMission(TOAU) >= tpz.mission.id.toau.IMPERIAL_CORONATION and + doRoyalPalaceArmorCheck(player) and noWeapons then + local ring = player:getCharVar("TOAU_RINGTIME") + local standard = player:hasItem(129) - local ringParam = 0 + local ringParam = 0 - if ring == 0 then - ringParam = 1 - end + if ring == 0 then + ringParam = 1 + end - local standardParam = 0 + local standardParam = 0 - if standard == false then - standardParam = 1 - end + if standard == false then + standardParam = 1 + end - if ringParam > 0 or standardParam > 0 then - player:startEvent(3155,standardParam,ringParam,0,0,0,0,0,0,0) - end + if ringParam > 0 or standardParam > 0 then + player:startEvent(3155,standardParam,ringParam,0,0,0,0,0,0,0) end -- TRANSFORMATIONS diff --git a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Lathuya.lua b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Lathuya.lua index 811303942bc..91705a3bc67 100644 --- a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Lathuya.lua +++ b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Lathuya.lua @@ -36,7 +36,6 @@ local craftingItems = { function onTrade(player, npc, trade) local remainingBLUAF = player:getCharVar("[BLUAF]Remaining") -- Bitmask of AF the player has NOT crafted if remainingBLUAF >= 1 then - local currentTask = player:getCharVar("LathuyaCurrentTask_Mask") local craftingStage = player:getCharVar("[BLUAF]CraftingStage") local totalCraftedPieces = 3 - player:countMaskBits(remainingBLUAF) local AFoffset = 8 * totalCraftedPieces @@ -78,7 +77,7 @@ function onTrigger(player, npc) if currentTask == 0 and totalCraftedPieces ~= 3 then if vanaDay() > player:getCharVar("[BLUAF]RestingDay") then if totalCraftedPieces == 2 then - currentTask = math.floor(player:getCharVar("[BLUAF]Remaining") / 2) + 1 + currentTask = math.floor(remainingBLUAF / 2) + 1 player:startEvent(746, 0, 0, 0, 0, 0, 0, 0, currentTask) else -- Will prompt for choosing which armor to work on diff --git a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Waoud.lua b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Waoud.lua index e129ebbdec1..aa753f5486d 100644 --- a/scripts/zones/Aht_Urhgan_Whitegate/npcs/Waoud.lua +++ b/scripts/zones/Aht_Urhgan_Whitegate/npcs/Waoud.lua @@ -31,11 +31,12 @@ function onTrigger(player, npc) local beginnings = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.BEGINNINGS) local omens = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.OMENS) local transformations = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.TRANSFORMATIONS) + local transformationsProgress = player:getCharVar("TransformationsProgress") local currentJob = player:getMainJob() local waoudNeedToZone = player:getLocalVar("WaoudNeedToZone") -- AN EMPTY VESSEL - if ENABLE_TOAU == 1 and anEmptyVessel == QUEST_AVAILABLE and anEmptyVesselProgress <= 1 and player:getMainLvl() >= ADVANCED_JOB_LEVEL then + if anEmptyVessel == QUEST_AVAILABLE and anEmptyVesselProgress <= 1 and player:getMainLvl() >= ADVANCED_JOB_LEVEL then if divinationReady then player:startEvent(60, player:getGil()) -- you must answer these 10 questions else @@ -57,12 +58,14 @@ function onTrigger(player, npc) -- BEGINNINGS elseif anEmptyVessel == QUEST_COMPLETED and beginnings == QUEST_AVAILABLE and player:getCurrentMission(TOAU) > tpz.mission.id.toau.IMMORTAL_SENTRIES and currentJob == tpz.job.BLU and player:getMainLvl() >= AF1_QUEST_LEVEL then - if not divinationReady then - player:startEvent(63) - elseif waoudNeedToZone == 1 then - player:startEvent(78, player:getGil()) -- dummy questions, costs you 1000 gil + if divinationReady then + if waoudNeedToZone == 1 then + player:startEvent(78, player:getGil()) -- dummy questions, costs you 1000 gil + else + player:startEvent(705) -- start Beginnings + end else - player:startEvent(705, player:getGil()) -- start AF1 quest + player:startEvent(63) end elseif beginnings == QUEST_ACCEPTED then local brand1 = player:hasKeyItem(tpz.ki.BRAND_OF_THE_SPRINGSERPENT) @@ -78,12 +81,14 @@ function onTrigger(player, npc) -- OMENS elseif beginnings == QUEST_COMPLETED and omens == QUEST_AVAILABLE and currentJob == tpz.job.BLU and player:getMainLvl() >= AF2_QUEST_LEVEL then - if not divinationReady then - player:startEvent(63) - elseif waoudNeedToZone == 1 then - player:startEvent(78, player:getGil()) -- dummy questions, costs you 1000 gil + if divinationReady then + if waoudNeedToZone == 1 then + player:startEvent(78, player:getGil()) -- dummy questions, costs you 1000 gil + else + player:startEvent(710) -- start Omens + end else - player:startEvent(710) -- start AF2 quest + player:startEvent(63) end elseif omens == QUEST_ACCEPTED then if player:getCharVar("OmensProgress") == 1 then @@ -96,19 +101,26 @@ function onTrigger(player, npc) -- TRANSFORMATIONS elseif omens == QUEST_COMPLETED and transformations == QUEST_AVAILABLE and currentJob == tpz.job.BLU then - if not divinationReady then - player:startEvent(63) - elseif waoudNeedToZone == 1 then - player:startEvent(78, player:getGil()) -- dummy questions, costs you 1000 gil + if divinationReady then + if waoudNeedToZone == 1 then + player:startEvent(78, player:getGil()) -- dummy questions, costs you 1000 gil + elseif transformationsProgress == 1 then + player:startEvent(721, player:getGil()) + else + player:startEvent(720, player:getGil()) -- starts Transformations + end else - player:startEvent(721, player:getGil()) -- starts Transformations + player:startEvent(63) end elseif transformations == QUEST_ACCEPTED then - if player:getCharVar("TransformationsProgress") == 2 then - player:startEvent(723, player:getGil()) -- clue about possible route to take, costs you 1000 gil - end - + player:startEvent(723, player:getGil()) -- clue about possible route to take, costs you 1000 gil -- DEFAULT DIALOG + elseif anEmptyVessel == QUEST_COMPLETED then + if divinationReady then + player:startEvent(78, player:getGil()) -- dummy questions, costs you 1000 gil + else + player:startEvent(63) + end else player:startEvent(61) end @@ -215,8 +227,10 @@ function onEventFinish(player, csid, option) player:messageSpecial(ID.text.PAY_DIVINATION) -- You pay 1000 gil for the divination. -- TRANSFORMATIONS - elseif csid == 721 and option == 1 and player:getGil() >= 1000 then - player:setCharVar("TransformationsProgress", 1) + elseif (csid == 720 or csid == 721) and option == 1 and player:getGil() >= 1000 then + if csid == 720 then + player:setCharVar("TransformationsProgress", 1) + end player:delGil(1000) player:messageSpecial(ID.text.PAY_DIVINATION) -- You pay 1000 gil for the divination. elseif csid == 723 and option == 1 and TransformationsProgress == 2 and player:getGil() >= 1000 then diff --git a/scripts/zones/Alzadaal_Undersea_Ruins/IDs.lua b/scripts/zones/Alzadaal_Undersea_Ruins/IDs.lua index 9d93ec61016..790fc846221 100644 --- a/scripts/zones/Alzadaal_Undersea_Ruins/IDs.lua +++ b/scripts/zones/Alzadaal_Undersea_Ruins/IDs.lua @@ -51,6 +51,7 @@ zones[tpz.zone.ALZADAAL_UNDERSEA_RUINS] = { RUNIC_PORTAL_NORTH = 17072236, RUNIC_PORTAL_SOUTH = 17072237, + NEPIONIC_QM = 17072271, }, } diff --git a/scripts/zones/Alzadaal_Undersea_Ruins/Zone.lua b/scripts/zones/Alzadaal_Undersea_Ruins/Zone.lua index 627b4c50e8f..030c33889b5 100644 --- a/scripts/zones/Alzadaal_Undersea_Ruins/Zone.lua +++ b/scripts/zones/Alzadaal_Undersea_Ruins/Zone.lua @@ -35,8 +35,8 @@ function onInitialize(zone) zone:registerRegion(21,-556, -2,-489,-550, 0,-483) -- map 12 east porter (white) zone:registerRegion(22,-610, -2,-489,-603, 0,-483) -- map 12 west porter (blue) zone:registerRegion(23, 382, -1,-582, 399, 1,-572) -- mission 9 TOAU - zone:registerRegion(24,-495, 0, 675,-505, 0, 665) -- transformations (quest) TODO: NEEDS CORRECT COORDINATES plz halp - zone:registerRegion(25,-493, 0, 664,-505, 0, 653) -- transformations (quest) TODO: NEEDS CORRECT COORDINATES plz halp + zone:registerRegion(24, 52, -1, 774, 67, 1, 778) -- transformations (quest) + zone:registerRegion(25, 134, -1,-584, 146, 1,-577) -- transformations (quest) end function onZoneIn(player,prevZone) @@ -65,7 +65,6 @@ function afterZoneIn(player) end function onRegionEnter(player,region) - local transformationsProgress = player:getCharVar("TransformationsProgress") switch (region:GetRegionID()): caseof { @@ -141,12 +140,12 @@ function onRegionEnter(player,region) end end, [24] = function (x) - if transformationsProgress == 2 then + if player:getCharVar("TransformationsProgress") == 2 then player:startEvent(2) end end, [25] = function (x) - if transformationsProgress <= 2 then + if player:getCharVar("TransformationsProgress") == 3 then player:startEvent(3) end end, diff --git a/scripts/zones/Alzadaal_Undersea_Ruins/mobs/Nepionic_Soulflayer.lua b/scripts/zones/Alzadaal_Undersea_Ruins/mobs/Nepionic_Soulflayer.lua index 8bbbfecc400..6ca8c749312 100644 --- a/scripts/zones/Alzadaal_Undersea_Ruins/mobs/Nepionic_Soulflayer.lua +++ b/scripts/zones/Alzadaal_Undersea_Ruins/mobs/Nepionic_Soulflayer.lua @@ -12,12 +12,8 @@ function onMobInitialize(mob) mob:setMobMod(tpz.mobMod.IDLE_DESPAWN, 180) end -function onMobSpawn(mob) - DespawnMob(mob:getID(), 180) -end - function onMobDeath(mob, player, isKiller) - if player:getCharVar("TransformationsProgress") >= 2 then + if player:getCharVar("TransformationsProgress") == 4 then player:setCharVar("TransformationsProgress", 5) end end diff --git a/scripts/zones/Alzadaal_Undersea_Ruins/npcs/21.lua b/scripts/zones/Alzadaal_Undersea_Ruins/npcs/21.lua index 73f02cbad1f..1a4ef92dcf8 100644 --- a/scripts/zones/Alzadaal_Undersea_Ruins/npcs/21.lua +++ b/scripts/zones/Alzadaal_Undersea_Ruins/npcs/21.lua @@ -12,9 +12,9 @@ end; function onTrigger(player,npc) local transformationsProgress = player:getCharVar("TransformationsProgress") -- TRANSFORMATIONS - if transformationsProgress >= 2 and transformationsProgress <= 4 and not GetMobByID(ID.mob.NEPIONIC_SOULFLAYER):isSpawned() then + if transformationsProgress == 4 then player:startEvent(4) - elseif player:getCharVar("TransformationsProgress") == 5 then + elseif transformationsProgress == 5 then player:startEvent(5) else player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY) @@ -26,7 +26,7 @@ end function onEventFinish(player,csid,option) if csid == 4 then - SpawnMob(ID.mob.NEPIONIC_SOULFLAYER) + npcUtil.popFromQM(player, GetNPCByID(ID.npc.NEPIONIC_QM), ID.mob.NEPIONIC_SOULFLAYER, {hide = 1}) elseif csid == 5 then npcUtil.completeQuest(player, AHT_URHGAN, TRANSFORMATIONS, { item = 15265, diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index ece30cd2038..3806951a3fa 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -2891,7 +2891,7 @@ INSERT INTO `mob_pools` VALUES (2830,'Nephiyl_Pinnacletosser','Nephiyl_Pinnaclet INSERT INTO `mob_pools` VALUES (2831,'Nephiyl_Rampartbreacher','Nephiyl_Rampartbreacher',126,0x0000BF0200000000000000000000000000000000,1,1,5,240,100,0,1,1,1,18,0,0,4216,131,0,0,0,1,0,126); INSERT INTO `mob_pools` VALUES (2832,'Nepionic_Bladmall','Nepionic_Bladmall',251,0x0000510500000000000000000000000000000000,1,1,7,290,100,0,1,1,1,0,0,0,3253,129,0,0,0,1,0,251); INSERT INTO `mob_pools` VALUES (2833,'Nepionic_Parata','Nepionic_Parata',251,0x0000510500000000000000000000000000000000,1,1,7,290,100,0,1,1,1,0,0,0,1247,129,0,0,0,1,0,251); -INSERT INTO `mob_pools` VALUES (2834,'Nepionic_Soulflayer','Nepionic_Soulflayer',233,0x0000EF0600000000000000000000000000000000,4,4,5,240,100,0,1,1,1,2,0,0,0,131,0,0,28,1,0,1011); +INSERT INTO `mob_pools` VALUES (2834,'Nepionic_Soulflayer','Nepionic_Soulflayer',233,0x0000EF0600000000000000000000000000000000,4,4,5,240,100,0,1,1,1,2,0,0,0,131,0,0,28,1,0,234); INSERT INTO `mob_pools` VALUES (2835,'Nest_Beetle','Nest_Beetle',49,0x0000980100000000000000000000000000000000,7,7,8,240,100,0,0,0,1,0,0,0,344,129,0,0,0,1,0,49); INSERT INTO `mob_pools` VALUES (2836,'Nguruvilu','Nguruvilu',198,0x0000D00600000000000000000000000000000000,1,4,6,240,100,0,0,0,0,2,0,0,0,0,0,0,0,1,0,823); INSERT INTO `mob_pools` VALUES (2837,'Nickel_Quadav_both','Nickel_Quadav_both',202,0x00004F0800000000000000000000000000000000,7,7,3,265,100,0,1,0,1,0,0,0,1,131,0,0,4,1,0,202); diff --git a/sql/mob_skill_lists.sql b/sql/mob_skill_lists.sql index ab90c5a2714..f127325662b 100644 --- a/sql/mob_skill_lists.sql +++ b/sql/mob_skill_lists.sql @@ -1060,6 +1060,7 @@ INSERT INTO `mob_skill_lists` VALUES ('Soulflayer',233,1967); INSERT INTO `mob_skill_lists` VALUES ('Soulflayer',233,1968); INSERT INTO `mob_skill_lists` VALUES ('Spheroid',234,561); INSERT INTO `mob_skill_lists` VALUES ('Spheroid',234,984); +-- INSERT INTO `mob_skill_lists` VALUES ('Soulflayer_NM',234,1969); INSERT INTO `mob_skill_lists` VALUES ('Spider',235,810); INSERT INTO `mob_skill_lists` VALUES ('Spider',235,811); INSERT INTO `mob_skill_lists` VALUES ('Spider',235,812); @@ -3461,10 +3462,4 @@ INSERT INTO `mob_skill_lists` VALUES ('Siren',1010,3512); -- Sonic Buffet INSERT INTO `mob_skill_lists` VALUES ('Siren',1010,3513); -- Entice INSERT INTO `mob_skill_lists` VALUES ('Siren',1010,3514); -- Hysteric Assault INSERT INTO `mob_skill_lists` VALUES ('Siren',1010,3515); -- Clarsach Call -INSERT INTO `mob_skill_lists` VALUES ('Nepionic_Soulflayer',1011,1963); --- INSERT INTO `mob_skill_lists` VALUES ('Nepionic_Soulflayer',1011,1964); --- INSERT INTO `mob_skill_lists` VALUES ('Nepionic_Soulflayer',1011,1965); -INSERT INTO `mob_skill_lists` VALUES ('Nepionic_Soulflayer',1011,1966); -INSERT INTO `mob_skill_lists` VALUES ('Nepionic_Soulflayer',1011,1967); -INSERT INTO `mob_skill_lists` VALUES ('Nepionic_Soulflayer',1011,1968); -INSERT INTO `mob_skill_lists` VALUES ('Nepionic_Soulflayer',1011,1969); -- Reprobation +