Distinguishing between a mainhand and shield attack

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
Razakai
Uruivellas
Posts: 889
Joined: Tue May 14, 2013 3:45 pm

Distinguishing between a mainhand and shield attack

#1 Post 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,

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Distinguishing between a mainhand and shield attack

#2 Post by darkgod »

You cuold check if it's a shield like that:

Code: Select all

if weapon.talented == "shield" then
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

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

Re: Distinguishing between a mainhand and shield attack

#3 Post by Razakai »

Perfect, thanks!

Post Reply