Writhe.lua 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. --[[
  2. Script Name : dot_debuff.lua
  3. Script Purpose : Generic damage + 1 effect script
  4. Script Author : John Adams
  5. Script Date : 2008.12.04
  6. --]]
  7. function cast(Caster, Target, DOTType, MinDOTVal, MaxDOTVal, DebuffType, MinDebuffVal, MaxDebuffVal)
  8. -- Debuff component
  9. -- Determine if there is a range to effect values
  10. if MaxDebuffVal ~= nil and MinDebuffVal < MaxDebuffVal then
  11. -- JA: for debuff randoms (if any), need to to math.random with precision - I think this function rounds up?
  12. DebuffValue = math.random(MinDebuffVal, MaxDebuffVal)
  13. else
  14. DebuffValue = MinDebuffVal
  15. end
  16. -- Determine DebuffType - either a DamageType or a String value passed as param 4
  17. if DebuffType == "Defense" then
  18. -- Need functionality to buff/debuff
  19. -- ModifyDefense(Target, -DebuffValue)
  20. end
  21. if DebuffType == "Elemental" then
  22. -- Need functionality to buff/debuff
  23. -- ModifyHeat(Target, -DebuffValue)
  24. -- ModifyCole(Target, -DebuffValue)
  25. end
  26. -- DOT component (instant damage)
  27. if MaxDOTVal ~= nil and MinDOTVal < MaxDOTVal then
  28. SpellDamage(Target, DOTType, math.random(MinDOTVal, MaxDOTVal))
  29. else
  30. SpellDamage(Target, DOTType, MinDOTVal)
  31. end
  32. end
  33. function tick(Caster, Target, DOTType, MinDOTVal, MaxDOTVal, DebuffType, MinDebuffVal, MaxDebuffVal)
  34. if MaxDOTVal ~= nil and MinDOTVal < MaxDOTVal then
  35. SpellDamage(Target, DOTType, math.random(MinDOTVal, MaxDOTVal))
  36. else
  37. SpellDamage(Target, DOTType, MinDOTVal)
  38. end
  39. end
  40. function remove(Caster, Target, DOTType, MinDOTVal, MaxDOTVal, DebuffType, MinDebuffVal, MaxDebuffVal)
  41. if DebuffType == "Defense" then
  42. -- Need functionality to restore original mitigations
  43. -- ModifyDefense(Target, Original)
  44. end
  45. if DebuffType == "Elemental" then
  46. -- Need functionality to restore original mitigations
  47. -- ModifyHeat(Target, Original)
  48. -- ModifyCold(Target, Original)
  49. end
  50. end