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

runes otx2

Dogrinha

New Member
Joined
Oct 6, 2019
Messages
206
Solutions
1
Reaction score
2
I have a problem in my otx2, the player when doing a rune that has 2 charges or more, can give only 1 shot and it ends, is not counting the charges, could someone help me?

I believe the source counts by quantity and not by loads.
obs. I don't want infinite loads, it's a global server
otx2 tibia 8.6
 
Try this solution
and download latest TFS or latest OTX 2 from their Github would have most of your issues fixed.
 
@M0ustafa i think this, but idk what i do to fix
Lua:
bool RuneSpell::executeUse(Player* player, Item* item, const PositionEx& posFrom,
    const PositionEx& posTo, bool, uint32_t creatureId)
{
    if(!checkRuneSpell(player, posTo))
        return false;

    bool result = false;
    if(isScripted())
    {
        LuaVariant var;
        if(needTarget)
        {
            if(!creatureId)
            {
                if(Tile* tileTo = g_game.getTile(posTo))
                {
                    if(const Creature* creature = tileTo->getTopVisibleCreature(player))
                        creatureId = creature->getID();
                }
            }

            var.type = VARIANT_NUMBER;
            var.number = creatureId;
        }
        else
        {
            var.type = VARIANT_POSITION;
            var.pos = posTo;
        }

        result = internalCastSpell(player, var);
    }
    else if(function)
        result = function(this, player, item, posFrom, posTo);

    if(result)
    {
        Spell::postSpell(player);
        if(hasCharges && item && g_config.getBool(ConfigManager::REMOVE_RUNE_CHARGES))
            g_game.transformItem(item, item->getID(), std::max((int32_t)0, ((int32_t)item->getItemCount()) - 1));
    }

    return result;
}
 
@M0ustafa i think this, but idk what i do to fix
Lua:
bool RuneSpell::executeUse(Player* player, Item* item, const PositionEx& posFrom,
    const PositionEx& posTo, bool, uint32_t creatureId)
{
    if(!checkRuneSpell(player, posTo))
        return false;

    bool result = false;
    if(isScripted())
    {
        LuaVariant var;
        if(needTarget)
        {
            if(!creatureId)
            {
                if(Tile* tileTo = g_game.getTile(posTo))
                {
                    if(const Creature* creature = tileTo->getTopVisibleCreature(player))
                        creatureId = creature->getID();
                }
            }

            var.type = VARIANT_NUMBER;
            var.number = creatureId;
        }
        else
        {
            var.type = VARIANT_POSITION;
            var.pos = posTo;
        }

        result = internalCastSpell(player, var);
    }
    else if(function)
        result = function(this, player, item, posFrom, posTo);

    if(result)
    {
        Spell::postSpell(player);
        if(hasCharges && item && g_config.getBool(ConfigManager::REMOVE_RUNE_CHARGES))
            g_game.transformItem(item, item->getID(), std::max((int32_t)0, ((int32_t)item->getItemCount()) - 1));
    }

    return result;
}
try this
C++:
bool RuneSpell::executeUse(Player* player, Item* item, const PositionEx& posFrom,
    const PositionEx& posTo, bool, uint32_t creatureId)
{
    if(!checkRuneSpell(player, posTo))
        return false;

    bool result = false;
    if(isScripted())
    {
        LuaVariant var;
        if(creatureId && needTarget)
        {
            var.type = VARIANT_NUMBER;
            var.number = creatureId;
        }
        else
        {
            var.type = VARIANT_POSITION;
            var.pos = posTo;
        }

        result = internalCastSpell(player, var);
    }
    else if(function)
        result = function(this, player, item, posFrom, posTo);

    if(result)
    {
        Spell::postSpell(player);
        if(hasCharges && item && g_config.getBool(ConfigManager::REMOVE_RUNE_CHARGES))
            g_game.transformItem(item, item->getID(), std::max((int32_t)0, ((int32_t)item->getItemCount()) - 1));
    }

    return result;
}
 
no work =/
i think it's damaged sources btw let's give another try go to your actions.cpp find
Code:
Action* Actions::getAction(const Item* item, ActionType_t type) const
replace with this class
C++:
Action* Actions::getAction(const Item* item, ActionType_t type) const
{
    if(item->getUniqueId() && (type == ACTION_ANY || type == ACTION_UNIQUEID))
    {
        ActionUseMap::const_iterator it = uniqueItemMap.find(item->getUniqueId());
        if(it != uniqueItemMap.end())
            return it->second;
    }

    if(item->getActionId() && (type == ACTION_ANY || type == ACTION_ACTIONID))
    {
        ActionUseMap::const_iterator it = actionItemMap.find(item->getActionId());
        if(it != actionItemMap.end())
            return it->second;
    }

    if(type == ACTION_ANY || type == ACTION_ITEMID)
    {
        ActionUseMap::const_iterator it = useItemMap.find(item->getID());
        if(it != useItemMap.end())
            return it->second;
    }

    if(type == ACTION_ANY || type == ACTION_RUNEID)
    {
        if(Action* runeSpell = g_spells->getRuneSpell(item->getID()))
            return runeSpell;
    }

    return NULL;
}
 
no work because is original file
Can u try to change rune items to "stackable" item editing them from tibia.dat and items.otb maybe should work like this
 
Back
Top