summaryrefslogblamecommitdiff
path: root/doc/sample/getiteminfo.txt
blob: 63a6e7928e81e36004bc5eb5ad8a681b89636bf7 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                               



                                                              

                                                              

                                                              
 
                                                                    






                                                                                          















                                                                                                                                         
                                                              
              
 
//===== Hercules Script =======================================
//= Sample: Getiteminfo
//===== By: ==================================================
//= Lupus
//===== Current Version: =====================================
//= 20131225
//===== Description: =========================================
//= Demonstrates the 'getiteminfo' command.
//============================================================

prontera,156,179,6	script	test_getiteminfo	4_F_KAFRA1,{
	mes "Please enter an item ID.";
	input .@value;

	// This line uses an INTERNAL function of your client to show item name by its ID!
	// ^nItemID^XXXX -> Item Name
	mes "Item ID: "+.@value+" ^nItemID^"+.@value;

	mes("Current item info:");
	mesf("Buy Price: %d", getiteminfo(.@value, ITEMINFO_BUYPRICE));
	mesf("Sell Price: %d", getiteminfo(.@value, ITEMINFO_SELLPRICE));
	mesf("Type: %d", getiteminfo(.@value, ITEMINFO_TYPE));
	mesf("Max drop chance: %d.%02d", getiteminfo(.@value, ITEMINFO_MAXCHANCE) / 100, getiteminfo(.@value, ITEMINFO_MAXCHANCE) % 100);
	mesf("Sex: %d", getiteminfo(.@value, ITEMINFO_SEX));
	mesf("Equip location: %d", getiteminfo(.@value, ITEMINFO_LOC));
	mesf("Weight: %d.%d", getiteminfo(.@value, ITEMINFO_WEIGHT) / 10, getiteminfo(.@value, ITEMINFO_WEIGHT) % 10);
	mesf("Attack: %d", getiteminfo(.@value, ITEMINFO_ATK));
	mesf("Defense: %d", getiteminfo(.@value, ITEMINFO_DEF));
	mesf("Range: %d", getiteminfo(.@value, ITEMINFO_RANGE));
	mesf("Slots: %d", getiteminfo(.@value, ITEMINFO_SLOTS));
	mesf("Subtype: %d", getiteminfo(.@value, ITEMINFO_SUBTYPE));
	mesf("Equip Level: %d", getiteminfo(.@value, ITEMINFO_ELV));
	mesf("Weapon Level: %d", getiteminfo(.@value, ITEMINFO_WLV));
	mesf("View ID: %d", getiteminfo(.@value, ITEMINFO_VIEWID));
	mesf("MATK: %d", getiteminfo(.@value, ITEMINFO_MATK));
	close;
}