Ir para conteúdo

Featured Replies

Postado

.Qual servidor ou website você utiliza como base? 

otx 2.15 - 8.60

Qual o motivo deste tópico? 

Preciso fazer uma verificação na Spell "jump up e Jump down" (levitate) que se o player estiver trapado com doCreatureSetNoMove, ele não possa usar  o jump.
provavelmente eu tenha que fazer alguma alteração na source. se alguem puder me ajudar.

 

Você tem o código disponível? Se tiver publique-o aqui: 

Spoiler

function onCastSpell(cid, var)

local waittime = 35 -- Tempo de exhaustion em segundos
local storage = 5890 -- Storage de Spell, nunca usar a mesma em outra spell, a menos que não queira usar duas spell juntas!

if exhaustion.check(cid, storage) then
doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.")
return false
end 

	local numerodehit = 5
	local drena = 200000

	if isMonster(getCreatureTarget(cid))then
		return false
	end

local target = getCreatureTarget(cid)
local targetpos = getCreaturePosition(target)
local efepos = {x=targetpos.x, y=targetpos.y, z=targetpos.z}

if not isPlayer(target) then
doPlayerSendCancel(cid, "Você só pode usar essa técnica em Players.")
return false
end
doCreatureSetNoMove(cid, true)
addEvent(doCreatureSetNoMove,5*1000,cid, false)
local tempo = 5 -- 5 Segundos, que é o tempo que o player vai ficar paralizado
doCreatureSetNoMove(target, true)
addEvent(doCreatureSetNoMove, tempo*1000, target, false)
doSendMagicEffect(efepos, 316) -- Efeito do mokuton prision
exhaustion.set(cid, storage, waittime)
for x=1,numerodehit do
		if isPlayer(getCreatureTarget(cid)) then
		doCreatureAddMana(getCreatureTarget(cid), -drena)
		end
	end

return true
end

	

 

 

Spells.cpp

 

Spoiler


bool InstantSpell::Levitate(const InstantSpell*, Creature* creature, const std::string& param)
{
	Player* player = creature->getPlayer();
	if(!player)
		return false;

	uint16_t floor = 7;
	ReturnValue ret = RET_NOERROR;
	const Position& position = creature->getPosition();
	Position destination = Spells::getCasterPosition(creature, creature->getDirection());

	std::string tmpParam = asLowerCaseString(param);
	if(tmpParam == "up")
		floor = 8;
	else if(tmpParam != "down")
		ret = RET_NOTPOSSIBLE;

	if(ret == RET_NOERROR)
	{
		ret = RET_NOTPOSSIBLE;
		if(position.z != floor)
		{
			Tile* tmpTile = NULL;
			if(floor != 7)
			{
				tmpTile = g_game.getTile(position.x, position.y, position.z - 1);
				destination.z--;
			}
			else
			{
				tmpTile = g_game.getTile(destination);
				destination.z++;
			}

			if(!tmpTile || (!tmpTile->ground && !tmpTile->hasProperty(IMMOVABLEBLOCKSOLID)))
			{
				Tile* tile = player->getTile();
				tmpTile = g_game.getTile(destination);
				if(tile && tmpTile && tmpTile->ground && !tmpTile->hasProperty(IMMOVABLEBLOCKSOLID) &&
					!tmpTile->floorChange() && tile->hasFlag(TILESTATE_HOUSE) == tmpTile->hasFlag(TILESTATE_HOUSE)
					&& tile->hasFlag(TILESTATE_PROTECTIONZONE) == tmpTile->hasFlag(TILESTATE_PROTECTIONZONE))
					ret = g_game.internalMoveCreature(NULL, player, tile, tmpTile, FLAG_IGNOREBLOCKITEM | FLAG_IGNOREBLOCKCREATURE);
			}
		}
	}

	if(ret == RET_NOERROR)
	{
		g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_TELEPORT, player->isGhost());
		return true;
	}

	player->sendCancelMessage(ret);
	g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF, player->isGhost());
	return false;
}

 

 

Editado por elielder
add spells.cpp, e add spells. (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo