
Solutions
-
Kemmlly's post in (Resolvido)Script que o player dobra o exp was marked as the answerarquivo /data/creaturescripts/scripts/double.lua
function onLogin(cid) local storage = 998899 -- STORAGE QUE QUER USAR local xp = 2 -- QUANTIDADE QUE VAI MULTIPLICAR O XP if getPlayerStorageValue(cid, storage) == 1 then local rates = getPlayerRates(cid) doCreatureSay(cid, "Voce esta com o XP dobrado, aproveite!", TALKTYPE_ORANGE_1, true, cid) doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]*xp) end return true end tag /data/creaturescripts/creaturescripts.xml
<event type="login" name="double" event="script" value="double.lua"/>
-
Kemmlly's post in (Resolvido)NPC Promo Diferentes! was marked as the answer
-
Kemmlly's post in (Resolvido)Item Teleport No Mapa was marked as the answeractions/scripts/ crie um tpespelho.lua
function onUse(cid, item, frompos, topos) local tab = { pos = {x = 1017, y = 1020, z = 7} -- posição x, y, z do local a teleportar o player } if isPlayer(cid) then doTeleportThing(cid, tab.pos) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) doCreatureSay(cid, "Voce foi teleportado!", TALKTYPE_ORANGE_1) end end actions.xml
<action actionid="ACTION QUE VOCE ESCOLHER" event="script" value="tpespelho.lua"/> E não esqueça de adicionar a ACTIONID que você escolher no actions.xml no espelho que você quer.
-
Kemmlly's post in (Resolvido)Npc Quest was marked as the answerlocal 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) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid --[[ REMEMBER TO SET YOUR STORAGE AS YOURSTORAGE! ]]-- local storage = 100010 local tab = { item = {5920, 1}, -- {id do item que ele precia receber na primeira missao, quantidade} item2 = {5920, 1}, -- {id do item que ele vai dar, quantidade} item3 = {5920, 1}, -- {id do item que ele vai receber do Katum, quantidade} } if(msgcontains(msg, 'quest') or msgcontains(msg, 'slug')) then if(getPlayerStorageValue(cid, storage) < 1) then npcHandler:say("Hey, Eu perdi as minhas miniaturas no sub-solo.. voce poderia buscar para min? eu preciso de {5 dragon miniature}.", cid) setPlayerStorageValue(cid, storage, 1) elseif(getPlayerStorageValue(cid, storage) == 1) then npcHandler:say("Voce recuperou as 5 dragon miniature?", cid) talkState[talkUser] = 1 elseif(getPlayerStorageValue(cid, storage) > 1) then npcHandler:say("Desculpe voce ja fez essa quest.", cid) end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerItemCount(cid, tab.item[1]) >= tab.item[2] then doPlayerRemoveItem(cid, tab.item[1], tab.item[2]) npcHandler:say("Wow! Muito obrigado! tenho algo aqui de muito valor, e acredito que Katum gostaria de falar com voce!", cid) doPlayerAddItem(cid, tab.item2[1], tab.item2[2]) setPlayerStorageValue(cid, 100012, 0) setPlayerStorageValue(cid, storage, 2) talkState[talkUser] = 0 else npcHandler:say("Voce nao tem meus items, sinto muito.", cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'no') and talkState[talkUser] > 0) then npcHandler:say("entao ta..", cid) talkState[talkUser] = 0 elseif (msgcontains(msg, 'upgrade') and getPlayerStorageValue(cid, 100012) == 0) then if getPlayerItemCount(cid, tab.item3[1]) >= tab.item3[2] then npcHandler:say("Obrigado, agora posso terminar.", cid) doPlayerRemoveItem(cid, tab.item3[1], tab.item3[2]) setPlayerStorageValue(cid, 100012, 1) else npcHandler:say("Voce não pegou o item com o Katum, retorne quando tiver o item.", cid) end elseif (msgcontains(msg, 'upgrade') and getPlayerStorageValue(cid, 100012) == 1) then npcHandler:say("Nao ha upgrade disponivel, voce ja concluiu a tarefa.", cid) elseif (msgcontains(msg, 'upgrade') and getPlayerStorageValue(cid, 100012) < 0) then npcHandler:say("Voce deve completar a primeira missao para iniciar o upgrade.", cid) end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Acredito que seja assim, certo?
-
Kemmlly's post in (Resolvido)Npc Não carrega! was marked as the answerO problema não está no npc, quem faz a contagem é o segundo script, mas ele n tem erros, acabei de testar novamente, você lembrou de colocar a tag:
registerCreatureEvent(cid, "taskblazing") No login.lua? E se colocou, no creaturescripts.xml o nome está desse mesmo jeito aí?
-
Kemmlly's post in (Resolvido)Npc - Task e Teleport was marked as the answernpc.lua
local destino = {x = 1004, y = 1021, z = 7} -- Coordenadas do destino 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) local storageinicio = 8887 -- Storage que inicia a quest local storagequest = 8888 -- Storage da quest local storagemonstro = 8889 -- Storage que faz a contagem do monstro local monstro = "cyclops" -- Nome do monstro local quantidade = 300 -- Quantidade de monstros para terminar a task if (not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if (msgcontains(msg, 'the volcano')) and getPlayerStorageValue(cid, storageinicio) == 1 and getPlayerStorageValue(cid, storagequest) ~= 1 then local contagem = getPlayerStorageValue(cid, storagemonstro) if contagem == -1 then contagem = 1 end selfSay('Voce nao terminou sua tarefa ainda, falta matar '..string.sub((contagem)-(quantidade), 2)..' '..monstro..'. Complete sua tarefa e retorne aqui.', cid) elseif (msgcontains(msg, 'the volcano')) and getPlayerStorageValue(cid, storageinicio) ~= 1 then talkState[talkUser] = 1 selfSay('Nasci e vivia em The Volcano, porem fui traido por aqueles malditos isqueiros! Me expulsaram so porque eu utilizava um {tunel proibido} para acessar o continente..', cid) elseif msgcontains(msg, 'the volcano') and getPlayerStorageValue(cid, storagequest) == 1 then selfSay('Voce ja completou sua missao, serei eternamente grato, siga seu caminho em paz!', cid) elseif msgcontains(msg, 'tunel proibido') and talkState[talkUser] == 1 then talkState[talkUser] = 2 selfSay('Existe uma maneira de acessar nossa ilha por dentro do mar, um tunel interliga a ilha ao continente. Tenho uma proposta pra voce e posso te levar ate a ilha. Quer {saber mais} ?', cid) elseif msgcontains(msg, 'saber mais') and talkState[talkUser] == 2 then selfSay('Quero que elimine, mate, extermine, o maximo de Blazing Spirits possivel, quero ver essa raca cair e nao me importo com sua extincao. Se apagar 300 da minha especie, MENOS EU, ensinarei voce a acessar a montanha dentro da ilha, aumentando seu respaw e melhorando suas hunts. {aceita} ?', cid) talkState[talkUser] = 3 elseif msgcontains(msg, 'aceita') and talkState[talkUser] == 3 then talkState[talkUser] = 4 setPlayerStorageValue(cid, storageinicio, 1) setPlayerStorageValue(cid, storagemonstro, 0) selfSay('Acordo fechado! Volte aqui com as cinzas daqueles miseraveis. Se quiser ir agora para o The Volcano, sa falar {travel} ou {blazing}.', cid) elseif msgcontains(msg, 'travel') then doTeleportThing(cid, destino) selfSay('Boa viagem.', cid) else return false end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) npc.xml
<npc name="NOME DO NPC" script="data/npc/scripts/NORME DO ARQUIVO.lua" access="5" lookdir="1"> <health now="1000" max="1000"/> <look type="54" head="45" body="67" legs="79" feet="10" addons="1"/> <parameters> <parameter key="message_greet" value="Hmmm... sinto a sua vontade de mostrar sua força. Vim do {The Volcano} buscando pessoas como você." /> </parameters> </npc>
em creaturescripts/scripts, crie um arquivo taskblazing.lua
function onKill(cid, target, lastHit) local storageinicio = 8887 -- Storage que inicia a quest local storagequest = 8888 -- Storage da quest local storagemonstro = 8889 -- Storage que faz a contagem do monstro local monstro = "cyclops" -- Nome do monstro if(isMonster(target) == true) then local n = string.lower(getCreatureName(target)) if getPlayerStorageValue(cid, storageinicio) >= 1 and n == monstro then local contagem = getPlayerStorageValue(cid, storagemonstro) setPlayerStorageValue(cid, storagemonstro, contagem+1) if contagem >= 300 then setPlayerStorageValue(cid, storagequest, 1) end end end return true end em login.lua adicione a tag
registerCreatureEvent(cid, "taskblazing") creaturescripts.xml
<event type="kill" name="taskblazing" event="script" value="taskblazing.lua"/>
Se os storages que eu escolhi não estiverem sendo usado no seu ot, deixe eles no script, se quiser mudar, mude com atenção nos dois scripts para não haver erro.
Lembre-se de mudar o nome do bixo no local correto e de escrever o nome corretamente para a contagem ser feita. Altere também as coordenadas do local que você quer teleportar o player.
-
Kemmlly's post in (Resolvido)Erro na Task Magnus was marked as the answerPrimeiro vê se o script ta com o nome zezeniaa.lua mesmo ou tem alguma letra ou espaço a mais, vê se ele está realmente em data/npc/scripts, depois verifica se a extensão está .lua mesmo ou vc salvou em outra sem querer. Esse erro é quando o XML do NPC não acha o arquivo que você declarou em script="", acredito q um desse motivos seja o causador do problema.