-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbattle_MainLoop.py
85 lines (52 loc) · 2.03 KB
/
battle_MainLoop.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
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
from System.Collections.Generic import List
from System import Byte
LastSpmSecondary = False
def consecrateWeapon():
if Timer.Check("ConsecDelay") or Player.BuffsExist('Consecrate Weapon'): return
if Player.ManaMax * 0.5 < Player.Mana:
Spells.CastChivalry('Consecrate Weapon')
Timer.Create("ConsecDelay", 2000)
def divineFury():
if Timer.Check("DivineDelay") or Player.BuffsExist('Divine Fury'): return
if Player.ManaMax * 0.5 < Player.Mana:
if Player.Stam < Player.StamMax * 0.90:
Spells.CastChivalry("Divine Fury")
Timer.Create("DivineDelay", 2000)
def evasion():
if Timer.Check("EvasionDelay") or Player.BuffsExist('Evasion'): return
if Player.Hits < Player.HitsMax * 0.5:
if Player.ManaMax * 0.5 < Player.Mana:
Spells.CastBushido("Evasion")
Timer.Create("EvasionDelay", 21000)
def spm():
isSpmSecondary = Misc.ReadSharedValue("UseSpmSecondary")
global LastSpmSecondary
if (LastSpmSecondary is not isSpmSecondary or not Player.HasSpecial) and Player.ManaMax * 0.5 < Player.Mana:
if isSpmSecondary:
Player.WeaponSecondarySA()
LastSpmSecondary = True
else:
Player.WeaponPrimarySA()
LastSpmSecondary = False
def honor():
if Player.BuffsExist('Honored'): return
Target.ClearLast()
Target.SetLastTargetFromList("honor")
mob = Mobiles.FindBySerial(Target.GetLast())
if not mob: return
if mob.Hits == mob.HitsMax:
Player.InvokeVirtue("Honor")
Target.WaitForTarget(1000, False)
Target.TargetExecute(mob.Serial)
def attack():
Target.ClearLast()
Target.SetLastTargetFromList("enemy_nearest")
Player.Attack(Target.GetLast())
Player.HeadMessage(33, "[War Mode]")
while not Player.IsGhost and not Player.BuffsExist("Hiding"):
Misc.Pause(100)
honor()
spm()
divineFury()
consecrateWeapon()
attack()