Skip to content

Commit 64a8f3d

Browse files
authored
Merge pull request LandSandBoat#10393 from UmeboshiXI/Mob_BaseDamage_Refactor
[core][lua] Mob Weapon Damage Refactor
2 parents 0899465 + 721e3d1 commit 64a8f3d

51 files changed

Lines changed: 210 additions & 139 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

scripts/enum/mob_mod.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ xi.mobMod =
6767
HP_STANDBACK = 56, -- mob will always standback with hp % higher to value
6868
MAGIC_DELAY = 57, -- Amount of seconds mob waits before casting first spell
6969
SPECIAL_DELAY = 58, -- Amount of seconds mob waits before using first special
70-
WEAPON_BONUS = 59, -- Add a flat modifer mob weapon damage ( damage + bonus )
70+
BASE_DAMAGE_MODIFIER = 59, -- Add a flat modifer mob a mob's base damage. This is subject to multiplication by MOBMOD_BASE_DAMAGE_MULTIPLIER.
7171
SPAWN_ANIMATIONSUB = 60, -- reset animationsub to this on spawn
7272
HP_SCALE = 61, -- Scale the mobs max HP. ( hp_scale / 100 ) * maxhp
7373
NO_STANDBACK = 62, -- Mob will never standback
@@ -94,7 +94,7 @@ xi.mobMod =
9494
CLAIM_TYPE = 83, -- Changes the claim behavior of the mob. See xi.claimType enum.
9595
NO_SPELL_COST = 84, -- Mob does not use MP when casting spells
9696
ASTRAL_PET_OFFSET = 85, -- If non-zero, defines the offset from main mob's ID for astral flow (if zero, will assume offset of 2)
97-
BASE_DAMAGE_MULTIPLIER = 86, -- Multiplies the mob's base damage. Example: 150 = x1.5
97+
BASE_DAMAGE_MULTIPLIER = 86, -- Multiplies the mob's base damage. Example: 150 = x1.5. MOBMOD_DAMAGE_OFFSET/MOBMOD_RANGED_DAMAGE_OFFSET are not subject to multiplication.
9898
DAMAGE_OFFSET = 87, -- Adds or subtracts the mob's base damage offset.
9999
RANGED_DAMAGE_OFFSET = 88, -- Adds or subtracts the mob's ranged base damage offset.
100100
AVATAR_PETID = 89, -- A value from xi.petId to select model/ability from when owner uses astral flow

scripts/mixins/families/euvhi.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ end
2424

2525
local function openMouth(mob)
2626
local damage = 1 + mob:getMainLvl() / 2
27-
mob:setMobMod(xi.mobMod.WEAPON_BONUS, damage)
27+
mob:setMobMod(xi.mobMod.BASE_DAMAGE_MODIFIER, damage)
2828
mob:setAnimationSub(2) -- TODO: the db.. mobs start with animsub 4 or 6? shouldn't even be possible
2929
mob:wait(2000)
3030
end
3131

3232
local function closeMouth(mob)
33-
mob:setMobMod(xi.mobMod.WEAPON_BONUS, 0)
33+
mob:setMobMod(xi.mobMod.BASE_DAMAGE_MODIFIER, 0)
3434
mob:setLocalVar('[euvhi]changeTime', GetSystemTime() + 80)
3535
mob:setLocalVar('closeMouth', 0)
3636
mob:setAnimationSub(1) -- TODO: db shows animsub 5?

scripts/mixins/families/ghrah.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ local function switchMobForm(mob, form, aggressive)
163163
local originalEva = mob:getLocalVar('originalEVA')
164164

165165
-- Reset to base stats first
166-
mob:setMobMod(xi.mobMod.WEAPON_BONUS, 0)
166+
mob:setMobMod(xi.mobMod.BASE_DAMAGE_MODIFIER, 0)
167167
mob:setMod(xi.mod.ATT, originalAtt)
168168
mob:setMod(xi.mod.DEF, originalDef)
169169
mob:setMod(xi.mod.EVA, originalEva)
@@ -177,7 +177,7 @@ local function switchMobForm(mob, form, aggressive)
177177
elseif form == 2 then
178178
-- Spider form
179179
-- ATT and DEF traits equivalent to 75 WAR
180-
mob:setMobMod(xi.mobMod.WEAPON_BONUS, mob:getMainLvl() + 2)
180+
mob:setMobMod(xi.mobMod.BASE_DAMAGE_MODIFIER, mob:getMainLvl() + 2)
181181
mob:setMod(xi.mod.ATT, originalAtt + 11)
182182
mob:setMod(xi.mod.DEF, originalDef + 11)
183183
elseif form == 3 then

scripts/mixins/families/hpemde.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ end
3232

3333
-- Hpemde take 100% increased damage and deal 2x base damage in open mouth form
3434
local function openMouth(mob)
35-
mob:setMobMod(xi.mobMod.WEAPON_BONUS, mob:getMainLvl() + 2)
35+
mob:setMobMod(xi.mobMod.BASE_DAMAGE_MODIFIER, mob:getMainLvl() + 2)
3636
mob:setMod(xi.mod.DMG, 10000)
3737
mob:setAnimationSub(3)
3838
mob:wait(2000)
3939
end
4040

4141
local function closeMouth(mob)
42-
mob:setMobMod(xi.mobMod.WEAPON_BONUS, 0)
42+
mob:setMobMod(xi.mobMod.BASE_DAMAGE_MODIFIER, 0)
4343
mob:setMod(xi.mod.DMG, 0)
4444
mob:setLocalVar('[hpemde]changeTime', mob:getBattleTime() + 30)
4545
mob:setAnimationSub(6)

scripts/specs/core/CBaseEntity.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3875,8 +3875,9 @@ function CBaseEntity:setDelay(delay)
38753875
end
38763876

38773877
---@param damage integer
3878+
---@param slot xi.slot
38783879
---@return nil
3879-
function CBaseEntity:setDamage(damage)
3880+
function CBaseEntity:setDamage(damage, slot)
38803881
end
38813882

38823883
---@nodiscard

scripts/zones/AlTaieu/mobs/Jailer_of_Hope.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ entity.onMobInitialize = function(mob)
2525
end
2626

2727
entity.onMobSpawn = function(mob)
28-
mob:setMobMod(xi.mobMod.WEAPON_BONUS, 78) -- 175 total weapon damage
28+
mob:setMobMod(xi.mobMod.BASE_DAMAGE_MODIFIER, 78) -- 175 total weapon damage
2929
mob:addMod(xi.mod.EVA, 30)
3030
mob:addMod(xi.mod.DEFP, 50)
3131
mob:addMod(xi.mod.ATTP, 50)

scripts/zones/AlTaieu/mobs/Jailer_of_Prudence.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ entity.onMobSpawn = function(mob)
4646
mob:setMod(xi.mod.TRIPLE_ATTACK, 20)
4747
mob:addMod(xi.mod.DEFP, 33)
4848
mob:addMod(xi.mod.MOVE_SPEED_STACKABLE, 20)
49-
mob:addMobMod(xi.mobMod.WEAPON_BONUS, 72) -- 180 total weapon damage
49+
mob:addMobMod(xi.mobMod.BASE_DAMAGE_MODIFIER, 72) -- 180 total weapon damage
5050
end
5151

5252
local teleportToTarget = function(mob, target, currentTargetId)

scripts/zones/AlTaieu/mobs/Omyovra.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ end
1212

1313
entity.onMobSpawn = function(mob)
1414
mob:setMod(xi.mod.REGEN, 50)
15-
mob:setMobMod(xi.mobMod.WEAPON_BONUS, mob:getMainLvl() - 2) -- Base damage is level * 2
15+
mob:setMobMod(xi.mobMod.BASE_DAMAGE_MODIFIER, mob:getMainLvl() - 2) -- Base damage is level * 2
1616
mob:setMod(xi.mod.AGI, 76 - mob:getStat(xi.mod.AGI)) -- Jimmy indicates AGI for Omyovra should be 76 or so
1717
-- Yovra have a +50% bonus to defense
1818
mob:addMod(xi.mod.DEF, mob:getStat(xi.mod.DEF) * 0.5)

scripts/zones/AlTaieu/mobs/Qnhpemde.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ entity.onMobFight = function(mob, target)
2222
if mob:getAnimationSub() == 6 and mob:getBattleTime() - changeTime > 30 then
2323
mob:setAnimationSub(3) -- Mouth Open
2424
-- Double the mob weapon damage
25-
mob:setMobMod(xi.mobMod.WEAPON_BONUS, mob:getMainLvl())
25+
mob:setMobMod(xi.mobMod.BASE_DAMAGE_MODIFIER, mob:getMainLvl())
2626
-- Boost all damage taken by 50%
2727
mob:setMod(xi.mod.UDMGPHYS, 5000)
2828
mob:setMod(xi.mod.UDMGRANGE, 5000)
@@ -32,7 +32,7 @@ entity.onMobFight = function(mob, target)
3232

3333
elseif mob:getAnimationSub() == 3 and mob:getBattleTime() - changeTime > 30 then
3434
mob:setAnimationSub(6) -- Mouth Closed
35-
mob:setMobMod(xi.mobMod.WEAPON_BONUS, 0)
35+
mob:setMobMod(xi.mobMod.BASE_DAMAGE_MODIFIER, 0)
3636
mob:setMod(xi.mod.UDMGPHYS, 0)
3737
mob:setMod(xi.mod.UDMGRANGE, 0)
3838
mob:setMod(xi.mod.UDMGMAGIC, 0)

scripts/zones/AlTaieu/mobs/Ulyovra.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ end
1212

1313
entity.onMobSpawn = function(mob)
1414
mob:setMod(xi.mod.REGEN, 50)
15-
mob:setMobMod(xi.mobMod.WEAPON_BONUS, mob:getMainLvl() - 2) -- Base damage is level * 2
15+
mob:setMobMod(xi.mobMod.BASE_DAMAGE_MODIFIER, mob:getMainLvl() - 2) -- Base damage is level * 2
1616
-- Yovra have a +50% bonus to defense.
1717
mob:addMod(xi.mod.DEF, mob:getStat(xi.mod.DEF) * 0.5)
1818
mob:hideName(true)

0 commit comments

Comments
 (0)