Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial release script commands for Item Random Options #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions doc/script_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4380,6 +4380,8 @@ 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
Expand Down Expand Up @@ -4465,6 +4467,18 @@ command, creating a pet which is the same, but simultaneously exists in two
eggs, and may hatch from either, although, I'm not sure what kind of a mess will
this really cause.

'getitem3' is advance version of 'getitem2' 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;
getitem3 28705,1,1,9,0,0,0,0,0,.@OptID,.@OptVal,.@OptParam;

---------------------------------------

*getitembound <item id>,<amount>,<bound type>{,<account ID>};
Expand All @@ -4485,6 +4499,8 @@ Valid bound types are:

*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
Expand All @@ -4493,6 +4509,18 @@ 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>;
Expand Down Expand Up @@ -4538,12 +4566,26 @@ 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>;
Expand All @@ -4563,12 +4605,33 @@ If the map name is given as "this", the map the invoking character is on will be

*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,UNITTYPE_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>;
Expand Down Expand Up @@ -4625,10 +4688,17 @@ cart or storage. If no cart is mounted, 'cartdelitem' will fail.

*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>};
Expand Down Expand Up @@ -4675,13 +4745,20 @@ cart or storage. If no cart is mounted, 'cartcountitem' 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>)
Expand Down
Loading