Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lancer 4's double attack interaction with PerformAttack #93

Open
gelguy opened this issue Nov 13, 2016 · 1 comment
Open

Lancer 4's double attack interaction with PerformAttack #93

gelguy opened this issue Nov 13, 2016 · 1 comment

Comments

@gelguy
Copy link
Collaborator

gelguy commented Nov 13, 2016

When Lancer 4 uses Double Spearmanship, it is possible to get up to 3 attacks. For Rampant Warrior, since the proc chance is 100%, it will always perform 3 attacks.

This might due to the timer for proc cooldown only setting the flag after the timer is created. If PerformAttack is triggered within 0.033 seconds (combat log only shows 0.03, no further decimal places), it will avoid the cooldown flag.
So assuming PerformAttack has a 0.03 second delay:

  • 0.00x First attack (Attack1), procs PerformAttack (Attack2), timer created for 0.033 seconds
  • 0.03x Attack2 procs PerformAttack (Attack3) as cooldown flag has not been set
  • 0.033 Timer activates, sets cooldown flag
  • 0.06x Attack3 occurs, but does not proc further due to cooldown flag

Timers only guarantee to proc after the trigger time, so it might be entirely possible that the attack occurs before the timer during the server tick.

if not caster.bIsDoubleAttackOnCD then
Timers:CreateTimer(0.033, function()
caster:PerformAttack(target, true, true, true, true, false)
caster.bIsDoubleAttackOnCD = true
Timers:CreateTimer(0.066, function()
caster.bIsDoubleAttackOnCD = false
end)
end)
end

	if not caster.bIsDoubleAttackOnCD then
		Timers:CreateTimer(0.033, function()
			caster:PerformAttack(target, true, true, true, true, false)
			caster.bIsDoubleAttackOnCD = true
			Timers:CreateTimer(0.066, function()
				caster.bIsDoubleAttackOnCD = false
			end)
		end)
	end

Fix should just be to move the setting of flag out of the timer.

In addition, since Rampant Warrior critical is applied OnAttackStart and removed OnAttackLanded, only the first attack will trigger the critical. The second (and the bugged third) attack will not.

Not entirely clear of this interaction as the OnDSLanded is proc-ing but not the critical trigger.

@gelguy gelguy changed the title Lancer 4's attack interaction with DSLanded Lancer 4's double attack interaction with PerformAttack Nov 13, 2016
@sngweicong
Copy link
Collaborator

easy solution appears to be merely shifting
caster.bIsDoubleAttackOnCD = true
above
Timers:CreateTimer(0.033, function()

second timer to be changed to either 0.033 or left as 0.066, depending on whether he intended cooldown to be .066 or 1, which i'm not sure of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants