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

Lua [TFS 1.2] Xodet not adding charges to runes

Eldora

Banned User
Joined
Oct 19, 2009
Messages
604
Reaction score
26
Why does my magic NPC (Xodet) not add charges to the runes?

This is my code:
Lua:
shopModule:addBuyableItem({'heavy magic missile'}, 2311, 125, 5, 'heavy magic missile rune')

1677337451826.png

And this gives me a "heavy magic missile rune" without charges:

1677337484064.png


I want it to add 5 charges to the rune, how can I accomplish that?
 
Creates a function to sell runes in the src/behaviourdatabase.cpp at line 813 or that is, before it.stackable and changes it.stackable putting && !it.isRune
like this in the script below.


C++:
if (it.isRune()) {
            if (data < 0) {
                data = 1;
            }
            for (int32_t i = 0; i < std::max<int32_t>(1, amount); i++) {
                Item* item = Item::CreateItem(itemId, data);
                if (!item) {
                    break;
                }
                ReturnValue ret = g_game.internalPlayerAddItem(player, item);
                if (ret != RETURNVALUE_NOERROR) {
                    delete item;
                    break;
                }
            }
        }
        else if (it.stackable && !it.isRune())
Lacked a function to issue rune loads in the src.

i thought tfs 1.2 was the same version i have, disconsider that.
 
Back
Top