BE
talkaction

[TalkAction] Promotion Sem Npc

Por Benefactor, 03 de ago. de 2009 em Actions e Talkactions

script
6
2.2k
03 de agosto de 2009 às 12:34

Padrão de Postagem:

 

Autor : Shawak
 Versão : 8.40x
 Testado : TFS 0.3.3
 Tipo : TalkAction

Comentario : Você fala !promotion e depois você pega promotion.

 

Vá em data/talkaction/script depois lá crie um arquivo .lua chamado promote.lua

Depois bote isso lá dentro:

 

function onSay(cid, words, param, channel)

  sorcerer = {
  cost = 200000,
  level = 20,
  text = "Promoted to Master Sorcerer",
  }
  druid = {
  cost = 200000,
  level = 20,
  text = "Promoted to Elder Druid",
  }
  paladin = {
  cost = 200000,
  level = 20,
  text = "Promoted to Royal Paladin",
  }
  knight = {
  cost = 200000,
  level = 20,
  text = "Promoted to Elite Knight",
  }

  if getPlayerVocation(cid) == 1 then
	  voc = sorcerer
  elseif getPlayerVocation(cid) == 2 then
	  voc = druid
  elseif getPlayerVocation(cid) == 3 then
	  voc = paladin
  elseif getPlayerVocation(cid) == 4 then
	  voc = knight
  else
	  voc = nil
  end
  if voc ~= nil then
	  if getPlayerLevel(cid) >= voc.level then
		  if doPlayerRemoveMoney(cid,voc.cost) == TRUE then
			  setPlayerPromotionLevel(cid, 1)
			  doSendMagicEffect(getCreaturePosition(cid),14)
			  doSendAnimatedText(getCreaturePosition(cid),voc.text,49)
		  else
			  doPlayerSendTextMessage(cid,18,"You need "..voc.cost.." to promote.")
		  end
	  else
		  doPlayerSendTextMessage(cid,18,"You need level "..voc.level.." to promote.")
	  end
  else
	  doPlayerSendTextMessage(cid,18,"You already promoted.")
  end
  return TRUE
 end

Depois em data/talkaction.xml bote está tag:

 

<talkaction words="!promotion" event="script" value="promote.lua"/>

Créditos: Shawak

4 semanas depois...
42912264
30 de agosto de 2009 às 16:31

Tem como transformar em second promotion ? :D

satan666S
30 de agosto de 2009 às 16:47

o unico problema desse script e que ele temlinhas desnecessarias que diminuiria muito o script.

 

 

tipo essas são desnecessarias.

 

if getPlayerVocation(cid) == 1 then

voc = sorcerer

elseif getPlayerVocation(cid) == 2 then

voc = druid

elseif getPlayerVocation(cid) == 3 then

voc = paladin

elseif getPlayerVocation(cid) == 4 then

voc = knight

else

voc = nil

end

6 meses depois...
blade06B
25 de fevereiro de 2010 às 17:35

Muito bom cara eu estava precisando mesmo, pois meu npc de promotion estava com poblemas , Vlw mesmo e belo trabalho :D

VildenV
25 de fevereiro de 2010 às 17:42

MisterChaos não reviva tópicos parados a mais de 1 mês, só revive

se você tiver algum tipo de ajuda na script ou algo parecido..

 

Tenha mais cuidado, Valeu..

1 mês depois...
xurupita1X
05 de março de 2010 às 09:08

A Muito Massa, To APRENDENDO OS sCRIPTS :)