Skip to content

Commit

Permalink
[lua, sql] HNM Kings Rework
Browse files Browse the repository at this point in the history
  • Loading branch information
CriticalXI committed Jan 22, 2025
1 parent b6d8849 commit 724f7aa
Show file tree
Hide file tree
Showing 25 changed files with 280 additions and 131 deletions.
2 changes: 1 addition & 1 deletion scripts/actions/mobskills/absolute_terror.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local power = 30
local duration = 30 -- Reference: http://wiki.ffxiclopedia.org/wiki/Absolute_Terror
local duration = math.random(15, 45)

if skill:isAoE() then
duration = 10
Expand Down
3 changes: 2 additions & 1 deletion scripts/actions/mobskills/aqua_breath.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ mobskillObject.onMobSkillCheck = function(target, mob, skill)
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local dmgmod = xi.mobskills.mobBreathMove(mob, target, skill, 0.25, 1.5, xi.element.WATER, 400)
-- TODO: Needs a flat bonus 100 damage added to breath
local dmgmod = xi.mobskills.mobBreathMove(mob, target, skill, 0.10, 1.5, xi.element.WATER, 500)
local dmg = xi.mobskills.mobFinalAdjustments(dmgmod, mob, skill, target, xi.attackType.BREATH, xi.damageType.WATER, xi.mobskills.shadowBehavior.IGNORE_SHADOWS)

target:takeDamage(dmg, mob, xi.attackType.BREATH, xi.damageType.WATER)
Expand Down
4 changes: 2 additions & 2 deletions scripts/actions/mobskills/dragon_breath.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ mobskillObject.onMobSkillCheck = function(target, mob, skill)
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local dmgmod = xi.mobskills.mobBreathMove(mob, target, skill, 0.2, 1.25, xi.element.FIRE, 1400)
dmgmod = utils.conalDamageAdjustment(mob, target, skill, dmgmod, 0.9)
local dmgmod = xi.mobskills.mobBreathMove(mob, target, skill, 0.15, 1.25, xi.element.FIRE, 1596)
dmgmod = utils.conalDamageAdjustment(mob, target, skill, dmgmod, 0.2)

local dmg = xi.mobskills.mobFinalAdjustments(dmgmod, mob, skill, target, xi.attackType.BREATH, xi.damageType.FIRE, xi.mobskills.shadowBehavior.IGNORE_SHADOWS)

Expand Down
3 changes: 2 additions & 1 deletion scripts/actions/mobskills/earth_breath.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ mobskillObject.onMobSkillCheck = function(target, mob, skill)
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local dmgmod = xi.mobskills.mobBreathMove(mob, target, skill, 0.167, 1.875, xi.element.EARTH, 500)
-- TODO: Needs a flat bonus 100 damage added to breath
local dmgmod = xi.mobskills.mobBreathMove(mob, target, skill, 0.10, 1.875, xi.element.EARTH, 500)

local dmg = xi.mobskills.mobFinalAdjustments(dmgmod, mob, skill, target, xi.attackType.BREATH, xi.damageType.EARTH, xi.mobskills.shadowBehavior.IGNORE_SHADOWS)
target:takeDamage(dmg, mob, xi.attackType.BREATH, xi.damageType.EARTH)
Expand Down
8 changes: 7 additions & 1 deletion scripts/actions/mobskills/harden_shell.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ mobskillObject.onMobSkillCheck = function(target, mob, skill)
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
skill:setMsg(xi.mobskills.mobBuffMove(mob, xi.effect.DEFENSE_BOOST, 100, 0, 60))
local duration = math.random(60, 180)

if mob:isNM() then
skill:setMsg(xi.mobskills.mobBuffMove(mob, xi.effect.DEFENSE_BOOST, 80, 0, duration))
else
skill:setMsg(xi.mobskills.mobBuffMove(mob, xi.effect.DEFENSE_BOOST, 33, 0, duration))
end

return xi.effect.DEFENSE_BOOST
end
Expand Down
5 changes: 3 additions & 2 deletions scripts/actions/mobskills/head_butt_turtle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ end
mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local numhits = 1
local accmod = 1
local dmgmod = 3
local dmgmod = 1
local info = xi.mobskills.mobPhysicalMove(mob, target, skill, numhits, accmod, dmgmod, xi.mobskills.physicalTpBonus.DMG_VARIES, 1, 2, 3)
local dmg = xi.mobskills.mobFinalAdjustments(info.dmg, mob, skill, target, xi.attackType.PHYSICAL, xi.damageType.BLUNT, info.hitslanded)

xi.mobskills.mobPhysicalStatusEffectMove(mob, target, skill, xi.effect.ACCURACY_DOWN, 50, 0, 120)
local duration = math.random(120, 180)
xi.mobskills.mobPhysicalStatusEffectMove(mob, target, skill, xi.effect.ACCURACY_DOWN, 40, 0, duration)

target:takeDamage(dmg, mob, xi.attackType.PHYSICAL, xi.damageType.BLUNT)
return dmg
Expand Down
2 changes: 1 addition & 1 deletion scripts/actions/mobskills/howl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mobskillObject.onMobSkillCheck = function(target, mob, skill)
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
skill:setMsg(xi.mobskills.mobBuffMove(mob, xi.effect.WARCRY, 25, 0, 180))
skill:setMsg(xi.mobskills.mobBuffMove(mob, xi.effect.WARCRY, 15, 0, 180))

return xi.effect.WARCRY
end
Expand Down
11 changes: 8 additions & 3 deletions scripts/actions/mobskills/hurricane_wing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@ mobskillObject.onMobSkillCheck = function(target, mob, skill)
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local damage = mob:getWeaponDmg() * 5
local damage = mob:getWeaponDmg()

damage = xi.mobskills.mobMagicalMove(mob, target, skill, damage, xi.element.WIND, 1, xi.mobskills.magicalTpBonus.NO_EFFECT)
damage = xi.mobskills.mobMagicalMove(mob, target, skill, damage, xi.element.WIND, 4, xi.mobskills.magicalTpBonus.NO_EFFECT)
damage = xi.mobskills.mobFinalAdjustments(damage, mob, skill, target, xi.attackType.MAGICAL, xi.damageType.WIND, xi.mobskills.shadowBehavior.WIPE_SHADOWS)

target:takeDamage(damage, mob, xi.attackType.MAGICAL, xi.damageType.WIND)
xi.mobskills.mobStatusEffectMove(mob, target, xi.effect.BLINDNESS, 60, 0, 30)

if mob:getPool() == 2840 then -- Nidhogg
xi.mobskills.mobStatusEffectMove(mob, target, xi.effect.BLINDNESS, 160, 0, 30)
else
xi.mobskills.mobStatusEffectMove(mob, target, xi.effect.BLINDNESS, 100, 0, 30)
end

return damage
end
Expand Down
15 changes: 8 additions & 7 deletions scripts/actions/mobskills/shock_wave.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ mobskillObject.onMobSkillCheck = function(target, mob, skill)
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local numhits = 1
local accmod = 1
local dmgmod = 3.2
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, xi.mobskills.shadowBehavior.IGNORE_SHADOWS)
target:takeDamage(dmg, mob, xi.attackType.PHYSICAL, xi.damageType.BLUNT)
return dmg
local damage = mob:getWeaponDmg()

damage = xi.mobskills.mobMagicalMove(mob, target, skill, damage, xi.element.WIND, 0.6, xi.mobskills.magicalTpBonus.NO_EFFECT, 1)
damage = xi.mobskills.mobFinalAdjustments(damage, mob, skill, target, xi.attackType.MAGICAL, xi.damageType.WIND, xi.mobskills.shadowBehavior.WIPE_SHADOWS)

target:takeDamage(damage, mob, xi.attackType.MAGICAL, xi.damageType.WIND)

return damage
end

return mobskillObject
4 changes: 2 additions & 2 deletions scripts/actions/mobskills/spike_flail.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local numhits = 1
local accmod = 2
local dmgmod = math.random(5, 7)
local accmod = 1
local dmgmod = 4
local info = xi.mobskills.mobPhysicalMove(mob, target, skill, numhits, accmod, dmgmod, xi.mobskills.physicalTpBonus.DMG_VARIES, 2, 3, 4)
local dmg = xi.mobskills.mobFinalAdjustments(info.dmg, mob, skill, target, xi.attackType.PHYSICAL, xi.damageType.SLASHING, xi.mobskills.shadowBehavior.NUMSHADOWS_3)
target:takeDamage(dmg, mob, xi.attackType.PHYSICAL, xi.damageType.SLASHING)
Expand Down
7 changes: 4 additions & 3 deletions scripts/actions/mobskills/thunderbolt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ mobskillObject.onMobSkillCheck = function(target, mob, skill)
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local damage = mob:getWeaponDmg() * 2
local damage = mob:getWeaponDmg()
local duration = math.random(8, 14)

damage = xi.mobskills.mobMagicalMove(mob, target, skill, damage, xi.element.THUNDER, 1, xi.mobskills.magicalTpBonus.NO_EFFECT)
damage = xi.mobskills.mobMagicalMove(mob, target, skill, damage, xi.element.THUNDER, 0.6, xi.mobskills.magicalTpBonus.NO_EFFECT)
damage = xi.mobskills.mobFinalAdjustments(damage, mob, skill, target, xi.attackType.MAGICAL, xi.damageType.THUNDER, xi.mobskills.shadowBehavior.IGNORE_SHADOWS)

target:takeDamage(damage, mob, xi.attackType.MAGICAL, xi.damageType.THUNDER)
xi.mobskills.mobStatusEffectMove(mob, target, xi.effect.STUN, 1, 0, 4)
xi.mobskills.mobStatusEffectMove(mob, target, xi.effect.STUN, 1, 0, duration)

return damage
end
Expand Down
5 changes: 3 additions & 2 deletions scripts/actions/mobskills/tortoise_stomp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ end
mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local numhits = 1
local accmod = 1
local dmgmod = 2.8
local dmgmod = 1
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)

xi.mobskills.mobPhysicalStatusEffectMove(mob, target, skill, xi.effect.DEFENSE_DOWN, 30, 0, 180)
local duration = math.random(120, 180)
xi.mobskills.mobPhysicalStatusEffectMove(mob, target, skill, xi.effect.DEFENSE_DOWN, 25, 0, duration)

target:takeDamage(dmg, mob, xi.attackType.PHYSICAL, xi.damageType.BLUNT)
return dmg
Expand Down
2 changes: 1 addition & 1 deletion scripts/actions/mobskills/wild_horn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ end
mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local numhits = 3
local accmod = 1
local dmgmod = 1.3
local dmgmod = 1.5
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.SLASHING, info.hitslanded)
target:takeDamage(dmg, mob, xi.attackType.PHYSICAL, xi.damageType.SLASHING)
Expand Down
6 changes: 6 additions & 0 deletions scripts/actions/spells/black/meteor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ spellObject.onSpellCast = function(caster, target, spell)
local dmg = 0
if caster:isPC() then
dmg = ((100 + caster:getMod(xi.mod.MATT)) / (100 + target:getMod(xi.mod.MDEF))) * (caster:getStat(xi.mod.INT) + caster:getSkillLevel(xi.skill.ELEMENTAL_MAGIC) / 6) * 3.5
elseif -- Behemoth family
caster:isMob() and
(caster:getFamily() == 51 or
caster:getFamily() == 479)
then
dmg = 14 + caster:getMainLvl() * 30
else
dmg = ((100 + caster:getMod(xi.mod.MATT)) / (100 + target:getMod(xi.mod.MDEF))) * (caster:getStat(xi.mod.INT) + (caster:getMaxSkillLevel(caster:getMainLvl(), xi.job.BLM, xi.skill.ELEMENTAL_MAGIC)) / 6) * 9.4
end
Expand Down
14 changes: 6 additions & 8 deletions scripts/effects/super_buff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ local effectObject = {}

