From fc8485df1b423a5ef3faace829d84a14d124e501 Mon Sep 17 00:00:00 2001 From: claywar Date: Sat, 11 May 2024 14:25:00 -0400 Subject: [PATCH 1/4] Add secondary updateEnmity call to ensure GM-enabled triggers Avatar --- scripts/mixins/families/avatar.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/mixins/families/avatar.lua b/scripts/mixins/families/avatar.lua index 072b1d76fcc..c047efa1cc2 100644 --- a/scripts/mixins/families/avatar.lua +++ b/scripts/mixins/families/avatar.lua @@ -25,6 +25,10 @@ g_mixins.families.avatar = function(avatarMob) mob:setAutoAttackEnabled(false) mob:setMagicCastingEnabled(false) + -- When GM is enabled, mobs will not automatically engage. Update Enmity one more + -- time to ensure that the listener will actually be triggered. + mob:updateEnmity() + -- If something goes wrong, the avatar will clean itself up in 5s mob:timer(5000, function(mobArg) if mobArg:isAlive() then From 0cd11013808d3cf43806a93735f72cf65959d564 Mon Sep 17 00:00:00 2001 From: claywar Date: Sat, 11 May 2024 14:25:25 -0400 Subject: [PATCH 2/4] Interaction - Battlefield: Temple of Uggalepih --- .../temple_of_uggalepih.lua | 76 +++++++++++++++++++ scripts/globals/battlefield.lua | 2 +- scripts/zones/Sacrificial_Chamber/IDs.lua | 1 + .../bcnms/temple_of_uggalepih.lua | 33 -------- .../zones/Sacrificial_Chamber/npcs/_4j0.lua | 8 -- 5 files changed, 78 insertions(+), 42 deletions(-) create mode 100644 scripts/battlefields/Sacrificial_Chamber/temple_of_uggalepih.lua delete mode 100644 scripts/zones/Sacrificial_Chamber/bcnms/temple_of_uggalepih.lua diff --git a/scripts/battlefields/Sacrificial_Chamber/temple_of_uggalepih.lua b/scripts/battlefields/Sacrificial_Chamber/temple_of_uggalepih.lua new file mode 100644 index 00000000000..2befaf20830 --- /dev/null +++ b/scripts/battlefields/Sacrificial_Chamber/temple_of_uggalepih.lua @@ -0,0 +1,76 @@ +----------------------------------- +-- Temple of Uggalepih +-- Sacrifical Chamber Mission Battlefield +----------------------------------- +local sacrificialChamberID = zones[xi.zone.SACRIFICIAL_CHAMBER] +----------------------------------- + +local content = BattlefieldMission:new({ + zoneId = xi.zone.SACRIFICIAL_CHAMBER, + battlefieldId = xi.battlefield.id.TEMPLE_OF_UGGALEPIH, + isMission = true, + maxPlayers = 6, + levelCap = 75, + timeLimit = utils.minutes(30), + index = 0, + entryNpc = '_4j0', + exitNpcs = { '_4j2', '_4j3', '_4j4' }, + missionArea = xi.mission.log_id.ZILART, + mission = xi.mission.id.zilart.THE_TEMPLE_OF_UGGALEPIH, + missionStatusArea = xi.mission.log_id.ZILART, + requiredMissionStatus = 0, +}) + +content.groups = +{ + { + mobIds = + { + { + sacrificialChamberID.mob.GRAVITON, + sacrificialChamberID.mob.GRAVITON + 1, + sacrificialChamberID.mob.GRAVITON + 2, + }, + + { + sacrificialChamberID.mob.GRAVITON + 5, + sacrificialChamberID.mob.GRAVITON + 6, + sacrificialChamberID.mob.GRAVITON + 7, + }, + + { + sacrificialChamberID.mob.GRAVITON + 10, + sacrificialChamberID.mob.GRAVITON + 11, + sacrificialChamberID.mob.GRAVITON + 12, + }, + }, + + allDeath = function(battlefield, mob) + battlefield:setStatus(xi.battlefield.status.WON) + end, + }, + + -- Elemental + { + mobIds = + { + { sacrificialChamberID.mob.GRAVITON + 3 }, + { sacrificialChamberID.mob.GRAVITON + 8 }, + { sacrificialChamberID.mob.GRAVITON + 13 }, + }, + }, + + -- Avatar + { + mobIds = + { + { sacrificialChamberID.mob.GRAVITON + 4 }, + { sacrificialChamberID.mob.GRAVITON + 9 }, + { sacrificialChamberID.mob.GRAVITON + 14 }, + }, + + spawned = false, + }, +} + +return content:register() diff --git a/scripts/globals/battlefield.lua b/scripts/globals/battlefield.lua index 42b939bff4a..eff8dd48481 100644 --- a/scripts/globals/battlefield.lua +++ b/scripts/globals/battlefield.lua @@ -144,7 +144,7 @@ xi.battlefield.id = V_FORMATION = 114, AVIAN_APOSTATES = 115, BEYOND_INFINITY_BALGAS_DAIS = 116, -- Converted - TEMPLE_OF_UGGALEPIH = 128, + TEMPLE_OF_UGGALEPIH = 128, -- Converted JUNGLE_BOOGYMEN = 129, AMPHIBIAN_ASSAULT = 130, PROJECT_SHANTOTTOFICATION = 131, diff --git a/scripts/zones/Sacrificial_Chamber/IDs.lua b/scripts/zones/Sacrificial_Chamber/IDs.lua index f26b4a0b8be..3c9c7153fc7 100644 --- a/scripts/zones/Sacrificial_Chamber/IDs.lua +++ b/scripts/zones/Sacrificial_Chamber/IDs.lua @@ -30,6 +30,7 @@ zones[xi.zone.SACRIFICIAL_CHAMBER] = }, mob = { + GRAVITON = GetFirstID('Graviton'), }, npc = { diff --git a/scripts/zones/Sacrificial_Chamber/bcnms/temple_of_uggalepih.lua b/scripts/zones/Sacrificial_Chamber/bcnms/temple_of_uggalepih.lua deleted file mode 100644 index d60d9bbb5bb..00000000000 --- a/scripts/zones/Sacrificial_Chamber/bcnms/temple_of_uggalepih.lua +++ /dev/null @@ -1,33 +0,0 @@ ------------------------------------ --- Temple of Uggalepih --- Sacrifical Chamber Mission Battlefield ------------------------------------ -local battlefieldObject = {} - -battlefieldObject.onBattlefieldTick = function(battlefield, tick) - xi.battlefield.onBattlefieldTick(battlefield, tick) -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() - player:setLocalVar('battlefieldWin', battlefield:getID()) - player:startEvent(32001, battlefield:getArea(), clearTime, partySize, battlefield:getTimeInside(), 1, battlefield:getLocalVar('[cs]bit'), 0) - 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/Sacrificial_Chamber/npcs/_4j0.lua b/scripts/zones/Sacrificial_Chamber/npcs/_4j0.lua index 3265acd274d..f303286c766 100644 --- a/scripts/zones/Sacrificial_Chamber/npcs/_4j0.lua +++ b/scripts/zones/Sacrificial_Chamber/npcs/_4j0.lua @@ -3,26 +3,18 @@ -- NPC: Mahogany Door -- !pos 299 0.1 349 163 ----------------------------------- -local ID = zones[xi.zone.SACRIFICIAL_CHAMBER] ------------------------------------ local entity = {} entity.onTrade = function(player, npc, trade) - xi.bcnm.onTrade(player, npc, trade) end entity.onTrigger = function(player, npc) - if not xi.bcnm.onTrigger(player, npc) then - player:messageSpecial(ID.text.NO_BATTLEFIELD_ENTRY) - end 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 From 4e03d7f993b07339b124d934ef1e517132bf7df0 Mon Sep 17 00:00:00 2001 From: claywar Date: Sun, 12 May 2024 10:25:35 -0400 Subject: [PATCH 3/4] Interaction - Battlefield: Amphibian Assault Fix wyvern enmity update --- .../Sacrificial_Chamber/amphibian_assault.lua | 148 ++++++++++++++++++ scripts/globals/battlefield.lua | 2 +- scripts/globals/bcnm.lua | 4 - scripts/zones/Sacrificial_Chamber/IDs.lua | 3 +- .../bcnms/amphibian_assault.lua | 37 ----- .../mobs/Pevv_the_Riverleaper.lua | 17 +- .../npcs/Armoury_Crate.lua | 79 ---------- 7 files changed, 163 insertions(+), 127 deletions(-) create mode 100644 scripts/battlefields/Sacrificial_Chamber/amphibian_assault.lua delete mode 100644 scripts/zones/Sacrificial_Chamber/bcnms/amphibian_assault.lua diff --git a/scripts/battlefields/Sacrificial_Chamber/amphibian_assault.lua b/scripts/battlefields/Sacrificial_Chamber/amphibian_assault.lua new file mode 100644 index 00000000000..52ddd63be25 --- /dev/null +++ b/scripts/battlefields/Sacrificial_Chamber/amphibian_assault.lua @@ -0,0 +1,148 @@ +----------------------------------- +-- Amphibian Assault +-- Sacrificial Chamber BCNM60, Moon Orb +-- !additem 1130 +----------------------------------- +local sacrificialChamberID = zones[xi.zone.SACRIFICIAL_CHAMBER] +----------------------------------- + +local content = Battlefield:new({ + zoneId = xi.zone.SACRIFICIAL_CHAMBER, + battlefieldId = xi.battlefield.id.AMPHIBIAN_ASSAULT, + maxPlayers = 6, + levelCap = 60, + timeLimit = utils.minutes(30), + index = 2, + entryNpc = '_4j0', + exitNpcs = { '_4j2', '_4j3', '_4j4' }, + requiredItems = { xi.item.MOON_ORB, wearMessage = sacrificialChamberID.text.A_CRACK_HAS_FORMED, wornMessage = sacrificialChamberID.text.ORB_IS_CRACKED }, + armouryCrates = + { + sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 4, + sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 10, + sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 16, + }, +}) + +content.groups = +{ + { + mobIds = + { + { + sacrificialChamberID.mob.QULL_THE_FALLSTOPPER, + sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 1, + sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 2, + sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 3, + }, + + { + sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 6, + sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 7, + sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 8, + sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 9, + }, + + { + sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 12, + sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 13, + sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 14, + sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 15, + }, + }, + + allDeath = utils.bind(content.handleAllMonstersDefeated, content), + }, + + -- Wyvern + { + mobIds = + { + { sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 5 }, + { sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 11 }, + { sacrificialChamberID.mob.QULL_THE_FALLSTOPPER + 17 }, + }, + + spawned = false, + }, +} + +content.loot = +{ + { + { item = xi.item.ENFEEBLING_TORQUE, weight = 250 }, -- Enfeebling Torque + { item = xi.item.DIVINE_TORQUE, weight = 250 }, -- Divine Torque + { item = xi.item.SHIELD_TORQUE, weight = 250 }, -- Shield Torque + { item = xi.item.STRING_TORQUE, weight = 250 }, -- String Torque + }, + + { + { item = xi.item.ELEMENTAL_TORQUE, weight = 250 }, -- Elemental Torque + { item = xi.item.EVASION_TORQUE, weight = 250 }, -- Evasion Torque + { item = xi.item.GUARDING_TORQUE, weight = 250 }, -- Guarding Torque + { item = xi.item.ENHANCING_TORQUE, weight = 250 }, -- Enhancing Torque + }, + + { + { item = xi.item.CHUNK_OF_WATER_ORE, weight = 125 }, -- Chunk Of Water Ore + { item = xi.item.CHUNK_OF_WIND_ORE, weight = 125 }, -- Chunk Of Wind Ore + { item = xi.item.CHUNK_OF_ICE_ORE, weight = 125 }, -- Chunk Of Ice Ore + { item = xi.item.CHUNK_OF_LIGHTNING_ORE, weight = 125 }, -- Chunk Of Lightning Ore + { item = xi.item.CHUNK_OF_LIGHT_ORE, weight = 125 }, -- Chunk Of Light Ore + { item = xi.item.CHUNK_OF_FIRE_ORE, weight = 125 }, -- Chunk Of Fire Ore + { item = xi.item.CHUNK_OF_DARK_ORE, weight = 125 }, -- Chunk Of Dark Ore + { item = xi.item.CHUNK_OF_EARTH_ORE, weight = 125 }, -- Chunk Of Earth Ore + }, + + { + { item = xi.item.NONE, weight = 750 }, -- nothing + { item = xi.item.SUMMONING_TORQUE, weight = 250 }, -- Summoning Torque + }, + + { + { item = xi.item.NONE, weight = 200 }, -- nothing + { item = xi.item.PLATINUM_BEASTCOIN, weight = 800 }, -- Platinum Beastcoin + }, + + { + { item = xi.item.NONE, weight = 375 }, -- nothing + { item = xi.item.FIRE_SPIRIT_PACT, weight = 125 }, -- Fire Spirit Pact + { item = xi.item.SCROLL_OF_ABSORB_STR, weight = 125 }, -- Scroll Of Absorb-str + { item = xi.item.SCROLL_OF_ERASE, weight = 125 }, -- Scroll Of Erase + { item = xi.item.SCROLL_OF_PHALANX, weight = 125 }, -- Scroll Of Phalanx + { item = xi.item.SCROLL_OF_RAISE_II, weight = 125 }, -- Scroll Of Raise Ii + }, + + { + { item = xi.item.NONE, weight = 888 }, -- nothing + { item = xi.item.VILE_ELIXIR_P1, weight = 56 }, -- Vile Elixir +1 + { item = xi.item.HI_RERAISER, weight = 56 }, -- Hi-reraiser + }, + + { + { item = xi.item.FLUORITE, weight = 10 }, -- Fluorite + { item = xi.item.PAINITE, weight = 50 }, -- Painite + { item = xi.item.SUNSTONE, weight = 10 }, -- Sunstone + { item = xi.item.JADEITE, weight = 150 }, -- Jadeite + { item = xi.item.AQUAMARINE, weight = 50 }, -- Aquamarine + { item = xi.item.MOONSTONE, weight = 150 }, -- Moonstone + { item = xi.item.YELLOW_ROCK, weight = 50 }, -- Yellow Rock + { item = xi.item.RED_ROCK, weight = 50 }, -- Red Rock + { item = xi.item.WHITE_ROCK, weight = 100 }, -- White Rock + { item = xi.item.GREEN_ROCK, weight = 50 }, -- Green Rock + { item = xi.item.TRANSLUCENT_ROCK, weight = 100 }, -- Translucent Rock + { item = xi.item.CHRYSOBERYL, weight = 150 }, -- Chrysoberyl + { item = xi.item.BLACK_ROCK, weight = 50 }, -- Black Rock + { item = xi.item.PURPLE_ROCK, weight = 50 }, -- Purple Rock + }, + + { + { item = xi.item.PLATINUM_BEASTCOIN, weight = 500 }, -- Platinum Beastcoin + { item = xi.item.CORAL_FRAGMENT, weight = 222 }, -- Coral Fragment + { item = xi.item.SPOOL_OF_MALBORO_FIBER, weight = 10 }, -- Spool Of Malboro Fiber + { item = xi.item.STEEL_INGOT, weight = 111 }, -- Steel Ingot + { item = xi.item.EBONY_LOG, weight = 56 }, -- Ebony Log + }, +} + +return content:register() diff --git a/scripts/globals/battlefield.lua b/scripts/globals/battlefield.lua index eff8dd48481..96f7807c394 100644 --- a/scripts/globals/battlefield.lua +++ b/scripts/globals/battlefield.lua @@ -146,7 +146,7 @@ xi.battlefield.id = BEYOND_INFINITY_BALGAS_DAIS = 116, -- Converted TEMPLE_OF_UGGALEPIH = 128, -- Converted JUNGLE_BOOGYMEN = 129, - AMPHIBIAN_ASSAULT = 130, + AMPHIBIAN_ASSAULT = 130, -- Converted PROJECT_SHANTOTTOFICATION = 131, WHOM_WILT_THOU_CALL = 132, SHADOW_LORD_BATTLE = 160, diff --git a/scripts/globals/bcnm.lua b/scripts/globals/bcnm.lua index ed38a885cc3..7559bc7eaaa 100644 --- a/scripts/globals/bcnm.lua +++ b/scripts/globals/bcnm.lua @@ -563,10 +563,6 @@ local function checkReqs(player, npc, bfid, registrant) return player:hasKeyItem(xi.ki.DRAGON_CURSE_REMEDY) end, - [128] = function() -- ZM4: The Temple of Uggalepih - return zilartMission == xi.mission.id.zilart.THE_TEMPLE_OF_UGGALEPIH - end, - [163] = function() -- Quest: Survival of the Wisest (SCH LB5) return mainJob == xi.job.SCH and mainLevel >= 66 end, diff --git a/scripts/zones/Sacrificial_Chamber/IDs.lua b/scripts/zones/Sacrificial_Chamber/IDs.lua index 3c9c7153fc7..5b197668793 100644 --- a/scripts/zones/Sacrificial_Chamber/IDs.lua +++ b/scripts/zones/Sacrificial_Chamber/IDs.lua @@ -30,7 +30,8 @@ zones[xi.zone.SACRIFICIAL_CHAMBER] = }, mob = { - GRAVITON = GetFirstID('Graviton'), + GRAVITON = GetFirstID('Graviton'), + QULL_THE_FALLSTOPPER = GetFirstID('Qull_the_Fallstopper'), }, npc = { diff --git a/scripts/zones/Sacrificial_Chamber/bcnms/amphibian_assault.lua b/scripts/zones/Sacrificial_Chamber/bcnms/amphibian_assault.lua deleted file mode 100644 index d1338bb7fd6..00000000000 --- a/scripts/zones/Sacrificial_Chamber/bcnms/amphibian_assault.lua +++ /dev/null @@ -1,37 +0,0 @@ ------------------------------------ --- Amphibian Assault --- Balga's Dais BCNM60, Moon Orb --- !additem 1130 ------------------------------------ -local battlefieldObject = {} - -battlefieldObject.onBattlefieldInitialise = function(battlefield) - battlefield:setLocalVar('loot', 1) -end - -battlefieldObject.onBattlefieldTick = function(battlefield, tick) - xi.battlefield.onBattlefieldTick(battlefield, tick) -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() - player:startEvent(32001, battlefield:getArea(), clearTime, partySize, battlefield:getTimeInside(), 1, battlefield:getLocalVar('[cs]bit'), 0) - 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/Sacrificial_Chamber/mobs/Pevv_the_Riverleaper.lua b/scripts/zones/Sacrificial_Chamber/mobs/Pevv_the_Riverleaper.lua index d1924b8dcac..6c3747f3358 100644 --- a/scripts/zones/Sacrificial_Chamber/mobs/Pevv_the_Riverleaper.lua +++ b/scripts/zones/Sacrificial_Chamber/mobs/Pevv_the_Riverleaper.lua @@ -7,13 +7,20 @@ mixins = { require('scripts/mixins/job_special') } ----------------------------------- local entity = {} +entity.onMobSpawn = function(mob) + xi.mix.jobSpecial.config(mob, { + specials = + { + { id = xi.jsa.CALL_WYVERN, hpp = 75 }, + }, + }) +end + entity.onMobFight = function(mob, target) - -- spawn pet wyvern and assign it a target local mobId = mob:getID() - local pet = GetMobByID(mobId + 2) - if not pet:isSpawned() then - SpawnMob(mobId + 2):updateEnmity(target) - elseif pet:getCurrentAction() == xi.act.ROAMING then + local pet = GetMobByID(mobId + 2) + + if pet:getCurrentAction() == xi.act.ROAMING then pet:updateEnmity(target) end end diff --git a/scripts/zones/Sacrificial_Chamber/npcs/Armoury_Crate.lua b/scripts/zones/Sacrificial_Chamber/npcs/Armoury_Crate.lua index 478ccbb0125..1acd0127aaf 100644 --- a/scripts/zones/Sacrificial_Chamber/npcs/Armoury_Crate.lua +++ b/scripts/zones/Sacrificial_Chamber/npcs/Armoury_Crate.lua @@ -81,85 +81,6 @@ local loot = { itemid = xi.item.FLUORITE, droprate = 50 }, -- Fluorite }, }, - - -- BCNM Amphibian Assault - [130] = - { - { - { itemid = xi.item.ENFEEBLING_TORQUE, droprate = 250 }, -- Enfeebling Torque - { itemid = xi.item.DIVINE_TORQUE, droprate = 250 }, -- Divine Torque - { itemid = xi.item.SHIELD_TORQUE, droprate = 250 }, -- Shield Torque - { itemid = xi.item.STRING_TORQUE, droprate = 250 }, -- String Torque - }, - - { - { itemid = xi.item.ELEMENTAL_TORQUE, droprate = 250 }, -- Elemental Torque - { itemid = xi.item.EVASION_TORQUE, droprate = 250 }, -- Evasion Torque - { itemid = xi.item.GUARDING_TORQUE, droprate = 250 }, -- Guarding Torque - { itemid = xi.item.ENHANCING_TORQUE, droprate = 250 }, -- Enhancing Torque - }, - - { - { itemid = xi.item.CHUNK_OF_WATER_ORE, droprate = 125 }, -- Chunk Of Water Ore - { itemid = xi.item.CHUNK_OF_WIND_ORE, droprate = 125 }, -- Chunk Of Wind Ore - { itemid = xi.item.CHUNK_OF_ICE_ORE, droprate = 125 }, -- Chunk Of Ice Ore - { itemid = xi.item.CHUNK_OF_LIGHTNING_ORE, droprate = 125 }, -- Chunk Of Lightning Ore - { itemid = xi.item.CHUNK_OF_LIGHT_ORE, droprate = 125 }, -- Chunk Of Light Ore - { itemid = xi.item.CHUNK_OF_FIRE_ORE, droprate = 125 }, -- Chunk Of Fire Ore - { itemid = xi.item.CHUNK_OF_DARK_ORE, droprate = 125 }, -- Chunk Of Dark Ore - { itemid = xi.item.CHUNK_OF_EARTH_ORE, droprate = 125 }, -- Chunk Of Earth Ore - }, - - { - { itemid = xi.item.NONE, droprate = 750 }, -- nothing - { itemid = xi.item.SUMMONING_TORQUE, droprate = 250 }, -- Summoning Torque - }, - - { - { itemid = xi.item.NONE, droprate = 200 }, -- nothing - { itemid = xi.item.PLATINUM_BEASTCOIN, droprate = 800 }, -- Platinum Beastcoin - }, - - { - { itemid = xi.item.NONE, droprate = 375 }, -- nothing - { itemid = xi.item.FIRE_SPIRIT_PACT, droprate = 125 }, -- Fire Spirit Pact - { itemid = xi.item.SCROLL_OF_ABSORB_STR, droprate = 125 }, -- Scroll Of Absorb-str - { itemid = xi.item.SCROLL_OF_ERASE, droprate = 125 }, -- Scroll Of Erase - { itemid = xi.item.SCROLL_OF_PHALANX, droprate = 125 }, -- Scroll Of Phalanx - { itemid = xi.item.SCROLL_OF_RAISE_II, droprate = 125 }, -- Scroll Of Raise Ii - }, - - { - { itemid = xi.item.NONE, droprate = 888 }, -- nothing - { itemid = xi.item.VILE_ELIXIR_P1, droprate = 56 }, -- Vile Elixir +1 - { itemid = xi.item.HI_RERAISER, droprate = 56 }, -- Hi-reraiser - }, - - { - { itemid = xi.item.FLUORITE, droprate = 10 }, -- Fluorite - { itemid = xi.item.PAINITE, droprate = 50 }, -- Painite - { itemid = xi.item.SUNSTONE, droprate = 10 }, -- Sunstone - { itemid = xi.item.JADEITE, droprate = 150 }, -- Jadeite - { itemid = xi.item.AQUAMARINE, droprate = 50 }, -- Aquamarine - { itemid = xi.item.MOONSTONE, droprate = 150 }, -- Moonstone - { itemid = xi.item.YELLOW_ROCK, droprate = 50 }, -- Yellow Rock - { itemid = xi.item.RED_ROCK, droprate = 50 }, -- Red Rock - { itemid = xi.item.WHITE_ROCK, droprate = 100 }, -- White Rock - { itemid = xi.item.GREEN_ROCK, droprate = 50 }, -- Green Rock - { itemid = xi.item.TRANSLUCENT_ROCK, droprate = 100 }, -- Translucent Rock - { itemid = xi.item.CHRYSOBERYL, droprate = 150 }, -- Chrysoberyl - { itemid = xi.item.BLACK_ROCK, droprate = 50 }, -- Black Rock - { itemid = xi.item.PURPLE_ROCK, droprate = 50 }, -- Purple Rock - }, - - { - { itemid = xi.item.PLATINUM_BEASTCOIN, droprate = 500 }, -- Platinum Beastcoin - { itemid = xi.item.CORAL_FRAGMENT, droprate = 222 }, -- Coral Fragment - { itemid = xi.item.SPOOL_OF_MALBORO_FIBER, droprate = 10 }, -- Spool Of Malboro Fiber - { itemid = xi.item.STEEL_INGOT, droprate = 111 }, -- Steel Ingot - { itemid = xi.item.EBONY_LOG, droprate = 56 }, -- Ebony Log - }, - }, } entity.onTrade = function(player, npc, trade) From e64df37cb7062f642ea06dae57ddf4087ca86714 Mon Sep 17 00:00:00 2001 From: claywar Date: Sun, 12 May 2024 11:09:43 -0400 Subject: [PATCH 4/4] Interaction - Battlefield: Jungle Boogeymen Set avatar group to not spawned Fix linking due to mob spacing Add additional spawned check for Wyvern --- scripts/actions/mobskills/astral_flow.lua | 2 + .../Sacrificial_Chamber/jungle_boogymen.lua | 156 ++++++++++++++++++ scripts/globals/battlefield.lua | 2 +- scripts/zones/Sacrificial_Chamber/IDs.lua | 5 +- .../bcnms/jungle_boogymen.lua | 37 ----- .../mobs/Pevv_the_Riverleaper.lua | 5 +- .../npcs/Armoury_Crate.lua | 83 ---------- 7 files changed, 166 insertions(+), 124 deletions(-) create mode 100644 scripts/battlefields/Sacrificial_Chamber/jungle_boogymen.lua delete mode 100644 scripts/zones/Sacrificial_Chamber/bcnms/jungle_boogymen.lua diff --git a/scripts/actions/mobskills/astral_flow.lua b/scripts/actions/mobskills/astral_flow.lua index 84f8b7ca8bd..5c039cdb380 100644 --- a/scripts/actions/mobskills/astral_flow.lua +++ b/scripts/actions/mobskills/astral_flow.lua @@ -6,6 +6,8 @@ local mobskillObject = {} local avatarOffsets = { [17444883] = 3, -- Vermilion-eared Noberry + [17444890] = 3, -- Vermilion-eared Noberry + [17444897] = 3, -- Vermilion-eared Noberry [17453078] = 3, -- Duke Dantalian [17453085] = 3, -- Duke Dantalian [17453092] = 3, -- Duke Dantalian diff --git a/scripts/battlefields/Sacrificial_Chamber/jungle_boogymen.lua b/scripts/battlefields/Sacrificial_Chamber/jungle_boogymen.lua new file mode 100644 index 00000000000..70dfc851ad0 --- /dev/null +++ b/scripts/battlefields/Sacrificial_Chamber/jungle_boogymen.lua @@ -0,0 +1,156 @@ +----------------------------------- +-- Jungle Boogymen +-- Sacrificial Chamber BCNM60, Moon Orb +-- !additem 1130 +----------------------------------- +local sacrificialChamberID = zones[xi.zone.SACRIFICIAL_CHAMBER] +----------------------------------- + +local content = Battlefield:new({ + zoneId = xi.zone.SACRIFICIAL_CHAMBER, + battlefieldId = xi.battlefield.id.JUNGLE_BOOGYMEN, + maxPlayers = 6, + levelCap = 60, + timeLimit = utils.minutes(30), + index = 1, + entryNpc = '_4j0', + exitNpcs = { '_4j2', '_4j3', '_4j4' }, + requiredItems = { xi.item.MOON_ORB, wearMessage = sacrificialChamberID.text.A_CRACK_HAS_FORMED, wornMessage = sacrificialChamberID.text.ORB_IS_CRACKED }, + armouryCrates = + { + sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 4, + sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 11, + sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 18, + }, +}) + +content.groups = +{ + { + mobIds = + { + { + sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY, + sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 1, + sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 2, + sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 3, + }, + + { + sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 7, + sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 8, + sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 9, + sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 10, + }, + + { + sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 14, + sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 15, + sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 16, + sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 17, + }, + }, + + superlink = true, + allDeath = utils.bind(content.handleAllMonstersDefeated, content), + }, + + -- Elemental + { + mobIds = + { + { sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 5 }, + { sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 12 }, + { sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 19 }, + }, + }, + + -- Avatar + { + mobIds = + { + { sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 6 }, + { sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 13 }, + { sacrificialChamberID.mob.SABLE_TONGUED_GONBERRY + 20 }, + }, + + spawned = false, + }, +} + +content.loot = +{ + { + { item = xi.item.DARK_TORQUE, weight = 250 }, -- Dark Torque + { item = xi.item.ELEMENTAL_TORQUE, weight = 250 }, -- Elemental Torque + { item = xi.item.HEALING_TORQUE, weight = 250 }, -- Healing Torque + { item = xi.item.WIND_TORQUE, weight = 250 }, -- Wind Torque + }, + + { + { item = xi.item.PLATINUM_BEASTCOIN, weight = 500 }, -- Platinum Beastcoin + { item = xi.item.SCROLL_OF_ABSORB_STR, weight = 48 }, -- Scroll Of Absorb-STR + { item = xi.item.SCROLL_OF_ERASE, weight = 143 }, -- Scroll Of Erase + { item = xi.item.SCROLL_OF_PHALANX, weight = 119 }, -- Scroll Of Phalanx + { item = xi.item.FIRE_SPIRIT_PACT, weight = 48 }, -- Fire Spirit Pact + { item = xi.item.CHUNK_OF_FIRE_ORE, weight = 48 }, -- Chunk Of Fire Ore + { item = xi.item.CHUNK_OF_ICE_ORE, weight = 48 }, -- Chunk Of Ice Ore + { item = xi.item.CHUNK_OF_WIND_ORE, weight = 48 }, -- Chunk Of Wind Ore + { item = xi.item.CHUNK_OF_EARTH_ORE, weight = 48 }, -- Chunk Of Earth Ore + { item = xi.item.CHUNK_OF_LIGHTNING_ORE, weight = 48 }, -- Chunk Of Lightning Ore + { item = xi.item.CHUNK_OF_WATER_ORE, weight = 48 }, -- Chunk Of Water Ore + { item = xi.item.CHUNK_OF_LIGHT_ORE, weight = 48 }, -- Chunk Of Light Ore + { item = xi.item.CHUNK_OF_DARK_ORE, weight = 48 }, -- Chunk Of Dark Ore + }, + + { + { item = xi.item.PLATINUM_BEASTCOIN, weight = 833 }, -- Platinum Beastcoin + { item = xi.item.CHUNK_OF_ICE_ORE, weight = 167 }, -- Chunk Of Ice Ore + }, + + { + { item = xi.item.ENFEEBLING_TORQUE, weight = 250 }, -- Enfeebling Torque + { item = xi.item.EVASION_TORQUE, weight = 250 }, -- Evasion Torque + { item = xi.item.GUARDING_TORQUE, weight = 250 }, -- Guarding Torque + { item = xi.item.SUMMONING_TORQUE, weight = 250 }, -- Summoning Torque + }, + + { + { item = xi.item.DARKSTEEL_INGOT, weight = 154 }, -- Darksteel Ingot + { item = xi.item.PAINITE, weight = 154 }, -- Painite + { item = xi.item.GOLD_INGOT, weight = 154 }, -- Gold Ingot + { item = xi.item.AQUAMARINE, weight = 77 }, -- Aquamarine + { item = xi.item.VILE_ELIXIR_P1, weight = 77 }, -- Vile Elixir +1 + { item = xi.item.MYTHRIL_INGOT, weight = 153 }, -- Mythril Ingot + { item = xi.item.CHRYSOBERYL, weight = 30 }, -- Chrysoberyl + { item = xi.item.MOONSTONE, weight = 30 }, -- Moonstone + { item = xi.item.SUNSTONE, weight = 30 }, -- Sunstone + { item = xi.item.ZIRCON, weight = 30 }, -- Zircon + { item = xi.item.AQUAMARINE, weight = 30 }, -- Aquamarine + { item = xi.item.EBONY_LOG, weight = 30 }, -- Ebony Log + { item = xi.item.MAHOGANY_LOG, weight = 30 }, -- Mahogany Log + { item = xi.item.PHILOSOPHERS_STONE, weight = 30 }, -- Philosophers Stone + }, + + { + { item = xi.item.DARKSTEEL_INGOT, weight = 77 }, -- Darksteel Ingot + { item = xi.item.MOONSTONE, weight = 134 }, -- Moonstone + { item = xi.item.STEEL_INGOT, weight = 154 }, -- Steel Ingot + { item = xi.item.CHRYSOBERYL, weight = 50 }, -- Chrysoberyl + { item = xi.item.HI_RERAISER, weight = 154 }, -- Hi-reraiser + { item = xi.item.JADEITE, weight = 121 }, -- Jadeite + { item = xi.item.SPOOL_OF_MALBORO_FIBER, weight = 10 }, -- Spool Of Malboro Fiber + { item = xi.item.VIAL_OF_BLACK_BEETLE_BLOOD, weight = 10 }, -- Vial Of Black Beetle Blood + { item = xi.item.RED_ROCK, weight = 30 }, -- Red Rock + { item = xi.item.BLUE_ROCK, weight = 30 }, -- Blue Rock + { item = xi.item.YELLOW_ROCK, weight = 30 }, -- Yellow Rock + { item = xi.item.GREEN_ROCK, weight = 30 }, -- Green Rock + { item = xi.item.TRANSLUCENT_ROCK, weight = 30 }, -- Translucent Rock + { item = xi.item.PURPLE_ROCK, weight = 30 }, -- Purple Rock + { item = xi.item.BLACK_ROCK, weight = 30 }, -- Black Rock + { item = xi.item.WHITE_ROCK, weight = 30 }, -- White Rock + { item = xi.item.FLUORITE, weight = 50 }, -- Fluorite + }, +} + +return content:register() diff --git a/scripts/globals/battlefield.lua b/scripts/globals/battlefield.lua index 96f7807c394..70433f5ffea 100644 --- a/scripts/globals/battlefield.lua +++ b/scripts/globals/battlefield.lua @@ -145,7 +145,7 @@ xi.battlefield.id = AVIAN_APOSTATES = 115, BEYOND_INFINITY_BALGAS_DAIS = 116, -- Converted TEMPLE_OF_UGGALEPIH = 128, -- Converted - JUNGLE_BOOGYMEN = 129, + JUNGLE_BOOGYMEN = 129, -- Converted AMPHIBIAN_ASSAULT = 130, -- Converted PROJECT_SHANTOTTOFICATION = 131, WHOM_WILT_THOU_CALL = 132, diff --git a/scripts/zones/Sacrificial_Chamber/IDs.lua b/scripts/zones/Sacrificial_Chamber/IDs.lua index 5b197668793..ee671f2490d 100644 --- a/scripts/zones/Sacrificial_Chamber/IDs.lua +++ b/scripts/zones/Sacrificial_Chamber/IDs.lua @@ -30,8 +30,9 @@ zones[xi.zone.SACRIFICIAL_CHAMBER] = }, mob = { - GRAVITON = GetFirstID('Graviton'), - QULL_THE_FALLSTOPPER = GetFirstID('Qull_the_Fallstopper'), + GRAVITON = GetFirstID('Graviton'), + QULL_THE_FALLSTOPPER = GetFirstID('Qull_the_Fallstopper'), + SABLE_TONGUED_GONBERRY = GetFirstID('Sable-tongued_Gonberry'), }, npc = { diff --git a/scripts/zones/Sacrificial_Chamber/bcnms/jungle_boogymen.lua b/scripts/zones/Sacrificial_Chamber/bcnms/jungle_boogymen.lua deleted file mode 100644 index a432253b890..00000000000 --- a/scripts/zones/Sacrificial_Chamber/bcnms/jungle_boogymen.lua +++ /dev/null @@ -1,37 +0,0 @@ ------------------------------------ --- Jungle Boogymen --- Balga's Dais BCNM60, Moon Orb --- !additem 1130 ------------------------------------ -local battlefieldObject = {} - -battlefieldObject.onBattlefieldInitialise = function(battlefield) - battlefield:setLocalVar('loot', 1) -end - -battlefieldObject.onBattlefieldTick = function(battlefield, tick) - xi.battlefield.onBattlefieldTick(battlefield, tick) -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() - player:startEvent(32001, battlefield:getArea(), clearTime, partySize, battlefield:getTimeInside(), 1, battlefield:getLocalVar('[cs]bit'), 0) - 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/Sacrificial_Chamber/mobs/Pevv_the_Riverleaper.lua b/scripts/zones/Sacrificial_Chamber/mobs/Pevv_the_Riverleaper.lua index 6c3747f3358..6993e0846cc 100644 --- a/scripts/zones/Sacrificial_Chamber/mobs/Pevv_the_Riverleaper.lua +++ b/scripts/zones/Sacrificial_Chamber/mobs/Pevv_the_Riverleaper.lua @@ -20,7 +20,10 @@ entity.onMobFight = function(mob, target) local mobId = mob:getID() local pet = GetMobByID(mobId + 2) - if pet:getCurrentAction() == xi.act.ROAMING then + if + pet:isSpawned() and + pet:getCurrentAction() == xi.act.ROAMING + then pet:updateEnmity(target) end end diff --git a/scripts/zones/Sacrificial_Chamber/npcs/Armoury_Crate.lua b/scripts/zones/Sacrificial_Chamber/npcs/Armoury_Crate.lua index 1acd0127aaf..0e86e10532f 100644 --- a/scripts/zones/Sacrificial_Chamber/npcs/Armoury_Crate.lua +++ b/scripts/zones/Sacrificial_Chamber/npcs/Armoury_Crate.lua @@ -4,93 +4,10 @@ ----------------------------------- local entity = {} -local loot = -{ - -- BCNM Jungle Boogymen - [129] = - { - { - { itemid = xi.item.DARK_TORQUE, droprate = 250 }, -- Dark Torque - { itemid = xi.item.ELEMENTAL_TORQUE, droprate = 250 }, -- Elemental Torque - { itemid = xi.item.HEALING_TORQUE, droprate = 250 }, -- Healing Torque - { itemid = xi.item.WIND_TORQUE, droprate = 250 }, -- Wind Torque - }, - - { - { itemid = xi.item.PLATINUM_BEASTCOIN, droprate = 500 }, -- Platinum Beastcoin - { itemid = xi.item.SCROLL_OF_ABSORB_STR, droprate = 48 }, -- Scroll Of Absorb-STR - { itemid = xi.item.SCROLL_OF_ERASE, droprate = 143 }, -- Scroll Of Erase - { itemid = xi.item.SCROLL_OF_PHALANX, droprate = 119 }, -- Scroll Of Phalanx - { itemid = xi.item.FIRE_SPIRIT_PACT, droprate = 48 }, -- Fire Spirit Pact - { itemid = xi.item.CHUNK_OF_FIRE_ORE, droprate = 48 }, -- Chunk Of Fire Ore - { itemid = xi.item.CHUNK_OF_ICE_ORE, droprate = 48 }, -- Chunk Of Ice Ore - { itemid = xi.item.CHUNK_OF_WIND_ORE, droprate = 48 }, -- Chunk Of Wind Ore - { itemid = xi.item.CHUNK_OF_EARTH_ORE, droprate = 48 }, -- Chunk Of Earth Ore - { itemid = xi.item.CHUNK_OF_LIGHTNING_ORE, droprate = 48 }, -- Chunk Of Lightning Ore - { itemid = xi.item.CHUNK_OF_WATER_ORE, droprate = 48 }, -- Chunk Of Water Ore - { itemid = xi.item.CHUNK_OF_LIGHT_ORE, droprate = 48 }, -- Chunk Of Light Ore - { itemid = xi.item.CHUNK_OF_DARK_ORE, droprate = 48 }, -- Chunk Of Dark Ore - }, - - { - { itemid = xi.item.PLATINUM_BEASTCOIN, droprate = 833 }, -- Platinum Beastcoin - { itemid = xi.item.CHUNK_OF_ICE_ORE, droprate = 167 }, -- Chunk Of Ice Ore - }, - - { - { itemid = xi.item.ENFEEBLING_TORQUE, droprate = 250 }, -- Enfeebling Torque - { itemid = xi.item.EVASION_TORQUE, droprate = 250 }, -- Evasion Torque - { itemid = xi.item.GUARDING_TORQUE, droprate = 250 }, -- Guarding Torque - { itemid = xi.item.SUMMONING_TORQUE, droprate = 250 }, -- Summoning Torque - }, - - { - { itemid = xi.item.DARKSTEEL_INGOT, droprate = 154 }, -- Darksteel Ingot - { itemid = xi.item.PAINITE, droprate = 154 }, -- Painite - { itemid = xi.item.GOLD_INGOT, droprate = 154 }, -- Gold Ingot - { itemid = xi.item.AQUAMARINE, droprate = 77 }, -- Aquamarine - { itemid = xi.item.VILE_ELIXIR_P1, droprate = 77 }, -- Vile Elixir +1 - { itemid = xi.item.MYTHRIL_INGOT, droprate = 153 }, -- Mythril Ingot - { itemid = xi.item.CHRYSOBERYL, droprate = 30 }, -- Chrysoberyl - { itemid = xi.item.MOONSTONE, droprate = 30 }, -- Moonstone - { itemid = xi.item.SUNSTONE, droprate = 30 }, -- Sunstone - { itemid = xi.item.ZIRCON, droprate = 30 }, -- Zircon - { itemid = xi.item.AQUAMARINE, droprate = 30 }, -- Aquamarine - { itemid = xi.item.EBONY_LOG, droprate = 30 }, -- Ebony Log - { itemid = xi.item.MAHOGANY_LOG, droprate = 30 }, -- Mahogany Log - { itemid = xi.item.PHILOSOPHERS_STONE, droprate = 30 }, -- Philosophers Stone - }, - - { - { itemid = xi.item.DARKSTEEL_INGOT, droprate = 77 }, -- Darksteel Ingot - { itemid = xi.item.MOONSTONE, droprate = 134 }, -- Moonstone - { itemid = xi.item.STEEL_INGOT, droprate = 154 }, -- Steel Ingot - { itemid = xi.item.CHRYSOBERYL, droprate = 50 }, -- Chrysoberyl - { itemid = xi.item.HI_RERAISER, droprate = 154 }, -- Hi-reraiser - { itemid = xi.item.JADEITE, droprate = 121 }, -- Jadeite - { itemid = xi.item.SPOOL_OF_MALBORO_FIBER, droprate = 10 }, -- Spool Of Malboro Fiber - { itemid = xi.item.VIAL_OF_BLACK_BEETLE_BLOOD, droprate = 10 }, -- Vial Of Black Beetle Blood - { itemid = xi.item.RED_ROCK, droprate = 30 }, -- Red Rock - { itemid = xi.item.BLUE_ROCK, droprate = 30 }, -- Blue Rock - { itemid = xi.item.YELLOW_ROCK, droprate = 30 }, -- Yellow Rock - { itemid = xi.item.GREEN_ROCK, droprate = 30 }, -- Green Rock - { itemid = xi.item.TRANSLUCENT_ROCK, droprate = 30 }, -- Translucent Rock - { itemid = xi.item.PURPLE_ROCK, droprate = 30 }, -- Purple Rock - { itemid = xi.item.BLACK_ROCK, droprate = 30 }, -- Black Rock - { itemid = xi.item.WHITE_ROCK, droprate = 30 }, -- White Rock - { itemid = xi.item.FLUORITE, droprate = 50 }, -- Fluorite - }, - }, -} - entity.onTrade = function(player, npc, trade) end entity.onTrigger = function(player, npc) - local battlefield = player:getBattlefield() - if battlefield then - xi.battlefield.HandleLootRolls(battlefield, loot[battlefield:getID()], nil, npc) - end end entity.onEventUpdate = function(player, csid, option, npc)