Ir para conteúdo

[Encerrado] Itens como moedas não estão stackando sem puxar pra cima


fefuxd

Posts Recomendados

meu otserv não esta juntando os itens stackbles automaticamente.. tipo moeda.. tem que puxar um monte em cima do outro pra juntar..

como posso arrumar isso sem ter que trocar a distro? pois daria muito trabalho trocar a distro e configurar o OT tudo denovo..

 

DISTRO: Global Server 1.0.1 Developed by Dener Diegoli Team

Versão: 8.6

Editado por fefuxd
Link para o comentário
Compartilhar em outros sites

Titulo: Auto Stacking - TFS 0.3.6pl1

Créditos: Fresh (Otland)

Versão: 8.6 / 8.7 ...

 

Abra "container.cpp" e modifique:

 `Cylinder* Container::__queryDestination(int32_t& index, const Thing* thing, Item** destItem, uint32_t&)

 

Para:

 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;} 


Abra "container.cpp" e modifique a função:

`ReturnValue Container::__queryMaxCount(int32_t index, const Thing* thing, uint32_t count,`

 

Para: 

ReturnValue Container::__queryMaxCount(int32_t index, const Thing* thing, uint32_t count,    uint32_t& maxQueryCount, uint32_t flags) const{    const Item* item = thing->getItem();    if(!item)    {        maxQueryCount = 0;        return RET_NOTPOSSIBLE;    }     if(((flags & FLAG_NOLIMIT) == FLAG_NOLIMIT))    {        maxQueryCount = std::max((uint32_t)1, count);        return RET_NOERROR;    }     int32_t freeSlots = std::max((int32_t)(capacity() - size()), (int32_t)0);    if(item->isStackable())    {        uint32_t n = 0;        if(index != INDEX_WHEREEVER)        {            const Thing* destThing = __getThing(index);            const Item* destItem = NULL;            if(destThing)                destItem = destThing->getItem();             if(destItem && destItem->getID() == item->getID())                n = 100 - destItem->getItemCount();        }         maxQueryCount = freeSlots * 100 + n;        if(maxQueryCount < count)            return RET_CONTAINERNOTENOUGHROOM;    }    else    {        maxQueryCount = freeSlots;        if(maxQueryCount == 0)            return RET_CONTAINERNOTENOUGHROOM;    }     return RET_NOERROR;} 


Abra "container.cpp" e modifique a função:

`ReturnValue Container::__queryRemove(const Thing* thing, uint32_t count, uint32_t flags) const`

 

Para:

 ReturnValue Container::__queryRemove(const Thing* thing, uint32_t count, uint32_t flags) const{    int32_t index = __getIndexOfThing(thing);    if(index == -1)        return RET_NOTPOSSIBLE;     const Item* item = thing->getItem();    if(item == NULL)        return RET_NOTPOSSIBLE;     if(count == 0 || (item->isStackable() && count > item->getItemCount()))        return RET_NOTPOSSIBLE;     if(item->isNotMoveable() && !hasBitSet(FLAG_IGNORENOTMOVEABLE, flags))        return RET_NOTMOVEABLE;     return RET_NOERROR;} 

 

 

FB9.png

 

Link para o comentário
Compartilhar em outros sites

  • 8 months later...
Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...