effectObject.onEffectGain = function(target, effect)
local power = effect:getPower()
target:addMod(xi.mod.ATTP, power)
target:addMod(xi.mod.DEFP, power)
target:addMod(xi.mod.MATT, power)
target:addMod(xi.mod.MEVA, power)
target:addMod(xi.mod.UDMGMAGIC, -500)
target:addMod(xi.mod.UDMGPHYS, -5000)
target:addMod(xi.mod.UDMGRANGE, -5000)
-- The following only applies to Nidhogg. If this buff is to be used anywhere else, a check on mob name (NOT ID) would be a good choice
target:setAnimationSub(2)
end
Expand All @@ -19,10 +18,9 @@ end

effectObject.onEffectLose = function(target, effect)
local power = effect:getPower()
target:delMod(xi.mod.ATTP, power)
target:delMod(xi.mod.DEFP, power)
target:delMod(xi.mod.MATT, power)
target:delMod(xi.mod.MEVA, power)
target:delMod(xi.mod.UDMGMAGIC, -500)
target:delMod(xi.mod.UDMGPHYS, -5000)
target:delMod(xi.mod.UDMGRANGE, -5000)
target:setAnimationSub(0)
end

Expand Down
3 changes: 3 additions & 0 deletions scripts/zones/Behemoths_Dominion/mobs/Behemoth.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ local entity = {}
entity.onMobSpawn = function(mob)
mob:setLocalVar('[rage]timer', 1800) -- 30 minutes
mob:setMobMod(xi.mobMod.NO_MOVE, 0)
mob:setMobMod(xi.mobMod.WEAPON_BONUS, 37) -- Level 70 + 38 = 108 Base Weapon Damage
mob:setMod(xi.mod.EVA, 301)
mob:setMod(xi.mod.ATT, 211)

-- Despawn the ???
GetNPCByID(ID.npc.BEHEMOTH_QM):setStatus(xi.status.DISAPPEAR)
Expand Down
22 changes: 20 additions & 2 deletions scripts/zones/Behemoths_Dominion/mobs/King_Behemoth.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ end
entity.onMobSpawn = function(mob)
mob:setLocalVar('[rage]timer', 3600) -- 60 minutes
mob:setMobMod(xi.mobMod.NO_MOVE, 0)
mob:setMobMod(xi.mobMod.WEAPON_BONUS, 58) -- Level 70 + 38 = 108 Base Weapon Damage
mob:setMod(xi.mod.MDEF, 20)
mob:setMod(xi.mod.ATT, 462)
mob:setMod(xi.mod.DEF, 500)
mob:setMod(xi.mod.EVA, 370)
mob:setMod(xi.mod.TRIPLE_ATTACK, 5)
mob:addImmunity(xi.immunity.LIGHT_SLEEP)
mob:addImmunity(xi.immunity.DARK_SLEEP)
mob:addImmunity(xi.immunity.STUN)

-- Despawn the ???
GetNPCByID(ID.npc.BEHEMOTH_QM):setStatus(xi.status.DISAPPEAR)
Expand Down Expand Up @@ -45,10 +54,19 @@ entity.onMobFight = function(mob, target)
mob:setMobMod(xi.mobMod.NO_MOVE, 0)
end
end

local delay = mob:getLocalVar("delay")
if
os.time() > delay and
mob:canUseAbilities()
then -- Use Meteor every 40s, based on capture
mob:castSpell(218, target) -- meteor
mob:setLocalVar("delay", os.time() + 40)
end
end

