2
// By Pteromys of Melon Island - http://melonisland.net
4
// Hold down ATTACK to charge up a spell. When the smokies
5
// start moving vertically, release it to make a little
6
// twister that sucks enemies in. Press ATTACK again to
7
// kill the twister. Useful for "congregating" enemies
8
// so you can finish them off with a fireball.
9
// Guide to object states:
10
// 0 spellbook or a spell in hand
12
// Offhand peculiarities noticed while scripting:
13
// Crushing will have no effect on an object that has bump
14
// dimensions of zero.
17
IfStateIs0 // A spellbook
19
Else // Or a howling gale?
20
NotAnItem // Don't let anyone pick it up
29
IfChanged // It's a spell in hand
39
SetTargetToWhoeverIsHolding
46
UndoEnchant // Kill the previous one
50
SetTargetToWhoeverIsHolding
56
IfContentIs // Fully charged?
66
tmpargument = tmpargument + 12
75
tmpargument = 50 // Too advanced of a spell
88
SetTargetToWhoeverIsHolding
90
StopTargetMovement // Recoil
93
tmpturn = targetturn + 32767
98
tmpx = targetx // Attempt to spawn a whirlwind
103
tmpdistance = targetz + 15
116
Else // Backfire if the spell was cast into a wall
117
tmpargument = rand & 1023 + 1536
126
tmpdistance = EXPSECRET
127
GiveExperienceToTarget
140
Else // AI for the blast of wind
144
tmpturn = rand & 65535
145
tmpdistance = 200 // Do not stray more than 200 units from home
149
tmpargument = rand & 31 + 32
152
IfInWater // Become a waterspout
169
IfDropped // Turn back into a spellbook (do last)
174
tmpargument = ACTIONJB