From 1f500fc2b24a92941058b4df626b259d3283ab2b Mon Sep 17 00:00:00 2001 From: ibm2431 Date: Mon, 11 May 2020 17:44:43 -0700 Subject: [PATCH] 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 +