Updated follower bot with new gwa2.
Had to disable the fight function, something must have changed because it crashes every time with that on, anyone know a fix?
Code:
Func AggroMoveToEx2($x, $y, $s = "", $z = 1200)
$random = 50
$iBlocked = 0
Move($x, $y, $random)
$lMe = GetAgentByID(-2)
$coordsX =DllStructGetData($lMe, "X")
$coordsY = DllStructGetData($lMe, "Y")
Do
$oldCoordsX = $coordsX
$oldCoordsY = $coordsY
$nearestenemy = GetNearestEnemyToAgent(-2)
$lDistance = GetDistance($nearestenemy, -2)
If $lDistance < $z AND DllStructGetData($nearestenemy, 'ID') <> 0 Then
Fight($z, $s)
Move($x, $y, $random)
EndIf
$lMe = GetAgentByID(-2)
$coordsX =DllStructGetData($lMe, "X")
$coordsY = DllStructGetData($lMe, "Y")
;~ If $oldCoordsX = $coordsX AND $oldCoordsY = $coordsY Then
;~ $iBlocked += 1
;~ Move($coordsX, $coordsY, 500)
;~ RndSlp(350)
;~ Move($x, $y, $random)
;~ EndIf
Until ComputeDistanceEx($coordsX, $coordsY, $x, $y) < 250 OR $iBlocked > 20
EndFunc
Func Fight($x, $s = "enemies")
local $TimerToGetOut = TimerInit()
Do
$useSkill = -1
$target = GetNearestEnemyToAgent(-2)
$distance = GetDistance($target, -2)
If DllStructGetData($target, 'ID') <> 0 AND $distance < $x Then
ChangeTarget($target)
RndSlp(150)
CallTarget($target)
RndSlp(150)
Attack($target)
RndSlp(150)
ElseIf DllStructGetData($target, 'ID') = 0 OR $distance > $x Then
exitloop
EndIf
For $i = 0 To $totalskills
$targetHP = DllStructGetData(GetCurrentTarget(),'HP')
if $targetHP = 0 then ExitLoop
$distance = GetDistance($target, -2)
if $distance > $x then ExitLoop
$TargetAllegiance = DllStructGetData(GetCurrentTarget(),'Allegiance')
if $TargetAllegiance = 0x1 OR $TargetAllegiance = 0x4 OR $TargetAllegiance = 0x5 OR $TargetAllegiance = 0x6 Then ExitLoop
$TargetIsDead = DllStructGetData(GetCurrentTarget(), 'Effects')
If $TargetIsDead = 0x0010 Then ExitLoop
$TargetItem = DllStructGetData(GetCurrentTarget(),'Type')
if $TargetItem = 0x400 then ExitLoop
$energy = GetEnergy(-2)
$recharge = DllStructGetData(GetSkillBar(), "Recharge" & $i+1)
$adrenaline = DllStructGetData(GetSkillBar(), "Adrenaline" & $i+1)
If $recharge = 0 And $energy >= $intSkillEnergy[$i] And $adrenaline >= ($intSkillAdrenaline[$i]*25 - 25) Then
$useSkill = $i + 1
$variabletosort = 0
UseSkill($useSkill, $target)
RndSlp($intSkillCastTime[$i]+500)
EndIf
$target = GetNearestEnemyToAgent(-2)
Attack($target)
RndSlp(150)
if $i = $totalskills then $i = -1 ; change -1
Next
$TargetAllegiance = DllStructGetData(GetCurrentTarget(),'Allegiance')
$TargetIsDead = DllStructGetData(GetCurrentTarget(), 'Effects')
$targetHP = DllStructGetData(GetCurrentTarget(),'HP')
$TargetItem = DllStructGetData(GetCurrentTarget(),'Type')
Until DllStructGetData($target, 'ID') = 0 OR $distance > $x OR $TargetAllegiance = 0x1 OR $TargetAllegiance = 0x4 OR $TargetAllegiance = 0x5 OR $TargetAllegiance = 0x6 OR $TargetIsDead = 0x0010 OR $targetHP = 0 OR $TargetItem = 0x400 OR TimerDiff($TimerToGetOut) > 240000
EndFunc