Talkaction Que Vende Skill

sauvadur2
em Lixeira Pública

sauvadur2

Cavaleiro
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/11/09Posts: 62Char no Tibia: Misstter Emme

Ae galera do xtibia,

Gostaria de uma talkaction que adcione 1 skill por 1 item de id: 10556

Assim,

Eu diria !axe ou !sword ou !club(Somente knights) ou !magic (somente druids e sorcerers) !distance(Somente paladin)

 

E trocaria 1 item de id 10556 por 1 skills das qual eu citei acima, mas o maximo de skill que pode e 350

 

Se pudessem postar so 1 de cada (axe,magic e distance) Ficaria agradecico ^.^

 

 

Versao do ot: 8.5-8.52

Sauvadur Server!

Exp 200

Loot 2

Skill 100

Ml 100

SpawnR 1

 

NoLag

24/7 ONLINE!

 

Sistemas:

Reset

Vip

1kk p/skill

e Muito mais!

 

Map: styller yourots 8.6 Sem teleports (Sem modificações por enquanto)

1234322_2.png

Antharaz

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 05/01/08Posts: 153Char no Tibia: nenhum

Tenta usar esse:

 

local itemretirado = 10556
function onSay(cid, words, param, channel)
local alpha={}
confere(cid)
if doPlayerRemoveItem(cid,itemretirado,1) then
	if words == "!fist" and alpha[1] ~= 0 then
		doPlayerAddSkill(cid,0,1)
	elseif words == "!club" and alpha[2] ~= 1 then
		doPlayerAddSkill(cid,1,1)
	elseif words == "!sword" and alpha[3] ~= 2 then
		doPlayerAddSkill(cid,2,1)
	elseif words == "!axe" and alpha[4] ~= 3 then
		doPlayerAddSkill(cid,2,1)
	elseif words == "!distance" and alpha[5] ~= 4 then
		doPlayerAddSkill(cid,4,1)
	elseif words == "!shield" and alpha[6] ~= 5 then
		doPlayerAddSkill(cid,5,1)
	else
		doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'Você já atingiu o número máxido de skills para se poder comprar mais.')
	end
	doSendMagicEffect(getThingPos(cid),12)
	doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'Skill comprado com sucesso.')
else
	doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'Você não tem o necessário para comprar esta skill.')
end
end



function confere(cid)

for x=0,5 do
if getPlayerSkillLevel(cid,x) > 349 then
	alpha[x+1] = x
end
end
end

 

 

Nota: Funciona em 8.54 mas não sei se funciona em 8.5 ou 8.52.

 

Nota2: Não testei

Atenciosamente,

Antharaz

HwmBLEb.jpg

sauvadur2

Cavaleiro
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/11/09Posts: 62Char no Tibia: Misstter Emme

funcionou certinho, mas tem como se me fazer para ml tbm, que so sorcerer e druid possam comprar?

e pra por que distance so pra paladin e o resto so pra knight?

Sauvadur Server!

Exp 200

Loot 2

Skill 100

Ml 100

SpawnR 1

 

NoLag

24/7 ONLINE!

 

Sistemas:

Reset

Vip

1kk p/skill

e Muito mais!

 

Map: styller yourots 8.6 Sem teleports (Sem modificações por enquanto)

1234322_2.png

thyaguin

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 02/04/10Posts: 2Char no Tibia: Donthave

Olá, sou novo portanto, não sei se dará certo.

 

Em talkactions add isto :

 

<talkaction words="!axe" event="script" value="axe.lua"/>
<talkaction words="!sword" event="script" value="sword.lua"/>
<talkaction words="!club" event="script" value="club.lua"/>
<talkaction words="!distance" event="script" value="distance.lua"/>

 

Pronto.

 

Agora dentro da pasta scripts em talkactions copie um arquivo qualquer .LUA e renomeie para axe e coleque isto

 

function onSay(cid, words, param, channel) 
if getPlayerVocation == 4 then
doPlayerRemoveItem(cid,10556,1)
doPlayerAddSkillTry(cid, 3, 1)
doPlayerSendTextMessage(cid, 22, "Skill add com sucesso")
else
doPlayerSendTextMessage(cid, 22, "Você não é knight")
end
return TRUE
end

 

 

Novamente em talkactions copie um arquivo qualquer .LUA e renomeie para sword e coleque isto

 

function onSay(cid, words, param, channel) 
if getPlayerVocation == 4 then
doPlayerRemoveItem(cid,10556,1)
doPlayerAddSkillTry(cid, 2, 1)
doPlayerSendTextMessage(cid, 22, "Skill add com sucesso")
else
doPlayerSendTextMessage(cid, 22, "Você não é knight")
end
return TRUE
end

 

 

Novamente em talkactions copie um arquivo qualquer .LUA e renomeie para club e coleque isto

 

function onSay(cid, words, param, channel) 
if getPlayerVocation == 4 then
doPlayerRemoveItem(cid,10556,1)
doPlayerAddSkillTry(cid, 1, 1)
doPlayerSendTextMessage(cid, 22, "Skill add com sucesso")
else
doPlayerSendTextMessage(cid, 22, "Você não é knight")
end
return TRUE
end

 

 

Novamente em talkactions copie um arquivo qualquer .LUA e renomeie para distance e coleque isto

 

function onSay(cid, words, param, channel) 
if getPlayerVocation == 3 then
doPlayerRemoveItem(cid,10556,1)
doPlayerAddSkillTry(cid, 4, 1)
doPlayerSendTextMessage(cid, 22, "Skill add com sucesso")

else
doPlayerSendTextMessage(cid, 22, "Você não é Paladin")
end
return TRUE
end

 

 

Não testei, portanto não sei se dará certo !!

Thyaguiin



 

 

 

 

xscripting.png