Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Nome: Mount System

Versão: 8.70

Sistema: Action

Bem, estava vendo aqui e não encontrei nenhum mount system pareçido com oque tenho aqui intão vou postar para vocês completo e funcionando perfeitamente.

Testado em Crystal server V1.0

Em data/action/script crie um arquivo .lua e adicione:


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=10, run=39, broken=51},

	{item = 13298, name = "terror bird", id = 2,			 tame=10, run=39, broken=51},

	{item = 5907, name = "bear", id = 3,				 tame=7, run=39, broken=54},

	{item = 13295, name = "black sheep", id = 4,			 tame=7, run=35, broken=58},

	{item = 13293, name = "midnight panther", id = 5,		 tame=10, run=39, broken=51},

	{item = 13294, name = "draptor", id = 6,				 tame=10, run=39, broken=51},

	{item = 13305, name = "crustacea gigantica", id = 7,	 tame=10, run=39, broken=51},

	{item = 13292, name = "tin lizzard", id = 8,		 tame=10, run=36, broken=54},

	{item = 13247, name = "boar", id = 10,					 tame=10, run=39, broken=51},

	{item = 13291, name = "undead cavebear", id = 12,		 tame=10, run=39, broken=51}

}


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 getPlayerMount(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

Agora em action.xml adicione:

	<action itemid="13295" event="script" value="tools/mounts.lua"/> --reins

	<action itemid="13294" event="script" value="tools/mounts.lua"/> --harness

	<action itemid="13293" event="script" value="tools/mounts.lua"/> --leather whip

	<action itemid="13298" event="script" value="tools/mounts.lua"/> --carrot on a stick

	<action itemid="13247" event="script" value="tools/mounts.lua"/> --hunting horn

	<action itemid="13305" event="script" value="tools/mounts.lua"/> --Giant Shrimp

	<action itemid="13291" event="script" value="tools/mounts.lua"/> --Maxilla Maximus

	<action itemid="5907" event="script" value="tools/mounts.lua"/> --Slingshot

	<action itemid="13307" event="script" value="tools/mounts.lua"/> --Sweet Smelling Bait

	<action itemid="13292" event="script" value="tools/mounts.lua"/> --Tin key

Agora em items/items.xml adicione na ultima linha, antes do </items>

		<item id="13291" name="maxilla maximus" article="a">

		<attribute key="description" value="A hermit near Carlin might be able to tell you more about it." />

		<attribute key="weight" value="200" />

	</item>

	<item id="13292" name="tin key" article="a">

		<attribute key="description" value="A hermit near Carlin might be able to tell you more about it." />

		<attribute key="weight" value="200" />

	</item>

	<item id="13293" name="leather whip" article="a">

		<attribute key="description" value="A hermit near Carlin might be able to tell you more about it." />

		<attribute key="weight" value="200" />

	</item>

	<item id="13294" name="harness" article="a">

		<attribute key="description" value="A hermit near Carlin might be able to tell you more about it." />

		<attribute key="weight" value="200" />

	</item>

	<item id="13295" name="reins" article="a">

		<attribute key="description" value="A hermit near Carlin might be able to tell you more about it." />

		<attribute key="weight" value="200" />

	</item>

	<item id="13298" name="carrot on a stick" article="a">

		<attribute key="description" value="A hermit near Carlin might be able to tell you more about it." />

		<attribute key="weight" value="200" />

	</item>

	<item id="13305" name="giant shrimp" article="a">

		<attribute key="description" value="A hermit near Carlin might be able to tell you more about it." />

		<attribute key="weight" value="200" />

	</item>

	<item id="13307" name="sweet smelling bait" article="a">

		<attribute key="description" value="A hermit near Carlin might be able to tell you more about it." />

		<attribute key="weight" value="200" />

	</item>

	<item id="13247" name="hunting horn" article="a">

		<attribute key="description" value="A hermit near Carlin might be able to tell you more about it." />

		<attribute key="weight" value="200" />

	</item>

E por ultimo em XML/mounts.xml adicione:

<?xml version="1.0" encoding="UTF-8"?>

<mounts>

		<mount id="1" clientId="368" name="Widow Queen" speed="10" />

		<mount id="2" clientId="369" name="Racing Bird" speed="20" />

		<mount id="3" clientId="370" name="War Bear" speed="10" />

		<mount id="4" clientId="371" name="Black Sheep" speed="5" />

		<mount id="5" clientId="372" name="Midnight Panther" speed="20" />

		<mount id="6" clientId="373" name="Draptor" speed="40" />

		<mount id="7" clientId="374" name="Titanica" speed="15" />

		<mount id="8" clientId="375" name="Tin Lizzard" speed="15" />

		<mount id="9" clientId="376" name="Blazebringer" speed="20" />

		<mount id="10" clientId="377" name="Rapid Boar" speed="20" />

		<mount id="11" clientId="378" name="Stampor" speed="20" />

		<mount id="12" clientId="379" name="Undead Cavebear" speed="20" />

</mounts>

Caso já tenha os items configurados no items.xml, basta trocar a config do action!

tame - possibilidade do monstro fugir em %

run - possibilidade de adquirir a montaria em %

broken - possibilidade de quebrar o item em %

PS: caso modifique preste muita atenção, ao total tem que dar 100 em tame, run e broken juntos ex:

Tame = 10

Run = 40

Broken = 50

TOtal = 100

Créditos: ruda 100%

Editado por Subyth (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Mt bom cara !

"ℱoco, ℱorçα, ℱé, ℱelicidαde & ℱodα-se os ℱilhos dα Putα."

Premiações:

tYBgy.png

Link para o post
Compartilhar em outros sites

Ta aqui sociopata:


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=10, run=39, broken=51},

		{item = 13298, name = "terror bird", id = 2,					 tame=10, run=39, broken=51},

		{item = 5907, name = "bear", id = 3,							 tame=7, run=39, broken=54},

		{item = 13295, name = "black sheep", id = 4,					 tame=7, run=35, broken=58},

		{item = 13293, name = "midnight panther", id = 5,				tame=10, run=39, broken=51},

		{item = 13294, name = "draptor", id = 6,								 tame=10, run=39, broken=51},

		{item = 13305, name = "crustacea gigantica", id = 7,	 tame=10, run=39, broken=51},

		{item = 13292, name = "tin lizzard", id = 8,			 tame=10, run=36, broken=54},

		{item = 13247, name = "boar", id = 10,								   tame=10, run=39, broken=51},

		{item = 13291, name = "undead cavebear", id = 12,				tame=10, run=39, broken=51}

}


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

