Ir para conteúdo

zipter98

Herói
  • Total de itens

    2553
  • Registro em

  • Última visita

  • Dias Ganhos

    72

Tudo que zipter98 postou

  1. Não lembro direito desse script. Me passe por PM, que dou uma olhada melhor.
  2. Vá em data/lib/Movement_Effects.lua, procure por: if isCreature(cid) then addEvent(sendAuraEffect, 3000, cid, eff) --Não sei se no seu estará 3000, de qualquer maneira, procure por essa parte. end E mude para: if isCreature(cid) then addEvent(sendAuraEffect, 1000, cid, eff) end 1000 = 1 segundo.
  3. Help é no data/xml/channels.
  4. Deve ser problema do XML que mandei. Recomendo que faça um XML próprio, ou mude essa parte: <look type="523" head="114" body="119" legs="114" feet="114" corpse="2212"/> Respectivamente, a "roupa" do NPC (look type); as cores da outfit dele (head, body, legs e feet); e a corpse dele. (esse último, como não altera muita coisa, pode deixar 2212.)
  5. Foi mal, esse erro foi burrice minha ._. 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 local t = {need_items = {2160, 2159, 2158}, remove_items = {1, 2, 3}} local g = t.need_items local h = t.remove_items premio1 = x -- coloque aqui o id do dinheiro quant1 = x -- quantidade de grana que vai ganhar pexp = x -- experiencia que vai ganhar no premio if msgcontains(msg, 'mission') or msgcontains(msg, 'help') then selfSay("Você gostaria de me ajudar numa missão?", cid) doPlayerSendTextMessage(cid, 27, "Say yes or no.") talkState[talkUser] = 1 return true elseif msgcontains(msg 'yes') and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, storage) < 1 then selfSay("Certo, vá pegar x qnt de x items!", cid) setPlayerStorageValue(cid, 222011, 1) doPlayerSendTextMessage(cid, 27, "If you alreay have the items, say complete.") talkState[talkUser] = 2 return true else selfSay("Você já me ajudou.", cid) talkState[talkUser] = 0 return true end elseif msgcontains(msg, 'no') and talkState[talkUser] == 1 then selfSay("Ok então...", cid) talkState[talkUser] = 0 return true elseif msgcontains(msg, 'complete') and (talkState[talkUser] == 2 or getPlayerStorageValue(cid, 222011) >= 1) then for i = 1, #g do if getPlayerItemCount(cid, g[i]) >= h[i] then doPlayerRemoveItem(cid, g[i], h[i]) selfSay("Obrigado! Aqui está seu prêmio.", cid) doPlayerAddItem(cid, premio1, quant1) setPlayerStorageValue(cid, storage, 1) setPlayerStorageValue(cid, 222011, -1) talkState[talkUser] = 0 return true else selfSay("Você não possui os items requisitados.", cid) talkState[talkUser] = 0 return true end end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  6. Desculpe, pedi o arquivo errado '-' Poderia postar seu goback.lua, localizado em data/actions/scripts? #EDIT: Estou indo dormir agora, ai amanhã tento arrumar isso pra você.
  7. Fiz esse NPC rapidinho aqui, qualquer erro, só postar. 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 local storage = x -- storage id local local t = {need_items = {2160, 2159, 2158}, remove_items = {1, 2, 3}} local g = t.need_items local h = t.remove_items premio1 = x -- coloque aqui o id do dinheiro quant1 = x -- quantidade de grana que vai ganhar pexp = x -- experiencia que vai ganhar no premio if msgcontains(msg, 'mission') or msgcontains(msg, 'help') then selfSay("Você gostaria de me ajudar numa missão?", cid) doPlayerSendTextMessage(cid, 27, "Say yes or no.") talkState[talkUser] = 1 return true elseif msgcontains(msg 'yes') and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, storage) < 1 then selfSay("Certo, vá pegar x qnt de x items!", cid) setPlayerStorageValue(cid, 222011, 1) doPlayerSendTextMessage(cid, 27, "If you alreay have the items, say complete.") talkState[talkUser] = 2 return true else selfSay("Você já me ajudou.", cid) talkState[talkUser] = 0 return true end elseif msgcontains(msg, 'no') and talkState[talkUser] == 1 then selfSay("Ok então...", cid) talkState[talkUser] = 0 return true elseif msgcontains(msg, 'complete') and (talkState[talkUser] == 2 or getPlayerStorageValue(cid, 222011) >= 1) then for i = 1, #g do if getPlayerItemCount(cid, g[i]) >= h[i] then doPlayerRemoveItem(cid, g[i], h[i]) selfSay("Obrigado! Aqui está seu prêmio.", cid) doPlayerAddItem(cid, premio1, quant1) setPlayerStorageValue(cid, storage, 1) setPlayerStorageValue(cid, 222011, -1) talkState[talkUser] = 0 return true else selfSay("Você não possui os items requisitados.", cid) talkState[talkUser] = 0 return true end end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  8. Poderia postar seu some functions.lua? [data/lib]
  9. Sobre essa parte, tenta assim: local t = {need_items = {2160, 2159, 2158}, remove_items = {1, 2, 3}} g = t.need_items h = t.remove_items if quest1 ==1 then selfSay('Bom! Entao vc trouxe os meus itens? Deixe-me ver.',cid) for i = 1, #g do if getPlayerItemCount(cid, g[i]) >= h[i] then doPlayerRemoveItem(cid, g[i], h[i]) selfSay('Obrigado! Agora poderei termina de concertar minha bicicleta. Aqui esta sua recompenca!',cid) doPlayerAddItem(cid, premio1, quant1) else selfSay("Você não possui os items requisitados.", cid) talkState[talkUser] = 0 end end
  10. Sobre a animação, poderia ser um doSendAnimatedText(getThingPos(cid), pexp, 215) Dessa maneira, irá simular como se o player recebesse a exp normalmente. EDIT: Sobre remover mais de um item, faz tipo assim: local t = {need_items = {2160, 2159, 2158}, remove_items = {1, 2, 3}} g = t.need_items h = t.remove_items for i = 1, #g do if getPlayerItemCount(cid, g[i]) >= h[i] then doPlayerRemoveItem(cid, g[i], h[i]) else return doPlayerSendCancel(cid, "Você não tem os items necessários.") end end Na tabela, a posição dos valores da variável need_items deve ser igual à remove_items. Assim, como o ID 2160 está na posição 1 da variável need_items, irá ser removido apenas uma unidade desde item. (Perceba que na variável remove_items, o valor 1 está na posição 1; portanto, o valor que será retirado do item que se encontra na posição 1 da variável need_items é o valor que se encontra na posição 1 da variável remove_items). Do item que se encontra na posição 2, no caso, 2159, será removido 2 unidades. Já do 2158, 3 unidades.
  11. Tenta: 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 local need_lv = 250 if msgcontains(msg, 'promotion') or msgcontains(msg, 'promote') then selfSay("Então, você gostaria de ser promovido?", cid) doPlayerSendTextMessage(cid, 27, "Say yes or no. You need be at least level "..need_lv.." to be promoted.") talkState[talkUser] = 1 return true elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then if getPlayerLevel(cid) >= need_lv then selfSay("Parabéns, você foi promovido.") doPlayerSetPromotionLevel(cid, 1) talkState[talkUser] = 0 return true else selfSay("Você precisa estar, no mínimo, level "..need_lv.." para ser promovido.", cid) talkState[talkUser] = 0 return true end elseif msgcontains(msg, 'no') and talkState[talkUser] == 1 then selfSay("Ok, então...", cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) O XML, você sabe criar?
  12. Tinha feito correndo, ai nem reparei nisso e.e Valeu por corrigir!
  13. function onUse(cid, item, frompos, item2, topos) local pos = {x=1710, y=1000, z=4} local need_lv = 200 if getPlayerLevel(cid) >= need_lv then doTeleportThing(cid, pos) doSendMagicEffect(pos, CONST_ME_TELEPORT) else return doPlayerSendCancel(cid, "Você precisa ser level "..need_lv.." para passar por esta porta.") end return 1 end
  14. Em relação ao seu boost.lua, você configurou a Ancient Stone e Metal Stone no configuration.lua? (Porque, caso não tenha, metals e ancient vão assumir um valor nulo ao boostar). Sobre isso da configuração das stones, fica nessa parte do configuration.lua: leaf = 11441 grass = 11441 water = 11442 venom = 11443 thunder = 11444 rock = 11445 punch = 11446 fire = 11447 coccon = 11448 crystal = 11449 dark = 11450 earth = 11451 enigma = 11452 heart = 11453 ice = 11454 boostStone = 12618 Se o ID da Ancient Stone for, por exemplo, 11455, você mudaria essa parte para: leaf = 11441 grass = 11441 water = 11442 venom = 11443 thunder = 11444 rock = 11445 punch = 11446 fire = 11447 coccon = 11448 crystal = 11449 dark = 11450 earth = 11451 enigma = 11452 heart = 11453 ice = 11454 boostStone = 12618 ancient = 11455
  15. Fiz rapidinho aqui, porque jaja estou saindo: XML do NPC: <?xml version="1.0" encoding="UTF-8"?> <npc name="Flawless Ice Crystal" script="flawlesscrystal.lua" walkinterval="0" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="523" head="114" body="119" legs="114" feet="114" corpse="2212"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|, voce deseja trocar 10 life crystal por 1 Flawless Ice Crystal?"/> </parameters> </npc> data/npc/scripts, crie um arquivo com extensão .lua com o nome flawlesscrystal. 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 local cfg = { life_crystal = xxx, --ID do life crystal life_crystal_qnt = 10, --Quantidade de life crystal necessários. flawless_ice_crystal = xxx, --ID do flawless ice crystal. flawless_ice_crystal_qnt = 1, --Quantidade de flawless ice crystal que o player irá receber. } if msgcontains(msg, 'yes') or msgcontains(msg, 'sim') then if getPlayerItemCount(cid, cfg.life_crystal) >= cfg.life_crystal_qnt then selfSay("Aqui está seu Flawless Ice Crystal!", cid) doPlayerRemoveItem(cid, cfg.life_crystal, cfg.life_crystal_qnt) doPlayerAddItem(cid, flawless_ice_crystal, flawless_ice_crystal_qnt) talkState[talkUser] = 0 return true else selfsay("Você não tem "..life_crystal_qnt.." Life Crystals para trocar...", cid) talkState[talkUser] = 0 return true end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Qualquer erro, é só postar.
  16. zipter98

    Script de war

    Verde: function onStepIn(cid, item, frompos, item2, topos) local outfit = {lookType = 128, lookHead = 82, lookBody = 114, lookLegs = 114, lookFeet = 82, lookAddons = 3} if item.actionid == 5031 then if not isCreature(cid) then return true end doSetCreatureOutfit(cid, outfit, -1) end return true end Vermelho: function onStepIn(cid, item, frompos, item2, topos) local outfit = {lookType = 128, lookHead = 94, lookBody = 114, lookLegs = 114, lookFeet = 94, lookAddons = 3} if item.actionid == 5032 then if not isCreature(cid) then return true end doSetCreatureOutfit(cid, outfit, -1) end return true end
  17. Não. Só é necessário mexer nas coordenadas. Esse [1] é o valor da storage. Se quiser se orientar melhor sobre qual número é qual clan, siga a tabela que o Akumah postou logo acima.
  18. Suponho que não haja muita diferença, porém, melhor prevenir do que remediar. O script em si, pelo que vi, está funcionando direitinho. É só configurar corretamente no map editor.
  19. Pensei que você soubesse fazer ;/ jaja edito com a tag. <action actionid="xxx" event="script" value="arquivo.lua"/> Troque xxx pelo actionid da porta. Troque arquivo pelo nome do arquivo .lua com o conteúdo que passei acima.
  20. zipter98

    Script de war

    Só pra testar, veja se está mudando a outfit, e retirando no de saída. Blue team function onStepIn(cid, item, frompos, item2, topos) local outfit = {lookType = 128, lookHead = 88, lookBody = 114, lookLegs = 114, lookFeet = 88, lookAddons = 3} if item.actionid == 5031 then if not isCreature(cid) then return true end doSetCreatureOutfit(cid, outfit, -1) end return true end Saída function onStepIn(cid, item, frompos, item2, topos) if getCreatureCondition(cid, CONDITION_OUTFIT) then doRemoveCondition(cid, CONDITION_OUTFIT) end return true end
  21. Tenta upar seu char exatamente pra um dos levels da tabela: function onAdvance(cid, skill, oldLevel, newLevel) local t = { [100] = {items = {2160}, quantidade = {1}, storage = 110291}, [300] = {items = {2160, 12618}, quantidade = {3, 1}, storage = 110292}, [500] = {items = {2160, 12618}, quantidade = {5, 1}, storage = 110293}, } if skill == 8 then if t[newLevel] then item = t[newLevel].items quantidade = t[newLevel].quantidade for a, b in pairs(t) do if newLevel >= a and getPlayerStorageValue(cid, b.storage) < 1 then for i = 1, #item do doPlayerAddItem(cid, item[i], quantidade[i]) setPlayerStorageValue(cid, b.storage, 1) end end end end end return true end
  22. function onAdvance(cid, skill, oldLevel, newLevel) local t = { [100] = {items = {2160}, quantidade = {1}, storage = 110291}, [300] = {items = {2160, 12618}, quantidade = {3, 1}, storage = 110292}, [500] = {items = {2160, 12618}, quantidade = {5, 1}, storage = 110293}, } if t[newLevel] then item = t[newLevel].items quantidade = t[newLevel].quantidade end if skill == 8 then for a, b in pairs(t) do if newLevel >= a and getPlayerStorageValue(cid, b.storage) < 1 then for i = 1, #item do doPlayerAddItem(cid, item[i], quantidade[i]) setPlayerStorageValue(cid, b.storage, 1) end end end end return true end
  23. data/actions/scripts
  24. Este meu script está completo. A explicação, editei acima.
  • Quem Está Navegando   0 membros estão online

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