Modifying the offhand multiplier in combat.lua

A place to post your add ons and ideas for them

Moderator: Moderator

Post Reply
Message
Author
Osmodius
Low Yeek
Posts: 9
Joined: Tue Jan 12, 2016 11:15 am

Modifying the offhand multiplier in combat.lua

#1 Post by Osmodius »

I want to make my new class dual wield one handed weapons (which is easy enough).

However getOffHandMultiplier looks specifically at reaving combat/dual wield mastery/dual weapon training to find the offhand multiplier.

I do not know how to make my own changes to the combat.lua (that's a bit more complicated than the rest, it seems), could someone explain roughly (or exactly) what I'd have to do to add in another if statement that looks to my new talent, or a different way to end up in the same situation?

All it should need is

Code: Select all

if self:knowTalent(Talents.T_NORSE_MIGHT) then
		offmult = math.max(offmult,self:callTalent(Talents.T_NORSE_Might,"getoffmult"))
	end
chucked in there but that's beyond me.

Cheers in advance.

Razakai
Uruivellas
Posts: 889
Joined: Tue May 14, 2013 3:45 pm

Re: Modifying the offhand multiplier in combat.lua

#2 Post by Razakai »

Take a look at my Assassin mod. iirc I changed Lethality to give an offhand mult bonus there so you should be able to copy that.

Basically for this one you need to use superload to modify the function. There's quite a few mods that have examples of using combat.lua superload. In general you'll need to use that for modifying things like actor, combat etc.

Osmodius
Low Yeek
Posts: 9
Joined: Tue Jan 12, 2016 11:15 am

Re: Modifying the offhand multiplier in combat.lua

#3 Post by Osmodius »

Razakai wrote:Take a look at my Assassin mod. iirc I changed Lethality to give an offhand mult bonus there so you should be able to copy that.

Basically for this one you need to use superload to modify the function. There's quite a few mods that have examples of using combat.lua superload. In general you'll need to use that for modifying things like actor, combat etc.
Well, it works! I have no idea how, but I'll take it.

Razakai
Uruivellas
Posts: 889
Joined: Tue May 14, 2013 3:45 pm

Re: Modifying the offhand multiplier in combat.lua

#4 Post by Razakai »

Superload is basically a bit of a less hacky Overload. Rather than modifying the entire file, it just looks for the particular function and adds stuff into that. There's a bit of advanced functionality there and best practices for making it compatible with other addons, but what I did in Assassin should be good enough for now.

Post Reply