Para arrumar isso você precisará de suas sources.
Em container.cpp procure por
Cylinder* Container::__queryDestination(int32_t& index, const Thing* thing, Item** destItem,
uint32_t& flags)
{
if(index == 254 /*move up*/)
{
index = INDEX_WHEREEVER;
*destItem = NULL;
Container* parentContainer = dynamic_cast<Container*>(getParent());
if(parentContainer)
return parentContainer;
return this;
}
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)
return this;
if(!((flags & FLAG_IGNOREAUTOSTACK) == FLAG_IGNOREAUTOSTACK)
&& item->isStackable() && item->getParent() != this)
{
//try to find a suitable item to stack with
uint32_t n = itemlist.size();
for(ItemList::reverse_iterator cit = itemlist.rbegin(); cit != itemlist.rend(); ++cit, --n)
{
if((*cit)->getID() == item->getID() && (*cit)->getItemCount() < 100)
{
*destItem = (*cit);
index = n;
return this;
}
}
}
if(index != INDEX_WHEREEVER)
{
Thing* destThing = __getThing(index);
if(destThing)
*destItem = destThing->getItem();
if(Cylinder* subCylinder = dynamic_cast<Cylinder*>(*destItem))
{
index = INDEX_WHEREEVER;
*destItem = NULL;
return subCylinder;
}
}
return this;
}
substitue por
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 procure
void Item::setDefaultSubtype()
caso não estiver substitue a função por isso
void Item::setDefaultSubtype()
{
setItemCount(1);
const ItemType& it = items[id];
if(it.charges)
setCharges(it.charges);
}
e em player.cpp procure
Cylinder* Player::__queryDestination(int32_t& index, const Thing* thing, Item** destItem,
uint32_t& flags)
{
substitue toda a função por
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;
}




info
Grupo: Campones
Registrado: 16/08/13
Posts: 19
Reputação: -1
Boa Tarde Galera.
No meu ot server nada de agrupa
EXP:Se eu tver 20 GMP na bp e comprar mais 80,ela n fica como 100,ela fica um slot de 20 e um de 80,isso acontece com runas,dinheiros etc...
Gostaria de saber como arrumar isso,se tem algum tutorial ensinando ou se alguem pode me ajudar aqui!
Obg