Hey I have made a plugin that will automatically activate and deactivate stealth while gathering. Stealthy But I just now realised that it will not only use stealth on hostile mobs, but on every mob. Even neutral ones. Does anyone have an idea how to sort out hostile mobs ? I'm currently using: Code: GameObjectManager.GetObjectsOfType<BattleCharacter>().Where((u, i) => u.Type == GameObjectType.BattleNpc && u.Location.Distance(Core.Player.Location) < 30 && u.CanAttack && u.IsVisible).FirstOrDefault() != null
There isn't an api for checking a mobs reaction to the player currently, ill see about adding one. Also, you can safely assume that everything returned from getobjectsoftype will be x type, so you can remove the u.Type == GameObjectType.BattleNpc to save from having todo an extra memory read.
Ok, thank you for the answer I will remove "u.Type == GameObjectType.BattleNpc". Looking forward to the hostile enemy api addition.
You can now do battlechar.StatusFlags.HasFlag(StatusFlags.Hostile) to check if a mob will aggro when you are near it. You should also check if the npc is much lower level as low enemies that are hostile wont aggro higher level players, im not sure what the breakpoint is for this.