Advertisement
Guest User

Total Minnion Map and Total Minion Lane Stats

a guest
Jul 6th, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.46 KB | None | 0 0
  1. local EnemyMinions = minionManager(MINION_ENEMY, 2000, myHero, MINION_SORT_HEALTH_ASC)
  2.  
  3. function OnProcessSpell(object,spell)
  4.     local spellName,spellLevel,P1,P2 = spell.name,spell.level,spell.startPos,spell.endPos
  5.     if object~=nil and not myHero.dead and object==myHero then
  6.         EnemyMinions:update()
  7.         for i,e in pairs(EnemyMinions.objects) do
  8.             local allytarget = e
  9.             local shieldflag = shieldCheck(object,spellName,allytarget,spellLevel,P1,P2)
  10.            
  11.         end
  12.     end
  13. end
  14. function shieldCheck(object,spellName,target,spellLevel,P1,P2)
  15.     local shottype,radius,maxdistance = 0,0,0
  16.     local hitchampion = false
  17.    
  18.     if object.type ~= "obj_AI_Hero" then
  19.        
  20.         local spelltype, casttype = getSpellType(object, spellName)
  21.         -- PrintChat(spelltype)
  22.         if spelltype == "Q" or spelltype == "W" or spelltype == "E" or spelltype == "R" or spelltype == "P" or spelltype == "QM" or spelltype == "WM" or spelltype == "EM" then
  23.             shottype = skillData[object.charName][spelltype]["type"]
  24.             radius = skillData[object.charName][spelltype]["radius"]
  25.             maxdistance = skillData[object.charName][spelltype]["maxdistance"]
  26.            
  27.         end
  28.         local allyHitBox = target.boundingRadius
  29.        
  30.         if shottype == 0 then hitchampion = true
  31.             elseif shottype == 1 then hitchampion = checkhitlinepass(object, P2, radius, maxdistance, target, allyHitBox)
  32.             elseif shottype == 2 then hitchampion = checkhitlinepoint(object, P2, radius, maxdistance, target, allyHitBox)
  33.             elseif shottype == 3 then hitchampion = checkhitaoe(object, P2, radius, maxdistance, target, allyHitBox)
  34.             elseif shottype == 4 then hitchampion = checkhitcone(object, P2, radius, maxdistance, target, allyHitBox)
  35.             elseif shottype == 5 then hitchampion = checkhitwall(object, P2, radius, maxdistance, target, allyHitBox)
  36.             elseif shottype == 6 then hitchampion = checkhitlinepass(object, P2, radius, maxdistance, target, allyHitBox) or checkhitlinepass(object, Vector(object)*2-spell.endPos, radius, maxdistance, target, allyHitBox)
  37.             elseif shottype == 7 then hitchampion = checkhitcone(P2, object, radius, maxdistance, target, allyHitBox)
  38.         end
  39.         if hitchampion==true then
  40.             PrintChat(tostring(target.name))
  41.         end
  42.     end
  43.     return spelltype
  44. end
  45. --Minion_T100L1S21N0132--
  46. local maxminion=0
  47. local minions={}
  48. local maxm=0
  49. local bl=true
  50. local firstdelete=0
  51. function OnCreateObj(object)
  52.     if object ~= nil and object.valid and string.find(object.name,"Minion_T") then
  53.         if tonumber(string.sub(tostring(object.name), 19, 21))>tonumber(maxm) then
  54.             maxm=string.sub(tostring(object.name), 19, 21)
  55.             maxminion=maxm+1
  56.         end
  57.     end
  58. end
  59.  
  60. function OnDeleteObj(object)
  61.     if object ~= nil and object.valid and string.find(object.name,"Minion_T") then
  62.         -- if bl==true then
  63.             -- firstdelete=string.sub(tostring(object.name), 19, 21)-1
  64.             -- bl=false
  65.         -- end
  66.         if minions[object.team]==nil then
  67.             minions[object.team]={}
  68.         end
  69.         if minions[object.team][string.sub(tostring(object.name), 12, 13)]==nil then
  70.             minions[object.team][string.sub(tostring(object.name), 12, 13)]=0
  71.         end
  72.         minions[object.team][string.sub(tostring(object.name), 12, 13)]=minions[object.team][string.sub(tostring(object.name), 12, 13)]+1
  73.         -- PrintChat(tostring(maxminion))
  74.     end
  75. end
  76.  
  77.  
  78. local color,x,y,lane
  79.  
  80. function OnDraw()
  81.     if minions ~= nil then
  82.     for i,k in pairs(minions) do
  83.         for j,kl in pairs(minions[i]) do
  84.             if i==TEAM_BLUE then
  85.                 color=0xff0000ff
  86.                 x=10
  87.                 elseif i==TEAM_RED then
  88.                 color=0xffff0000
  89.                 x=100
  90.             end
  91.             if j=="L0" then
  92.                 y=90
  93.                 lane="Bot"
  94.                 elseif j=="L1" then
  95.                 y=105
  96.                 lane="Mid"
  97.                 elseif j=="L2" then
  98.                 y=120
  99.                 lane="Top"
  100.             end
  101.             DrawText(lane.." Lane:"..(maxminion-kl),16,x,y,color)
  102.            
  103.         end
  104.        
  105.     end
  106. end
  107. DrawText("Maximum Minion:"..maxminion,16,10,75,0xff00ff00)
  108.     end
  109.    
  110. function OnLoad()
  111.     -- maxming=0
  112.     -- maxmingr={}
  113.    
  114.     -- for i = 1, objManager.iCount, 1 do
  115.         -- local obj = objManager:getObject(i)
  116.         -- if obj ~= nil and string.find(obj.name,"Minion") then
  117.         -- PrintChat(obj.name)
  118.         -- if tonumber(string.sub(tostring(obj.name), 19, 21))>tonumber(maxm) then
  119.             -- maxm=string.sub(tostring(obj.name), 19, 21)
  120.             -- maxminion=maxm
  121.         -- end
  122.         -- end
  123.         -- end
  124.     -- for i = 1, objManager.iCount, 1 do
  125.         -- local obj = objManager:getObject(i)
  126.         -- if obj ~= nil and string.find(obj.name,"Minion_T") then
  127.             -- if tonumber(string.sub(tostring(obj.name), 15, 16))>maxming then
  128.                 -- maxming=tonumber(string.sub(tostring(obj.name), 15, 16))
  129.             -- end
  130.             -- if minions[obj.team]==nil then
  131.                 -- minions[obj.team]={}
  132.             -- end
  133.             -- if minions[obj.team][string.sub(tostring(obj.name), 12, 13)]==nil then
  134.                 -- minions[obj.team][string.sub(tostring(obj.name), 12, 13)]=0
  135.             -- end
  136.             -- if obj.team==TEAM_RED then
  137.             -- if maxmingr[string.sub(tostring(obj.name), 12, 13)]==nil then
  138.             -- maxmingr[string.sub(tostring(obj.name), 12, 13)]=0
  139.             -- end
  140.                 -- if tonumber(string.sub(tostring(obj.name), 15, 16))>maxmingr[string.sub(tostring(obj.name), 12, 13)] then
  141.                 -- maxmingr[string.sub(tostring(obj.name), 12, 13)]=tonumber(string.sub(tostring(obj.name), 15, 16))
  142.                 -- end
  143.             -- end
  144.             -- minions[obj.team][string.sub(tostring(obj.name), 12, 13)]=-minions[obj.team][string.sub(tostring(obj.name), 12, 13)]-1
  145.         -- end
  146.     -- end
  147.     -- for i,k in pairs(minions) do
  148.         -- for j,kl in pairs(minions[i]) do
  149.         -- PrintChat(i..j.."-"..kl)
  150.             -- if i==TEAM_RED then
  151.             -- for k,lane in pairs(minions) do
  152.                 -- if j==k then
  153.                     -- kl=kl-6*(maxming-lane)
  154.                 -- end
  155.             -- end 
  156.         -- end     
  157.         -- end
  158.         -- end
  159.         end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement