DeadZone Community Packages
    Preparing search index...

    Class MenuEntry

    Creating a menu entry allows you to execute custom actions using the action utility. You can find the menu entry for an action by enabling Developer Tools under Extras in DZ API and viewing the logs after performing an action then replicating the entry. It's important you only action menu entries which are valid, so ensure you have replicated the values and identified any dynamic parts prior to sending them.

    Dynamic values such as the index of the NPC you'd like to interact with or an object's position in the scene differs everytime. You can't provide static values for these type of interaction or your action will not function between different areas or after a client restart. To accomplish this, use the various helper methods available such as GameObject Get All or NPC Get All to grab them and retrieve the target value. For example, objects require their SceneMinLocation or LocalLocation (SceneX / SceneY) for param0 and param1 to interact with them.

    We recommend using the Interact utility for performing actions, unless unsupported.

    Implements

    Implemented by

    Index

    Constructors

    • Internal

      It's advisable to use the static methods create or createItem methods for new menu entries rather than the constructor!

      Parameters

      • option: string

        The left-side option of the menu, typically the action's name

      • target: string

        The right-side option of the menu, typically the target's name

      • id: number

        Typically refers to a unique index or ID

      • itemID: number
      • opCode: number

        The MenuAction ID

      • param0: number

        Typically a dynamic value

      • param1: number

        Varies between static or dynamic depending on the interaction

      • forceLeftClick: boolean

        Typically false, only set true for specific actions related to withdrawing / depositing from a bank and other minor instances

      • worldViewID: number

        The world view this action is relates to. As of current, this value can be set to -1

      Returns MenuEntry

    Properties

    forceLeftClick: boolean
    id: number
    itemID: number
    opCode: number
    option: string
    param0: number
    param1: number
    target: string
    worldViewId: number

    Methods

    • Returns an Actor which could be of type Npc or Player. Make use of isNpc or isPlayer to determine the type and use the static convert functions for editor clarity on the Actor class

      Returns Actor

    • Create a new Menu Entry with the provided values

      Parameters

      • option: string

        The left-side option of the menu, typically the action's name

      • target: string

        The right-side option of the menu, typically the target's name

      • id: number

        Typically refers to a unique index or ID

      • opCode: number

        The MenuAction ID

      • param0: number

        Typically a dynamic value

      • param1: number

        Varies between static or dynamic depending on the interaction

      • forceLeftClick: boolean

        Typically false, only set true for specific actions related to withdrawing / depositing from a bank and other minor instances

      Returns MenuEntry

      • A new Menu Entry with the provided values
    • Create a new Menu Entry for item interactions using the provided values

      Parameters

      • option: string

        The left-side option of the menu

      • target: string

        The right-side option of the menu

      • itemActionID: number

        The ID of the ItemAction you'd like to execute

      • itemID: number

        The ID of the item you wish to interact with

      • opCode: number

        Typically either CC_OP or CC_OP_LOW_PRIORITY depending on the action

      • itemPosition: number

        The item's position in your inventory starting at 0 for the top left slot. You can use GetItemPosition method for dynamic position information

      • param1: number

        Typically either Normal or Banking inventory param ID

      • forceLeftClick: boolean

        Typically false, only set true for specific actions related to withdrawing / depositing from a bank and minor instances

      Returns MenuEntry

      • A new Menu Entry with the provided values