Advertisement
fiqt

spell_damage

Sep 20th, 2014
2,804
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 52.25 KB | None | 0 0
  1. --[[
  2. added:  cass, soraka, nidalee, viktor (patch 4.17)
  3. khazix, sion, ezreal (patch 4.18)
  4. lucian, ryze (patch 4.19)
  5.  
  6.  
  7. Spell Damage Library 1.44
  8. by eXtragoZ
  9.  
  10. Is designed to calculate the damage of the skills to champions, although most of the calculations
  11. work for creeps
  12.  
  13. -------------------------------------------------------
  14. Usage:
  15.  
  16. local target = heroManager:getHero(2)
  17. local damage, TypeDmg = getDmg("R",target,myHero,3)
  18. -------------------------------------------------------
  19. Full function:
  20.     getDmg("SKILL",target,owner,stagedmg,spelllvl)
  21.    
  22.     Returns:
  23.     damage, TypeDmg
  24.    
  25.     TypeDmg:
  26.     1   Normal damage
  27.     2   Attack damage and on hit passives needs to be added to the damage
  28.    
  29.     Skill:          (in capitals!)
  30.     "P"             -Passive
  31.     "Q"
  32.     "W"
  33.     "E"
  34.     "R"
  35.     "QM"            -Q in melee form (Jayce, Nidalee and Elise only)
  36.     "WM"            -W in melee form (Jayce, Nidalee and Elise only)
  37.     "EM"            -E in melee form (Jayce, Nidalee and Elise only)
  38.     "AD"            -Attack damage
  39.     "IGNITE"        -Ignite
  40.     "DFG"           -Deathfire Grasp
  41.     "HXG"           -Hextech Gunblade
  42.     "BWC"           -Bilgewater Cutlass
  43.     "KITAES"        -Kitae's Bloodrazor
  44.     "WITSEND"       -Wit's End
  45.     "SHEEN"         -Sheen
  46.     "TRINITY"       -Trinity Force
  47.     "LICHBANE"      -Lich Bane
  48.     "LIANDRYS"      -Liandry's Torment
  49.     "BLACKFIRE"     -Blackfire Torch
  50.     "STATIKK"       -Statikk Shiv
  51.     "ICEBORN"       -Iceborn Gauntlet
  52.     "TIAMAT"        -Tiamat
  53.     "HYDRA"         -Ravenous Hydra
  54.     "RUINEDKING"    -Blade of the Ruined King
  55.     "MURAMANA"      -Muramana
  56.     "HURRICANE"     -Runaan's Hurricane
  57.     "SPIRITLIZARD"  -Spirit of the Elder Lizard
  58.     "SUNFIRE"       -Sunfire Cape
  59.     "LIGHTBRINGER"  -Lightbringer
  60.     "NTOOTH"        -Nashor's Tooth
  61.     "MOUNTAIN"      -Face of the Mountain
  62.    
  63.     Removed (returns 0):
  64.     "MADREDS"       -Madred's Bloodrazor
  65.     "ISPARK"        -Ionic Spark
  66.     "EXECUTIONERS"  -Executioner's Calling
  67.     "MALADY"        -Malady
  68.    
  69.     Stagedmg:
  70.     nil Active or first instance of dmg
  71.     1   Active or first instance of dmg
  72.     2   Passive or second instance of dmg
  73.     3   Max damage or third instance of dmg
  74.    
  75.     -Returns the damage they will do "owner" to "target" with the "skill"
  76.         -With some skills returns a percentage of increased damage
  77.         -Many skills are shown per second, hit and other
  78.         -Use spelllvl only if you want to specify the level of skill
  79.        
  80.         ]]--
  81.  
  82. spellDmg={}
  83. function getDmg(spellname,target,owner,stagedmg,spelllvl)
  84.     for i=1, objManager:GetMaxHeroes() do
  85.         local champ = objManager:GetHero(i)
  86.         spellDmg[champ.name]=true
  87.     end
  88.     local name = owner.name
  89.     local lvl = owner.selflevel
  90.     local ap = owner.ap
  91.     local ad = owner.addDamage+owner.baseDamage
  92.     local bad = owner.addDamage
  93.     local ar = owner.armor
  94.     local mmana = owner.maxMana
  95.     local mana = owner.mana
  96.     local mhp = owner.maxHealth
  97.     local tap = target.ap
  98.     local thp = target.health
  99.     local tmhp = target.maxHealth
  100.     local Qlvl = spelllvl and spelllvl or owner.SpellLevelQ
  101.     local Wlvl = spelllvl and spelllvl or owner.SpellLevelW
  102.     local Elvl = spelllvl and spelllvl or owner.SpellLevelE
  103.     local Rlvl = spelllvl and spelllvl or owner.SpellLevelR
  104.     local stagedmg1,stagedmg2,stagedmg3 = 1,0,0
  105.     if stagedmg == 2 then stagedmg1,stagedmg2,stagedmg3 = 0,1,0
  106.         elseif stagedmg == 3 then stagedmg1,stagedmg2,stagedmg3 = 0,0,1 end
  107.     local TrueDmg = 0
  108.     local TypeDmg = 1 --1 ability/normal--2 bonus to attack
  109.     if ((spellname == "Q" or spellname == "QM") and Qlvl == 0) or ((spellname == "W" or spellname == "WM") and Wlvl == 0) or ((spellname == "E" or spellname == "EM") and Elvl == 0) or (spellname == "R" and Rlvl == 0) then
  110.         TrueDmg = 0
  111.     elseif spellname == "Q" or spellname == "W" or spellname == "E" or spellname == "R" or spellname == "P" or spellname == "QM" or spellname == "WM" or spellname == "EM" then
  112.         local DmgM = 0
  113.         local DmgP = 0
  114.         local DmgT = 0
  115.         if name == "Aatrox" then
  116.             if spellname == "Q" then DmgP = 45*Qlvl+25+.6*bad
  117.             elseif spellname == "W" then DmgP = (35*Wlvl+25+bad)*(stagedmg1+stagedmg3) TypeDmg = 2
  118.             elseif spellname == "E" then DmgM = 35*Elvl+40+.6*ap+.6*bad
  119.             elseif spellname == "R" then DmgM = 100*Rlvl+100+ap
  120.             end
  121.         elseif name == "Ahri" then
  122.             if spellname == "Q" then DmgM = (25*Qlvl+15+.35*ap)*(stagedmg1+stagedmg3) DmgT = (25*Qlvl+15+.35*ap)*(stagedmg2+stagedmg3) -- stage1:Initial. stage2:way back. stage3:total.
  123.             elseif spellname == "W" then DmgM = math.max(25*Wlvl+15+.4*ap,(25*Wlvl+15+.4*ap)*1.6*stagedmg3) -- xfox-fires , 30% damage from each additional fox-fire beyond the first. stage3: Max damage
  124.             elseif spellname == "E" then DmgM = 30*Elvl+30+.35*ap --Enemies hit by Charm take 20% increased damage from Ahri for 6 seconds
  125.             elseif spellname == "R" then DmgM = 40*Rlvl+30+.3*ap -- xbolt (3 bolts)
  126.             end
  127.         elseif name == "Akali" then
  128.             if spellname == "P" then DmgM = (6+.1666667*ap)*ad/100
  129.             elseif spellname == "Q" then DmgM = math.max((20*Qlvl+15+.4*ap)*stagedmg1,(25*Qlvl+20+.5*ap)*stagedmg2,(45*Qlvl+35+.9*ap)*stagedmg3) --stage1:Initial. stage2:Detonation. stage3:Max damage
  130.             elseif spellname == "E" then DmgP = 25*Elvl+5+.3*ap+.6*ad
  131.             elseif spellname == "R" then DmgM = 75*Rlvl+25+.5*ap
  132.             end
  133.         elseif name == "Alistar" then
  134.             if spellname == "P" then DmgM = math.max(6+lvl+.1*ap,(6+lvl+.1*ap)*3*stagedmg3)
  135.             elseif spellname == "Q" then DmgM = 45*Qlvl+15+.5*ap
  136.             elseif spellname == "W" then DmgM = 55*Wlvl+.7*ap
  137.             end
  138.         elseif name == "Amumu" then
  139.             if spellname == "Q" then DmgM = 50*Qlvl+30+.7*ap
  140.             elseif spellname == "W" then DmgM = ((.3*Wlvl+1.2+.01*ap)*tmhp/100)+4*Wlvl+4 --xsec
  141.             elseif spellname == "E" then DmgM = 25*Elvl+50+.5*ap
  142.             elseif spellname == "R" then DmgM = 100*Rlvl+50+.8*ap
  143.             end
  144.         elseif name == "Anivia" then
  145.             if spellname == "Q" then DmgM = math.max(30*Qlvl+30+.5*ap,(30*Qlvl+30+.5*ap)*2*stagedmg3) -- x2 if it detonates. stage3: Max damage
  146.             elseif spellname == "E" then DmgM = math.max(30*Elvl+25+.5*ap,(30*Elvl+25+.5*ap)*2*stagedmg3) -- x2 If the target has been chilled. stage3: Max damage
  147.             elseif spellname == "R" then DmgM = 40*Rlvl+40+.25*ap --xsec
  148.             end
  149.         elseif name == "Annie" then
  150.             if spellname == "Q" then DmgM = 35*Qlvl+45+.8*ap
  151.             elseif spellname == "W" then DmgM = 45*Wlvl+25+.85*ap
  152.             elseif spellname == "E" then DmgM = 10*Elvl+10+.2*ap --x each attack suffered
  153.             elseif spellname == "R" then DmgM = math.max((125*Rlvl+50+.8*ap)*stagedmg1,(35+.2*ap)*stagedmg2,(125*Rlvl+50+.8*ap)*stagedmg3) DmgP = (25*Rlvl+55)*stagedmg2 --stage1:Summon Tibbers . stage2:Aura AoE xsec + 1 Tibbers Attack. stage3:Summon Tibbers
  154.             end
  155.         elseif name == "Ashe" then
  156.             if spellname == "Q" then TypeDmg = 2
  157.             elseif spellname == "W" then DmgP = 10*Wlvl+30+ad
  158.             elseif spellname == "R" then DmgM = 175*Rlvl+75+ap
  159.             end
  160.         elseif name == "Azir" then
  161.             if spellname == "Q" then DmgM = 30*Qlvl+30+.5*ap --beyond the first will deal only 25% damage
  162.             elseif spellname == "W" then DmgM = math.max(5*lvl+45,10*lvl-10)+.7*ap--after the first deals 25% damage
  163.             elseif spellname == "E" then DmgM = 30*Qlvl+30+.4*ap
  164.             elseif spellname == "R" then DmgM = 75*Rlvl+75+.6*ap
  165.             end
  166.         elseif name == "Blitzcrank" then
  167.             if spellname == "Q" then DmgM = 55*Qlvl+25+ap
  168.             elseif spellname == "E" then DmgP = ad TypeDmg = 2
  169.             elseif spellname == "R" then DmgM = math.max((125*Rlvl+125+ap)*stagedmg1,(100*Rlvl+.2*ap)*stagedmg2,(125*Rlvl+125+ap)*stagedmg3) --stage1:the active. stage2:the passive. stage3:the active
  170.             end
  171.         elseif name == "Brand" then
  172.             if spellname == "P" then DmgM = math.max(2*tmhp/100,(2*tmhp/100)*4*stagedmg3) --xsec (4sec). stage3: Max damage
  173.             elseif spellname == "Q" then DmgM = 40*Qlvl+40+.65*ap
  174.             elseif spellname == "W" then DmgM = math.max(45*Wlvl+30+.6*ap,(45*Wlvl+30+.6*ap)*1.25*stagedmg3) --125% for units that are ablaze. stage3: Max damage
  175.             elseif spellname == "E" then DmgM = 35*Elvl+35+.55*ap
  176.             elseif spellname == "R" then DmgM = math.max(100*Rlvl+50+.5*ap,(100*Rlvl+50+.5*ap)*3*stagedmg3) --xbounce (can hit the same enemy up to three times). stage3: Max damage
  177.             end
  178.         elseif name == "Braum" then
  179.             if spellname == "P" then DmgM = math.max((8*lvl+32)*(stagedmg1+stagedmg3),(2*lvl+12)*stagedmg2) --stage1-stage3:Stun. stage2:bonus damage.
  180.             elseif spellname == "Q" then DmgM = 45*Qlvl+15+.025*mhp
  181.             elseif spellname == "R" then DmgM = 100*Rlvl+50+.6*ap
  182.             end
  183.         elseif name == "Caitlyn" then
  184.             if spellname == "P" then DmgP = .5*ad TypeDmg = 2 --xheadshot (bonus)
  185.             elseif spellname == "Q" then DmgP = 40*Qlvl-20+1.3*ad --deal 10% less damage for each subsequent target hit, down to a minimum of 50%
  186.             elseif spellname == "W" then DmgM = 50*Wlvl+30+.6*ap
  187.             elseif spellname == "E" then DmgM = 50*Elvl+30+.8*ap
  188.             elseif spellname == "R" then DmgP = 225*Rlvl+25+2*bad
  189.             end
  190.         elseif name == "Cassiopeia" then
  191.             if spellname == "Q" then DmgM = 40*Qlvl+35+.45*ap
  192.             elseif spellname == "W" then DmgM = 5*Wlvl+5+.1*ap --xsec
  193.             elseif spellname == "E" then DmgM = 25*Elvl+30+(.05*Elvl+.35)*ap
  194.             elseif spellname == "R" then DmgM = 100*Rlvl+50+.5*ap
  195.             end
  196.         elseif name == "Chogath" then
  197.             if spellname == "Q" then DmgM = 56.25*Qlvl+23.75+ap
  198.             elseif spellname == "W" then DmgM = 50*Wlvl+25+.7*ap
  199.             elseif spellname == "E" then DmgM = 15*Elvl+5+.3*ap TypeDmg = 2 --xhit (bonus)
  200.             elseif spellname == "R" then DmgT = 175*Rlvl+125+.7*ap
  201.             end
  202.         elseif name == "Corki" then
  203.             if spellname == "P" then DmgT = .1*ad TypeDmg = 2 --xhit (bonus)
  204.             elseif spellname == "Q" then DmgM = 50*Qlvl+30+.5*bad+.5*ap
  205.             elseif spellname == "W" then DmgM = 30*Wlvl+30+.4*ap --xsec (2.5 sec)
  206.             elseif spellname == "E" then DmgP = 12*Elvl+8+.4*bad --xsec (4 sec)
  207.             elseif spellname == "R" then DmgM = math.max(70*Rlvl+50+.3*ap+(.1*Rlvl+.1)*ad,(70*Rlvl+50+.3*ap+(.1*Rlvl+.1)*ad)*1.5*stagedmg3) --150% the big one. stage3: Max damage
  208.             end
  209.         elseif name == "Darius" then
  210.             if spellname == "P" then DmgM = (-.75)*((-1)^lvl-2*lvl-13)+.3*bad --xstack over 5 sec
  211.             elseif spellname == "Q" then DmgP = math.max(35*Qlvl+35+.7*bad,(35*Qlvl+35+.7*bad)*1.5*stagedmg3) --150% Champions in the outer half. stage3: Max damage
  212.             elseif spellname == "W" then DmgP = .2*Wlvl*ad TypeDmg = 2 --(bonus)
  213.             elseif spellname == "R" then DmgT = math.max(90*Rlvl+70+.75*bad,(90*Rlvl+70+.75*bad)*2*stagedmg3) --xstack of Hemorrhage deals an additional 20% damage. stage3: Max damage
  214.             end
  215.         elseif name == "Diana" then
  216.             if spellname == "P" then DmgM = math.max(5*lvl+15,10*lvl-10,15*lvl-60,20*lvl-125,25*lvl-200)+.8*ap TypeDmg = 2 -- (bonus)
  217.             elseif spellname == "Q" then DmgM = 35*Qlvl+25+.7*ap
  218.             elseif spellname == "W" then DmgM = math.max(12*Wlvl+10+.2*ap,(12*Wlvl+10+.2*ap)*3*stagedmg3) --xOrb (3 orbs). stage3: Max damage
  219.             elseif spellname == "R" then DmgM = 60*Rlvl+40+.6*ap
  220.             end
  221.         elseif name == "DrMundo" then
  222.             if spellname == "Q" then DmgM = math.max((2.5*Qlvl+12.5)*thp/100,50*Qlvl+30)
  223.             elseif spellname == "W" then DmgM = 15*Wlvl+20+.2*ap --xsec
  224.             end
  225.         elseif name == "Draven" then
  226.             if spellname == "P" then DmgP = (.1*Qlvl+.35)*ad TypeDmg = 2 --xhit (bonus)
  227.             elseif spellname == "E" then DmgP = 35*Elvl+35+.5*bad
  228.             elseif spellname == "R" then DmgP = 100*Rlvl+75+1.1*bad --xhit (max 2 hits), deals 8% less damage for each unit hit, down to a minimum of 40%
  229.             end
  230.         elseif name == "Elise" then
  231.             if spellname == "P" then DmgM = 10*Rlvl+.1*ap --xhit Spiderling Damage
  232.             elseif spellname == "Q" then DmgM = 35*Qlvl+5+(8+.03*ap)*thp/100
  233.             elseif spellname == "QM" then DmgM = 40*Qlvl+20+(8+.03*ap)*(tmhp-thp)/100
  234.             elseif spellname == "W" then DmgM = 50*Wlvl+25+.8*ap
  235.             elseif spellname == "R" then DmgM = 10*Rlvl+.3*ap TypeDmg = 2 --xhit (bonus)
  236.             end
  237.         elseif name == "Evelynn" then
  238.             if spellname == "Q" then DmgM = 15*Qlvl+15+(.05*Qlvl+.3)*ap+(.05*Qlvl+.45)*bad
  239.             elseif spellname == "E" then DmgP = 40*Elvl+30+ap+bad --total
  240.             elseif spellname == "R" then DmgM = (5*Rlvl+10+.01*ap)*thp/100
  241.             end
  242.         elseif name == "Ezreal" then
  243.             if spellname == "Q" then DmgP = 20*Qlvl+15+.1*ad+.4*ap TypeDmg = 2 -- (bonus)
  244.             elseif spellname == "W" then DmgM = 45*Wlvl+25+.7*ap
  245.             elseif spellname == "E" then DmgM = 50*Elvl+25+.75*ap
  246.             elseif spellname == "R" then DmgM = 150*Rlvl+200+.9*ap+bad --deal 10% less damage for each subsequent target hit, down to a minimum of 30%
  247.             end
  248.         elseif name == "FiddleSticks" then
  249.             if spellname == "W" then DmgM = math.max(30*Wlvl+30+.45*ap,(30*Wlvl+30+.45*ap)*5*stagedmg3) --xsec (5 sec). stage3: Max damage
  250.             elseif spellname == "E" then DmgM = math.max(20*Elvl+45+.45*ap,(20*Elvl+45+.45*ap)*3*stagedmg3) --xbounce. stage3: Max damage
  251.             elseif spellname == "R" then DmgM = math.max(100*Rlvl+25+.45*ap,(100*Rlvl+25+.45*ap)*5*stagedmg3) --xsec (5 sec). stage3: Max damage
  252.             end
  253.         elseif name == "Fiora" then
  254.             if spellname == "Q" then DmgP = 25*Qlvl+15+.6*bad --xstrike
  255.             elseif spellname == "W" then DmgM = 50*Wlvl+10+ap
  256.             elseif spellname == "R" then DmgP = math.max(170*Rlvl-10+1.2*bad,(170*Rlvl-10+1.2*bad)*2*stagedmg3) --xstrike , without counting on-hit effects, Successive hits against the same target deal 25% damage. stage3: Max damage
  257.             end
  258.         elseif name == "Fizz" then
  259.             if spellname == "Q" then DmgM = 30*Qlvl-20+.6*ap TypeDmg = 2 -- (bonus)
  260.             elseif spellname == "W" then DmgM = math.max(((15*Wlvl+25+.6*ap)+(Wlvl+3)*(tmhp-thp)/100)*(stagedmg1+stagedmg3),((10*Wlvl+20+.35*ap)+(Wlvl+3)*(tmhp-thp)/100)*stagedmg2) TypeDmg = 2 --stage1:when its active. stage2:Passive. stage3:when its active
  261.             elseif spellname == "E" then DmgM = 50*Elvl+20+.75*ap
  262.             elseif spellname == "R" then DmgM = 125*Rlvl+75+ap
  263.             end
  264.         elseif name == "Galio" then
  265.             if spellname == "Q" then DmgM = 55*Qlvl+25+.6*ap
  266.             elseif spellname == "E" then DmgM = 45*Elvl+15+.5*ap
  267.             elseif spellname == "R" then DmgM = math.max(110*Rlvl+110+.6*ap,(110*Rlvl+110+.6*ap)*1.4*stagedmg3) --additional 5% damage for each attack suffered while channeling and capping at 40%. stage3: Max damage
  268.             end
  269.         elseif name == "Gangplank" then
  270.             if spellname == "P" then DmgM = 3+lvl TypeDmg = 2 --xstack
  271.             elseif spellname == "Q" then DmgP = 25*Qlvl-5 TypeDmg = 2 --without counting on-hit effects
  272.             elseif spellname == "R" then DmgM = 45*Rlvl+30+.2*ap --xCannonball (25 cannonballs)
  273.             end
  274.         elseif name == "Garen" then
  275.             if spellname == "Q" then DmgP = 25*Qlvl+5+.4*ad TypeDmg = 2 -- (bonus)
  276.             elseif spellname == "E" then DmgP = math.max(25*Elvl-5+(.1*Elvl+.6)*ad,(25*Elvl-5+(.1*Elvl+.6)*ad)*2.5*stagedmg3) --xsec (2.5 sec). stage3: Max damage
  277.             elseif spellname == "R" then DmgM = 175*Rlvl+(tmhp-thp)/((8-Rlvl)/2)
  278.             end
  279.         elseif name == "Gnar" then
  280.             if spellname == "Q" then DmgP = 35*Qlvl-25+ad -- 50% damage beyond the first
  281.             elseif spellname == "QM" then DmgP = 40*Qlvl-30+1.2*ad
  282.             elseif spellname == "W" then DmgM = 5*Wlvl+20+ap+(2*Wlvl+4)*tmhp/100
  283.             elseif spellname == "WM" then DmgP = 20*Wlvl+5+ad
  284.             elseif spellname == "E" then DmgP = 40*Elvl-20+6*mhp/100
  285.             elseif spellname == "EM" then DmgP = 40*Elvl-20+6*mhp/100
  286.             elseif spellname == "R" then DmgP = math.max(100*Rlvl+100+.2*bad+.5*ap,(100*Rlvl+100+.2*bad+.5*ap)*1.5*stagedmg3) --x1.5 If collide with terrain. stage3: Max damage
  287.             end
  288.         elseif name == "Gragas" then
  289.             if spellname == "Q" then DmgM = math.max(40*Qlvl+40+.6*ap,(40*Qlvl+40+.6*ap)*1.5*stagedmg3) --Damage increase by up to 50% over 2 seconds. stage3: Max damage
  290.             elseif spellname == "W" then DmgM = 30*Wlvl-10+.3*ap+(.01*Wlvl+.07)*tmhp TypeDmg = 2 -- (bonus)
  291.             elseif spellname == "E" then DmgM = 50*Elvl+30+.6*ap
  292.             elseif spellname == "R" then DmgM = 100*Rlvl+100+.7*ap
  293.             end
  294.         elseif name == "Graves" then
  295.             if spellname == "Q" then DmgP = math.max(35*Qlvl+25+.8*bad,(35*Qlvl+25+.8*bad)*1.8*stagedmg3) --xbullet , 40% damage xeach bullet beyond the first. stage3: Max damage
  296.             elseif spellname == "W" then DmgM = 50*Wlvl+10+.6*ap
  297.             elseif spellname == "R" then DmgP = math.max((150*Rlvl+100+1.5*bad)*(stagedmg1+stagedmg3),(120*Rlvl+80+1.2*bad)*stagedmg2) --stage1-3:Initial. stage2:Explosion.
  298.             end
  299.         elseif name == "Hecarim" then
  300.             if spellname == "Q" then DmgP = 35*Qlvl+25+.6*bad
  301.             elseif spellname == "W" then DmgM = math.max(11.25*Wlvl+8.75+.2*ap,(11.25*Wlvl+8.75+.2*ap)*4*stagedmg3) --xsec (4 sec). stage3: Max damage
  302.             elseif spellname == "E" then DmgP = math.max(35*Elvl+5+.5*bad,(35*Elvl+5+.5*bad)*2*stagedmg3) --Minimum , 200% Maximum (bonus). stage3: Max damage
  303.             elseif spellname == "R" then DmgM = 100*Rlvl+50+ap
  304.             end
  305.         elseif name == "Heimerdinger" then
  306.             if spellname == "P" then
  307.             elseif spellname == "Q" then DmgM = math.max((5.5*Qlvl+6.5+.15*ap)*stagedmg1,(math.max(20*Qlvl+20,25*Qlvl+5)+.55*ap)*stagedmg2,(60*Rlvl+120+.7*ap)*stagedmg3) --stage1:x Turrets attack. stage2:Beam. stage3:UPGRADE Beam
  308.             elseif spellname == "W" then DmgM = 30*Wlvl+30+.45*ap --x Rocket, 20% magic damage for each rocket beyond the first
  309.             elseif spellname == "E" then DmgM = 40*Elvl+20+.6*ap
  310.             elseif spellname == "R" then DmgM = math.max((20*Rlvl+50+.3*ap)*stagedmg1,(45*Rlvl+90+.45*ap)*stagedmg2,(50*Rlvl+100+.6*ap)*stagedmg3) --stage1:x Turrets attack. stage2:x Rocket, 20% magic damage for each rocket beyond the first. stage3:x Bounce
  311.             end
  312.         elseif name == "Irelia" then
  313.             if spellname == "Q" then DmgP = 30*Qlvl-10 TypeDmg = 2 -- (bonus)
  314.             elseif spellname == "W" then DmgT = 15*Wlvl TypeDmg = 2 --xhit (bonus)
  315.             elseif spellname == "E" then DmgM = 50*Elvl+30+.5*ap
  316.             elseif spellname == "R" then DmgP = 40*Rlvl+40+.5*ap+.6*bad --xblade
  317.             end
  318.         elseif name == "Janna" then
  319.             if spellname == "Q" then DmgM = math.max((25*Qlvl+35+.35*ap)*stagedmg1,(5*Qlvl+10+.1*ap)*stagedmg2,(25*Qlvl+35+.35*ap+(5*Qlvl+10+.1*ap)*3)*stagedmg3) --stage1:Initial. stage2:Additional Damage xsec (3 sec). stage3:Max damage
  320.             elseif spellname == "W" then DmgM = 55*Wlvl+5+.5*ap
  321.             end
  322.         elseif name == "JarvanIV" then
  323.             if spellname == "P" then DmgP = math.min(.01*tmhp,400) TypeDmg = 2
  324.             elseif spellname == "Q" then DmgP = 45*Qlvl+25+1.2*bad
  325.             elseif spellname == "E" then DmgM = 45*Elvl+15+.8*ap
  326.             elseif spellname == "R" then DmgP = 125*Rlvl+75+1.5*bad
  327.             end
  328.         elseif name == "Jax" then
  329.             if spellname == "Q" then DmgP = 40*Qlvl+30+.6*ap+bad
  330.             elseif spellname == "W" then DmgM = 35*Wlvl+5+.6*ap TypeDmg = 2
  331.             elseif spellname == "E" then DmgP = math.max(25*Elvl+25+.5*bad,(25*Elvl+25+.5*bad)*2*stagedmg3) --deals 20% additional damage for each attack dodged to a maximum of 100%. stage3: Max damage
  332.             elseif spellname == "R" then DmgM = 60*Rlvl+40+.7*ap TypeDmg = 2 --every third basic attack (bonus)
  333.             end
  334.         elseif name == "Jayce" then
  335.             if spellname == "Q" then DmgP = math.max(55*Qlvl+5+1.2*bad,(55*Qlvl+5+1.2*bad)*1.4*stagedmg3) --If its fired through an Acceleration Gate damage will increase by 40%. stage3: Max damage
  336.             elseif spellname == "QM" then DmgP = 45*Qlvl-25+bad
  337.             elseif spellname == "W" then DmgT = 15*Wlvl+55 --% damage
  338.             elseif spellname == "WM" then DmgM = math.max(17.5*Wlvl+7.5+.25*ap,(17.5*Wlvl+7.5+.25*ap)*4*stagedmg3) --xsec (4 sec). stage3: Max damage
  339.             elseif spellname == "EM" then DmgM = bad+((3*Elvl+5)*tmhp/100)
  340.             elseif spellname == "R" then DmgM = 40*Rlvl-20 TypeDmg = 2
  341.             end
  342.         elseif name == "Jinx" then
  343.             if spellname == "Q" then DmgP = .1*ad TypeDmg = 2
  344.             elseif spellname == "W" then DmgP = 50*Wlvl-40+1.4*ad
  345.             elseif spellname == "E" then DmgM = 55*Elvl+25+ap -- per Chomper
  346.             elseif spellname == "R" then DmgP = math.max(((50*Rlvl+75+.5*bad)*2+(0.05*Rlvl+0.2)*(tmhp-thp))*stagedmg1,(50*Rlvl+75+.5*bad)*stagedmg2,(0.05*Rlvl+0.2)*(tmhp-thp)*stagedmg3) --stage1:Maximum (after 1500 units)+Additional Damage. stage2:Minimum Base (Maximum = x2). stage3: Additional Damage
  347.             end
  348.         elseif name == "Karma" then
  349.             if spellname == "Q" then DmgM = math.max((45*Qlvl+35+.6*ap)*stagedmg1,(50*Rlvl-25+.3*ap)*stagedmg2,(100*Rlvl-50+.6*ap)*stagedmg3) --stage1:Initial. stage2:Bonus (R). stage3: Detonation (R)
  350.             elseif spellname == "W" then DmgM = math.max((50*Wlvl+10+.6*ap)*(stagedmg1+stagedmg3),(75*Rlvl+.6*ap)*stagedmg2) --stage1:Initial. stage2:Bonus (R).
  351.             elseif spellname == "E" then DmgM = 80*Rlvl-20+.6*ap --(R)
  352.             end
  353.         elseif name == "Karthus" then
  354.             if spellname == "Q" then DmgM = 40*Qlvl+40+.6*ap --50% damage if it hits multiple units
  355.             elseif spellname == "E" then DmgM = 20*Elvl+10+.2*ap --xsec
  356.             elseif spellname == "R" then DmgM = 150*Rlvl+100+.6*ap
  357.             end
  358.         elseif name == "Kassadin" then
  359.             if spellname == "Q" then DmgM = 25*Qlvl+55+.7*ap
  360.             elseif spellname == "W" then DmgM = math.max((25*Wlvl+15+.6*ap)*(stagedmg1+stagedmg3),(20+.1*ap)*stagedmg2) TypeDmg = 2 -- stage1-3:Active. stage2: Pasive.
  361.             elseif spellname == "E" then DmgM = 25*Elvl+55+.7*ap
  362.             elseif spellname == "R" then DmgM = math.max((20*Rlvl+60+.02*mmana)*(stagedmg1+stagedmg3),(10*Rlvl+30+.01*mmana)*stagedmg2) --stage1-3:Initial. stage2:additional xstack (4 stack).
  363.             end
  364.         elseif name == "Katarina" then
  365.             if spellname == "Q" then DmgM = math.max((25*Qlvl+35+.45*ap)*stagedmg1,(15*Qlvl+.15*ap)*stagedmg2,(40*Qlvl+35+.6*ap)*stagedmg3) --stage1:Dagger, Each subsequent hit deals 10% less damage. stage2:On-hit. stage3: Max damage
  366.             elseif spellname == "W" then DmgM = 35*Wlvl+5+.25*ap+.6*bad
  367.             elseif spellname == "E" then DmgM = 25*Elvl+35+.4*ap
  368.             elseif spellname == "R" then DmgM = math.max(17.5*Rlvl+22.5+.25*ap+.375*bad,(17.5*Rlvl+22.5+.25*ap+.375*bad)*10*stagedmg3) --xdagger (champion can be hit by a maximum of 10 daggers (2 sec)). stage3: Max damage
  369.             end
  370.         elseif name == "Kayle" then
  371.             if spellname == "Q" then DmgM = 50*Qlvl+10+.6*ap+bad
  372.             elseif spellname == "E" then DmgM = 10*Elvl+10+.25*ap TypeDmg = 2 --xhit (bonus)
  373.             end
  374.         elseif name == "Kennen" then
  375.             if spellname == "Q" then DmgM = 40*Qlvl+35+.75*ap
  376.             elseif spellname == "W" then DmgM = math.max((30*Wlvl+35+.55*ap)*(stagedmg1+stagedmg3),(.1*Wlvl+.3)*ad*stagedmg2) TypeDmg = 1+stagedmg2 --stage1:Active. stage2:On-hit. stage3: stage1
  377.             elseif spellname == "E" then DmgM = 40*Elvl+45+.6*ap
  378.             elseif spellname == "R" then DmgM = math.max(65*Rlvl+15+.4*ap,(65*Rlvl+15+.4*ap)*3*stagedmg3) --xbolt (max 3 bolts). stage3: Max damage
  379.             end
  380.         elseif name == "Khazix" then
  381.             if spellname == "P" then DmgM = math.max(5*lvl+10,10*lvl-5,15*lvl-55)-math.max(0,5*(lvl-13))+.5*ap TypeDmg = 2 -- (bonus)
  382.             elseif spellname == "Q" then DmgP = math.max((25*Qlvl+45+1.2*bad)*stagedmg1,(25*Qlvl+45+1.2*bad)*1.3*stagedmg2,((25*Qlvl+45+1.2*bad)*1.3+10*lvl+1.04*bad)*stagedmg3) --stage1:Normal. stage2:to Isolated. stage3:Evolved to Isolated.
  383.             elseif spellname == "W" then DmgP = 30*Wlvl+50+bad
  384.             elseif spellname == "E" then DmgP = 35*Elvl+30+.2*bad
  385.             end
  386.         elseif name == "KogMaw" then
  387.             if spellname == "P" then DmgT = 100+25*lvl
  388.             elseif spellname == "Q" then DmgM = 50*Qlvl+30+.5*ap
  389.             elseif spellname == "W" then DmgM = (Wlvl+1+.01*ap)*tmhp/100 TypeDmg = 2 --xhit (bonus)
  390.             elseif spellname == "E" then DmgM = 50*Elvl+10+.7*ap
  391.             elseif spellname == "R" then DmgM = 80*Rlvl+80+.3*ap+.5*bad
  392.             end
  393.         elseif name == "Leblanc" then
  394.             if spellname == "Q" then DmgM = math.max(25*Qlvl+30+.4*ap,(25*Qlvl+30+.4*ap)*2*stagedmg3) --Initial or mark. stage3: Max damage
  395.             elseif spellname == "W" then DmgM = 40*Wlvl+45+.6*ap
  396.             elseif spellname == "E" then DmgM = math.max(25*Qlvl+15+.5*ap,(25*Qlvl+15+.5*ap)*2*stagedmg3) --Initial or Delayed. stage3: Max damage
  397.             elseif spellname == "R" then DmgM = math.max((100*Rlvl+.65*ap)*stagedmg1,(150*Rlvl+.975*ap)*stagedmg2,(100*Rlvl+.65*ap)*stagedmg3) --stage1:Q Initial or mark. stage2:W. stage3:E Initial or Delayed
  398.             end
  399.         elseif name == "LeeSin" then
  400.             if spellname == "Q" then DmgP = math.max((30*Qlvl+20+.9*bad)*stagedmg1,(30*Qlvl+20+.9*bad+8*(tmhp-thp)/100)*stagedmg2,(60*Qlvl+40+1.8*bad+8*(tmhp-thp)/100)*stagedmg3) --stage1:Sonic Wave. stage2:Resonating Strike. stage3: Max damage
  401.             elseif spellname == "E" then DmgM = 35*Qlvl+25+bad
  402.             elseif spellname == "R" then DmgP = 200*Rlvl+2*bad
  403.             end
  404.         elseif name == "Leona" then
  405.             if spellname == "P" then DmgM = (-1.25)*(3*(-1)^lvl-6*lvl-7)
  406.             elseif spellname == "Q" then DmgM = 30*Qlvl+10+.3*ap TypeDmg = 2 -- (bonus)
  407.             elseif spellname == "W" then DmgM = 50*Wlvl+10+.4*ap
  408.             elseif spellname == "E" then DmgM = 40*Elvl+20+.4*ap
  409.             elseif spellname == "R" then DmgM = 100*Rlvl+50+.8*ap
  410.             end
  411.         elseif name == "Lissandra" then
  412.             if spellname == "Q" then DmgM = 35*Qlvl+40+.65*ap
  413.             elseif spellname == "W" then DmgM = 40*Wlvl+30+.4*ap
  414.             elseif spellname == "E" then DmgM = 45*Elvl+25+.6*ap
  415.             elseif spellname == "R" then DmgM = 100*Rlvl+50+.7*ap
  416.             end
  417.         elseif name == "Lucian" then
  418.             if spellname == "P" then DmgP = (.5+.25*math.floor(lvl/13))*ad TypeDmg = 2 -- 50-75% of Lucian's AD based on level 13
  419.             elseif spellname == "Q" then DmgP = 30*Qlvl+50+(15*Qlvl+45)*bad/100
  420.             elseif spellname == "W" then DmgM = 40*Wlvl+20+.9*ap
  421.             elseif spellname == "R" then DmgP = 10*Rlvl+30+.1*ap+.3*bad --per shot
  422.             end
  423.         elseif name == "Lulu" then
  424.             if spellname == "P" then DmgM = math.max(4*math.floor(lvl/2+.5)-1+.15*ap,(4*math.floor(lvl/2+.5)-1+.15*ap)*3*stagedmg3) --xbolt (3 bolts). stage: Max damage
  425.             elseif spellname == "Q" then DmgM = 45*Qlvl+35+.5*ap
  426.             elseif spellname == "E" then DmgM = 30*Elvl+50+.4*ap
  427.             end
  428.         elseif name == "Lux" then
  429.             if spellname == "P" then DmgM = 8*lvl+10+.2*ap
  430.             elseif spellname == "Q" then DmgM = 50*Qlvl+10+.7*ap
  431.             elseif spellname == "E" then DmgM = 45*Elvl+15+.6*ap
  432.             elseif spellname == "R" then DmgM = 100*Rlvl+200+.75*ap
  433.             end
  434.         elseif name == "Malphite" then
  435.             if spellname == "Q" then DmgM = 50*Qlvl+20+.6*ap
  436.             elseif spellname == "E" then DmgM = 40*Elvl+20+.2*ap+.3*ar
  437.             elseif spellname == "R" then DmgM = 100*Rlvl+100+ap
  438.             end
  439.         elseif name == "Malzahar" then
  440.             if spellname == "P" then DmgP = 20+5*lvl+bad --Voidling xhit
  441.             elseif spellname == "Q" then DmgM = 55*Qlvl+25+.8*ap
  442.             elseif spellname == "W" then DmgM = (Wlvl+3+.01*ap)*tmhp/100 --xsec (5 sec)
  443.             elseif spellname == "E" then DmgM = 60*Elvl+20+.8*ap --over 4 sec
  444.             elseif spellname == "R" then DmgM = 150*Rlvl+100+1.3*ap --over 2.5 sec
  445.             end
  446.         elseif name == "Maokai" then
  447.             if spellname == "Q" then DmgM = 45*Qlvl+25+.4*ap
  448.             elseif spellname == "W" then DmgM = (1*Wlvl+8+.03*ap)*tmhp/100
  449.             elseif spellname == "E" then DmgM = math.max((20*Elvl+20+.4*ap)*stagedmg1,(40*Elvl+40+.6*ap)*stagedmg2,(60*Elvl+60+ap)*stagedmg3) --stage1:Impact. stage2:Explosion. stage3: Max damage
  450.             elseif spellname == "R" then DmgM = 50*Rlvl+50+.5*ap+(50*Rlvl+50)*stagedmg3 -- +2 per point of damage absorbed (max 200/250/300). stage3: Max damage
  451.             end
  452.         elseif name == "MasterYi" then
  453.             if spellname == "P" then DmgP = .5*ad TypeDmg = 2
  454.             elseif spellname == "Q" then DmgP = math.max((35*Qlvl-10+ad)*stagedmg1,(.6*ad)*stagedmg2,(35*Qlvl-10+1.6*ad)*stagedmg3) --stage1:normal. stage2:critically strike (bonus). stage3: critically strike
  455.             elseif spellname == "E" then DmgT = 5*Elvl+5+((5/2)*Elvl+15/2)*ad/100
  456.             end
  457.         elseif name == "MissFortune" then
  458.             if spellname == "Q" then DmgP = math.max((15*Qlvl+5+.85*ad+.35*ap)*(stagedmg1+stagedmg3),(30*Qlvl+10+ad+.5*ap)*stagedmg2) --stage1-stage3:1st target. stage2:2nd target.
  459.             elseif spellname == "W" then DmgM = .06*ad --xstack (max 5+Rlvl stacks) (bonus)
  460.             elseif spellname == "E" then DmgM = 55*Elvl+35+.8*ap --over 3 seconds
  461.             elseif spellname == "R" then DmgP = math.max(25*Rlvl+25,50*Rlvl-25)+.2*ap --xwave (8 waves) applies a stack of Impure Shots
  462.             end
  463.         elseif name == "Mordekaiser" then
  464.             if spellname == "Q" then DmgM = math.max(30*Qlvl+50+.4*ap+bad,(30*Qlvl+50+.4*ap+bad)*1.65*stagedmg3) --If the target is alone, the ability deals 65% more damage. stage3: Max damage
  465.             elseif spellname == "W" then DmgM = math.max(14*Wlvl+10+.2*ap,(14*Wlvl+10+.2*ap)*6*stagedmg3) --xsec (6 sec). stage3: Max damage
  466.             elseif spellname == "E" then DmgM = 45*Elvl+25+.6*ap
  467.             elseif spellname == "R" then DmgM = (5*Rlvl+19+.04*ap)*tmhp/100 --half Initial and half over 10 sec
  468.             end
  469.         elseif name == "Morgana" then
  470.             if spellname == "Q" then DmgM = 55*Qlvl+25+.6*ap
  471.             elseif spellname == "W" then DmgM = (7*Wlvl+5+.11*ap)*(1+.5*(1-thp/tmhp)) --x 1/2 sec (5 sec)
  472.             elseif spellname == "R" then DmgM = math.max(75*Rlvl+75+.7*ap,(75*Rlvl+75+.7*ap)*2*stagedmg3) --x2 If the target stay in range for the full duration. stage3: Max damage
  473.             end
  474.         elseif name == "Nami" then
  475.             if spellname == "Q" then DmgM = 55*Qlvl+20+.5*ap
  476.             elseif spellname == "W" then DmgM = 40*Wlvl+30+.5*ap --The percentage power of later bounces now scales. Each bounce gains 0.75% more power per 10 AP
  477.             elseif spellname == "E" then DmgM = 15*Elvl+10+.2*ap TypeDmg = 2 --xhit (max 3 hits)
  478.             elseif spellname == "R" then DmgM = 100*Rlvl+50+.6*ap
  479.             end
  480.         elseif name == "Nasus" then
  481.             if spellname == "Q" then DmgP = 20*Qlvl+10 TypeDmg = 2 --+3 per enemy killed by Siphoning Strike (bonus)
  482.             elseif spellname == "E" then DmgM = math.max((80*Elvl+30+1.2*ap)/5,(80*Elvl+30+1.2*ap)*stagedmg3) --xsec (5 sec). stage3: Max damage
  483.             elseif spellname == "R" then DmgM = (Rlvl+2+.01*ap)*tmhp/100 --xsec (15 sec)
  484.             end
  485.         elseif name == "Nautilus" then
  486.             if spellname == "P" then DmgP = 2+6*lvl TypeDmg = 2
  487.             elseif spellname == "Q" then DmgM = 45*Qlvl+15+.75*ap
  488.             elseif spellname == "W" then DmgM = 15*Wlvl+25+.4*ap TypeDmg = 2 --xhit (bonus)
  489.             elseif spellname == "E" then DmgM = math.max(40*Elvl+20+.5*ap,(40*Elvl+20+.5*ap)*2*stagedmg3) --xexplosions , 50% less damage from additional explosions. stage3: Max damage
  490.             elseif spellname == "R" then DmgM = 125*Rlvl+75+.8*ap
  491.             end
  492.         elseif name == "Nidalee" then
  493.             if spellname == "Q" then DmgM = 25*Qlvl+25+.4*ap --deals 300% damage the further away the target is, gains damage from 525 units until 1300 units
  494.             elseif spellname == "QM" then DmgM = (math.max(4,30*Rlvl-40,40*Rlvl-70)+0.75*ad+0.36*ap)*(1+1.5*(tmhp-thp)/tmhp) --Deals 33% increased damage against Hunted
  495.             elseif spellname == "W" then DmgM = 20*Wlvl+(2*Wlvl+8+.02*ap)*thp/100 -- over 4 sec
  496.             elseif spellname == "WM" then DmgM = 50*Rlvl+.3*ap
  497.             elseif spellname == "EM" then DmgM = 60*Rlvl+10+.45*ap
  498.             end
  499.         elseif name == "Nocturne" then
  500.             if spellname == "P" then DmgP = .2*ad TypeDmg = 2 --(bonus)
  501.             elseif spellname == "Q" then DmgP = 45*Qlvl+15+.75*bad
  502.             elseif spellname == "E" then DmgM = 50*Elvl+ap
  503.             elseif spellname == "R" then DmgP = 100*Rlvl+50+1.2*bad
  504.             end
  505.         elseif name == "Nunu" then
  506.             if spellname == "Q" then DmgM = .01*mhp --xhit Ornery Monster Tails passive
  507.             elseif spellname == "E" then DmgM = 37.5*Elvl+47.5+ap
  508.             elseif spellname == "R" then DmgM = 250*Rlvl+375+2.5*ap --After 3 sec
  509.             end
  510.         elseif name == "Olaf" then
  511.             if spellname == "Q" then DmgP = 45*Qlvl+25+bad
  512.             elseif spellname == "E" then DmgT = 45*Elvl+25+.4*ad
  513.             end
  514.         elseif name == "Orianna" then
  515.             if spellname == "P" then DmgM = 8*math.floor((lvl+2)/3)+2+0.15*ap --xhit subsequent attack deals 20% more dmg up to 40%
  516.             elseif spellname == "Q" then DmgM = 30*Qlvl+30+.5*ap --10% less damage for each subsequent target hit down to a minimum of 40%
  517.             elseif spellname == "W" then DmgM = 45*Wlvl+25+.7*ap
  518.             elseif spellname == "E" then DmgM = 30*Elvl+30+.3*ap
  519.             elseif spellname == "R" then DmgM = 75*Rlvl+75+.7*ap
  520.             end
  521.         elseif name == "Pantheon" then
  522.             if spellname == "Q" then DmgP = (40*Qlvl+25+1.4*bad)+(40*Qlvl+25+1.4*bad)*0.5*math.floor((tmhp-thp)/(tmhp*0.85))
  523.             elseif spellname == "W" then DmgM = 25*Wlvl+25+ap
  524.             elseif spellname == "E" then DmgP = math.max(20*Elvl+6+1.2*bad,(20*Elvl+6+1.2*bad)*3*stagedmg3) --xStrike (3 strikes). stage3: Max damage
  525.             elseif spellname == "R" then DmgM = 300*Rlvl+100+ap
  526.             end
  527.         elseif name == "Poppy" then
  528.             if spellname == "Q" then DmgM = 25*Qlvl+.6*ap+ad+math.min(0.08*tmhp,75*Qlvl) --(applies on hit?) TypeDmg = 3
  529.             elseif spellname == "E" then DmgM = math.max((25*Elvl+25+.4*ap)*stagedmg1,(50*Elvl+25+.4*ap)*stagedmg2,(75*Elvl+50+.8*ap)*stagedmg3) --stage1:initial. stage2:Collision. stage3: Max damage
  530.             elseif spellname == "R" then DmgT = 10*Rlvl+10 --% Increased Damage
  531.             end
  532.         elseif name == "Quinn" then
  533.             if spellname == "P" then DmgP = math.max(10*lvl+15,15*lvl-55)+.5*bad TypeDmg = 2 --(bonus)
  534.             elseif spellname == "Q" then DmgP = 40*Qlvl+30+.65*bad+.5*ap
  535.             elseif spellname == "E" then DmgP = 30*Elvl+10+.2*bad
  536.             elseif spellname == "R" then DmgP = (50*Rlvl+70+.5*bad)*(2-thp/tmhp)
  537.             end
  538.         elseif name == "Rammus" then
  539.             if spellname == "Q" then DmgM = 50*Qlvl+50+ap
  540.             elseif spellname == "W" then DmgM = 10*Wlvl+5+.1*ar --x each attack suffered
  541.             elseif spellname == "R" then DmgM = 65*Rlvl+.3*ap --xsec (8 sec)
  542.             end
  543.         elseif name == "Renekton" then
  544.             if spellname == "Q" then DmgP = math.max(30*Qlvl+30+.8*bad,(30*Qlvl+30+.8*bad)*1.5*stagedmg3) --stage1:with 50 fury deals 50% additional damage. stage3: Max damage
  545.             elseif spellname == "W" then DmgP = math.max(20*Wlvl-10+1.5*ad,(20*Wlvl-10+1.5*ad)*1.5*stagedmg3) --stage1:with 50 fury deals 50% additional damage. stage3: Max damage -- on hit x2 or x3
  546.             elseif spellname == "E" then DmgP = math.max(30*Elvl+.9*bad,(30*Elvl+.9*bad)*1.5*stagedmg3) --stage1:Slice or Dice , with 50 fury Dice deals 50% additional damage. stage3: Max damage of Dice
  547.             elseif spellname == "R" then DmgM = math.max(30*Rlvl,60*Rlvl-60)+.1*ap --xsec (15 sec)
  548.             end
  549.         elseif name == "Rengar" then
  550.             if spellname == "Q" then DmgP = math.max((30*Qlvl+(.05*Qlvl-.05)*ad)*stagedmg1,(math.min(15*lvl+15,10*lvl+60)+.5*ad)*(stagedmg2+stagedmg3)) TypeDmg = 2 --stage1:Savagery. stage2-stage3:Empowered Savagery.
  551.             elseif spellname == "W" then DmgM = math.max((30*Wlvl+20+.8*ap)*stagedmg1,(math.min(15*lvl+25,math.max(145,10*lvl+60))+.8*ap)*(stagedmg2+stagedmg3)) --stage1:Battle Roar. stage2-stage3:Empowered Battle Roar.
  552.             elseif spellname == "E" then DmgP = math.max((50*Elvl+.7*bad)*stagedmg1,(math.min(25*lvl+25,10*lvl+160)+.7*bad)*(stagedmg2+stagedmg3))
  553.             end
  554.         elseif name == "Riven" then
  555.             if spellname == "P" then DmgP = 5+math.max(5*math.floor((lvl+2)/3)+10,10*math.floor((lvl+2)/3)-15)*ad/100 --xcharge
  556.             elseif spellname == "Q" then DmgP = 20*Qlvl-10+(.05*Qlvl+.35)*ad --xstrike (3 strikes)
  557.             elseif spellname == "W" then DmgP = 30*Wlvl+20+bad
  558.             elseif spellname == "R" then DmgP = math.min((40*Rlvl+40+.6*bad)*(1+(100-25)/100*8/3),120*Rlvl+120+1.8*bad)
  559.             end
  560.         elseif name == "Rumble" then
  561.             if spellname == "P" then DmgM = 20+5*lvl+.25*ap TypeDmg = 2 --xhit
  562.             elseif spellname == "Q" then DmgM = math.max(20*Qlvl+5+.33*ap,(20*Qlvl+5+.33*ap)*3*stagedmg3) --xsec (3 sec) , with 50 heat deals 150% damage. stage3: Max damage , with 50 heat deals 150% damage
  563.             elseif spellname == "E" then DmgM = 25*Elvl+20+.4*ap --xshoot (2 shoots) , with 50 heat deals 150% damage
  564.             elseif spellname == "R" then DmgM = math.max(55*Rlvl+75+.3*ap,(55*Rlvl+75+.3*ap)*5*stagedmg3) --stage1: xsec (5 sec). stage3: Max damage
  565.             end
  566.         elseif name == "Ryze" then
  567.             if spellname == "Q" then DmgM = 20*Qlvl+20+.4*ap+.065*mmana
  568.             elseif spellname == "W" then DmgM = 35*Wlvl+25+.6*ap+.045*mmana
  569.             elseif spellname == "E" then DmgM = math.max(20*Elvl+30+.35*ap+.01*mmana,(20*Elvl+30+.35*ap+.01*mmana)*3*stagedmg3) --xbounce. stage3: Max damage
  570.             end
  571.         elseif name == "Sejuani" then
  572.             if spellname == "Q" then DmgM = 30*Qlvl+10+.4*ap+(2*Qlvl+2)*tmhp/100
  573.             elseif spellname == "W" then DmgM = math.max((20*Wlvl+20+.3*ap)*stagedmg1,(10*Wlvl+10+.15*ap+2.5*(mhp-440-lvl*95)/100)*stagedmg2,(10*Wlvl+10+.15*ap+2.5*(mhp-440-lvl*95)/100)*4*stagedmg3) TypeDmg = 1+stagedmg1 --stage1: bonus. stage2: xsec (4 sec). stage3: stage2*4 sec
  574.             elseif spellname == "E" then DmgM = 50*Elvl+10+.5*ap
  575.             elseif spellname == "R" then DmgM = 100*Rlvl+50+.8*ap
  576.             end
  577.         elseif name == "Shaco" then
  578.             if spellname == "Q" then DmgP = (.2*Qlvl+.2)*ad --(bonus)
  579.             elseif spellname == "W" then DmgM = 15*Wlvl+20+.2*ap --xhit
  580.             elseif spellname == "E" then DmgM = 40*Elvl+10+ap+bad
  581.             elseif spellname == "R" then DmgM = 150*Rlvl+150+ap --The clone deals 75% of Shaco's damage
  582.             end
  583.         elseif name == "Shen" then
  584.             if spellname == "P" then DmgM = 4+4*lvl+(mhp-(428+85*lvl))*.1 TypeDmg = 2 --(bonus)
  585.             elseif spellname == "Q" then DmgM = 40*Qlvl+20+.6*ap
  586.             elseif spellname == "E" then DmgM = 35*Elvl+15+.5*ap
  587.             end
  588.         elseif name == "Shyvana" then
  589.             if spellname == "Q" then DmgP = (.05*Qlvl+.75)*ad TypeDmg = 2 --Second Strike
  590.             elseif spellname == "W" then DmgM = 15*Wlvl+5+.2*bad --xsec (3 sec + 4 extra sec)
  591.             elseif spellname == "E" then DmgM = math.max((40*Elvl+20+.6*ap)*(stagedmg1+stagedmg3),(2*tmhp/100)*stagedmg2) --stage1-3:Active. stage2:Each autoattack that hits debuffed targets
  592.             elseif spellname == "R" then DmgM = 125*Rlvl+50+.7*ap
  593.             end
  594.         elseif name == "Singed" then
  595.             if spellname == "Q" then DmgM = 12*Qlvl+10+.3*ap --xsec
  596.             elseif spellname == "E" then DmgM = 45*Elvl+35+.75*ap
  597.             end
  598.         elseif name == "Sion" then
  599.             if spellname == "P" then DmgP = 10*tmhp/100 TypeDmg = 2
  600.             elseif spellname == "Q" then DmgP = 20*Qlvl+.6*ad --Minimum, x3 over 2 sec
  601.             elseif spellname == "W" then DmgM = 25*Wlvl+15+.4*ap+(Wlvl+9)*tmhp/100
  602.             elseif spellname == "E" then DmgM = math.max(35*Wlvl+35+.4*ap,(35*Wlvl+35+.4*ap)*1.5*stagedmg3) --Minimum. stage3: x1.5 if hits a minion
  603.             elseif spellname == "R" then DmgP = 150*Qlvl+.4*bad --Minimum, x2 over 1.75 sec
  604.             end
  605.         elseif name == "Sivir" then
  606.             if spellname == "Q" then DmgP = 20*Qlvl+5+.5*ap+(.1*Qlvl+.6)*ad --x2 , 15% reduced damage to each subsequent target
  607.             elseif spellname == "W" then DmgP = (.05*Wlvl+.45)*ad*stagedmg2 TypeDmg = 2 --stage1:bonus to attack target. stage2: Bounce Damage
  608.             end
  609.         elseif name == "Skarner" then
  610.             if spellname == "P" then DmgM = 5*lvl+15 TypeDmg = 2
  611.             elseif spellname == "Q" then DmgP = (10*Qlvl+8+.4*bad)*(stagedmg1+stagedmg3) QDmgM = (10*Qlvl+8+.2*ap)*(stagedmg2+stagedmg3) --stage1:basic. stage2: charge bonus. stage2: total
  612.             elseif spellname == "E" then DmgM = 20*Elvl+20+.4*ap
  613.             elseif spellname == "R" then DmgM = math.max((100*Rlvl+100+ap)*(stagedmg1+stagedmg3),(25*Rlvl+25)*stagedmg2)--stage1-3:basic. stage2: per stacks of Crystal Venom.
  614.             end
  615.         elseif name == "Sona" then
  616.             if spellname == "P" then DmgM = (math.max(7*lvl+6,8*lvl+3,9*lvl-2,10*lvl-8,15*lvl-78)+.2*ap)*(1+stagedmg1) TypeDmg = 2 --stage1: Staccato. stage2:Diminuendo or Tempo
  617.             elseif spellname == "Q" then DmgM = math.max((40*Qlvl+.5*ap)*(stagedmg1+stagedmg3),(10*Qlvl+30+.25*ap+10*Rlvl)*stagedmg2) TypeDmg = 1+stagedmg2 --stage1-3: Active. stage2:On-hit
  618.             elseif spellname == "R" then DmgM = 100*Rlvl+50+.5*ap
  619.             end
  620.         elseif name == "Soraka" then
  621.             if spellname == "Q" then DmgM = math.max(40*Qlvl+30+0.35*ap,(40*Qlvl+30+0.35*ap)*1.5*stagedmg3)
  622.             elseif spellname == "E" then DmgM = math.max(40*Qlvl+30+0.35*ap,(40*Qlvl+30+0.35*ap)*2*stagedmg3)
  623.             end
  624.         elseif name == "Swain" then
  625.             if spellname == "Q" then DmgM = math.max(15*Qlvl+10+.3*ap,(15*Qlvl+10+.3*ap)*3*stagedmg3) --xsec (3 sec). stage3: Max damage
  626.             elseif spellname == "W" then DmgM = 40*Wlvl+40+.7*ap
  627.             elseif spellname == "E" then DmgM = (40*Elvl+35+.8*ap)*(stagedmg1+stagedmg3) DmgT = (3*Elvl+5)*stagedmg2 --stage1-3:Active. stage2:% Extra Damage.
  628.             elseif spellname == "R" then DmgM = 20*Rlvl+30+.2*ap --xstrike (1 strike x sec)
  629.             end
  630.         elseif name == "Syndra" then
  631.             if spellname == "Q" then DmgM = math.max(40*Qlvl+30+.6*ap,(40*Qlvl+30+.6*ap)*1.15*(Qlvl-4))
  632.             elseif spellname == "W" then DmgM = 40*Wlvl+40+.7*ap
  633.             elseif spellname == "E" then DmgM = 45*Elvl+25+.4*ap
  634.             elseif spellname == "R" then DmgM = math.max(45*Rlvl+45+.2*ap,(45*Rlvl+45+.2*ap)*7*stagedmg3) --stage1:xSphere (Minimum 3). stage3:7 Spheres
  635.             end
  636.         elseif name == "Talon" then
  637.             if spellname == "Q" then DmgP = 40*Qlvl+1.3*bad TypeDmg = 2 --(bonus)
  638.             elseif spellname == "W" then DmgP = math.max(25*Wlvl+5+.6*bad,(25*Wlvl+5+.6*bad)*2*stagedmg3) --x2 if the target is hit twice. stage3: Max damage
  639.             elseif spellname == "E" then DmgT = 3*Elvl --% Damage Amplification
  640.             elseif spellname == "R" then DmgP = math.max(50*Rlvl+70+.75*bad,(50*Rlvl+70+.75*bad)*2*stagedmg3) --x2 if the target is hit twice. stage3: Max damage
  641.             end
  642.         elseif name == "Taric" then
  643.             if spellname == "P" then DmgM = .2*ar TypeDmg = 2 --(bonus)
  644.             elseif spellname == "W" then DmgM = 40*Wlvl+.2*ar
  645.             elseif spellname == "E" then DmgM = math.max(30*Elvl+10+.2*ap,(30*Elvl+10+.2*ap)*2*stagedmg3) --min (lower damage the farther the target is) up to 200%. stage3: Max damage
  646.             elseif spellname == "R" then DmgM = 100*Rlvl+50+.5*ap
  647.             end
  648.         elseif name == "Teemo" then
  649.             if spellname == "Q" then DmgM = 45*Qlvl+35+.8*ap
  650.             elseif spellname == "E" then DmgM = math.max((10*Elvl+.3*ap)*stagedmg1,(6*Elvl+.1*ap)*stagedmg2,(34*Elvl+.7*ap)*stagedmg3) --stage1:Hit (bonus). stage2:poison xsec (4 sec). stage3:Hit+poison for 4 sec
  651.             elseif spellname == "R" then DmgM = 125*Rlvl+75+.5*ap
  652.             end
  653.         elseif name == "Thresh" then
  654.             if spellname == "Q" then DmgM = 40*Qlvl+40+.5*ap
  655.             elseif spellname == "E" then DmgM = math.max((40*Elvl+25+.4*ap)*(stagedmg1+stagedmg3),((.3*Qlvl+.5)*ad)*stagedmg2) --stage1:Active. stage2:Passive (+ Souls). stage3:stage1
  656.             elseif spellname == "R" then DmgM = 150*Rlvl+100+ap
  657.             end
  658.         elseif name == "Tristana" then
  659.             if spellname == "W" then DmgM = 45*Wlvl+25+.8*ap
  660.             elseif spellname == "E" then DmgM = math.max((45*Elvl+35+ap)*(stagedmg1+stagedmg3),(25*Elvl+25+.25*ap)*stagedmg2) --stage1-3:Active. stage2:Passive.
  661.             elseif spellname == "R" then DmgM = 100*Rlvl+200+1.5*ap
  662.             end
  663.         elseif name == "Trundle" then
  664.             if spellname == "Q" then DmgP = 20*Qlvl+(5*Qlvl+95)*ad/100 TypeDmg = 2 --(bonus)
  665.             elseif spellname == "R" then DmgM = (2*Rlvl+18+.02*ap)*tmhp/100 --over 4 sec
  666.             end
  667.         elseif name == "Tryndamere" then
  668.             if spellname == "E" then DmgP = 30*Elvl+40+ap+1.2*bad
  669.             end
  670.         elseif name == "TwistedFate" then
  671.             if spellname == "Q" then DmgM = 50*Qlvl+10+.65*ap
  672.             elseif spellname == "W" then DmgM = math.max((7.5*Wlvl+7.5+.5*ap+ad)*stagedmg1,(15*Wlvl+15+.5*ap+ad)*stagedmg2,(20*Wlvl+20+.5*ap+ad)*stagedmg3) --stage1:Gold Card. stage2:Red Card. stage3:Blue Card
  673.             elseif spellname == "E" then DmgM = 25*Elvl+30+.5*ap
  674.             end
  675.         elseif name == "Twitch" then
  676.             if spellname == "P" then DmgT = math.floor((lvl+2)/3) --xstack xsec (6 stack 6 sec)
  677.             elseif spellname == "E" then DmgP = math.max((5*Elvl+10+.2*ap+.25*bad)*stagedmg1,(15*Elvl+5)*stagedmg2,((5*Elvl+10+.2*ap+.25*bad)*6+15*Elvl+5)*stagedmg3) --stage1:xstack (6 stack). stage2:Base. stage3: Max damage
  678.             end
  679.         elseif name == "Udyr" then
  680.             if spellname == "Q" then DmgP = math.max((50*Qlvl-20+(.1*Qlvl+1.1)*ad)*(stagedmg2+stagedmg3),(.15*ad)*stagedmg1) TypeDmg = 2 --stage1:persistent effect. stage2:(bonus). stage3:stage2
  681.             elseif spellname == "W" then TypeDmg = 2
  682.             elseif spellname == "E" then TypeDmg = 2
  683.             elseif spellname == "R" then DmgM = math.max((40*Rlvl+.45*ap)*stagedmg2,(10*Rlvl+5+.25*ap)*stagedmg3) TypeDmg = 2 --stage1:0. stage2:xThird Attack. stage3:x wave (5 waves)
  684.             end
  685.         elseif name == "Urgot" then
  686.             if spellname == "Q" then DmgP = 30*Qlvl-20+.85*ad
  687.             elseif spellname == "E" then DmgP = 55*Elvl+20+.6*bad
  688.             end
  689.         elseif name == "Varus" then
  690.             if spellname == "Q" then DmgP = math.max(.625*(55*Qlvl-40+1.6*ad),(55*Qlvl-40+1.6*ad)*stagedmg3) --stage1:min. stage3:max. reduced by 15% per enemy hit (minimum 33%)
  691.             elseif spellname == "W" then DmgM = math.max((4*Wlvl+6+.25*ap)*stagedmg1,((.0075*Wlvl+.0125+.02*ap)*tmhp/100)*stagedmg2,((.0075*Wlvl+.0125+.02*ap)*tmhp/100)*3*stagedmg3) --stage1:xhit. stage2:xstack (3 stacks). stage3: 3 stacks
  692.             elseif spellname == "E" then DmgP = 35*Elvl+30+.6*ad
  693.             elseif spellname == "R" then DmgM = 100*Rlvl+50+ap
  694.             end
  695.         elseif name == "Vayne" then
  696.             if spellname == "Q" then DmgP = (.05*Qlvl+.25)*ad TypeDmg = 2 --(bonus)
  697.             elseif spellname == "W" then DmgT = 10*Wlvl+10+((1*Wlvl+3)*tmhp/100)
  698.             elseif spellname == "E" then DmgP = math.max(35*Elvl+10+.5*bad,(35*Elvl+10+.5*bad)*2*stagedmg3) --x2 If they collide with terrain. stage3: Max damage
  699.             elseif spellname == "R" then TypeDmg = 2
  700.             end
  701.         elseif name == "Veigar" then
  702.             if spellname == "Q" then DmgM = 45*Qlvl+35+.6*ap
  703.             elseif spellname == "W" then DmgM = 50*Wlvl+70+ap
  704.             elseif spellname == "R" then DmgM = 125*Rlvl+125+1.2*ap+.8*tap
  705.             end
  706.         elseif name == "Velkoz" then
  707.             if spellname == "P" then DmgT = 10*lvl+25
  708.             elseif spellname == "Q" then DmgM = 40*Qlvl+40+.6*ap
  709.             elseif spellname == "W" then DmgM = math.max(20*Wlvl+10+.25*ap,(20*Wlvl+10+.25*ap)*1.5*stagedmg2) --stage1-3:Initial. stage2:Detonation.
  710.             elseif spellname == "E" then DmgM = 30*Elvl+40+.5*ap
  711.             elseif spellname == "R" then DmgM = 20*Rlvl+30+.6*ap --every 0.25 sec (2.5 sec), Organic Deconstruction every 0.5 sec
  712.             end
  713.         elseif name == "Vi" then
  714.             if spellname == "Q" then DmgP = math.max(25*Qlvl+25+.8*bad,(25*Qlvl+25+.8*bad)*2*stagedmg3) --x2 If charging up to 1.5 seconds. stage3: Max damage
  715.             elseif spellname == "W" then DmgP = ((3/2)*Wlvl+5/2+(1/35)*bad)*thp/100
  716.             elseif spellname == "E" then DmgP = 15*Elvl-10+.15*ad+.7*ap TypeDmg = 2 --(Bonus)
  717.             elseif spellname == "R" then DmgP = 150*Rlvl+50+1.4*bad --deals 75% damage to enemies in her way
  718.             end
  719.         elseif name == "Viktor" then
  720.             if spellname == "Q" then DmgM = math.max((20*Qlvl+20+.2*ap)*(stagedmg1+stagedmg3),(math.max(5*lvl+15,10*lvl-30,20*lvl-150)+.5*ap+ad)*stagedmg2) --stage1-3:Initial. stage2:basic attack.
  721.             elseif spellname == "E" then DmgM = math.max(45*Elvl+25+.7*ap,(45*Elvl+25+.7*ap)*1.4*stagedmg3) --Initial or Aftershock. stage3: Max damage
  722.             elseif spellname == "R" then DmgM = math.max((100*Rlvl+50+.55*ap)*stagedmg1,(15*Rlvl+.1*ap)*stagedmg2,(100*Rlvl+50+.55*ap+(15*Rlvl+.1*ap)*7)*stagedmg3) --stage1:initial. stage2: xsec (7 sec). stage3: Max damage
  723.             end
  724.         elseif name == "Vladimir" then
  725.             if spellname == "Q" then DmgM = 35*Qlvl+55+.6*ap
  726.             elseif spellname == "W" then DmgM = 55*Wlvl+25+(mhp-(400+85*lvl))*.15 --(2 sec)
  727.             elseif spellname == "E" then DmgM = math.max((25*Elvl+35+.45*ap)*stagedmg1,((25*Elvl+35)*0.25)*stagedmg2,((25*Elvl+35)*2+.45*ap)*stagedmg3) --stage1:25% more base damage x stack. stage2:+x stack. stage3: Max damage
  728.             elseif spellname == "R" then DmgM = 100*Rlvl+50+.7*ap
  729.             end
  730.         elseif name == "Volibear" then
  731.             if spellname == "Q" then DmgP = 30*Qlvl TypeDmg = 2 --(bonus)
  732.             elseif spellname == "W" then DmgP = ((Wlvl-1)*45+80+(mhp-(440+lvl*86))*.15)*(1+(tmhp-thp)/tmhp)
  733.             elseif spellname == "E" then DmgM = 45*Elvl+15+.6*ap
  734.             elseif spellname == "R" then DmgM = 80*Rlvl-5+.3*ap TypeDmg = 2 --xhit
  735.             end
  736.         elseif name == "Warwick" then
  737.             if spellname == "P" then DmgM = math.max(.5*lvl+2.5,(.5*lvl+2.5)*3*stagedmg3) --xstack (3 stacks). stage3: Max damage
  738.             elseif spellname == "Q" then DmgM = 50*Qlvl+25+ap+((2*Qlvl+6)*tmhp/100)
  739.             elseif spellname == "R" then DmgM = math.max(17*Rlvl+33+.4*bad,(17*Rlvl+33+.4*bad)*5*stagedmg3) --xstrike (5 strikes) , without counting on-hit effects. stage3: Max damage
  740.             end
  741.         elseif name == "MonkeyKing" then
  742.             if spellname == "Q" then DmgP = 30*Qlvl+.1*ad TypeDmg = 2 --(bonus)
  743.             elseif spellname == "W" then DmgM = 45*Wlvl+25+.6*ap
  744.             elseif spellname == "E" then DmgP = 45*Elvl+15+.8*bad
  745.             elseif spellname == "R" then DmgP = math.max(90*Rlvl-70+1.1*ad,(90*Rlvl-70+1.1*ad)*4*stagedmg3) --xsec (4 sec). stage3: Max damage
  746.             end
  747.         elseif name == "Xerath" then
  748.             if spellname == "Q" then DmgM = 40*Qlvl+40+.75*ap
  749.             elseif spellname == "W" then DmgM = math.max((30*Qlvl+30+.6*ap)*1.5*(stagedmg1+stagedmg3),(30*Qlvl+30+.6*ap)*stagedmg2) --stage1,3: Center. stage2: Border
  750.             elseif spellname == "E" then DmgM = 30*Elvl+50+.45*ap
  751.             elseif spellname == "R" then DmgM = 55*Rlvl+135+.43*ap --xcast (3 cast)
  752.             end
  753.         elseif name == "XinZhao" then
  754.             if spellname == "Q" then DmgP = 15*Qlvl+.2*ad TypeDmg = 2 --(bonus x hit)
  755.             elseif spellname == "E" then DmgM = 35*Elvl+35+.6*ap
  756.             elseif spellname == "R" then DmgP = 100*Rlvl-25+bad+15*thp/100
  757.             end
  758.         elseif name == "Yasuo" then
  759.             if spellname == "Q" then DmgP = 20*Qlvl TypeDmg = 2 -- can critically strike, dealing X% AD
  760.             elseif spellname == "E" then DmgM = 20*Elvl+50+.6*ap --Each cast increases the next dash's base damage by 25%, up to 50% bonus damage
  761.             elseif spellname == "R" then DmgP = 100*Rlvl+100+1.5*bad
  762.             end
  763.         elseif name == "Yorick" then
  764.             if spellname == "P" then DmgP = .35*ad --xhit of ghouls
  765.             elseif spellname == "Q" then DmgP = 30*Qlvl+.2*ad TypeDmg = 2 --(bonus)
  766.             elseif spellname == "W" then DmgM = 35*Wlvl+25+ap
  767.             elseif spellname == "E" then DmgM = 30*Elvl+25+bad
  768.             end
  769.         elseif name == "Zac" then
  770.             if spellname == "Q" then DmgM = 40*Qlvl+30+.5*ap
  771.             elseif spellname == "W" then DmgM = 15*Wlvl+25+((1*Wlvl+3+.02*ap)*tmhp/100)
  772.             elseif spellname == "E" then DmgM = 40*Elvl+40+.7*ap
  773.             elseif spellname == "R" then DmgM = math.max(70*Rlvl+70+.4*ap,(70*Rlvl+70+.4*ap)*2.5*stagedmg3) -- stage1:Enemies hit more than once take half damage. stage3: Max damage
  774.             end
  775.         elseif name == "Zed" then
  776.             if spellname == "P" then DmgM = (6+2*(math.floor((lvl-1)/6)))*tmhp/100 TypeDmg = 2
  777.             elseif spellname == "Q" then DmgP = math.max((40*Qlvl+35+bad)*stagedmg1,(40*Qlvl+35+bad)*.6*stagedmg2,(40*Qlvl+35+bad)*1.5*stagedmg3) --stage1:multiple shurikens deal 50% damage. stage2:Secondary Targets. stage3: Max damage
  778.             elseif spellname == "E" then DmgP = 30*Elvl+30+.8*bad
  779.             elseif spellname == "R" then DmgP = ad*(stagedmg1+stagedmg3) DmgT = (15*Rlvl+5)*stagedmg2 --stage1-3:100% of Zed attack damage. stage2:% of damage dealt.
  780.             end
  781.         elseif name == "Ziggs" then
  782.             if spellname == "P" then DmgM = math.max(4*lvl+16,8*lvl-8,12*lvl-56)+(.2+.05*math.floor((lvl+5)/6))*ap TypeDmg = 2
  783.             elseif spellname == "Q" then DmgM = 45*Qlvl+30+.65*ap
  784.             elseif spellname == "W" then DmgM = 35*Wlvl+35+.35*ap
  785.             elseif spellname == "E" then DmgM = 25*Elvl+15+.3*ap --xmine , 40% damage from additional mines
  786.             elseif spellname == "R" then DmgM = 125*Rlvl+125+.9*ap --enemies away from the primary blast zone will take 80% damage
  787.             end
  788.         elseif name == "Zilean" then
  789.             if spellname == "Q" then DmgM = 57.5*Qlvl+32.5+.9*ap
  790.             end
  791.         elseif name == "Zyra" then
  792.             if spellname == "P" then DmgT = 80+20*lvl
  793.             elseif spellname == "Q" then DmgM = 35*Qlvl+35+.65*ap
  794.             elseif spellname == "W" then DmgM = 23+6.5*lvl+.2*ap --xstrike Extra plants striking the same target deal 50% less damage
  795.             elseif spellname == "E" then DmgM = 35*Elvl+25+.5*ap
  796.             elseif spellname == "R" then DmgM = 85*Rlvl+95+.7*ap
  797.             end
  798.         end
  799.         if DmgM > 0 then DmgM = CalcMagicDamage(target,DmgM) end
  800.         if DmgP > 0 then DmgP = CalcDamage(target,DmgP) end
  801.         TrueDmg = DmgM+DmgP+DmgT
  802.     elseif (spellname == "AD") then
  803.         TrueDmg = CalcDamage(target,ad)
  804.     elseif (spellname == "IGNITE") then
  805.         TrueDmg = 50+20*lvl
  806.     elseif (spellname == "DFG") then
  807.         TrueDmg = CalcMagicDamage(target,.15*tmhp)
  808.     elseif (spellname == "HXG") then
  809.         TrueDmg = CalcMagicDamage(target,150+.4*ap)
  810.     elseif (spellname == "BWC") then
  811.         TrueDmg = CalcMagicDamage(target,100)
  812.     elseif (spellname == "KITAES") then
  813.         TrueDmg = CalcMagicDamage(target,.025*tmhp)
  814.     elseif (spellname == "NTOOTH") then
  815.         TrueDmg = CalcMagicDamage(target,15+.15*ap)
  816.     elseif (spellname == "WITSEND") then
  817.         TrueDmg = CalcMagicDamage(target,42)
  818.     elseif (spellname == "SHEEN") then
  819.         TrueDmg = CalcDamage(target,ad-bad) --(bonus)
  820.     elseif (spellname == "TRINITY") then
  821.         TrueDmg = CalcDamage(target,2*(ad-bad)) --(bonus)
  822.     elseif (spellname == "LICHBANE") then
  823.         TrueDmg = CalcMagicDamage(target,.75*(ad-bad)+.5*ap) --(bonus)
  824.     elseif (spellname == "LIANDRYS") then
  825.         TrueDmg = CalcMagicDamage(target,.06*thp) --over 3 sec, If their movement is impaired, they take double damage from this effect
  826.     elseif (spellname == "BLACKFIRE") then
  827.         TrueDmg = CalcMagicDamage(target,.035*tmhp) --over 2 sec
  828.     elseif (spellname == "STATIKK") then
  829.         TrueDmg = CalcMagicDamage(target,100)
  830.     elseif (spellname == "ICEBORN") then
  831.         TrueDmg = CalcDamage(target,1.25*(ad-bad)) --(bonus)
  832.     elseif (spellname == "TIAMAT") then
  833.         TrueDmg = CalcDamage(target,.6*ad) --decaying down to 33.33% near the edge (20% of ad)
  834.     elseif (spellname == "HYDRA") then
  835.         TrueDmg = CalcDamage(target,.6*ad) --decaying down to 33.33% near the edge (20% of ad)
  836.     elseif (spellname == "RUINEDKING") then
  837.         TrueDmg = math.max(CalcDamage(target,.08*thp)*(stagedmg1+stagedmg3),CalcDamage(target,math.max(.1*tmhp,100))*stagedmg2) --stage1-3:Passive. stage2:Active.
  838.     elseif (spellname == "MURAMANA") then
  839.         TrueDmg = CalcDamage(target,.06*mana)
  840.     elseif (spellname == "HURRICANE") then
  841.         TrueDmg = CalcDamage(target,10+.5*ad) --apply on-hit effects
  842.     elseif (spellname == "SPIRITLIZARD") then
  843.         TrueDmg = 14+2*lvl --over 3 sec
  844.     elseif (spellname == "SUNFIRE") then
  845.         TrueDmg = CalcMagicDamage(target,25+lvl) --x sec
  846.     elseif (spellname == "LIGHTBRINGER") then
  847.         TrueDmg = CalcMagicDamage(target,100) -- 20% chance
  848.     elseif (spellname == "MOUNTAIN") then
  849.         TrueDmg = CalcMagicDamage(target,.3*ap+ad)
  850.     elseif (spellname == "ISPARK" or spellname == "MADREDS" or spellname == "ECALLING" or spellname == "EXECUTIONERS" or spellname == "MALADY") then
  851.         TrueDmg = 0
  852.     else
  853.         DrawText("Error spellDmg " .. name .. " ".. spellname,10,40,0xFFFFFF00)
  854.         TrueDmg = 0
  855.     end
  856.     return TrueDmg, TypeDmg
  857. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement