I hope ya did get killed yet in the grey
a_large_rat01
Moderator: MacroQuest Developers


Code: Select all
| - Twist1.mac -
| - Created by:
| - TheColonel -
| * Edited by:
| * Viisual
| + Touched up:
| + don't_know_at_all
|
| Description: This macro will run a bard in a circle, starting at an
| x,y loc you input and a radius you input and cast songs
| from the gem#(s) that you input
| Call : /macro <macroname> <xloc> <yloc> <radius> <song1> <song2>
| <song3> <song4>
|______________________________________________________________________
#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"
#event SpawnCheck "check"
#define cursong v1
#define exper V2
#define nsongs v3
#define targcount v4
#define songname v5
#define CastTimer t0
#define xpleft v14
Sub Main
/varset nsongs 0
/if $p3!="" /if $p3!=NULL {
/varadd nsongs 1
/varset a(0,2) $p3
/echo Song 1: $char(gem,$p3)
}
/if $p4!="" /if $p4!=NULL {
/varadd nsongs 1
/varset a(0,2) $p4
/echo Song 2: $char(gem,$p4)
}
/if $p5!="" /if $p5!=NULL {
/varadd nsongs 1
/varset a(0,3) $p5
/echo Song 3: $char(gem,$p5)
}
/if $p6!="" /if $p6!=NULL {
/varadd nsongs 1
/varset a(0,4) $p6
/echo Song 4: $char(gem,$p6)
}
/varset cursong 1
/varset exper $char(exp)
:Loop
/varset songname $char(gem,$cursong)
/call Sing $int($a(0,$cursong))
/call circ $p0 $p1 $p2
/doevents
/varset CastTimer $int($spell("$songname",casttime)*10+$spell("$songname",recoverytime)*10)
:casting
/call circ $p0 $p1 $p2
/if n $CastTimer>0 /goto :casting
/doevents
/cal circ $p0 $p1 $p2
/goto :Loop
/return
Sub Sing
/stopsong
/cast $p0
/varadd cursong 1
/if n $cursong>$nsongs /varset cursong 1
/doevents
/return
sub circ
/face heading $calc($heading($p0,$p1)+90+$calc($p2-$distance($p0,$p1))/2)
/varset v6 $calc($p2-$distance($p0,$p1))
/if n $v6>10 {
/face heading $calc($heading($p0,$p1)+180)
} else /if n $v6<-10 {
/if n $v6<-180 /varset v6 -180
/face heading $calc($heading($p0,$p1)+90+$v6/2)
} else {
/face heading $calc($heading($p0,$p1)+90)
}
/return
Sub Event_MissedNote
/varcalc cursong $cursong - 1
/if n $cursong<1 /varset cursong 1
/varset t0 0
/return
Sub Event_Slow
/if n $cursong!=1 {
/varset cursong 1
/varset t0 0
/doevent
}
/return
Sub Event_Outof
/varset t0 0
/varadd targcount 1
/if n targcount<=4 /if $target(hp)<"100" {
/varset targcount 0
/tar npc
}
/doevents
/return
Sub Event_Recovered
/delay .4
/doevents
/return
Sub Event_NeedTarget
/varadd cursong 1
/if n $cursong>nsongs /varset cursong 1
/tar npc
/return
Sub Event_Exp
/varset xpleft $calc(100-$char(exp))
/varcalc exper $char(exp)-$exper
/echo Kill:$exper% Left:$xpleft
/varset exper $char(exp)
/tar npc
/return
Sub Event_SpawnCheck
| /ooc Big Island raptors
/return


