Tudo que joadson postou
-
RESOLVIDO NPCs change sex/change name
Tente assim o 2° Pedido. 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 price = xxx --Preço para trocar o nome. local characters = {} --Configure nesta tabela os caracteres (ou palavras) proibidos. local delay = 5 --Tempo para o jogador ser desconectado após trocar o nome. if msgcontains(msg:lower(), "name") or msgcontains(msg:lower(), "change") then selfSay("Do you wanna change your name? It will cost {"..price.." gold}.", cid) talkState[talkUser] = 1 return true elseif msgcontains(msg:lower(), "yes") and talkState[talkUser] == 1 then if getPlayerMoney(cid) >= price then selfSay("OK, tell me your new name.", cid) talkState[talkUser] = 2 return true else selfSay("You do not have enough money.", cid) talkState[talkUser] = 0 return true end elseif talkState[talkUser] == 2 then local query = db.getResult("SELECT name FROM players") if query:getID() == -1 then selfSay("Database inexistent.", cid) talkState[talkUser] = 0 return true end repeat local name = query:getDataString("name") if msg == name then selfSay("This name is already in use.", cid) talkState[talkUser] = 0 return true end until not query:next() query:free() for i = 1, #characters do if msg:find(characters[i]) then selfSay("Sorry, this name isn't available.", cid) talkState[talkUser] = 0 return true end end db.executeQuery('UPDATE `'..sqlDatabase..'`.`players` SET `name` = "'..msg..'" WHERE `players`.`id` ='..getPlayerGUID(cid)' AND CONVERT( `players`.`name` USING utf8 ) = "'..old..'" LIMIT 1 ;') doPlayerRemoveMoney(cid, price) selfSay("You changed your name to {"..msg.."}. In "..delay.." second"..(delay > 1 and "s" or "")..", you will be disconected.", cid) addEvent(function() if isPlayer(cid) then doRemoveCreature(cid) end end, delay * 1000) talkState[talkUser] = 0 return true elseif msgcontains(msg:lower(), "no") and talkState[talkUser] == 1 then selfSay("Ok, bye.", cid) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
(Resolvido)Ajuda: como fazer task uma única vez
Okay, já sei onde modifcar... Breve edito aqui EDIT: Tente assim agora 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 task = { ["Zulu"] = {{"Gloom", 15}, {"Tangela", 5 }}, } if msgcontains(msg, 'task') or msgcontains(msg, 'Task') then if isMyTaskComplete(cid, getNpcCid()) then selfSay("Wow you have already complete my task! Ok then, take your reward!", cid) doPlayerAddExperience(cid, 80000) --premio doPlayerAddItem(cid, 11441, 2) doPlayerAddItem(cid, 11447, 2) doPlayerAddItem(cid, 11442, 2) doPlayerAddItem(cid, 11639, 1) local sto = getMyTaskSto(cid, getNpcCid()) setPlayerStorageValue(cid, sto, 3) setPlayerStorageValue(cid, 181603, 1) --storage da outfit talkState[talkUser] = 0 return true else selfSay("Then, is a simple task, i want to you kill {15 Gloom, 5 Tangela,}, you accept the task?", cid) talkState[talkUser] = 2 end elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'Yes')) and talkState[talkUser] == 2 then if getMyTaskSto(cid, getNpcCid()) ~= -1 then selfSay("You are already doing my task! go end it!", cid) talkState[talkUser] = 0 return true end local sto = getFreeTaskStorage(cid) if sto == -1 then selfSay("You can't catch more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid) talkState[talkUser] = 0 return true end selfSay("OK then... Go kill your targets!", cid) setStorageArray(cid, sto, task) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
(Resolvido)Ajuda: como fazer task uma única vez
Tente assim... 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 task = { ["Zulu"] = {{"Gloom", 15}, {"Tangela", 5 }}, } if msgcontains(msg, 'task') or msgcontains(msg, 'Task') then if isMyTaskComplete(cid, getNpcCid()) then selfSay("Wow you have already complete my task! Ok then, take your reward!", cid) doPlayerAddExperience(cid, 80000) --premio doPlayerAddItem(cid, 11441, 2) doPlayerAddItem(cid, 11447, 2) doPlayerAddItem(cid, 11442, 2) doPlayerAddItem(cid, 11639, 1) local sto = getMyTaskSto(cid, getNpcCid()) setPlayerStorageValue(cid, sto, -1) setPlayerStorageValue(cid, 181603, 1) --storage da outfit setPlayerStorageValue(cid, 182603, 2) talkState[talkUser] = 0 return true else selfSay("Then, is a simple task, i want to you kill {15 Gloom, 5 Tangela,}, you accept the task?", cid) talkState[talkUser] = 2 end elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'Yes')) and talkState[talkUser] == 2 then if getMyTaskSto(cid, getNpcCid()) ~= -1 then selfSay("You are already doing my task! go end it!", cid) talkState[talkUser] = 0 return true end if getPlayerStorageValue(cid, 182603) >= 2 then selfSay("You have finished all task", cid) end local sto = getFreeTaskStorage(cid) if sto == -1 then selfSay("You can't catch more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid) talkState[talkUser] = 0 return true end selfSay("OK then... Go kill your targets!", cid) setStorageArray(cid, sto, task) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
(Resolvido)[RESOLVIDO] [PEDIDO] TELEPORTAR TODOS OS PLAYERS ON-LINE
Aqui... Vá em talkaction/script e crie um arquivo chamado temple.lua e coloque o codigo abaixo function onSay(cid, words, param, channel) local temple = { x = 1000, y = 1000, z = 7 } for _, cid in ipairs(getPlayersOnline()) do doTeleportThing(cid, temple) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Todos Players foram teleportados para o templo.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) end return TRUE end e depois abra talkaction.xml e coloque isso dentro <talkaction access="4" words="!alltemple" event="script" value="temple.lua"/>
-
[HELP] Erro no distro
Realmente, esse erro é porque não encontrou o arquivo -1.lua dentro do diretorio. Você pode baixar o arquivo de algum server ou simplesmente criar um arquivo chamado -1.lua e fazer o teste.
- [AJUDEM] Systema de Cidade por RESET
-
(Resolvido)[ajuda] bug no npc de vocações supremas
Testei no TFS 0.3.7, mas o seu "antigo" funciona certo? Porem ao relogar, ele some a vocação? Irei modificar para nao sumir. EDIT: substitua seu vocationsupreme.lua por esse 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, 'voc suprem') or msgcontains(msg, 'voc suprem')) then selfSay('Deseja virar {Voc suprem} ?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if(getPlayerItemCount(cid, 142) >= 1) then doPlayerRemoveItem(cid, 142, 1) doPlayerSetVocation(cid, getPlayerVocation(cid) > 4 and getPlayerVocation(cid) + 4 or getPlayerVocation(cid) + 8) setPlayerStorageValue(cid, 35125, 1) -- Storage que vai checar se tem a 3° promotion ou nao. selfSay('Parabéns você acaba de completar Asgard.', cid) else selfSay('Você não tem {suprem vocation} suficientes.', cid) end talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) e depois vá em creaturescript/script e crie um arquivo chamado promote.lua e coloque isso dentro function onLogin(cid) if getPlayerStorageValue(cid,35125) >= 1 then if(isInArray({5, 6, 7, 8}, getPlayerVocation(cid))) then doPlayerSetVocation(cid, getPlayerVocation(cid) + 4) end end return TRUE end e em login.lua adicione isso registerCreatureEvent(cid, "Promotion") e em creatures.xml adicione. <event type="login" name="Promotion" event="script" value="promote.lua"/>
-
(Resolvido)Help na Script ''exevo gran trap''
Está infinito porque não tem a tag no items.xml procure por <item id="1498" article="a" name="magic wall"> e adicione isso <attribute key="duration" value="20"/> -- em vermelho é os segundos
- [PEDIDO] Name Tag (Esse item foi obtido por "Player tal".
- [PEDIDO] Name Tag (Esse item foi obtido por "Player tal".
-
[Ajuda]Dois Scripts
Aqui o change gold... vá em action/script e crie um arquivo chamado crystal.lua e cole o codigo abaixo function onUse(cid, item, frompos, item2, topos) if doRemoveItem(item.uid,1) then doPlayerSendTextMessage(cid,22,"You have changed 1 crystal coin to 100 platinum coins") doPlayerAddItem(cid,2152,100) end end e coloque isso em action.xml <action itemid="2160" script="crystal.lua" />
-
(Resolvido)[ajuda] bug no npc de vocações supremas
O problema é que a vocação volta ao relogar, certo? Irei adaptar o script com uma storage, assim ao relogar o player que tiver a storage, ganha a voc supreme... Tudo bem?
-
(Resolvido)[ajuda] bug no npc de vocações supremas
Não é pra alterar, esses 5,6,7,8 já sao a promotion e o + 4 no script é pra dar a 3° promotion... ou seja, 5+4 = 9(etc).... teste sem alterar o script. EDIT: Testei sem alterar o script e funcionou perfeitamente.
-
(Resolvido)[ajuda] bug no npc de vocações supremas
Você alterou if(isInArray({5, 6, 7, 8}, getPlayerVocation(cid))) then, para o numero da vocação? Porque esse script é para dar uma 3 promotion, caso seja a 2 promotion, coloque 1, 2, 3 e 4
-
Svar arena bugada.
Troque essa linha pillarItem:remove() por essa doRemoveItem(pillarItem.uid,1) e tente
-
Svar arena bugada.
Aqui, não sei se irá funcionar... Não tenho como testar. esse é o creatureevent. function onKill(cid, target) local targetMonster = Monster(target) if not targetMonster then return end local player = Player(cid) local pit = player:getStorageValue(Storage.SvargrondArena.Pit) if pit < 1 or pit > 10 then return end local arena = player:getStorageValue(Storage.SvargrondArena.Arena) if arena < 1 then return end if not isInArray(ARENA[arena].creatures, targetMonster:getName():lower()) then return end -- Remove pillar and create teleport local pillarTile = Tile(PITS[pitId].pillar) if pillarTile then local pillarItem = pillarTile:getItemById(SvargrondArena.itemPillar) if pillarItem then pillarItem:remove() local teleportItem = Game.createItem(SvargrondArena.itemTeleport, 1, PITS[pitId].tp) if teleportItem then teleportItem:setActionId(25200) end SvargrondArena.sendPillarEffect(pit) end end player:setStorageValue(Storage.SvargrondArena.Pit, pit + 1) player:say('Victory! Head through the new teleporter into the next room.', TALKTYPE_MONSTER_SAY) return true end
-
Svar arena bugada.
Irei reeditar o seu então, espero que resolva =D Breve eu posto aqui.
-
(Resolvido)[ajuda] bug no npc de vocações supremas
Fiz uma pequena modificação, espero que resolva seu problema. 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, 'voc suprem') or msgcontains(msg, 'voc suprem')) then selfSay('Deseja virar {Voc suprem} ?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if(getPlayerItemCount(cid, 142) >= 1) then doPlayerRemoveItem(cid, 142, 1) if(isInArray({5, 6, 7, 8}, getPlayerVocation(cid))) then -- id das vocation doPlayerSetVocation(cid, getPlayerVocation(cid) + 4) selfSay('Parabéns você acaba de completar Asgard.', cid) else selfSay('Você não tem {suprem vocation} suficientes.', cid) end talkState[talkUser] = 0 end return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Svar arena bugada.
Porque não faz por uniqueID nos portais? assim não precisa remover as pedras.
-
NPC ! Ajuda Urgente...
Aqui... Vaá em creaturescript/script e crie um arquivo chamado reward e coloque isso dentro function onDeath(cid, corpse, deathList) if isPlayer(cid) and isPlayer(deathList[1]) then local v = { rewardid = 5925, -- Mude aqui para o ID do item pos = getCreaturePosition(cid), } local reward = doPlayerAddItem(deathList[1], v.rewardid, 1) end return true end e em creaturescript.xml coloque <event type="death" name="Reward" event="script" value="reward.lua"/> depois abra login.lua e colque registerCreatureEvent(cid, "Reward")
-
(Resolvido)[ajuda] bug no npc de vocações supremas
Você mudou a pasta lib do NPC? dá algum erro no distro?
-
Colocar itens inicias como unic item
Veja se é isso que você quer. Vá em action/script e crie um arquivo chamado kina.lua e coloque o codigo abaixo function onUse(cid, item, frompos, item2, topos) if item.uid == 3090 then queststatus = getPlayerStorageValue(cid,3090) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Você encontrou seu bonus de knight!.") doPlayerAddItem(cid,7390,1) -- Mude 7390 para o ID do item e o 1 é a quantidade, para adicionar mais itens, é só copiar doPlayerAddItem(cid,7390,1) e acrescentar em baixo setPlayerStorageValue(cid,3090,1) else doPlayerSendTextMessage(cid,22,"Você ja ganhou este bonus!") end else return 0 end return 1 end e em action.xml coloque. <action uniqueid="3090" script="kina.lua" /> e pelo RME colocar uniqueID 3090 nos bau de kina e para criar para outra vocação, mude só o 3090 para 3091, 3092 etc... EDIT: se quiser te passo um script de porta, ou coloco so pra tal vocação poder abrir o bau
-
(Resolvido)Error no RME
Problema solucionado... Tive que formatar o PC
-
(Resolvido)Error no RME
Acontece logo apos um mapa ou clicar em "new"... é tibia normal. Edit: Ahh, como tenho dois sistemas op. fui testar no win8 e abriu normal
-
(Resolvido)[ PEDIDO ] Portinhas Por profissão
Qual é o erro que dá? é só você mudar os numero das vocações