• 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!

[8.6 OTServ 0.6.4] Capacity doesn't update correctly on "conjureItem" spells.

Demnish

Tibian Hero
Joined
Sep 28, 2011
Messages
402
Solutions
2
Reaction score
65
Location
Sweden
So my problem is this, whenever I conjure items, the cap doesn't properly update until it's created a new stack.
So by definition I have infinite cap due to this,

Here are some images to put it into perspective: (The bug can be replicated at will)

STEP 1 (399 cap, 75 bolts)
dVITtOL.png


STEP 2 (399 cap, 100 bolts)
V4eofXE.png


STEP 3
(359 cap, 125 bolts)
yjfGweN.png


As you can see, something is wrong. I can start at 25 Bolts and keep my cap until I reach above 100 and the inventory is changed, however it does change by the correct number when the inventory is updated. (In this case 25 bolts is 20oz and with +50 it changed by 40oz)
I should also mention that if I move or alter the inventory in any way except conjuration, the cap is updated. If I went above what my character's total cap is, it will become 0 and stay 0 until I've cleared out enough cap.

I've tried this with adding items 1 by 1 to the same stack, but the bug seems to only occur during conjuration (function="conjureItem").

Here is the spell:
Code:
        <conjure name="Conjure Bolt" words="exevo con mort" maglv="6" mana="70" conjureId="2543" conjureCount="25" function="conjureItem">
            <vocation name="Paladin"/>  <vocation name="Royal Paladin"/>
        </conjure>

It seems that every conjuration spell that creates items out of "thin air" suffers from this, so runes or any other type of conjuration that uses another item as a reagent doesn't suffer from this.
(Using blank runes doesn't alter inventory and only stack count, but the bug doesn't exist here)

If you need additional information, just ask!
Help would be greatly appreciated.

King regards, Z.
 
Last edited:
Can you provide the sources and data for your server? Problem might lies in lua spell classes (conjure spell) or server sources (bug in addItem?)
 
Can you provide the sources and data for your server? Problem might lies in lua spell classes (conjure spell) or server sources (bug in addItem?)
Distro: [8.6] OTServ 0.6.4 STABLE (OTServ 0.6.4)
Datapack: Uploadfiles.io - data.rar (Essentially the same Datapack you get from the distro, just a few minor tweaks)
I should also mention that the count you can read in "Spells.xml" for ammo is not what I used in the pictures. I put 100 as a quick workaround, which is not ideal since I want to use 25 etc.

Anyway, thank you for taking time to look into my problem! :)
 
Last edited:
Distro: [8.6] OTServ 0.6.4 STABLE (OTServ 0.6.4)
Datapack: Uploadfiles.io - data.rar (Essentially the same Datapack you get from the distro, just a few minor tweaks)
I should also mention that the count you can read in "Spells.xml" for ammo is not what I used in the pictures. I put 100 as a quick workaround, which is not ideal since I want to use 25 etc.

Anyway, thank you for taking time to look into my problem! :)

Hi

I've looked into code and heres my thoughts:

1. Can you check if creating bread (into same stack) and fishing fish produces the same bug? They should do according to Lua code.
2. Can you check somehow if thats only visual bug? For example the available cap displayed in client can be just not updated (u see 399 cap but in reality u got 350~ and cant pick up item that weights more than 350+)

If you got ability to recompile your server engine I think I found something. I think theres also possiblity that server does not properly update weight while its only updating item (count in this example) and not creating new one.
Try to add updateInventoryWeight method into body of onUpdateInventoryItem

In player.cpp
( opentibia/server )

Try add into onUpdateInventoryItem method
C++:
void Player::onUpdateInventoryItem(SlotType slot, Item* oldItem, const ItemType& oldType, Item* newItem, const ItemType& newType)
{
    if(oldItem != newItem){
        onRemoveInventoryItem(slot, oldItem);
    }
    if(tradeState != TRADE_TRANSFER){
        checkTradeState(oldItem);
    }

    updateInventoryWeight(); // add this
}
 
I have no doubt that your solution would fix the issue, however I had to abandon the distro I was working with (OTServ 0.6.4) due to bugs like these ones among a lot of other ones that really broke the game the way I ment to make it.
I've looked into TFS 1.2 for client 10.98 and hope that one can provide more stability and less issues in the long run since my VC17 is being a bitch to work with I really have no intentions of editing the sources, at least not at this time when the project in such a basic state. Still need lots of LUA codes to be done and spells to be edited, pretty much everything has to be changed in a way so I guess after all that is done I'm switching focus towards the sources.

Thanks for your help, keep it up!
 
Back
Top