require 'Utils' require 'vals_lib' require 'hunter_libs' local Q,W,E,R = 'Q','W','E','R' local target local position=0 local times=0 local dmg=0 local truetimes=0 local Wave=0 local MConfig = scriptConfig("Samipote's Mf", "Miss Fortune") MConfig:addParam("combo", "Main Switch", SCRIPT_PARAM_ONOFF,true) TargetSelector(LESS_CAST) function OnTick() target= getTSTarget(1400) if R()==false then UnblockOrders() end GetCD() if MConfig.combo then Combo() end end function Combo() W() Q() if target~=nil then E() end R() end function W() if WRDY==1 then if target~=nil and GetDistance(myHero,target)<=550 then CastSpellTarget("W",myHero) end end end function Q() if QRDY==1 then if target~=nil and GetDistance(myHero,target)<=650 then CastSpellTarget("Q",target) end end end function E() if ERDY==1 then if target~=nil and GetDistance(myHero,target)<=800 and VTarget(target, 800, true) and (QRDY==0 or GetDistance(myHero,target)>650) and Kill(E,target)==true then CastSpellTarget("E",target) elseif target~=nil and GetDistance(myHero,target)<=750 and VTarget(target, 750, true) and myHero.mana>=myHero.mana*0.3 and IsRunning(target, AWAY) or (myHero.health<=target.health and IsRunning(target, YOU)) then CastSpellTarget("E",target) end end end function R() if RRDY==1 then if target~=nil and GetDistance(myHero,target)<=1400 and VTarget(target, 1400, true) and (QRDY==0 or GetDistance(myHero,target)>650 or Kill(Q,target)==false) and Kill(R,target)==true then BlockOrders() CastSpellXYZ("R",target.x,target.y,target.z) return true end else return false end end function Kill(spell,cible) GetWave() if cible~=nil and spell~=nil and VTarget(cible, 1400, true) then if spell==Q then dmg=CalcDamage(cible,(math.floor(myHero.SpellLevelQ - 1) * 15 + 20 + (myHero.ap * 0.35)+(myHero.baseDamage*0.85)*QRDY)) end if spell==E then dmg=CalcDamage(cible,(math.floor(myHero.SpellLevelE - 1) * 55 + 90 + (myHero.ap * 0.80)*ERDY)) end if spell==R then dmg=CalcDamage(cible,(math.floor(myHero.SpellLevelR - 1) * 25 + 50 + (myHero.ap * 0.20)*RRDY))*Wave end if dmg>cible.health then return true else return false end end end function GetWave() for i = 1, objManager:GetMaxHeroes() do local enemy = objManager:GetHero(i) if enemy~=nil and GetDistance(myHero,enemy)<=1400 then position=1400-GetDistance(myHero,enemy) times=position/enemy.attackspeed truetimes=times/100 end if truetimes>2 then Wave=8 elseif truetimes>1.75 then Wave=7 elseif truetimes>1.50 then Wave=6 elseif truetimes>1.25 then Wave=5 elseif truetimes>1 then Wave=4 elseif truetimes>0.75 then Wave=3 elseif truetimes>0.50 then Wave=2 elseif truetimes>0.25 then Wave=1 elseif truetimes>0 then Wave=0 end end end SetTimerCallback("OnTick")