From cd23aca552de073a90754b445042c074512f590d Mon Sep 17 00:00:00 2001 From: claywar Date: Mon, 13 May 2024 13:25:42 -0400 Subject: [PATCH] Interaction - Battlefield: The Celestial Nexus Fix errors, add orbitals to entity list Add engage timer, fix ID references Remove bcnm checks for Celestial Nexus Remove unused variable --- .../The_Celestial_Nexus/celestial_nexus.lua | 121 ++++++++++++++++++ .../Throne_Room/shadow_lord_battle.lua | 1 + scripts/globals/bcnm.lua | 9 -- scripts/zones/The_Celestial_Nexus/IDs.lua | 5 + .../bcnms/celestial_nexus.lua | 42 ------ .../The_Celestial_Nexus/mobs/Ealdnarche.lua | 13 -- .../The_Celestial_Nexus/mobs/Ealdnarche_2.lua | 6 - .../The_Celestial_Nexus/mobs/Exoplates.lua | 12 +- .../The_Celestial_Nexus/mobs/Orbital.lua | 23 ---- .../zones/The_Celestial_Nexus/npcs/_513.lua | 2 +- 10 files changed, 129 insertions(+), 105 deletions(-) create mode 100644 scripts/battlefields/The_Celestial_Nexus/celestial_nexus.lua delete mode 100644 scripts/zones/The_Celestial_Nexus/bcnms/celestial_nexus.lua diff --git a/scripts/battlefields/The_Celestial_Nexus/celestial_nexus.lua b/scripts/battlefields/The_Celestial_Nexus/celestial_nexus.lua new file mode 100644 index 00000000000..6956e092943 --- /dev/null +++ b/scripts/battlefields/The_Celestial_Nexus/celestial_nexus.lua @@ -0,0 +1,121 @@ +----------------------------------- +-- Area: The Celestial Nexus +-- Name: The Celestial Nexus (ZM16) +----------------------------------- +local celestialNexusID = zones[xi.zone.THE_CELESTIAL_NEXUS] +----------------------------------- + +local content = BattlefieldMission:new({ + zoneId = xi.zone.THE_CELESTIAL_NEXUS, + battlefieldId = xi.battlefield.id.CELESTIAL_NEXUS, + isMission = true, + maxPlayers = 6, + levelCap = 75, + timeLimit = utils.minutes(30), + index = 0, + entryNpc = '_513', + + -- TODO: This needs verification, and potentially updating the door inside of the arena to not open + -- and display appropriate message. + exitNpcs = { }, + + missionArea = xi.mission.log_id.ZILART, + mission = xi.mission.id.zilart.THE_CELESTIAL_NEXUS, + missionStatusArea = xi.mission.log_id.ZILART, + requiredMissionStatus = 0, +}) + +function content:onEventFinishBattlefield(player, csid, option, npc) + if csid == 32004 then + local battlefield = player:getBattlefield() + local phaseTwoId = content.groups[4]['mobIds'][battlefield:getArea()][1] + local phaseTwo = GetMobByID(phaseTwoId) + + if phaseTwo:isSpawned() then + return + end + + DespawnMob(content.groups[1]['mobIds'][battlefield:getArea()][1]) + SpawnMob(phaseTwoId) + + phaseTwo:setLocalVar('targetId', player:getTargID()) + phaseTwo:timer(30000, function(mobArg) + phaseTwo:engage(mobArg:getLocalVar('targetId')) + end) + end +end + +content.groups = +{ + -- Phase 1 - Eald'narche + { + mobIds = + { + { celestialNexusID.mob.EALDNARCHE }, + { celestialNexusID.mob.EALDNARCHE + 5 }, + { celestialNexusID.mob.EALDNARCHE + 10 }, + }, + + death = function(battlefield, mob) + local mobId = mob:getID() + for orbitalId = mobId + 3, mobId + 4 do + DespawnMob(orbitalId) + end + + local players = battlefield:getPlayers() + for _, player in pairs(players) do + player:startEvent(32004, battlefield:getArea()) + end + end + }, + + -- Phase 1 - Exoplates + { + mobIds = + { + { celestialNexusID.mob.EALDNARCHE + 1 }, + { celestialNexusID.mob.EALDNARCHE + 6 }, + { celestialNexusID.mob.EALDNARCHE + 11 }, + }, + }, + + -- Phase 1 - Orbitals + { + mobIds = + { + { + celestialNexusID.mob.EALDNARCHE + 3, + celestialNexusID.mob.EALDNARCHE + 4, + }, + + { + celestialNexusID.mob.EALDNARCHE + 8, + celestialNexusID.mob.EALDNARCHE + 9, + }, + + { + celestialNexusID.mob.EALDNARCHE + 13, + celestialNexusID.mob.EALDNARCHE + 14, + }, + }, + + spawned = false, + }, + + -- Phase 2 - Eald'narche + { + mobIds = + { + { celestialNexusID.mob.EALDNARCHE + 2 }, + { celestialNexusID.mob.EALDNARCHE + 7 }, + { celestialNexusID.mob.EALDNARCHE + 12 }, + }, + + spawned = false, + death = function(battlefield, mob) + battlefield:setStatus(xi.battlefield.status.WON) + end + }, +} + +return content:register() diff --git a/scripts/battlefields/Throne_Room/shadow_lord_battle.lua b/scripts/battlefields/Throne_Room/shadow_lord_battle.lua index 340c72ebf9e..0eede9bddc1 100644 --- a/scripts/battlefields/Throne_Room/shadow_lord_battle.lua +++ b/scripts/battlefields/Throne_Room/shadow_lord_battle.lua @@ -9,6 +9,7 @@ local ID = zones[xi.zone.THRONE_ROOM] local content = BattlefieldMission:new({ zoneId = xi.zone.THRONE_ROOM, battlefieldId = xi.battlefield.id.SHADOW_LORD_BATTLE, + isMission = true, maxPlayers = 6, levelCap = 75, timeLimit = utils.minutes(30), diff --git a/scripts/globals/bcnm.lua b/scripts/globals/bcnm.lua index 34224042efe..397c7181018 100644 --- a/scripts/globals/bcnm.lua +++ b/scripts/globals/bcnm.lua @@ -531,7 +531,6 @@ local function checkReqs(player, npc, bfid, registrant) local sandoriaMission = player:getCurrentMission(xi.mission.log_id.SANDORIA) local windurstMission = player:getCurrentMission(xi.mission.log_id.WINDURST) - local zilartMission = player:getCurrentMission(xi.mission.log_id.ZILART) local promathiaMission = player:getCurrentMission(xi.mission.log_id.COP) local toauMission = player:getCurrentMission(xi.mission.log_id.TOAU) -- local acpMission = player:getCurrentMission(xi.mission.log_id.ACP) NOTE: UNUSED Until BCNMID 532 is Re-enabled @@ -587,10 +586,6 @@ local function checkReqs(player, npc, bfid, registrant) nationStatus == 2 end, - [320] = function() -- ZM16: The Celestial Nexus - return zilartMission == xi.mission.id.zilart.THE_CELESTIAL_NEXUS - end, - [416] = function() -- Quest: Trial by Wind return player:hasKeyItem(xi.ki.TUNING_FORK_OF_WIND) end, @@ -1163,10 +1158,6 @@ local function checkSkip(player, bfid) ) end, - [320] = function() -- ZM16: The Celestial Nexus - return player:hasCompletedMission(xi.mission.log_id.ZILART, xi.mission.id.zilart.THE_CELESTIAL_NEXUS) - end, - [416] = function() -- Quest: Trial by Wind return player:hasCompletedQuest(xi.questLog.OUTLANDS, xi.quest.id.outlands.TRIAL_BY_WIND) or player:hasKeyItem(xi.ki.WHISPER_OF_GALES) diff --git a/scripts/zones/The_Celestial_Nexus/IDs.lua b/scripts/zones/The_Celestial_Nexus/IDs.lua index 1b9f8349d38..a8d9a3fe6ee 100644 --- a/scripts/zones/The_Celestial_Nexus/IDs.lua +++ b/scripts/zones/The_Celestial_Nexus/IDs.lua @@ -15,12 +15,17 @@ zones[xi.zone.THE_CELESTIAL_NEXUS] = LOGIN_CAMPAIGN_UNDERWAY = 7002, -- The [/January/February/March/April/May/June/July/August/September/October/November/December] Login Campaign is currently underway! LOGIN_NUMBER = 7003, -- In celebration of your most recent login (login no. ), we have provided you with points! You currently have a total of points. MEMBERS_LEVELS_ARE_RESTRICTED = 7023, -- Your party is unable to participate because certain members' levels are restricted. + MEMBERS_OF_YOUR_PARTY = 7534, -- Currently, members of your party (including yourself) have clearance to enter the battlefield. + MEMBERS_OF_YOUR_ALLIANCE = 7535, -- Currently, # members of your alliance (including yourself) have clearance to enter the battlefield. + TIME_LIMIT_FOR_THIS_BATTLE_IS = 7537, -- The time limit for this battle is minutes. CONQUEST_BASE = 7064, -- Tallying conquest results... PARTY_MEMBERS_HAVE_FALLEN = 7573, -- All party members have fallen in battle. Now leaving the battlefield. THE_PARTY_WILL_BE_REMOVED = 7580, -- If all party members' HP are still zero after # minute[/s], the party will be removed from the battlefield. + ENTERING_THE_BATTLEFIELD_FOR = 7601, -- Entering the battlefield for [The Celestial Nexus/The Celestial Nexus/Crystal Paradise]! }, mob = { + EALDNARCHE = GetFirstID('Ealdnarche'), }, npc = { diff --git a/scripts/zones/The_Celestial_Nexus/bcnms/celestial_nexus.lua b/scripts/zones/The_Celestial_Nexus/bcnms/celestial_nexus.lua deleted file mode 100644 index 33bbef3305a..00000000000 --- a/scripts/zones/The_Celestial_Nexus/bcnms/celestial_nexus.lua +++ /dev/null @@ -1,42 +0,0 @@ ------------------------------------ --- Area: The Celestial Nexus --- Name: The Celestial Nexus (ZM16) ------------------------------------ -local battlefieldObject = {} - -battlefieldObject.onBattlefieldTick = function(battlefield, tick) - xi.battlefield.onBattlefieldTick(battlefield, tick) -end - -battlefieldObject.onBattlefieldInitialise = function(battlefield) - battlefield:setLocalVar('phaseChange', 1) -end - -battlefieldObject.onBattlefieldRegister = function(player, battlefield) -end - -battlefieldObject.onBattlefieldEnter = function(player, battlefield) -end - -battlefieldObject.onBattlefieldLeave = function(player, battlefield, leavecode) - if leavecode == xi.battlefield.leaveCode.WON then - local _, clearTime, partySize = battlefield:getRecord() - - if player:getCurrentMission(xi.mission.log_id.ZILART) == xi.mission.id.zilart.THE_CELESTIAL_NEXUS then - player:setLocalVar('battlefieldWin', battlefield:getID()) - end - - local arg8 = (player:hasCompletedMission(xi.mission.log_id.ZILART, xi.mission.id.zilart.THE_CELESTIAL_NEXUS)) and 1 or 0 - player:startEvent(32001, battlefield:getArea(), clearTime, partySize, battlefield:getTimeInside(), 1, battlefield:getLocalVar('[cs]bit'), arg8) - elseif leavecode == xi.battlefield.leaveCode.LOST then - player:startEvent(32002) - end -end - -battlefieldObject.onEventUpdate = function(player, csid, option, npc) -end - -battlefieldObject.onEventFinish = function(player, csid, option, npc) -end - -return battlefieldObject diff --git a/scripts/zones/The_Celestial_Nexus/mobs/Ealdnarche.lua b/scripts/zones/The_Celestial_Nexus/mobs/Ealdnarche.lua index 8a49b5088f1..7358f759d0b 100644 --- a/scripts/zones/The_Celestial_Nexus/mobs/Ealdnarche.lua +++ b/scripts/zones/The_Celestial_Nexus/mobs/Ealdnarche.lua @@ -42,25 +42,12 @@ entity.onMobFight = function(mob, target) end entity.onMobDeath = function(mob, player, optParams) - DespawnMob(mob:getID() + 1) - DespawnMob(mob:getID() + 3) - DespawnMob(mob:getID() + 4) - local battlefield = player:getBattlefield() - player:startEvent(32004, battlefield:getArea()) end entity.onEventUpdate = function(player, csid, option, npc) end entity.onEventFinish = function(player, csid, option, npc) - if csid == 32004 then - DespawnMob(npc:getID()) - local mob = SpawnMob(npc:getID() + 2) - mob:updateEnmity(player) - --the "30 seconds of rest" you get before he attacks you, and making sure he teleports first in range - mob:addStatusEffectEx(xi.effect.BIND, 0, 1, 0, 30) - mob:addStatusEffectEx(xi.effect.SILENCE, 0, 1, 0, 40) - end end return entity diff --git a/scripts/zones/The_Celestial_Nexus/mobs/Ealdnarche_2.lua b/scripts/zones/The_Celestial_Nexus/mobs/Ealdnarche_2.lua index 349830e924b..143dbde7384 100644 --- a/scripts/zones/The_Celestial_Nexus/mobs/Ealdnarche_2.lua +++ b/scripts/zones/The_Celestial_Nexus/mobs/Ealdnarche_2.lua @@ -15,12 +15,6 @@ end entity.onMobSpawn = function(mob) mob:setMobMod(xi.mobMod.GA_CHANCE, 25) - if - GetMobByID(mob:getID() - 1):isDead() and - GetMobByID(mob:getID() - 2):isDead() - then - mob:getBattlefield():setLocalVar('phaseChange', 0) - end end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/The_Celestial_Nexus/mobs/Exoplates.lua b/scripts/zones/The_Celestial_Nexus/mobs/Exoplates.lua index da7266d4a19..a91f13181db 100644 --- a/scripts/zones/The_Celestial_Nexus/mobs/Exoplates.lua +++ b/scripts/zones/The_Celestial_Nexus/mobs/Exoplates.lua @@ -48,6 +48,7 @@ end entity.onMobDeath = function(mob, player, optParams) local ealdnarche = GetMobByID(mob:getID() - 1) + ealdnarche:delStatusEffect(xi.effect.PHYSICAL_SHIELD, 0, 1, 0, 0) ealdnarche:delStatusEffect(xi.effect.ARROW_SHIELD, 0, 1, 0, 0) ealdnarche:delStatusEffect(xi.effect.MAGIC_SHIELD, 0, 1, 0, 0) @@ -57,17 +58,6 @@ entity.onEventUpdate = function(player, csid, option, npc) end entity.onEventFinish = function(player, csid, option, npc) - if csid == 32004 then - DespawnMob(npc:getID()) - DespawnMob(npc:getID() - 1) - DespawnMob(npc:getID() + 2) - DespawnMob(npc:getID() + 3) - local mob = SpawnMob(npc:getID() + 1) - mob:updateEnmity(player) - -- the "30 seconds of rest" you get before he attacks you, and making sure he teleports first in range - mob:addStatusEffectEx(xi.effect.BIND, 0, 1, 0, 30) - mob:addStatusEffectEx(xi.effect.SILENCE, 0, 1, 0, 40) - end end return entity diff --git a/scripts/zones/The_Celestial_Nexus/mobs/Orbital.lua b/scripts/zones/The_Celestial_Nexus/mobs/Orbital.lua index 3895d119467..13ee1ce8916 100644 --- a/scripts/zones/The_Celestial_Nexus/mobs/Orbital.lua +++ b/scripts/zones/The_Celestial_Nexus/mobs/Orbital.lua @@ -16,29 +16,6 @@ entity.onEventUpdate = function(player, csid, option, npc) end entity.onEventFinish = function(player, csid, option, npc) - if csid == 32004 then - if GetMobByID(npc:getID() - 1):getName() == 'Orbital' then - DespawnMob(npc:getID()) - DespawnMob(npc:getID() - 1) - DespawnMob(npc:getID() - 3) - DespawnMob(npc:getID() - 4) - local mob = SpawnMob(npc:getID()-2) - mob:updateEnmity(player) - --the '30 seconds of rest' you get before he attacks you, and making sure he teleports first in range - mob:addStatusEffectEx(xi.effect.BIND, 0, 1, 0, 30) - mob:addStatusEffectEx(xi.effect.SILENCE, 0, 1, 0, 40) - else - DespawnMob(npc:getID()) - DespawnMob(npc:getID() + 1) - DespawnMob(npc:getID() - 2) - DespawnMob(npc:getID() - 3) - local mob = SpawnMob(npc:getID()-1) - mob:updateEnmity(player) - -- the '30 seconds of rest' you get before he attacks you, and making sure he teleports first in range - mob:addStatusEffectEx(xi.effect.BIND, 0, 1, 0, 30) - mob:addStatusEffectEx(xi.effect.SILENCE, 0, 1, 0, 40) - end - end end return entity diff --git a/scripts/zones/The_Celestial_Nexus/npcs/_513.lua b/scripts/zones/The_Celestial_Nexus/npcs/_513.lua index 452e3a767c2..d06a52d703f 100644 --- a/scripts/zones/The_Celestial_Nexus/npcs/_513.lua +++ b/scripts/zones/The_Celestial_Nexus/npcs/_513.lua @@ -1,6 +1,6 @@ ----------------------------------- -- Area: Celestial Nexus --- NPC: _515 +-- NPC: _513 ----------------------------------- local entity = {}