dropz
Member
- Joined
- May 4, 2022
- Messages
- 46
- Reaction score
- 24
hello everyone!!
here we go again
im implementing a quiver for my server, i found a good content here on the forum thats helped me a lot in the way but now im facing a problem that im not knowing how to deal with...
well, i used the solutions of this thread for the implementation:
but fow now im getting a issue about the container items, every backpack, bag or parcel that i put on the arrow slot with ammunition inside works like a quiver.
i tried create a some conditions on player.cpp using some tips that i saw in few other threads about quivers, but unfortunately nothing worked for me..
anyone knows a way to solve it?
here's my player.cpp function that's used for ammunition:
i tried create a another "if" below "if(Container *container = item->getContainer())" to try deal with the idea of item->getName() = "quiver", something like that buuut no results..
better example of one try:
but it didnt works too...
Thanks in advance, you guys are rock.
solved:
if you came here trying found a solution for it, add this new "if" that has the comment of quiver id.
use the thread that i mencioned before to get the base of the quiver system creation, then use this funcition for the getAmmution on "player.cpp":
here we go again
im implementing a quiver for my server, i found a good content here on the forum thats helped me a lot in the way but now im facing a problem that im not knowing how to deal with...
well, i used the solutions of this thread for the implementation:
C++ - Quiver for Nostalrius 7.7
Hey, been trying to figure out how to get a quiver to work on Nostalrius 7.7. Here the git for the sources I'm using: GitHub I've tried looking at these two tutorials but my players.cpp doesn't match. I don't have any "ammoItem". Quiver [TFS 1.X + 0.X] Quiver for paladins - tfs1.X I don't...
otland.net
but fow now im getting a issue about the container items, every backpack, bag or parcel that i put on the arrow slot with ammunition inside works like a quiver.
i tried create a some conditions on player.cpp using some tips that i saw in few other threads about quivers, but unfortunately nothing worked for me..
anyone knows a way to solve it?
here's my player.cpp function that's used for ammunition:
C++:
Item* Player::getAmmunition() const
{
Item* item = inventory[CONST_SLOT_AMMO];
if(!item)
return nullptr;
if(Container *container = item->getContainer()){
Item* weapon = getWeapon();
const ItemType& it = Item::items[weapon->getID()];
for(ContainerIterator iter = container->iterator(); iter.hasNext(); iter.advance()) {
const ItemType& itr = Item::items[(*iter)->getID()];
if(itr.ammoType == it.ammoType)
return (*iter);
}
}
return item;
}
i tried create a another "if" below "if(Container *container = item->getContainer())" to try deal with the idea of item->getName() = "quiver", something like that buuut no results..
better example of one try:
C++:
Container* container = ammoItem->getContainer()
if (container && container->getName() == "Quiver")
{
for(ContainerIterator iter = container->begin(), end = container->end(); iter != end; ++iter)
{
if (item->getAmmoType() == (*iter)->getAmmoType())
{
ammoItem = (*iter);
break;
}
}
}
Thanks in advance, you guys are rock.
Post automatically merged:
solved:
if you came here trying found a solution for it, add this new "if" that has the comment of quiver id.
use the thread that i mencioned before to get the base of the quiver system creation, then use this funcition for the getAmmution on "player.cpp":
C++:
Item* Player::getAmmunition() const
{
Item* item = inventory[CONST_SLOT_AMMO];
if(!item)
return nullptr;
if(Container *container = item->getContainer()){
if(container->getID() == 5090 || container->getID() == 5101){ // id of quiver items.
Item* weapon = getWeapon();
const ItemType& it = Item::items[weapon->getID()];
for(ContainerIterator iter = container->iterator(); iter.hasNext(); iter.advance()) {
const ItemType& itr = Item::items[(*iter)->getID()];
if(itr.ammoType == it.ammoType)
return (*iter);
}
}
}
return item;
}
Last edited: