• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Monsters in Proximity

    Discussion in 'Community Developer Forum' started by Mrydeen, Feb 4, 2015.

    1. Mrydeen

      Mrydeen Member

      Joined:
      Nov 9, 2014
      Messages:
      59
      Likes Received:
      0
      Trophy Points:
      6
      Anyone figured out how to write a code to detect monsters in Proximity?
       
    2. kagamihiiragi17

      kagamihiiragi17 Community Developer

      Joined:
      Jun 24, 2014
      Messages:
      873
      Likes Received:
      25
      Trophy Points:
      0
      Query the GameObjectManager with the restrictions that you are looking for. Plenty of Combat Routines have code that does this that you can look through.

      From Magitek:

      Code:
      target =
                                  (from unit in GameObjectManager.GetObjectsOfType<BattleCharacter>()
                                   where unit.Location.Distance(Core.Player.Location) < Magitek.WindowSettings.TargetDistance
                                   where unit.ObjectId == (selection.GameObject as BattleCharacter).CurrentTargetId
                                   select unit).FirstOrDefault();
       

    Share This Page