enums.h
replace
with
game.cpp
replace
with
Talkaction example
replace
Code:
enum StorageValues_t {
STORAGEVALUE_PROMOTION = 30018
};
Code:
enum StorageValues_t {
STORAGEVALUE_PROMOTION = 30018,
STORAGEVALUE_EMOTE = 30019
};
game.cpp
replace
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, SPEAK_SAY, words, false);
} else {
return internalCreatureSay(player, SPEAK_MONSTER_SAY, words, false);
}
} else if (result == TALKACTION_FAILED) {
return true;
}
return false;
}
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) {
int32_t value;
player->getStorageValue(STORAGEVALUE_EMOTE, value);
if (!g_config.getBoolean(ConfigManager::EMOTE_SPELLS) && value != 1) {
return internalCreatureSay(player, SPEAK_SAY, words, false);
} else {
return internalCreatureSay(player, SPEAK_MONSTER_SAY, words, false);
}
} else if (result == TALKACTION_FAILED) {
return true;
}
return false;
}
Code:
function onSay(cid, words, param)
local player = Player(cid)
if param == "emote" and player:getStorageValue(30019) < 1 then
player:setStorageValue(30019, 1)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have enabled emoted spells.")
elseif param == "normal" and player:getStorageValue(30019) == 1 then
player:setStorageValue(30019, 0)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have disabled emoted spells.")
end
return false
end
Last edited: