• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Feature Change /ghost

tonyplyson

New Member
Joined
Sep 24, 2011
Messages
10
Reaction score
0
Hello everybody, I want to change a business here, I removed the msg type that was saying "You are now visible" and everything. Now I want to remove that message in red that appears in defaut. / ghost
then here is the code .

Code:
bool TalkAction::ghost(Creature* creature, const std::string& cmd, const std::string& param)
{
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;
}
 
You need change the talk script

<talkaction log="yes" access="5" words="/ghost" event="function" value="ghost"/>

If you remove access the red msg will leave.
 
Back
Top