Moderator: MacroQuest Developers
Code: Select all
|
| - swarm.mac -
| Hacked together by Brick 37 twisting 3 AE dots, 49 Selo's,
|
| swarm <dot1> <dot2> <dot3> <selo> <loc x> <loc y> <radius>
| run around in a cirle while twisting selos and three DOT AEs. If x,
| y, and radius are not supplied, use the current position and a radius
| of 32. But i strongly recommend you to type in xloc yloc and 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)
/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 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
/declare rangecalc global
/declare lastmobid global
/varset rangecalc 0
/if $defined(p0)==false {
/echo usage: swarm.mac <DOT> <DOT> <DOT> <selo> <loc x> <loc y> <radius>
/return
}
| check if the location was passed in...
/if $defined(p4)==false {
/varset cirx $char(y)
/varset ciry $char(x)
/varset cirr 32
} else {
/varset cirx @p4
/varset ciry @p5
/varset cirr @p6
}
/varset nsongs 3
| 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)
}
|Selos
/if $defined(p5)!=false {
/varset a(4) @p3
/echo Song 4: $char(gem,@p3)
}
| 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(p3)==false {
/varset selotimer 10000
}
/if $defined(p5)!=false {
/if $char(speed)<=1 /varset cursong 4
/call circ @cirx @ciry @cirr
}
/if n @selotimer<=0 {
/varset cursong 4
/varset selotimer 1500
/call Sing
}
/if n @puretonetimer<=0 {
/varset angstimer 0
/disc puretone
/varset puretonetimer 43200
}
/if n @songtimer<=0 /call Sing
/call circ @cirx @ciry @cirr
/doevents
/goto :Loop
/return
Sub Sing
/stopsong
/cast @a(@cursong)
/if n $target(id)!=@lastmobid /if n @rangecalc!=0 /varset rangecalc 0
/echo casting @cursong
/varset prevsong @cursong
/varadd cursong 1
/varset songtimer 32
/call circ @cirx @ciry @cirr
/doevents
/if n @cursong>@nsongs /varset cursong 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!=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
/varset lastmobid $target(id)
/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
Sub Event_OOR
/varcalc rangecalc @rangecalc+1
/if n @rangecalc>=10 {
/press esc
/varset rangecalc 0
/tar npc
/call circ @cirx @ciry @cirr
/doevents
}
/return
Code: Select all
/if n @songtimer<=0 /call SingCode: Select all
/if n @songtimer<=0 /if n @selotimer<=1467 /call SingCode: Select all
/if n @selotimer<1467 /if n $char(speed)<=100 /if n $char(speed)>40 {
|Selos down for some reason... casting selos
/varset cursong 4
/varset selotimer 1500
/call Sing
}
Code: Select all
/if n @selotimer<=0 {
/varset cursong 4
/varset selotimer 1500
/call Sing
}Code: Select all
Sub circ
/if [color=red]n[/color] $char(speed)<=.2 /press Num_Lock
/if n $distance(@cirx,@ciry)<[color=red]$calc[/color](@cirr/2){
/face heading $calc($heading(@cirx,@ciry)+180)
} else {
/face heading $calc($heading(@cirx,@ciry)+$calc(90*$calc(@cirr/$distance(@cirx,@ciry))))
}
/return 
Code: Select all
|
| - swarm.mac -
| Hacked together by Brick 37 twisting 3 AE dots, 49
Selo's,
|
| swarm <dot1> <dot2> <dot3> <selo> <loc x> <loc y>
<radius>
| run around in a cirle while twisting selos and three DOT
AEs. If x,
| y, and radius are not supplied, use the current position
and a radius
| of 32. But i strongly recommend you to type in xloc yloc
and 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)
/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 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
/declare rangecalc global
/declare lastmobid global
/varset rangecalc 0
/if $defined(p0)==false {
/echo usage: swarm.mac <DOT> <DOT> <DOT> <selo> <loc
x> <loc y> <radius>
/return
}
| check if the location was passed in...
/if $defined(p4)==false {
/varset cirx $char(y)
/varset ciry $char(x)
/varset cirr 32
} else {
/varset cirx @p4
/varset ciry @p5
/varset cirr @p6
}
/varset nsongs 3
| 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)
}
|Selos
/if $defined(p5)!=false {
/varset a(4) @p3
/echo Song 4: $char(gem,@p3)
}
| 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(p3)==false {
/varset selotimer 10000
}
/if $defined(p5)!=false {
/if $char(speed)<=1 /varset cursong 4
/call circ @cirx @ciry @cirr
}
if n @selotimer<1467 /if n $char(speed)<=100 /if n
$char(speed)>40 {
|Selos down for some reason... casting selos
/varset cursong 4
/varset selotimer 1500
/call Sing
}
/if n @puretonetimer<=0 {
/varset angstimer 0
/disc puretone
/varset puretonetimer 43200
}
/if n @songtimer<=0 /if n @selotimer<=1467 /call Sing
/call circ @cirx @ciry @cirr
/doevents
/goto :Loop
/return
Sub Sing
/stopsong
/cast @a(@cursong)
/if n $target(id)!=@lastmobid /if n @rangecalc!=0
/varset rangecalc 0
/echo casting @cursong
/varset prevsong @cursong
/varadd cursong 1
/varset songtimer 32
/call circ @cirx @ciry @cirr
/doevents
/if n @cursong>@nsongs /varset cursong 1
/return
Sub circ
/if n $char(speed)<=.2 /press Num_Lock
/if n $distance(@cirx,@ciry)<$calc(@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!=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
/varset lastmobid $target(id)
/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
Sub Event_OOR
/varcalc rangecalc @rangecalc+1
/if n @rangecalc>=10 {
/press esc
/varset rangecalc 0
/tar npc
/call circ @cirx @ciry @cirr
/doevents
}
/return