Agradeço vodkart pela função! REP+

Editado por Subyth (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • 2 years later...

Desculpa reviver o tópico, mas aqui não funcionou, testei milhares de vezes e não funcionou =/

 

-----------Edit---------

 

Você deu informação errada amigo.

 

tame: chance de domar o monstro

run: chance do monstro escapar

broken: chance do item quebrar

 

E também alguns servers precisam da linha 

getPlayerMount = canPlayerRideMount

em data/lib/100-compat.lua     o meu precisou :)

Editado por NathanAmaro (veja o histórico de edições)

Oi

Link para o post
Compartilhar em outros sites
  • 2 weeks later...

funfa 10.37 com TFS 1.0?

 

Não brother, são funções do 0.3.6 então não irá funcionar =P

YDmXTU2.png

 

Entenda tudo sobre VPS, DEDICADOS & HOSPEDAGENS. => Clique aqui

Global Full Download 10.9x - TFS 1.2/FERUMBRAS/KRAILOS. => Clique aqui

 

Muitos querem aquilo que você tem, 
mas vão desistir quando souberem o preço que você pagou.

 

skype-favicon.png lu.lukinha

message-16.png [email protected]

Link para o post
Compartilhar em outros sites

Não brother, são funções do 0.3.6 então não irá funcionar =P

Obrigado por responder bem rápido...

será que alguem consegue fazer uma adaptação? de 0.3....... pra 1.0 ?

Se Ajudei Rep+ pra mim ^^

tumblr_lyd1xtGgx81qf9l6uo1_500.gif

Link para o post
Compartilhar em outros sites

Obrigado por responder bem rápido...

será que alguem consegue fazer uma adaptação? de 0.3....... pra 1.0 ?

 

 

 

Troquei as funções pra do TFS 1.0, testa aí, se o dono quiser anexar no tópico para o 1.0 também pode :P

Acho que não esqueci nada, um pouco de sono mas ok rs, segue:

local function tameMonster(cid, item, itemEx, tame, run, broken)
	n = math.random(100)
	if n <= broken then
		creature:say(cid, "Lost item", TALKTYPE_ORANGE_1)
		player:removeItem(item.uid)
	elseif n > broken and n <= (tame+broken) then
		player:removeItem(item.uid)
		creature:say(cid, "You tamed the mount", TALKTYPE_ORANGE_1)
		player:sendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You tamed the mount "..getCreatureName(itemEx.uid)..".")
		return true
	elseif n > (tame+broken) and n <= (tame+broken+run) then
		creature:say(cid, "the monster fled", TALKTYPE_ORANGE_1)
		creature:remove(itemEx.uid)
	else
		creature:say(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=10, run=39, broken=51},
	{item = 13298, name = "terror bird", id = 2,			 tame=10, run=39, broken=51},
	{item = 5907, name = "bear", id = 3,				 tame=7, run=39, broken=54},
	{item = 13295, name = "black sheep", id = 4,			 tame=7, run=35, broken=58},
	{item = 13293, name = "midnight panther", id = 5,		 tame=10, run=39, broken=51},
	{item = 13294, name = "draptor", id = 6,				 tame=10, run=39, broken=51},
	{item = 13305, name = "crustacea gigantica", id = 7,	 tame=10, run=39, broken=51},
	{item = 13292, name = "tin lizzard", id = 8,		 tame=10, run=36, broken=54},
	{item = 13247, name = "boar", id = 10,					 tame=10, run=39, broken=51},
	{item = 13291, name = "undead cavebear", id = 12,		 tame=10, run=39, broken=51}
}

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 getPlayerMount(cid, mounts[i].id) then
				if tameMonster(cid, item, itemEx, mounts[i].tame, mounts[i].run, mounts[i].broken) then
					position:sendMagicEffect(fromPosition, CONST_ME_MAGIC_BLUE)
					monster:removeFriend(itemEx.uid)
					player:addMount(cid, mounts[i].id)
				else
					position:sendMagicEffect(toPosition, CONST_ME_POFF)
				end
			end
		end
	end
	return true
end

YDmXTU2.png

 

Entenda tudo sobre VPS, DEDICADOS & HOSPEDAGENS. => Clique aqui

Global Full Download 10.9x - TFS 1.2/FERUMBRAS/KRAILOS. => Clique aqui

 

Muitos querem aquilo que você tem, 
mas vão desistir quando souberem o preço que você pagou.

 

skype-favicon.png lu.lukinha

message-16.png [email protected]

Link para o post
Compartilhar em outros sites

 

Troquei as funções pra do TFS 1.0, testa aí, se o dono quiser anexar no tópico para o 1.0 também pode :P

Acho que não esqueci nada, um pouco de sono mas ok rs, segue:

