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
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:
but im getting this erro while compiling:
i looked for the functions and getInstantSpell actually exist.
Thanks in advice!
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:
i looked for the functions and getInstantSpell actually exist.
Thanks in advice!