danylook2
Member
I Host my server 4 years i love this forum maybe someone can faind solutions for can wear outfit for tibia bot ng there is something like this in client 8.5 but my problem is only for old client so lets start what i found in my source. this is canwear in player.cpp
______________________________________________________
I tray add this two options i am very close to add this i do my best .
______________________________________________________
-- Moderator edit: Use code tags
Code:
const OutfitListType& Player::getPlayerOutfits()
{
return m_playerOutfits.getOutfits();
}
bool Player::canWear(uint32_t _looktype)
{
if(m_playerOutfits.isInList(_looktype)){
return true;
}
return false;
}
void Player::genReservedStorageRange()
{
unsigned long base_key;
//generate outfits range
base_key = PSTRG_OUTFITS_RANGE_START + 1;
const OutfitList& global_outfits = Outfits::getInstance()->getOutfitList(sex);
const OutfitListType& outfits = m_playerOutfits.getOutfits();
OutfitListType::const_iterator it;
for(it = outfits.begin(); it != outfits.end(); ++it){
uint32_t looktype = (*it)->looktype;
if(!global_outfits.isInList(looktype)){
long value = (looktype << 16);
storageMap[base_key] = value;
base_key++;
if(base_key > PSTRG_OUTFITS_RANGE_START + PSTRG_OUTFITS_RANGE_SIZE){
std::cout << "Warning: [Player::genReservedStorageRange()] Player " << getName() << " with more than 500 outfits!." << std::endl;
break;
}
}
}
}
void Player::addOutfit(uint32_t _looktype, uint32_t _premium)
{
Outfit outfit;
outfit.looktype = _looktype;
outfit.premium = _premium;
m_playerOutfits.addOutfit(outfit);
}
bool Player::remOutfit(uint32_t _looktype, uint32_t _premium)
{
Outfit outfit;
outfit.looktype = _looktype;
outfit.premium = _premium;
return m_playerOutfits.remOutfit(outfit);
}
I tray add this two options i am very close to add this i do my best .
______________________________________________________
Code:
bool Player::canWear(uint32_t _looktype)
{
if(m_playerOutfits.isInList(_looktype)){
return true;
}
return false;
}
-- Moderator edit: Use code tags
Attachments
-
player.zip17.8 KB · Views: 1 · VirusTotal
Last edited by a moderator: