• 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!

How to make talkaction command don't appear in Default Channel?

gabriel28

Member
Joined
Mar 16, 2012
Messages
199
Solutions
6
Reaction score
24
Well, what I need to change in source to make the talk action command don't appear on default channel? If possible, make only the command that refers to ghost function don't appear.
Thanks in advance.
 
Solution
<talkaction words="/m" access="4" log="yes" event="script" value="creature.lua"/> <!-- show in default channel -->
<talkaction words="/m" access="4" log="no" event="script" value="creature.lua"/> <!-- dont show in default channel -->
Well, what I need to change in source to make the talk action command don't appear on default channel? If possible, make only the command that refers to ghost function don't appear.
Thanks in advance.
At least in newer TFS versions if you return false out of the onSay func it will negate the console message.
 
@Apollos
I forget everytime to put my version, is TFS 0.4.
I looked on the talkaction.cpp, but I don't have C++ knowledge, so I don't know what to do to make this change.
 
@Stigma
Change the return true in the end of ghost function to return false?
C++:
bool TalkAction::ghost(Creature* creature, const std::string&, const std::string&)
{
    Player* player = creature->getPlayer();
    if(!player)
        return false;

    if(player->hasFlag(PlayerFlag_CannotBeSeen))
    {
        player->sendTextMessage(MSG_INFO_DESCR, "Command disabled for players with special, invisibility flag.");
        return true;
    }

    SpectatorVec::iterator it;
    SpectatorVec list = g_game.getSpectators(player->getPosition());
    Player* tmpPlayer = NULL;

    Condition* condition = NULL;
    if((condition = player->getCondition(CONDITION_GAMEMASTER, CONDITIONID_DEFAULT, GAMEMASTER_INVISIBLE)))
    {
        player->sendTextMessage(MSG_INFO_DESCR, "You are visible again.");
        IOLoginData::getInstance()->updateOnlineStatus(player->getGUID(), true);
        for(AutoList<Player>::iterator pit = Player::autoList.begin(); pit != Player::autoList.end(); ++pit)
        {
            if(!pit->second->canSeeCreature(player))
                pit->second->notifyLogIn(player);
        }

        for(it = list.begin(); it != list.end(); ++it)
        {
            if((tmpPlayer = (*it)->getPlayer()) && !tmpPlayer->canSeeCreature(player))
                tmpPlayer->sendMagicEffect(player->getPosition(), MAGIC_EFFECT_TELEPORT);
        }

        player->removeCondition(condition);
        g_game.internalCreatureChangeVisible(creature, VISIBLE_GHOST_APPEAR);
    }
    else if((condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_GAMEMASTER, -1, 0, false, GAMEMASTER_INVISIBLE)))
    {
        player->addCondition(condition);
        g_game.internalCreatureChangeVisible(creature, VISIBLE_GHOST_DISAPPEAR);
        for(it = list.begin(); it != list.end(); ++it)
        {
            if((tmpPlayer = (*it)->getPlayer()) && !tmpPlayer->canSeeCreature(player))
                tmpPlayer->sendMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
        }

        for(AutoList<Player>::iterator pit = Player::autoList.begin(); pit != Player::autoList.end(); ++pit)
        {
            if(!pit->second->canSeeCreature(player))
                pit->second->notifyLogOut(player);
        }

        IOLoginData::getInstance()->updateOnlineStatus(player->getGUID(), false);
        if(player->isTrading())
            g_game.internalCloseTrade(player);

        player->clearPartyInvitations();
        if(player->getParty())
            player->getParty()->leave(player);

        player->sendTextMessage(MSG_INFO_DESCR, "You are now invisible.");
    }

    return true;  //this one?
}
 
@Stigma
Change the return true in the end of ghost function to return false?
C++:
bool TalkAction::ghost(Creature* creature, const std::string&, const std::string&)
{
    Player* player = creature->getPlayer();
    if(!player)
        return false;

    if(player->hasFlag(PlayerFlag_CannotBeSeen))
    {
        player->sendTextMessage(MSG_INFO_DESCR, "Command disabled for players with special, invisibility flag.");
        return true;
    }

    SpectatorVec::iterator it;
    SpectatorVec list = g_game.getSpectators(player->getPosition());
    Player* tmpPlayer = NULL;

    Condition* condition = NULL;
    if((condition = player->getCondition(CONDITION_GAMEMASTER, CONDITIONID_DEFAULT, GAMEMASTER_INVISIBLE)))
    {
        player->sendTextMessage(MSG_INFO_DESCR, "You are visible again.");
        IOLoginData::getInstance()->updateOnlineStatus(player->getGUID(), true);
        for(AutoList<Player>::iterator pit = Player::autoList.begin(); pit != Player::autoList.end(); ++pit)
        {
            if(!pit->second->canSeeCreature(player))
                pit->second->notifyLogIn(player);
        }

        for(it = list.begin(); it != list.end(); ++it)
        {
            if((tmpPlayer = (*it)->getPlayer()) && !tmpPlayer->canSeeCreature(player))
                tmpPlayer->sendMagicEffect(player->getPosition(), MAGIC_EFFECT_TELEPORT);
        }

        player->removeCondition(condition);
        g_game.internalCreatureChangeVisible(creature, VISIBLE_GHOST_APPEAR);
    }
    else if((condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_GAMEMASTER, -1, 0, false, GAMEMASTER_INVISIBLE)))
    {
        player->addCondition(condition);
        g_game.internalCreatureChangeVisible(creature, VISIBLE_GHOST_DISAPPEAR);
        for(it = list.begin(); it != list.end(); ++it)
        {
            if((tmpPlayer = (*it)->getPlayer()) && !tmpPlayer->canSeeCreature(player))
                tmpPlayer->sendMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
        }

        for(AutoList<Player>::iterator pit = Player::autoList.begin(); pit != Player::autoList.end(); ++pit)
        {
            if(!pit->second->canSeeCreature(player))
                pit->second->notifyLogOut(player);
        }

        IOLoginData::getInstance()->updateOnlineStatus(player->getGUID(), false);
        if(player->isTrading())
            g_game.internalCloseTrade(player);

        player->clearPartyInvitations();
        if(player->getParty())
            player->getParty()->leave(player);

        player->sendTextMessage(MSG_INFO_DESCR, "You are now invisible.");
    }

    return true;  //this one?
}
Like I said in my post the onSay function in lua. Unless this is the only place ghost is referenced. If not then yeah try return false there.
 
@Apollos
Yeah, I don't have lua to the ghost function. This is the GOD ghost comand that I use in one spell to make fully invisible to players, because of that, I want to remove the '/ghost' that appear in default when player cast the spell.
 
<talkaction words="/m" access="4" log="yes" event="script" value="creature.lua"/> <!-- show in default channel -->
<talkaction words="/m" access="4" log="no" event="script" value="creature.lua"/> <!-- dont show in default channel -->
 
Solution
Back
Top