Skip to content

Commit

Permalink
PW: Full Rework
Browse files Browse the repository at this point in the history
- Odd-number phases to match retail as simply a short intermediate phase
- Mob spell/skill list defined in mob's lua per phase for pet and PW
  - This removes need for most familyid conditionals in skill luas
- Astral Flow given retail-accurate delay on spawn
- Phase and pet change logic moved to functions
- Coded skills: cackle, brainjack
- Added flavor text to PW spawn/death
  • Loading branch information
MowFord committed Dec 17, 2023
1 parent 36354bf commit daad764
Show file tree
Hide file tree
Showing 42 changed files with 652 additions and 482 deletions.
10 changes: 0 additions & 10 deletions scripts/actions/mobskills/bilgestorm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
if mob:getFamily() == 316 then
local mobSkin = mob:getModelId()

if mobSkin == 1840 then
return 0
else
return 1
end
end

return 0
end

Expand Down
30 changes: 22 additions & 8 deletions scripts/actions/mobskills/brainjack.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
-----------------------------------
-- BrainJack
-- Charms a player and inflicts a 25/tick dot while charmed
-- Only used by Long-Armed Chariot and Long-Horned Chariot. Last roughly 90 seconds; DoT takes about 25HP/tick.
-----------------------------------
local mobskillObject = {}

Expand All @@ -8,16 +10,28 @@ mobskillObject.onMobSkillCheck = function(target, mob, skill)
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local numhits = 1
local accmod = 1
local dmgmod = 2.3
local info = xi.mobskills.mobPhysicalMove(mob, target, skill, numhits, accmod, dmgmod, xi.mobskills.magicalTpBonus.NO_EFFECT)
local dmg = xi.mobskills.mobFinalAdjustments(info.dmg, mob, skill, target, xi.attackType.PHYSICAL, xi.damageType.BLUNT, info.hitslanded)
local duration = 90
local typeEffect = xi.effect.CHARM_I

xi.mobskills.mobPhysicalStatusEffectMove(mob, target, skill, xi.effect.CHARM_I, 0, 0, 60)
target:takeDamage(dmg, mob, xi.attackType.PHYSICAL, xi.damageType.BLUNT)
if not target:isPC() then
skill:setMsg(xi.msg.basic.SKILL_MISS)
return typeEffect
elseif mob:getFamily() == 316 then -- Pandemonium Warden
duration = 30
end

return dmg
local msg = xi.mobskills.mobPhysicalStatusEffectMove(mob, target, skill, typeEffect, 0, 0, duration)
if msg == xi.msg.basic.SKILL_ENFEEB_IS then
target:addMod(xi.mod.REGEN_DOWN, 25)
-- apply regen_down on the target, and stack DoT on the effect so it gets removed when charm is removed
local effect = target:getStatusEffect(typeEffect)
effect:addMod(xi.mod.REGEN_DOWN, 25)
mob:charm(target)
mob:resetEnmity(target)
end

skill:setMsg(msg)
return typeEffect
end

return mobskillObject
40 changes: 40 additions & 0 deletions scripts/actions/mobskills/cackle.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
-----------------------------------
-- Cackle
-- Reduces magical attack, magical accuracy, or magical defense of targets in an area of effect.
-- Video evidence that it's only ever one effect applied to all targets in AoE: https://youtu.be/T_Us2Tmlm-E?t=206
-----------------------------------
local mobskillObject = {}

local typeEffects =
{
xi.effect.MAGIC_ATK_DOWN,
xi.effect.MAGIC_ACC_DOWN,
xi.effect.MAGIC_DEF_DOWN,
}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
-- smaller range to use, but 30 yalm AoE. Effectively cannot out-range the skill
if mob:checkDistance(target) > 10 then
return 1
end

mob:setLocalVar('cackle-index', math.random(1, #typeEffects))
return 0
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local power = 40
local duration = 60
local returnEffect = xi.effect.NONE
local typeEffect = typeEffects[mob:getLocalVar('cackle-index')]

skill:setMsg(xi.msg.basic.SKILL_MISS)
if xi.mobskills.mobStatusEffectMove(mob, target, typeEffect, power, 0, duration) == xi.msg.basic.SKILL_ENFEEB_IS then
returnEffect = typeEffect
skill:setMsg(xi.msg.basic.SKILL_ENFEEB_IS)
end

return returnEffect
end

return mobskillObject
10 changes: 0 additions & 10 deletions scripts/actions/mobskills/crosswind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
if mob:getFamily() == 91 then
local mobSkin = mob:getModelId()

if mobSkin == 1746 then
return 0
else
return 1
end
end

return 0
end

Expand Down
2 changes: 1 addition & 1 deletion scripts/actions/mobskills/diamondhide.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local power = 600 -- Guesstimated, def not based on mobs lv+hp*tp like was previously in this script..
skill:setMsg(xi.mobskills.mobBuffMove(mob, xi.effect.STONESKIN, power, 0, 300))
skill:setMsg(xi.mobskills.mobBuffMove(target, xi.effect.STONESKIN, power, 0, 300))
return xi.effect.STONESKIN
end

Expand Down
10 changes: 0 additions & 10 deletions scripts/actions/mobskills/dreadstorm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
if mob:getFamily() == 316 then
local mobSkin = mob:getModelId()

if mobSkin == 1805 then
return 0
else
return 1
end
end

return 1
end

Expand Down
10 changes: 0 additions & 10 deletions scripts/actions/mobskills/enervation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
if mob:getFamily() == 91 then
local mobSkin = mob:getModelId()

if mobSkin == 1680 then
return 0
else
return 1
end
end

return 0
end

Expand Down
10 changes: 0 additions & 10 deletions scripts/actions/mobskills/firespit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
if mob:getFamily() == 91 then
local mobSkin = mob:getModelId()

if mobSkin == 1639 then
return 0
else
return 1
end
end

return 0
end

Expand Down
14 changes: 4 additions & 10 deletions scripts/actions/mobskills/fossilizing_breath.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
if mob:getFamily() == 316 then
local mobSkin = mob:getModelId()

if mobSkin == 1805 then
return 0
else
return 1
end
if target:isBehind(mob, 48) then
return 1
else
return 0
end

return 0
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
Expand Down
12 changes: 2 additions & 10 deletions scripts/actions/mobskills/fulmination.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
if mob:getFamily() == 316 then
local mobSkin = mob:getModelId()

if mobSkin == 1805 then
return 0
else
return 1
end
end

local family = mob:getFamily()
local mobhp = mob:getHPP()
local result = 1
Expand All @@ -27,6 +17,8 @@ mobskillObject.onMobSkillCheck = function(target, mob, skill)
result = 0
elseif family == 315 and mobhp <= 50 then -- Tyger < 50%
result = 0
elseif family == 316 then
result = 0
end

return result
Expand Down
10 changes: 0 additions & 10 deletions scripts/actions/mobskills/gates_of_hades.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
if mob:getFamily() == 316 then
local mobSkin = mob:getModelId()

if mobSkin == 1793 then
return 0
else
return 1
end
end

local result = 1
local mobhp = mob:getHPP()

Expand Down
20 changes: 0 additions & 20 deletions scripts/actions/mobskills/hellclap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,6 @@
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
if mob:getFamily() == 91 then
local mobSkin = mob:getModelId()

if mobSkin == 1839 then
return 0
else
return 1
end
end

if mob:getFamily() == 316 then
local mobSkin = mob:getModelId()

if mobSkin == 1840 then
return 0
else
return 1
end
end

return 0
end

Expand Down
30 changes: 8 additions & 22 deletions scripts/actions/mobskills/hellsnap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,19 @@
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
if mob:getFamily() == 91 then
local mobSkin = mob:getModelId()

if mobSkin == 1839 then
return 0
else
return 1
end
end

if mob:getFamily() == 316 then
local mobSkin = mob:getModelId()

if mobSkin == 1840 then
return 0
else
return 1
end
end

return 0
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
xi.mobskills.mobPhysicalStatusEffectMove(mob, target, skill, xi.effect.STUN, 1, 0, 4)
local duration = 5
local returnEffect = xi.effect.STUN
if mob:getFamily() == 316 and mob:getLocalVar('phase') ~= 21 then
duration = 10
end

skill:setMsg(xi.mobskills.mobPhysicalStatusEffectMove(mob, target, skill, returnEffect, 1, 0, duration))

return xi.effect.STUN
return returnEffect
end

return mobskillObject
File renamed without changes.
6 changes: 1 addition & 5 deletions scripts/actions/mobskills/ill_wind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
if mob:getFamily() == 316 and mob:getModelId() == 1746 then
return 0
else
return 1
end
return 0
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
Expand Down
10 changes: 0 additions & 10 deletions scripts/actions/mobskills/lava_spit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
if mob:getFamily() == 316 then
local mobSkin = mob:getModelId()

if mobSkin == 1793 then
return 0
else
return 1
end
end

if target:isBehind(mob, 48) then
return 1
else
Expand Down
20 changes: 0 additions & 20 deletions scripts/actions/mobskills/necrobane.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,6 @@
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
if mob:getFamily() == 316 then
local mobSkin = mob:getModelId()

if mobSkin == 1840 then
return 0
else
return 1
end
end

if mob:getFamily() == 91 then
local mobSkin = mob:getModelId()

if mobSkin == 1839 then
return 0
else
return 1
end
end

return 0
end

Expand Down
20 changes: 0 additions & 20 deletions scripts/actions/mobskills/necropurge.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,6 @@
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
if mob:getFamily() == 316 then
local mobSkin = mob:getModelId()

if mobSkin == 1840 then
return 0
else
return 1
end
end

if mob:getFamily() == 91 then
local mobSkin = mob:getModelId()

if mobSkin == 1839 then
return 0
else
return 1
end
end

return 0
end

Expand Down
Loading

0 comments on commit daad764

Please sign in to comment.