entity.onAdditionalEffect = function(mob, target, damage)
return xi.mob.onAddEffect(mob, target, damage, xi.mob.ae.STUN, { chance = 20, duration = math.random(5, 10) })
return xi.mob.onAddEffect(mob, target, damage, xi.mob.ae.STUN, { chance = 20, duration = math.random(4, 8) })
end

entity.onSpellPrecast = function(mob, spell)
Expand All @@ -57,7 +75,7 @@ entity.onSpellPrecast = function(mob, spell)
spell:setFlag(xi.magic.spellFlag.HIT_ALL)
spell:setRadius(30)
spell:setAnimation(280)
spell:setMPCost(1)
spell:setMPCost(0)
end
end

Expand Down
15 changes: 15 additions & 0 deletions scripts/zones/Dragons_Aery/mobs/Darter.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-----------------------------------
-- Area: Dragons Aery
-- HNM: Fafnir
-----------------------------------
local ID = zones[xi.zone.DRAGONS_AERY]
mixins = { require('scripts/mixins/rage') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobInitialize = function(mob)
mob:setMobMod(xi.mobMod.ALLI_HATE, 30) -- 30 yalm distance
end

return entity
3 changes: 2 additions & 1 deletion scripts/zones/Dragons_Aery/mobs/Fafnir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ local entity = {}

entity.onMobSpawn = function(mob)
mob:setLocalVar('[rage]timer', 3600) -- 60 minutes
mob:setMobMod(xi.mobMod.WEAPON_BONUS, 50) -- Level 90 + 50 = 140 Base Weapon Damage
mob:setMobMod(xi.mobMod.WEAPON_BONUS, 48) -- Level 90 + 50 = 140 Base Weapon Damage
mob:setMod(xi.mod.ATT, 435)

-- Despawn the ???
GetNPCByID(ID.npc.FAFNIR_QM):setStatus(xi.status.DISAPPEAR)
Expand Down
5 changes: 4 additions & 1 deletion scripts/zones/Dragons_Aery/mobs/Nidhogg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ local entity = {}

entity.onMobSpawn = function(mob)
mob:setLocalVar('[rage]timer', 3600) -- 60 minutes
mob:setMobMod(xi.mobMod.WEAPON_BONUS, 50) -- Level 90 + 50 = 140 Base Weapon Damage
mob:setMobMod(xi.mobMod.WEAPON_BONUS, 48) -- Level 90 + 50 = 140 Base Weapon Damage
mob:setMobMod(xi.mobMod.NO_MOVE, 0)
mob:setMod(xi.mod.ATT, 445)
mob:setMod(xi.mod.ACC, 444)
mob:setMod(xi.mod.EVA, 327)

-- Despawn the ???
GetNPCByID(ID.npc.FAFNIR_QM):setStatus(xi.status.DISAPPEAR)
Expand Down
12 changes: 11 additions & 1 deletion scripts/zones/Valley_of_Sorrows/mobs/Adamantoise.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@
-- HNM: Adamantoise
-----------------------------------
local ID = zones[xi.zone.VALLEY_OF_SORROWS]
mixins = { require('scripts/mixins/rage') }
mixins =
{
require('scripts/mixins/rage'),
require('scripts/mixins/draw_in'),
}
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobSpawn = function(mob)
mob:setLocalVar('[rage]timer', 1800) -- 30 minutes
mob:addImmunity(xi.immunity.LIGHT_SLEEP)
mob:addImmunity(xi.immunity.DARK_SLEEP)
mob:setMod(xi.mod.DMGMAGIC, -3500)
mob:setMobMod(xi.mobMod.WEAPON_BONUS, 36) -- Level 70 + 38 = 108 Base Weapon Damage
mob:setMod(xi.mod.DEF, 4112)
mob:setMod(xi.mod.ATT, 450)

-- Despawn the ???
GetNPCByID(ID.npc.ADAMANTOISE_QM):setStatus(xi.status.DISAPPEAR)
Expand Down
Loading

0 comments on commit 724f7aa

Please sign in to comment.