olha mano pra vc fazer isso vc tenque ter o iteneditor adequado a seu server ae quando vc abri ele vc vai clica no quadradinho e marca la em stackable= empilhável
espero ter ajudado abraços!
Por othereality, 25 de jan. de 2011 em Archived
info
Grupo: Campones
Registrado: 17/06/10
Posts: 61
Reputação: +4
Char no Tibia: Churupettinha
olha mano pra vc fazer isso vc tenque ter o iteneditor adequado a seu server ae quando vc abri ele vc vai clica no quadradinho e marca la em stackable= empilhável
espero ter ajudado abraços!
info
Grupo: Visconde
Registrado: 17/01/11
Posts: 343
Reputação: +46
Char no Tibia: Zodriac

não cara não é isso..
vou dar um exemplo:
eu tenho na BP 3gp e mato um troll que dropa 6gp, quando eu jogo pra dentro da BP eu quero que ele empilhe automaticamente..
sem eu precisar por exatamente em cima dos outros tres.
vc sabe como me ajudar?
**ja é a segunda vez que estou pedindo e ja vi pedidos não atendidos de outros membros..
não entendo porque ninguem responde.. =S
info
Grupo: Campones
Registrado: 27/10/08
Posts: 46
Reputação: +8
Char no Tibia: Sonnyxz

Testado no TFS 0.4 e 0.3.6pl1
Para arruma o AutoStatacking é preciso mexer nas sources do server.
Ache as fuções e modifique.
Em container.cpp
Cylinder* Container::__queryDestination(int32_t& index, const Thing* thing, Item** destItem, uint32_t&)
{
if(index == 254 /*move up*/)
{
index = INDEX_WHEREEVER;
*destItem = NULL;
Container* parentContainer = dynamic_cast<Container*>(getParent());
if(parentContainer)
return parentContainer;
return this;
}
else if(index == 255 /*add wherever*/){
index = INDEX_WHEREEVER;
*destItem = NULL;
}
else if(index >= (int32_t)capacity()){
/*
if you have a container, maximize it to show all 20 slots
then you open a bag that is inside the container you will have a bag with 8 slots
and a "grey" area where the other 12 slots where from the container
if you drop the item on that grey area
the client calculates the slot position as if the bag has 20 slots
*/
index = INDEX_WHEREEVER;
*destItem = NULL;
}
const Item* item = thing->getItem();
if(item == NULL){
return this;
}
if(item->isStackable()){
if(item->getParent() != this){
//try find a suitable item to stack with
uint32_t n = 0;
for(ItemList::iterator cit = itemlist.begin(); cit != itemlist.end(); ++cit){
if((*cit) != item && (*cit)->getID() == item->getID() && (*cit)->getItemCount() < 100){
*destItem = (*cit);
index = n;
return this;
}
++n;
}
}
}
if(index != INDEX_WHEREEVER){
Thing* destThing = __getThing(index);
if(destThing)
*destItem = destThing->getItem();
Cylinder* subCylinder = dynamic_cast<Cylinder*>(*destItem);
if(subCylinder){
index = INDEX_WHEREEVER;
*destItem = NULL;
return subCylinder;
}
}
return this;
}
Em item.cpp
void Item::setDefaultSubtype()
{
setItemCount(1);
const ItemType& it = items[id];
if(it.charges)
setCharges(it.charges);
}
Em player.cpp
Cylinder* Player::__queryDestination(int32_t& index, const Thing* thing, Item** destItem,
uint32_t& flags)
{
if(index == 0 /*drop to capacity window*/ || index == INDEX_WHEREEVER){
*destItem = NULL;
const Item* item = thing->getItem();
if(item == NULL){
return this;
}
//find an appropiate slot
std::list<Container*> containerList;
for(int i = SLOT_FIRST; i < SLOT_LAST; ++i){
Item* inventoryItem = inventory[i];
if(inventoryItem == tradeItem){
continue;
}
if(inventoryItem == tradeItem){
continue;
}
if(inventoryItem){
//try find an already existing item to stack with
if(inventoryItem != item && item->isStackable() && inventoryItem->getID() == item->getID() && inventoryItem->getItemCount() < 100){
*destItem = inventoryItem;
index = i;
return this;
}
//check sub-containers
else if(Container* subContainer = inventoryItem->getContainer()){
Cylinder* tmpCylinder = NULL;
int32_t tmpIndex = INDEX_WHEREEVER;
Item* tmpDestItem = NULL;
tmpCylinder = subContainer->__queryDestination(tmpIndex, item, &tmpDestItem, flags);
if(tmpCylinder && tmpCylinder->__queryAdd(tmpIndex, item, item->getItemCount(), flags) == RET_NOERROR){
index = tmpIndex;
*destItem = tmpDestItem;
return tmpCylinder;
}
containerList.push_back(subContainer);
}
}
//empty slot
else if(__queryAdd(i, item, item->getItemCount(), flags) == RET_NOERROR){
index = i;
*destItem = NULL;
return this;
}
}
//check deeper in the containers
for(std::list<Container*>::iterator it = containerList.begin(); it != containerList.end(); ++it){
for(ContainerIterator iit = (*it)->begin(); iit != (*it)->end(); ++iit){
if(Container* subContainer = (*iit)->getContainer()){
if(subContainer == tradeItem){
continue;
}
Cylinder* tmpCylinder = NULL;
int32_t tmpIndex = INDEX_WHEREEVER;
Item* tmpDestItem = NULL;
tmpCylinder = subContainer->__queryDestination(tmpIndex, item, &tmpDestItem, flags);
if(tmpCylinder && tmpCylinder->__queryAdd(tmpIndex, item, item->getItemCount(), flags) == RET_NOERROR){
index = tmpIndex;
*destItem = tmpDestItem;
return tmpCylinder;
}
}
}
}
return this;
}
Thing* destThing = __getThing(index);
if(destThing)
*destItem = destThing->getItem();
Cylinder* subCylinder = dynamic_cast<Cylinder*>(destThing);
if(subCylinder){
index = INDEX_WHEREEVER;
*destItem = NULL;
return subCylinder;
}
else
return this;
}
Créditos: Exedion e kwovan
info
Grupo: Visconde
Registrado: 17/01/11
Posts: 343
Reputação: +46
Char no Tibia: Zodriac

vlw o/
se funcionar começo hj mesmo com seus reps..
já já eu edito aki:
Olha cara sou bem noob em script,
e não consegui achar.
se consegue me dizer>
*onde ficam as sources do OT?
E
*onde eu baixo o TFS 0.4 ou o 0.3.6pl1?
Vlw =D
to loco atras disso faz tempo..
Editado Janeiro 26 por OtheReality
info
Grupo: Campones
Registrado: 27/10/08
Posts: 46
Reputação: +8
Char no Tibia: Sonnyxz

Bom as sources do TFS 0.3.6pl1 você esta baixando elas nesse link Clique aqui, e podera editar oque quiser...agora sobre como editar e compilar o server procure em Tutoriais de Programação aqui mesmo no Xtibia.
Flw
info
Grupo: Visconde
Registrado: 17/01/11
Posts: 343
Reputação: +46
Char no Tibia: Zodriac

blz eu baxei e to testando mas dexa ver se eu entendi eu tenho que substituir isso que vc me deu, pelos antigos?
foi oque fiz apesar de ter sido muito foda pq os scripts estavam desorganizados =S
estou testando e edito:
olha eu extrai as sources e botei todas na pasta do meu ot..
tavez ele não seja compativel se vc tiver um que seja com esass sources que vc me deu agradeço.
ok depois de extrair eu botei sem a pasta e sem a pasta data dentro do pasta do ot e editei oque vc mandou substituindo, ao abrir o servidor não da erro nenhum mas não funcionou..
se poder me ajudar..
porfavor =S
EDITE:
o seguinte tutorial me ajudou com minhas ultimas duvidas:
http://www.xtibia.com/forum/topic/145300-c-compilando-um-otserv/
2 REP+ pra vc está justo ![]()
vlw pela grande ajuda =D
pode ser fechado.
Editado Janeiro 30 por OtheReality
info
Grupo: Visconde
Registrado: 17/01/11
Posts: 343
Reputação: +46
Char no Tibia: Zodriac
eai scripters do xtibia..
bem eu to querendo que os itens empilhem automaticamente no meu OT.
não tem muito oque explicar, é simples para entender.
Bem me parece uma coisa bem complicada de se fazer então prometo a quem conseguir 3 rep.
se funcionar em qualquer servidor 8.6 funciona no meu
vlw.