-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmagery_trainer.py
53 lines (41 loc) · 1.4 KB
/
magery_trainer.py
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
# magery trainer
class SpellStat:
def __init__(self, minimum, code, circle, target=None):
self.minimum = minimum
self.code = code
self.circle = circle
self.target = target
spells = [
SpellStat(90.0, 'Earthquake', 8),
SpellStat(75.0, 'Mana Vampire', 7, 'self'),
SpellStat(65.0, 'Invisibility', 6, 'self'),
SpellStat(55.0, 'Magic Reflection', 5),
SpellStat(45.0, 'Curse', 4, 'self'),
SpellStat(29.0, 'Bless', 3, 'self'),
]
circleMana = [0, 4, 6, 9, 11, 14, 20, 40, 50]
circleDelay = lambda x: (0.25 + x * 0.25) * 1000
circleRecovery = lambda x: (0.25 + x * 0.7) * 1000
lmc = Player.SumAttribute("Lower Mana Cost")
def waitForMana(circle):
return int(circleMana[circle] * (1.0 - lmc / 100.0))
while Player.GetRealSkillValue('Magery') < Player.GetSkillCap('Magery'):
skill_value = Player.GetSkillValue('Magery')
spell = None
for s in spells:
if skill_value >= s.minimum:
spell = s
break
if not spell:
break
while Player.Mana < waitForMana(spell.circle):
Player.UseSkill('Meditation')
Misc.Pause(4000)
Spells.CastMagery(spell.code)
if spell.target:
Target.WaitForTarget(circleDelay(spell.circle))
if spell.target == 'self':
Target.Self()
elif spell.target == 'last':
Target.Last()
Misc.Pause(circleRecovery(spell.circle))