local function tameMonster(cid, item, itemEx, tame, run, broken)
	n = math.random(100)
	if n <= broken then
		creature:say(cid, "Lost item", TALKTYPE_ORANGE_1)
		player:removeItem(item.uid)
	elseif n > broken and n <= (tame+broken) then
		player:removeItem(item.uid)
		creature:say(cid, "You tamed the mount", TALKTYPE_ORANGE_1)
		player:sendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You tamed the mount "..getCreatureName(itemEx.uid)..".")
		return true
	elseif n > (tame+broken) and n <= (tame+broken+run) then
		creature:say(cid, "the monster fled", TALKTYPE_ORANGE_1)
		creature:remove(itemEx.uid)
	else
		creature:say(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=10, run=39, broken=51},
	{item = 13298, name = "terror bird", id = 2,			 tame=10, run=39, broken=51},
	{item = 5907, name = "bear", id = 3,				 tame=7, run=39, broken=54},
	{item = 13295, name = "black sheep", id = 4,			 tame=7, run=35, broken=58},
	{item = 13293, name = "midnight panther", id = 5,		 tame=10, run=39, broken=51},
	{item = 13294, name = "draptor", id = 6,				 tame=10, run=39, broken=51},
	{item = 13305, name = "crustacea gigantica", id = 7,	 tame=10, run=39, broken=51},
	{item = 13292, name = "tin lizzard", id = 8,		 tame=10, run=36, broken=54},
	{item = 13247, name = "boar", id = 10,					 tame=10, run=39, broken=51},
	{item = 13291, name = "undead cavebear", id = 12,		 tame=10, run=39, broken=51}
}

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 getPlayerMount(cid, mounts[i].id) then
				if tameMonster(cid, item, itemEx, mounts[i].tame, mounts[i].run, mounts[i].broken) then
					position:sendMagicEffect(fromPosition, CONST_ME_MAGIC_BLUE)
					monster:removeFriend(itemEx.uid)
					player:addMount(cid, mounts[i].id)
				else
					position:sendMagicEffect(toPosition, CONST_ME_POFF)
				end
			end
		end
	end
	return true
end

muito bom..

uma duvida...

na tag

creature:say(cid, "Lost item", TALKTYPE_ORANGE_1)

 

tem como colocar assim... "tal monstro get the item tal from your hands"

entendeu? tipo.. pra cada bixo, ele dar uma msg diferente 

meio parecido com o player:sendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You tamed the mount "..getCreatureName(itemEx.uid)..".")

Se Ajudei Rep+ pra mim ^^

tumblr_lyd1xtGgx81qf9l6uo1_500.gif

Link para o post
Compartilhar em outros sites

muito bom..

uma duvida...

na tag

creature:say(cid, "Lost item", TALKTYPE_ORANGE_1)

 

tem como colocar assim... "tal monstro get the item tal from your hands"

entendeu? tipo.. pra cada bixo, ele dar uma msg diferente 

meio parecido com o player:sendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You tamed the mount "..getCreatureName(itemEx.uid)..".")

 

 

creature:say(cid, "Lost item", TALKTYPE_ORANGE_1) - teria que criar uma configuração local no script buscando as mensagens em parâmetro ou adicione na linha mesmo: "You tamed the mount "..getCreatureName(itemEx.uid).."

YDmXTU2.png

 

Entenda tudo sobre VPS, DEDICADOS & HOSPEDAGENS. => Clique aqui

Global Full Download 10.9x - TFS 1.2/FERUMBRAS/KRAILOS. => Clique aqui

 

Muitos querem aquilo que você tem, 
mas vão desistir quando souberem o preço que você pagou.

 

skype-favicon.png lu.lukinha

message-16.png [email protected]

Link para o post
Compartilhar em outros sites

creature:say(cid, "Lost item", TALKTYPE_ORANGE_1) - teria que criar uma configuração local no script buscando as mensagens em parâmetro ou adicione na linha mesmo: "You tamed the mount "..getCreatureName(itemEx.uid).."

mas tu num pode fazer a config. local pra mim? :B 

(sim, sou folgado) :P perdoe...

existe essa função "getItemName(itemEx.uid)"?

pra ele pegar o nome do item, e colocar nessa função....

Se Ajudei Rep+ pra mim ^^

tumblr_lyd1xtGgx81qf9l6uo1_500.gif

Link para o post
Compartilhar em outros sites
  • 4 weeks later...
  • 3 months later...
  • 1 year later...

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo