-
Notifications
You must be signed in to change notification settings - Fork 0
/
p3_meleecombat.inc
executable file
·80 lines (61 loc) · 1.82 KB
/
p3_meleecombat.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
SUB p3_meleecombat_init {
/call p3RegisterCommand KILL meleecombatKill 55
/call p3RegisterCommand STOP meleecombatStop 50
/call p3RegisterCommand FOLLOW meleecombatFollow 50
/call p3RegisterCommand ROAMMOVESTART meleecombatRoamMoveStart 45
/declare meleeTargetID int outer 0
/declare useMeleeCombat bool outer ${Bool[${Select[${Me.Class.ShortName},${defaultMeleeCombatClasses}]}]}
/declare meleeRetreatPct int outer 45
/declare meleeRetreatResumePct int outer 80
/varset useMeleeCombat ${getBotIniOption[Assist.UseMeleeCombat,${useMeleeCombat}]}
/RETURN
}
SUB meleecombatRoamMoveStart(string cmd, string opts) {
/call meleecombatStop
/RETURN
}
SUB meleecombatFollow(string cmd, string opts) {
/call meleecombatStop
/RETURN
}
SUB meleecombatKill(string cmd, string opts) {
/varset meleeTargetID ${getStackCommandOpt[${opts},SPAWNID]}
/RETURN
}
SUB meleecombatStop(string cmd, string opts) {
/varset meleeTargetID 0
/attack off
/if (${useAutoFire}==TRUE && ${Me.AutoFire}==TRUE) /autofire
/RETURN
}
SUB meleecombatMaintenance() {
/declare killSpawn spawn local
/if (${meleeTargetID}==0) {
/if (${Me.Combat}==TRUE) /attack off
/return
}
/if (${Spawn[id ${meleeTargetID}].ID}==NULL || ${Spawn[id ${meleeTargetID}].Dead}==TRUE) {
/call meleecombatStop
/return
}
/vardata killSpawn Spawn[id ${meleeTargetID}]
/if (${killSpawn.ID}==NULL || ${killSpawn.Dead}==TRUE) {
/call meleecombatStop
/return
}
/if (${useAutoFire}==TRUE) {
/if (${Me.AutoFire}==FALSE) {
/echo autofire on
/timed 5 /autofire
}
}
/if (${useMeleeCombat}==TRUE && ${useAutoFire}==FALSE) {
|/if (${killSpawn.Distance} > ${Math.Calc[${killSpawn.MaxRangeTo}+0.5]}) {
/if (${killSpawn.Distance} > 30) {
/if (${Me.Combat}==TRUE) /attack off
} else {
/if (${Me.Combat}==FALSE) /attack on
}
}
/RETURN
}