Hum...
Achei interessante...
seria legal algo deste tipo...
gostei :positive:
vou fazer um teste aqui no meu ot pra ver nu q q da =]
vlw ae pelo script
info
Grupo: Barão
Registrado: 15/12/07
Posts: 239
Reputação: +2

Hum...
Achei interessante...
seria legal algo deste tipo...
gostei :positive:
vou fazer um teste aqui no meu ot pra ver nu q q da =]
vlw ae pelo script
info
Grupo: Conde
Registrado: 18/12/05
Posts: 912
Reputação: +86
Gênero: Masculino
Char no Tibia: Kohzete
Bem aqui mais um codigo em c++ para The Forgotten Server, esse codigo foi criado por slawkens e foi colocado no otfans.
Ele faz alguns outfits serem obtidos apenas por quests.
O autor faz uma resalva dizendo que ele não é 100% e tem vezes que o player não ganha o outfit
Porém e os usuarios ainda não tivemos esse desprazer, eu por exemplo ja fiz todos os npcs de roupas e testei com uns 20 char e nenhum deu erro algum.
Se você usa a versão do The Forgotten Server 0.3.0 Alpha 4 pode usar esse executavel que eu compilei com o codigo (ja corrigido).
Nesse link
Primeiro você deverá ter o Dev-Cpp com as libs corretas para poder compilar, se você não o tem baixe aqui.
link
E também as sources mais recentes que podem ser obtidas aqui.
link
Recomendo usar a versão mais recente do The Forgotten Server que no caso hoje é a 0.3.0 Alpha 4, porém nela havia um bug
q eu consegui corrigir e postarei ele aqui em primeira mão.
Em outfit.cpp
Depois de :
Adicione :
troque :
por:
Nessa mesma função troque:
por :
if((*it)->premium && playerPremium || !(*it)->premium) { if((*it)->quest && playerStorage || !(*it)->quest) return true; } return false;depois de :
adicione :
depois de:
adicione:
Em Outfit.h
Depois de:
adicione :
Troque :
por:
Em protocolgame.cpp:
Troque:
OutfitListType::const_iterator it, it_; for(it = global_outfits.begin(); it != global_outfits.end(); ++it) { if((*it)->premium && !player->isPremium()) count_outfits--; }Por:
OutfitListType::const_iterator it, it_; for(it = global_outfits.begin(); it != global_outfits.end(); ++it) { int32_t value; player->getStorageValue((40000 + (*it)->looktype), value); if(((*it)->premium && !player->isPremium()) || ((*it)->quest && !(value==1))) count_outfits--; }Troque:
for(it = global_outfits.begin(); it != global_outfits.end() && (count_outfits > 0); ++it) { if((*it)->premium && player->isPremium() || !(*it)->premium) { addedAddon = false; msg->AddU16((*it)->looktype); msg->AddString(Outfits::getInstance()->getOutfitName((*it)->looktype)); //TODO: Try to avoid using loop to get addons for(it_ = player_outfits.begin(); it_ != player_outfits.end(); ++it_) { if((*it_)->looktype == (*it)->looktype) { msg->AddByte((*it_)->addons); addedAddon = true; break; } } if(!addedAddon) msg->AddByte(0x00); count_outfits--; } }Por:
for(it = global_outfits.begin(); it != global_outfits.end() && (count_outfits > 0); ++it) { if((*it)->premium && player->isPremium() || !(*it)->premium) { int32_t value; player->getStorageValue((40000 + (*it)->looktype), value); if((*it)->quest && (value == 1) || !(*it)->quest) { addedAddon = false; msg->AddU16((*it)->looktype); msg->AddString(Outfits::getInstance()->getOutfitName((*it)->looktype)); //TODO: Try to avoid using loop to get addons for(it_ = player_outfits.begin(); it_ != player_outfits.end(); ++it_) { if((*it_)->looktype == (*it)->looktype) { msg->AddByte((*it_)->addons); addedAddon = true; break; } } if(!addedAddon) msg->AddByte(0x00); count_outfits--; } } }Em player.cpp
Troque :
Por:
Troque :
Por:
Se você usa TFS Alpha 4 faça isso, se for uma versão anterior não prescisa :
Em player.cpp
Troque :
Por :
Para usa-lo em Outfits.xml adicione a tag questOnly="1" em todos os outfits que não virá com o jogador
Os que não tiver virão normalmente (a tag premmium ainda funciona).
Para adiciona o outfit ao player você deve adiciona o StorageValue 40000 + numero do outfit
Por exemplo se vc quer adicionar o Hunter Outfit adicione o StorageValue 40129(40000+129).