An open library of RPG Maker MZ plugins, powered by the community.

PGMZ - The Community-Driven Plugin Library for RPG Maker MZ

MZ plugins

NRP Get Item Common - NRP_GetItemCommon.js

Plugin desc : v1.021 Commonize the process of gaining items.

License :
・Copyright: Retained
・Commercial Use: Allowed
・Modification: Allowed
・Redistribution: Allowed
・Details: See Download Page / In-plugin documentation

Author : Takeshi Sunagawa (http://newrpg.seesaa.net/)

Website : https://github.com/NewRPGProject/MZMV_Plugin/blob/main/NRP_GetItemCommon.js

Desc page : http://newrpg.seesaa.net/article/484654978.html

Download Page : https://raw.githubusercontent.com/NewRPGProject/MZMV_Plugin/main/NRP_GetItemCommon.js

File name : NRP_GetItemCommon.js

Help of plugin :

Commonize the process of gaining items.
 * Although I refer to items in the following,
 * they are valid for all weapons, armors, and gold.
 * 
 * Automatically calls the Common Event when changing items.
 * In addition, information such as the item name
 * and the amount of change can be referenced by plugin commands.
 * This makes the gaining process common.
 * 
 * You can also prohibit the calling of common events
 * only while the specified switch is on.
 * 
 * -------------------------------------------------------------------
 * [Plugin Command MZ]
 * -------------------------------------------------------------------
 * Stores each item's information gained immediately
 * before in a variable.
 * If you specify a variable in the message,
 * such as ¥v[1], the value will be displayed.
 * ※If the target is "Gold", only the amount of change is valid.
 * 
 * ◆GetName
 * Stores the name of the last item gained in a variable.
 * 
 * ◆GetAmount
 * Stores the amount of the last item gained in a variable.
 * 
 * ◆GetDescription
 * Stores the description of the last item gained in a variable.
 * Line breaks are also useful.
 * 
 * ◆GetIcon
 * Stores the icon ID of the last item gained in a variable.
 * 
 * ◆GetCategory
 * Stores the category of the last item gained in a variable.
 * 
 * ◆GetId
 * Stores the ID of the last item gained in a variable.
 * 
 * ◆GetType
 * Stores the type of the last item gained in a variable.
 * Item, Weapon, and Armor, for each types.
 * 
 * For Item, the following applies.
 *   1: Regular Item, 2: Key Item, 3: Hidden Item A, 4: Hidden Item B
 * For Weapon and Armor, please refer to the database setting values.
 * 
 * ◆GetEquipType
 * Stores the equip type of the last item gained in a variable.
 * 
 * ◆GetMetaValue
 * Stores the meta value of the last item gained in a variable.
 * Only this item requires the meta name to be specified.
 * 
 * Meta value is a value defined by the user in the note field.
 * For example, suppose you write <Test:100>.
 * If you specify the "Test" part as the meta name,
 * 100 will be stored in the variable.
 * 
 * -------------------------------------------------------------------
 * [Plugin Command MV]
 * -------------------------------------------------------------------
 * The functions are exactly the same as the MZ version,
 * so I'll skip them.
 * Call the following command.
 * ※No distinction is made between individual capital letters.
 *   Also, do not include [].
 * 
 * ◆GetName
 * NRP.GetItemCommon.GetName [VariableId]
 * 
 * ◆GetAmount
 * NRP.GetItemCommon.GetAmount [VariableId]
 * 
 * ◆GetDescription
 * NRP.GetItemCommon.GetDescription [VariableId]
 * 
 * ◆GetIcon
 * NRP.GetItemCommon.GetIcon [VariableId]
 * 
 * ◆GetCategory
 * NRP.GetItemCommon.GetCategory [VariableId]
 * 
 * ◆GetId
 * NRP.GetItemCommon.GetId [VariableId]
 * 
 * ◆GetType
 * NRP.GetItemCommon.GetType [VariableId]
 * 
 * ◆GetEquipType
 * NRP.GetItemCommon.GetEquipType [VariableId]
 * 
 * ◆GetMetaValue
 * NRP.GetItemCommon.GetMetaValue [MetaName] [VariableId]
 * 
 * -------------------------------------------------------------------
 * [Script]
 * -------------------------------------------------------------------
 * The following functions can be used in conditional branching scripts.
 * 
 * ◆I have obtained an item with the specified ID.
 * $gameParty.havedItem($dataItems[ID])
 * 
 * ◆I have obtained a weapon with the specified ID.
 * $gameParty.havedItem($dataWeapons[ID])
 * 
 * ◆I have obtained an armor with the specified ID.
 * $gameParty.havedItem($dataArmors[ID])
 * 
 * ※However, the acquisition experience will be effective
 *   after the plugin (ver1.02) is installed.
 *  Items that were sold or otherwise lost
 *   before that was introduced cannot be determined.
 * 
 * ◆Clear acquisition status
 * $gameParty.clearHavedItems()
 * 
 * -------------------------------------------------------------------
 * [Terms]
 * -------------------------------------------------------------------
 * There are no restrictions.
 * Modification, redistribution freedom, commercial availability,
 * and rights indication are also optional.
 * The author is not responsible,
 * but will deal with defects to the extent possible.
 * 
 * @-----------------------------------------------------
 * @ [Plugin Commands]
 * @-----------------------------------------------------
 * 
 * @command GetName
 * @desc Stores the name of the last item gained in a variable.
 * 
 * @arg Variable
 * @desc A variable that stores the name of the item.
 * @type variable
 * 
 * @-----------------------------------------------------
 * 
 * @command GetAmount
 * @desc Stores the amount of the last item gained in a variable.
 * 
 * @arg Variable
 * @desc A variable that stores the amount of the item.
 * @type variable
 * 
 * @-----------------------------------------------------
 * 
 * @command GetDescription
 * @desc Stores the description of the last item gained in a variable.
 * 
 * @arg Variable
 * @desc A variable that stores the description of the item.
 * @type variable
 * 
 * @-----------------------------------------------------
 * 
 * @command GetIcon
 * @desc Stores the icon ID of the last item gained in a variable.
 * 
 * @arg Variable
 * @desc A variable that stores the icon ID of the item.
 * @type variable
 * 
 * @-----------------------------------------------------
 * 
 * @command GetCategory
 * @desc Stores the category of the last item gained in a variable.
 * 0:Gold, 1:Item, 2:Weapon, 3:Armor
 * 
 * @arg Variable
 * @desc A variable that stores the category of the item.
 * @type variable
 * 
 * @-----------------------------------------------------
 * 
 * @command GetId
 * @desc Stores the ID of the last item gained in a variable.
 * 
 * @arg Variable
 * @desc A variable that stores the ID of the item.
 * @type variable
 * 
 * @-----------------------------------------------------
 * 
 * @command GetType
 * @desc Stores the type of the last item gained in a variable.
 * Item, Weapon, and Armor, for each types.
 * 
 * @arg Variable
 * @desc A variable that stores the item type of the item.
 * @type variable
 * 
 * @-----------------------------------------------------
 * 
 * @command GetEquipType
 * @desc Stores the equip type of the last armor gained in a variable.
 * 
 * @arg Variable
 * @desc A variable that stores the equip type of the item.
 * @type variable
 * 
 * @-----------------------------------------------------
 * 
 * @command GetMetaValue
 * @desc Stores the meta value of the last item gained in a variable.
 * 
 * @arg MetaName
 * @desc The name of the meta value definition.
 * e.g. this is the Test part in <Test:100>.
 * @type string
 * 
 * @arg Variable
 * @desc A variable that stores the meta value of the item.
 * @type variable
 * 
 * @-----------------------------------------------------
 * @ [Plugin Parameters]
 * @-----------------------------------------------------
 * 
 * @param GoldCommonEvent
 * @type common_event
 * @desc A common event that is called when gold increases or decreases.
 * 
 * @param ItemCommonEvent
 * @type common_event
 * @desc A common event that is called when items increase or decrease.
 * 
 * @param WeaponCommonEvent
 * @type common_event
 * @desc A common event that is called when weapons increase or decrease.
 * 
 * @param ArmorCommonEvent
 * @type common_event
 * @desc A common event that is called when armors increase or decrease.
 * 
 * @param DisableSwitch
 * @type switch
 * @desc Disables the invocation of the common event while the switch is on.

スポンサードリンク

-MZ plugins

Copyright© PGMZ - The Community-Driven Plugin Library for RPG Maker MZ , 2026 All Rights Reserved.