Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- need to reload several times
- -- increase the wait time before casting next net
- -- it casts net only the main meepo is in the range. If you try with meepo 2 and 3 then it won't work.
- local alpha_meepo = {
- enabled = Menu.AddOption({"Alpha Meepo"}, "Cast net", "If you want your meepos to cast nets"),
- comoboKey= Menu.AddKeyOption({"Alpha Meepo"}, "Combo Key", Enum.ButtonCode.BUTTON_CODE_NONE)
- }
- alpha_meepo.lastTick = 0
- alpha_meepo.one = nil
- alpha_meepo.two = nil
- alpha_meepo.three = nil
- function alpha_meepo.OnUpdate()
- if not Menu.IsEnabled(alpha_meepo.enabled) then return end
- local myHero = Heroes.GetLocal()
- if not myHero or NPC.GetUnitName(myHero) ~= "npc_dota_hero_meepo" then return end
- local enemy = Input.GetNearestHeroToCursor(Entity.GetTeamNum(myHero), Enum.TeamType.TEAM_ENEMY)
- -- finding all meepos
- local ultimate = NPC.GetAbility(myHero, "meepo_divided_we_stand")
- if alpha_meepo.one == nil and ultimate and Ability.GetLevel(ultimate)>0 then
- for i= 1, NPCs.Count() do
- local entity = NPCs.Get(i)
- if entity then
- local name = NPC.GetUnitName(entity)
- if name == "npc_dota_hero_meepo" and myHero~= entity and alpha_meepo.two ~= entity and alpha_meepo.three ~= entity then
- alpha_meepo.one = entity
- end
- end
- end
- return
- end
- if alpha_meepo.two == nil and ultimate and Ability.GetLevel(ultimate)>1 then
- for i= 1, NPCs.Count() do
- local entity = NPCs.Get(i)
- if entity then
- local name = NPC.GetUnitName(entity)
- if name == "npc_dota_hero_meepo" and myHero~= entity and alpha_meepo.one ~= entity and alpha_meepo.three ~= entity then
- alpha_meepo.two = entity
- end
- end
- end
- return
- end
- if alpha_meepo.three == nil and ultimate and Ability.GetLevel(ultimate)>2 then
- for i= 1, NPCs.Count() do
- local entity = NPCs.Get(i)
- if entity then
- local name = NPC.GetUnitName(entity)
- if name == "npc_dota_hero_meepo" and myHero~= entity and alpha_meepo.two ~= entity and alpha_meepo.one ~= entity then
- alpha_meepo.three = entity
- end
- end
- end
- return
- end
- if Menu.IsEnabled(alpha_meepo.enabled) then
- alpha_meepo.Combo(myHero,enemy)
- end
- end
- ---------- Main combo
- function alpha_meepo.Combo(myHero, enemy)
- -- get net for all meepos
- local net = NPC.GetAbility(myHero, "meepo_earthbind")
- local net1 = nil
- local net2 = nil
- local net3 = nil
- if alpha_meepo.one ~= nil then
- net1 = NPC.GetAbility(alpha_meepo.one, "meepo_earthbind")
- end
- if alpha_meepo.two ~= nil then
- net2 = NPC.GetAbility(alpha_meepo.two, "meepo_earthbind")
- end
- if alpha_meepo.three ~= nil then
- net3 = NPC.GetAbility(alpha_meepo.three, "meepo_earthbind")
- end
- if Menu.IsKeyDown(alpha_meepo.comoboKey) and Entity.GetHealth(enemy) > 0 then
- if NPC.IsEntityInRange(myHero, enemy, Ability.GetCastRange(net)) then
- if net and Ability.IsReady(net) then
- local netPrediction = Ability.GetCastPoint(net) + (Entity.GetAbsOrigin(enemy):__sub(Entity.GetAbsOrigin(myHero)):Length2D() / 1000) + (NetChannel.GetAvgLatency(Enum.Flow.FLOW_OUTGOING) * 2)
- Ability.CastPosition(net, alpha_meepo.castLinearPrediction(myHero, enemy, netPrediction))
- Player.AttackTarget(Players.GetLocal(), myHero, enemy)
- alpha_meepo.lastTick = os.clock()
- end
- if net1 and alpha_meepo.SleepReady(1.4) and Ability.IsReady(net1) then
- local netPrediction = Ability.GetCastPoint(net1) + (Entity.GetAbsOrigin(enemy):__sub(Entity.GetAbsOrigin(myHero)):Length2D() / 1000) + (NetChannel.GetAvgLatency(Enum.Flow.FLOW_OUTGOING) * 2)
- Ability.CastPosition(net1, alpha_meepo.castLinearPrediction(myHero, enemy, netPrediction))
- Player.AttackTarget(Players.GetLocal(), alpha_meepo.one, enemy)
- alpha_meepo.lastTick = os.clock()
- return
- end
- if net2 and alpha_meepo.SleepReady(1.5) and Ability.IsReady(net2) then
- local netPrediction = Ability.GetCastPoint(net2) + (Entity.GetAbsOrigin(enemy):__sub(Entity.GetAbsOrigin(myHero)):Length2D() / 1000) + (NetChannel.GetAvgLatency(Enum.Flow.FLOW_OUTGOING) * 2)
- Ability.CastPosition(net2, alpha_meepo.castLinearPrediction(myHero, enemy, netPrediction))
- Player.AttackTarget(Players.GetLocal(), alpha_meepo.two, enemy)
- alpha_meepo.lastTick = os.clock()
- return
- end
- if net3 and alpha_meepo.SleepReady(1.5) and Ability.IsReady(net3) then
- local netPrediction = Ability.GetCastPoint(net3) + (Entity.GetAbsOrigin(enemy):__sub(Entity.GetAbsOrigin(myHero)):Length2D() / 1000) + (NetChannel.GetAvgLatency(Enum.Flow.FLOW_OUTGOING) * 2)
- Ability.CastPosition(net3, alpha_meepo.castLinearPrediction(myHero, enemy, netPrediction))
- Player.AttackTarget(Players.GetLocal(), alpha_meepo.three, enemy)
- alpha_meepo.lastTick = os.clock()
- return
- end
- end
- --Player.AttackTarget(Players.GetLocal(), myHero, enemy)
- end
- end
- function alpha_meepo.SleepReady(sleep)
- if (os.clock() - alpha_meepo.lastTick) >= sleep then
- return true
- end
- return false
- end
- function alpha_meepo.castLinearPrediction(myHero, enemy, adjustmentVariable)
- if not myHero then return end
- if not enemy then return end
- local enemyRotation = Entity.GetRotation(enemy):GetVectors()
- enemyRotation:SetZ(0)
- local enemyOrigin = Entity.GetAbsOrigin(enemy)
- enemyOrigin:SetZ(0)
- local cosGamma = (Entity.GetAbsOrigin(myHero) - enemyOrigin):Dot2D(enemyRotation:Scaled(100)) / ((Entity.GetAbsOrigin(myHero) - enemyOrigin):Length2D() * enemyRotation:Scaled(100):Length2D())
- if enemyRotation and enemyOrigin then
- if not NPC.IsRunning(enemy) then
- return enemyOrigin
- else return enemyOrigin:__add(enemyRotation:Normalized():Scaled(NPC.GetMoveSpeed(enemy) * adjustmentVariable * (1 - cosGamma)))
- end
- end
- end
- return alpha_meepo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement