• 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+ TFS 1.3 - Emote spells

Ovnyx

Member
Joined
Jul 25, 2017
Messages
163
Solutions
2
Reaction score
7
Hi, i was trying to change how the cast spell works, i enabled in config lua the emote flag, and what i am looking for is that when a player cast a spell the words show are not the "Words" , instead i want to show the "Name" so if i cast exura it will say "Light healing".

i was looking into this function in game.cpp:
Code:
bool Game::playerSaySpell(Player* player, SpeakClasses type, const std::string& text)
{
    std::string words = text;

    TalkActionResult_t result = g_talkActions->playerSaySpell(player, type, words);
    if (result == TALKACTION_BREAK) {
        return true;
    }

    result = g_spells->playerSaySpell(player, words);
    if (result == TALKACTION_BREAK) {
        if (!g_config.getBoolean(ConfigManager::EMOTE_SPELLS)) {
            return internalCreatureSay(player, TALKTYPE_SAY, words, false);
        } else {
            //LOOKING HERE TO CHANGE
            return internalCreatureSay(player, TALKTYPE_MONSTER_SAY, words, false);
        }

    } else if (result == TALKACTION_FAILED) {
        return true;
    }

    return false;
}

is there a way to create a Spell or Spells instance with the "words", in order to use something like getName() and i wan use that string instead of the words?
i tryied this:
Code:
 Spells spell = Spells();
 spell.getInstantSpell(words);

but im getting this erro while compiling:
1569119526225.png
i looked for the functions and getInstantSpell actually exist.

Thanks in advice!
 
C++ methods:
C++:
type Class::methodName(params){
type variable;
//code
return variable;
}

You declared a different type than you returned

Besides that, I told you to make a new function using that one as an example. The function you're editing is still in use.
 
Back
Top