-
Notifications
You must be signed in to change notification settings - Fork 0
/
p3_tank.inc
executable file
·142 lines (99 loc) · 3.67 KB
/
p3_tank.inc
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
SUB p3_tank_init() {
/call p3RegisterCommand TAGSCHANGED tankTagsChanged 50
/declare tankModeEnabled bool outer FALSE
/declare dontTakeAggroFrom string outer NONE
/declare tauntSuccessList list outer
/declare tankCheckTimer timer outer 0
/varset tankModeEnabled ${getBotIniOption[Tank.Enabled,${tankModeEnabled}]}
/varset dontTakeAggroFrom ${getBotIniOption[Tank.DontTakeAggroFromNames,${dontTakeAggroFrom}]}
/RETURN
}
SUB tankMaintenance() {
/if (${tankModeEnabled}==TRUE && ${tankCheckTimer}==0) {
/call checkTauntSuccessList
/call checkTankStatus
/varset tankCheckTimer 5
}
/RETURN
}
SUB tankTagsChanged() {
/call validateTagsFromArray iniTankActions
/RETURN
}
SUB tankKill(string cmd, string opts) {
/RETURN
}
SUB tankStop(string cmd, string opts) {
/RETURN
}
SUB checkTankStatus() {
/if (${assistSpawnID}==0) /return
/declare i int local
/if (${dontTakeAggroFrom.NotEqual[NONE]} && ${Me.TargetOfTarget.ID}!=NULL) {
/call characterPassesAllowKeySeries ${Me.TargetOfTarget.CleanName.Upper} "${dontTakeAggroFrom.Upper}"
/if (${Macro.Return}==TRUE) /return
}
/for i 1 to ${iniTankActions.Size}
/if (${iniTankActions[${i},${bTagsInvalidated}].Equal[YES]}) /continue
/if (${iniTankActions[${i},${bEnabled}].Equal[NO]}) /continue
/if (${iniTankActions[${i},1].Equal[-]}) /return
/if (${iniTankActions[${i},${bNotToT}].NotEqual[-]}) {
/if (${Me.TargetOfTarget.ID}==${Me.ID}) /continue
}
/if (${iniTankActions[${i},${bAmToT}].NotEqual[-]}) {
/if (${Me.TargetOfTarget.ID}!=${Me.ID}) /continue
}
/if (${iniTankActions[${i},${bOnlyAfterTaunt}].NotEqual[-]}) {
/if (${tauntSuccessListContains[${assistSpawnID}_]}==FALSE) {
/continue
}
}
|/if (${iniTankActions[${i},${bDoAbility}].NotEqual[-]}) {
| /if (${Me.AbilityReady[${iniTankActions[${i},1]}]} == FALSE) /continue
|}
/if (${iniTankActions[${i},${bSelfNotHighestAggro}].NotEqual[-]}) {
/if (${Me.PctAggro}==100) /continue
}
/if (${iniTankActions[${i},${bCombatTimeOver}].NotEqual[-]}) {
/if (${Math.Calc[(12000-${assistTime})/10]} < ${iniTankActions[${i},${bCombatTimeOver}]}) /continue
}
/if (${iniTankActions[${i},${bSelfOverEnd}].NotEqual[-]}) {
/if (${Me.PctEndurance} < ${iniTankActions[${i},${bSelfOverEnd}]} ) /continue
}
/if (${iniTankActions[${i},${bNextHighestAggroOver}].NotEqual[-]}) {
/if (${Me.PctAggro} != 100) /continue
/if (${Me.SecondaryPctAggro} < ${iniTankActions[${i},${bNextHighestAggroOver}]}) /continue
}
/if (${iniTankActions[${i},${bTargetUnderDistance}].NotEqual[-]}) {
/if (${Target.Distance} > ${iniTankActions[${i},${bTargetUnderDistance}]}) /continue
}
/if (${iniTankActions[${i},${bRequireMobsInProximity}].NotEqual[-]}) {
/if (${SpawnCount[npc loc ${Me.X} ${Me.Y} radius 30]} < ${iniTankActions[${i},${bRequireMobsInProximity}]}) /continue
}
/if (${iniTankActions[${i},${bDoCommand}].NotEqual[-]}) {
/call p3command "${iniTankActions[${i},${bDoCommand}]}"
}
/invoke (${cq.Append[CAST;SPELL=${iniTankActions[${i},1]};TARGETID=${assistSpawnID};]})
/next i
/RETURN
}
SUB checkTauntSuccessList() {
/if (${tauntSuccessList.Count}==0) /return
/declare i int local
/declare t int local
/for i ${Math.Calc[${tauntSuccessList.Count}-1]} downto 0
/varset t ${tauntSuccessList.Item[${i}].Token[2,_]}
/if (${Math.Calc[${MacroQuest.Running} - ${t} >5000]}) {
/invoke ${tauntSuccessList.Erase[${i}]}
}
/next i
/RETURN
}
SUB tauntSuccessListContains(string s)
/if (${tauntSuccessList.Count}==0) /return FALSE
/declare i int local
/for i 0 to ${Math.Calc[${tauntSuccessList.Count}-1]}
/if (${tauntSuccessList.Item[${i}].Find[${s}]}!=NULL) /return TRUE
/next i
/return FALSE
/RETURN