Code: Select all
/face heading $calc($heading($p0,$p1)+90+$calc($p2-$distance($p0,$p1))/2)
Code: Select all
/varset v6 $calc($p2-$distance($p0,$p1))
/if n $v6>10 {
|/echo heading outward $v6
/face heading $calc($heading($p0,$p1)+180) | head outward
} else /if n $v6<-10 {
|/echo heading inward
/if n $v6<-180 /varset v6 -180
/face heading $calc($heading($p0,$p1)+90+$v6/2) | head inward
} else {
|/echo tangent
/face heading $calc($heading($p0,$p1)+90) | head tangentially
}
Code: Select all
Sub Event_MissedNote
/varcalc cursong $cursong - 1
/if n $cursong<1 /varset cursong 1
/varset t0 0
/return
Code: Select all
| - Twist1.mac -
| - TheColonel -
#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"
#event SpawnCheck "check"
#define cursong v1
#define nsongs v3
#define switch v4
#define exper V2
#define targcount v5
#define aaleft v6
#define aaxper v7
#define xpleft v14
Sub Main
/varset nsongs 0
/if "$p3"~~"Selo`s Accelerating Chorus" /varset t1 1400
/if $p3!="" /if $p3!=NULL {
/varadd nsongs 1
/varset a(0,1) $p3
/echo Song 1: $char(gem,$p3)
}
/if $p4!="" /if $p4!=NULL {
/varadd nsongs 1
/varset a(0,2) $p4
/echo Song 2: $char(gem,$p4)
}
/if $p5!="" /if $p5!=NULL {
/varadd nsongs 1
/varset a(0,3) $p5
/echo Song 3: $char(gem,$p5)
}
/if $p6!="" /if $p6!=NULL {
/varadd nsongs 1
/varset a(0,4) $p6
/echo Song 4: $char(gem,$p6)
}
/if $p7!="" /if $p7!=NULL {
/varadd nsongs 1
/varset a(0,5) $p7
/echo Song 5: $char(gem,$p7)
}
/varset cursong 1
/varset exper $char(exp)
/call Sing $int($a(0,$cursong))
/varset t0 33
:Loop
/if n $cursong==1 /if n $t1>0 /varadd cursong 1
/if n $t1<=0 {
/varset t1 1400
/stopsong
/varset cursong 1
/varset t0 0
}
/if n $t0<=0 /call Sing $int($a(0,$cursong))
/call circ $p0 $p1 $p2
/doevents
/goto :Loop
/return
Sub Sing
/varset t0 33
/stopsong
/cast $p0
/varadd cursong 1
/if n $cursong>$nsongs /varset cursong 1
/doevents
/return
sub circ
/face heading $calc($heading($p0,$p1)+90+$calc($p2-$distance($p0,$p1))/2)
/return
Sub Event_MissedNote
/varcalc cursong $cursong - 1
/if n $cursong<1 /varset cursong 1
/call Sing $cursong
/doevents
/return
Sub Event_Slow
/if n $cursong!=1 {
/varset cursong 1
/varset t0 0
/doevent
}
/return
Sub Event_Outof
/varset t0 0
/varadd targcount 1
/if n targcount<=15 /if $target(hp)<"100" {
/varset targcount 0
/tar npc raptor
}
/doevents
/return
Sub Event_Recovered
/delay .4
/doevents
/return
Sub Event_NeedTarget
/varadd cursong 1
/if n $cursong>nsongs /varset cursong 1
/tar npc raptor
/return
Sub Event_Exp
/varset xpleft $calc(100-$char(exp))
/varset aaleft $calc(100-$char(aa,exp))
/varcalc exper $char(exp)-$exper
/varcalc aaxper $char(aa,exp)-$aaxper
/echo XP:$exper% AA:$aaxper% Xp Left:$xpleft% AA Left:$aaleft%
/varset exper $char(exp)
/varset aaxper $char(aa,exp)
/tar npc raptor
/return
Sub Event_SpawnCheck
| /ooc Big Island raptors
/return

Code: Select all
sub circ
/if n $distance($p0,$p1)<($p2/2){
/face heading $calc($heading($p0,$p1)+180)
} else {
/face heading $calc($heading($p0,$p1)+$calc(90*$calc($p2/$distance($p0,$p1))))
}
| /echo $distance($p0,$p1)
/return

Code: Select all
Sub Event_MissedNote
/varcalc cursong $cursong - 1
/if n $cursong&1 /varset cursong 1
/call Sing $cursong
/doevents
/return
Code: Select all
/call Sing $int($a(0,$cursong))Code: Select all
#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 experience!!"
#define exper V2
Sub Main
/if $p0=="" /return
/if $p0==NULL /return
/varset exper $char(exp)
:Loop
/if n $CastTimer<=0 /call Sing
/call circ $p0 $p1 $p2
/doevents
/goto :Loop
/return
Sub Sing
/if n $char(buff,"Selo`s Accelerando")==0 {
/if n $char(gem,"Selo`s Accelerando")==-2 {
/if $CastTimer==0 {
/stopsong
}
} else /if $CastTimer==0 {
/sit off
/varset CastTimer 35
/cast $char(gem,"Selo`s Accelerando")
}
/if n $char(hp,pct)&70 /call healme
/if n $char(hp,pct)&90 /call damage
/return
sub circ
/if n $distance($p0,$p1)&($p2/2){
/face heading $calc($heading($p0,$p1)+180)
} else {
/face heading $calc($heading($p0,$p1)+$calc(90*$calc($p2/$distance($p0,$p1))))
}
/echo $distance($p0,$p1)
/return
Sub Event_MissedNote
/call Sing
/return
Sub Event_Slow
/call Sing
/return
Sub Event_Recovered
/call Sing
/return
Sub Event_NeedTarget
/tar npc
/return
Sub Event_Exp
/varcalc exper $char(exp)-$exper
/echo $exper%
/varset exper $char(exp)
/tar npc
/return
Sub healme
/if n $char(buff,"Hymn of Restoration")==0 {
/if n $char(gem,"Hymn of Restoration")==-2 {
/if $CastTimer==0 {
/stopsong
}
} else /if $CastTimer==0 {
/sit off
/varset CastTimer 35
/cast $char(gem,"Hymn of Restoration")
}
/call Sing
/return
Sub damage
/if n $char(buff,"Chords of Dissonance")==0 {
/if n $char(gem,"Denon's Disruptive Discord")==-2 {
/if $CastTimer==0 {
/stopsong
}
} else /if $CastTimer==0 {
/sit off
/varset CastTimer 40
/cast $char(gem,"Denon's Disruptive Discord")
}
}
/call Sing
/return