OSRS Plugin API
    Preparing search index...

    Class NpcType

    Class representing the base data of an NPC type.

    Implements

    Index

    Methods

    • Returns the type of the current entity.

      Returns TypecodeEntityType

      enum designating the type of the current entity.

      local loc = osrs.Engine.Decoders.decodeLocType(osrs.gamevals.loctypes.poh_portal_teak_empty)
      if(loc:getEntityType() == osrs.TypecodeEntityType.LOC) then
      osrs.print("Found type LOC")
      end

      local lesserdemon = osrs.Engine.Decoders.decodeNpcType(osrs.gamevals.npctypes.lesser_demon)
      if(lesserdemon:getEntityType() == osrs.TypecodeEntityType.NPC) then
      osrs.print("Found type NPC")
      end
    • Gets the id of the current datatype. Data types will return their type ID, which will match the id in gamevals.

      Returns number

      id of the current entity.

      local loc = osrs.Engine.Decoders.decodeLocType(osrs.gamevals.loctypes.poh_portal_teak_empty)
      if(loc:getEntityType() == osrs.TypecodeEntityType.LOC) then
      osrs.print("Found type LOC")
      end

      local lesserdemon = osrs.Engine.Decoders.decodeNpcType(osrs.gamevals.npctypes.lesser_demon)
      if(lesserdemon:getEntityType() == osrs.TypecodeEntityType.NPC) then
      osrs.print("Found type NPC")
      end
    • Returns the name of the entity.

      Returns string

      Returns the name of the entity as a string.

      local picked = osrs.Engine.MousePickingHelper.getPickedEntityTypecodes()
      for index, entity in pairs(picked) do
      local var = entity:getEntityTypeData()
      if(var ~= nil) then
      osrs.print(var:getName())
      end
      end
    • Table of available ops that can be performed on this NPC.

      Returns OpTable

    • Tile size of NPC.

      Returns number

    • Table containing stats for this NPC.

      Returns NPCStats

    • Returns the type of the npc.

      Returns number

      Returns the category number of the npc.

      npcs = osrs.ClientOp.getNpcIdAll()
      for index, npc_id in pairs(npcs) do
      npc = osrs.ClientOp.getNpcObj(npc_id)
      if npc:getType() == 1540 then
      osrs.print("I am a thrall!")
      end
      end