Nettleshield.lua 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. --[[
  2. Script Name : Spells/Priest/Druid/Nettleshield.lua
  3. Script Author : neatz09
  4. Script Date : 2020.11.05 02:11:35
  5. Script Purpose :
  6. :
  7. --]]
  8. -- When damaged with a melee weapon this spell will cast Nettleshield Thorns on target's attacker.
  9. -- Inflicts 3 piercing damage on target
  10. function cast(Caster, Target, DmgType, MinVal)
  11. AddProc(Target, 4, 100)
  12. end
  13. function proc(Caster, Target, Type, DmgType, MinVal)
  14. Level = GetLevel(Caster)
  15. SpellLevel = 10
  16. Mastery = SpellLevel + 10
  17. StatBonus = GetInt(Caster) / 10
  18. if Level < Mastery then
  19. LvlBonus = Level - SpellLevel
  20. else LvlBonus = Mastery - SpellLevel
  21. end
  22. DmgBonus = LvlBonus + StatBonus
  23. MinDmg = MinVal + math.floor(DmgBonus)
  24. if Type == 4 then
  25. Spell = GetSpell(5503,1)
  26. SetSpellDataIndex(Spell, 0, DmgType)
  27. SetSpellDataIndex(Spell, 1, MinDmg)
  28. CastCustomSpell(Spell, Caster, Target)
  29. end
  30. end
  31. function remove(Caster, Target)
  32. RemoveProc(Target)
  33. end