• 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 Is there a way to hide Spell name when using it?

Misterion

New Member
Joined
Jan 24, 2014
Messages
52
Reaction score
4
Is there a way to hide spell name when using it, like a function or something? In tibia 8.6, The Forgotten Server version 0.3.6.
 
You probably need to do changes in your source code. I would just trace emote from config.lua and see where it is used in the sources, and remove the emote text effect. When changing the sources you also need to recompile a new executable file.
 
It is a lot of work but you can return false in every spells .lua file. If the script returns false the engine thinks execution failed and does not display the words even if combat got executed. Im not sure if it consumes mana in this case but you can also do it from script.
 
spells.cpp line 44
C++:
ReturnValue Spells::onPlayerSay(Player* player, const std::string& words)
{
    std::string reWords = words;
    trimString(reWords);

    InstantSpell* instantSpell = getInstantSpell(reWords);
    if(!instantSpell)
        return RET_NOTPOSSIBLE;

    size_t size = instantSpell->getWords().length();
    std::string param = reWords.substr(size, reWords.length() - size), reParam = "";
    if(instantSpell->getHasParam() && !param.empty() && param[0] == ' ')
    {
        size_t quote = param.find('"', 1);
        if(quote != std::string::npos)
        {
            size_t tmp = param.find('"', quote + 1);
            if(tmp == std::string::npos)
                tmp = param.length();

            reParam = param.substr(quote + 1, tmp - quote - 1);
        }
        else if(param.find(' ', 1) == std::string::npos)
            reParam = param.substr(1, param.length());

        trimString(reParam);
    }

    if(!instantSpell->playerCastInstant(player, reParam))
        return RET_NEEDEXCHANGE;

    std::string ret = instantSpell->getName();
    if(param.length())
    {
        trimString(param);
        size_t tmp = 0, rtmp = param.length();
        if(param[0] == '"')
            tmp = 1;

        if(param[rtmp] == '"')
            rtmp -= 1;

        ret += ": " + param.substr(tmp, rtmp);
    }

    return RET_NOERROR;
}
 
Becouse I'm not the only one who was looking for it and this topic displays at the top in google search here's solution:

Add this to your sources:

And then you can add in your config.lua this option:
Code:
hidespellwords = true
 
Back
Top