text coming above it's head when cast spell

Tbol

Active Member
Joined
Apr 7, 2019
Messages
327
Reaction score
38
TFS 1.2 Hi, so some of the servers have this when you cast a spell lets say Energy Wave the orange text comes up above player with text Energy Wave right? So i have this same stuff, i found it on otland and modified it so when you cast spell like this lets say Energy Wave dgfrgdfgdfg text above player comes up Energy Wave "dgfrgdfgdfg but now i have an issue with it :D so i have craft runes npc and i have rune called Energy Wave Rune so when i try to cast it, it calls it as a spell called Energy Wave "Rune.
So probably solution would be that you could add your custom tags in your name only if you use this \/
7f6a06d4c8a402adc649544c4d5d5c49.png
so
Spell Name
"whatever text i want
and not like this
Spell Name whatever text i want



Not sure which code part to send here. Cant remember where it was edited in source
 

M0ustafa

1337
Senator
Joined
Mar 4, 2017
Messages
2,508
Solutions
310
Reaction score
1,082
Location
Egypt
If you are not using main TFS emote spell option then you will have to post your code of how you added your spell emoting.
or you can check something like how params are added to levitate/summon creatures functions on older TFS and try doing like it.
 
OP
Tbol

Tbol

Active Member
Joined
Apr 7, 2019
Messages
327
Reaction score
38
If you are not using main TFS emote spell option then you will have to post your code of how you added your spell emoting.
or you can check something like how params are added to levitate/summon creatures functions on older TFS and try doing like it.
Read my thread at the bottom
"Not sure which code part to send here. Cant remember where it was edited in source"

mention on my thread that i cant remember what i edited so thats why i can provide the code maybe in spells.cpp not sure
 

M0ustafa

1337
Senator
Joined
Mar 4, 2017
Messages
2,508
Solutions
310
Reaction score
1,082
Location
Egypt
How do you enable/disable it? Is it through config like normal one? Or its just always enabled? and yes it should be in spells.cpp
 
OP
Tbol

Tbol

Active Member
Joined
Apr 7, 2019
Messages
327
Reaction score
38
How do you enable/disable it? Is it through config like normal one? Or its just always enabled? and yes it should be in spells.cpp
It always enabled someone from otland made it like old time ago. It was source code edit because by default spell would send message on Default chat when casting spell so someone changed it.
spells.cpp
 

Loney

Senator
Premium User
Joined
Jul 23, 2012
Messages
1,941
Solutions
16
Reaction score
174
Location
🇲🇽
Found this thread real quick with search function, hope it gives you an idea (modification should be in game.cpp aswell)

 
OP
Tbol

Tbol

Active Member
Joined
Apr 7, 2019
Messages
327
Reaction score
38
Found this thread real quick with search function, hope it gives you an idea (modification should be in game.cpp aswell)

So how would you check if he uses Quotation Mark if there isnt a quotation mark on spell it sends as a regular text in Default chat as example SpellName Blalbalblablal <---- Incorrect sends in default chat. SpellName "Blalbalblablal <---- Correct cast it as a spell

Lua:
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 {
            return internalCreatureSay(player, TALKTYPE_MONSTER_SAY, words, false);
        }

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

    return false;
}
 
Top