Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Blue Mage Transformations quest + other 3 armor pieces
Browse files Browse the repository at this point in the history
Only thing missing are set the onRegionEnter zone correctly and add 2 mob skills that are missing from soulflayers (and this nm too)
  • Loading branch information
kaincenteno committed May 7, 2020
1 parent a96c492 commit ca738be
Show file tree
Hide file tree
Showing 13 changed files with 285 additions and 15 deletions.
33 changes: 33 additions & 0 deletions scripts/globals/mobskills/reprobation.lua
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion scripts/globals/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Aht_Urhgan_Whitegate/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 <item>!
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!
Expand Down
15 changes: 12 additions & 3 deletions scripts/zones/Aht_Urhgan_Whitegate/npcs/Imperial_Whitegate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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

Expand Down Expand Up @@ -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
126 changes: 122 additions & 4 deletions scripts/zones/Aht_Urhgan_Whitegate/npcs/Lathuya.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-----------------------------------
-----------------------------------
-- Area: Aht Urhgan Whitegate
-- NPC: Lathuya
-- Standard Info NPC
Expand All @@ -9,36 +9,129 @@ 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)
end
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
Expand All @@ -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
31 changes: 29 additions & 2 deletions scripts/zones/Aht_Urhgan_Whitegate/npcs/Waoud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
3 changes: 3 additions & 0 deletions scripts/zones/Alzadaal_Undersea_Ruins/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ zones[tpz.zone.ALZADAAL_UNDERSEA_RUINS] =
CANNOT_LEAVE = 7220, -- You cannot leave this area while in the possession of <keyitem>.
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.
Expand All @@ -34,6 +35,7 @@ zones[tpz.zone.ALZADAAL_UNDERSEA_RUINS] =
},
mob =
{
NEPIONIC_SOULFLAYER = 17072129,
COOKIEDUSTER_LIPIROON_PH =
{
[17072142] = 17072150,
Expand All @@ -43,6 +45,7 @@ zones[tpz.zone.ALZADAAL_UNDERSEA_RUINS] =
CHEESE_HOARDER_GIGIROON = 17072172,
ARMED_GEARS = 17072178,
WULGARU = 17072179,

},
npc =
{
Expand Down
Loading

0 comments on commit ca738be

Please sign in to comment.