Skip to content

Commit

Permalink
Interaction - Battlefield: Desires of Emptiness
Browse files Browse the repository at this point in the history
Properly set battlefield exit npcs

Fix BattlefieldMission checkSkipCutscene for var changes

Update skipcs checks to include further progress in current mission

Remove old desires of emptiness bcnm checks
  • Loading branch information
claywar committed May 18, 2024
1 parent 45ce0c9 commit 847834d
Show file tree
Hide file tree
Showing 11 changed files with 99 additions and 75 deletions.
1 change: 0 additions & 1 deletion scripts/battlefields/QuBia_Arena/rank_5_mission.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ local content = BattlefieldMission:new({
levelCap = 50,
timeLimit = utils.minutes(30),
index = 0,
superlinkAll = true,
entryNpc = 'BC_Entrance',
exitNpc = 'Burning_Circle',
mission = xi.mission.id.nation.ARCHLICH,
Expand Down
85 changes: 85 additions & 0 deletions scripts/battlefields/Spire_of_Vahzl/desires_of_emptiness.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
-----------------------------------
-- Desires of Emptiness
-- Spire of Vahzl mission battlefield
-----------------------------------
local spireOfVahzlID = zones[xi.zone.SPIRE_OF_VAHZL]
-----------------------------------

local content = BattlefieldMission:new({
zoneId = xi.zone.SPIRE_OF_VAHZL,
battlefieldId = xi.battlefield.id.DESIRES_OF_EMPTINESS,
isMission = true,
maxPlayers = 6,
levelCap = 50,
timeLimit = utils.minutes(30),
index = 0,
entryNpc = '_0n0',
exitNpcs = { '_0n1', '_0n2', '_0n3' },
missionArea = xi.mission.log_id.COP,
mission = xi.mission.id.cop.DESIRES_OF_EMPTINESS,
requiredVar = 'Mission[6][518]Status',
requiredValue = 2,

grantXP = 1500,
title = xi.title.FROZEN_DEAD_BODY,
})

content.groups =
{
{
mobIds =
{
{
spireOfVahzlID.mob.AGONIZER,
spireOfVahzlID.mob.AGONIZER + 1,
spireOfVahzlID.mob.AGONIZER + 6,
},

{
spireOfVahzlID.mob.AGONIZER + 7,
spireOfVahzlID.mob.AGONIZER + 8,
spireOfVahzlID.mob.AGONIZER + 13,
},

{
spireOfVahzlID.mob.AGONIZER + 14,
spireOfVahzlID.mob.AGONIZER + 15,
spireOfVahzlID.mob.AGONIZER + 20,
},
},

allDeath = function(battlefield, mob)
battlefield:setStatus(xi.battlefield.status.WON)
end,
},

{
mobIds =
{
{
spireOfVahzlID.mob.AGONIZER + 2,
spireOfVahzlID.mob.AGONIZER + 3,
spireOfVahzlID.mob.AGONIZER + 4,
spireOfVahzlID.mob.AGONIZER + 5,
},

{
spireOfVahzlID.mob.AGONIZER + 9,
spireOfVahzlID.mob.AGONIZER + 10,
spireOfVahzlID.mob.AGONIZER + 11,
spireOfVahzlID.mob.AGONIZER + 12,
},

{
spireOfVahzlID.mob.AGONIZER + 16,
spireOfVahzlID.mob.AGONIZER + 17,
spireOfVahzlID.mob.AGONIZER + 18,
spireOfVahzlID.mob.AGONIZER + 19,
},
},

spawned = false,
},
}

return content:register()
9 changes: 6 additions & 3 deletions scripts/globals/battlefield.lua
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ xi.battlefield.id =
ANCIENT_FLAMES_BECKON_SPIRE_OF_MEA = 832, -- Converted
PLAYING_HOST = 833,
EMPTY_DESIRES = 834,
DESIRES_OF_EMPTINESS = 864,
DESIRES_OF_EMPTINESS = 864, -- Converted
PULLING_THE_PLUG = 865,
EMPTY_ASPIRATIONS = 866,
STORMS_OF_FATE = 896,
Expand Down Expand Up @@ -1327,7 +1327,8 @@ function BattlefieldMission:checkSkipCutscene(player)
local status = player:getMissionStatus(missionStatusArea, self.missionStatus)

return player:hasCompletedMission(missionArea, self.mission) or
(current == self.mission and status > self.skipMissionStatus)
(self.requiredMissionStatus and current == self.mission and status > self.skipMissionStatus) or
(self.requiredValue and current == self.mission and player:getCharVar(self.requiredVar) > self.requiredValue)
end

function BattlefieldMission:onBattlefieldWin(player, battlefield)
Expand All @@ -1339,7 +1340,9 @@ function BattlefieldMission:onBattlefieldWin(player, battlefield)
end

local _, clearTime, partySize = battlefield:getRecord()
local canSkipCS = (current ~= self.mission) and 1 or 0
local canSkipCS = (player:hasCompletedMission(missionArea, self.mission) or
(self.requiredMissionStatus and current == self.mission and status > self.skipMissionStatus) or
(self.requiredValue and current == self.mission and player:getCharVar(self.requiredVar) > self.requiredValue)) and 1 or 0

player:startEvent(32001, battlefield:getArea(), clearTime, partySize, battlefield:getTimeInside(), player:getZoneID(), self.index, canSkipCS)
end
Expand Down
13 changes: 0 additions & 13 deletions scripts/globals/bcnm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -763,11 +763,6 @@ local function checkReqs(player, npc, bfid, registrant)
return player:hasKeyItem(xi.ki.CENSER_OF_ANIMUS)
end,

[864] = function() -- PM5-2: Desires of Emptiness
return promathiaMission == xi.mission.id.cop.DESIRES_OF_EMPTINESS and
player:getCharVar('Mission[6][518]Status') == 2
end,

[865] = function() -- ENM: Pulling the Plug
return player:hasKeyItem(xi.ki.CENSER_OF_ACRIMONY)
end,
Expand Down Expand Up @@ -1175,14 +1170,6 @@ local function checkSkip(player, bfid)
player:hasKeyItem(xi.ki.WHISPER_OF_DREAMS)
end,

[864] = function() -- PM5-2: Desires of Emptiness
return player:hasCompletedMission(xi.mission.log_id.COP, xi.mission.id.cop.DESIRES_OF_EMPTINESS) or
(
promathiaMission == xi.mission.id.cop.DESIRES_OF_EMPTINESS and
player:getCharVar('Mission[6][518]Status') > 2
)
end,

[896] = function() -- Quest: Storms of Fate
local stormsOfFateStatus = player:getQuestStatus(xi.questLog.JEUNO, xi.quest.id.jeuno.STORMS_OF_FATE)

Expand Down
7 changes: 7 additions & 0 deletions scripts/missions/cop/5_2_Desires_of_Emptiness.lua
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,13 @@ mission.sections =
mission:getVar(player, 'Status') == 2
then
mission:setVar(player, 'Status', 3)

-- NOTE: Only players on this mission are transported here on completion of
-- the battlefield. All other players will remain at the location of the
-- 32001 event finish, and it is vital that arg7 (canSkipCS) is set, else
-- the player will receive a black screen.

player:setPos(-340.00, -100.25, 140.00, 64, xi.zone.BEAUCEDINE_GLACIER)
end
end,
},
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Spire_of_Vahzl/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ zones[xi.zone.SPIRE_OF_VAHZL] =
},
mob =
{
AGONIZER = GetFirstID('Agonizer'),
},
npc =
{
Expand Down
42 changes: 0 additions & 42 deletions scripts/zones/Spire_of_Vahzl/bcnms/desires_of_emptiness.lua

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/zones/Spire_of_Vahzl/npcs/_0n0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@
local entity = {}

entity.onTrade = function(player, npc, trade)
xi.bcnm.onTrade(player, npc, trade)
end

entity.onTrigger = function(player, npc)
xi.bcnm.onTrigger(player, npc)
end

entity.onEventUpdate = function(player, csid, option, extras)
xi.bcnm.onEventUpdate(player, csid, option, extras)
end

entity.onEventFinish = function(player, csid, option, npc)
xi.bcnm.onEventFinish(player, csid, option, npc)
end

return entity
4 changes: 0 additions & 4 deletions scripts/zones/Spire_of_Vahzl/npcs/_0n1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@
local entity = {}

entity.onTrade = function(player, npc, trade)
xi.bcnm.onTrade(player, npc, trade)
end

entity.onTrigger = function(player, npc)
xi.bcnm.onTrigger(player, npc)
end

entity.onEventUpdate = function(player, csid, option, extras)
xi.bcnm.onEventUpdate(player, csid, option, extras)
end

entity.onEventFinish = function(player, csid, option, npc)
xi.bcnm.onEventFinish(player, csid, option, npc)
end

return entity
4 changes: 0 additions & 4 deletions scripts/zones/Spire_of_Vahzl/npcs/_0n2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@
local entity = {}

entity.onTrade = function(player, npc, trade)
xi.bcnm.onTrade(player, npc, trade)
end

entity.onTrigger = function(player, npc)
xi.bcnm.onTrigger(player, npc)
end

entity.onEventUpdate = function(player, csid, option, extras)
xi.bcnm.onEventUpdate(player, csid, option, extras)
end

entity.onEventFinish = function(player, csid, option, npc)
xi.bcnm.onEventFinish(player, csid, option, npc)
end

return entity
4 changes: 0 additions & 4 deletions scripts/zones/Spire_of_Vahzl/npcs/_0n3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@
local entity = {}

entity.onTrade = function(player, npc, trade)
xi.bcnm.onTrade(player, npc, trade)
end

entity.onTrigger = function(player, npc)
xi.bcnm.onTrigger(player, npc)
end

entity.onEventUpdate = function(player, csid, option, extras)
xi.bcnm.onEventUpdate(player, csid, option, extras)
end

entity.onEventFinish = function(player, csid, option, npc)
xi.bcnm.onEventFinish(player, csid, option, npc)
end

return entity

0 comments on commit 847834d

Please sign in to comment.