Ir para conteúdo

Featured Replies

Postado
  • Autor

@egyptPOWER isso !! é que a "quest" que estou fazendo existe 4 portas e cada porta vai com a vocação dele ... pq se uma pessoa fazer a quest como "druid" e criar char "knight" funciona ... agora se eu fazer isso de 4 items .. ele vai ter que fazer o druid dele novamente ... caso queira trocar .. terá que trocar entre os players

  • Respostas 14
  • Visualizações 829
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @Kyllini Teste o script e posta o feedback ai! Abraço!   Crie um arquivo lua dentro da sua pasta actions/scripts e cole este código.   promoteitem.lua -- Created by egyptPOWER

  • @Kyllini, manda aqui pra min seu vocations.xml por favor  

  • -- Created by egyptPOWER -- function onUse(cid, item, fromPosition, itemEx, toPosition) if (getPlayerLevel(cid) <= 8) then if (getPlayerVocation(cid) >= 1 and getPlayerVocation(cid) <=4

Postado
  • Solução

Não tive tempo de testar. Veja ai se funfa

promoteitems.lua

-- Created by egyptPOWER --

function onUse(cid, item, fromPosition, itemEx, toPosition)

local item1 = ID ITEM SORC
local item2 = ID ITEM DRUID
local item3 = ID ITEM PALADIN
local item4 = ID ITEM KNIGHT


-- CONFIG MS
	if (getPlayerLevel(cid) == 8) then
		if (getPlayerVocation(cid) == 1 and item.itemid == item1) then
			doRemoveItem(item.uid, 1)
			doPlayerSetPromotionLevel(cid, getPlayerVocation(cid)+4)
			doPlayerSay(cid, "You are promoted to ".. getPlayerVocationName(cid) .."!", TALKTYPE_MONSTER_SAY) 
			doSendMagicEffect(getPlayerPosition(cid),10)
		else 
			doPlayerSay(cid, "To use it, you need be a  master sorcerer.", TALKTYPE_MONSTER_SAY)
		end
	else 
		doPlayerSay(cid, "You need level 8 to do it!", TALKTYPE_MONSTER_SAY)
	end

-- CONFIG ED	
	if (getPlayerLevel(cid) == 8) then
		if (getPlayerVocation(cid) == 2 and item.itemid == item2) then
			doRemoveItem(item.uid, 1)
			doPlayerSetPromotionLevel(cid, getPlayerVocation(cid)+4)
			doPlayerSay(cid, "You are promoted to ".. getPlayerVocationName(cid) .."!", TALKTYPE_MONSTER_SAY) 
			doSendMagicEffect(getPlayerPosition(cid),10)
		else 
			doPlayerSay(cid, "To use it, you need be a  elder druid.", TALKTYPE_MONSTER_SAY)
		end
	else 
		doPlayerSay(cid, "You need level 8 to do it!", TALKTYPE_MONSTER_SAY)
	end

-- CONFIG RP	
	if (getPlayerLevel(cid) == 8) then
		if (getPlayerVocation(cid) == 3 and item.itemid == item3) then
			doRemoveItem(item.uid, 1)
			doPlayerSetPromotionLevel(cid, getPlayerVocation(cid)+4)
			doPlayerSay(cid, "You are promoted to ".. getPlayerVocationName(cid) .."!", TALKTYPE_MONSTER_SAY) 
			doSendMagicEffect(getPlayerPosition(cid),10)
		else 
			doPlayerSay(cid, "To use it, you need be a  royal paladin.", TALKTYPE_MONSTER_SAY)
		end
	else 
		doPlayerSay(cid, "You need level 8 to do it!", TALKTYPE_MONSTER_SAY)
	end

-- CONFIG EK
	if (getPlayerLevel(cid) == 8) then
		if (getPlayerVocation(cid) == 4 and item.itemid == item4) then
			doRemoveItem(item.uid, 1)
			doPlayerSetPromotionLevel(cid, getPlayerVocation(cid)+4)
			doPlayerSay(cid, "You are promoted to ".. getPlayerVocationName(cid) .."!", TALKTYPE_MONSTER_SAY) 
			doSendMagicEffect(getPlayerPosition(cid),10)
		else 
			doPlayerSay(cid, "To use it, you need be a  elite knight.", TALKTYPE_MONSTER_SAY)
		end
	else 
		doPlayerSay(cid, "You need level 8 to do it!", TALKTYPE_MONSTER_SAY)
	end
	
	return true
end 
 

 

action.xml

 

<action itemid="ID ITEM MS" event="script" value="promoteitem.lua"/>
<action itemid="ID ITEM ED" event="script" value="promoteitem.lua"/>
<action itemid="ID ITEM RP" event="script" value="promoteitem.lua"/>
<action itemid="ID ITEM EK" event="script" value="promoteitem.lua"/>

 

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

No signature.

 

 

 

Postado
  • Autor

@egyptPOWER Deu uns erro aqui

Citar

[12/2/2018 15:15:12] [Error - LuaInterface::loadFile] data/actions/scripts/promoteitem.lua:12: ')' expected near 'then'
[12/2/2018 15:15:12] [Error - Event::checkScript] Cannot load script (data/actions/scripts/promoteitem.lua)
[12/2/2018 15:15:12] data/actions/scripts/promoteitem.lua:12: ')' expected near 'then'
[12/2/2018 15:15:12] [Error - LuaInterface::loadFile] data/actions/scripts/promoteitem.lua:12: ')' expected near 'then'
[12/2/2018 15:15:12] [Error - Event::checkScript] Cannot load script (data/actions/scripts/promoteitem.lua)
[12/2/2018 15:15:12] data/actions/scripts/promoteitem.lua:12: ')' expected near 'then'
[12/2/2018 15:15:12] [Error - LuaInterface::loadFile] data/actions/scripts/promoteitem.lua:12: ')' expected near 'then'
[12/2/2018 15:15:12] [Error - Event::checkScript] Cannot load script (data/actions/scripts/promoteitem.lua)
[12/2/2018 15:15:12] data/actions/scripts/promoteitem.lua:12: ')' expected near 'then'
[12/2/2018 15:15:12] [Error - LuaInterface::loadFile] data/actions/scripts/promoteitem.lua:12: ')' expected near 'then'
[12/2/2018 15:15:12] [Error - Event::checkScript] Cannot load script (data/actions/scripts/promoteitem.lua)
[12/2/2018 15:15:12] data/actions/scripts/promoteitem.lua:12: ')' expected near 'then'

 

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