P.S.
I blame my horrible spelling on my keyboard
Moderator: MacroQuest Developers
Code: Select all
/macro advchant 123 0 40 4
Code: Select all
| - chant.mac - By Raebis
| Version: REV5c Jan 03 15:00
|
| This mac is used mostly for big open zones with not a lot of
| big hills (cause hills cause pain - unless you have levitate)
|
| Features:------------------------------------------------------------------------
|
| * Automatically selects high light blue, dark blue, or white mob
| * Runs to mob before targeting it (Stealth! No cross-zone targeting!)
| * Aggro/Add Detection: Automatically targets and kites aggroed mobs (adds)
| * Ignores greens and low light blues unless they are aggroed (adds)
| * Caster Detection: Automatically will switch target to aggroed casting mobs
| * Compatible with level 49 and level 6 selos
| * Auto Healing: If health gets low, it will automatically heal
| * Fleeing Mob Catcher: If mob runs away, macro keeps you in range!
| * Detects WMS (Warping Mob Syndrom) and gets a new target if a mob warps away!
| * NEW: Rubber Anchor: kites mobs closest to macro starting point - no wandering!
|
| ---------------------------------------------------------------------------------
|
| usage: chant.mac <DOTs/LVL6 Selos> <49selo> <radius> [<heal song>]
|
|
| Usage Examples:
| -Scenario 1: If you are using...
| ...DOTs in Gems 4, 5, 6, and 7
| ...Level 49 Selo in Gem 2
| ...Hymn of Restoration in Gem 1
| ...Radius of 55
| syntax: /mac chant 4567 2 55 1
|
| -Scenario 2: If you are using...
| ...DOTs in Gems 6 and 7
| ...Level 6 Selo in gem 3
| ...Hymn of Restoration in gem 8
| ...Radius of 80
| syntax: /mac chant 673 0 80 8
|
|
| If <heal song> is defined then when health goes below @HealthMin (default is 70%)
| it will replace the first song in <DOTs> with <heal song> until health is above
| @HealthMax (default is 85%)
|
| If <selo> is 0 then the macro will not try to cast selos every 150 seconds
|
| Note about the rubber anchor:
| The macro will target the mob closest to the RubberAnchor (your /loc when first
| starting the macro)
|
| REV5b was Tested in EW for bout an hour
|
| Warning: You may wander from your starting point but after killing a mob, the
| next mob that the macro targets will be closest to your starting point
|
| Note: Rev information moved to the top
|
#event NeedTarget "You must first select a target for this spell!"
#event Exp "You gain "
#event Died "You have entered"
#event Caster " begins to cast a spell."
#turbo
Sub Main(DOTs,Selos,CRadius,Health)
/zapvars
/if $defined(CRadius)==false {
/echo usage: chant.mac <DOTs, LVL6 Selos> <49selo> <radius> [<heal song>]
/return
}
/declare CirR global
/declare Songs array
/declare nSongs global
/declare CurSong global
/declare PrevSong global
/declare Exper global
/declare AAExp global
/declare SongTimer timer
/declare SeloSong global
/declare HealSong global
/declare OrigSong global
/declare HealthMin global
/declare HealthMax global
/declare DBLevel global
/declare TargetUpNext global
/declare RubberX global
/declare RubberY global
/declare EachSong local
/varset nSongs $strlen(@DOTs)
/for EachSong 1 to @nSongs
/varset Songs(@EachSong) $mid($calc(@EachSong-1),1,@DOTs)
/echo Song @EachSong: $char(gem,@Songs(@EachSong))
/next EachSong
/if n @Selos!=0 {
/varset SeloSong @Selos
/echo Selo's: $char(gem,@SeloSong)
} else {
/varset SeloSong 0
/echo Not using level 49 Selos.
}
/if $defined(Health)!=false {
/varset HealSong @Health
/echo Healsong: $char(gem,@HealSong)
} else {
/echo No HealSong. Please watch your health.
/varset HealSong 0
}
/varset CirR @CRadius
/echo Radius: @CRadius
/varset OrigSong @Songs(1)
/varset CurSong 1
/varset Exper $char(exp)
/varset AAExp $char(aa,exp)
/varset SongTimer 1
/varset DBLevel $int($calc($calc($char(level)*.7)+1))
/varset HealthMin 70
/varset HealthMax 85
/varset TargetUpNext 0
/varset RubberX $char(x)
/varset RubberY $char(y)
/echo Rubber Anchor dropped at @RubberX,@RubberY
:Loop
/if n @TargetUpNext<=0 /if n $target(id)<=0 {
/call gettarget
}
/if n @TargetUpNext>0 /if n $target(id)>0 {
/echo User Selected Target or Aggroed while running
/varset TargetUpNext 0
}
/if n $target(distance)>1000 /if n $target(hp,pct)<=50 {
/cleanup
/echo Target Warped... Getting a new target
/call GetTarget
}
/if n @HealSong!=0 /if n $char(hp,pct)<@HealthMin {
/if n @Songs(1)!=@HealSong {
/echo Healing On - Health: $char(hp,pct)% to @HealthMax%
/varset Songs(1) @HealSong
}
}
/if n @HealSong!=0 /if n $char(hp,pct)>=@HealthMax {
/if n @Songs(1)!=@OrigSong {
/echo Healing Off
/varset Songs(1) @OrigSong
}
}
/if n @SeloSong!=0 /if $char(casting)==FALSE /if n $char(buff,"$char(gem,@SeloSong)")==0 /varset SongTimer 1
/if n @SongTimer>0 /if $char(casting)==FALSE /call SongFailed
/call Circ
/doevents
/delay 0
/goto :Loop
/return
Sub Event_Timer(TimerName)
/if @TimerName==SongTimer {
/if n @SeloSong!=0 /if n $char(buff,"$char(gem,@SeloSong)")==0 {
/delay 2
/stopsong
/cast @SeloSong
/varset PrevSong 0
/varset SongTimer 30
/call Circ
/doevents
/return
}
/if n @SeloSong!=0 /if n $char(buff,"$char(gem,@SeloSong)")!=0 /if n $char(buff,$char(buff,"$char(gem,@SeloSong)"),duration)<=6 {
/delay 2
/stopsong
/cast @SeloSong
/varset PrevSong 0
/varset SongTimer 30
/call Circ
/doevents
/return
}
/delay 2
/stopsong
/cast @Songs(@CurSong)
/varset PrevSong @CurSong
/varadd CurSong 1
/varset SongTimer 30
/call Circ
/doevents
/if n @CurSong>@nSongs /varset CurSong 1
}
/return
Sub Circ
/declare CirX local
/declare CirY local
/if n @TargetUpNext!=0 {
/varset CirX $spawn(@TargetUpNext,y)
/varset CirY $spawn(@TargetUpNext,x)
/if n $spawn(@TargetUpNext,distance)<=$calc(@CirR*2) {
/target id @TargetUpNext
/varset TargetUpNext 0
}
}
/if n $target(id)>0 {
/varset CirX $target(y)
/varset CirY $target(x)
}
/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 SongFailed
/if n @PrevSong==0 {
/varset SongTimer 1
/return
}
/varset CurSong @PrevSong
/varset SongTimer 1
/return
Sub Event_NeedTarget
/if n @TargetUpNext<=0 /call GetTarget
/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 EXP: @Exper%:$char(exp)% - AAXP: @AAExp%:$char(aa,exp)% - $calc($running/60) minutes
/varset Exper $char(exp)
/varset AAExp $char(aa,exp)
/varset DBLevel $int($calc($calc($char(level)*.7)+1))
/if n @TargetUpNext==0 /if n $target(id)==0 /call gettarget
/return
Sub GetTarget
/declare MobID local
/declare SRadius local
/varset MobID $searchspawn(npc,radius:$calc(@CirR*2))
/if n @MobID!=0 /if n $spawn(@MobID,speed)>100 {
/target id @MobID
/echo Kiting aggro'd mob: $target(name,clean)
/return
}
/varset MobID 0
/for SRadius 0 to 10000 step 100
/varset MobID $searchspawn(npc,range:@DBLevel:$char(level),loc:@RubberX:@RubberY,radius:@SRadius)
/if n @MobID!=0 {
/goto :Done
}
/next SRadius
/echo No mobs found, action required!
/beep
/echo Ending Macro
/beep
/endmac
:Done
/varset TargetUpNext @MobID
/echo Next: $spawn(@MobID,level) $spawn(@MobID,name,clean) - Distance: $spawn(@MobID,distance)
/return
Sub Event_Caster(CastText)
/declare CasterID local
/varset CasterID $searchspawn(name,"$left($calc($strlen("@CastText")-24),"@CastText")")
/if $spawn(@CasterID,type)!=NPC /return
/if n $target(id)==@CasterID /return
/if n $spawn(@CasterID,distance)<=$calc(@CirR*2) {
/target id @CasterID
/echo Targeting Caster: $spawn(@CasterID,name,clean)
}
/return

