Djinni Wiki

function GetFirstObjectInShape (int nShape, float fSize, location lTarget, int bLineOfSight=FALSE, int nObjectFilter=OBJECT_TYPE_CREATURE, vector vOrigin=[0.0,0.0,0.0], float fExtConeInflectionDist = 0.5)

Get the first object in nShape

  • nShape: SHAPE_* -
  • fSize:
    • If nShape = SHAPE_SPHERE, this is the radius of the sphere
    • If nShape = SHAPE_SPELLCYLINDER, this is the length of the cylinder
    • If nShape = SHAPE_CONE, kat rozwarcia w stopniach
    • If nShape = SHAPE_CUBE, this is half the length of one of the sides of the cube
    • If nShape = SHAPE_EXTENDED_CONE, angle in degrees -
  • lTarget: This is the centre of the effect, usually GetSpellTargetPosition(), or the end of a cylinder or cone. -
  • bLineOfSight: This controls whether to do a line-of-sight check on the object returned. (This can be used to ensure that spell effects do not go through walls.) -
  • nObjectFilter: This allows you to filter out undesired object types, using bitwise "or". For example, to return only creatures and doors, the value for this parameter would be OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR -
  • vOrigin: This is only used for cylinders and cones, and specifies the origin of the effect(normally the spell-caster's position). -
  • fExtConeInflectionDist: Only for EXTENDED_CONE. Distance from the cone origin (in cone space, origin = 0, cone end = 1) where cone's angle is reached. Extended cone starts with 180 degrees and the angle is interpolated.
  • Return value on error: OBJECT_INVALID

  • Return type: object
  • Include file: nwscriptdefn