Advertisement
Terrah

RF Calc

Jan 27th, 2016
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. local function RFBurn(life,ES,fireRes,dmgTaken) local burnDegen = (life*0.9+ ES*0.7) * (1 - fireRes) * (1 + dmgTaken); return tostring((burnDegen / life)*100).."% with ZO: "..tostring((burnDegen / ES)*100).."%("..tostring(burnDegen).."/sec)"; end
  2.  
  3. local function Func(msg,usr,chan)
  4.  
  5. if msg==nil or msg=="" then print("@"..usr.." Useage: !rfcalc life es fireres damagetaken. Example: !rfcalc 4000 100 0.75 0.05"); return; end
  6.  
  7. local parameters = {};
  8. for number in string.gmatch(msg,"%S+") do
  9. table.insert(parameters,number);
  10. end
  11.  
  12. local life = tonumber(parameters [1]);
  13. local es = tonumber(parameters [2]);
  14. local fireres = tonumber(parameters [3]);
  15. local dmgtaken = tonumber(parameters [4]);
  16.  
  17. if life==nil then
  18. life=0;
  19. end
  20.  
  21. if life <= 1 then
  22. print("@"..usr.." you cannot use RF is you have 1 or less MAX HP, wow don't you even know anything? wow OpieOP wow FishMoley OpieOP wow nerd OpieOP");
  23. return;
  24. end
  25.  
  26. if es==nil then
  27. es=0;
  28. end
  29.  
  30. if fireres==nil then
  31. fireres=0;
  32. end
  33.  
  34. if dmgtaken==nil then
  35. dmgtaken=0;
  36. end
  37.  
  38. if fireres > 1 then
  39. fireres = fireres/100;
  40. end
  41.  
  42. print("@"..usr.." with "..tostring(life).." life, "..tostring(es).." es, "..tostring(fireres*100).."% fireres and "..tostring(dmgtaken*100).."% damage taken you need ".. RFBurn(life,es,fireres,dmgtaken).." life regen");
  43.  
  44. end
  45.  
  46. return Func;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement