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

TFS 1.X+ Its possible to make items charges...

mano368

Senior Support Team Member
Staff member
Support Team
Joined
Sep 2, 2011
Messages
646
Solutions
46
Reaction score
296
Location
Brazil
Its possible in tfs 1.5 to make items doesnt lose charges, like sd, potions and others if a player has storage? Only using lua or only in sources?
 
Solution
E
for potions its very easy, just add a storage check here:



now for runes it is in source:

ammo and weapon as well:


to check storage in source just see the places where getStorageValue is used in this file
for potions its very easy, just add a storage check here:



now for runes it is in source:

ammo and weapon as well:


to check storage in source just see the places where getStorageValue is used in this file
 
Solution
for potions its very easy, just add a storage check here:



now for runes it is in source:

ammo and weapon as well:


to check storage in source just see the places where getStorageValue is used in this file
Thanks, I'll do!
 
Last edited:
@Evil Puncker
tried using something like that, but without effect:
C:
    uint32_t key = 100008;
    int32_t value;
    if (player->getStorageValue(key, value)) {
        if (hasCharges && item && g_config.getBoolean(ConfigManager::REMOVE_RUNE_CHARGES) && value < 1) {
            int32_t newCount = std::max<int32_t>(0, item->getSubType() - 1);
            g_game.transformItem(item, item->getID(), newCount);
        }
    }

its wrong?

edit: ok, my mistake, forgot to give player storage value 0 to work in login event
 
Last edited:
Back
Top