lucasrafaelcorrea 0 Postado Maio 31, 2011 Share Postado Maio 31, 2011 Tipo do script: action Protocolo (versão do Tibia):8.50 Servidor utilizado:TSF Nível de experiência:Medio Adicionais/Informações:Queria Uma Quest Que So Pode Pegar um dos items,OBRIGADO. Link para o comentário https://xtibia.com/forum/topic/157573-pedido-quest-que-da-pra-pegar-so-1-item/ Compartilhar em outros sites More sharing options...
douguera 18 Postado Maio 31, 2011 Share Postado Maio 31, 2011 (editado) bom assim vou colocar um exemplo de armas vai em SEUOT/DATA/ACTIONS/SCRIPTS E CRIE 1 ARQUIVO .LUA CHAMADO armas.lua ABRA ELE E COLOQUE ISSU DENTRO -- Supreme Quest function onUse(cid, item, frompos, item2, topos) if item.uid == 9996 then queststatus = getPlayerStorageValue(cid,5491) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Voce pegou um(a) Supreme Star.") doPlayerAddItem(cid,10073,1) setPlayerStorageValue(cid,5491,1) else doPlayerSendTextMessage(cid,22,"It is empty.") end elseif item.uid == 9997 then queststatus = getPlayerStorageValue(cid,5491) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Voce pegou um(a) Supreme Sword.") doPlayerAddItem(cid,10313,1) setPlayerStorageValue(cid,5491,1) else doPlayerSendTextMessage(cid,22,"It is empty.") end elseif item.uid == 9998 then queststatus = getPlayerStorageValue(cid,5491) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Voce pegou um(a) Supreme Axe.") doPlayerAddItem(cid,6553,1) setPlayerStorageValue(cid,5491,1) else doPlayerSendTextMessage(cid,22,"It is empty.") end elseif item.uid == 9999 then queststatus = getPlayerStorageValue(cid,5491) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Voce pegou um(a) Supreme Wand.") doPlayerAddItem(cid,10531,1) setPlayerStorageValue(cid,5491,1) else doPlayerSendTextMessage(cid,22,"It is empty.") end else return 0 end return 1 end depois disso vc vai em SEUOT/DATA/ACTIONS/ACTIONS.XML e coloca esta linha <action uniqueid="9996" script="armas.lua" /> <action uniqueid="9997" script="armas.lua" /> <action uniqueid="9998" script="armas.lua" /> <action uniqueid="9999" script="armas.lua" /> ♥ é onde vai fikar o nome do seu script por exemplo voce cria la em scripts item.lua voce vai ter q por aqui em xml tbm item.lua ♥ é o Uniqueid que vc ira colocar no BAU para o xar pega o item pois esse uniqueid tem q ser igual no xml e no Script.lua ♥ é o ID DO ITEM ♥ é a Descriçao por exemplo voce fez essa quest para bens.! Bom cara espero te ajudado nao sei se da para entender ;D e outra mude somente oq eu discrevi aki o resto deixe do jeito q esta ;D Editado Maio 31, 2011 por douguer Link para o comentário https://xtibia.com/forum/topic/157573-pedido-quest-que-da-pra-pegar-so-1-item/#findComment-1039588 Compartilhar em outros sites More sharing options...
Nolis 161 Postado Junho 2, 2011 Share Postado Junho 2, 2011 Vou lhe dar uma ideia: Actions (XML) <action actionid="2000" event="script" value="quests/system.lua"/> Actions/Scripts/quests (system.lua) local specialQuests = { [2001] = 30015 --Annihilator } local questsExperience = { [30015] = 10000 } function onUse(cid, item, fromPosition, itemEx, toPosition) if(getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF, cid) return true end local storage = specialQuests[item.actionid] if(not storage) then storage = item.uid if(storage > 65535) then return false end end if(getPlayerStorageValue(cid, storage) > 0) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.") return true end local items = {} local reward = 0 local size = isContainer(item.uid) and getContainerSize(item.uid) or 0 if(size == 0) then reward = doCopyItem(item, false) else for i = 0, size do local tmp = getContainerItem(item.uid, i) if(tmp.itemid > 0) then table.insert(items, tmp) end end end size = table.maxn(items) if(size == 1) then reward = doCopyItem(items[1], true) end local result = "" if(reward ~= 0) then local ret = getItemDescriptions(reward.uid) if(reward.type > 0 and isItemRune(reward.itemid)) then result = reward.type .. " charges " .. ret.name elseif(reward.type > 0 and isItemStackable(reward.itemid)) then result = reward.type .. " " .. ret.plural else result = ret.article .. " " .. ret.name end else if(size > 20) then reward = doCopyItem(item, false) elseif(size > 8) then reward = getThing(doCreateItemEx(1988, 1)) else reward = getThing(doCreateItemEx(1987, 1)) end for i = 1, size do local tmp = doCopyItem(items[i], true) if(doAddContainerItemEx(reward.uid, tmp.uid) ~= RETURNVALUE_NOERROR) then print("[Warning] QuestSystem:", "Could not add quest reward") else local ret = ", " if(i == 2) then ret = " and " elseif(i == 1) then ret = "" end result = result .. ret ret = getItemDescriptions(tmp.uid) if(tmp.type > 0 and isItemRune(tmp.itemid)) then result = result .. tmp.type .. " charges " .. ret.name elseif(tmp.type > 0 and isItemStackable(tmp.itemid)) then result = result .. tmp.type .. " " .. ret.plural else result = result .. ret.article .. " " .. ret.name end end end end if(doPlayerAddItemEx(cid, reward.uid, false) ~= RETURNVALUE_NOERROR) then result = "You have found a reward weighing " .. getItemWeight(reward.uid) .. " oz. It is too heavy or you have not enough space." else result = "You have found " .. result .. "." setPlayerStorageValue(cid, storage, 1) if(questsExperience[storage] ~= nil) then rep.add(cid, 5, math.random(1,255)) doPlayerAddExp(cid, questsExperience[storage]) doSendAnimatedText(getCreaturePosition(cid), questsExperience[storage], TEXTCOLOR_WHITE) end end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, result) return true end local specialQuests = { [2001] = 30015 --Annihilator } local questsExperience = { [30015] = 10000 } function onUse(cid, item, fromPosition, itemEx, toPosition) if(getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF, cid) return true end local storage = specialQuests[item.actionid] if(not storage) then storage = item.uid if(storage > 65535) then return false end end if(getPlayerStorageValue(cid, storage) > 0) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.") return true end local items = {} local reward = 0 local size = isContainer(item.uid) and getContainerSize(item.uid) or 0 if(size == 0) then reward = doCopyItem(item, false) else for i = 0, size do local tmp = getContainerItem(item.uid, i) if(tmp.itemid > 0) then table.insert(items, tmp) end end end size = table.maxn(items) if(size == 1) then reward = doCopyItem(items[1], true) end local result = "" if(reward ~= 0) then local ret = getItemDescriptions(reward.uid) if(reward.type > 0 and isItemRune(reward.itemid)) then result = reward.type .. " charges " .. ret.name elseif(reward.type > 0 and isItemStackable(reward.itemid)) then result = reward.type .. " " .. ret.plural else result = ret.article .. " " .. ret.name end else if(size > 20) then reward = doCopyItem(item, false) elseif(size > 8) then reward = getThing(doCreateItemEx(1988, 1)) else reward = getThing(doCreateItemEx(1987, 1)) end for i = 1, size do local tmp = doCopyItem(items[i], true) if(doAddContainerItemEx(reward.uid, tmp.uid) ~= RETURNVALUE_NOERROR) then print("[Warning] QuestSystem:", "Could not add quest reward") else local ret = ", " if(i == 2) then ret = " and " elseif(i == 1) then ret = "" end result = result .. ret ret = getItemDescriptions(tmp.uid) if(tmp.type > 0 and isItemRune(tmp.itemid)) then result = result .. tmp.type .. " charges " .. ret.name elseif(tmp.type > 0 and isItemStackable(tmp.itemid)) then result = result .. tmp.type .. " " .. ret.plural else result = result .. ret.article .. " " .. ret.name end end end end if(doPlayerAddItemEx(cid, reward.uid, false) ~= RETURNVALUE_NOERROR) then result = "You have found a reward weighing " .. getItemWeight(reward.uid) .. " oz. It is too heavy or you have not enough space." else result = "You have found " .. result .. "." setPlayerStorageValue(cid, storage, 1) if(questsExperience[storage] ~= nil) then rep.add(cid, 5, math.random(1,255)) doPlayerAddExp(cid, questsExperience[storage]) doSendAnimatedText(getCreaturePosition(cid), questsExperience[storage], TEXTCOLOR_WHITE) end end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, result) return true end Agora abra o RME Download - Site oficial Coloque uma chest no chao, va em propiedades: Action: 2000 Uniqueid: (deixa qualqer numero, mas sertifique-se de que ja nao esta sendo usado) E Poem o Item. E Bem Mais Facil Na Minha opiniao. Boa Sorte Link para o comentário https://xtibia.com/forum/topic/157573-pedido-quest-que-da-pra-pegar-so-1-item/#findComment-1040229 Compartilhar em outros sites More sharing options...
joao33 29 Postado Junho 2, 2011 Share Postado Junho 2, 2011 Ese da certo pode confiar Bom isso é facil editar edito como quiser so ganha 1 item vlw -- orshabaal chests function onUse(cid, item, frompos, item2, topos) if item.uid == 5020 then queststatus = getPlayerStorageValue(cid,5020) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Você recebeu seu norse shield.") doPlayerAddItem(cid,7460,1) setPlayerStorageValue(cid,5020,1) else doPlayerSendTextMessage(cid,22,"It is empty.") end elseif item.uid == 5021 then queststatus = getPlayerStorageValue(cid,5020) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Você recebeu seu Santa Hat.") doPlayerAddItem(cid,6531,1) setPlayerStorageValue(cid,5020,1) else doPlayerSendTextMessage(cid,22,"It is empty.") end elseif item.uid == 5022 then queststatus = getPlayerStorageValue(cid,5020) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Você recebeu sua Dragon Robe.") doPlayerAddItem(cid,8867,1) setPlayerStorageValue(cid,5020,1) else doPlayerSendTextMessage(cid,22,"It is empty.") end elseif item.uid == 5023 then queststatus = getPlayerStorageValue(cid,5020) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Você recebeu sua bunny slippers.") doPlayerAddItem(cid,2644,1) setPlayerStorageValue(cid,5020,1) else doPlayerSendTextMessage(cid,22,"It is empty.") end elseif item.uid == 5024 then queststatus = getPlayerStorageValue(cid,5020) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Você recebeu sua northwind rod.") doPlayerAddItem(cid,8911,1) setPlayerStorageValue(cid,5020,1) else doPlayerSendTextMessage(cid,22,"It is empty.") end elseif item.uid == 5025 then queststatus = getPlayerStorageValue(cid,5020) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Você recebeu sua wand of decay.") doPlayerAddItem(cid,2188,1) setPlayerStorageValue(cid,5020,1) else doPlayerSendTextMessage(cid,22,"It is empty.") end elseif item.uid == 5026 then queststatus = getPlayerStorageValue(cid,5020) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Você recebeu sua Knife.") doPlayerAddItem(cid,2403,1) setPlayerStorageValue(cid,5020,1) else doPlayerSendTextMessage(cid,22,"It is empty.") end else return 0 end return 1 end Edite como quiser nas propiedades do chest ponha como action id exemplo no primeiro bau elseif item.uid == 5025 thenno segundo elseif item.uid == 5026 then e só editar la em cima script facinho depois va em data/actions.xml e ponha isso <action uniqueid="5020" script="orshachest.lua" /><action uniqueid="5021" script="orshachest.lua" /> <action uniqueid="5022" script="orshachest.lua" /> <action uniqueid="5023" script="orshachest.lua" /> <action uniqueid="5024" script="orshachest.lua" /> <action uniqueid="5025" script="orshachest.lua" /> <action uniqueid="5026" script="orshachest.lua" /> se for editra os uniqid do chest mude aki e no script vlw Rep+ né? Link para o comentário https://xtibia.com/forum/topic/157573-pedido-quest-que-da-pra-pegar-so-1-item/#findComment-1040294 Compartilhar em outros sites More sharing options...
Posts Recomendados