Ir para conteúdo

[Encerrado] Configurando System Enchanting


dinpajeh

Posts Recomendados

Boa tarde pessoal, estou precisando de ajuda para fazer o sistema de enchanting.

Não sei como configurar no mapa onde o player deve botar os itens, alguem tem como me dar uma ajuda?

 

actions.lua

[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]<!-- Weapons enchanting (Gems) -->[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	<action itemid="2146" event="script" value="other/enchanting.lua"/>[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	<action itemid="2147" event="script" value="other/enchanting.lua"/>[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	<action itemid="2150" event="script" value="other/enchanting.lua"/>[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	<action itemid="2149" event="script" value="other/enchanting.lua"/>[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	<action itemid="7759" event="script" value="other/enchanting.lua"/>[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	<action itemid="7760" event="script" value="other/enchanting.lua"/>[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	<action itemid="7761" event="script" value="other/enchanting.lua"/>[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	<action itemid="7762" event="script" value="other/enchanting.lua"/>[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]

 

enchanting.lua

[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]local config = {[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	manaCost = 300,[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	soulCost = 2[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]}[/size][/font]


[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]function onUse(cid, item, fromPosition, itemEx, toPosition)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	if(item.itemid == 2147 and itemEx.itemid == 2342) then[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		doTransformItem(itemEx.uid, 2343)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		doDecayItem(itemEx.uid)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		doRemoveItem(item.uid, 1)[/size][/font]


[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		return true[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	end[/size][/font]


[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	if(item.itemid == 7760 and isInArray({9934, 10022}, itemEx.itemid)) then[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		doTransformItem(itemEx.uid, 9933)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		doRemoveItem(item.uid, 1)[/size][/font]


[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		return true[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	end[/size][/font]


[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	if(isInArray(enchantableGems, item.itemid)) then[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		local subtype = item.type[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		if(subtype == 0) then[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]			subtype = 1[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		end[/size][/font]


[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		local mana = config.manaCost * subtype[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		if(getPlayerMana(cid) < mana) then[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]			doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]			return true[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		end[/size][/font]


[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		local soul = config.soulCost * subtype[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		if(getPlayerSoul(cid) < soul) then[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]			doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHSOUL)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]			return true[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		end[/size][/font]


[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		local a = table.find(enchantableGems, item.itemid)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		if(a == nil or not isInArray(enchantingAltars[a], itemEx.itemid)) then[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]			return false[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		end[/size][/font]


[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		doTransformItem(item.uid, enchantedGems[a])[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		doPlayerAddMana(cid, -mana)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		doPlayerAddSoul(cid, -soul)[/size][/font]


[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		doPlayerAddSpentMana(cid, mana)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		doSendMagicEffect(fromPosition, CONST_ME_HOLYDAMAGE)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		return true[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	end[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3] [/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	if(isInArray(enchantedGems, item.itemid)) then[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		if(not isInArray(enchantableItems, itemEx.itemid)) then[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]			doSendMagicEffect(fromPosition, CONST_ME_POFF)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]			return false[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		end[/size][/font]


[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		local b = table.find(enchantedGems, item.itemid)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		if(b == nil) then[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]			return false[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		end[/size][/font]


[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		local subtype = itemEx.type[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		if(not isInArray({2544, 8905}, itemEx.itemid)) then[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]			subtype = 1000[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		end[/size][/font]


[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		doTransformItem(itemEx.uid, enchantedItems[itemEx.itemid][b], subtype)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_HOLYDAMAGE)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		doDecayItem(itemEx.uid)[/size][/font]


[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		doRemoveItem(item.uid, 1)[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]		return true[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	end[/size][/font]


[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]	return false[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]end[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]

 

Infelismente não consegui entender onde (MAPA) devo botar cada coisa.

 

Segue imagem do meu mapa!

Link para o comentário
Compartilhar em outros sites

  • 5 years later...
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...