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

Commit

Permalink
Transformations fixes + cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ibm2431 committed May 12, 2020
1 parent 0cf58e5 commit 1f500fc
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 73 deletions.
6 changes: 2 additions & 4 deletions scripts/globals/mobskills/reprobation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
47 changes: 23 additions & 24 deletions scripts/zones/Aht_Urhgan_Whitegate/npcs/Imperial_Whitegate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions scripts/zones/Aht_Urhgan_Whitegate/npcs/Lathuya.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
58 changes: 36 additions & 22 deletions scripts/zones/Aht_Urhgan_Whitegate/npcs/Waoud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Alzadaal_Undersea_Ruins/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ zones[tpz.zone.ALZADAAL_UNDERSEA_RUINS] =
{
RUNIC_PORTAL_NORTH = 17072236,
RUNIC_PORTAL_SOUTH = 17072237,
NEPIONIC_QM = 17072271,
},
}

Expand Down
9 changes: 4 additions & 5 deletions scripts/zones/Alzadaal_Undersea_Ruins/Zone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -65,7 +65,6 @@ function afterZoneIn(player)
end

function onRegionEnter(player,region)
local transformationsProgress = player:getCharVar("TransformationsProgress")

switch (region:GetRegionID()): caseof
{
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions scripts/zones/Alzadaal_Undersea_Ruins/npcs/21.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion sql/mob_pools.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 2 additions & 7 deletions sql/mob_skill_lists.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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

0 comments on commit 1f500fc

Please sign in to comment.