I’m sure this can be made more reliable and or faster, so it’s a work in progress as people come back with feedback or I manage to get time to spend on it.
Edit: A whole mess of fine tuning, invcluding a better stun recovery, and a redundent check to make sure selo's is on. Still have an issue that I haven't looked into yet about why the arrays aren't incrementing the songs they are supposed too.
Code: Select all
|
| - chant.mac -
| Hacked together by Insanitywiz to support 4 chants, 49 Selo's,
| Angstlich Assonance, and Bellow from DKAA's chantkite mac.
|
| chant <dot1> <dot2> <dot3> <dot4> <angstlich> <selo> <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.
|
| Example of calling the macro with the 49 selo's and Angstlich Assonance
| Example:/macro chant <dot> <dot> <dot> <dot> <angst> <selo> <xloc> <yloc> <radius>
|
| Example of calling the macro with the 49 selo's, but without Angstlich
| Example:/macro chant <dot> <dot> <dot> <dot> <0> <selo> <xloc> <yloc> <radius>
|
| Example of calling the macro without the 49 selo's, or Angstlich
| Example:/macro chant <dot> <dot> <dot> <selo> <0> <0> <xloc> <yloc> <radius>
#event MissedNote "You miss a note, bringing your song to a close!"
#event NeedTarget "You must first select a target for this spell!"
#event Slow "you slow down"
#event Exp "You gain "
#event Tell "tells you"
#event Recovered "You haven't recovered yet..."
#event Notsee "You cannot see"
#event Died "You have entered"
| this needs to be on now -- parameter parsing takes too long
#turbo
Sub Main(p0,p1,p2,p3,p4,p5,p6,p7,p8)
/declare cirx global
/declare ciry global
/declare cirr global
| array of songs
/declare a array
| number of songs
/declare nsongs global
| current song 1-5
/declare cursong global
/declare prevsong global
/declare exper global
/declare aaexp global
/declare health global
/declare songtimer timer
/declare selotimer timer
/declare angstimer timer
/declare puretonetimer timer
/declare bellowtimer timer
/if $defined(p0)==false {
/echo usage: chant.mac <DOT> <DOT> <DOT> <DOT> <angst> <selo> <loc x> <loc y> <radius>
/return
}
| check if the location was passed in...
/if $defined(p6)==false {
/varset cirx $char(y)
/varset ciry $char(x)
/varset cirr 80
} else {
/varset cirx @p6
/varset ciry @p7
/varset cirr @p8
}
/varset nsongs 4
| First song
/varset a(1) @p0
/echo Song 1: $char(gem,@p0)
/if $defined(p1)!=false {
/varset a(2) @p1
/echo Song 2: $char(gem,@p1)
}
/if $defined(p2)!=false {
/varset a(3) @p2
/echo Song 3: $char(gem,@p2)
}
/if $defined(p3)!=false {
/varset a(4) @p3
/echo Song 4: $char(gem,@p3)
}
|Angstlich Assonance (Only use if the X Y and radius was set)
/if $defined(p4)!=false {
/varset a(5) @p4
/echo Song 5: $char(gem,@p4)
}
|Selos
/if $defined(p5)!=false {
/varset a(6) @p5
/echo Song 6: $char(gem,@p5)
}
| always incremented before starting a new
| song. songs start at 1 so we can make
| cursong = 0 to restart the list
/varset cursong 1
/varset exper $char(exp)%
/varset aaexp $char(aa,exp)%
/varset songtimer 64
/varset bellowtimer 186
/varset selotimer 0
/varset angstimer 240
/varset puretonetimer 64
:Loop
/if $defined(p4)==false {
/varset angstimer 15000
}
/if $defined(p5)==false {
/varset selotimer 15000
}
/if $defined(p5)!=false {
/if $char(speed)<=1 /varset cursong @a(6)
/call circ @cirx @ciry @cirr
}
/if n @bellowtimer<=0 {
/alt activate 199
/varset bellowtimer 186
}
/if n @selotimer<=0 {
/varset cursong @a(6)
/varset selotimer 1500
/call Sing
}
/if n @puretonetimer<=0 {
/varset angstimer 0
/disc puretone
/varset puretonetimer 43200
}
/if n @angstimer<=0 {
/varset cursong @a(5)
/varset angstimer 600
/call Sing
}
/if n @songtimer<=0 /call Sing
/call circ @cirx @ciry @cirr
/doevents
/goto :Loop
/return
Sub Sing
/stopsong
/cast @cursong
| /echo casting @cursong
/varset prevsong @cursong
/varadd cursong 1
/varset songtimer 32
/call circ @cirx @ciry @cirr
/doevents
/if n @cursong>@nsongs /varset cursong @a(1)
/return
Sub circ
/if $char(speed)<=.2 /press Num_Lock
/if n $distance(@cirx,@ciry)<(@cirr/2){
/face heading $calc($heading(@cirx,@ciry)+180)
} else {
/face heading $calc($heading(@cirx,@ciry)+$calc(90*$calc(@cirr/$distance(@cirx,@ciry))))
}
/return
Sub Event_MissedNote
| restart song
/varset cursong @prevsong
/varset songtimer 0
/call circ $xloc $yloc $radius
/doevents
/return
Sub Event_Recovered
| restart song
/if @cursong!=a(5) {
/varset cursong @prevsong
}
/varset songtimer 0
/call circ $xloc $yloc $radius
/doevents
/return
Sub Event_Notsee
/stopsong
/varset cursong @prevsong
/varset songtimer 0
/call circ $xloc $yloc $radius
/doevents
/return
Sub Event_NeedTarget
| get target
/tar npc
/call circ @cirx @ciry @cirr
/doevents
/return
Sub Event_Tell
/beep
/call circ $xloc $yloc $radius
/doevents
/return
Sub Event_Died
/delay 10
/sit
/delay 10
/camp desktop
/return
Sub Event_Exp
/varset aaexp $calc($char(aa,exp)-@aaexp)
/varset exper $calc($char(exp)-@exper)
/echo Running time $calc($running/60) minutes
/echo @exper% regular exp @aaexp% AA exp
/varset exper $char(exp)
/varset aaexp $char(aa,exp)
/stopsong
/tar npc
/varset cursong @a(1)
/varset songtimer 0
/call circ @cirx @ciry @cirr
/doevents
/return
