diff --git a/scripts/globals/promyvion.lua b/scripts/globals/promyvion.lua index 8ec847dd601..fc30e42dab6 100644 --- a/scripts/globals/promyvion.lua +++ b/scripts/globals/promyvion.lua @@ -1,36 +1,175 @@ xi = xi or {} xi.promyvion = xi.promyvion or {} +local demID = zones[xi.zone.PROMYVION_DEM] +local hollaID = zones[xi.zone.PROMYVION_HOLLA] +local meaID = zones[xi.zone.PROMYVION_MEA] +local vahzlID = zones[xi.zone.PROMYVION_VAHZL] + +----------------------------------- +-- Global Tables +----------------------------------- +xi.promyvion.receptacleInfoTable = +{ + [xi.zone.PROMYVION_DEM] = + { + -- [Mob ID (Memory receptacle)] = { Portal Group, Number of Strays, Associated "Memory stream" NPC ID } + [demID.mob.MEMORY_RECEPTACLE_TABLE[1] ] = { 1, 3, demID.npc.MEMORY_STREAM_OFFSET }, -- Floor 1: Portal + [demID.mob.MEMORY_RECEPTACLE_TABLE[2] ] = { 3, 5, demID.npc.MEMORY_STREAM_OFFSET + 4 }, -- Floor 2: Portal SE - Destination: North + [demID.mob.MEMORY_RECEPTACLE_TABLE[3] ] = { 2, 5, demID.npc.MEMORY_STREAM_OFFSET + 5 }, -- Floor 2: Portal NE - Destination: South + [demID.mob.MEMORY_RECEPTACLE_TABLE[4] ] = { 2, 5, demID.npc.MEMORY_STREAM_OFFSET + 6 }, -- Floor 2: Portal SW - Destination: South + [demID.mob.MEMORY_RECEPTACLE_TABLE[5] ] = { 3, 5, demID.npc.MEMORY_STREAM_OFFSET + 7 }, -- Floor 2: Portal NW - Destination: North + [demID.mob.MEMORY_RECEPTACLE_TABLE[6] ] = { 4, 7, demID.npc.MEMORY_STREAM_OFFSET + 1 }, -- Floor 3 (South): Portal NE + [demID.mob.MEMORY_RECEPTACLE_TABLE[7] ] = { 4, 7, demID.npc.MEMORY_STREAM_OFFSET + 2 }, -- Floor 3 (South): Portal NW + [demID.mob.MEMORY_RECEPTACLE_TABLE[8] ] = { 4, 7, demID.npc.MEMORY_STREAM_OFFSET + 3 }, -- Floor 3 (South): Portal SW + [demID.mob.MEMORY_RECEPTACLE_TABLE[9] ] = { 5, 7, demID.npc.MEMORY_STREAM_OFFSET + 8 }, -- Floor 3 (North): Portal SW + [demID.mob.MEMORY_RECEPTACLE_TABLE[10]] = { 5, 7, demID.npc.MEMORY_STREAM_OFFSET + 9 }, -- Floor 3 (North): Portal NE + [demID.mob.MEMORY_RECEPTACLE_TABLE[11]] = { 5, 7, demID.npc.MEMORY_STREAM_OFFSET + 10 }, -- Floor 3 (North): Portal SE + }, + + [xi.zone.PROMYVION_HOLLA] = + { + -- [Mob ID (Memory receptacle)] = { Portal Group, Number of Strays, Associated "Memory stream" NPC ID } + [hollaID.mob.MEMORY_RECEPTACLE_TABLE[1] ] = { 1, 3, hollaID.npc.MEMORY_STREAM_OFFSET + 7 }, -- Floor 1: Portal + [hollaID.mob.MEMORY_RECEPTACLE_TABLE[2] ] = { 3, 5, hollaID.npc.MEMORY_STREAM_OFFSET + 3 }, -- Floor 2: Portal NW - Destination: East + [hollaID.mob.MEMORY_RECEPTACLE_TABLE[3] ] = { 2, 5, hollaID.npc.MEMORY_STREAM_OFFSET + 4 }, -- Floor 2: Portal SW - Destination: West + [hollaID.mob.MEMORY_RECEPTACLE_TABLE[4] ] = { 3, 5, hollaID.npc.MEMORY_STREAM_OFFSET + 5 }, -- Floor 2: Portal SE - Destination: East + [hollaID.mob.MEMORY_RECEPTACLE_TABLE[5] ] = { 2, 5, hollaID.npc.MEMORY_STREAM_OFFSET + 6 }, -- Floor 2: Portal NE - Destination: West + [hollaID.mob.MEMORY_RECEPTACLE_TABLE[6] ] = { 4, 7, hollaID.npc.MEMORY_STREAM_OFFSET }, -- Floor 3 (West): Portal NE + [hollaID.mob.MEMORY_RECEPTACLE_TABLE[7] ] = { 4, 7, hollaID.npc.MEMORY_STREAM_OFFSET + 1 }, -- Floor 3 (West): Portal NW + [hollaID.mob.MEMORY_RECEPTACLE_TABLE[8] ] = { 4, 7, hollaID.npc.MEMORY_STREAM_OFFSET + 2 }, -- Floor 3 (West): Portal SW + [hollaID.mob.MEMORY_RECEPTACLE_TABLE[9] ] = { 5, 7, hollaID.npc.MEMORY_STREAM_OFFSET + 8 }, -- Floor 3 (East): Portal NW + [hollaID.mob.MEMORY_RECEPTACLE_TABLE[10]] = { 5, 7, hollaID.npc.MEMORY_STREAM_OFFSET + 9 }, -- Floor 3 (East): Portal NE + [hollaID.mob.MEMORY_RECEPTACLE_TABLE[11]] = { 5, 7, hollaID.npc.MEMORY_STREAM_OFFSET + 10 }, -- Floor 3 (East): Portal SE + }, + + [xi.zone.PROMYVION_MEA] = + { + -- [Mob ID (Memory receptacle)] = { Portal Group, Number of Strays, Associated "Memory stream" NPC ID } + [meaID.mob.MEMORY_RECEPTACLE_TABLE[1] ] = { 1, 3, meaID.npc.MEMORY_STREAM_OFFSET }, -- Floor 1: Portal + [meaID.mob.MEMORY_RECEPTACLE_TABLE[2] ] = { 3, 5, meaID.npc.MEMORY_STREAM_OFFSET + 3 }, -- Floor 2: Portal N - Destination: East + [meaID.mob.MEMORY_RECEPTACLE_TABLE[3] ] = { 2, 5, meaID.npc.MEMORY_STREAM_OFFSET + 7 }, -- Floor 2: Portal SW - Destination: West + [meaID.mob.MEMORY_RECEPTACLE_TABLE[4] ] = { 2, 5, meaID.npc.MEMORY_STREAM_OFFSET + 8 }, -- Floor 2: Portal S - Destination: West + [meaID.mob.MEMORY_RECEPTACLE_TABLE[5] ] = { 3, 5, meaID.npc.MEMORY_STREAM_OFFSET + 9 }, -- Floor 2: Portal SE - Destination: East + [meaID.mob.MEMORY_RECEPTACLE_TABLE[6] ] = { 4, 7, meaID.npc.MEMORY_STREAM_OFFSET + 1 }, -- Floor 3 (West): Portal SW + [meaID.mob.MEMORY_RECEPTACLE_TABLE[7] ] = { 4, 7, meaID.npc.MEMORY_STREAM_OFFSET + 2 }, -- Floor 3 (West): Portal S + [meaID.mob.MEMORY_RECEPTACLE_TABLE[8] ] = { 4, 7, meaID.npc.MEMORY_STREAM_OFFSET + 4 }, -- Floor 3 (West): Portal SE + [meaID.mob.MEMORY_RECEPTACLE_TABLE[9] ] = { 5, 7, meaID.npc.MEMORY_STREAM_OFFSET + 5 }, -- Floor 3 (East): Portal NW + [meaID.mob.MEMORY_RECEPTACLE_TABLE[10]] = { 5, 7, meaID.npc.MEMORY_STREAM_OFFSET + 6 }, -- Floor 3 (East): Portal NE + [meaID.mob.MEMORY_RECEPTACLE_TABLE[11]] = { 5, 7, meaID.npc.MEMORY_STREAM_OFFSET + 10 }, -- Floor 3 (East): Portal SW + }, + + [xi.zone.PROMYVION_VAHZL] = + { + -- [Mob ID (Memory receptacle)] = { Portal Group, Number of Strays, Associated "Memory stream" NPC ID } + [vahzlID.mob.MEMORY_RECEPTACLE_TABLE[1] ] = { 1, 3, vahzlID.npc.MEMORY_STREAM_OFFSET + 2 }, -- Floor 1: Portal S + [vahzlID.mob.MEMORY_RECEPTACLE_TABLE[2] ] = { 1, 3, vahzlID.npc.MEMORY_STREAM_OFFSET + 3 }, -- Floor 1: Portal N + [vahzlID.mob.MEMORY_RECEPTACLE_TABLE[3] ] = { 2, 5, vahzlID.npc.MEMORY_STREAM_OFFSET }, -- Floor 2: Portal N + [vahzlID.mob.MEMORY_RECEPTACLE_TABLE[4] ] = { 2, 5, vahzlID.npc.MEMORY_STREAM_OFFSET + 1 }, -- Floor 2: Portal S + [vahzlID.mob.MEMORY_RECEPTACLE_TABLE[5] ] = { 3, 5, vahzlID.npc.MEMORY_STREAM_OFFSET + 5 }, -- Floor 3: Portal W + [vahzlID.mob.MEMORY_RECEPTACLE_TABLE[6] ] = { 3, 5, vahzlID.npc.MEMORY_STREAM_OFFSET + 6 }, -- Floor 3: Portal N + [vahzlID.mob.MEMORY_RECEPTACLE_TABLE[7] ] = { 3, 5, vahzlID.npc.MEMORY_STREAM_OFFSET + 7 }, -- Floor 3: Portal S + [vahzlID.mob.MEMORY_RECEPTACLE_TABLE[8] ] = { 3, 5, vahzlID.npc.MEMORY_STREAM_OFFSET + 8 }, -- Floor 3: Portal E + [vahzlID.mob.MEMORY_RECEPTACLE_TABLE[9] ] = { 4, 7, vahzlID.npc.MEMORY_STREAM_OFFSET + 4 }, -- Floor 4: Portal SW + [vahzlID.mob.MEMORY_RECEPTACLE_TABLE[10]] = { 4, 7, vahzlID.npc.MEMORY_STREAM_OFFSET + 9 }, -- Floor 4: Portal SE + [vahzlID.mob.MEMORY_RECEPTACLE_TABLE[11]] = { 4, 7, vahzlID.npc.MEMORY_STREAM_OFFSET + 10 }, -- Floor 4: Portal NE + }, +} + +xi.promyvion.portalGroupTable = +{ + [xi.zone.PROMYVION_DEM] = + { + [1] = { demID.npc.MEMORY_STREAM_OFFSET }, -- Floor 1 + [2] = { demID.npc.MEMORY_STREAM_OFFSET + 5, demID.npc.MEMORY_STREAM_OFFSET + 6 }, -- Floor 2 leading South + [3] = { demID.npc.MEMORY_STREAM_OFFSET + 4, demID.npc.MEMORY_STREAM_OFFSET + 7 }, -- Floor 2 leading North + [4] = { demID.npc.MEMORY_STREAM_OFFSET + 1, demID.npc.MEMORY_STREAM_OFFSET + 2, demID.npc.MEMORY_STREAM_OFFSET + 3 }, -- Floor 3 South + [5] = { demID.npc.MEMORY_STREAM_OFFSET + 8, demID.npc.MEMORY_STREAM_OFFSET + 9, demID.npc.MEMORY_STREAM_OFFSET + 10 }, -- Floor 3 North + }, + + [xi.zone.PROMYVION_HOLLA] = + { + [1] = { hollaID.npc.MEMORY_STREAM_OFFSET + 7 }, -- Floor 1 + [2] = { hollaID.npc.MEMORY_STREAM_OFFSET + 4, hollaID.npc.MEMORY_STREAM_OFFSET + 6 }, -- Floor 2 leading West + [3] = { hollaID.npc.MEMORY_STREAM_OFFSET + 3, hollaID.npc.MEMORY_STREAM_OFFSET + 5 }, -- Floor 2 leading East + [4] = { hollaID.npc.MEMORY_STREAM_OFFSET, hollaID.npc.MEMORY_STREAM_OFFSET + 1, hollaID.npc.MEMORY_STREAM_OFFSET + 2 }, -- Floor 3 West + [5] = { hollaID.npc.MEMORY_STREAM_OFFSET + 8, hollaID.npc.MEMORY_STREAM_OFFSET + 9, hollaID.npc.MEMORY_STREAM_OFFSET + 10 }, -- Floor 3 East + }, + + [xi.zone.PROMYVION_MEA] = + { + [1] = { meaID.npc.MEMORY_STREAM_OFFSET }, -- Floor 1 + [2] = { meaID.npc.MEMORY_STREAM_OFFSET + 7, meaID.npc.MEMORY_STREAM_OFFSET + 8 }, -- Floor 2 leading West + [3] = { meaID.npc.MEMORY_STREAM_OFFSET + 3, meaID.npc.MEMORY_STREAM_OFFSET + 9 }, -- Floor 2 leading East + [4] = { meaID.npc.MEMORY_STREAM_OFFSET + 1, meaID.npc.MEMORY_STREAM_OFFSET + 2, meaID.npc.MEMORY_STREAM_OFFSET + 4 }, -- Floor 3 West + [5] = { meaID.npc.MEMORY_STREAM_OFFSET + 5, meaID.npc.MEMORY_STREAM_OFFSET + 6, meaID.npc.MEMORY_STREAM_OFFSET + 10 }, -- Floor 3 East + }, + + [xi.zone.PROMYVION_VAHZL] = + { + [1] = { vahzlID.npc.MEMORY_STREAM_OFFSET + 2, vahzlID.npc.MEMORY_STREAM_OFFSET + 3 }, -- Floor 1 + [2] = { vahzlID.npc.MEMORY_STREAM_OFFSET, vahzlID.npc.MEMORY_STREAM_OFFSET + 1 }, -- Floor 2 + [3] = { vahzlID.npc.MEMORY_STREAM_OFFSET + 5, vahzlID.npc.MEMORY_STREAM_OFFSET + 6, vahzlID.npc.MEMORY_STREAM_OFFSET + 7, vahzlID.npc.MEMORY_STREAM_OFFSET + 8 }, -- Floor 3 + [4] = { vahzlID.npc.MEMORY_STREAM_OFFSET + 4, vahzlID.npc.MEMORY_STREAM_OFFSET + 9, vahzlID.npc.MEMORY_STREAM_OFFSET + 10 }, -- Floor 4 + }, +} + ----------------------------------- -- Local functions ----------------------------------- -local function maxFloor(ID) - local m = 0 +-- Check available strays to pop. +local function checkForStrays(mob) + local zoneId = mob:getZone():getID() + local mobId = mob:getID() + local strayId = 0 - for _, v in pairs(ID.mob.MEMORY_RECEPTACLES) do - m = math.max(m, v[1]) + -- Check for alive/dead strays. + for i = mobId + 1, mobId + xi.promyvion.receptacleInfoTable[zoneId][mobId][2] do + if not GetMobByID(i):isSpawned() then + strayId = i + break + end end - return m + return strayId end -local function randomizeFloorExit(ID, floor) - local streams = {} +-- Handle receptacle animation (up-pop-down) and stray spawn. +local function spawnStray(mob, strayId) + -- Save mob to spawn. + mob:setLocalVar('[Stray]Id', strayId) - for _, v in pairs(ID.mob.MEMORY_RECEPTACLES) do - if v[1] == floor then - GetNPCByID(v[3]):setLocalVar('[promy]floorExit', 0) - table.insert(streams, v[3]) - end - end + -- 1: Raise Receptacle. + mob:setAnimationSub(1) + + -- 2: Pop Stray. + mob:timer(875, function(mobArg) + local stray = GetMobByID(mobArg:getLocalVar('[Stray]Id')) + mobArg:setLocalVar('[Stray]Id', 0) - local exitStreamId = streams[math.random(#streams)] - GetNPCByID(exitStreamId):setLocalVar('[promy]floorExit', 1) + stray:spawn() + end) + + -- 3: Lower Receptacle. + mob:timer(1750, function(mobArg) + mobArg:setAnimationSub(2) + end) end ----------------------------------- -- Zone global functions ----------------------------------- +xi.promyvion.setupInitialPortals = function(zone) + local zoneId = zone:getID() + + for portalGroup = 1, #xi.promyvion.portalGroupTable[zoneId] do + local groupTable = xi.promyvion.portalGroupTable[zoneId][portalGroup] -- Fetch the whole group entry. + local newPortal = GetNPCByID(groupTable[math.random(1, #groupTable)]) -- Fetch an NPC object from table, at random. + + newPortal:setLocalVar('[Portal]Chosen', 1) -- Mark new portal. + end +end + xi.promyvion.handlePortal = function(player, npcId, eventId) if player:getAnimation() == xi.anim.NONE and @@ -40,15 +179,6 @@ xi.promyvion.handlePortal = function(player, npcId, eventId) end end -xi.promyvion.initZone = function(zone) - local ID = zones[zone:getID()] - - -- randomize floor exits - for i = 1, maxFloor(ID) do - randomizeFloorExit(ID, i) - end -end - ----------------------------------- -- Stray global functions ----------------------------------- @@ -64,43 +194,140 @@ end ----------------------------------- -- Memory Receptacle global functions ----------------------------------- -xi.promyvion.receptacleOnFight = function(mob, target) - if os.time() > mob:getLocalVar('[promy]nextStray') then - local ID = zones[mob:getZoneID()] - local mobId = mob:getID() - local numStrays = ID.mob.MEMORY_RECEPTACLES[mobId][2] - - for i = mobId + 1, mobId + numStrays do - local stray = GetMobByID(i) - if not stray:isSpawned() then - mob:setLocalVar('[promy]nextStray', os.time() + 20) - stray:spawn() +xi.promyvion.receptacleOnMobInitialize = function(mob) + mob:setAutoAttackEnabled(false) -- Receptacles only use TP moves. + mob:addMod(xi.mod.DEF, 55) +end + +xi.promyvion.receptacleOnMobSpawn = function(mob) + -- Handle Stray pop cooldown. + mob:setLocalVar('[Stray]CooldownIdle', os.time() + 60 * math.random(2, 6)) + mob:setLocalVar('[Stray]CooldownFight', 0) + + -- Handle decoration: Fade-in. + local decoration = GetNPCByID(mob:getID() - 1) + + decoration:updateToEntireZone(xi.status.NORMAL, xi.anim.NONE) +end + +xi.promyvion.receptacleOnMobRoam = function(mob) + -- Handle idle stray spawn. + -- NOTE: Strays poped when receptacles are idle don't automatically link unless they are in a certain range. + if os.time() >= mob:getLocalVar('[Stray]CooldownIdle') then + local strayId = checkForStrays(mob) -- Returns stray Id OR 0 + + -- Spawn stray. + if strayId > 0 then + spawnStray(mob, strayId) + GetMobByID(strayId):setLocalVar('[Stray]RangedEnmity', 1) + end + + -- Handle cooldown. + mob:setLocalVar('[Stray]CooldownIdle', os.time() + 60 * math.random(2, 6)) + end +end + +xi.promyvion.receptacleOnMobEngage = function(mob) + -- Handle initial TP. + mob:setTP(3000) +end + +xi.promyvion.receptacleOnMobFight = function(mob, target) + local zoneId = mob:getZone():getID() + local mobId = mob:getID() + local strayCooldown = mob:getLocalVar('[Stray]CooldownFight') + + -- Handle initial cooldown. + if strayCooldown == 0 then + strayCooldown = os.time() + 5 * math.random(2, 4) + mob:setLocalVar('[Stray]CooldownFight', strayCooldown) + end + + -- Handle engaged stray spawn. + if os.time() >= strayCooldown then + local strayId = checkForStrays(mob) + + -- Spawn stray. + if strayId > 0 then + spawnStray(mob, strayId) + end + + -- Handle cooldown. + mob:setLocalVar('[Stray]CooldownFight', os.time() + 5 * math.random(2, 4)) + end + + -- Check for alive associated Strays and update enmity. + for strayId = mobId + 1, mobId + xi.promyvion.receptacleInfoTable[zoneId][mobId][2] do + local stray = GetMobByID(strayId) + + if + stray:isSpawned() and + not stray:isEngaged() + then + -- This stray was spawned when receptacle was idle. Needs distance check. + if stray:getLocalVar('[Stray]RangedEnmity') == 1 then + if stray:checkDistance(mob) < 10 then + stray:updateEnmity(target) + end + -- This stray was spawned when receptacle was engaged in combat. + else stray:updateEnmity(target) - break end end - else - mob:setAnimationSub(2) end end -xi.promyvion.receptacleOnDeath = function(mob, optParams) - if optParams.isKiller then - local ID = zones[mob:getZoneID()] - local mobId = mob:getID() - local floor = ID.mob.MEMORY_RECEPTACLES[mobId][1] - local streamId = ID.mob.MEMORY_RECEPTACLES[mobId][3] - local stream = GetNPCByID(streamId) - - mob:setAnimationSub(0) - - -- open floor exit portal - if stream:getLocalVar('[promy]floorExit') == 1 then - randomizeFloorExit(ID, floor) - local events = ID.npc.MEMORY_STREAMS[streamId][7] - local event = events[math.random(#events)] - stream:setLocalVar('[promy]destination', event) - stream:openDoor(180) - end +xi.promyvion.receptacleOnMobWeaponSkill = function(mob) + -- When left alone after hitting it, Memory Receptacle uses it's skill every 1-3 minutes (aprox). + mob:setMod(xi.mod.REGAIN, 50 * math.random(1, 3)) +end + +xi.promyvion.receptacleOnMobDeath = function(mob, optParams) + if + optParams.isKiller or + optParams.noKiller + then + mob:timer(2000, function(mobArg) + local zoneId = mobArg:getZone():getID() + local mobId = mobArg:getID() + + -- Handle receptacle: Fast despawn. + mobArg:setStatus(xi.status.CUTSCENE_ONLY) + + -- Handle portal: Open if it's the chosen portal. + local portal = GetNPCByID(xi.promyvion.receptacleInfoTable[zoneId][mobId][3]) -- Fetch mob's associated portal. + + if portal:getLocalVar('[Portal]Chosen') == 1 then + portal:openDoor(180) -- Open portal for 3 minutes. + end + + -- Handle decoration: Fade-out. + GetNPCByID(mobId - 1):entityAnimationPacket(xi.animationString.STATUS_DISAPPEAR) + end) + end +end + +xi.promyvion.receptacleOnMobDespawn = function(mob) + local zoneId = mob:getZone():getID() + local mobId = mob:getID() + + -- Handle portal: Choose new portal. + local portal = GetNPCByID(xi.promyvion.receptacleInfoTable[zoneId][mobId][3]) -- Fetch mob's associated portal. + + if portal:getLocalVar('[Portal]Chosen') == 1 then + portal:setLocalVar('[Portal]Chosen', 0) -- Reset. + + -- Choose new portal. + local mobGroup = xi.promyvion.receptacleInfoTable[zoneId][mobId][1] -- Fetch group ID the mob belongs to. + local groupTable = xi.promyvion.portalGroupTable[zoneId][mobGroup] -- Fetch the whole group table. + local newPortal = GetNPCByID(groupTable[math.random(1, #groupTable)]) -- Fetch NPC object from table, at random. + + newPortal:setLocalVar('[Portal]Chosen', 1) -- Mark new portal. end + + -- Handle decoration: Reset. + local decoration = GetNPCByID(mobId - 1) + + decoration:updateToEntireZone(xi.status.CUTSCENE_ONLY, xi.anim.DESPAWN) + decoration:entityAnimationPacket(xi.animationString.STATUS_VISIBLE) end diff --git a/scripts/zones/Promyvion-Dem/IDs.lua b/scripts/zones/Promyvion-Dem/IDs.lua index ed40dfc2b9f..8e0a69eb2f4 100644 --- a/scripts/zones/Promyvion-Dem/IDs.lua +++ b/scripts/zones/Promyvion-Dem/IDs.lua @@ -22,22 +22,8 @@ zones[xi.zone.PROMYVION_DEM] = }, mob = { - MEMORY_RECEPTACLES = - { - [16850972] = { 1, 3, 16851278 }, - [16851026] = { 2, 5, 16851282 }, - [16851033] = { 2, 5, 16851283 }, - [16851040] = { 2, 5, 16851284 }, - [16851047] = { 2, 5, 16851285 }, - [16851073] = { 3, 7, 16851279 }, - [16851082] = { 3, 7, 16851280 }, - [16851091] = { 3, 7, 16851281 }, - [16851152] = { 4, 7, 16851286 }, - [16851161] = { 4, 7, 16851287 }, - [16851170] = { 4, 7, 16851288 }, - }, - - SATIATOR = GetFirstID('Satiator'), + MEMORY_RECEPTACLE_TABLE = GetTableOfIDs('Memory_Receptacle'), + SATIATOR = GetFirstID('Satiator'), }, npc = { diff --git a/scripts/zones/Promyvion-Dem/Zone.lua b/scripts/zones/Promyvion-Dem/Zone.lua index 2cf38a14dc9..af58f9e45ab 100644 --- a/scripts/zones/Promyvion-Dem/Zone.lua +++ b/scripts/zones/Promyvion-Dem/Zone.lua @@ -25,7 +25,7 @@ zoneObject.onInitialize = function(zone) zone:registerTriggerArea(16, -120, 3, 160, 0, 0, 0) -- Floor 3 (North): Portal SE -- Select portals. - xi.promyvion.initZone(zone) + xi.promyvion.setupInitialPortals(zone) -- Update NM between Floor 3 islands. UpdateNMSpawnPoint(ID.mob.SATIATOR) diff --git a/scripts/zones/Promyvion-Dem/mobs/Memory_Receptacle.lua b/scripts/zones/Promyvion-Dem/mobs/Memory_Receptacle.lua index 752f87b2b7a..b48a61f2ad5 100644 --- a/scripts/zones/Promyvion-Dem/mobs/Memory_Receptacle.lua +++ b/scripts/zones/Promyvion-Dem/mobs/Memory_Receptacle.lua @@ -5,19 +5,35 @@ local entity = {} entity.onMobInitialize = function(mob) - mob:setAutoAttackEnabled(false) -- Receptacles only use TP moves. + xi.promyvion.receptacleOnMobInitialize(mob) +end + +entity.onMobSpawn = function(mob) + xi.promyvion.receptacleOnMobSpawn(mob) +end + +entity.onMobRoam = function(mob) + xi.promyvion.receptacleOnMobRoam(mob) +end + +entity.onMobEngage = function(mob, target) + xi.promyvion.receptacleOnMobEngage(mob) end entity.onMobFight = function(mob, target) - xi.promyvion.receptacleOnFight(mob, target) + xi.promyvion.receptacleOnMobFight(mob, target) +end + +entity.onMobWeaponSkill = function(target, mob, skill) + xi.promyvion.receptacleOnMobWeaponSkill(mob) end entity.onMobDeath = function(mob, player, optParams) - xi.promyvion.receptacleOnDeath(mob, optParams) + xi.promyvion.receptacleOnMobDeath(mob, optParams) end -entity.onMobSpawn = function(mob) - mob:addMod(xi.mod.DEF, 55) +entity.onMobDespawn = function(mob) + xi.promyvion.receptacleOnMobDespawn(mob) end return entity diff --git a/scripts/zones/Promyvion-Holla/IDs.lua b/scripts/zones/Promyvion-Holla/IDs.lua index 1ef045e6f39..9f277fc1282 100644 --- a/scripts/zones/Promyvion-Holla/IDs.lua +++ b/scripts/zones/Promyvion-Holla/IDs.lua @@ -22,22 +22,8 @@ zones[xi.zone.PROMYVION_HOLLA] = }, mob = { - MEMORY_RECEPTACLES = - { - [16842781] = { 1, 3, 16843061 }, - [16842841] = { 2, 5, 16843057 }, - [16842848] = { 2, 5, 16843058 }, - [16842855] = { 2, 5, 16843059 }, - [16842862] = { 2, 5, 16843060 }, - [16842888] = { 3, 7, 16843054 }, - [16842897] = { 3, 7, 16843055 }, - [16842906] = { 3, 7, 16843056 }, - [16842940] = { 4, 7, 16843062 }, - [16842949] = { 4, 7, 16843063 }, - [16842958] = { 4, 7, 16843064 }, - }, - - CEREBRATOR = GetFirstID('Cerebrator'), + MEMORY_RECEPTACLE_TABLE = GetTableOfIDs('Memory_Receptacle'), + CEREBRATOR = GetFirstID('Cerebrator'), }, npc = { diff --git a/scripts/zones/Promyvion-Holla/Zone.lua b/scripts/zones/Promyvion-Holla/Zone.lua index 7f2ece576a3..365eb49b209 100644 --- a/scripts/zones/Promyvion-Holla/Zone.lua +++ b/scripts/zones/Promyvion-Holla/Zone.lua @@ -25,7 +25,7 @@ zoneObject.onInitialize = function(zone) zone:registerTriggerArea(16, 280, 3, 200, 0, 0, 0) -- Floor 3 (East): Portal SE -- Select portals. - xi.promyvion.initZone(zone) + xi.promyvion.setupInitialPortals(zone) -- Update NM between Floor 3 islands. UpdateNMSpawnPoint(ID.mob.CEREBRATOR) diff --git a/scripts/zones/Promyvion-Holla/mobs/Memory_Receptacle.lua b/scripts/zones/Promyvion-Holla/mobs/Memory_Receptacle.lua index 0b916c4cfae..019f0c498d7 100644 --- a/scripts/zones/Promyvion-Holla/mobs/Memory_Receptacle.lua +++ b/scripts/zones/Promyvion-Holla/mobs/Memory_Receptacle.lua @@ -5,19 +5,35 @@ local entity = {} entity.onMobInitialize = function(mob) - mob:setAutoAttackEnabled(false) -- Receptacles only use TP moves. + xi.promyvion.receptacleOnMobInitialize(mob) +end + +entity.onMobSpawn = function(mob) + xi.promyvion.receptacleOnMobSpawn(mob) +end + +entity.onMobRoam = function(mob) + xi.promyvion.receptacleOnMobRoam(mob) +end + +entity.onMobEngage = function(mob, target) + xi.promyvion.receptacleOnMobEngage(mob) end entity.onMobFight = function(mob, target) - xi.promyvion.receptacleOnFight(mob, target) + xi.promyvion.receptacleOnMobFight(mob, target) +end + +entity.onMobWeaponSkill = function(target, mob, skill) + xi.promyvion.receptacleOnMobWeaponSkill(mob) end entity.onMobDeath = function(mob, player, optParams) - xi.promyvion.receptacleOnDeath(mob, optParams) + xi.promyvion.receptacleOnMobDeath(mob, optParams) end -entity.onMobSpawn = function(mob) - mob:addMod(xi.mod.DEF, 55) +entity.onMobDespawn = function(mob) + xi.promyvion.receptacleOnMobDespawn(mob) end return entity diff --git a/scripts/zones/Promyvion-Mea/IDs.lua b/scripts/zones/Promyvion-Mea/IDs.lua index 5050add0212..e0d00976afc 100644 --- a/scripts/zones/Promyvion-Mea/IDs.lua +++ b/scripts/zones/Promyvion-Mea/IDs.lua @@ -22,22 +22,8 @@ zones[xi.zone.PROMYVION_MEA] = }, mob = { - MEMORY_RECEPTACLES = - { - [16859155] = { 1, 3, 16859483 }, - [16859205] = { 2, 5, 16859486 }, - [16859212] = { 2, 5, 16859490 }, - [16859219] = { 2, 5, 16859491 }, - [16859226] = { 2, 5, 16859492 }, - [16859296] = { 3, 7, 16859484 }, - [16859305] = { 3, 7, 16859485 }, - [16859314] = { 3, 7, 16859487 }, - [16859376] = { 4, 7, 16859488 }, - [16859385] = { 4, 7, 16859489 }, - [16859394] = { 4, 7, 16859493 }, - }, - - COVETER = GetFirstID('Coveter'), + MEMORY_RECEPTACLE_TABLE = GetTableOfIDs('Memory_Receptacle'), + COVETER = GetFirstID('Coveter'), }, npc = { diff --git a/scripts/zones/Promyvion-Mea/Zone.lua b/scripts/zones/Promyvion-Mea/Zone.lua index c96232f00b9..e5fbd711cf8 100644 --- a/scripts/zones/Promyvion-Mea/Zone.lua +++ b/scripts/zones/Promyvion-Mea/Zone.lua @@ -25,7 +25,7 @@ zoneObject.onInitialize = function(zone) zone:registerTriggerArea(16, 240, 3, -320, 0, 0, 0) -- Floor 3 (East): Portal SW -- Select portals. - xi.promyvion.initZone(zone) + xi.promyvion.setupInitialPortals(zone) -- Update NM between Floor 3 islands. UpdateNMSpawnPoint(ID.mob.COVETER) diff --git a/scripts/zones/Promyvion-Mea/mobs/Memory_Receptacle.lua b/scripts/zones/Promyvion-Mea/mobs/Memory_Receptacle.lua index d9fcb8caf15..2602e380e90 100644 --- a/scripts/zones/Promyvion-Mea/mobs/Memory_Receptacle.lua +++ b/scripts/zones/Promyvion-Mea/mobs/Memory_Receptacle.lua @@ -5,19 +5,35 @@ local entity = {} entity.onMobInitialize = function(mob) - mob:setAutoAttackEnabled(false) -- Receptacles only use TP moves. + xi.promyvion.receptacleOnMobInitialize(mob) +end + +entity.onMobSpawn = function(mob) + xi.promyvion.receptacleOnMobSpawn(mob) +end + +entity.onMobRoam = function(mob) + xi.promyvion.receptacleOnMobRoam(mob) +end + +entity.onMobEngage = function(mob, target) + xi.promyvion.receptacleOnMobEngage(mob) end entity.onMobFight = function(mob, target) - xi.promyvion.receptacleOnFight(mob, target) + xi.promyvion.receptacleOnMobFight(mob, target) +end + +entity.onMobWeaponSkill = function(target, mob, skill) + xi.promyvion.receptacleOnMobWeaponSkill(mob) end entity.onMobDeath = function(mob, player, optParams) - xi.promyvion.receptacleOnDeath(mob, optParams) + xi.promyvion.receptacleOnMobDeath(mob, optParams) end -entity.onMobSpawn = function(mob) - mob:addMod(xi.mod.DEF, 55) +entity.onMobDespawn = function(mob) + xi.promyvion.receptacleOnMobDespawn(mob) end return entity diff --git a/scripts/zones/Promyvion-Vahzl/IDs.lua b/scripts/zones/Promyvion-Vahzl/IDs.lua index df9b4fc4d50..3718344306e 100644 --- a/scripts/zones/Promyvion-Vahzl/IDs.lua +++ b/scripts/zones/Promyvion-Vahzl/IDs.lua @@ -26,27 +26,13 @@ zones[xi.zone.PROMYVION_VAHZL] = }, mob = { - MEMORY_RECEPTACLES = - { - [16867387] = { 1, 3, 16867720 }, - [16867392] = { 1, 3, 16867721 }, - [16867439] = { 2, 5, 16867718 }, - [16867446] = { 2, 5, 16867719 }, - [16867504] = { 3, 5, 16867723 }, - [16867511] = { 3, 5, 16867724 }, - [16867518] = { 3, 5, 16867725 }, - [16867525] = { 3, 5, 16867726 }, - [16867601] = { 4, 7, 16867722 }, - [16867610] = { 4, 7, 16867727 }, - [16867619] = { 4, 7, 16867728 }, - }, - - PONDERER = GetFirstID('Ponderer'), - PROPAGATOR = GetFirstID('Propagator'), - SOLICITOR = GetFirstID('Solicitor'), - DEVIATOR = GetFirstID('Deviator'), - WAILER = GetFirstID('Wailer'), - PROVOKER = GetFirstID('Provoker'), + MEMORY_RECEPTACLE_TABLE = GetTableOfIDs('Memory_Receptacle'), + PONDERER = GetFirstID('Ponderer'), + PROPAGATOR = GetFirstID('Propagator'), + SOLICITOR = GetFirstID('Solicitor'), + DEVIATOR = GetFirstID('Deviator'), + WAILER = GetFirstID('Wailer'), + PROVOKER = GetFirstID('Provoker'), }, npc = { diff --git a/scripts/zones/Promyvion-Vahzl/Zone.lua b/scripts/zones/Promyvion-Vahzl/Zone.lua index 113b856fdf2..f95651a5042 100644 --- a/scripts/zones/Promyvion-Vahzl/Zone.lua +++ b/scripts/zones/Promyvion-Vahzl/Zone.lua @@ -25,7 +25,7 @@ zoneObject.onInitialize = function(zone) zone:registerTriggerArea(16, 440, 3, 279, 0, 0, 0) -- Floor 4: Portal NE -- Select portals. - xi.promyvion.initZone(zone) + xi.promyvion.setupInitialPortals(zone) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Promyvion-Vahzl/mobs/Memory_Receptacle.lua b/scripts/zones/Promyvion-Vahzl/mobs/Memory_Receptacle.lua index e6bccd52bdc..7a86e4262a0 100644 --- a/scripts/zones/Promyvion-Vahzl/mobs/Memory_Receptacle.lua +++ b/scripts/zones/Promyvion-Vahzl/mobs/Memory_Receptacle.lua @@ -5,15 +5,35 @@ local entity = {} entity.onMobInitialize = function(mob) - mob:setAutoAttackEnabled(false) -- Receptacles only use TP moves. + xi.promyvion.receptacleOnMobInitialize(mob) +end + +entity.onMobSpawn = function(mob) + xi.promyvion.receptacleOnMobSpawn(mob) +end + +entity.onMobRoam = function(mob) + xi.promyvion.receptacleOnMobRoam(mob) +end + +entity.onMobEngage = function(mob, target) + xi.promyvion.receptacleOnMobEngage(mob) end entity.onMobFight = function(mob, target) - xi.promyvion.receptacleOnFight(mob, target) + xi.promyvion.receptacleOnMobFight(mob, target) +end + +entity.onMobWeaponSkill = function(target, mob, skill) + xi.promyvion.receptacleOnMobWeaponSkill(mob) end entity.onMobDeath = function(mob, player, optParams) - xi.promyvion.receptacleOnDeath(mob, optParams) + xi.promyvion.receptacleOnMobDeath(mob, optParams) +end + +entity.onMobDespawn = function(mob) + xi.promyvion.receptacleOnMobDespawn(mob) end return entity