ak77now

spellDmg.lua

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