This macro sticks to one spot and, for the area that I'm hunting in right now, is much safer.
I need to add 2 more different chants before the cycle repeats itself:
This is DKAA's chant macro.
Code: Select all
|
| - chantkite.mac -
| this is orignally from twist.mac or twist1.mac -- sorry, I
| didn't keep that attribution
|
| chantkite <selo's gem> [<dot1 gem> <dot2 gem> [<loc x> <loc y> <radius>]]
| run around in a cirle while twisting selos and two DOT chants. If x,
| y, and radius are not supplied, use the current position and a radius
| of 80. This uses the short-lasting selos.
|
#event MissedNote "You miss a note, bringing your song to a close!"
#event Recovered "You haven't recovered yet..."
#event NeedTarget "You must first select a target for this spell!"
#event Slow "You slow down"
#event Exp "You gain "
#event Outof "out of range"
| this needs to be on now -- parameter parsing takes too long
#turbo
Sub Main(p0,p1,p2,p3,p4,p5)
/declare cirx global
/declare ciry global
/declare cirr global
| array of songs
/declare a array
| number of songs
/declare nsongs global
| current song 1-3
/declare cursong global
/declare exper global
| selo's coming for slow down processing
/declare selocoming global
/declare t0 timer
/declare mytarg global
/declare v6 local
/if $defined(p0)==false {
/echo usage: zero string
/return
}
| check if the location was passed in...
/if $defined(p3)==false {
/varset cirx $char(y)
/varset ciry $char(x)
/varset cirr 80
} else {
/varset cirx @p3
/varset ciry @p4
/varset cirr @p5
}
/varset nsongs 1
/varset a(1) @p0 | First song
/echo Song 1: $char(gem,@p0)
/if $defined(p1)!=false {
/varadd nsongs 1
/varset a(2) @p1
/echo Song 2: $char(gem,@p1)
}
/if $defined(p2)!=false {
/varadd nsongs 1
/varset a(3) @p2
/echo Song 3: $char(gem,@p2)
}
| always incremented before starting a new
| song. songs start at 1 so we can make
| cursong = 0 to restart the list
/varset cursong 0
/varset exper $char(exp)
/varset selocoming 0
/varset t0 0
:Loop
/if n @t0<=0 {
| inline /call sing $int(@a(@cursong))
/stopsong
/if n @cursong==1 {
/varset selocoming 1
} else {
/varset selocoming 0
}
/delay 1
/varset t0 32
/varadd cursong 1
/if n @cursong>@nsongs /varset cursong 1
/echo starting song @a(@cursong)
/cast @a(@cursong)
/if "$target()"=="true" /varset mytarg $target(name,clean)
}
/delay 2
| inline /call circ @cirx @ciry @cirr
| do the circle calculations....
/varset v6 $calc(@cirr-$distance(@cirx,@ciry))
/if n @v6>10 {
| head out
/face fast heading $calc($heading(@cirx,@ciry)+180)
} else /if n @v6<-10 {
/if n @v6<-180 /varset v6 -180
| head in
/face fast heading $calc($heading(@cirx,@ciry)+90+@v6/2)
} else {
| head tang
/face fast heading $calc($heading(@cirx,@ciry)+90)
}
/delay 4
/doevents
/delay 1
/goto :Loop
/return
Sub Event_MissedNote
| restart song
/varcalc cursong @cursong-1
/varset t0 0
/return
Sub Event_Slow
/if n @selocoming!=1 {
| restart list
/varset cursong 0
/varset t0 0
}
/return
Sub Event_Outof
/varset t0 0
/return
Sub Event_Recovered
| restart song
/varcalc cursong @cursong-1
/varset t0 0
/return
Sub Event_NeedTarget
| get target
/tar npc @mytarg
/return
Sub Event_Exp
/varcalc exper $char(exp)-@exper
/echo @exper%
/varset exper $char(exp)
/tar npc @mytarg
/returnThank you in advance.
