Djinni Wiki
Advertisement

function GetNearestCreatureToLocation (int nFirstCriteriaType, int nFirstCriteriaValue, location lLocation, int nNth=1, int nSecondCriteriaType=-1, int nSecondCriteriaValue=-1, int nThirdCriteriaType=-1, int nThirdCriteriaValue=-1 )

Get the creature nearest to lLocation, subject to all the criteria specified.

  • nFirstCriteriaType: CREATURE_TYPE_*
  • nFirstCriteriaValue:
    • PROFILE_TYPE_* if nFirstCriteriaType was CREATURE_TYPE_CLASS
    • SPELL_* if nFirstCriteriaType was CREATURE_TYPE_DOES_NOT_HAVE_SPELL_EFFECT or CREATURE_TYPE_HAS_SPELL_EFFECT
    • TRUE or FALSE if nFirstCriteriaType was CREATURE_TYPE_IS_ALIVE
    • PERCEPTION_* if nFirstCriteriaType was CREATURE_TYPE_PERCEPTION
    • PLAYER_CHAR_IS_PC or PLAYER_CHAR_NOT_PC if nFirstCriteriaType was CREATURE_TYPE_PLAYER_CHAR
    • RACIAL_TYPE_* if nFirstCriteriaType was CREATURE_TYPE_RACIAL_TYPE
    • REPUTATION_TYPE_* if nFirstCriteriaType was CREATURE_TYPE_REPUTATION For example, to get the nearest PC, use (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC)
  • lLocation: We're trying to find the creature of the specified type that is nearest to lLocation
  • nNth: We don'
  • t have to find the first nearest: we can find the Nth nearest....
  • nSecondCriteriaType: This is used in the same way as nFirstCriteriaType to further specify the type of creature that we are looking for.
  • nSecondCriteriaValue: This is used in the same way as nFirstCriteriaValue to further specify the type of creature that we are looking for.
  • nThirdCriteriaType: This is used in the same way as nFirstCriteriaType to further specify the type of creature that we are looking for.
  • nThirdCriteriaValue: This is used in the same way as nFirstCriteriaValue to further specify the type of creature that we are looking for.
  • Return value on error: OBJECT_INVALID


  • Return type: object
  • Include file: nwscriptdefn
Advertisement