-
Notifications
You must be signed in to change notification settings - Fork 0
/
p3_targetting.inc
executable file
·97 lines (74 loc) · 2.26 KB
/
p3_targetting.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
SUB p3_targetting_init {
/call p3RegisterCommand STOP targettingStop 51
/call p3RegisterCommand KILL targettingKill 51
/call p3RegisterCommand CAST targettingCast 10
/declare lockTargetID int outer 0
/declare castTargetID int outer 0
/declare keepTargetClearWhileIdle bool outer FALSE
/varset keepTargetClearWhileIdle ${getBotIniOption[Misc.KeepTargetClearWhileIdle,${keepTargetClearWhileIdle}]}
/RETURN
}
SUB targettingMaintenance() {
| MAINTAIN CAST TARGET LOCK UNTIL NO LONGER CASTING
/if (${amBard}==TRUE && ${Twist.Twisting}==TRUE) {
|BARD TWISTING? MUST HAVE FINISHED CASTING
/varset castTargetID 0
} else {
/if (${castTargetID}!=0) {
/if (${Me.Casting.ID}==NULL) {
/varset castTargetID 0
} else {
/if (${Target.ID}!=${castTargetID}) {
/tar id ${castTargetID}
}
}
/RETURN
}
}
| HANDLE REGULAR TARGET LOCK
/if (${Spawn[id ${lockTargetID}].ID}==NULL || ${Spawn[id ${lockTargetID}].Dead}==TRUE) {
/varset lockTargetID 0
}
/if (${Spawn[id ${castTargetID}].ID}==NULL || ${Spawn[id ${castTargetID}].Dead}==TRUE) {
/varset castTargetID 0
}
|/if (${lockTargetID}==0 && ${Target.ID}!=NULL && ${keepTargetClearWhileIdle}==TRUE) /target clear
/if (${lockTargetID}==0) /RETURN
/if (${Target.ID}!=${lockTargetID}) {
/tar id ${lockTargetID}
}
/RETURN
}
SUB targettingCast(string cmd, string opts) {
/declare spellID string local ${getStackCommandOpt[${opts},SPELLID]}
/declare doForceTargetting string local ${getStackCommandOpt[${opts},FORCETARGETTING]}
/declare xspell spell local
/if (${spellID.NotEqual[-]}) {
/vardata xspell Spell[${spellID}]
/if (${xspell.TargetType.Equal[Self]} && ${doForceTargetting.Equal[-]}) /return
/if (${xspell.TargetType.Equal[Group v1]}) {
/if (${Target.ID}==NULL || ${Target.Type.Equal[NPC]}) {
/return
}
}
}
/varset castTargetID ${getStackCommandOpt[${opts},TARGETID]}
|/bc setting castTargetID ${castTargetID}
/if (${Target.ID}!=${castTargetID}) {
/tar id ${castTargetID}
/delay 2
}
/RETURN
}
SUB targettingStop(string cmd, string opts) {
/if (${useMeleeCombat}==TRUE) {
/varset lockTargetID 0
}
/RETURN
}
SUB targettingKill(string cmd, string opts) {
|/if (${useMeleeCombat}==TRUE) {
/varset lockTargetID ${getStackCommandOpt[${opts},SPAWNID]}
|}
/RETURN
}