EDIT: Fixed Cleric Nuke IF Statement.
Code: Select all
#turbo
#Event Enraged "has become ENRAGED"
#Event Offrage "is no longer enraged"
Sub Main
/declare readyforpull global
/declare currentmob global
/declare mobtokill global
/declare Xcur global
/declare Nuke global
/declare Ycur global
/declare ThereYet global
/declare AnchorX global
/declare AnchorY global
| NAME OF MOB YOU WANT TO KILL.
/varset mobtokill "an orc penis"
| Anchor X
/varset AnchorY 0
| Anchor Y
/varset AnchorX 0
|Main Loop
:Loop
/target myself
/cast item "Kizrak's Gauntlets of Battle"
/delay 40
/varset Nuke 0
/call Pull
:waitforrange
/face id @currentmob
/delay 1
/if n $target(distance)<20 {
/call Attack
} else {
/echo $char(target) Not in range, holding!
/goto :waitforrange
}
/goto :Loop
/return
Sub Pull
/varset readyforpull 0
/varset currentmob 0
:search
|Search for spawn
/varset currentmob $searchspawn(npc,"@mobtokill")
|Make sure spawn is in range
/if n $spawn(@currentmob,distance)<325 {
/varset readyforpull 1
}
/if n @readyforpull==1 {
/echo Found ID @currentmob pulling now.
:GoingToMob
/varset ThereYet 0
/face id @currentmob
/delay 4
| If we are not within incite range then make sure we are on autorun.
/if n $spawn(@currentmob,distance)>100 /sendkey down up
| Current Loc
/varset Xcur $char(x)
/varset Ycur $char(y)
| Obstacle routine if stuck
/delay 1
/if @Xcur==$char(x) /if @Ycur==$char(y) /call Obstacle
| End movement when near to point.
/if n $spawn(@currentmob,distance)<100 {
/sendkey up up
/varset ThereYet 1
}
/delay 0
/if @ThereYet!=1 /goto :GoingToMob
/echo We have arrived at mob ID @currentmob
} else {
/echo No mobs in range, waiting.
/delay 50
/goto :search
}
|Target Mob, Face Anchor.
/target id @currentmob
/face loc @AnchorY, @AnchorX
/delay 5
|Do Incite, And Run to Homepoint.
/disc Incite
:GoingToAnchor
/varset ThereYet 0
/face loc @AnchorY, @AnchorX
/delay 0
/if n $distance(@AnchorY,@AnchorX:$char(x),$char(y))>30 /sendkey down up
| Current Loc
/varset Xcur $char(x)
/varset Ycur $char(y)
| Obstacle routine if stuck
/delay 1
/if @Xcur==$char(x) /if @Ycur==$char(y) /call Obstacle
| End movement when near to point.
/if n $distance(@AnchorY,@AnchorX:$char(y),$char(x))<30 {
/sendkey up up
/varset ThereYet 1
}
/delay 0
/if @ThereYet!=1 /goto :GoingToAnchor
/echo We have arrived at our anchor.
/return
sub Obstacle
| We appear to be stuck so try and backup and strafe sideways
/sendkey up up
/sendkey down down
/delay 2
/sendkey up down
/sendkey down ctrl
/if n $rand(99)>50 {
/sendkey down right
} else {
/sendkey down left
}
/delay 3
/sendkey up right
/sendkey up left
/sendkey up ctrl
/sendkey down up
/return
sub Attack
/declare targetarray array
/declare MyXLOC global
/declare MyYLOC global
/declare ObstacleCount global
/declare InCombat global
/varset targetarray(0) "$target(name,clean)"
/varset targetarray(1) $target(level)
/varset targetarray(2) $target(name)
/varset targetarray(3) $target(id)
/varset InCombat 0
/echo Fighting a level @targetarray(1) @targetarray(0)
/face id @currentmob
/call MovetoMob
:CloserAF
/if "$target(id)"!="@targetarray(3)" /goto :EndAF
/doevents
/if n @InCombat==1 /call AttackRoutine
/goto :CloserAF
:EndAF
/echo The level @targetarray(1) @targetarray(0) is dead...
/sendkey up up
/sendkey up down
/attack off
/varset InCombat 0
/varset targetarray(3) 0
/press Num_5
/return
sub AttackRoutine
/if n $target(distance)>10 /press up
/if n $target(distance)<5 /press down
/if n $target(distance)<15 /attack on
/if n $target(distance)>15 {
/attack off
/call MovetoMob
}
/face id @currentmob
/if n $target(distance)<12 {
/if n $char(ability,"Kick")>0 /doability "Kick"
}
/if (n @Nuke==0 && n $target(hp,pct)<15) {
/tell Cleric Nuke
/varset nuke 1
}
/return
sub MoveToMob
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstacleCount 0
/if n $target(distance)<=15 {
/face id @currentmob
/varset InCombat 1
/return
}
/doevents
/sendkey down up
:Movementloop
/varadd ObstacleCount 1
/if $target()=="FALSE" /return
/face id @currentmob
/if n $target(distance)<=10 {
/face id @currentmob
/sendkey up up
/varset InCombat 1
/return
}
/if @ObstacleCount>=3 {
/call CheckObstacle
/goto :Movementloop
}
/if n $target(distance)>10 /goto :MovementLoop
/return
sub CheckObstacle
/if n @MyXLOC==$char(x) /if n @MyYLOC==$char(y) /call HitObstacle
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstacleCount 0
/return
sub HitObstacle
/sendkey up up
/sendkey down down
/delay 3
/sendkey up down
/sendkey down ctrl
/if n $rand(99)>50 {
/sendkey down right
} else {
/sendkey down left
}
/delay 5
/sendkey up right
/sendkey up left
/sendkey up ctrl
/sendkey down up
/return
sub Event_Enraged
/if $target()=="TRUE" {
/attack off
/varset InCombat 0
:EnrageDelay
/if $target()=="TRUE" /if n @InCombat==0 {
/doevents
/goto :EnrageDelay
}
}
/return
sub Event_Offrage
/if $target()=="TRUE" {
/varset InCombat 1
/attack on
}
/return
