Say, m_KIII, how did you add the Skill Damage Multiplier? I'd like to use that for an item in a new balance mod, but either I'm making some simple stupid mistake or I've missed something that you did to make it work. So far I've found this in your Hercules mod:
In ForgeUnit.lua in function OnCreate you added: self.SkillDamageMult = 1
GetSkillDamageMult = function(self)
And in BuffAffects.lua you only added:
function SkillDamageMult( unit, buffName )
local val = BuffCalculate(unit, buffName, 'SkillDamageMult', 1)
unit.SkillDamageMult = val
EDIT: I had forgotten you also modifed all Ability-files. Turns out the skill damage was the purpose. I'll just take TB's Fireball as example to see if I actually understand correctly what happens.
local tempFireball = Fireball
function Fireball(abilityDef, unit, params)
local abilityDefCopy = table.copy(abilityDef)
abilityDefCopy.DamageAmt = abilityDefCopy.DamageAmt * unit.SkillDamageMult
return tempFireball(abilityDefCopy, unit, params)
So... The Fireball-function that was originally in the HEMA01_Abilites.lua gets assigned into tempFireball. The actual Fireball function that's called while using the skill in-game is overwritten with the new Fireball-function we have here. You create a copy of the ability definitions, and then modify the amount of Damage with SkillDamageMult, all within that copy. And lastly you pass that copy to the original function (now tempFireball), since the new Fireball function wouldn't do much otherwise. Correct?
Do you think there's any way to implement the Damage Multiplier at a more basic level, without having to modify every single ability? But then I guess you'd have to modify all the basic functions like DealDamage(data,target) or PassDamageData(unit,damageTable). I don't even know where those are defined.
I'm also wondering if it's possible to access single functions within the ForgeUnit class without just overwriting the whole class.
EDIT: By the way, just checked the log. It complains "WARNING: 00:00:49: *AI DEBUG: No priority set for item [...]" for DragonMageGloves, DeadEyeSniperGloves, GreatMageArmor, LethalSpikedArmor, ArchitectArmor, ChaosMageBoots. And it warns about all the duplicate abilities and buffs that it detects. I don't know if it's advisable to delete the copy of the abilityTables after calculating the SkillDamageMult.