public class 0401_Item_Related extends Object
=============================== |0401.- Item-related commands.| ===============================
| 构造器和说明 |
|---|
0401_Item_Related() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
breakequip()
breakequip <equipment slot>{,<char_id>};
This command will break and unequip whatever is currently equipped in the
invoking character's specified equipment slot.
|
void |
buyingstore()
buyingstore <slots>;
Invokes buying store preparation window like the skill 'Open Buying Store',
without the item requirement.
|
void |
cartcountitem()
cartcountitem(<item id>{,<accountID>})
cartcountitem("<item name>"{,<accountID>})
storagecountitem(<item id>{,<accountID>})
storagecountitem("<item name>"{,<accountID>})
guildstoragecountitem(<nameID>{,<accountID>})
guildstoragecountitem("<item name>"{,<accountID>})
This command behaves identically to 'countitem', but counts items from the player's
cart, storage, or guild storage.
|
void |
cartcountitem2()
cartcountitem2(<item id>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<accountID>})
cartcountitem2("<item name>",<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<accountID>})
storagecountitem2(<item id>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<accountID>})
storagecountitem2("<item name>",<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<accountID>})
guildstoragecountitem2(<nameID>,<Identified>,<Refine>,<Attribute>,<Card0>,<Card1>,<Card2>,<Card3>{,<accountID>})
guildstoragecountitem2("<item name>",<Identified>,<Refine>,<Attribute>,<Card0>,<Card1>,<Card2>,<Card3>{,<accountID>})
This command behaves identically to 'countitem2', but counts items from the player's
cart, storage, or guild storage.
|
void |
cartdelitem()
cartdelitem <item id>,<amount>{,<account ID>};
cartdelitem "<item name>",<amount>{,<account ID>};
storagedelitem <item id>,<amount>{,<account ID>};
storagedelitem "<item name>",<amount>{,<account ID>};
guildstoragedelitem <item id>,<amount>{,<account ID>};
guildstoragedelitem "<item name>",<amount>{,<account ID>};
This command behaves identically to 'delitem', but deletes items from the player's
cart, storage, or guild storage.
|
void |
cartdelitem2()
cartdelitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
cartdelitem2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
storagedelitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
storagedelitem2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
guildstoragedelitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
guildstoragedelitem2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
This command behaves identically to 'delitem2', but deletes items from the player's
cart, storage, or guild storage.
|
void |
cleanarea()
cleanarea "<map name>",<x1>,<y1>,<x2>,<y2>;
cleanmap "<map name>";
These commands will clear all items lying on the ground on the specified map, either
within the x1/y1-x2/y2 rectangle or across the entire map.
|
void |
clearitem()
clearitem {<char_id>};
This command will destroy all items the invoking character has in their
inventory (including equipped items).
|
void |
consumeitem()
consumeitem <item id>{,<char_id>};
consumeitem "<item name>"{,<char_id>};
This command will run the item script of the specified item on the invoking
character.
|
void |
cooking()
cooking <dish level>;
This command will open a produce window on the client connected to the invoking
character.
|
void |
countbound()
countbound({<bound type>{,<char_id>}})
This function will return the number of bounded items in the character's
inventory, and sets an array @bound_items[] containing all item IDs of the
counted items.
|
void |
countitem()
countitem(<item id>)
countitem("<item name>")
This function will return the number of items for the specified item ID that the
invoking character has in the inventory.
|
void |
countitem2()
countitem2(<item id>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>)
countitem2("<item name>",<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>)
countitem3(<item id>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>)
countitem3("<item name>",<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>)
Expanded version of 'countitem' function, used for created/carded/forged items.
|
void |
delequip()
delequip <equipment slot>{,<char_id>};
This command will destroy whatever is currently equipped in the invoking
character's specified equipment slot.
|
void |
delitem()
delitem <item id>,<amount>{,<account ID>};
delitem "<item name>",<amount>{,<account ID>};
This command will remove a specified amount of items from the invoking/target character.
|
void |
delitem2()
delitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
delitem2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
delitem3 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account ID>};
delitem3 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account ID>};
This command will remove a specified amount of items from the invoking/target character.
|
void |
downrefitem()
downrefitem <equipment slot>{,<count>{,<char_id>}};
This command will downgrade an item in the specified equipment slot of the invoking
character by -1, or a count if given.
|
void |
enable_command()
enable_command;
disable_command;
These commands toggle the ability to use atcommand while interacting with an NPC.
|
void |
enable_items()
enable_items;
disable_items;
These commands toggle the ability to change equipment while interacting with
an NPC.
|
void |
equip()
equip <item id>{,<char_id>};
autoequip <item id>,<option>;
These commands are to equip a equipment on the attached character.
|
void |
failedrefitem()
failedrefitem <equipment slot>{,<char_id>};
This command will fail to refine an item in the specified equipment slot of the
invoking character.
|
void |
failedremovecards()
failedremovecards <equipment slot>,<type>;
This command will remove all cards from the item found in the specified
equipment slot of the invoking character.
|
void |
getgroupitem()
getgroupitem <group_id>{,<identify>{,<char_id>}};
Gives item(s) to the attached player based on item group contents.
|
void |
getitem()
getitem <item id>,<amount>{,<account ID>};
getitem "<item name>",<amount>{,<account ID>};
This command will give an amount of specified items to the invoking character.
|
void |
getitem2()
getitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
getitem2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
getitem3 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account ID>};
getitem3 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account ID>};
This command will give an amount of specified items to the invoking character.
|
void |
getitembound()
getitembound <item id>,<amount>,<bound type>{,<account ID>};
getitembound "<item name>",<amount>,<bound type>{,<account ID>};
This command behaves identically to 'getitem', but the items created will be
bound to the target character as specified by the bound type.
|
void |
getitembound2()
getitembound2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<bound type>{,<account ID>};
getitembound2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<bound type>{,<account ID>};
getitembound3 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<bound type>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account ID>};
getitembound3 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<bound type>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account ID>};
This command behaves identically to 'getitem2', but the items created will be
bound to the target character as specified by the bound type.
|
void |
getnameditem()
getnameditem <item id>,<character name|character ID>;
getnameditem "<item name>",<character name|character ID>;
Create an item signed with the given character's name.
|
void |
getrandgroupitem()
getrandgroupitem <group_id>{,<quantity>{,<sub_group>{,<identify>{,<char_id>}}}};
Similar to the above example, this command allows players to obtain the specified
quantity of a random item from the group "<group id>".
|
void |
groupranditem()
groupranditem <group id>{,<sub_group>};
Returns the item_id of a random item picked from the group specified.
|
void |
itemskill()
itemskill <skill id>,<skill level>{,<keep requirement>};
itemskill "<skill name>",<skill level>{,<keep requirement>};
This command is meant for item scripts to replicate single-use skills in usable
items.
|
void |
makeitem()
makeitem <item id>,<amount>,"<map name>",<X>,<Y>;
makeitem "<item name>",<amount>,"<map name>",<X>,<Y>;
This command will create an item on the specified cell of a map.
|
void |
makeitem2()
makeitem2 <item id>,<amount>,"<map name>",<X>,<Y>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>;
makeitem2 "<item name>",<amount>,"<map name>",<X>,<Y>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>;
makeitem3 <item id>,<amount>,"<map name>",<X>,<Y>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>;
makeitem3 "<item name>",<amount>,"<map name>",<X>,<Y>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>;
This command will create an item on the specified cell of a map.
|
void |
makerune()
makerune <% success bonus>{,<char_id>};
This command will open a rune crafting window on the client connected to the
invoking character.
|
void |
produce()
produce <item level>;
This command will open a crafting window on the client connected to the invoking
character.
|
void |
rentitem()
rentitem <item id>,<time>{,<account_id>};
rentitem "<item name>",<time>{,<account_id>};
Creates a rental item in the attached character's inventory.
|
void |
rentitem2()
rentitem2 <item id>,<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account_id>};
rentitem2 "<item name>",<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account_id>};
rentitem3 <item id>,<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account_id>};
rentitem3 "<item name>",<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account_id>};
Creates a rental item in the attached character's inventory.
|
void |
repair()
repair <broken item number>{,<char_id>};
This command repairs a broken piece of equipment, using the same list of broken
items as available through 'getbrokenid'.
|
void |
repairall()
repairall {<char_id>};
This command repairs all broken equipment in the attached player's inventory.
|
void |
searchitem()
searchitem <array name>,"<item name>";
This command will fill the given array with the ID of items whose name matches
the given one.
|
void |
searchstores()
searchstores <uses>,<effect>;
Invokes the store search window, which allows to search for both vending
and buying stores.
|
void |
successrefitem()
successrefitem <equipment slot>{,<count>{,<char_id>}};
This command will refine an item in the specified equipment slot of the invoking
character by +1, or a count if given.
|
void |
successremovecards()
successremovecards <equipment slot>;
This command will remove all cards of the cards slots defined by item_db.txt
from the item found in the specified equipment slot of the invoking character,
create new card items and give them to the character.
|
void |
unequip()
unequip <equipment slot>{,<char_id>};
This command will unequip whatever is currently equipped in the invoking
character's specified equipment slot.
|
getitem <item id>,<amount>{,<account ID>};
getitem "<item name>",<amount>{,<account ID>};
This command will give an amount of specified items to the invoking character.
If an optional account ID is specified, and the target character is currently
online, items will be created in their inventory instead. If they are not
online, nothing will happen.
In the first and most commonly used version of this command, items are
referred to by their database ID number found inside 'db/(pre-)re/item_db.txt'.
getitem 502,10 // The person will receive 10 apples
getitem 617,1 // The person will receive 1 Old Violet Box
This transaction is logged if the log script generated transactions option is
enabled.
You may also create an item by its name in the 'english name' field in the
item database:
getitem "RED_POTION",10;
Which will do what you'd expect. If it can't find that name in the database,
apples will be created anyway. It is often a VERY GOOD IDEA to use it like this.
This is used in pretty much all NPC scripts that have to do with items and
quite a few item scripts. For more examples check just about any official script.
getitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
getitem2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
getitem3 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account ID>};
getitem3 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account ID>};
This command will give an amount of specified items to the invoking character.
If an optional account ID is specified, and the target character is currently
online, items will be created in their inventory instead. If they are not
online, nothing will happen. It works essentially the same as 'getitem' but is
a lot more flexible.
Those parameters that are different from 'getitem' are:
identify - Whether you want the item to be identified (1) or not (0).
refine - For how many pluses will it be refined.
It will not let you refine an item higher than the max refine.
attribute - Whether the item is broken (1) or not (0).
card1,2,3,4 - If you want a card compound to it, place the card ID number into
the specific card slot.
Card1-card4 values are also used to store name information for named items, as
well as the elemental property of weapons and armor. You can create a named item
in this manner, however, if you just need a named piece of standard equipment,
it is much easier to the 'getnameditem' function instead.
You will need to keep these values if you want to destroy and then perfectly
recreate a named item, for this see 'getinventorylist'.
If you still want to try creating a named item with this command because
'getnameditem' won't do it for you cause it's too limited, you can do it like
this. Careful, minor magic ahead.
// First, let's get an ID of a character who's name will be on the item.
// Only an existing character's name may be there.
// Let's assume our character is 'Adam' and find his ID.
getitembound <item id>,<amount>,<bound type>{,<account ID>};
getitembound "<item name>",<amount>,<bound type>{,<account ID>};
This command behaves identically to 'getitem', but the items created will be
bound to the target character as specified by the bound type. All items created
in this manner cannot be dropped, sold, vended, auctioned, or mailed, and in
some cases cannot be traded or stored.
Valid bound types are:
Bound_Account : Account Bound item
Bound_Guild : Guild Bound item
Bound_Party : Party Bound item
Bound_Char : Character Bound item
getitembound2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<bound type>{,<account ID>};
getitembound2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<bound type>{,<account ID>};
getitembound3 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<bound type>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account ID>};
getitembound3 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<bound type>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account ID>};
This command behaves identically to 'getitem2', but the items created will be
bound to the target character as specified by the bound type. All items created
in this manner cannot be dropped, sold, vended, auctioned, or mailed, and in
some cases cannot be traded or stored.
For a list of bound types see 'getitembound'.
'getitembound3' is advance version of 'getitembound2' that also use Item Random Option as additional values.
<RandomIDArray> : Array variable of ID for item random option, see db/[pre-]re/item_randomopt_db.txt
<RandomValueArray> : Array variable of item random option's value.
<RandomParamArray> : Array variable of item random option's param.
Example to get Crimson Weapon with Ghost property:
// +9 Crimson Dagger [2]
setarray .@OptID[0],RDMOPT_WEAPON_ATTR_TELEKINESIS;
setarray .@OptVal[0],0;
setarray .@OptParam[0],0;
getitembound3 28705,1,1,9,0,0,0,0,0,BOUND_CHAR,.@OptID,.@OptVal,.@OptParam;
getnameditem <item id>,<character name|character ID>;
getnameditem "<item name>",<character name|character ID>;
Create an item signed with the given character's name.
The command returns 1 when the item is created successfully, or 0 if it fails.
Failure occurs when:
- There is no player attached.
- Item name or ID is not valid.
- The given character ID/name is offline.
Example:
//This will give the currently attached player a Aaron's Apple (if Aaron is online).
getnameditem "Apple","Aaron";
//Self-explanatory (I hope).
if (getnameitem("Apple","Aaron")) {
mes "You now have a Aaron's Apple!";
}
rentitem <item id>,<time>{,<account_id>};
rentitem "<item name>",<time>{,<account_id>};
Creates a rental item in the attached character's inventory. The item will expire
in <time> seconds and be automatically deleted. When receiving a rental item,
the character will receive a message in their chat window. The character will
also receive warning messages in their chat window before the item disappears.
When rentals expire it will call the OnUnequip Script of the item. This can be used
for special cases such as removing a status change or resetting a variable or state
of the player.
This command can not be used to rent stackable items. Rental items cannot be
dropped, traded, sold to NPCs, or placed in guild storage. (i.e. trade mask 75)
Note: 'delitem' in an NPC script can still remove rental items.
rentitem2 <item id>,<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account_id>};
rentitem2 "<item name>",<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account_id>};
rentitem3 <item id>,<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account_id>};
rentitem3 "<item name>",<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account_id>};
Creates a rental item in the attached character's inventory. The item will expire
in <time> seconds and be automatically deleted. See 'rentitem' for further details.
See 'getitem2' for an explanation of the expanded parameters.
'rentitem3' is advance version of 'rentitem2' that also use Item Random Option as additional values.
<RandomIDArray> : Array variable of ID for item random option, see db/[pre-]re/item_randomopt_db.txt
<RandomValueArray> : Array variable of item random option's value.
<RandomParamArray> : Array variable of item random option's param.
Example to get Crimson Weapon with Ghost property:
// +9 Crimson Dagger [2]
setarray .@OptID[0],RDMOPT_WEAPON_ATTR_TELEKINESIS;
setarray .@OptVal[0],0;
setarray .@OptParam[0],0;
rentitem3 28705,(24*60*60),1,9,0,0,0,0,0,.@OptID,.@OptVal,.@OptParam;
makeitem <item id>,<amount>,"<map name>",<X>,<Y>;
makeitem "<item name>",<amount>,"<map name>",<X>,<Y>;
This command will create an item on the specified cell of a map.
As with any dropped items, the items created with this command will disappear after
a period of time. Using an amount greater than 1 will create a single stack of the
given amount, not multiple stacks of 1.
Like 'getitem', it also accepts an 'english name' field from the database and creates
Apples if the name isn't found.
If the map name is given as "this", the map the invoking character is on will be used.
makeitem2 <item id>,<amount>,"<map name>",<X>,<Y>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>;
makeitem2 "<item name>",<amount>,"<map name>",<X>,<Y>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>;
makeitem3 <item id>,<amount>,"<map name>",<X>,<Y>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>;
makeitem3 "<item name>",<amount>,"<map name>",<X>,<Y>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>;
This command will create an item on the specified cell of a map. See 'makeitem' for
further details.
See 'getitem2' for an explanation of the expanded parameters.
'makeitem3' is advance version of 'makeitem2' that also use Item Random Option as additional values.
<RandomIDArray> : Array variable of ID for item random option, see db/[pre-]re/item_randomopt_db.txt
<RandomValueArray> : Array variable of item random option's value.
<RandomParamArray> : Array variable of item random option's param.
Example to get Crimson Weapon with Ghost property:
// 0.5% chance to get +0 Valkyrie Shield [1]
// with Neutral Resistance +10% and 5% damage reduction from Demi-Human or Player
// when Valkyrie Randgris killed
OnNPCKillEvent:
if (killedrid == 1751 && rand(0,1000) > 950) { // Valkyrie Randgris
getmapxy(.@map$,.@x,.@y,BL_PC);
setarray .@OptID[0],RDMOPT_ATTR_TOLERACE_NOTHING,RDMOPT_RACE_TOLERACE_HUMAN;
setarray .@OptVal[0],10,5;
setarray .@OptParam[0],0;
makeitem3 2115,1,.@map$,.@x,.@y,0,0,0,0,0,0,0,.@OptID,.@OptVal,.@OptParam;
}
end;
cleanarea "<map name>",<x1>,<y1>,<x2>,<y2>;
cleanmap "<map name>";
These commands will clear all items lying on the ground on the specified map, either
within the x1/y1-x2/y2 rectangle or across the entire map.
searchitem <array name>,"<item name>";
This command will fill the given array with the ID of items whose name matches
the given one. It returns the number of items found. For performance reasons,
the results array is limited to 10 items.
mes "What item are you looking for?";
input .@name$;
.@qty = searchitem(.@matches[0],.@name$);
mes "I found " + .@qty + " items:";
for (.@i = 0; .@i < .@qty; .@i++)
// Display name (eg: "Apple[0]")
mes getitemname(.@matches[.@i]) + "[" + getitemslots(.@matches[.@i]) + "]";
delitem <item id>,<amount>{,<account ID>};
delitem "<item name>",<amount>{,<account ID>};
This command will remove a specified amount of items from the invoking/target character.
Like all the item commands, it uses the item ID found inside 'db/(pre-)re/item_db.txt'.
delitem 502,10; // The person will lose 10 apples
delitem 617,1; // The person will lose 1 Old Violet Box
It is always a good idea to check if the player actually has the items before you delete them.
If you try to delete more items that the player has, the player will lose the ones he/she has
and the script will terminate with an error.
Like 'getitem', this command will also accept an 'english name' field from the
database. If the name is not found, nothing will be deleted.
cartdelitem <item id>,<amount>{,<account ID>};
cartdelitem "<item name>",<amount>{,<account ID>};
storagedelitem <item id>,<amount>{,<account ID>};
storagedelitem "<item name>",<amount>{,<account ID>};
guildstoragedelitem <item id>,<amount>{,<account ID>};
guildstoragedelitem "<item name>",<amount>{,<account ID>};
This command behaves identically to 'delitem', but deletes items from the player's
cart, storage, or guild storage.
If no cart is mounted, 'cartdelitem' will return -1.
If player is not in a guild or storage is open, 'guildstoragedelitem' will return -1.
delitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
delitem2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
delitem3 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account ID>};
delitem3 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account ID>};
This command will remove a specified amount of items from the invoking/target character.
See 'getitem2' for an explanation of the expanded parameters.
'delitem3' is advance version of 'delitem2' that also use Item Random Option as criteria.
<RandomIDArray> : Array variable of ID for item random option, see db/[pre-]re/item_randomopt_db.txt
<RandomValueArray> : Array variable of item random option's value.
<RandomParamArray> : Array variable of item random option's param.
cartdelitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
cartdelitem2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
storagedelitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
storagedelitem2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
guildstoragedelitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
guildstoragedelitem2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
This command behaves identically to 'delitem2', but deletes items from the player's
cart, storage, or guild storage.
If no cart is mounted, 'cartdelitem2' will return -1.
If player is not in a guild or storage is open, 'guildstoragedelitem2' will return -1.
countitem(<item id>);
countitem("<item name>");
This function will return the number of items for the specified item ID that the
invoking character has in the inventory.
mes "[Item Checker]";
mes "Hmmm, it seems you have " + countitem(502) + " apples";
close;
Like 'getitem', this function will also accept an 'english name' from the
database as an argument.
If you want to state the number at the end of a sentence, you can do it by
adding up strings:
mes "[Item Checker]";
mes "Hmmm, the total number of apples you are holding is " + countitem("APPLE");
close;
cartcountitem(<item id>{,<accountID>});
cartcountitem("<item name>"{,<accountID>});
storagecountitem(<item id>{,<accountID>});
storagecountitem("<item name>"{,<accountID>});
guildstoragecountitem(<nameID>{,<accountID>});
guildstoragecountitem("<item name>"{,<accountID>});
This command behaves identically to 'countitem', but counts items from the player's
cart, storage, or guild storage.
If no cart is mounted, 'cartcountitem' will return -1.
If player is not in a guild or storage is open, 'guildstoragecountitem' will return -1.
countitem2(<item id>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>);
countitem2("<item name>",<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>);
countitem3(<item id>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>);
countitem3("<item name>",<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>);
Expanded version of 'countitem' function, used for created/carded/forged items.
This function will return the number of items for the specified item ID and
other parameters that the invoking character has in the inventory.
See 'getitem2' for an explanation of the expanded parameters.
'countitem3' is advance version of 'countitem2' that also use Item Random Option as criteria.
<RandomIDArray> : Array variable of ID for item random option, see db/[pre-]re/item_randomopt_db.txt
<RandomValueArray> : Array variable of item random option's value.
<RandomParamArray> : Array variable of item random option's param.
cartcountitem2(<item id>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<accountID>});
cartcountitem2("<item name>",<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<accountID>});
storagecountitem2(<item id>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<accountID>});
storagecountitem2("<item name>",<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<accountID>});
guildstoragecountitem2(<nameID>,<Identified>,<Refine>,<Attribute>,<Card0>,<Card1>,<Card2>,<Card3>{,<accountID>});
guildstoragecountitem2("<item name>",<Identified>,<Refine>,<Attribute>,<Card0>,<Card1>,<Card2>,<Card3>{,<accountID>});
This command behaves identically to 'countitem2', but counts items from the player's
cart, storage, or guild storage.
If no cart is mounted, 'cartcountitem2' will return -1.
If player is not in a guild or storage is open, 'guildstoragecountitem2' will return -1.
countbound({<bound type>{,<char_id>}});
This function will return the number of bounded items in the character's
inventory, and sets an array @bound_items[] containing all item IDs of the
counted items. If a bound type is specified, only those items will be counted.
For a list of bound types see 'getitembound'.
Example:
mes "You currently have " + countbound() + " bounded items.";
next;
mes "The list of bounded items include:";
for(.@i = 0; .@i < getarraysize(@bound_items); .@i++)
mes getitemname(@bound_items[.@i]);
close;
groupranditem <group id>{,<sub_group>};
Returns the item_id of a random item picked from the group specified. The
different groups and their group number are specified in 'db/(pre-)re/item_group_db.txt'.
When used in conjunction with other functions, you can get a random item. For
example, for a random pet lure:
getitem groupranditem(IG_Taming),1;
'sub_group' is used to get the available random items of item group from specified random
group. 0 for 'must' item group, and random item group is 1 until 5 (MAX_ITEMGROUP_RANDGROUP+1).
More info, see doc/item_group.txt.
getrandgroupitem <group_id>{,<quantity>{,<sub_group>{,<identify>{,<char_id>}}}};
Similar to the above example, this command allows players to obtain the specified
quantity of a random item from the group "<group id>". The different groups and
their group number are specified in db/(pre-)re/item_group_db.txt
If 'quantity' is not defined or 0, it will uses defined amount from Item Group list.
If 'sub_group' is not defined the value will be 1 (since random group is 1 ~ 5, and 0 is
'must' item group).
For item with type IT_WEAPON, IT_ARMOR, IT_PETARMOR, and IT_SHADOWGEAR will be given
as unidentified item (as defined by itemdb_isidentified in src/map/itemdb.cpp) except
if 'identify' is defined with value 1.
More info, see doc/item_group.txt.
getgroupitem <group_id>{,<identify>{,<char_id>}};
Gives item(s) to the attached player based on item group contents.
This is not working like 'getrandgroupitem' which only give 1 item for specified
item group & sub_group.
For item with type IT_WEAPON, IT_ARMOR, IT_PETARMOR, and IT_SHADOWGEAR will be given
as unidentified item (as defined by itemdb_isidentified in src/map/itemdb.cpp) except
if 'identify' is defined with value 1.
More info, see doc/item_group.txt.
enable_items;
disable_items;
These commands toggle the ability to change equipment while interacting with
an NPC. To avoid possible exploits, the commands affect the particular script
instance only. Note that if a different script also calls enable_items, it
will override the last call (so you may want to call this command at the start
of your script without assuming it is still in effect).
The default setting, 'item_enabled_npc', is defined in 'conf/battle/items.conf'.
itemskill <skill id>,<skill level>{,<keep requirement>};
itemskill "<skill name>",<skill level>{,<keep requirement>};
This command is meant for item scripts to replicate single-use skills in usable
items. It will not work properly if there is a visible dialog window or menu.
If the skill is self or auto-targeting, it will be used immediately; otherwise a
target cursor is shown.
If <keep requirement> parameter is set to true, the skill's requirements will be checked.
By default, the requirements for item skills are not checked, and therefore the default value is false.
// When Anodyne is used, it will cast Endure (8), Level 1, as if the actual
// skill has been used from skill tree.
605,Anodyne,Anodyne,11,2000,0,100,,,,,10477567,2,,,,,{ itemskill 8,1; },{}
// When Sienna_Execrate_Scroll_1_5 is used, it will cast Sienna Execrate Level 5 and consume 2 Red_Gemstones.
23194,Sienna_Execrate_Scroll_1_5,Level 5 Sienna Execrate,11,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ itemskill "WL_SIENNAEXECRATE",5,true; },{},{}
consumeitem <item id>{,<char_id>};
consumeitem "<item name>"{,<char_id>};
This command will run the item script of the specified item on the invoking
character. The character does not need to possess the item, and the item will
not be deleted. While this command is intended for usable items, it will run
for any item type.
This command does not currently work with the 'itemskill' script command.
produce <item level>;
This command will open a crafting window on the client connected to the invoking
character. The 'item level' is a number which determines what kind of a crafting
window will pop-up.
You can see the full list of such item levels in 'db/produce_db.txt' which determines
what can actually be produced. The window will not be empty only if the invoking
character can actually produce the items of that type and has the appropriate raw
materials in their inventory.
The success rate to produce the item is the same as the success rate of the skill
associated with the item level. If there is no skill id, the success rate will be 50%.
Valid item levels are:
1 - Level 1 Weapons
2 - Level 2 Weapons
3 - Level 3 Weapons
21 - Blacksmith's Stones and Metals
22 - Alchemist's Potions, Holy Water, Assassin Cross's Deadly Poison
23 - Elemental Converters
cooking <dish level>;
This command will open a produce window on the client connected to the invoking
character. The 'dish level' is the number which determines what kind of dish
level you can produce. You can see the full list of dishes that can be produced in
'db/produce_db.txt'.
The window will be shown empty if the invoking character does not have enough of
the required incredients to cook a dish.
Valid dish levels are:
11 - Level 1 Dish
12 - Level 2 Dish
13 - Level 3 Dish
14 - Level 4 Dish
15 - Level 5 Dish
16 - Level 6 Dish
17 - Level 7 Dish
18 - Level 8 Dish
19 - Level 9 Dish
20 - Level 10 Dish
Although it's required to set a dish level, it doesn't matter if you set it to 1
and you want to cook a level 10 dish, as long as you got the required incredients
to cook the dish the command works.
makerune <% success bonus>{,<char_id>};
This command will open a rune crafting window on the client connected to the
invoking character. Since this command is officially used in rune ores, a bonus
success rate must be specified (which adds to the base formula).
You can see the full list of runes that can be produced in 'db/produce_db.txt'.
The window will not be empty only if the invoking character can actually produce
a rune and has the appropriate raw materials in their inventory.
successremovecards <equipment slot>;
This command will remove all cards of the cards slots defined by item_db.txt
from the item found in the specified equipment slot of the invoking character,
create new card items and give them to the character.
If any cards were removed in this manner, it will also show a success effect.
failedremovecards <equipment slot>,<type>;
This command will remove all cards from the item found in the specified
equipment slot of the invoking character. 'type' determines what happens to the
item and the cards:
0 - will destroy both the item and the cards.
1 - will keep the item, but destroy the cards.
2 - will keep the cards, but destroy the item.
Whatever the type is, it will also show a failure effect on screen.
repair <broken item number>{,<char_id>};
This command repairs a broken piece of equipment, using the same list of broken
items as available through 'getbrokenid'.
repairall {<char_id>};
This command repairs all broken equipment in the attached player's inventory.
A repair effect will be shown if any items are repaired, else the command will
end silently.
successrefitem <equipment slot>{,<count>{,<char_id>}};
This command will refine an item in the specified equipment slot of the invoking
character by +1, or a count if given. For a list of equipment slots see 'getequipid'.
This command will also display a 'refine success' effect on the character and put
appropriate messages into their chat window. It will also give the character fame
points if a weapon reached +10 this way, even though these will only take effect for
blacksmith who will later forge a weapon.
failedrefitem <equipment slot>{,<char_id>};
This command will fail to refine an item in the specified equipment slot of the
invoking character. The item will be destroyed. This will also display a 'refine
failure' effect on the character and put appropriate messages into their chat
window.
downrefitem <equipment slot>{,<count>{,<char_id>}};
This command will downgrade an item in the specified equipment slot of the invoking
character by -1, or a count if given. For a list of equipment slots see 'getequipid'.
This command will also display a 'refine failure' effect on the character and put
appropriate messages into their chat window.
unequip <equipment slot>{,<char_id>};
This command will unequip whatever is currently equipped in the invoking
character's specified equipment slot. For a full list of possible equipment
slots see 'getequipid'.
If an item occupies several equipment slots, it will get unequipped from all of
them.
delequip <equipment slot>{,<char_id>};
This command will destroy whatever is currently equipped in the invoking
character's specified equipment slot. For a full list of possible equipment
slots see 'getequipid'.
This command will return 1 if an item was deleted and 0 otherwise.
breakequip <equipment slot>{,<char_id>};
This command will break and unequip whatever is currently equipped in the
invoking character's specified equipment slot. For a full list of possible
equipment slots see 'getequipid'.
This command will return 1 if an item was broken and 0 otherwise.
clearitem {<char_id>};
This command will destroy all items the invoking character has in their
inventory (including equipped items). It will not affect anything else, like
storage or cart.
equip <item id>{,<char_id>};
autoequip <item id>,<option>;
These commands are to equip a equipment on the attached character.
The equip function will equip the item ID given when the player has
this item in his/her inventory, while the autoequip function will
equip the given item ID when this is looted. The option parameter of
the autoequip is 1 or 0, 1 to turn it on, and 0 to turn it off.
Examples:
//This will equip a 1104 (falchion) on the character if this is in the inventory.
equip 1104;
//The invoked character will now automatically equip a falchion when it's looted.
autoequip 1104,1;
//The invoked character will no longer automatically equip a falchion.
autoequip 1104,0;
buyingstore <slots>;
Invokes buying store preparation window like the skill 'Open Buying Store',
without the item requirement. Amount of slots is limited by the server to
a maximum of 5 slots by default.
Example:
// Gives the player opportunity to buy 4 different kinds of items.
buyingstore 4;
searchstores <uses>,<effect>;
Invokes the store search window, which allows to search for both vending
and buying stores. Parameter uses indicates, how many searches can be
started, before the window has to be reopened. Effect value affects,
what happens, when a result item is double-clicked and can be one of the
following:
0 = Shows the store's position on the mini-map and highlights the
shop sign with yellow color, when the store is on same map
as the invoking player.
1 = Directly opens the shop, regardless of distance.
Example:
// Item Universal_Catalog_Gold (10 uses, effect: open shop)
searchstores 10,1;
enable_command;
disable_command;
These commands toggle the ability to use atcommand while interacting with an NPC.
The default setting, 'atcommand_enable_npc', is defined in 'conf/battle/gm.conf'.
Copyright © 工程的初始时间(可选)–2019. All rights reserved.