Ir para conteúdo

jhon992

Conde
  • Total de itens

    631
  • Registro em

  • Última visita

  • Dias Ganhos

    13

Tudo que jhon992 postou

  1. quem sabe o item que você esta tentando usar jah possui uma outra tag no movements.xml. Se possuir apaga as outras tags e testa novamente.
  2. Vai em data/movements/scripts, duplica um arquivo e nomeia para "nomedoitem" sem as aspas e nele cole: function onEquip(cid, item, slot) local outfit = {lookType = 4} -- looktype doSetCreatureOutfit(cid, outfit, -1) doSendMagicEffect(getPlayerPosition(cid),67) -- effect return TRUE end function onDeEquip(cid, item, slot) doRemoveCondition(cid, CONDITION_OUTFIT) doSendMagicEffect(getPlayerPosition(cid),67) -- effect return TRUE end Agora em movements.xml cole a tag: <movevent type="Equip" itemid="iddoitem" slot="slotdoitem" event="script" value="nomedoitem.lua"/> <movevent type="DeEquip" itemid="iddoitem" slot="slotdoitem" event="script" value="nomedoitem.lua"/> slots validos: head armor legs hand shield ring necklace feet pickupable Postei pq ja tava criando antes do @mulizeo. E vi que tava mais explicadinho para o usuario.
  3. eu vi que n ia usar o cid dentro da função, mais passei sóh pra n deixar sem parametro nenhum. sahdua
  4. Fiz um script tbm, vou postar pq começei a fazer antes do vod postar o dele. O meu script vai funcionar como um evento. O Gm ordena quando começa e acaba esse evento. Vai em data/creaturescripts/scripts, duplica um arquivo e nomeia para "login_exp" sem as aspas e nele cole: function onLogin(cid) local rate = 2 -- 100% local msg = "Aproveite o evento Doble Exp!" local stor = 13545 -- storage vip if (getGlobalStorageValue(stor) > 0) then doPlayerSetExperienceRate(cid, rate) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, msg) end return TRUE end Em creaturescripts.xml cole a tag: <event type="login" name="Login_Exp" event="script" value="login_exp.lua"/> ------------------------------------------------------------------------------------------------------------ Vai em data/talkactions/scritps e duplica um arquivos, e nomeia para "eventexp" sem as aspas e nele cole: function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end if (param == "open") then if (getGlobalStorageValue(13545) > 0) then doPlayerSendTextMessage(cid, 22, "O evento ja esta aberto.") return true end setGlobalStorageValue(13545, 1) doBroadcastMessage("O evento Double Exp esta aberto, todos os player serão kikados após 10 segundos!") addEvent(RemoveAll, 10000, cid) elseif (param == "close") then if (getGlobalStorageValue(13545) <= 0) then doPlayerSendTextMessage(cid, 22, "O evento ja esta feixado.") return true end setGlobalStorageValue(13545, 0) doBroadcastMessage("O evento Double Exp esta feixado, todos os player serão kikados após 10 segundos!") addEvent(RemoveAll, 10000, cid) end return true end function RemoveAll(cid) local online = getOnlinePlayers() for i=1, #online do if (isPlayer(getPlayerByName(online[i]))) then doRemoveCreature(getPlayerByName(online[i])) end end end Em talkaction.xml cole a tag: <talkaction log="yes" access="5" words="eventxp" event="script" value="eventexp.lua"/> Para abrir o evento basta com o gm usar o comando "eventxp open" e para feixar "eventxp close".
  5. Primeiro tens que ir em data/XML/outfits.xml e colar as tags dos novos outfits. Exemplo: <outfit id="25"> <list gender="0-3" lookType="159" name="Elf"/> </outfit> <outfit id="26"> <list gender="0-3" lookType="160" name="Dwarf"/> </outfit> Explicando: outfit id = você coloca o numero de identificação, veja o numero da ultima outfit id e coloque o proximo numero, obs: "não é o numero da outfit". gender = male e female. looktype = agora sim e o numero correspondente a outfit do monstro, vc pode descobrir looks diferentes usando o comando "/newtype numero". name = nome que vai aparecer na hra de escolher a out. Você ainda pode usar a tag apenas para premium usar o out, ficaria assim: <outfit id="25" premium="yes"> Depois disso os players ja poderão escolher as outfits de monstros. Agora as que você quiser que os player só possam usar depois de comprar no npc, use tags com tags diferentes, assim: <outfit id="25" quest="40850"> <list gender="0-3" lookType="159" name="Elf"/> </outfit> <outfit id="26" quest="40851"> <list gender="0-3" lookType="160" name="Dwarf"/> </outfit> Ou, apenas premium que comprarem no npc, basta adicionar a tag do premium. Agora criando o npc, vai na pasta data/npc/ duplica um arquivo e nomeia para "Monsterout Seller" sem as aspas e nele cole: <?xml version="1.0" encoding="UTF-8"?> <npc name="Monsterout Seller" script="outseller.lua" walkinterval="2000" floorchange="0"> <health now="999999" max="999999"/> <look type="12" corpse="2212"/> <!-- troque o looktype para o outfit que o npc vai estar --> <parameters> <parameter key="message_greet" value="Eu vendo {monster outfits}!."/> </parameters> </npc> Agora em data/npc/scripts, duplica um arquivo e nomeia para "outseller" sem as aspas e nele cole: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'monster outfits') then selfSay('I Sell outfit {Elf}, {Dwarf}. For 10k each.', cid) talkState[talkUser] = 2 elseif talkState[talkUser] == 2 then if msgcontains(msg, 'Elf') then if (doPlayerRemoveMoney(cid, 10000)) then -- preço que custara o out de elf doSendMagicEffect(getCreaturePosition(cid), 30) -- effect que o player recebera selfSay('Você recebeu o Elf Outfit.', cid) setPlayerStorageValue(cid, 40850) -- aqui você poem o nomero da quest que você setou no outfit.xml para o elf else selfSay('Você não possui dinheiro suficiente.', cid) end talkState[talkUser] = 3 elseif msgcontains(msg, 'Dwarf') then if (doPlayerRemoveMoney(cid, 10000)) then -- preço que custara o out de dwarf doSendMagicEffect(getCreaturePosition(cid), 30) -- effect que o player recebera selfSay('Você recebeu o Dwarf Outfit.', cid) setPlayerStorageValue(cid, 40851) -- aqui você poem o nomero da quest que você setou no outfit.xml para o elf else selfSay('Você não possui dinheiro suficiente.', cid) end talkState[talkUser] = 1 else selfSay('Não posso realizar comprar outfit monster.', cid) end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Agora sóh adicionar o npc no mapa e testar! Fiz rapidinho então ficou meia boca, quando tiver mais tempo ageito o código para ficar mais facil.
  6. Uma dica que te dou é usar esse sisteminha: http://www.xtibia.co...p-items-system/ Assim apenas vips poderão usar armas vips. E me passa o teu globalevent que receber o item do site que eu tento adaptar com o script de owner.
  7. Vou me empenhar para fazer um ótimo trabalho. E parabéns aos outros escolhidos para a equipe.
  8. Esse código adiciona 5 leveis ao player que matou um adversario em batalha, se o player tiver o msm ip que o adversario ele recebe uma punição de -50 mil pontos de experiência; Analisando o código por linhas: function onKill(cid, target) local lvl = getPlayerLevel(cid) -- lvl atual do player local nlvl = getPlayerLevel(cid) + 5 -- lvl atual+5 if isPlayer(target) == TRUE then -- se o "ser" que você matou é um player, então if getPlayerIp(cid) ~= getPlayerIp(target) then -- se o seu ip for diferente do ip do cara que você matou, então local exp = (50 * (lvl) * (lvl) * (lvl) - 150 * (lvl) * (lvl) + 400 * (lvl)) / 5 -- faz um calculo estranho, que eu acho que descobre a experiência atual do player. local nexp = (50 * (nlvl) * (nlvl) * (nlvl) - 150 * (nlvl) * (nlvl) + 400 * (nlvl)) / 5 -- faz o msm calculo, mais agora descobre a experiência se o player fosse 5 leveis mais alto. local newexp = nexp - exp -- calcula a diferença de experiência desses 5 leveis. doPlayerAddExp(cid,newexp) -- adiciona essa diferença de exp ao player que matou. doSendAnimatedText(getPlayerPosition(cid), "Orgasmic~", 198) -- solta o animated text "Orgasmic~" no player que matou. else -- se o ip do player que matou for igual ao do player que morreu, então doPlayerAddExperience(cid, -50000) -- remove 50 mil pontos de experiência do player que matou. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.") -- manda essa msg no player. end -- o resto da linhas, finalizam condições e a função. end return TRUE end
  9. simples na segunda linha: removeOnUse = "yes", substitui por "no": removeOnUse = "no",
  10. Tem essa por talkaction: Só criar um arquivo.lua na pasta scripts da pasta talkactions e colar esse código. function onSay(cid, words, param, channel) local pos = getCreaturePosition(cid) if(getTileInfo(pos).protection) then local target = 0 param = param:trim() if(param == '') then pos = getPosByDir(pos, getCreatureLookDirection(cid)) target = getTopCreature(pos).uid else target = getPlayerByNameWildcard(param) if(target ~= 0) then pos = getCreaturePosition(target) if(getDistanceBetween(getCreaturePosition(cid), pos) > 1) then return true end end end local tmp = getCreaturePosition(cid) if(doTeleportThing(cid, pos, true) and not isPlayerGhost(cid)) then doSendMagicEffect(tmp, CONST_ME_POFF) doSendMagicEffect(pos, CONST_ME_TELEPORT) end end return false end Depois poem essa tag no talkactions.xml: <talkaction words="/pass;!pass" event="script" value="nomedoteuscript.lua"/> Troque o nome do script para o que você botou, e para usar em jogo basta /pass ou !pass. Créditos @slawkens.
  11. Parabens pelo seu trabalho @Laug, me deixou de boca aberta. Continue buscando conhecimento e melhorando cada dia mais.
  12. Tinham errado feio a minha area hem, mais pelo visto ja concertaram, valeu aew o parabens @DuhhCarvalho, e parabens para todos os selecionados e boa sorte com suas entrevistas.
  13. Aqui tem uma lista que eu uso: http://www.xtibia.com/forum/topic/138081-lualista-de-funcoes/ E procura alguns tutorias no forum ou me add no msn que te dou umas dicas.
  14. Ja testei o meu, ta funcional...
  15. n sei n velho, usa assim como eu fiz n muda tempo n, esse tempo é da função addevent é diferente do de globalevents e talz. e creio que o script esteja funcionando, pode usar @Blinkrox.
  16. vai em data/creaturescripts/scripts, duplica um arquivo e nomeia para "login_gain" sem as aspas e nele cole: function onLogin(cid) local timeOn = 4 -- quantidade de hras on para ganhar um dos itens addEvent(gainItem, timeOn*3600000, timeOn, cid) return true end function gainItem(timeOn, cid) if (isPlayer(cid)) then local itens_gain = {1234,5678,9101,4567} -- id dos itens doPlayerAddItem(cid, tonumber(itens_gain[math.random(1,#itens_gain)])) addEvent(gainItem, timeOn*3600000, timeOn, cid) end end Agora no creaturescripts.xml cole a tag: <event type="login" name="Gain" script="login_gain.lua"/> Ta pronto. Eu configurei para dar um dos itens que estão naquela lista, se quiser dar apenas um item especifico basta apagar os outros ids. Obs: nem testei, qualquer erro me fala.
  17. function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end local t = string.explode(param, ",") local player = getPlayerByNameWildcard(tostring(t[1])) local item_id = tonumber(t[2]) local quant = tonumber(t[3]) if(not isPlayer(player)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player nao existe.") return true elseif (getPlayerItemCount(player, item_id) <= 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O player não possui este item.") return true elseif (getPlayerItemCount(player, item_id) < quant) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O player não possui essa quantidade de item.") return true end doPlayerRemoveItem(player, item_id, quant) return true end
  18. Assim funcionara: function onThink(interval, lastExecution) -- Configurações local cor = 25 -- Defina a cor da mensagem (25 = verde) local mensagens ={ [[Você esta jogando Ryan War, feito por HisashiItYamaguti! Qualquer dúvida pergunte ao npc ajudante localizado para lá >>> do templo! Bom Jogo]] } -- Fim de Configurações doBroadcastMessage(mensagens[math.random(1,table.maxn(mensagens))], cor) return TRUE end Para testar as cores, entre com o gm em seu ot e teste "/y numerodacor".
  19. function onUse(cid, item, fromPosition, itemEx, toPosition) local min_hp = 100 -- minimo de life que ira encher local max_hp = 200 -- maximo de life que ira encher local min_mana = 100 -- minimo de mana que ira encher local max_mana = 200 -- maximo de mana que ira encher local effect = 30 -- efeito no player local exhaust_sec = 2 -- exausted em segundos if(exhaustion.check(cid, 34539) == TRUE) then doPlayerSendCancel(cid, "Voçê só pode usar após [" .. exhaustion.get(cid, 34539).."] segundos.") return TRUE end doCreatureAddHealth(cid, math.random(min_hp,max_hp)) doCreatureAddMana(cid, math.random(min_mana,max_mana)) exhaustion.set(cid, 34539, exhaust_sec) doRemoveItem(item.uid, 1) doSendMagicEffect(getPlayerPosition(cid), effect) return TRUE end
  20. Formulário Nome completo: Jhonatan Souza de Carvalho Idade: 19 Experiências com trabalho em equipe: Tenho pouca experiencia com trabalho em equipe, mais uma das minhas caracteristicas é que aprendo muito rapido. Experiências em sua área (mapping, scripting ou imprensa - deixar links para tópicos e/ou trabalhos aqui no fórum): Sou scripter, trabalho com .lua a um tempinho sou fã de programação, curso ciências da computação na universidade. Costumo ficar online no XTibia boa parte do dia, sempre em Dúvidas sobre Scripts e Pedidos de Scripts, tento responder o máximo de dúvidas que posso. Álias uns 90% dos meus pontos de Rep+ foi por ajuda aos usuarios. Por quê você deve ser um estagiário do XTibia.com? Até um tempo não queria ser estagiário, mais hoje sei que estão precisando de gente na equipe então resolvi me candidatar. E assim continuar ajudando a comunidade só que com um cargo de maior importancia que membro.
  21. local m = 10 --rebirth(reset) nessesarios para passar function onSetpIn(cid,item,pos) if isPlayer(cid) then if getPlayerStorageValue(cid, 72345) >= m then doTeleportThing(cid, pos) return TRUE end end return TRUE end Créditos @lordbug99
  22. tanta assim: function onUse(cid, item, frompos, item2, topos) -- Item ID and Uniqueid -- switchUniqueID = 29796 switchID = 1945 switch2ID = 1946 swordID = 8306 -- Pure Energy para knights crossbowID = 8300 -- Flawless Ice Crystal para paladins appleID = 8305 -- Mother Soil para druids spellbookID = 8304 -- Eternal Flames para sorcerer -- Level to do the quest -- questlevel = 80 piece1pos = {x=33265, y=31835, z=10, stackpos=1} -- Where the first piece will be placed knight getpiece1 = getThingfromPos(piece1pos) piece2pos = {x=33271, y=31835, z=10, stackpos=1} -- Where the second piece will be placed paladin getpiece2 = getThingfromPos(piece2pos) piece3pos = {x=33268, y=31839, z=10, stackpos=1} -- Where the third piece will be placed druid getpiece3 = getThingfromPos(piece3pos) piece4pos = {x=33268, y=31832, z=10, stackpos=1} -- Where the fourth piece will be placed sorcerer getpiece4 = getThingfromPos(piece4pos) player1pos = {x=33266, y=31835, z=10, stackpos=253} -- Where player1 will stand before pressing lever knight player1 = getThingfromPos(player1pos) player2pos = {x=33270, y=31835, z=10, stackpos=253} -- Where player2 will stand before pressing lever paladin player2 = getThingfromPos(player2pos) player3pos = {x=33268, y=31838, z=10, stackpos=253} -- Where player3 will stand before pressing lever druid player3 = getThingfromPos(player3pos) player4pos = {x=33268, y=31833, z=10, stackpos=253} -- Where player4 will stand before pressing lever sorcerer player4 = getThingfromPos(player4pos) knightvoc = getPlayerVocation(player1.uid) -- The vocation of player1 paladinvoc = getPlayerVocation(player2.uid) -- The vocation of player2 druidvoc = getPlayerVocation(player3.uid) -- The vocation of player3 sorcerervoc = getPlayerVocation(player4.uid) -- The vocation of player4 nplayer1pos = {x=33263, y=31831, z=12} -- The new position of player1 nplayer2pos = {x=33272, y=31831, z=12} -- The new position of player2 nplayer3pos = {x=33263, y=31840, z=12} -- The new position of player3 nplayer4pos = {x=33272, y=31840, z=12} -- The new position of player4 player1level = getPlayerLevel(player1.uid) -- Checking the level of player1 player2level = getPlayerLevel(player2.uid) -- Checking the level of player2 player3level = getPlayerLevel(player3.uid) -- Checking the level of player3 player4level = getPlayerLevel(player4.uid) -- Checking the level of player4 -- Check if all players has the correct vocation if knightvoc == 4 or knightvoc == 8 and paladinvoc == 3 or paladinvoc == 7 and druidvoc == 2 or druidvoc == 6 and sorcerervoc == 1 or sorcerervoc == 5 then -- Check if all players are standing on the correct positions if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then if player1level >= questlevel and player2level >= questlevel and player3level >= questlevel and player4level >= questlevel then if item.uid == switchUniqueID and item.itemid == switchID and getpiece1.itemid == swordID and getpiece2.itemid == crossbowID and getpiece3.itemid == appleID and getpiece4.itemid == spellbookID then doSendMagicEffect(player1pos,2) doTeleportThing(player1.uid,nplayer1pos) doSendMagicEffect(nplayer1pos,10) doRemoveItem(getpiece1.uid,1) doSendMagicEffect(player2pos,2) doTeleportThing(player2.uid,nplayer2pos) doSendMagicEffect(nplayer2pos,10) doRemoveItem(getpiece2.uid,1) doSendMagicEffect(player3pos,2) doTeleportThing(player3.uid,nplayer3pos) doSendMagicEffect(nplayer3pos,10) doRemoveItem(getpiece3.uid,1) doSendMagicEffect(player4pos,2) doTeleportThing(player4.uid,nplayer4pos) doSendMagicEffect(nplayer4pos,10) doRemoveItem(getpiece4.uid,1) doTransformItem(item.uid,item.itemid+1) doSummonCreature("Lord of the Elements", {x= 33267,y=31835,z=12}) return TRUE elseif item.uid == switchUniqueID and item.itemid == switch2ID then doTransformItem(item.uid,item.itemid-1) else doPlayerSendTextMessage(cid,19,"Sorry, you need to put the correct stuffs at the correct basins.") end else doPlayerSendTextMessage(cid,19,"All Players have to be level 80 to do this quest.") end else doPlayerSendTextMessage(cid,19,"You need 4 players to do this quest.") end end return TRUE end
  23. Nem analizei seu código, mais eu uso esse e funciona. Testa aew: -- [( Script edited by Doidin for XTibia.com )] -- function onSay(cid, item, words, param) local count = getPlayerInstantSpellCount(cid) local text = "" local t = {} local prevLevel = -1 local line = "" for i = 0, count - 1 do local spell = getPlayerInstantSpellInfo(cid, i) if spell.level ~= 0 then if spell.manapercent > 0 then spell.mana = spell.manapercent .. "%" end table.insert(t, spell) end end table.sort(t, function(a, b) return a.level < b.level end) for i, spell in ipairs(t) do if prevLevel ~= spell.level then if i ~= 1 then line = "" end line = line .. "- Spells for Level " .. spell.level .. ":\n" prevLevel = spell.level end text = text .. line .."• ".. spell.words .." - " .. spell.name .. ": " .. spell.mana .. "\n" end doShowTextDialog(cid, 7528, text) return TRUE end
  24. Vai nos monstros da task. Por exemplo o Troll e antes disso, que é a última linha do monstro: </monster> Cole aquilo, ficando assim: <script> <event name="KillingInTheNameOf"/> </script> </monster>
  25. http://www.xtibia.com/forum/topic/128237-killing-in-the-name-of-todos-os-monstros-todas-as-recompensas/
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...