tibiaa4e 86 Postado Abril 5, 2009 Autor Share Postado Abril 5, 2009 Bem depois de muita demora minha =/ Aqui estão as respostas... <Eu minha ideia inicial era se basear nos scripts aqui postados, como so o tozão participo da criação vou me basear no dele na maioria dos scripts e esses serão postados os devidos creditos. Criação de Scripts 1- Bem o Tozão fez até mais do que eu pedi, se fosse uma empresa ele seria um otimo funcionario... O dele está perfeito, aqui está um mais simples para iniciantes function onUse(cid, item, frompos, item2, topos) local bridgepos = {x=926, y=958, z=8, stackpos=0} local bridgepos2 = {x=926, y=958, z=8, stackpos=0} local bridgepos3 = {x=926, y=958, z=8, stackpos=0} local bridgepos4 = {x=926, y=958, z=8, stackpos=0} local getbridge = getThingfromPos(bridgepos) local getbridge2 = getThingfromPos(bridgepos2) local getbridge3 = getThingfromPos(bridgepos3) local getbridge4 = getThingfromPos(bridgepos4) if item.uid == 8551 and item.itemid == 1945 then doCreateItem(493,1,bridgepos) doCreateItem(493,1,bridgepos2) doCreateItem(493,1,bridgepos3) doCreateItem(493,1,bridgepos4) doTransformItem(item.uid,item.itemid+1) elseif item.uid == 8551 and item.itemid == 1946 then doCreateItem(1284,1,bridgepos) doCreateItem(1284,1,bridgepos2) doCreateItem(1284,1,bridgepos3) doCreateItem(1284,1,bridgepos4) doTransformItem(item.uid,item.itemid-1) else doPlayerSendCancel(cid,"Sorry, not possible.") end return 1 Ai eu faço o script simples, porém funcional... Esse ai não expulsa as pessoas da ponte, e sinceramente não sei o que acontece se tiver um infeliz na ponte 2- Bem esse até era simples, só quem não tem experiencia copiar ou no minimo se basear em um script "descente" de quest... O do Tozão teve as exigencias então está aqui o correto -------------Script made by Tozao(for ta4e competition)------------ ----------------Created for version 8.4------------------- function onUse(cid, item, frompos, item2, topos) -----------------chest1--------------- if item.uid == 20005 then if getPlayerStorageValue(cid,5555) == -1 then if getPlayerFreeCap(cid) >= 80 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Demon Armor.") doPlayerAddItem(cid,2494,1) setPlayerStorageValue(cid,5555,1) else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have found a demon armor. Weighing 80.00 oz it is too heavy.") end else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"It is empty.") end -----------------chest2--------------- elseif item.uid == 20006 then if getPlayerStorageValue(cid,5555) == -1 then if getPlayerFreeCap(cid) >= 42 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Magic Sword.") doPlayerAddItem(cid,2400,1) setPlayerStorageValue(cid,5555,1) else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have found a magic sword. Weighing 42.00 oz it is too heavy.") end else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"It is empty.") end -----------------chest3--------------- elseif item.uid == 20007 then if getPlayerStorageValue(cid,5555) == -1 then if getPlayerFreeCap(cid) >= 99 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Stonecutter's Axe.") doPlayerAddItem(cid,2431,1) setPlayerStorageValue(cid,5555,1) else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have found a stonecutter axe. Weighing 99.00 oz it is too heavy.") end else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"It is empty.") end -----------------chest4--------------- elseif item.uid == 20008 then if getPlayerStorageValue(cid,5555) == -1 then if getPlayerFreeCap(cid) >= 43 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Annihilator Bear.") doPlayerAddItem(cid,2326,1) setPlayerStorageValue(cid,5555,1) else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have found a annihilator bear. Weighing 43.00 oz it is too heavy.") end else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"It is empty.") end -----------------porta da sala pequena--------------- elseif item.uid == 20009 and item.itemid == 5114 then if getPlayerStorageValue(cid, 5555) == 1 then if getPlayerVocation(cid) > 4 then doTransformItem(item.uid, item.itemid+1) doTeleportThing(cid,frompos) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only promoted players may enter here.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don\'t complete the quest.") end -----------------chest da sala pequena--------------- elseif item.uid == 20010 then if getPlayerStorageValue(cid,5556) == -1 then if getPlayerFreeCap(cid) >= 18.40 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a bag.") container = doPlayerAddItem(cid,1991,1) doAddContainerItem(container,2160,100) doAddContainerItem(container,2123,1) setPlayerStorageValue(cid,5556,1) else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have found a bag. Weighing 18.40 oz it is too heavy.") end else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"It is empty.") end return TRUE end end 3- Bem o primeiro postado aqui está quase correto, eu acredito que o isinArray não funcione com essa função... A ultima vez que usei essa função funcionava perfeitamente nessa sintaxe aqui -- Baseado no do Tozão-- -- Fixado por Ta4e-- function onUse(cid, item, frompos, item2, topos) if item.uid == 20015 and item.itemid == 5114 then if getPlayerSex(cid) == 0 then if getPlayerSlotItem(cid,2) == 2130 then doTransformItem(item.uid, item.itemid+1) doTeleportThing(cid,frompos) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don\'t have the golden amulet.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Aqui não entra homen.") return TRUE end elseif item.uid == 20016 and item.itemid == 5114 then if getPlayerSex(cid) == 1 then if getPlayerSlotItem(cid,2) == 2142 then doTransformItem(item.uid, item.itemid+1) doTeleportThing(cid,frompos) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don\'t have the ancient amulet.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Desculpe, aqui é uma boate gay, não aceitamos mulheres.") end end end 4- Mais uma vez o dele está correto. ------------Script made by Tozao(for ta4e competition)------------ ----------------Created for version 8.4------------------- function onUse(cid, item, fromPosition, itemEx, toPosition) coalbasin1 = {x=1027, y=1021, z=7, stackpos=STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE} coalbasin2 = {x=1026, y=1022, z=7, stackpos=STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE} coalbasin3 = {x=1027, y=1023, z=7, stackpos=STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE} coalbasin4 = {x=1028, y=1022, z=7, stackpos=STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE} food1 = getThingFromPos(coalbasin1) food2 = getThingFromPos(coalbasin2) food3 = getThingFromPos(coalbasin3) food4 = getThingFromPos(coalbasin4) if item.actionid == 20020 and item.itemid == 1945 then if getPlayerLevel(cid) >= 50 then if food1.itemid == 2787 and food2.itemid == 2789 and food3.itemid == 2792 and food4.itemid == 2796 then doRemoveItem(food1.uid) doRemoveItem(food2.uid) doRemoveItem(food3.uid) doRemoveItem(food4.uid) setPlayerStorageValue(cid,2479,1) doPlayerSendTextMessage(cid,25, "Congratulations, now you may pass on the magic door.") doTransformItem(item.uid,item.itemid+1) else doPlayerSendTextMessage(cid,26, "Sorry, you don\'t have all foods, you need a white, brown, dark and green mushrooms.") end else doPlayerSendTextMessage(cid,26, "Sorry, you need get level 50.") end elseif item.actionid == 20020 and item.itemid == 1946 then doTransformItem(item.uid,item.itemid-1) end return TRUE end 5- Bem esse eu ja imaginava ser o mais "dificil" O seu tozão eu vi apenas 1 erro de sintaxe que era apenas para level 9 fazer e uma pessoa com vocation e não promotion (isso esqueci de falar) Porém são erros simples e normais. Sobre ele abrir normalmente isso acontece porque você chamou algo fora da função da principal (os vetores e matrizes) Isso é um bug desde a 8.4, que infelizmente os developers ainda não arrumaram... Pode ser corrigido fazendo uma função simples em c++ (que não possuo aqui =/). Ou seja ainda pode ser seu script mais perfeito que você fez xD Eu por exemplo criei uma função maravilhosa para quests e esse erro não possibilita o uso dela. -------------Script made by Tozao(for ta4e competition)------------ ----------------Created for version 8.4-------------------- local VOC_DRUID = {2,6} local VOC_SORC = {1,5} local VOC_KINA = {4,8} local VOC_PALLY = {3,7} local prizes = {[VOC_DRUID] = 2182, [VOC_PALLY] = 2456, [VOC_SORC] = 2190, [VOC_KINA] = 2409} function onUse(cid, item, frompos, item2, topos) local vocation = getPlayerVocation(cid) local itemweight = getItemWeightById(prizes[vocation],1) local itemname = getItemNameById(prizes[vocation],1) pos = getCreaturePosition(cid) health = getCreatureHealth(cid) if item.uniqueid == 20025 then if getPlayerLevel(cid) == 9 then if vocation >= 1 and vocation <= 4 then if getPlayerStorageValue(cid,7777) == -1 then if getPlayerFreeCap(cid) >= itemweigth then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a " .. itemname .. ".") doPlayerAddItem(cid,prizes[vocation],1) setPlayerStorageValue(cid,7777,1) else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have found a demon helmet. Weighing " .. itemweight .. " oz it is too heavy.") end else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You already made this quest.") doPlayerAddHealth(cid, health -1) doSendMagicEffect(pos,12) end else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Sorry, you need a vocation.") end else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Sorry, you need get level 9.") end return TRUE end end Bem, Obrigado ao Tozão por ter participado dessa "prova" e pelo jeito você está até mais a frente desse nivel de script COrreção de Erros Aqui tivemos dois "alunos", eram erros simples que só pediam atenção 1- No caso dependendo da versão existiam dois erros... Primeiro a função doPlayerSay não existe mais sendo agora doCreatureSay e a outra é por causa dos numeros das falas. O TFS constantemente muda isso, e devemos acostumar a usar as variaveis do Const.lua function onUse(cid, item, frompos, item2, topos) sorte = math.random(1,6) pos = getPlayerPosition(cid) if item.itemid == 6567 then doSendMagicEffect(pos,22) if sorte == 1 then doCreatureSay(cid,'Ho ho ho!',TALKTYPE_ORANGE_1) elseif sorte == 2 then doCreatureSay(cid,'Jingle bells, jingle bells..',TALKTYPE_ORANGE_1) elseif sorte == 3 then doCreatureSay(cid,'Have you been naughty?',TALKTYPE_ORANGE_1) elseif sorte == 4 then doCreatureSay(cid,'Have you been nice?',TALKTYPE_ORANGE_1) elseif sorte == 5 then doCreatureSay(cid,'Merry Christmas!',TALKTYPE_ORANGE_1) elseif sorte == 6 then doCreatureSay(cid,'Can you stop squeezing me now... I m starting to feel a little sick.',TALKTYPE_ORANGE_1) end end end 2- Essa era facil... function onUse(cid, item, fromPosition, itemEx, toPosition) if itemEx.itemid == 2782 then doTransformItem(itemEx.uid, 2781) doDecayItem(itemEx.uid) return TRUE end return destroyItem(cid, itemEx, toPosition) end 3- Essa foi meio uma sacanagem minha Não tinha erros de sintaxe e sim que o autor imbecil (eu msm) falo o maximo de caracteres para o animated text... A string em LUA é usada por ' e " então se você usar aspas duplas não afetará a simples... Eu cai nessa a uns dias atrás e não podia deixar escapar xD O usuario Radamanthis conseguiu essa 4 - O usuario Tozão encontrou uma maneira de burlar o erro que era o case sensitivy (essa parte não fui q inventei foi um amigo do msn que pediu para eu colocar essa ai esqueci o erro o0) function onUse(cid, item, fromPosition, itemEx, toPosition) newnPosition = {x=1904, y=1006, z=8} if item.uid == 32194 then doTeleportThing(cid,newnPosition) doSendMagicEffect(newnPosition,10) else return 0 end return 1 end 5 e 6 - Esse como falei não tem certo e errado. O erro de sintaxe era um end faltando ao final para fechar o function Esse script ja tinah ele no Xtibia postado por mim com ele diminuido... O do Tozão eu bati o olho e não vi erros também... Espero que tenha sido proveitoso ou no minimo legal isso... Claro que pensei q teria mais usuarios participando Agradeço aos que participaram e esperem os proximos tutoriais, quando eu acabar a segunda semana de prova (essa) Voltarei a fazer os ultimos tutoriais Link para o comentário https://xtibia.com/forum/topic/105581-pasta-data-prova-i/page/2/#findComment-719105 Compartilhar em outros sites More sharing options...
tozinho123 0 Postado Abril 6, 2009 Share Postado Abril 6, 2009 (editado) @tibiaa4e creio que o 3º script nao funciona assim, pq eu tambem tentei botar desse jeito(if getPlayerSlotItem(cid, 2) == ID DO COLAR) e nao deu certo, ja tentei tambem assim(amulet = getPlayerSlotItem(cid, 2) if amulet == ID DO COLAR then) e mesmo assim nao funcionou, pode ser algum erro do distro ou sei la :S bom de qualquer forma foi muitoo legal e gostaria que tivesse mais provas dessas :smile_positivo: (é claro se mais players participassem...) EDIT falta tambem a resposta do script da fishing rod xD Editado Abril 6, 2009 por Tozao Link para o comentário https://xtibia.com/forum/topic/105581-pasta-data-prova-i/page/2/#findComment-719595 Compartilhar em outros sites More sharing options...
tibiaa4e 86 Postado Abril 6, 2009 Autor Share Postado Abril 6, 2009 @up Hehe depois eu vejo se faço mais... Tipo to sem net ainda e essa semana ainda tem 2 provas e minha viagem Sobre o helmet ainda deve tar com uns bug ou eles mudaram a sintaxe Link para o comentário https://xtibia.com/forum/topic/105581-pasta-data-prova-i/page/2/#findComment-719643 Compartilhar em outros sites More sharing options...
grilloko 5 Postado Outubro 4, 2011 Share Postado Outubro 4, 2011 MUITO BOM! Está de Parabéns tibiaa4e [Andrew], Ajuda muito os Iniciantes em Script "como eu", logo mais postarei as respostas, [REP +] Link para o comentário https://xtibia.com/forum/topic/105581-pasta-data-prova-i/page/2/#findComment-1111802 Compartilhar em outros sites More sharing options...
EduardoDantas 0 Postado Fevereiro 2, 2012 Share Postado Fevereiro 2, 2012 Nossa ótimo tópico, tem previsão de quando vai ter outro evento desses? Se todos que visualizam o tópico participassem ia fazer maior sucesso. rsrs Link para o comentário https://xtibia.com/forum/topic/105581-pasta-data-prova-i/page/2/#findComment-1192243 Compartilhar em outros sites More sharing options...
Posts Recomendados