Skip to content

Commit

Permalink
Merge pull request #7127 from Xaver-DaRed/promy
Browse files Browse the repository at this point in the history
[Promyvion] Properly use fast despawn functionality for Memory receptacle decorations and portals
  • Loading branch information
zach2good authored Feb 24, 2025
2 parents 08385a9 + 70fb2e4 commit 62c80c6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 45 deletions.
37 changes: 8 additions & 29 deletions scripts/globals/promyvion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ end
xi.promyvion.receptacleOnMobInitialize = function(mob)
mob:setAutoAttackEnabled(false) -- Receptacles only use TP moves.
mob:addMod(xi.mod.DEF, 55)
-- mob:setMod(xi.mod.DESPAWN_TIME_REDUCTION, 10) -- TODO: Properly time in retail and then adjust timers for portal opening, decorations, etc...
mob:setMod(xi.mod.DESPAWN_TIME_REDUCTION, 15)
end

xi.promyvion.receptacleOnMobSpawn = function(mob)
Expand Down Expand Up @@ -351,39 +351,15 @@ xi.promyvion.receptacleOnMobWeaponSkill = function(mob)
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(receptacleInfoTable[zoneId][mobId][3]) -- Fetch mob's associated portal.

if portal and 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.
-- Handle portal: Open and choose new portal.
local portal = GetNPCByID(receptacleInfoTable[zoneId][mobId][3]) -- Fetch mob's associated portal.

if portal and portal:getLocalVar('[Portal]Chosen') == 1 then
portal:openDoor(180) -- Open portal for 3 minutes.
portal:setLocalVar('[Portal]Chosen', 0) -- Reset.

-- Choose new portal.
Expand All @@ -404,7 +380,10 @@ xi.promyvion.receptacleOnMobDespawn = function(mob)
-- Handle decoration: Reset.
local decoration = GetNPCByID(mobId - 1)
if decoration then
decoration:updateToEntireZone(xi.status.CUTSCENE_ONLY, xi.anim.DESPAWN)
decoration:entityAnimationPacket(xi.animationString.STATUS_VISIBLE)
decoration:entityAnimationPacket(xi.animationString.STATUS_DISAPPEAR)
decoration:timer(2500, function(decorationArg)
decorationArg:updateToEntireZone(xi.status.CUTSCENE_ONLY, xi.anim.DESPAWN)
decorationArg:entityAnimationPacket(xi.animationString.STATUS_VISIBLE)
end)
end
end
4 changes: 0 additions & 4 deletions scripts/zones/Promyvion-Dem/mobs/Memory_Receptacle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ entity.onMobWeaponSkill = function(target, mob, skill)
xi.promyvion.receptacleOnMobWeaponSkill(mob)
end

entity.onMobDeath = function(mob, player, optParams)
xi.promyvion.receptacleOnMobDeath(mob, optParams)
end

entity.onMobDespawn = function(mob)
xi.promyvion.receptacleOnMobDespawn(mob)
end
Expand Down
4 changes: 0 additions & 4 deletions scripts/zones/Promyvion-Holla/mobs/Memory_Receptacle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ entity.onMobWeaponSkill = function(target, mob, skill)
xi.promyvion.receptacleOnMobWeaponSkill(mob)
end

entity.onMobDeath = function(mob, player, optParams)
xi.promyvion.receptacleOnMobDeath(mob, optParams)
end

entity.onMobDespawn = function(mob)
xi.promyvion.receptacleOnMobDespawn(mob)
end
Expand Down
4 changes: 0 additions & 4 deletions scripts/zones/Promyvion-Mea/mobs/Memory_Receptacle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ entity.onMobWeaponSkill = function(target, mob, skill)
xi.promyvion.receptacleOnMobWeaponSkill(mob)
end

entity.onMobDeath = function(mob, player, optParams)
xi.promyvion.receptacleOnMobDeath(mob, optParams)
end

entity.onMobDespawn = function(mob)
xi.promyvion.receptacleOnMobDespawn(mob)
end
Expand Down
4 changes: 0 additions & 4 deletions scripts/zones/Promyvion-Vahzl/mobs/Memory_Receptacle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ entity.onMobWeaponSkill = function(target, mob, skill)
xi.promyvion.receptacleOnMobWeaponSkill(mob)
end

entity.onMobDeath = function(mob, player, optParams)
xi.promyvion.receptacleOnMobDeath(mob, optParams)
end

entity.onMobDespawn = function(mob)
xi.promyvion.receptacleOnMobDespawn(mob)
end
Expand Down

0 comments on commit 62c80c6

Please sign in to comment.