1
//AI note:s Set Content to 1 if you want a Ulna thrower. Leader Ulna are
2
//automatically transformed when level is 2 or higher (This is only checked on spawn).
3
//Dexterity increases attack speed
4
//Ranged attacks are always made from left hand
5
//------------------------------------------------------------------------------
6
// Check for a kill order
14
//------------------------------------------------------------------------------
20
IfXIsMoreThanY //Ulna is a leader?
24
EnchantTarget // target is self...
26
GetContent //Set ranged or melee AI
27
SetState //0 is melee and 1 is ranged (Leaders automatically use both)
28
MakeCrushValid //Ulnas can be crushed
31
//Make the bones flying
46
//------------------------------------------------------------------------------
47
//Handle death by sending a message and other stuff
49
tmpargument = 1 //Ulna Captain
53
tmpargument = 0 //Normal Ulna
57
tmpargument = 2 //Bone thrower
59
tmpargument = 3 //Teamkill
66
// Make the character body
71
//------------------------------------------------------------------------------
77
//------------------------------------------------------------------------------
81
SetTargetToWideEnemy //Find enemy
89
tmpargument = 1 //Leader Ulna always react fast
91
tmpargument = LATCHRIGHT
95
tmpy = 3940+ selfdex //15% chance to attack +1% per dex
96
IfXIsLessThanY //See if he reacts fast enough to attack
97
tmpargument = LATCHRIGHT
102
tmpturn = targetturnto
104
Else //Randomize attack approach
106
tmpx = rand & 256 + targetx - 128
107
tmpy = rand & 256 + targety - 128
108
tmpargument = 1 //Leader Ulna throws a bone
110
IfFacingTarget //Make sure to aim
112
SetTargetToTargetLeftHand //Check for left hand items
113
DoNothing //Left hand free for use
115
tmpargument = LATCHLEFT //Assuming having no weapon in
116
PressLatchButton //left hand
123
tmpx = targetdistance
125
IfXIsMoreThanY //Far enough away?
128
tmpy = selfdex //1% per dex
129
IfXIsLessThanY //See if he reacts fast enough to throw
130
tmpargument = LATCHLEFT
132
tmpx = targetx //Keep moving towards enemy
134
tmpturn = targetturnto
137
Else //Too close, run away
139
tmpx = rand & 256 + targetx - 128
140
tmpy = rand & 256 + targety - 128
141
tmpturn = targetturnto
144
tmpargument = rand & 15 + 5
147
Else //No enemy found, wander instead
148
tmpargument = rand & 31 + 120
150
tmpx = rand & 1023 - 512 + selfspawnx
151
tmpy = rand & 1023 - 512 + selfspawny
154
IfAtLastWaypoint //Don't stand still
164
//------------------------------------------------------------------------------
165
//Handle being attacked by blocking or countering or running away
168
// Chase the attacker
169
SetTargetToWhoeverAttacked
170
IfTargetIsOnHatedTeam
174
tmpturn = targetturnto
182
//------------------------------------------------------------------------------
183
//Instantly counterattack
185
SetTargetToWhoeverBumped
186
IfTargetIsOnHatedTeam
188
tmpargument = LATCHRIGHT
194
tmpturn = targetturnto
206
//------------------------------------------------------------------------------
208
//------------------------------------------------------------------------------