SiphonStrike.lua 1.0 KB

12345678910111213141516171819202122232425262728
  1. --[[
  2. Script Name : Spells/Fighter/Crusader/Shadowknight/SiphonStrike.lua
  3. Script Author : neatz09
  4. Script Date : 2019.10.11 07:10:15
  5. Script Purpose :
  6. :
  7. --]]
  8. function cast(Caster, Target, DmgType, MinVal, MaxVal, pctHealMin, pctHealMax, DmgType2, Minval2, MaxVal2)
  9. -- Inflicts 46 - 77 disease damage on target
  10. local Val1 = pctHealMin
  11. local Val2 = pctHealMax
  12. local HealAmt = randomFloat(Val1, Val2)
  13. SpellDamage(Target, DmgType, MinVal, MaxVal)
  14. if LastSpellAttackHit() then
  15. -- Applies Life Draw on termination.
  16. -- Heals caster for 1.0 - 1.2% of max health
  17. -- This effect cannot be critically applied.
  18. -- The healing of this spell cannot be modified except by direct means
  19. SpellHealPct("Heal", HealAmt, false, true, Caster, 1, true, "Life Draw")
  20. -- Inflicts 13 - 22 disease damage on target
  21. SpellDamage(Target, DmgType2, MinVal2, MaxVal2)
  22. end
  23. end
  24. function randomFloat(Val1, Val2)
  25. return Val1 + math.random() * (Val2 - Val1);
  26. end