As many people wonder, how is an item interpreted?
let's suppose we have this dagger
- Code:
-
Item = 1 Dagger 1 8 1 1 5 0 1 4 0 300 0 1 0 25 200 1 0 0 0 0 -10 7 1 0
what each attribute means?
when the server reads each item.cfg, each attribute means something.
go to hg src, item.h. you will find this variables(among many others):
- Code:
-
m_sIDnum
m_cName
m_cItemType
m_cEquipPos
m_sItemEffectType
m_sItemEffectValue1
m_sItemEffectValue2
m_sItemEffectValue3
m_sItemEffectValue4
m_sItemEffectValue5
m_sItemEffectValue6
m_wMaxLifeSpan
m_sSpecialEffect
m_sSprite
m_sSpriteFrame
m_bIsForSale
m_wPrice
m_wWeight
m_cApprValue
m_cSpeed
m_sLevelLimit
m_cGenderLimit
m_sSpecialEffectValue1
m_sSpecialEffectValue2
m_sRelatedSkill
m_cCategory
m_cItemColor
in the dagger's case, this is:
- Code:
-
Item = 1 Dagger 1 8 1 1 5 0 1 4 0 300 0 1 0 25 200 1 0 0 0 0 -10 7 1 0
m_sIDnum = 1
m_cName = "Dagger"
m_cItemType = 1
m_cEquipPos = 8
m_sItemEffectType = 1
m_sItemEffectValue1 = 1
m_sItemEffectValue2 = 5
m_sItemEffectValue3 = 0
m_sItemEffectValue4 = 1
m_sItemEffectValue5 = 4
m_sItemEffectValue6 = 0
m_wMaxLifeSpan = 300
m_sSpecialEffect = 0
m_sSprite = 1
m_sSpriteFrame = 0
m_bIsForSale
m_wPrice 25
m_wWeight = 200
m_cApprValue = 1
m_cSpeed = 0
m_sLevelLimit = 0
m_cGenderLimit = 0
m_sSpecialEffectValue1 = 0
m_sSpecialEffectValue2 = -10
m_sRelatedSkill = 7
m_cCategory = 1
m_cItemColor = 0
m_sIDnum it's a number, it's always a number.
m_cName
is an alphanumeric character string.
the default total length of these strings is 22 characters.m_cItemType
go to item.h, you will find the many types with the prefix name: DEF_ITEMTYPE
in this case, 1 is
DEF_ITEMTYPE_EQUIPthe Dagger can and must be equipped to be used.the rest ones are all numers
m_cEquipPos
the description is
the same as the previous one. the prefix name: DEF_EQUIPPOS8 is DEF_EQUIPPOS_RHAND, Right Hand.m_sItemEffectType is a number. again:
DEF_ITEMEFFECTTYPE
1 is DEF_ITEMEFFECTTYPE_ATTACKthe Dagger is a weapond. the previous variable and, the next 6 ones, are related.
m_sItemEffectValue1 = 1
m_sItemEffectValue2 = 5
m_sItemEffectValue3 = 0
m_sItemEffectValue4 = 1
m_sItemEffectValue5 = 4
m_sItemEffectValue6 = 0
The best thing I can advise you is to go to CalcTotalItemEffect
in that function, you will find the application of each effect.
in that case you will find:
- Code:
-
case DEF_ITEMEFFECTTYPE_ATTACK:
m_pClientList[iClientH]->m_cAttackDiceThrow_SM = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue1;
m_pClientList[iClientH]->m_cAttackDiceRange_SM = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue2; m_pClientList[iClientH]->m_cAttackBonus_SM = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue3;
m_pClientList[iClientH]->m_cAttackDiceThrow_L = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue4;
m_pClientList[iClientH]->m_cAttackDiceRange_L = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue5;
m_pClientList[iClientH]->m_cAttackBonus_L = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue6;
the rest, are calculations.
not all m_sItemEffectType use that 6 variables at the same way.
m_wMaxLifeSpan is the endurance. 300
m_sSpecialEffect is used for special weaponds, armors and shields.
0 means normal. go to hg src and try to see the applications.
there are not to many.
this ones are used to show the item in bag.
folder 1, frame 0. in client, the codification works like this.
you can use pack builder, every folder is a image, and every frame
is numerated from 0 to, i dont know. the frames needed.
- Code:
-
m_sSprite = 1
m_sSpriteFrame = 0
open pack builder, open item-pack.pack
you will see all the Daggers, swords, long swords, special weaponds, etc.
frame number 0 is the dagger.
if you want to add a new item. just save the image to a .bmp file into your computer. open .bmp with paint. edit the image.
reload the .bmp to the pack. and make a new frame. it is a easy task.
this one are related to. if the price is negative in the .cfg file.
the item can not be buyed. 25 are the gold pieces needed.
m_bIsForSale
m_wPrice = 25
this one is used in the client. if an item is too heavy, can not be equipped.
m_wWeight = 200
this one is used in bEquipItemHandler
m_cApprValue = 1
i dont know how is used. dont matter.
as bigger is m_cSpeed = 0, character will need more STR to move the item
m_sLevelLimit = 0 is the level required to load/use the item,
m_cGenderLimit = 0 means that item can be used by male(1), and female(2) genders.
i think that m_sSpecialEffectValue1 is obsolete/useless
this one too.
m_sSpecialEffectValue2 = -10
this one is related with the skill of the character.
m_sRelatedSkill = 7
it doesn't matter too much
this one is important. go to RequestItemUpgradeHandler
and see the applications of each case.
m_cCategory = 1
item color, 0 mean no color. from 1 to 15 weaponds, 1 to 10 armors.
m_cItemColor = 0