Postado Outubro 8, 2013 11 anos Este é um post popular. Olá "TKbianos", Eu desenvolvi um outro script junto com meu paceiro Daaniel, que pode agradar muita gente. O script faz o seguinte : Ao clicar no Item X (9002), abrirá uma janela vendendo os seguintes itens : Todas as blessings incluindo PVP blessing (Twist of fate). As 5 blessings sem o PVP blessing (Twist of fate). Apenas o PVP blessing (Twist of fate). Um amulet of loss (AOL). Com a janela aparecendo essas opções você selecionará, e apertará "OK" ou a tecla Enter para confirma sua compra. O script vai verificar se você tem o dinheiro necessário, e se tiver, ele removerá o dinheiro e te dará o item, se não tiver, haverá uma mensagem falando que não é possível comprar o item. @Update 0.0.1 (08 de outubro de 2013 - 12:05) : Criação do script. Imagem : @Update 0.1.1 (10 de outubro de 2013 - 09:50) : Adicionado marcadores para separar as categorias dos itens vendidos. Adicionado o preço do item ao lado de seus nomes. Adicionado alguns itens do tipo conteiners (backpacks). Adicionado efeitos quando houver alguma falha na compra. Fixado o bug do "EnterButton" (agora você pode confirma a compra com o "Enter"). Fixado algumas mensagens. Imagem : @Update 0.1.2 (20 de outubro de 2013 - 19:03) : Adicionado a aba Teleports (Hometown). Fixado ao selecionar uma das abas. Bem, aqui vai... Crie um arquivo chamado holybook.lua na pasta actions>scripts, e cole isso dentro : -- Desenvolvido do tibiaking.com por : -- Daaniel Nolmena & Jamison Collins -------------------------------------- -------------------------------------- modaldialog = { title = "Holy Book", message = "Choose what you want to buy.", buttons = { { id = 1, value = "Ok" }, { id = 2, value = "Cancel" }, }, buttonEnter = 1, buttonEscape = 2, choices = { { id = 0, value = "------/Teleports/------" }, { id = 13, value = "Hometown [1K]" }, { id = 0, value = "------/Blessings/------" }, { id = 1, value = "All blessings [70K]" }, { id = 2, value = "Five blessings [50K]" }, { id = 3, value = "Twist of Fate [20K]" }, { id = 0, value = "-------/Amulets/------" }, { id = 4, value = "Amulet of Loss [10K]" }, { id = 0, value = "------/Backpacks/-----" }, { id = 5, value = "Backpack [100GP]" }, { id = 6, value = "Blue Backpack [100GP]" }, { id = 7, value = "Grey Backpack [100GP]" }, { id = 8, value = "Purple Backpack [100GP]" }, { id = 9, value = "Green Backpack [100GP]" }, { id = 10, value = "Yellow Backpack [100GP]" }, { id = 11, value = "Orange Backpack [100GP]" }, { id = 12, value = "Red Backpack [100GP]" } }, popup = false } local bless = {1, 2, 3, 4, 5} local five_blessings_price = 50000 -- 50k SEM TWIST OF FATE local twist_of_fate_price = 20000 -- 20k APENAS TWIST OF FATE local all_blessings_price = 70000 -- 70k COM TWIST OF FATE local amulet_of_loss_price = 10000 -- 10k AMULET OF LOSS local backpack_price = 100 -- 100 gp preço das backpacks local hometown_price = 1000 -- 1000 gp preço do teleport para cidade function callback(cid, button, choice) if button == 1 or button == 29 or button == 0 then if (choice == 1) then for i = 1, table.maxn(bless) do if getPlayerBlessing(cid, bless[i]) == false and getPlayerPVPBlessing(cid) == false then if (doPlayerRemoveMoney(cid, all_blessings_price) == true) then for i = 1, table.maxn(bless) do doPlayerAddBlessing(cid, bless[i]) end doPlayerSetPVPBlessing(cid) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You has been blessed by Gods with all blessings, including the twist of fate.") doSendMagicEffect(getPlayerPosition(cid), 28) else doPlayerSendCancel(cid, "You don't have 100k to buy the five blessings and twist of fate.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "You already have the five blessings or twist of fate. Please choose other one to buy.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end end elseif (choice == 2) then for i = 1, table.maxn(bless) do if getPlayerBlessing(cid, bless[i]) == false and getPlayerPVPBlessing(cid) == true then if (doPlayerRemoveMoney(cid, five_blessings_price) == true) then for i = 1, table.maxn(bless) do doPlayerAddBlessing(cid, bless[i]) end doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You has been blessed with the five blessings. Before you had only the twist of fate.") doSendMagicEffect(getPlayerPosition(cid), 28) else doPlayerSendCancel(cid, "You don't have 50k to buy the five blessings.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "You already have the five blessings. Please choose other one to buy.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end end elseif (choice == 3) then for i = 1, table.maxn(bless) do if getPlayerBlessing(cid, bless[i]) == true and getPlayerPVPBlessing(cid) == false then if (doPlayerRemoveMoney(cid, twist_of_fate_price) == true) then doPlayerSetPVPBlessing(cid) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You has been blessed with twist of fate. the only bless that you didn't had.") doSendMagicEffect(getPlayerPosition(cid), 28) else doPlayerSendCancel(cid, "You don't have 20k to buy the twist of fate.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "You already have the twist of fate. Please choose other one to buy.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end end elseif (choice == 4) then if (doPlayerRemoveMoney(cid, amulet_of_loss_price) == true) then doPlayerAddItem(cid, 2173, 1) doSendMagicEffect(getPlayerPosition(cid), 28) else doPlayerSendCancel(cid, "You don't have 10k to buy an amulet of loss.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end elseif (choice == 5) then if (doPlayerRemoveMoney(cid, backpack_price) == true) then doPlayerAddItem(cid, 1988, 1) doSendMagicEffect(getPlayerPosition(cid), 28) else doPlayerSendCancel(cid, "You don't have 100gp to buy a backpack.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end elseif (choice == 6) then if (doPlayerRemoveMoney(cid, backpack_price) == true) then doPlayerAddItem(cid, 2002, 1) doSendMagicEffect(getPlayerPosition(cid), 28) else doPlayerSendCancel(cid, "You don't have 100gp to buy a blue backpack.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end elseif (choice == 7) then if (doPlayerRemoveMoney(cid, backpack_price) == true) then doPlayerAddItem(cid, 2003, 1) doSendMagicEffect(getPlayerPosition(cid), 28) else doPlayerSendCancel(cid, "You don't have 100gp to buy a grey backpack.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end elseif (choice == 8) then if (doPlayerRemoveMoney(cid, backpack_price) == true) then doPlayerAddItem(cid, 2001, 1) doSendMagicEffect(getPlayerPosition(cid), 28) else doPlayerSendCancel(cid, "You don't have 100gp to buy a purple backpack.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end elseif (choice == 9) then if (doPlayerRemoveMoney(cid, backpack_price) == true) then doPlayerAddItem(cid, 1998, 1) doSendMagicEffect(getPlayerPosition(cid), 28) else doPlayerSendCancel(cid, "You don't have 100gp to buy a green backpack.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end elseif (choice == 10) then if (doPlayerRemoveMoney(cid, backpack_price) == true) then doPlayerAddItem(cid, 1999, 1) doSendMagicEffect(getPlayerPosition(cid), 28) else doPlayerSendCancel(cid, "You don't have 100gp to buy a yellow backpack.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end elseif (choice == 11) then if (doPlayerRemoveMoney(cid, backpack_price) == true) then doPlayerAddItem(cid, 10519, 1) doSendMagicEffect(getPlayerPosition(cid), 28) else doPlayerSendCancel(cid, "You don't have 100gp to buy an orange backpack.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end elseif (choice == 12) then if (doPlayerRemoveMoney(cid, backpack_price) == true) then doPlayerAddItem(cid, 2000, 1) doSendMagicEffect(getPlayerPosition(cid), 28) else doPlayerSendCancel(cid, "You don't have 100gp to buy a red backpack.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end elseif (choice == 13) then if getTileInfo(getThingPos(cid)).protection == true then if (doPlayerRemoveMoney(cid, hometown_price) == true) then addEvent(goHomeTownI, 10 * 1000, cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You will teleport in 30 seconds.") else doPlayerSendCancel(cid, "You don't have 1000gp to teleport to your hometown.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't use this in protection zone.") end elseif (choice == 0 or choice == 0.1 or choice == 0.2) then addDialog(modaldialog, 2345, cid, callback); end end end function goHomeTownI(cid, position, fromPosition, toPosition) if getTileInfo(getThingPos(cid)).protection == true then addEvent(goHomeTownII, 10 * 1000, cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You will teleport in 20 seconds.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't teleport out of protection zone.") end end function goHomeTownII(cid, position, fromPosition, toPosition) if getTileInfo(getThingPos(cid)).protection == true then addEvent(goHomeTownIII, 10 * 1000, cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You will teleport in 10 seconds.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't teleport out of protection zone.") end end function goHomeTownIII(cid, position, fromPosition, toPosition) if getTileInfo(getThingPos(cid)).protection == true then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have been teleported to the "..getTownName(getPlayerTown(cid)).." town.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't teleport out of protection zone.") end end function onUse(cid, item, fromPosition, itemEx, toPosition) addDialog(modaldialog, 2345, cid, callback); return true end Depois abra o arquivo actions.xml e adicione a seguinte tag : <action itemid="9002" event="script" value="holybook.lua"/> ...e pronto, estará funcionando direitinho ! Testado e funcionando no TFS 0.3 (Versão 10.10). Créditos : Jamison Collins (50%) Daaniel (50%) 愛"A alma permanece em suas criações" 平(Não dou suporte por mensagem privada.)
Postado Outubro 8, 2013 11 anos Gostei pra caramba, bem útil, tira um pouco do RPG dos NPCs que servem pra isso mas é bem útil mesmo. Coloca o valor das blessings na frente do item, acho que fica mais fácil pra saberem o preço. sempre tem um novato que fica tentando comprar que nem idiota Skype @kaiquegabriel__ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Atenciosamente, kaiquegabriel. Não dou suporte via pm. Em caso de dúvidas, crie um tópico e espere o suporte.
Postado Outubro 8, 2013 11 anos Autor Sim, eu coloquei, porém não está na imagem, eu fiz a modificação quando estava criando o tópico... Aqui está a parte responsável por isso : { id = 1, value = "All blessings [70K]" }, { id = 2, value = "Five blessings [50K]" }, { id = 3, value = "Twist of Fate [20K]" }, { id = 4, value = "Amulet of Loss [10K]" } 愛"A alma permanece em suas criações" 平(Não dou suporte por mensagem privada.)
Postado Outubro 8, 2013 11 anos ficou muito bom, e bastante rpg (: Ot Design: https://discord.gg/VgtVRNmCD7
Postado Outubro 10, 2013 11 anos Autor @Update 0.1.1 (10 de outubro de 2013 - 09:50) : Adicionado marcadores para separar as categorias dos itens vendidos. Adicionado o preço do item ao lado de seus nomes. Adicionado alguns itens do tipo conteiners (backpacks). Adicionado efeitos quando houver alguma falha na compra. Fixado o bug do "EnterButton" (agora você pode confirma a compra com o "Enter"). Fixado algumas mensagens. Imagem : 愛"A alma permanece em suas criações" 平(Não dou suporte por mensagem privada.)
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.