9
3

ShadowBlade.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. --[[
  2. Script Name : Spells/Scout/Predator/ShadowBlade.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2023.03.27 04:03:47
  5. Script Purpose :
  6. :
  7. --]]
  8. --[[ Info from spell_display_effects (remove from script when done)
  9. *Inflicts 82 - 137 melee damage on target
  10. *You must be sneaking to use this ability.
  11. *Must be flanking or behind
  12. --]]
  13. function precast(Caster, Target)
  14. -- You must be sneaking to use this ability.
  15. if not IsStealthed(Caster) then
  16. SendMessage(Caster, "You must be sneaking to use this ability.", "yellow")
  17. return false
  18. end
  19. if not IsFlanking(Caster, Target) then
  20. SendMessage(Caster, "Must be flanking or behind", "yellow")
  21. return false
  22. end
  23. return true
  24. end
  25. function cast(Caster, Target, DmgType, MinVal, MaxVal)
  26. Level = GetLevel(Caster)
  27. SpellLevel = 10
  28. Mastery = SpellLevel + 10
  29. StatBonus = GetStr(Caster) / 10
  30. if Level < Mastery then
  31. LvlBonus = Level - SpellLevel
  32. else LvlBonus = Mastery - SpellLevel
  33. end
  34. DmgBonus = LvlBonus + StatBonus
  35. MaxDmg = math.floor(DmgBonus) * 2 + MaxVal
  36. MinDmg = math.floor(DmgBonus) * 2 + MaxVal
  37. SpellDamage(Target, DmgType, MinDmg, MaxDmg)
  38. end