[Library]ItemCore

06/04/2012 18:10 funhacker#1
I've now included some documentation for using this library. Enjoy guys and I'll update this as the DLL is updated :)

Use the links below to get details on each class available in the ItemCore.dll, only public fields/properties/methods/constructors etc etc are available.
Links to each datatype/class mentioned in the return types are also link to their own documentation.





Classes:


FileReader
Back To Top

Inheritance Hierarchy

NameSpace: ItemCore

Class Deffinition:

public class FileReader : BinaryReader

Constructors
Name
Description
FileReader(Stream input)Creates a new FileReader using an existing Stream. On a supplied stream using [Only registered and activated users can see links. Click Here To Register...]

Methods
Return Type
Name
Description
ItemtypeReadItemtype()Reads a block of Itemtype data from the current stream and advances the current position of the stream by the size of the itemtype data.
ItemDataReadItemData()Reads a block of ItemData from the current stream and advances the current position by 244 bytes.



FileWriter
Back To Top

Inheritance Hierarchy

NameSpace: ItemCore

Class Deffinition:

public class FileWriter : BinaryWriter

Constructors
Name
Description
FileWriter(Stream output)Creates a new FileWriter using an existing Stream. On a supplied stream using [Only registered and activated users can see links. Click Here To Register...]

Methods
Return Type
Name
Description
[Only registered and activated users can see links. Click Here To Register...]Write(Itemtype)Writes a block of Itemtype data to the current stream and advances the current position of the stream by the size of the itemtype data.
[Only registered and activated users can see links. Click Here To Register...]Write(ItemData)Writes a block of ItemData to the current stream and advances the current position by 244 bytes.



Frame
Back To Top

Inheritance Hierarchy

NameSpace: ItemCore

Class Deffinition:

public class Frame

Constructors
Name
Description
Frame()Creates a frame without a file name.
Frame(string fileName)Creates a frame with the specified file name.

Methods
Return Type
Name
Description
[Only registered and activated users can see links. Click Here To Register...]ToString()Gets the String representation of the Frame. Can be used to get the string form saved in an INI file.

Properties
Return Type
Name
Description
[Only registered and activated users can see links. Click Here To Register...]FileNameGets or Sets the File Name of the Frame.
[Only registered and activated users can see links. Click Here To Register...]FileExistsChecks if the File of the Frame exists.



Icon
Back To Top

Inheritance Hierarchy

NameSpace: ItemCore

Class Deffinition:

public class Icon

Constructors
Name
Description
Icon()Creates a new Icon with an empty Frame set.
Icon(Frame[] frames)Creates a new Icon with an array of Frames.

Methods
Return Type
Name
Description
[Only registered and activated users can see links. Click Here To Register...]InsertFrame(Frame frame, int index)Inserts a new frame at the given index and push the rest forward.
[Only registered and activated users can see links. Click Here To Register...]ReplaceFrame(Frame frame, int index)Replace the Frame at the given Index.
[Only registered and activated users can see links. Click Here To Register...]AddNewFrame(Frame frame)Add a new Frame at the end of the frame set.
[Only registered and activated users can see links. Click Here To Register...]ToString()Gets the String representation of the Frame. Can be used to get the string form saved in an INI file.

Properties
Return Type
Name
Description
[Only registered and activated users can see links. Click Here To Register...]<FrameFramesGets a list of all the Frames for the Icon.
Frame[Only registered and activated users can see links. Click Here To Register...][int frameIndex]Gets or Sets the frame based on the frameIndex. Use the index of a new frame to add a new frame (must be equal to Count).
FrameCurrentFrameGets the Current Frame for the Icon.
FrameNextFrameGets the Next Frame for the Icon.



ItemData
Back To Top

Inheritance Hierarchy
NameSpace: ItemCore

Class Deffinition:

public class ItemData

