Ir para conteúdo

Featured Replies

  • Respostas 18
  • Visualizações 4.2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @up Tente trocar getPlayerMount(cid, mounts[i].id) por canPlayerRideMount(cid, mounts[i].id)

  • 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)

  • 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 Acho que não esqueci nada, um pouco de sono mas ok rs, segue: local function tameMonster(cid,

Postado

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]

Postado

 

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

Postado

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]

Postado

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

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