DI

Script Help

Por dionatha14, 05 de jul. de 2009 em Archived

otserv
tibia
script
7
1.7k
dionatha14D
05 de julho de 2009 às 19:58

Ola amigos do xtibia, estou aqui para pedir ajuda a vcs.

Eu tenho um Server com mapa global, e como eu quero que ele seja o maximo parecido com o global eu decidi coloca um item la na inquisition quest para libera os 2 addons demon hunter, tipow quando o player termina de fazer a quest ele vai pra sala escolher os items, e nessa msm sala eu vou coloca um item (aquele ki vai libera os 2 addons demon hunter)

Eu tenho esse script aqui mais ele e por talkaction, ai quando o player pega o item la na chest ele tem que falar "!demonhunter" pra libera os addon, tipow si tiver como alguem me manda um script quando a pessoa pega o item di addon e da Use e libera os addons por favor post pra mim, preciso muito.

 

 

function onSay(cid, words, param)

removenugget = doPlayerRemoveItem(cid, 8701, 1)

if removenugget == 1 and getPlayerSex(cid) == 0 then

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)

doPlayerAddOutfit(cid, 288, 1)

doPlayerAddOutfit(cid, 288, 2)

doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You are now a true demonhunter!")

elseif removenugget == 1 and getPlayerSex(cid) == 1 then

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)

doPlayerAddOutfit(cid, 289, 1)

doPlayerAddOutfit(cid, 289, 2)

doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You are now a true demonhunter!")

end

end

 

Desde Já agradeço!

Editado Julho 5 por Dionatha14

deltonD
05 de julho de 2009 às 20:47

Tenta esse:

function onSay(cid, words, param)

removenugget = doPlayerRemoveItem(cid, 8701, 1)

if removenugget == 1 and getPlayerSex(cid) == 0 then

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)

doPlayerAddOutfit(cid, 288, 1)

doPlayerAddOutfit(cid, 289, 2)

doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You are now a true demonhunter!")

elseif removenugget == 1 and getPlayerSex(cid) == 1 then

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)

doPlayerAddOutfit(cid, 289, 1)

doPlayerAddOutfit(cid, 289, 2)

doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You are now a true demonhunter!")

end

end

Ou esse:

function onSay(cid, words, param)

removenugget = doPlayerRemoveItem(cid, 8701, 1)

if removenugget == 1 and getPlayerSex(cid) == 0 then

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)

doPlayerAddOutfit(cid, 288, 1)

doPlayerAddOutfit(cid, 288, 2)

doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You are now a true demonhunter!")

elseif removenugget == 1 and getPlayerSex(cid) == 1 then

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)

doPlayerAddOutfit(cid, 289, 1)

doPlayerAddOutfit(cid, 289, 2)

doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You are now a true demonhunter!")

return TRUE

end

end

 

Qual servidor você usa? é para adicionar os addons junto?

dionatha14D
05 de julho de 2009 às 21:31

Uso o Tfs 0.3.4 é pra add só os addons demonhunter.

Pra libera addons no meu server precisa di itens tipow o global só que 1 npc faiz todos addons.

Tipow pra mim coloca esse script pra funciona em actions como ki faiz?

Pq esse script ai que eu postei ele funciona em talkactions.

Manda o script e a tag pra coloca em actions.xml.

Editado Julho 5 por Dionatha14

satan666S
05 de julho de 2009 às 22:09

ta ae:

 

actions.xml

 

<action itemid="id do item" event="script" value="nome do arquivo.lua"/>

 

arquivo.lua

 

function onUse(cid,item,frompos,item2,topos)

 

 

if getPlayerItemCount(cid, 8701) >= 1 and getPlayerSex(cid) == 0 then

doPlayerRemoveItem(cid, 8701, 1)

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)

doPlayerAddOutfit(cid, 288, 1)

doPlayerAddOutfit(cid, 288, 2)

doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You are now a true demonhunter!")

 

elseif getPlayerItemCount(cid, 8701) >= 1 getPlayerSex(cid) == 1 then

doPlayerRemoveItem(cid, 8701, 1)

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)

doPlayerAddOutfit(cid, 289, 1)

doPlayerAddOutfit(cid, 289, 2)

doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You are now a true demonhunter!")

end

return TRUE

end

dionatha14D
05 de julho de 2009 às 22:55

Ôh mano esse tfs mais novo é injuado, tem um server aqui mais antigo um poko que esse script funciona mais nesse novo num que funciona.

Olha ai na foto o que aparece quando tento usa o Item di faze addon.

Com seu script tmb num quis funcionar nao..

post-120571-1246845303_thumb.jpg

Editado Julho 5 por Dionatha14

satan666S
06 de julho de 2009 às 14:08

arrumado acredito que funcione agora.

 

function onUse(cid, item,pos)

 

if getPlayerItemCount(cid, 8701) >= 1 then

if getPlayerSex(cid) == 0 then

doPlayerRemoveItem(cid, 8701, 1)

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)

doPlayerAddOutfit(cid, 288, 1)

doPlayerAddOutfit(cid, 288, 2)

doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You are now a true demonhunter!")

else

doPlayerRemoveItem(cid, 8701, 1)

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)

doPlayerAddOutfit(cid, 289, 1)

doPlayerAddOutfit(cid, 289, 2)

doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You are now a true demonhunter!")

end

end

return TRUE

end

 

qual a ot e que versao e que voce esta usando?

dionatha14D
06 de julho de 2009 às 21:55

Eu uso o The Forgotten Server 0.3.4 cryingdamson / versao 8.42

 

Aeee manu mais uma vez vc resolveu meu problema vlws msm.

Agora fico baum com esse script vai fica muito bom.

Mais uma vez Muito obrigado Marcryzius.

post-120571-1246928100_thumb.jpg

Editado Julho 6 por Dionatha14