evalTargetDefault = function(address, target) -- Check if still valid target if not target:exists() then print("Target not exists"); return false end -- Can't have self as target if( address == player.Address ) then return false; end -- If lootable, then dead target:updateLootable() if( target.Lootable ) then print("Target marked lootable"); return false; end target:updateAlive() if( not target.Alive ) then return false; end target:updateTargetPtr() target:updateType() player:updateBattling() if player.Battling then -- Battling flag is on if target.TargetPtr == player.Address or -- We are being targeted target:targetIsFriend(true) then -- Or friend is being targeted if target.Type ~= PT_PLAYER or settings.profile.options.PVP ~= false then -- Check PVP return true end end end -- Check height difference target:updateXYZ() player:updateXYZ() if( math.abs(target.Y - player.Y) > 45 ) then print("Target delta Y exceeds constraints"); return false; end -- check distance to target against MAX_TARGET_DIST if( distance(player.X, player.Z, target.X, target.Z) > settings.profile.options.MAX_TARGET_DIST ) then print("Target distance exceeds constraints"); return false; -- he is not a valid target end; -- target is to strong for us if (settings.profile.options.PARTY_INSTANCE ~= true ) then if( target.MaxHP > player.MaxHP * settings.profile.options.AUTO_ELITE_FACTOR ) then print("Target appears too strong, but ignoring this constraint.") end; end return true; end