-
Notifications
You must be signed in to change notification settings - Fork 2
/
cassiOPeiaYP.lua
93 lines (84 loc) · 3.12 KB
/
cassiOPeiaYP.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
-- Mad's cassiOPeia preview 1 --
-- USED LIBS --
local uiconfig = require 'uiconfig'
require "hunter_libs"
require "coneCalc"
require "spell_damage"
local yayo = require "yayo"
require 'yprediction'
local YP = YPrediction()
-- YAYO STUFF --
yayo.RegisterBeforeAttackCallback(BeforeAttack)
yayo.RegisterOnAttackCallback(OnAttack)
yayo.RegisterAfterAttackCallback(AfterAttack)
-- CASSIOPEIA CONFIG --
CassiopeiaConfig, cfg = uiconfig.add_menu("Mad's Cassiopeia Config")
cfg.keydown('ForceUlt', 'Force Smart Ult', string.byte("A"))
cfg.slider('Ult2Win','Enemies to Smart Ult',0,5,3)
local AARange = getAARange()
local Cassiopeia = {Skills = {Q = {range = 850, delay = 6, radius = 75, speed = 20}, W = {range = 850, radius = 125, speed = 20}, E = {range = 700}, R = {radius = 825, theta = 80}}}
TargetSelector(DAMAGE_MAGIC, LESS_CAST, true)
function CastSpellVector(spell, vector)
CastSpellXYZ(spell, vector.x, vector.y, vector.z)
end
function IsPoisoned(target)
for i = 1, objManager:GetMaxObjects(), 1 do
obj = objManager:GetObject(i)
if obj~=nil and string.find(obj.charName,"oison") and GetDistance(obj, target) < 100 then
return true
end
end
end
function Q(target)
if VTarget(target, Cassiopeia.Skills.Q.range, true) then
local mainCastPosition, mainHitChance, points, mainPosition = YP:GetCircularAOECastPosition(target, Cassiopeia.Skills.Q.delay, Cassiopeia.Skills.Q.radius, Cassiopeia.Skills.Q.range, Cassiopeia.Skills.Q.speed, myHero, false)
if mainPosition and HitChance >= 2 then
CastSpellVector("Q", mainCastPosition)
end
end
end
function W(target)
if VTarget(target, Cassiopeia.Skills.W.range, true) then
local mainCastPosition, mainHitChance, points, mainPosition = YP:GetCircularAOECastPosition(target, 0, Cassiopeia.Skills.W.radius, Cassiopeia.Skills.W.range, Cassiopeia.Skills.W.speed, myHero, false)
if mainPosition and HitChance >= 2 then
CastSpellVector("W", mainCastPosition)
end
end
end
function E(target)
if VTarget(target, Cassiopeia.Skills.E.range, true) and IsPoisoned(target) or VTarget(target, Cassiopeia.Skills.E.range, true) and getDmg("E",target,myHero) >= target.health then
CastSpellTarget("E", target)
end
end
function AutoR()
conePred = GetCone(Cassiopeia.Skills.R.radius, Cassiopeia.Skills.R.theta)
if conePred ~= nil then
CastSpellVector("R", conePred)
end
end
function Combo(target)
if target ~= nil then
if yayo.Config.AutoCarry then
E(target)
if not IsPoisoned(target) and getDmg("E",target,myHero) < target.health then
W(target)
end
if not IsPoisoned(target) and getDmg("E",target,myHero) < target.health then
Q(target)
end
end
end
end
function OnTick()
local target = getTSTarget(Cassiopeia.Skills.E.range)
local target2 = getTSTarget(Cassiopeia.Skills.Q.range)
if target == nil and target2 ~= nil then
target = target2
end
Combo(target)
if CassiopeiaConfig.Ult2Win ~= 0 and CountEnemyHeroInRange(Cassiopeia.Skills.R.radius) >= CassiopeiaConfig.Ult2Win then
AutoR()
end
if CassiopeiaConfig.ForceUlt then AutoR() end
end
SetTimerCallback('OnTick')