Page 1 of 1

Distinguishing between a mainhand and shield attack

Posted: Sun Mar 08, 2015 9:07 pm
by Razakai
I'm making a talent that causes mainhand attacks to follow with a shield slam, and shield attacks to follow with a mainhand swing, but for this I need to get callbackOnMeleeAttack to distinguish between them. Is this possible? I tried the following code with no success:

Code: Select all

	callbackOnMeleeAttack = function(self, t, target, hitted, crit, weapon, damtype, mult, dam)
		local shield = self:hasShield()
		if hitted and not target.dead and shield and not self.turn_procs.sword_and_board and shield.special_combat then
			self.turn_procs.sword_and_board = true
			self:attackTarget(target, nil, t.getDamage(self, t), true)
		elseif hitted and not target.dead and not self.turn_procs.sword_and_board then
			self.turn_procs.sword_and_board = true
			self:attackTargetWith(target, shield.special_combat, nil, t.getDamage(self, t))
		end
	end,

Re: Distinguishing between a mainhand and shield attack

Posted: Sun Mar 08, 2015 10:32 pm
by darkgod
You cuold check if it's a shield like that:

Code: Select all

if weapon.talented == "shield" then

Re: Distinguishing between a mainhand and shield attack

Posted: Mon Mar 09, 2015 6:23 pm
by Razakai
Perfect, thanks!