Constructors
Name
Description
ItemData()Creates a new instance of ItemData, ID = 0 Name = Blank, all other values = default.
ItemData(uint id, string name)Basic Constructor. Sets all default values and uses an assigned ID/Name of the new Item.
ItemData(
uint id,
uint price,
uint id_action,
uint monster_type,
uint emoney,
uint soul_value,
int mana,
string name,
string description,
bool ident,
byte req_profession,
byte level,
byte req_level,
byte req_sex,
byte monopoly,
byte gem1,
byte gem2,
byte magic1,
byte magic2,
byte magic3,
byte able_mask,
byte exp_type,
ushort official1,
ushort official2,
ushort official3,
ushort official4,
ushort official5,
ushort official6,
ushort official7,
ushort official8,
ushort official9,
ushort official10,
ushort official11,
ushort official12,
ushort req_force,
ushort req_dex,
ushort req_health,
ushort req_soul,
ushort weight,
ushort attack_max,
ushort attack_min,
ushort magic_atk_min,
ushort amount,
ushort amount_limit,
ushort magic_atk_max,
ushort magic_def,
ushort atk_range,
ushort atk_speed,
ushort hitrate,
ushort target,
ushort defense,
short life,
short dodge)
Creates new item data based on all the passed fields.
ItemData(ItemData baseItem)Creates a new instance of ItemData using an existing item data object. (used for cloning)

Methods
Return Type
Name
Description
[Only registered and activated users can see links. Click Here To Register...]ToString()Gets a string representation of the ItemData. Format = "ID Name"

