Code: Select all
|- ChantKite.mac -
| /mac Chantkite <GEM> <GEM> <GEM> <SELOS GEM> <XLOC> <YLOC> <RADIUS>
| Note, since the lvl 49 Selo's lasts 2.5 minutes, this macro WONT WORK
| IF YOU HAVEN'T GOT THE 2.5 MINUTE SELOS DON'T TRY, DON'T BITCH IT WON'T
#event MissedNote "You miss a note, bringing your song to a close!"
#event Recovered "You haven't recovered yet..."
#event Exp "You gain "
#event Slow "You slow down"
#event Outran "out of range"
#event NeedTarget "You must first select a target for this spell!"
Sub Main(Psong1 Psong2 Psong3 Psong4 Pselo Pxloc Pyloc Pradius)
/declare songarray array
/declare timer0 timer
/declare timer1 timer
/declare CASTTIME global
/declare SELOS global
/declare xloc global
/declare yloc global
/declare radius global
/declare cursong global
/declare prevsong global
/declare nsongs global
/varset timer1 0
/varset CASTTIME 31
/varset SELOS 5
/varset cursong 0
/varset nsongs 5
/varset xloc @Pxloc
/varset yloc @Pyloc
/varset radius @Pradius
/varset songarray(1) @Psong1
/varset songarray(2) @Psong2
/varset songarray(3) @Psong3
/varset songarray(4) @Psong4
/varset songarray(5) @Pselo
|:DEBUG:| /echo Song 1: $char(gem,@Psong1)
|:DEBUG:| /echo Song 2: $char(gem,@Psong2)
|:DEBUG:| /echo Song 3: $char(gem,@Psong3)
|:DEBUG:| /echo Song 4: $char(gem,@Psong4)
|:DEBUG:| /echo Song 5: $char(gem,@Pselo)
|:DEBUG:| /echo x,y,radius: @xloc , @yloc , @radius
|:DEBUG:| /echo Array: @songarray(1) , @songarray(2) , @songarray(3) , @songarray(4) , @songarray(5)
:Loop
/if n @timer1<=$calc(@timer0+@CASTTIME) {
/varset cursong @SELOS
}
/if n @timer1<=@CASTTIME {
/varset timer0 1
}
/if n @timer0<=0 /call Sing $int(@songarray(@cursong))
/call circ @xloc @yloc @radius
/doevents
/goto :Loop
/return
Sub Sing(Param)
/varset timer0 @CASTTIME
/if n @Param==@SELOS /varset timer1 1475
/stopsong
/cast @Param
/varset prevsong $cursong
/varadd cursong 1
/if n @cursong>=@nsongs /varset @cursong 1
/call circ @xloc @yloc @radius
/doevents
/return
Sub circ(Px Py Pr)
/if n $distance(@Px,@Py)<(@Pr/2){
/face heading $calc($heading(@Px,@Py)+180)
} else {
/face heading $calc($heading(@Px,@Py)+$calc(90*$calc(@Pr/$distance(@Px,@Py))))
}
/return
Sub Event_MissedNote
/varset cursong @prevsong
/varset timer0 0
/doevents
/return
Sub Event_Recovered
/varset timer0 0
/varset cursong @prevsong
/doevents
/return
Sub Event_NeedTarget
/tar npc
/call circ @xloc @yloc @radius
/doevents
/return
Sub Event_Exp
/tar npc
/call circ @xloc @yloc @radius
/doevents
/return
Sub Event_Outran
/tar npc
/call circ @xloc @yloc @radius
/doevents
/return
Sub Event_Slow
/varset cursong @SELOS
/varset timer0 0
/return
Then i get these errors:
-------------------------------------------------------------------------------------
Ending macro: Bad variable in /var function.
bardkite.mac@73 (Sing(Param)): /if n @cursong>=@nsongs /varset @cursong 1
bardkite.mac@60 (Main(Psong1 Psong2 Psong3 Psong4 Pselo Pxloc Pyloc Pradius)): /if n @timer0<=0 /call Sing $int(@songarray(@cursong))
Cleared the following: Timers Vars Arrays
The current macro has ended.
-------------------------------------------------------------------------------------
If i comment out this line /if n @cursong>=@nsongs /varset @cursong 1 then it looks as though it works fine, BUT it casts songs way too fast, like one every .5 seconds, instead of waiting 3sec so they can cast. Any ideas would be cool! lol thanks guys.


