Code: Select all
| - Twi.mac -
|
#include exp.mac
#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 Outran "out of range"
#event Outran "You cannot see"
|#chat tell
| Read what Event_chat is setup to do before uncommenting it.
| song queue. prev/next aren't really doing anything useful
| right now, I just have them there in case I find a good use later
#define prevsong v0
#define cursong v1
#define nextsong v2
#define nsongs v3
#define temp v4
#define amtem v5
#define WAITTIME 33 |Cast time of one song.
#define AMPL 5 |This is the hole that it gets in the queue
#define SELOS 6 | ^^ditto^^
Sub Main
/if $p0=="" /return
/if $p0==NULL /return
/varset nsongs 0
/varset v60 0
/varset cursong 0
/call EXPSETUP
/varset a(1,0) $p0
/if $p1!="" /varset a(1,1) $p1
/if $p2!="" /varset a(1,2) $p2
/if $p3!="" /varset a(1,3) $p3
/if $p4!="" /varset a(1,4) $p4
/if $p5!="" /varset a(1,5) $p5
/if $p6!="" /varset a(1,6) $p6
/if $p7!="" /varset a(1,7) $p7
/if $p8!="" /varset a(1, $p8
:setupLoop
/if $a(1,$v60)=="amp" {
/varcalc temp $v60+1
/varset a(0,AMPL) $a(1,$temp)
/varadd v60 2
/echo Found $char(gem,$a(0,AMPL)) at Gem $a(0,AMPL)
/varset amtem 7
/goto :setuploop
}
/if $a(1,$v60)=="selo" {
/varcalc temp $v60+1
/varset a(0,SELOS) $a(1,$temp)
/varadd v60 2
/echo Found $char(gem,$a(0,SELOS)) at Gem $a(0,SELOS)
/goto :setuploop
}
/if $a(1,$v60)!="" /if $a(1,$v60)!=NULL {
/varset a(0,$int($nsongs)) $int($a(1,$v60))
/echo Song $int($nsongs+1): $char(gem,$a(0,$int($nsongs)))
/varadd nsongs 1
/varadd v60 1
/goto :setuploop
}
/if n $a(0,SELOS)>0 /varset cursong $a(0,SELOS)
:Loop
/if n $a(0,SELOS)>0 {
/if n $t1<=$calc($t0+WAITTIME) /varset cursong SELOS
/if n $t1<=WAITTIME /varset t0 1 |INTERRUPTS CURRENT SONG!
}
/if n $a(0,AMPL)>0 /if n $amtem>6 /varset cursong AMPL
/if n $t0<=0 /call Sing $int($a(0,$cursong))
/delay 0
/doevents
/goto :Loop
/return
Sub Sing
/varset t0 WAITTIME
/if n $cursong==SELOS /varset t1 1500
/if n $cursong==AMPL /varset amtem 0
/stopsong
/cast $p0
/varadd amtem 1
/varset prevsong $cursong
/varadd cursong 1
/if n $cursong>=$nsongs /varset cursong 0
/doevents
/return
Sub Event_MissedNote
/varset cursong $prevsong
/varsub amtem 1
/varset t0 0
/doevents
/return
Sub Event_Slow
/varset cursong SELOS
/varset t0 0
/return
Sub Event_Outran
/varset t0 0
/varadd targcount 1
/varsub amtem 1
/if n $targcount>=4 {
/varset targcount 0
/tar npc
}
/doevents
/return
Sub Event_Recovered
/varset t0 0
/varsub amtem 1
/varset cursong $prevsong
/doevents
/return
Sub Event_NeedTarget
/varadd targcount 1
/if n $targcount>=2 {
/varset targcount 0
/tar npc
}
/doevents
/return
Code: Select all
| Sense Heading Trainer
sub main
:senseheadingloop
/if n $char(ability,"Sense Heading")>0 /doability "Sense Heading"
/if n $char(skill,"Sense Heading")<$calc($calc($char(level)*5)+5) /goto :senseheadingloop
/return 

