SingingBlade.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --[[
  2. Script Name : dd_heal.lua
  3. Script Purpose : Generic damage + Heal effect script
  4. Script Author : John Adams
  5. Script Date : 2008.12.02
  6. --]]
  7. function cast(Caster, Target, DDType, MinDDVal, MaxDDVal, EffectType, MinEffectVal, MaxEffectVal)
  8. -- DD component
  9. if MaxDDVal ~= nil and MinDDVal < MaxDDVal then
  10. SpellDamage(Target, DDType, math.random(MinDDVal, MaxDDVal))
  11. else
  12. SpellDamage(Target, DDType, MinDDVal)
  13. end
  14. -- Effect component - only process this code if there is an EffectType param
  15. if EffectType ~= nil then
  16. -- Determine if there is a range to effect values
  17. if MaxEffectVal ~= nil and MinEffectVal < MaxEffectVal then
  18. EffectValue = math.random(MinEffectVal, MaxEffectVal)
  19. else
  20. EffectValue = MinEffectVal
  21. end
  22. -- Determine EffectType - either a DamageType or a String value passed as param 4
  23. if EffectType == "Heal" then
  24. ModifyHP(Caster, EffectValue)
  25. else
  26. -- something else
  27. end
  28. end
  29. end
  30. function tick(Caster, Target, DDType, MinDDVal, MaxDDVal, EffectType, MinEffectVal, MaxEffectVal)
  31. if MaxEffectVal ~= nil and MinEffectVal < MaxEffectVal then
  32. EffectValue = math.random(MinEffectVal, MaxEffectVal)
  33. else
  34. EffectValue = MinEffectVal
  35. end
  36. if EffectType == "heal" then
  37. ModifyHP(Caster, EffectValue)
  38. else
  39. -- something else
  40. end
  41. end
  42. function remove(Caster, Target)
  43. end