1
//The different states:
2
//0: Wandering around looking for enemies (And following the leader)
7
//------------------------------------------------------------------------------
8
//How fast can he attack?
10
tmpargument = rand & 50 + 25
13
//------------------------------------------------------------------------------
14
//Always have 1 vampire leader
20
//------------------------------------------------------------------------------
31
tmpdistance = rand & 100 + selfz
37
tmpargument = tmpargument + 1
40
//------------------------------------------------------------------------------
41
// Let the character walk around
44
//Turn to gass to escape?
47
IfXIsLessThanY //Turn to gass if less than 11 life left
49
IfStateIsNot //Dont become gass if already gas
52
tmpargument = 3 //Gass mode
54
tmpargument = 4 //Sound effect and message
57
tmpdistance = rand & 2000 + 8000
61
OrderTarget //Hide the wings
63
//Wandering around following lead vampire
66
SetTargetToWideEnemy //Found a enemy, enter combat mode
67
tmpargument = rand & 20 + 10
74
tmpturn = targetturnto
78
Else //No enemies, wander around
79
tmpargument = rand & 61 + 60
81
tmpx = rand & 1023 - 512 + leaderx
82
tmpy = rand & 1023 - 512 + leadery
97
tmpturn = targetturnto
101
tmpx = targetdistance
103
IfXIsLessThanY //Close enough?
104
IfFacingTarget //Are we looking at the enemy?
106
//If the target defends, either wait or find new target
108
SetTargetToNearestEnemy
110
SetTargetToWhoeverAttacked
114
tmpturn = targetturnto
119
Else //Attack the enemy
120
IfTargetIsOnHatedTeam //Only if he is a enemy
121
tmpargument = LATCHRIGHT
127
tmpx = rand & 2023 - 1000 + targetx
128
tmpy = rand & 2023 - 1000 + targety
144
tmpy = 3000 //About 12 life should be enough
145
IfXIsMoreThanY //Do we have enough life to return to combat?
146
tmpargument = 0 //If so, become normal again
147
ChangeArmor //Become visible
148
SetState //Return to leader or wandering mode
152
OrderTarget //Show the wings
153
tmpargument = 5 //Sound effect
154
tmpdistance = rand & 2000 + 8000
156
Else //Nope, still too hurt, hide and heal
158
SetTargetToNearestEnemy
159
tmpx = rand & 2023 - 1000 + targetx
160
tmpy = rand & 2023 - 1000 + targety
162
tmpturn = targetturnto + 360 //Run away
166
tmpargument = 356 + rand & 456 //Regenerate extra while in gass form
170
//Don't just stand still
172
tmpargument = 3 //Don't do this if gass cloud
177
//------------------------------------------------------------------------------
178
//What to do if enemy is dead
181
IfStateIsNot //Only do if not gass form
182
SetTargetToNearbyEnemy
183
tmpargument = 1 //Engage nearby enemy
185
tmpargument = 0 //Return to leader
189
//------------------------------------------------------------------------------
190
//Handle being attacked by blocking or countering or running away
193
//Engage the attacker
194
SetTargetToWhoeverAttacked
195
IfTargetIsOnHatedTeam
197
tmpx = 2 //Only if idle of in combat mode
200
tmpx = targetx //Else - counter attack
203
tmpturn = targetturnto
209
Else //Whoops, friendly fire
210
SetTargetToNearestEnemy
212
//Cover in fear if damaged by holy
220
IfStateIsNot //Dont do this if in gass form
221
tmpargument = 2 //Become Feared
223
tmpargument = 4 //Play feared ouch sound
225
tmpargument = rand & 1 + 1 //Play normal ouch sound
227
//Silver weapons are super effective
230
tmpargument = rand & 1500 + 1000
231
tmpdistance = DAMAGEFIRE
234
tmpargument = 4 //Play feared ouch sound
236
//In gass form the vampire has weakness to fire and holy damage is instant kill
243
tmpargument = rand & 1500 + 2000
244
tmpdistance = DAMAGEFIRE
247
tmpargument = 4 //Play feared ouch sound
253
SetTargetToWhoeverAttacked
255
tmpdistance = EXPREVENGE //Give bonus xp
256
GiveExperienceToTarget
257
SetTargetToSelf //Holy damage is instant kill
262
tmpdistance = rand & 10000 + 5000
267
//------------------------------------------------------------------------------
268
//Always attack enemies who bump
270
SetTargetToWhoeverBumped
271
IfTargetIsOnHatedTeam
276
//------------------------------------------------------------------------------
277
//Handle death by sending a message and other stuff
286
tmpargument = 3 //Play death sound
287
tmpdistance = rand & 10000 + 5000
290
//If gass form, become normal
296
tmpargument = [HIDE] //Show the wings
305
// Make the character body
313
// Tell the wings to stop flappin'
314
SetTargetToRider // The wings are on gripleft, so this works
319
//------------------------------------------------------------------------------
321
//------------------------------------------------------------------------------