Properties
Return Type
Name
Description
[Only registered and activated users can see links. Click Here To Register...]IDGets or Sets the ID of the Item.
[Only registered and activated users can see links. Click Here To Register...]NameGets or Sets the Name of the Item.
[Only registered and activated users can see links. Click Here To Register...]RequiredProfessionGets or Sets the Required Profession of the Item.
[Only registered and activated users can see links. Click Here To Register...]LevelGets or Sets the Level of the Item.
[Only registered and activated users can see links. Click Here To Register...]RequiredLevelGets or Sets the Required Level of the Item.
[Only registered and activated users can see links. Click Here To Register...]RequiredSexGets or Sets the Required Sex of the Item.
[Only registered and activated users can see links. Click Here To Register...]RequiredForceGets or Sets the Required Force of the Item.
[Only registered and activated users can see links. Click Here To Register...]RequiredDexterityGets or Sets the Required Dexterity of the Item.
[Only registered and activated users can see links. Click Here To Register...]RequiredHealthGets or Sets the Required Health of the Item.
[Only registered and activated users can see links. Click Here To Register...]RequiredSoulGets or Sets the Required Soul of the Item.
[Only registered and activated users can see links. Click Here To Register...]MonopolyGets or Sets the Monopoly of the Item.
[Only registered and activated users can see links. Click Here To Register...]WeightGets or Sets the Weight of the Item.
[Only registered and activated users can see links. Click Here To Register...]GoldPriceGets or Sets the Gold Price of the Item.
[Only registered and activated users can see links. Click Here To Register...]ActionIDGets or Sets the Action ID of the Item.
[Only registered and activated users can see links. Click Here To Register...]PhysicalAttackMaxGets or Sets the Maximum Physical Attack of the Item.
[Only registered and activated users can see links. Click Here To Register...]PhysicalAttackMinGets or Sets the Minimum Physical Attack of the Item.
[Only registered and activated users can see links. Click Here To Register...]PhysicalDefenceGets or Sets the Physical Defence of the Item.
[Only registered and activated users can see links. Click Here To Register...]MagicalAttackMinGets or Sets the Minimum Physical Attack of the Item.
[Only registered and activated users can see links. Click Here To Register...]DodgeGets or Sets the Dodge of the Item.
[Only registered and activated users can see links. Click Here To Register...]LifeGets or Sets the Life of the Item.
[Only registered and activated users can see links. Click Here To Register...]ManaGets or Sets the Mana of the Item.
[Only registered and activated users can see links. Click Here To Register...]AmountGets or Sets the Minimum Amount of the Item.
[Only registered and activated users can see links. Click Here To Register...]AmountLimitGets or Sets the Maximum Amount of the Item.
[Only registered and activated users can see links. Click Here To Register...]IdentifiedGets or Sets the Identified state of the Item.
[Only registered and activated users can see links. Click Here To Register...]GemOneGets or Sets the Gem One value of the Item.
[Only registered and activated users can see links. Click Here To Register...]GemTwoGets or Sets the Gem Two value of the Item.
[Only registered and activated users can see links. Click Here To Register...]MagicOneGets or Sets the Magic One value of the Item.
[Only registered and activated users can see links. Click Here To Register...]MagicTwoGets or Sets the Magic Two value of the Item.
[Only registered and activated users can see links. Click Here To Register...]MagicThreeGets or Sets the Magic Three value of the Item.
[Only registered and activated users can see links. Click Here To Register...]MagicalAttackMaxGets or Sets the Maximum Magical Attack of the Item.
[Only registered and activated users can see links. Click Here To Register...]MagicalDefenceGets or Sets the Magical Defence of the Item.
[Only registered and activated users can see links. Click Here To Register...]AttackRangeGets or Sets the Attack Range of the Item.
[Only registered and activated users can see links. Click Here To Register...]AttackSpeedGets or Sets the Attack Speed of the Item.
[Only registered and activated users can see links. Click Here To Register...]HitrateGets or Sets the Hitrate of the Item.
[Only registered and activated users can see links. Click Here To Register...]MonsterTypeGets or Sets the Monster Type of the Item.
[Only registered and activated users can see links. Click Here To Register...]TargetGets or Sets the Target of the Item.
[Only registered and activated users can see links. Click Here To Register...]AbleMaskGets or Sets the Able Mask of the Item
[Only registered and activated users can see links. Click Here To Register...]ExperienceTypeGets or Sets the Experience Type of the Item.
[Only registered and activated users can see links. Click Here To Register...]EPCostGets or Sets the EP Cost of the Item.
[Only registered and activated users can see links. Click Here To Register...]KnightOneGets or Sets the Knight One value of the Item.
[Only registered and activated users can see links. Click Here To Register...]KnightTwoGets or Sets the Knight Two value of the Item.
[Only registered and activated users can see links. Click Here To Register...]KnightThreeGets or Sets the Knight Three value of the Item.
[Only registered and activated users can see links. Click Here To Register...]KnightFourGets or Sets the Knight Four value of the Item.
[Only registered and activated users can see links. Click Here To Register...]KnightFiveGets or Sets the Knight Five value of the Item.
[Only registered and activated users can see links. Click Here To Register...]KnightSixGets or Sets the Knight Six value of the Item.
[Only registered and activated users can see links. Click Here To Register...]KnightSevenGets or Sets the Knight Seven value of the Item.
[Only registered and activated users can see links. Click Here To Register...]KnightEightGets or Sets the Knight Eight value of the Item.
[Only registered and activated users can see links. Click Here To Register...]KnightNineGets or Sets the Knight Nine value of the Item.
[Only registered and activated users can see links. Click Here To Register...]KnightTenGets or Sets the Knight Ten value of the Item.
[Only registered and activated users can see links. Click Here To Register...]KnightElevenGets or Sets the Knight Eleven value of the Item.
[Only registered and activated users can see links. Click Here To Register...]KnightTwelveGets or Sets the Knight Twelve value of the Item.
[Only registered and activated users can see links. Click Here To Register...]SoulValueGets or Sets the Soul Value of the Item.
[Only registered and activated users can see links. Click Here To Register...]DescriptionGets or Sets the Description of the Item.

Constants
Type & Value
Name
Description
[Only registered and activated users can see links. Click Here To Register...] 16NAMESTRINGSIZESize of the Name block within the ItemData.
[Only registered and activated users can see links. Click Here To Register...] 128DESCRIPTIONSTRINGSIZESize of the Description block within the ItemData.



ItemMinIcon
Back To Top

Inheritance Hierarchy
NameSpace: ItemCore

Class Deffinition:

public class ItemMinIcon

Constructors
Name
Description
ItemMinIcon()Sets up a blank Item Min Icon object.
ItemMinIcon(Icon defaultIcon)Sets up an Item Min Icon object with a default Icon.
ItemMinIcon([Only registered and activated users can see links. Click Here To Register...] fileName)Loads an Item Min Icon object from a file.

Properties
Return Type
Name
Description
IconDefaultGets or Sets the Default Icon for the Itemtype. Used when an Icon's file is not found.
Icon[Only registered and activated users can see links. Click Here To Register...][uint id]Gets or Sets the Icon given the ID.
[Only registered and activated users can see links. Click Here To Register...]CountGets the Count of Icons found in the Item Min Icon, the default icon is not counted.



Itemtype
Back To Top

Inheritance Hierarchy
NameSpace: ItemCore

Class Deffinition:

public class Itemtype

Constructors
Name
Description
Itemtype()Creates a blank instance of an Itemtype object.

Properties
Return Type
Name
Description
[Only registered and activated users can see links. Click Here To Register...]<[Only registered and activated users can see links. Click Here To Register...]>IDListGets a list of all the IDs found in the Itemtype.
ItemData[Only registered and activated users can see links. Click Here To Register...][uint id]Gets or Sets Item Data for the Itemtype given the ID of the Item. Suggest using "UpdateItem" method when changing data, "AddNewItem" when adding data and "DeleteItem" when removing data.
[Only registered and activated users can see links. Click Here To Register...]<[Only registered and activated users can see links. Click Here To Register...], ItemData>ItemsGets a collection of items within the Itemtype.
06/04/2012 18:45 zombaxcrop#2
Thank you
06/05/2012 13:20 funhacker#3
Included documentation for the following:


Classes:
06/06/2012 11:07 javairc#4
very nice funhacker.. thx for this..
06/06/2012 16:44 funhacker#5
Quote:
Originally Posted by javairc View Post
very nice funhacker.. thx for this..
You're welcome :)


Here's a bit of a code snippet for those that need a little helping nudge in using this:


Loading the itemtype into memory:
Code:
//Declare variables
FileReader fileReader;
Itemtype itemtype;

//Setup the fileReader
fileReader = new FileReader(new FileStream("itemtype.dat",FileMode.Open,FileAccess.Read));

//Load the itemtype
itemtype = fileReader.ReadItemtype();

//Close the itemtype file
fileReader.Close();
Displaying all the items in a list box (named "lbItems")
Code:
//Clear the list box
lbItems.Items.Clear();

//Add all the items
lbItems.Items.AddRange(itemtype.Items.Values.ToArray());

Enjoy! :)
02/23/2016 20:41 Khalidmadkour#6
Quote:
Originally Posted by funhacker View Post
You're welcome :)


Here's a bit of a code snippet for those that need a little helping nudge in using this:


Loading the itemtype into memory:
Code:
//Declare variables
FileReader fileReader;
Itemtype itemtype;

//Setup the fileReader
fileReader = new FileReader(new FileStream("itemtype.dat",FileMode.Open,FileAccess.Read));

//Load the itemtype
itemtype = fileReader.ReadItemtype();

//Close the itemtype file
fileReader.Close();
Displaying all the items in a list box (named "lbItems")
Code:
//Clear the list box
lbItems.Items.Clear();

//Add all the items
lbItems.Items.AddRange(itemtype.Items.Values.ToArray());

Enjoy! :)

If anyone still here Can you help ?

I tried to use this code
FileReader fileReader; << depend on itemcore so I have to import it first
Itemtype itemtype; << what I have to import to use this ?
my error when I try to dim itemtype as itemtype is " type itemtype is not defined "