Postado Junho 15, 2015 10 anos Eu queria um script de quest que o player poderia escolher 1 entre 3 items,eu sei que tem como fazer pelo remeres pelo action 200, mais por ele ta dando bug, então queria um script unico pra essa quest! Descreva seus sonhos aqui.
Postado Junho 15, 2015 10 anos adicione isso em xml. <action actionid="2000" script="quests/system.lua"/> crie um system.lua em action/script/quests/system.lua e adicione. -- UniqueIDS para quests, começa nos 55000+ para a quest funcionar, use o ACTIONID 2000 + UNIQUEID para pegar o BAU e os Storagevalue 70000+ -- local config = { storage = 70013, Bp_ID = 5926, -- Pirate Backpack storage2 = 70020, Presente = 1990 -- presente anihilator] } function onUse(cid, item, fromPosition, itemEx, toPosition) -- quest aleatórias -- elseif item.uid == 55024 then if getPlayerStorageValue(cid,70020) == -1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a demon armor.") doPlayerAddItem(cid,2494,1) setPlayerStorageValue(cid,70020,1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"The chest is empty.") end elseif item.uid == 55025 then if getPlayerStorageValue(cid,70020) == -1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a magic sword.") doPlayerAddItem(cid,2400,1) setPlayerStorageValue(cid,70020,1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"The chest is empty.") end elseif item.uid == 55026 then if getPlayerStorageValue(cid,70020) == -1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a stonecutter axe.") doPlayerAddItem(cid,2431,1) setPlayerStorageValue(cid,70020,1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"The chest is empty.") end elseif item.uid == 55027 then if getPlayerStorageValue(cid, config.storage2) == -1 then setPlayerStorageValue(cid, config.storage2, 1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a present.") Bp = doPlayerAddItem(cid, config.presente, 1) doAddContainerItem(Bp, 2326, 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"The chest is empty.") end -- end quest aleatórias -- end return true end IDS que vão no BAU - elseif item.uid == 55024 then STORAGE - if getPlayerStorageValue(cid,70020) == -1 then [NÂO MUDAR] ID DO ITEM - doPlayerAddItem(cid,2431,1) Editado Junho 15, 2015 10 anos por pedrook (veja o histórico de edições)
Postado Junho 15, 2015 10 anos Fiz uma com table aqui, caso queira: local t = { storage = 55555, -- Storage utilizada na quest. [50001] = {reward = 2160, count = 3}, -- Aqui você coloca [uniqueid] = {reward = IDDOITEM, count = QUANTIDADE}. [50002] = {reward = 2472, count = 1}, [50003] = {reward = 2162, count = 1} } function onUse(cid, item) local actions = t[item.uid] if actions then if getPlayerStorageValue(cid, t.storage) < 1 then if getPlayerFreeCap(cid) > getItemWeightById(actions.reward, actions.count) then doPlayerAddItem(cid, actions.reward, actions.count) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você encontrou ".. actions.count .." ".. getItemNameById(actions.reward) ..".") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED) setPlayerStorageValue(cid, t.storage, 1) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você encontrou um ".. getItemNameById(actions.reward) .." mas não tem ".. getItemWeightById(actions.reward, actions.count) .." de capacidade livre.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O baú está vazio.") end end return true end TAG: <action uniqueid="50001;50002;50003" script="rewardchest.lua"/> ➥ Regras | Seções OTServ | Seções BOT
Postado Junho 16, 2015 10 anos Autor Muito obrigado aos dois que compartilharam o script comigo!Vou testar mas creio que funcionam, obrigado! Descreva seus sonhos aqui.
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.