Skip to content

Commit

Permalink
Merge pull request #5719 from LandSandBoat/interaction/battlefield-ce…
Browse files Browse the repository at this point in the history
…lestial-nexus

Interaction - Battlefield: The Celestial Nexus
  • Loading branch information
claywar authored May 13, 2024
2 parents 362f740 + cd23aca commit e42b3b4
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 105 deletions.
121 changes: 121 additions & 0 deletions scripts/battlefields/The_Celestial_Nexus/celestial_nexus.lua
Original file line number Diff line number Diff line change
@@ -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()
1 change: 1 addition & 0 deletions scripts/battlefields/Throne_Room/shadow_lord_battle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
9 changes: 0 additions & 9 deletions scripts/globals/bcnm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions scripts/zones/The_Celestial_Nexus/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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] <number> Login Campaign is currently underway!
LOGIN_NUMBER = 7003, -- In celebration of your most recent login (login no. <number>), we have provided you with <number> points! You currently have a total of <number> points.
MEMBERS_LEVELS_ARE_RESTRICTED = 7023, -- Your party is unable to participate because certain members' levels are restricted.
MEMBERS_OF_YOUR_PARTY = 7534, -- Currently, <number> 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 <number> 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 =
{
Expand Down
42 changes: 0 additions & 42 deletions scripts/zones/The_Celestial_Nexus/bcnms/celestial_nexus.lua

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/zones/The_Celestial_Nexus/mobs/Ealdnarche.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 0 additions & 6 deletions scripts/zones/The_Celestial_Nexus/mobs/Ealdnarche_2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 1 addition & 11 deletions scripts/zones/The_Celestial_Nexus/mobs/Exoplates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
23 changes: 0 additions & 23 deletions scripts/zones/The_Celestial_Nexus/mobs/Orbital.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion scripts/zones/The_Celestial_Nexus/npcs/_513.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-----------------------------------
-- Area: Celestial Nexus
-- NPC: _515
-- NPC: _513
-----------------------------------
local entity = {}

Expand Down

0 comments on commit e42b3b4

Please sign in to comment.