ThyroDree 3 Posted December 28, 2013 Can someone give me script of Item or Box Item Gives Freebies Like If i Open "Freebies Box" You'll get the ff. : 1 Valkyrie Armor 1 Valkyrie Shoes 1 Valkyrie Manteau 1 Valkyrie Shield Quote Share this post Link to post Share on other sites
0 Lelouch 10 Posted December 28, 2013 (edited) You can use the following... (you can also check doc/script_commands.txt) getitem *getitem <item id>,<amount>{,<account ID>};*getitem "<item name>",<amount>{,<account ID>};This command will give a specific amount of specified items to the targetcharacter. If the character is not online, nothing will happen.If <account ID> is not specified, items will be created in the invokingcharacter inventory instead.In the first and most commonly used version of this command, items arereferred to by their database ID number found in '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 BoxGiving an item ID of -1 will give a specified number of random items fromthe list of those that fall out of Old Blue Box. Unlike in all othercases, these will be unidentified, if they turn out to be equipment. Thisis exactly what's written in the Old Blue Box's item script.Other negative IDs also correspond to other random item generating itemtables:Giving an item ID of -2 will produce the effects of Old Violet Box.Giving an item ID of -3 will produce the effects of Old Card Album.Giving an item ID of -4 will produce the effects of Gift Box.Giving an item ID of -5 will produce the effects of Worn Out Scroll,which, in current Git, drops only Jellopies anyway.This transaction is logged if the log script generated transactions optionis enabled.You may also create an item by it's name in the 'english name' field inthe item database: getitem "RED_POTION",10;Which will do what you'd expect. If it can't find that name in thedatabase, apples will be created anyway. It is often a VERY GOOD IDEA touse it like this.This is used in pretty much all NPC scripts that have to do with items andquite a few item scripts. For more examples check just about any officialscript. 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>};This command will give an amount of specified items to the invokingcharacter. If an optional account ID is specified, and the targetcharacter is currently online, items will be created in their inventoryinstead. If they are not online, nothing will happen. It works essentiallythe same as 'getitem' (it even works for negative ID numbers the same way)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 nameditems, as well as the elemental property of weapons and armor. You cancreate a named item in this manner, however, if you just need a namedpiece 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 thenperfectly 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 itlike 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. set @charid,getcharid(0,"Adam"); // Now we split the character ID number into two portions with a // binary shift operation. If you don't understand what this does, // just copy it. set @card3, @charid & 65535; set @card4, @charid >> 16; // If you're inscribing non-equipment, @card1 must be 254. // Arrows are also not equipment. set @card1,254; // For named equipment, card2 means the Star Crumbs and elemental // crystals used to make this equipment. For everything else, it's 0. set @card2,0; // Now, let's give the character who invoked the script some // Adam's Apples: getitem2 512,1,1,0,0,@card1,@card2,@card3,@card4;This wasn't tested with all possible items, so I can't give any promises,experiment first before relying on it.To create equipment, continue this example it like this: // We've already have card3 and card4 loaded with correct // values so we'll just set up card1 and card2 with data // for an Ice Stiletto. // If you're inscribing equipment, @card1 must be 255. set @card1,255; // That's the number of star crumbs in a weapon. set @sc,2; // That's the number of elemental property of the weapon. set @ele,1; // And that's the wacky formula that makes them into // a single number. set @card2,@ele+((@sc*5)<<8); // That will make us an Adam's +2 VVS Ice Stiletto: getitem2 1216,1,1,2,0,@card1,@card2,@card3,@card4;Experiment with the number of star crumbs - I'm not certain just how muchwill work most and what it depends on. The valid element numbers are: 1 - Ice, 2 - Earth 3 - Fire 4 - Wind.You can, apparently, even create duplicates of the same pet egg with thiscommand, creating a pet which is the same, but simultaneously exists intwo eggs, and may hatch from either, although, I'm not sure what kind of amess will this really cause. 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 bebound to the target character as specified by the bound type. All items createdin this manner cannot be dropped, sold, vended, auctioned, or mailed, and insome cases cannot be traded or stored.Valid bound types are: 1 - Account Bound 2 - Guild Bound 3 - Party Bound 4 - Character Bound getitembound2 *getitembound2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<bound type>;*getitembound2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<bound type>;This command behaves identically to 'getitem2', but the items created will bebound to the target character as specified by the bound type. All items createdin this manner cannot be dropped, sold, vended, auctioned, or mailed, and insome cases cannot be traded or stored.For a list of bound types see 'getitembound'. Edited December 28, 2013 by Lelouch Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted December 29, 2013 (edited) Try : itemid,itemname,.........{ callfunc("Freebies",2357,2524,2115,2421); },{},{} /* callfunc( "Freebies",itemid{,itemid} ); */function script Freebies { for ( .@i = 0; .@i < getargcount(); .@i++ ) getitem getarg(.@i), 1; return;} Edited December 29, 2013 by Patskie Quote Share this post Link to post Share on other sites
Can someone give me script of Item or Box Item Gives Freebies Like
If i Open "Freebies Box"
You'll get the ff. :
1 Valkyrie Armor
Share this post
Link to post
Share on other sites