forked from Eroica-cpp/dota2scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNyx.lua
26 lines (19 loc) · 1.14 KB
/
Nyx.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
local Nyx = {}
Nyx.optionCombo = Menu.AddOption({"Hero Specific", "Nyx Assassin"}, "Attack & Impale Combo", "use impale right after attack that break invisible")
-- use impale right after attack that break invisible
function Nyx.OnPrepareUnitOrders(orders)
if not Menu.IsEnabled(Nyx.optionCombo) then return true end
if not orders or not orders.order then return true end
local myHero = Heroes.GetLocal()
if not myHero or NPC.GetUnitName(myHero) ~= "npc_dota_hero_nyx_assassin" then return true end
if NPC.IsStunned(myHero) or NPC.IsSilenced(myHero) then return true end
if not NPC.HasModifier(myHero, "modifier_nyx_assassin_vendetta") then return true end
if orders.order ~= Enum.UnitOrder.DOTA_UNIT_ORDER_ATTACK_TARGET and orders.order ~= Enum.UnitOrder.DOTA_UNIT_ORDER_ATTACK_MOVE then return true end
local impale = NPC.GetAbilityByIndex(myHero, 0)
if not impale or not Ability.IsCastable(impale, NPC.GetMana(myHero)) then return true end
if not orders.target then return true end
-- Player.AttackTarget(Players.GetLocal(), myHero, orders.target)
-- Ability.CastPosition(impale, Entity.GetAbsOrigin(orders.target))
return true
end
return Nyx