Olá, desculpe minha ausensia no forum, estava de "mudança" :B agora voltando ao assunto, um belo code que faz qualquer item precisar de level.
Lembrando code só pega na versão Forgotten Server.
Em Items.cpp
Depois dê:
ItemType::ItemType() {
Adicione:
reqLevel = 0;
Depois dê:
else if(strcasecmp(strValue.c_str(), "replaceable") == 0){ if(readXMLInteger(itemAttributesNode, "value", intValue)){ it.replaceable = (intValue != 0); } }
Adicione:
else if(strcasecmp(strValue.c_str(), "reqLevel") == 0){ if(readXMLInteger(itemAttributesNode, "value", intValue)){ it.reqLevel = intValue; } }
Agora em items.h
Depois dê:
ItemTypes_t type;
Adicione:
uint32_t reqLevel;
Agora em item.h
Adicione em algum lugar do public:
int32_t getReqLevel() const {return items[id].reqLevel;}
Em player.cpp
Depois dê:
default: ret = RET_NOTPOSSIBLE; break; }
Adicione:
if(level < item->getReqLevel()) ret = RET_NOTPOSSIBLE;
Pronto, para fazer funcionar basta você adicionar a linha que está em negrito:
<item id="2436" name="skull staff"><attribute key="description" value="The staff longs for death."/>
<attribute key="weight" value="1700"/>
<attribute key="defense" value="12"/>
<attribute key="attack" value="36"/>
<attribute key="reqLevel" value="30"/>
<attribute key="weaponType" value="club"/>
</item>
Créditos: ??
Não sei, achei este code em um forum polonês
Abraços!