• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling How to fix that? [TFS 0.4]

marek12

Available for sprite works
Joined
Apr 8, 2020
Messages
398
Solutions
4
Reaction score
394
I'm using this modification: Feature - Quiver [TFS 1.X + 0.X] (https://otland.net/threads/quiver-tfs-1-x-0-x.264070/)
Source edits: Fir3element/3777 (https://github.com/Fir3element/3777/compare/master...rookgaard:feature/quiver)

How it should work: equip Quiver into arrow slot, put arrows inside, equip bow into your hand and attack target. arrows will be taken from the quiver one by one on each shot. You cannot put other items than ammo into quiver and also you can only use quiver or just ammo on it's own.

How does it work for me: attacking and taking arrows works fine, but I can use any container as a quiver. it can be even pirate bag. also I can put other items into quiver (example: cc, sword, anything).

How do I fix these ?
Post automatically merged:

I guess I can do by myself to prevent putting other items into quiver, but how to fix so only item with name quiver can be the actual quiver? :D
 
Last edited:
doesn't actually help at all :s
It may be helpful in different script, but not on the one I am about ^^
 
hm... then you should do something like this: create an onMove and add some prints to it, I don't know the value anymore but when you move an item to your inventory it has a number like 127833
when you move an item to a backpack, it has another value, let's say 78331
then all you need to do is to create a onMove event that's like
Lua:
function onMove(params)
    if movingToBackpack and not arrowsId then
        return doPlayerSendCancel(cid, "You can only move arrows to this container.") and false
    end
end
should be a good work around, source edit would be better tho
 
the part where only ammo can be put to the quiver is pretty easy, the main problem im facing is that all the containers are working as a quiver (only quiver should). thanks anyways for replying :D
 
then you can remove all quiver stuff from your source and make an onMove like I said, I had made a post here asking for help with something kinda simular, if I find that thread I'll like it to you

edit: here it is, TFS 0.X - dual wielding conditions (https://otland.net/threads/dual-wielding-conditions.266159/) read xikini's answers, that position 65535 is player's inventory if i'm not mistake, just have to know the number related to backpack and check onMove

again, source would be better but I'm not that skilled to help you with that
 
If I remove quiver from sources then it wont work, haha :D
It may be similar in case of putting/taking objects to/from container, but it's not similar at all when it comes to removing arrows from the quiver(and only the quiver) on hit.
 
well I don't think I know what a quiver is then, in my head it is a backpack that you store arrows but I have never seen it anywhere, stoped playing tibia in a long time and I'm not using this on my server so sorry if I misunderstood everything. Good luck trying to fix tho
 
thanks for trying but I guess we are not about the same stuff ^^
Post automatically merged:

well I don't think I know what a quiver is then, in my head it is a backpack that you store arrows but I have never seen it anywhere, stoped playing tibia in a long time and I'm not using this on my server so sorry if I misunderstood everything. Good luck trying to fix tho
I just explained in the first post how it should work :D
[B]How it should work: [/B]equip Quiver into arrow slot, put arrows inside, equip bow into your hand and attack target. arrows will be taken from the quiver one by one on each shot. You cannot put other items than ammo into quiver and also you can only use quiver or just ammo on it's own.
 

This is basically identical to what you're attempting, except with gold.
Should be easy enough to change to fit your needs.
 

This is basically identical to what you're attempting, except with gold.
Should be easy enough to change to fit your needs.
yeah but this is also related just to not allowing other items be in quiver.
Maybe I explained it wrong how it should work.

Basically the quiver is a container which holds all type of ammunition, you can put quiver (with 1000 arrows inside it) in your arrow slot while holding a bow and when you attack creature it will remove ammo from the quiver. This part is working 100% for me. The problem is that I can also put normal bag (also with arrows in it) in my arrow slow and it will also remove ammo. It should only work and remove ammo when I got equiped quiver. not bag, not backpack, not parcel. just quiver ^^
 
so check if the item is being moved to the arrow slot.. and if it is.. check the itemid... and if the itemid is incorrect, return false.

I don't see where the issue is
 
so check if the item is being moved to the arrow slot.. and if it is.. check the itemid... and if the itemid is incorrect, return false.

I don't see where the issue is
You still don't get me :D
Not being rude, just saying that we are not talking about same thing.

I know this must be done in sources (which I completely don't know the language = won't be able to fix it myself). I don't want to not being able to put other containers or items in arrow slot. I just want that the arrows will only get automatically removed when are in the quiver.
I guess I will just leave it and remove it completely. I don't think someone would be able to help me with that crap.
 
You still don't get me :D
Not being rude, just saying that we are not talking about same thing.

I know this must be done in sources (which I completely don't know the language = won't be able to fix it myself). I don't want to not being able to put other containers or items in arrow slot. I just want that the arrows will only get automatically removed when are in the quiver.
I guess I will just leave it and remove it completely. I don't think someone would be able to help me with that crap.
Ah, I see the problem.

Yeah, that would definitely need to be done via sources, or at least.. it would be massively easier then the work around I would create. xD
 
I'm not good at c++ but looking at the source changes you linked to I would try this.
After this line here (before the for-loop), add this:
C++:
if (container->getName() != "Quiver")
{
    return NULL;
}
 
I'm not good at c++ but looking at the source changes you linked to I would try this.
After this line here (before the for-loop), add this:
C++:
if (container->getName() != "Quiver")
{
    return NULL;
}
error when compiling :/ " 322 xxxxxxxx\source\player.cpp `container' was not declared in this scope "
Post automatically merged:

Ah, I see the problem.

Yeah, that would definitely need to be done via sources, or at least.. it would be massively easier then the work around I would create. xD
yeah. as far as I am newbie in OT's I still guess it would be best to do it in sources :D
Post automatically merged:

jesus.... can;t believe it was so simple to fix....
basically what was wrong was that in items.xml I had slottype=backpack instead of arrow for the quiver.
This is pathetic. By reading the code I just thought maybe just change that and it worked.

Thank you very much guys anyways. Probably if you wouldn't reply I would just delete it and forget about it.
 
Last edited:
As I said, I'm not good at c++:confused:
Try this:
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;
        }
    }
}
 
As I said, I'm not good at c++:confused:
Try this:
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;
        }
    }
}
sorry to taking your time.
now it came the problem was in completely different place than I thought.
sources were okay. but well, logically for me I thought the problem is just there. lmao
 
Back
Top