"You now also use your x in place of x when equipping weapons and ammo as well as when calculating weapon damage."

I can't seem to wrap my head around the way lua for skills that replace weapon stat calc and equip requirements with another stat work.
For example if ↓

newTalent{
	name = "Strength of Purpose",
	type = {"chronomancy/guardian", 1},
	points = 5,
	require = { stat = { mag=function(level) return 12 + level * 6 end }, },
	mode = "passive",
	getDamage = function(self, t) return self:getTalentLevel(t) * 10 end,
	getPercentInc = function(self, t) return math.sqrt(self:getTalentLevel(t) / 5) / 2 end,
	info = function(self, t)
		local damage = t.getDamage(self, t)
		local inc = t.getPercentInc(self, t)
		return ([[Increases Physical Power by %d, and increases weapon damage by %d%% when using swords, axes, maces, knives, or bows.
		You now also use your Magic in place of Strength when equipping weapons and ammo as well as when calculating weapon damage.
		These bonuses override rather than stack with weapon mastery, dagger mastery, and bow mastery.]]):
		format(damage, 100*inc)
	end,
}

Is changed to something like ↓ and given to a custom class the skill will have no effect.

newTalent{
	name = "Magic Enhanced Strength",
	type = {"spell/Body enhancements", 1},
	points = 5,
	require = { stat = { mag=function(level) return 12 + level * 6 end }, },
	mode = "passive",
	getDamage = function(self, t) return self:getTalentLevel(t) * 10 end,
	getPercentInc = function(self, t) return math.sqrt(self:getTalentLevel(t) / 5) / 2 end,
	info = function(self, t)
		local damage = t.getDamage(self, t)
		local inc = t.getPercentInc(self, t)
		return ([[Increases Physical Power by %d, and increases weapon damage by %d%% when using swords, axes, maces, knives, or bows.
		You now also use your Magic in place of Strength when equipping weapons and ammo as well as when calculating weapon damage.
		These bonuses override rather than stack with weapon mastery, dagger mastery, and bow mastery.]]):
		format(damage, 100*inc)
	end,
}

I have no idea what I'm missing, is there another lua file that somehow is loaded by the skill or am I completely misreading the lua?

Probably happens elsewhere

Doesn't look like the damage calculation changes are happening in the talent definition. [sound F/X: source diving] Ah, yes, that apparently happens in Combat:getDammod() in mod/class/interface/Combat.lua. For your purposes, it looks like you'll want to hook into the "Combat:getDammod:subs" hook to apply your changes.

Thanks

Thank you. Btw how did you go about finding the relevant class?

:knowTalent(T_STRENGTH_OF_PURPOSE)

I searched the code for Strength of Purpose's talent ID T_STRENGTH_OF_PURPOSE. Basically, I figured that if the modification wasn't happening in the talent definition, then something somewhere in the code must be calling :knowTalent('T_STRENGTH_OF_PURPOSE') or similar and using that to decide whether to do the modification.

Thought that might have been

Thought that might have been the case, thanks.

Opps

Didn't mean to post this comment