Aqui está a Demon Helmet atualizada
Aqui esta a versão atualizada da Demon Helmet Quest, primeiro vamos a parte da sala principal.
Na alavanca, coloque a uid 8550 e em pedradh.lua add :
gatepos é a posica da pedra que será retirada.
telepos a posição que o teleport será criado.
gopos a posição que o player irá ao andar no teleport.
--Old code now updated to 8.31 by ta4e--function onUse(cid, item, frompos, item2, topos)local gatepos = {x=1069, y=653, z=15, stackpos=1}local telepos = {x=1071, y=652, z=15, stackpos=1}local gopos = {x=1073, y=653, z=14, stackpos=1}local getgate = getThingfromPos(gatepos)local gettele = getThingfromPos(telepos) if item.uid == 8550 and item.itemid == 1945 and getgate.itemid == 1355 then doRemoveItem(getgate.uid,1) doTransformItem(item.uid,item.itemid+1) doCreateTeleport(1387, gopos, telepos) elseif item.uid == 8550 and item.itemid == 1946 and getgate.itemid == 0 then doCreateItem(1355,1,gatepos) doTransformItem(item.uid,item.itemid-1) doRemoveItem(gettele.uid,1) else doPlayerSendCancel(cid,"Sorry, not possible.") endreturn 1end
E para fazer a parte da parchment, vá em movements/scripts e crie o parchment.lua :
As demonpos são as posicões aonde os demons serão sumados, e as posx,posy,posz a posição do parchment.
O parchment que deve ter em cima do caixão deve ser o de id 4857.
---Criado por Soulblaster(Xtibia)--------7.8function onRemoveItem(item, tileItem, pos)--editando as variaveis--demonpos1 = {x=815, y=684, z=15}demonpos2 = {x=815, y=688, z=15}demonpos3 = {x=821, y=684, z=15}demonpos4 = {x=821, y=688, z=15}posicaoX = 818posicaoY = 685posicaoZ = 15-----------------------if pos.x == posicaoX and pos.y == posicaoY and pos.z == posicaoZ then doSummonCreature("Demon", demonpos1) doSummonCreature("Demon", demonpos2) doSummonCreature("Demon", demonpos3) doSummonCreature("Demon", demonpos4)endreturn 1end
E os baus de recompensa adicione dhreward.lua ou adicione no seu arquivo de quests:
--Old code now updated to 8.31 by ta4e--function onUse(cid, item, frompos, item2, topos)local itemWeight = getItemWeightById(item, 1)local playerCap = getPlayerFreeCap(cid) if item.uid == 2300 then if getPlayerStorageValue(cid,2300) == -1 then if playerCap >= itemWeight then doPlayerSendTextMessage(cid,24,"You have found a demon helmet.") doPlayerAddItem(cid,2493,1) setPlayerStorageValue(cid,2300,1) else doPlayerSendTextMessage(cid,24,"You have found a demon helmet. Weighing 29.50 oz it is too heavy.") end else doPlayerSendTextMessage(cid,24,"The chest is empty.") end elseif item.uid == 2301 then if getPlayerStorageValue(cid,2301) == -1 then if playerCap >= itemWeight then doPlayerSendTextMessage(cid,24,"You have found a demon shield.") doPlayerAddItem(cid,2520,1) setPlayerStorageValue(cid,2301,1) else doPlayerSendTextMessage(cid,24,"You have found a demon shield. Weighing 26.00 oz it is too heavy.") end else doPlayerSendTextMessage(cid,24,"The chest is empty.") end elseif item.uid == 2302 then if getPlayerStorageValue(cid,2302) == -1 then if playerCap >= itemWeight then doPlayerSendTextMessage(cid,24,"You have found a steel boots.") doPlayerAddItem(cid,2645,1) setPlayerStorageValue(cid,2302,1) else doPlayerSendTextMessage(cid,24,"You have found a steel boots. Weighing 29.00 oz it is too heavy.") end else doPlayerSendTextMessage(cid,24,"The chest is empty.") end elseif item.uid == 2303 then if getPlayerStorageValue(cid,2303) == -1 then if getPlayerFreeCap(cid) >= 12.00 then container = doPlayerAddItem(cid, 1987, 1) doAddContainerItem(container, 2229, 1) --skull doAddContainerItem(container, 2151, 2) --talon doAddContainerItem(container, 2165, 1) --stealth doAddContainerItem(container, 2230, 20) --bone key_uid = doAddContainerItem(container,2091,1) doSetItemActionId(key_uid,6010) setPlayerStorageValue(cid,2303,1) else doPlayerSendTextMessage(cid,24,"You have found a bag. Weighing 12.00 oz it is too heavy.") end else doPlayerSendTextMessage(cid,24,"The coffin is empty.") end endend
Do 2300 ao 2302 é na sala da demon Helmet, e o 2340 no caixão da parchment.
Ao final adicione em actions.xml :
<action uniqueid="8550" script="pedra dh.lua" /><action uniqueid="2300" script="dhreward.lua" /><action uniqueid="2301" script="dhreward.lua" /><action uniqueid="2302" script="dhreward.lua" /><action uniqueid="2303" script="dhreward.lua" />
em movements.xml add :
<movevent event="RemoveItem" tileitem="0" itemid="4857" script="parchment.lua" />
Na porta de entrada do corredor apenas adicione a actionid 6010:
O funcionamento é assim, vc deve pegar a chave na sala do parchment, depois ir no corredor abrir a porta e seguir até a sala
Nela de use na alavanca, nisso o teleport de saida e a pedra sairão do lugar