• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Invisibility to monster and player, withgout a source edit.?

Werewolf

Forbidden Ascension
Joined
Jul 15, 2012
Messages
886
Reaction score
123
IM Just looking for a way to make a character with access 1 go /ghost command for 10 Second duration. and have a 20 Second cooldown.

If i have too i'll make the player access 2 or higher just looking for a way to make him Temporarily invisible to monster and player. Rep++

Oh and if possible make it a spell, so i can adjust the mana cost/level requirement and such to use it.

Running 8.54 TFS 0.3.6
 
Last edited:
XD well my server has about 11 vocations, and one of them being an assassin. my players have been wanting to go invisible to players, however i have not a clue how to do it other then the command /ghost with a higher access, so i got rid of the tutor position and made it for assassin vocations only* so they can be invisible to other players, except for the assassins themselves. however the command lasts forever, making it Over powerd... so i just want a /ghost command/spell that does the same thing but for 10 seconds, with a 20 second cool down, to make it less OP
 
this is how it looks in the sources from the public revs..
LUA:
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);

		Status::getInstance()->addPlayer();
		for(AutoList<Player>::listiterator pit = Player::listPlayer.list.begin(); pit != Player::listPlayer.list.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(), NM_ME_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(), NM_ME_POFF);
		}

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

		Status::getInstance()->removePlayer();
		IOLoginData::getInstance()->updateOnlineStatus(player->getGUID(), false);
		player->sendTextMessage(MSG_INFO_DESCR, "You are now invisible.");
	}

	return true;
}


i suppose
Code:
createCondition(CONDITIONID_DEFAULT, CONDITION_GAMEMASTER, -1, 0, false, GAMEMASTER_INVISIBLE)
is the interesting part..


both the conditions CONDITION_GAMEMASTER and condition GAMEMASTER_INVISIBLE exists in 000-constant.lua in the libs..
 
Last edited:
So how do i change this spell, to use The game master invisible?

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_INVISIBLE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10000)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
 
Last edited:
You can use doExecuteTalkaction with ignoreAccess parameter and call the /ghost command, then addEvent(removeInvis, 20*1000, ...) and check if the player is invisible and if so call /ghost again.
However I had bad experience with the /ghost command, it will most likely cause debugs to players.
 
You can do as Summ said, but the problem is. That it can cause client crash when players step into eacher when they are ghost.
 
im not afraid of the de-bugging thing.

- - - Updated - - -

You can use doExecuteTalkaction with ignoreAccess parameter and call the /ghost command, then addEvent(removeInvis, 20*1000, ...) and check if the player is invisible and if so call /ghost again.
However I had bad experience with the /ghost command, it will most likely cause debugs to players.

How do i put these parameters into a spell format?
 
I was looking into this and got an idea.

getCreatureHideHealth(cid) then change player outfit to nothing somehow idk but i think its possible to do that.
 
It would be good, but i dont think its possable, also the hp bar and the name are 2 differant things that need to be hid
 
Back
Top