Advertisement
npsoni

meepo

May 19th, 2021
1,102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.85 KB | None | 0 0
  1. -- need to reload several times
  2. -- increase the wait time before casting next net
  3. -- it casts net only the main meepo is in the range. If you try with meepo 2 and 3 then it won't work.
  4.  
  5. local alpha_meepo = {
  6.     enabled = Menu.AddOption({"Alpha Meepo"}, "Cast net", "If you want your meepos to cast nets"),
  7.     comoboKey= Menu.AddKeyOption({"Alpha Meepo"}, "Combo Key", Enum.ButtonCode.BUTTON_CODE_NONE)
  8. }
  9.  
  10. alpha_meepo.lastTick = 0
  11. alpha_meepo.one = nil
  12. alpha_meepo.two = nil
  13. alpha_meepo.three = nil
  14.  
  15. function alpha_meepo.OnUpdate()
  16.     if not Menu.IsEnabled(alpha_meepo.enabled) then return end
  17.     local myHero = Heroes.GetLocal()
  18.     if not myHero or NPC.GetUnitName(myHero) ~= "npc_dota_hero_meepo" then return end
  19.     local enemy = Input.GetNearestHeroToCursor(Entity.GetTeamNum(myHero), Enum.TeamType.TEAM_ENEMY)
  20.  
  21.  
  22.     -- finding all meepos
  23.     local ultimate = NPC.GetAbility(myHero, "meepo_divided_we_stand")
  24.     if alpha_meepo.one == nil and ultimate and Ability.GetLevel(ultimate)>0 then
  25.         for i= 1, NPCs.Count() do
  26.             local entity = NPCs.Get(i)
  27.             if entity then
  28.                 local name = NPC.GetUnitName(entity)
  29.                 if name == "npc_dota_hero_meepo" and myHero~= entity and alpha_meepo.two ~= entity  and alpha_meepo.three ~= entity then
  30.                     alpha_meepo.one  = entity
  31.                 end
  32.             end
  33.         end
  34.         return
  35.     end
  36.     if alpha_meepo.two == nil and ultimate and Ability.GetLevel(ultimate)>1 then
  37.         for i= 1, NPCs.Count() do
  38.             local entity = NPCs.Get(i)
  39.             if entity then
  40.                 local name = NPC.GetUnitName(entity)
  41.                 if name == "npc_dota_hero_meepo" and myHero~= entity and alpha_meepo.one ~= entity  and alpha_meepo.three ~= entity then
  42.                     alpha_meepo.two  = entity
  43.                 end
  44.             end
  45.         end
  46.         return
  47.     end
  48.    
  49.     if alpha_meepo.three == nil and ultimate and Ability.GetLevel(ultimate)>2 then
  50.         for i= 1, NPCs.Count() do
  51.             local entity = NPCs.Get(i)
  52.             if entity then
  53.                 local name = NPC.GetUnitName(entity)
  54.                 if name == "npc_dota_hero_meepo" and myHero~= entity and alpha_meepo.two ~= entity  and alpha_meepo.one ~= entity then
  55.                     alpha_meepo.three  = entity
  56.                 end
  57.             end
  58.         end
  59.         return
  60.     end
  61.  
  62.     if Menu.IsEnabled(alpha_meepo.enabled) then
  63.         alpha_meepo.Combo(myHero,enemy)
  64.     end
  65.  
  66. end
  67.  
  68.  
  69. ---------- Main combo
  70.  
  71. function alpha_meepo.Combo(myHero, enemy)
  72.  
  73.     -- get net for all meepos
  74.     local net = NPC.GetAbility(myHero, "meepo_earthbind")
  75.     local net1 = nil
  76.     local net2 = nil
  77.     local net3 = nil
  78.  
  79.  
  80.    
  81.     if alpha_meepo.one ~= nil then
  82.         net1 = NPC.GetAbility(alpha_meepo.one, "meepo_earthbind")          
  83.     end
  84.     if alpha_meepo.two ~= nil then
  85.         net2 = NPC.GetAbility(alpha_meepo.two, "meepo_earthbind")          
  86.     end
  87.     if alpha_meepo.three ~= nil then
  88.         net3 = NPC.GetAbility(alpha_meepo.three, "meepo_earthbind")        
  89.     end
  90.  
  91.     if Menu.IsKeyDown(alpha_meepo.comoboKey) and Entity.GetHealth(enemy) > 0  then
  92.         if NPC.IsEntityInRange(myHero, enemy, Ability.GetCastRange(net)) then
  93.  
  94.            
  95.             if net and Ability.IsReady(net) then
  96.                 local netPrediction = Ability.GetCastPoint(net) + (Entity.GetAbsOrigin(enemy):__sub(Entity.GetAbsOrigin(myHero)):Length2D() / 1000) + (NetChannel.GetAvgLatency(Enum.Flow.FLOW_OUTGOING) * 2)
  97.                 Ability.CastPosition(net, alpha_meepo.castLinearPrediction(myHero, enemy, netPrediction))
  98.                 Player.AttackTarget(Players.GetLocal(), myHero, enemy)
  99.                 alpha_meepo.lastTick = os.clock()
  100.             end
  101.             if net1 and alpha_meepo.SleepReady(1.4) and Ability.IsReady(net1) then
  102.                 local netPrediction = Ability.GetCastPoint(net1) + (Entity.GetAbsOrigin(enemy):__sub(Entity.GetAbsOrigin(myHero)):Length2D() / 1000) + (NetChannel.GetAvgLatency(Enum.Flow.FLOW_OUTGOING) * 2)
  103.                 Ability.CastPosition(net1, alpha_meepo.castLinearPrediction(myHero, enemy, netPrediction))
  104.                 Player.AttackTarget(Players.GetLocal(), alpha_meepo.one, enemy)
  105.                 alpha_meepo.lastTick = os.clock()
  106.                 return
  107.             end
  108.             if net2 and alpha_meepo.SleepReady(1.5) and Ability.IsReady(net2) then
  109.                 local netPrediction = Ability.GetCastPoint(net2) + (Entity.GetAbsOrigin(enemy):__sub(Entity.GetAbsOrigin(myHero)):Length2D() / 1000) + (NetChannel.GetAvgLatency(Enum.Flow.FLOW_OUTGOING) * 2)
  110.                 Ability.CastPosition(net2, alpha_meepo.castLinearPrediction(myHero, enemy, netPrediction))
  111.                 Player.AttackTarget(Players.GetLocal(), alpha_meepo.two, enemy)
  112.                 alpha_meepo.lastTick = os.clock()
  113.                 return
  114.             end
  115.             if net3 and alpha_meepo.SleepReady(1.5) and Ability.IsReady(net3) then
  116.                 local netPrediction = Ability.GetCastPoint(net3) + (Entity.GetAbsOrigin(enemy):__sub(Entity.GetAbsOrigin(myHero)):Length2D() / 1000) + (NetChannel.GetAvgLatency(Enum.Flow.FLOW_OUTGOING) * 2)
  117.                 Ability.CastPosition(net3, alpha_meepo.castLinearPrediction(myHero, enemy, netPrediction))
  118.                 Player.AttackTarget(Players.GetLocal(), alpha_meepo.three, enemy)
  119.                 alpha_meepo.lastTick = os.clock()
  120.                 return
  121.             end
  122.         end
  123.     --Player.AttackTarget(Players.GetLocal(), myHero, enemy)
  124.     end
  125. end
  126.  
  127. function alpha_meepo.SleepReady(sleep)
  128.  
  129.     if (os.clock() - alpha_meepo.lastTick) >= sleep then
  130.         return true
  131.     end
  132.     return false
  133.  
  134. end
  135.  
  136. function alpha_meepo.castLinearPrediction(myHero, enemy, adjustmentVariable)
  137.  
  138.     if not myHero then return end
  139.     if not enemy then return end
  140.  
  141.     local enemyRotation = Entity.GetRotation(enemy):GetVectors()
  142.         enemyRotation:SetZ(0)
  143.         local enemyOrigin = Entity.GetAbsOrigin(enemy)
  144.         enemyOrigin:SetZ(0)
  145.  
  146.  
  147.     local cosGamma = (Entity.GetAbsOrigin(myHero) - enemyOrigin):Dot2D(enemyRotation:Scaled(100)) / ((Entity.GetAbsOrigin(myHero) - enemyOrigin):Length2D() * enemyRotation:Scaled(100):Length2D())
  148.  
  149.         if enemyRotation and enemyOrigin then
  150.             if not NPC.IsRunning(enemy) then
  151.                 return enemyOrigin
  152.             else return enemyOrigin:__add(enemyRotation:Normalized():Scaled(NPC.GetMoveSpeed(enemy) * adjustmentVariable * (1 - cosGamma)))
  153.             end
  154.         end
  155. end
  156.  
  157. return alpha_meepo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement