Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LUA] Add Frozen Mist and Hydro Wave mobskills #5731

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions scripts/actions/mobskills/frozen_mist.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----------------------------------
-- Frozen Mist
-- Description: Deals ice damage to enemies around the caster. Additional effect: Terror
-- Type: Magical (Ice)
-----------------------------------
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
return 0
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local power = 30
local resist = xi.mobskills.applyPlayerResistance(mob, xi.effect.TERROR, target, mob:getStat(xi.mod.INT) - target:getStat(xi.mod.INT), 0, 0)
local duration = 30 * resist

xi.mobskills.mobStatusEffectMove(mob, target, xi.effect.TERROR, power, 0, duration)

local dmgmod = 1.5
local info = xi.mobskills.mobMagicalMove(mob, target, skill, mob:getWeaponDmg(), xi.element.ICE, dmgmod, xi.mobskills.magicalTpBonus.NO_EFFECT)
local dmg = xi.mobskills.mobFinalAdjustments(info.dmg, mob, skill, target, xi.attackType.MAGICAL, xi.damageType.ICE, xi.mobskills.shadowBehavior.WIPE_SHADOWS)

target:takeDamage(dmg, mob, xi.attackType.MAGICAL, xi.damageType.ICE)

return dmg
end

return mobskillObject
30 changes: 30 additions & 0 deletions scripts/actions/mobskills/hydro_wave.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-----------------------------------
-- Hydro Wave
-- Description: Deals water damage to enemies around the caster.
-- Type: Magical (Water)
-----------------------------------
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
return 0
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local power = math.random(1, 16)
local resist = xi.mobskills.applyPlayerResistance(mob, xi.effect.ENCUMBRANCE_II, target, mob:getStat(xi.mod.INT) - target:getStat(xi.mod.INT), 0, 0)
local duration = 30 * resist

xi.mobskills.mobStatusEffectMove(mob, target, xi.effect.ENCUMBRANCE_II, power, 0, duration)

local dmgmod = 2.5
local info = xi.mobskills.mobMagicalMove(mob, target, skill, mob:getWeaponDmg(), xi.element.WATER, dmgmod, xi.mobskills.magicalTpBonus.NO_EFFECT)
local dmg = xi.mobskills.mobFinalAdjustments(info.dmg, mob, skill, target, xi.attackType.MAGICAL, xi.damageType.WATER, xi.mobskills.shadowBehavior.WIPE_SHADOWS)

target:takeDamage(dmg, mob, xi.attackType.MAGICAL, xi.damageType.WATER)

mob:addStatusEffect(xi.effect.STONESKIN, 0, 0, 180, 2, 1500)

return dmg
end

return mobskillObject
2 changes: 1 addition & 1 deletion scripts/effects/encumbrance.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-----------------------------------
-- xi.effect.ENCUMBERANCE
-- xi.effect.ENCUMBRANCE
-----------------------------------
local effectObject = {}

Expand Down
19 changes: 19 additions & 0 deletions scripts/mixins/families/ruszor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,28 @@ require('scripts/globals/mixins')
g_mixins = g_mixins or {}

g_mixins.ruszor = function(ruszorMob)
ruszorMob:addListener('WEAPONSKILL_USE', 'AURA', function(mob, target, actionId, tp, action)
local frozenMist = 2438
local hydroWave = 2439

-- Ruszor gain a temporary icy aura following the use of Frozen Mist.
if actionId == frozenMist then
mob:setAnimationSub(1)
mob:setMod(xi.mod.WATER_ABSORB, 0)
mob:setMod(xi.mod.ICE_ABSORB, 100)
-- Ruszor gain a temporary water aura following the use of Hydro Wave.
elseif actionId == hydroWave then
mob:setAnimationSub(2)
mob:setMod(xi.mod.ICE_ABSORB, 0)
mob:setMod(xi.mod.WATER_ABSORB, 100)
end
end)

ruszorMob:addListener('EFFECT_LOSE', 'STONESKIN', function(mob, effect)
if effect:getEffectType() == xi.effect.STONESKIN then
mob:setAnimationSub(0)
mob:setMod(xi.mod.ICE_ABSORB, 0)
mob:setMod(xi.mod.WATER_ABSORB, 0)
end
end)
end
Expand Down
Loading