Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

            Olá galera!

 

 

Eu tive algumas ideias para um mount system e não consigo fazer sozinho, então vim pedir uma ajudinha :)

 

Uso esse mount system: 

local function tameMonster(cid, item, itemEx, tame, run, broken)
	n = math.random(100)
	if n <= broken then
		doCreatureSay(cid, "Lost item", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid)
	elseif n > broken and n <= (tame+broken) then
		doRemoveItem(item.uid)
		doCreatureSay(cid, "You tamed the mount", TALKTYPE_ORANGE_1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You tamed the mount "..getCreatureName(itemEx.uid)..".")
		return true
	elseif n > (tame+broken) and n <= (tame+broken+run) then
		doCreatureSay(cid, "the monster fled", TALKTYPE_ORANGE_1)
		doRemoveCreature(itemEx.uid)
	else
		doCreatureSay(cid, "Try again", TALKTYPE_ORANGE_1)
	end
	return false
end

local function inArray(table, value)
	for i,v in pairs(table) do
		if (v.name == string.lower(value)) then
			return i
		end
	end
	return 0
end

local mounts = {
	{item = 13307, name = "wailing widow", id = 1,			 tame=0, run=100, broken=0},
	{item = 13298, name = "terror bird", id = 2,			 tame=0, run=100, broken=0},
	{item = 5907, name = "bear", id = 3,				 tame=100, run=0, broken=0},
	{item = 13295, name = "black sheep", id = 4,			 tame=100, run=0, broken=0},
	{item = 13293, name = "midnight panther", id = 5,		 tame=0, run=100, broken=0},
	{item = 13294, name = "draptor", id = 6,				 tame=0, run=100, broken=0},
	{item = 13305, name = "crustacea gigantica", id = 7,	 tame=0, run=100, broken=0},
	{item = 13292, name = "tin lizzard", id = 8,		 tame=0, run=100, broken=0},
	{item = 13247, name = "boar", id = 10,					 tame=0, run=100, broken=0},
	{item = 13291, name = "undead cavebear", id = 12,		 tame=0, run=100, broken=0}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isCreature(itemEx.uid) then
		if inArray(mounts, getCreatureName(itemEx.uid)) > 0 then
			i = inArray(mounts, getCreatureName(itemEx.uid))
			if item.itemid == mounts[i].item and not canPlayerRideMount(cid, mounts[i].id) then
				if tameMonster(cid, item, itemEx, mounts[i].tame, mounts[i].run, mounts[i].broken) then
					doSendMagicEffect(fromPosition, CONST_ME_MAGIC_BLUE)
					doRemoveCreature(itemEx.uid)
					doPlayerAddMount(cid, mounts[i].id)
				else
					doSendMagicEffect(toPosition, CONST_ME_POFF)
				end
			end
		end
	end
	return true
end

Está funcionando perfeitamente, mas eu queria que quando o player montasse na montaria a montaria adicionasse 10% da vida do player ao player, e quando ele desmontasse a vida dele voltaria ao normal. E também uma que adicionasse 10% da mana do player ao player. Espero que alguém me ajude, grato!

 

Rep++

     

Oi

  • Respostas 8
  • Visualizações 419
  • Created
  • Última resposta

Top Posters In This Topic

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.7k

Informação Importante

Confirmação de Termo