dragonfire
Member
- Joined
- Dec 14, 2006
- RedCents
- 722¢
I am running a slightly modified SKHunter mac that runs around killing trash (one mob only in list - wolf), every so often my merc healer gets mobbed by orcs. The SK ignores them because they are not attacking the SK and they are not in the list of mobs. The XTarget TLO gives me a number, but how can I look at what is attacking the merc and then attack it as if it is attacking me. I am a bit stumped on the extended target thing.
Here is the code for killing adds and acquiring a target.
Thanks for any help.
Here is the code for killing adds and acquiring a target.
Thanks for any help.
Rich (BB code):
:KillAdds
/if (${RV_HasTarget}) /call MoveToMob
/if (${RV_HasTarget}) /call CombatSub
/if (${RV_HasTarget}) /call MoveToMob
/if (${RV_HasTarget} && (${Defined[RV_LootArray]} || ${RV_LootAllItems})) /call LootMob
/if (${RV_DisplayStats}) /call DisplayStats
/call ResetSub
Rich (BB code):
|--------------------------------------------------------------------------------
|SUB: Aquire Target
|--------------------------------------------------------------------------------
Sub GetTarget
/target clear
/keypress back
/declare RV_CurrentRadius int local
/declare RV_TargetSub int local
:Acquire
/for RV_CurrentRadius 100 to ${RV_MaxRadius} step 100
/for RV_TargetSub 1 to ${RV_MobArray.Size}
/squelch /target radius ${RV_CurrentRadius} nopcnear notid ${RV_InvalidTargetID} npc "${RV_MobArray[${RV_TargetSub}]}"
/varset RV_MyTargetID ${Target.ID}
/varset RV_MyTargetDead 0
/if (${Target.ID}) {
/if (${Int[${Target.PctHPs}]}<100) {
/echo (${Int[${Target}]}
/echo ${Target} NOT at Full Health, picking another...
/varset RV_InvalidTargetID ${Target.ID}
/call ResetSub
/goto :Acquire
}
/if (${Int[${Target.Z}]}<${RV_MinZRange}) {
/echo Mob is BELOW Min Z Range, picking another...
/varset RV_InvalidTargetID ${Target.ID}
/call ResetSub
/goto :Acquire
}
/if (${Int[${Target.Z}]}>${RV_MaxZRange}) {
/echo Mob is ABOVE Max Z Range, picking another...
/varset RV_InvalidTargetID ${Target.ID}
/call ResetSub
/goto :Acquire
}
/varset RV_HasTarget 1
/varset RV_MyTargetName ${Target.CleanName}
/echo Acquired ${Target.CleanName} at range ${Int[${Target.Distance}]}
/return
}
/next RV_TargetSub
/delay 2
/next RV_CurrentRadius
/if (!${Target.ID}) {
/delay 2s
/varcalc RV_FailCounter ${RV_FailCounter}+1
/echo Failed to Acquire Target in Range ${RV_MaxRadius} ${RV_FailCounter} Time(s)
/if (${RV_FailCounter}>=${RV_FailMax}) {
/echo Waiting for Respawns, Resetting Failure Counter...
/delay 60s
/varset RV_FailCounter 0
}
/goto :Acquire
}
/return