Advertisement
cnl_cnl_cnl

Untitled

Jun 9th, 2022
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. function isSpellUp(sources,minCount,minDuration,minPoints,modify)
  2. if type(sources) == "string" then sources = { sources } end -- if sources is a string make it a table...
  3. if cnl_util.checkMSDP(report) then
  4.  
  5. local spell_up = false
  6. for k, v in pairs(msdp.CHARACTER_AFFECTS) do
  7. for _k, _v in pairs(sources) do
  8. if (v.SOURCE or "") == _v then
  9. if
  10. (minCount and v.COUNT and minCount <= tonumber(v.COUNT)) or
  11. (minDuration and v.DURATION and minDuration <= tonumber(v.DURATION)) or
  12. (minPoints and v.POINTS and minPoints <= tonumber(v.POINTS)) or
  13. (modify and v.MODIFY and modify == v.MODIFY) or
  14. not (minCount or minDuration or minPoints or modify)
  15. then
  16. spell_up = true
  17. end
  18. end
  19. end
  20. end
  21. return spell_up
  22. else
  23. error("isSpellUp cannot read msdp.CHARACTER_AFFECTS")
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement