im not 100% sure what i did but i have it working now
;------------------------------------------------------
sub attack
FINDITEM %creature G_6
if ( #findkind = -1 )
{
gosub loot
}
if ( #findkind = -1 ) && ( %noloot = #TRUE )
{
event pathfind 362 15
wait 20
event pathfind 365 15
wait 20
}
if #findkind <> -1
{
attackloop:
set %attacking #TRUE
if #findcnt > 0 && ( %spellTimer < #scnt2 )
gosub execSec
if #FINDKIND = -1 4
finditem %creature
set %attack #findid
set #LTARGETID %attack
event macro 27 0
if #findid <> %attack
{
set %attack #findid
set #LTARGETID %attack
event macro 27 0
goto attackloop
}
}
set %attacking #false
return
;------------------------------------------------
sub loot
;gosub get claw to start looting
;wait 90s for claw to finish and respawn time to pass
FINDITEM %CORPSE G_3
if ( #FINDKIND > -1 ) && ( %attacking = #false )
{
set %noloot #false
goto lootloop
}
if #findkind = -1
{
set %noloot #true
}
lootloop:
set %newcorpse #findID
set #LOBJECTID %newcorpse
set %opencorpse #CONTID
nextCPos 25 450
wait 20
EVENT MACRO 17
wait 20
FINDITEM %loot C_ , %opencorpse
if #findcnt > 0
{
exevent drag #findID
wait 10
EXEVENT DROPC %lootbag
wait 10
}
FINDITEM POF C_ , %opencorpse
if #findcnt > 0
{
exevent drag #findID #findstack
wait 10
EXEVENT DROPC #BACKPACKID
wait 10
}
ignoreitem %newcorpse 1
return
;------------------------------------------------
sub execSec
cmppix 3 f
{
event macro 36 0
wait 5
}
return
;------------------------------------------------