Tudo que anderkrox postou
-
Newsticker announcer para TFS 1.x
function onThink(interval, lastExecution) local result = db.storeQuery("SELECT text FROM `z_news_tickers` ORDER by date DESC LIMIT 0,5") local sorteado = math.random(1, 5) local news = {} if result:getID() == -1 then return false end repeat if result:getID() ~= -1 then table.insert(news, result:getDataString("text")) end until not result:next() if not news[sorteado] then return false end doBroadcastMessage("News: " .. string.sub(news[sorteado], 1, 150) .. "", MESSAGE_EVENT_ADVANCE) return true end
-
Storage
Simples, adicione no login.lua um comando para dar a storage. Se estiver usando TFS 1.0+ use: player:setStorageValue(10205, 1) Se estiver usando versões anteriores: setPlayerStorageValue(cid, 10205, 1)
-
Anuncio
Vou ser bem direto. Não querem vender o espaço do anuncio!? Já mandei pedido por e-mail, já mandei pedido por mensagem privada e já conversei por Whatsapp. Cade as respostas? Desde semana passada nessa enrolação. Nota 0 para vocês! Eu quero anunciar.
-
Script look verificar reputação.
local function getDeathsAndKills(cid, type) -- by vodka local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0 if query:getID() ~= -1 then repeat d = d + 1 until not query:next() query:free() end return d end end local function getPoints(cid) local Info = db.getResult("SELECT `rep` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";") local s = Info:getDataInt("s") Info:free() return s end if s <= -20 then x = "GranBigNoob" elseif s <= -10 then x = "Big Noob" elseif s <= -1 then x = "Noob" elseif s == 0 then x = "Citizen" elseif s >= 1 then x = "Avowed" elseif s >= 10 and s < 20 then x = "Respected" elseif s >= 20 and s < 30 then x = "Sagaz" elseif s >= 30 and s < 40 then x = "Domination" elseif s >= 40 and s < 20 then x = "Bloodbath" elseif s >= 50 then x = "Legendary" end if isPlayer(thing.uid) then doPlayerSetSpecialDescription(thing.uid, "\n".. (getPlayerSex(thing.uid) == 0 and "Ela" or "Ele") .." ja Matou: [".. getDeathsAndKills(thing.uid, "kill") .."] Players.\n".. (getPlayerSex(thing.uid) == 0 and "Ela" or "Ele") .." ja Morreu: [".. getDeathsAndKills(thing.uid, "death") .."] Vezes.\nReputação: ".. getPoints .." (".. x ..")." ) end end function onLook(cid, thing, position, lookDistance) return getPoints(cid) end Deixa assim e me mostra o que acontece.
-
[Pedido] Tile de battle
Tenta agora: function onStepIn(cid, item, position, fromPosition) if isPlayer(cid) == true then if ((isPlayerPzLocked(cid) == true) or (getCreatureCondition(cid, CONDITION_INFIGHT) == true)) then doTeleportThing(cid, fromPosition, true) doPlayerSendCancel(cid, "Elimine o monstro, e espere o pz.") else return true end else return true end end
-
Script look verificar reputação.
local function getDeathsAndKills(cid, type) -- by vodka local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0 if query:getID() ~= -1 then repeat d = d + 1 until not query:next() query:free() end return d end end local function getPoints(cid) local Info = db.getResult("SELECT `rep` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";") local s = Info:getDataInt("s") Info:free() return s end if s <= -20 then x = "GranBigNoob" elseif s <= -10 then x = "Big Noob" elseif s <= -1 then x = "Noob" elseif s == 0 then x = "Citizen" elseif s >= 1 then x = "Avowed" elseif s >= 10 and s < 20 then x = "Respected" elseif s >= 20 and s < 30 then x = "Sagaz" elseif s >= 30 and s < 40 then x = "Domination" elseif s >= 40 and s < 20 then x = "Bloodbath" elseif s >= 50 then x = "Legendary" end if isPlayer(thing.uid) then doPlayerSetSpecialDescription(thing.uid, "\n ".. (getPlayerSex(thing.uid) == 0 and "Ela" or "Ele") .." ja Matou: [".. getDeathsAndKills(thing.uid, "kill") .."] Players.\n ".. (getPlayerSex(thing.uid) == 0 and "Ela" or "Ele") .." ja Morreu: [".. getDeathsAndKills(thing.uid, "death") .."] Vezes.\n Reputação: ".. getPoints .." (".. x ..")." ) end end function onLook(cid, thing, position, lookDistance) return getPoints(cid) end
-
[Globalevents] unexpected symbol near 'á'
Meu anexo foi feito no editor chamado sublime. Da uma pesquisada no google, é muito bom!
-
[ AJUDA ~~ SCRIPTS CONTRA MAGEBOMB
Vá no config.lua e procure por loginProtectionPeriod, deixe o mesmo assim: loginProtectionPeriod = 10 * 1000 Isto fará com que cada personagem com o mesmo IP tenha um intervalo de 10 segundos para fazer o login no servidor. É tempo suficiente para perceber um magebomb, mas se preferir, pode usar esse script abaixo, o mesmo fará com que só 2 personagens no mesmo IP possam entrar. function onLogin(cid) local config = { maximoPermitidoPorIp = 2, -- Quantidade máxima de personagens permitida por IP. } function deslogar(cid) local count, on = 0, getPlayersOnline() if #on > 0 then for i = 1, #on do if getPlayerIp(on[i]) == getPlayerIp(cid) then count = count + 1 end end if count > config.maximoPermitidoPorIp then doRemoveCreature(cid) end end return true end addEvent(deslogar, 500, cid) return true end
-
(Urgente) Help
Cria um arquivo em creaturescript e poem como penalidade uma perda de experiência. Assim a hora que matar alguém com o mesmo IP, irá ganhar a experiência por causa do servidor, mas ao mesmo tempo irá perder determinada experiência por causa do script feito em .lua Nunca testei adicionar experiência ao jogador de modo negativo, mas vale tentar: function onKill(cid, target) if ((isPlayer(cid) == true) and (isPlayer(target) == true)) then if getPlayerIp(cid) == getPlayerIp(target) then doPlayerAddExp(cid, getExperienceForLevel(getPlayerLevel(cid))*-1) end end return true end
-
Duvida Script do Utito Tempo San
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, 10000) setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCEPERCENT, 150) setConditionParam(condition, CONDITION_PARAM_BUFF, true) setCombatCondition(combat, condition) local speed = createConditionObject(CONDITION_PARALYZE) setConditionParam(speed, CONDITION_PARAM_TICKS, 10000) setConditionFormula(speed, -0.7, 56, -0.7, 56) setCombatCondition(combat, speed) local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_SUBID, 2) setConditionParam(exhaust, CONDITION_PARAM_TICKS, 10000) setCombatCondition(combat, exhaust) function onCastSpell(cid, var) return doCombat(cid, combat, var) end Onde está escrito: setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCEPERCENT, 150) Significa que na hora que pronunciar a magia, o servidor fará um calculo assim: (SKILL_DE_DISTÂNCIA / 100) * 150; Porque no script original está 150, ou seja, se eu estiver skill 70 e pronunciar a magia, vai acontecer isso: (70/100) * 150 = 105; Meu skill irá para 105, simples né? Pode altera o 150 para outro valor, por exemplo 200.
-
[Globalevents] unexpected symbol near 'á'
Olha, o script parece correto e se mesmo formatando não deu certo. Tente isto: function onThink(cid, interval, lastExecution) local pos = { templo = {x = 160, y = 54, z = 7}, -- Templo teleports = {x = 1096, y = 1063, z = 7}, -- Teleportes vip = {x = 1096, y = 1063, z = 7}, -- Área VIP } local cores = {205, 210} doSendAnimatedText(pos.templo, "Templo", cores[math.random(#cores)]) doSendAnimatedText(pos.teleports, "Teleports", cores[math.random(#cores)]) doSendMagicEffect(pos.teleports, 39) doSendAnimatedText(pos.vip, "Area Vip", cores[math.random(#cores)]) local efeitos = {39, 10} doSendMagicEffect(pos.vip, efeitos[math.random(#efeitos)]) return true end Ou se preferir, podes baixar o anexo que estou postando junto. falantes.lua
-
[ AJUDA ~~ SCRIPTS CONTRA MAGEBOMB
O que é mb? Seria mage bot, ou mage bomb?
-
Script The oracle (pedido)
Tente este: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 oracle(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end local cityNode = node:getParent():getParent() local vocNode = node:getParent() local destination = cityNode:getParameters().destination local town = cityNode:getParameters().town local vocation = vocNode:getParameters().vocation if(destination ~= nil and vocation ~= nil and town ~= nil) then if(getPlayerLevel(cid) < parameters.level) then npcHandler:say('You must first reach level ' .. parameters.level .. '!', cid) npcHandler:resetNpc() else if(getPlayerVocation(cid) > ) then npcHandler:say('Sorry, You already have a vocation!') npcHandler:resetNpc() else doPlayerSetVocation(cid, vocation) doPlayerSetTown(cid, town) npcHandler:resetNpc() local tmp = getCreaturePosition(cid) doTeleportThing(cid, destination) doSendMagicEffect(tmp, CONST_ME_POFF) doSendMagicEffect(destination, CONST_ME_TELEPORT) end end end return true end function greetCallback(cid) if(getPlayerLevel(cid) < 8) then npcHandler:say('COME BACK WHEN YOU GROW UP, CHILD!') return false else return true end end npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|. Are you prepared to face your destiny?') local yesNode = KeywordNode:new({'yes'}, oracle, {level = 8}) local noNode = KeywordNode:new({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then what vocation do you want to become?'}) local node1 = keywordHandler:addKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'What city do you wish to live in? {Rhyves}, {Varak} or {Jorvik}?'}) local node2 = node1:addChildKeyword({'varak'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, town = 1, destination = {x=242, y=429, z=12}, text = 'Varak, eh? So what vocation do you wish to become? {Sorcerer}, {druid}, {paladin} or {knight}?'}) local node3 = node2:addChildKeyword({'sorcerer'}, StdModule.say, {npcHandler = npcHandler, vocation = 1, onlyFocus = true, text = 'So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) node3 = node2:addChildKeyword({'druid'}, StdModule.say, {npcHandler = npcHandler, vocation = 2, onlyFocus = true, text = 'Are you sure that a druid is what you wish to become? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) node3 = node2:addChildKeyword({'paladin'}, StdModule.say, {npcHandler = npcHandler, vocation = 3, onlyFocus = true, text = 'A ranged marksman. Are you sure? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) node3 = node2:addChildKeyword({'knight'}, StdModule.say, {npcHandler = npcHandler, vocation = 4, onlyFocus = true, text = 'A mighty warrior. Is that your final decision? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) node2 = node1:addChildKeyword({'rhyves'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, town = 1, destination = {x=159, y=387, z=6}, text = 'Rhyves, eh? So what vocation do you wish to become? {Sorcerer}, {druid}, {paladin} or {knight}?'}) node3 = node2:addChildKeyword({'sorcerer'}, StdModule.say, {npcHandler = npcHandler, vocation = 1, onlyFocus = true, text = 'So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) node3 = node2:addChildKeyword({'druid'}, StdModule.say, {npcHandler = npcHandler, vocation = 2, onlyFocus = true, text = 'Are you sure that a druid is what you wish to become? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) node3 = node2:addChildKeyword({'paladin'}, StdModule.say, {npcHandler = npcHandler, vocation = 3, onlyFocus = true, text = 'A ranged marksman. Are you sure? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) node3 = node2:addChildKeyword({'knight'}, StdModule.say, {npcHandler = npcHandler, vocation = 4, onlyFocus = true, text = 'A mighty warrior. Is that your final decision? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) node2 = node1:addChildKeyword({'jorvik'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, town = 1, destination = {x=469, y=172, z=7}, text = 'Jorvik, eh? So what vocation do you wish to become? {Sorcerer}, {druid}, {paladin} or {knight}?'}) node3 = node2:addChildKeyword({'sorcerer'}, StdModule.say, {npcHandler = npcHandler, vocation = 1, onlyFocus = true, text = 'So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) node3 = node2:addChildKeyword({'druid'}, StdModule.say, {npcHandler = npcHandler, vocation = 2, onlyFocus = true, text = 'Are you sure that a druid is what you wish to become? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) node3 = node2:addChildKeyword({'paladin'}, StdModule.say, {npcHandler = npcHandler, vocation = 3, onlyFocus = true, text = 'A ranged marksman. Are you sure? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) node3 = node2:addChildKeyword({'knight'}, StdModule.say, {npcHandler = npcHandler, vocation = 4, onlyFocus = true, text = 'A mighty warrior. Is that your final decision? This decision is irreversible!'}) node3:addChildKeywordNode(yesNode) node3:addChildKeywordNode(noNode) keywordHandler:addKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Then come back when you are ready.'}) npcHandler:addModule(FocusModule:new()) E se não funcionar na versão 1.2, use este, mas o anterior é mais fácil de configurar: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local vocation = {} local town = {} local destination = {} 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 local function greetCallback(cid) local player = Player(cid) local level = player:getLevel() if level < 8 then npcHandler:say("CHILD! COME BACK WHEN YOU HAVE GROWN UP!", cid) return false elseif level > 9 then npcHandler:say(player:getName() .. ", I CAN'T LET YOU LEAVE - YOU ARE TOO STRONG ALREADY! YOU CAN ONLY LEAVE WITH LEVEL 9 OR LOWER.", cid) return false elseif player:getVocation():getId() > then npcHandler:say("YOU ALREADY HAVE A VOCATION!", cid) return false end return true end local function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end if msgcontains(msg, "yes") and npcHandler.topic[cid] == then npcHandler:say("IN WHICH TOWN DO YOU WANT TO LIVE: {RHYVES}?", cid) npcHandler.topic[cid] = 1 elseif npcHandler.topic[cid] == 1 then if msgcontains(msg, "rhyves") then town[cid] = 2 destination[cid] = Position(159, 387, 6) npcHandler:say("IN RHYVES! AND WHAT PROFESSION HAVE YOU CHOSEN: {KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid) npcHandler.topic[cid] = 2 else npcHandler:say("IN WHICH TOWN DO YOU WANT TO LIVE: {RHYVES}?", cid) end elseif npcHandler.topic[cid] == 2 then if msgcontains(msg, "sorcerer") then npcHandler:say("A SORCERER! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!", cid) npcHandler.topic[cid] = 3 vocation[cid] = 1 elseif msgcontains(msg, "druid") then npcHandler:say("A DRUID! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!", cid) npcHandler.topic[cid] = 3 vocation[cid] = 2 elseif msgcontains(msg, "paladin") then npcHandler:say("A PALADIN! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!", cid) npcHandler.topic[cid] = 3 vocation[cid] = 3 elseif msgcontains(msg, "knight") then npcHandler:say("A KNIGHT! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!", cid) npcHandler.topic[cid] = 3 vocation[cid] = 4 else npcHandler:say("{KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid) end elseif npcHandler.topic[cid] == 3 then if msgcontains(msg, "yes") then local player = Player(cid) npcHandler:say("SO BE IT!", cid) player:setVocation(Vocation(vocation[cid])) player:setTown(Town(town[cid])) local destination = destination[cid] npcHandler:releaseFocus(cid) player:teleportTo(destination) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) destination:sendMagicEffect(CONST_ME_TELEPORT) else npcHandler:say("THEN WHAT? {KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid) npcHandler.topic[cid] = 2 end end return true end local function onAddFocus(cid) town[cid] = vocation[cid] = destination[cid] = end local function onReleaseFocus(cid) town[cid] = nil vocation[cid] = nil destination[cid] = nil end npcHandler:setCallback(CALLBACK_ONADDFOCUS, onAddFocus) npcHandler:setCallback(CALLBACK_ONRELEASEFOCUS, onReleaseFocus) npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
[PEDIDO] Vip Account Inicial
Só complementando o script anterior, postado originalmente por eliaszinho. Coloquei opção de escolher se o sistema é por VIP, ou por PREMIUM. function onLogin(cid) local config = { diasDeVip = 3, -- Quantidade de dias VIP tipoDeSistema = "VIP", -- Deve escolher entre VIP, ou PREMIUM } local storage = (getPlayerAccountId(cid)+550) if getGlobalStorageValue(storage) <= then setGlobalStorageValue(storage, 1) if getBooleanFromString(config.tipoDeSistema) == "VIP" then addVipDays(cid, config.diasDeVip) elseif getBooleanFromString(config.tipoDeSistema) == "PREMIUM" then doPlayerAddPremiumDays(cid, config.diasDeVip) else print("Deve escolher entre VIP, ou PREMIUM.") end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Recebeu ".. config.diasDeVip .." dias de vantagens, bom jogo!") end return true end
-
Colocar aleatoriedade
Tenta usar assim: local msgs = { "Eu sou uma mensagem", "Eu sou outra mensagem", "Ah, eu tambem!", "Legal, mas tambem sou uma mensagem...", } gems = { id = {2154, 2156, 2158, 2153, 2154, 2156, 2158, 2153}, storage = {5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008}, interval = {600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600} } gemMsg = { colorDruid = {180,180}, colorSorcerer = {30,215}, colorPaladin = {251,10}, colorKnight = {204,212}, colorElderDruid = {180,180}, colorMasterSorcerer = {30,215}, colorRoyalPaladin = {251,10}, colorEliteKnight = {204,212} } function doRemoveGemEffect(cid) local voc = getPlayerVocation(cid) if getPlayerPromotionLevel(cid) > then voc = voc - (getPlayerPromotionLevel(cid) * 2) end end function doUseGem(cid, item) local level = getPlayerLevel(cid) local voc = getPlayerVocation(cid) local interval = gems.interval[voc] if getPlayerPromotionLevel(cid) > then voc = voc - (getPlayerPromotionLevel(cid) * 2) end if item.itemid ~= gems.id[voc] or getPlayerStorageValue(cid, gems.storage[voc]) > then return false end setPlayerStorageValue(cid, gems.storage[voc], 1) sendGemEffect(cid, gems.storage[voc], gems.interval[voc]) doRemoveItem(item.uid, 1) return true end function sendGemEffect(cid, storage, interval) if isPlayer(cid) then local pos = getThingPos(cid) local voc = getPlayerVocation(cid) local level = getPlayerLevel(cid) local color = 1 if level > 199 then if getPlayerPromotionLevel(cid) > then voc = voc - (getPlayerPromotionLevel(cid) * 2) end if voc == 1 then color = gemMsg.colorDruid[math.random(1,#gemMsg.colorElderDruid)] elseif voc == 2 then color = gemMsg.colorSorcerer[math.random(1,#gemMsg.colorMasterSorcerer)] elseif voc == 3 then color = gemMsg.colorPaladin[math.random(1,#gemMsg.colorRoyalPaladin)] elseif voc == 4 then color = gemMsg.colorKnight[math.random(1,#gemMsg.colorEliteKnight)] end doSendAnimatedText(pos, msgs[math.random(#msgs)], color) if getPlayerStorageValue(cid, gems.storage[voc]) >= 1 then addEvent(sendGemEffect, interval, cid, storage, interval) end else stopEvent(sendGemEffect(cid, storage, interval)) end end function isGemActivated(cid) local voc = getPlayerVocation(cid) if getPlayerPromotionLevel(cid) > then voc = voc - (getPlayerPromotionLevel(cid) * 2) end if getPlayerStorageValue(cid, gems.storage[voc]) > then return true end return false end return true end
-
[Pedido] Tile de battle
Nesse caso deve ser StepIn, e pelo que percebi, tu não usa TFS 1.x, então segue: function onStepIn(cid, item, position, fromPosition) if isPlayer(cid) == true then if isPlayerPzLocked(cid) == true then doTeleportThing(cid, fromPosition, true) doPlayerSendCancel(cid, "Elimine o monstro, e espere o pz.") else return true end else return true end return true end
-
ERROR: Failed to load motd!
Posta como está o teu config.lua
-
RPG - Royal Fufu
E aqui vai um vídeo demostrando: https://www.youtube.com/watch?v=PwXeV-Nctig
-
RPG - Royal Fufu
Tu já pensou em criar um NPC com inteligencia artificial? Eu pensei, e criei! Este NPC que eu criei vai andar até determinado local e voltar. Também irá falar frases divertidas automaticamente. Na rota que o NPC fará, ele irá parar em uma caixa e irá "abri-la". O script ficou consideravelmente grande, porque não tenho muitas habilidades nesta área, mas estou partilhando para melhorias. No mapa do meu servidor, o NPC anda entre dois pontos que eu determinei. Em cada ponto terá uma caixa... ele irá olhar para uma e ira "abrir", depois de um tempo ele andará novamente até a outra caixa e irá "abrir". Como se estivesse levando produtos de uma caixa para a outra. Em fim, o script está funcionando 100%. Eu uso no meu servidor, e estou partilhando para melhorias no mesmo! No npc.lua poste este código: -- [[ Feito por Anderson (BomBa)]] waypoint_royalFufu = 971714008 local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local msgs = { "Que meus inimigos sejam fortes e bravos para que eu nao sinta remorsos ao derrota-los", "Voce deve se fazer uma pergunta: 'Estou com sorte?", "Nunca se ouviu dizer que filho valente tivera nascido de pai temeroso.", "Nunca comece uma briga, mas sempre a termine.", "Eu me pergunto qual seria melhor, ser temido ou respeitado? Seria de mais pedir os dois. ", } 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 local function greet(cid) return false end function onThink() local pos = getCreaturePosition(getNpcCid()) -- indo if getGlobalStorageValue(waypoint_royalFufu) <= 0 then doTeleportThing(getNpcCid(), {x=1011, y=1357, z=6}, true) setGlobalStorageValue(waypoint_royalFufu, 1) elseif getGlobalStorageValue(waypoint_royalFufu) == 1 then doTeleportThing(getNpcCid(), {x=1010, y=1357, z=6}, true) setGlobalStorageValue(waypoint_royalFufu, 2) elseif getGlobalStorageValue(waypoint_royalFufu) == 2 then doTeleportThing(getNpcCid(), {x=1009, y=1357, z=6}, true) setGlobalStorageValue(waypoint_royalFufu, 3) elseif getGlobalStorageValue(waypoint_royalFufu) == 3 then doTeleportThing(getNpcCid(), {x=1008, y=1357, z=6}, true) setGlobalStorageValue(waypoint_royalFufu, 4) elseif getGlobalStorageValue(waypoint_royalFufu) == 4 then doTeleportThing(getNpcCid(), {x=1007, y=1357, z=6}, true) setGlobalStorageValue(waypoint_royalFufu, 5) elseif getGlobalStorageValue(waypoint_royalFufu) == 5 then doTeleportThing(getNpcCid(), {x=1006, y=1357, z=6}, true) setGlobalStorageValue(waypoint_royalFufu, 6) elseif getGlobalStorageValue(waypoint_royalFufu) == 6 then doTeleportThing(getNpcCid(), {x=1005, y=1357, z=6}, true) setGlobalStorageValue(waypoint_royalFufu, 7) elseif getGlobalStorageValue(waypoint_royalFufu) == 7 then doTeleportThing(getNpcCid(), {x=1005, y=1358, z=6}, true) setGlobalStorageValue(waypoint_royalFufu, 8) elseif getGlobalStorageValue(waypoint_royalFufu) == 8 then doTeleportThing(getNpcCid(), {x=1005, y=1360, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 9) elseif getGlobalStorageValue(waypoint_royalFufu) == 9 then doTeleportThing(getNpcCid(), {x=1005, y=1361, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 10) elseif getGlobalStorageValue(waypoint_royalFufu) == 10 then doTeleportThing(getNpcCid(), {x=1005, y=1362, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 11) elseif getGlobalStorageValue(waypoint_royalFufu) == 11 then doTeleportThing(getNpcCid(), {x=1005, y=1363, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 12) elseif getGlobalStorageValue(waypoint_royalFufu) == 12 then doTeleportThing(getNpcCid(), {x=1005, y=1364, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 13) elseif getGlobalStorageValue(waypoint_royalFufu) == 13 then doTeleportThing(getNpcCid(), {x=1005, y=1365, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 14) elseif getGlobalStorageValue(waypoint_royalFufu) == 14 then doTeleportThing(getNpcCid(), {x=1005, y=1366, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 15) elseif getGlobalStorageValue(waypoint_royalFufu) == 15 then doTeleportThing(getNpcCid(), {x=1005, y=1367, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 16) elseif getGlobalStorageValue(waypoint_royalFufu) == 16 then doTeleportThing(getNpcCid(), {x=1006, y=1367, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 17) elseif getGlobalStorageValue(waypoint_royalFufu) == 17 then doTeleportThing(getNpcCid(), {x=1007, y=1367, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 18) elseif getGlobalStorageValue(waypoint_royalFufu) == 18 then doTeleportThing(getNpcCid(), {x=1008, y=1367, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 19) elseif getGlobalStorageValue(waypoint_royalFufu) == 19 then doTeleportThing(getNpcCid(), {x=1008, y=1366, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 20) elseif getGlobalStorageValue(waypoint_royalFufu) == 20 then doTeleportThing(getNpcCid(), {x=1008, y=1365, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 21) elseif getGlobalStorageValue(waypoint_royalFufu) == 21 then doTeleportThing(getNpcCid(), {x=1008, y=1364, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 22) elseif getGlobalStorageValue(waypoint_royalFufu) == 22 then doTeleportThing(getNpcCid(), {x=1008, y=1363, z=7}, true) doCreatureSetLookDir(getNpcCid(), WEST) addEvent(setGlobalStorageValue, 20000, waypoint_royalFufu, 23) -- voltando elseif getGlobalStorageValue(waypoint_royalFufu) == 23 then doTeleportThing(getNpcCid(), {x=1008, y=1364, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 24) elseif getGlobalStorageValue(waypoint_royalFufu) == 24 then doTeleportThing(getNpcCid(), {x=1008, y=1365, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 25) elseif getGlobalStorageValue(waypoint_royalFufu) == 25 then doTeleportThing(getNpcCid(), {x=1008, y=1366, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 26) elseif getGlobalStorageValue(waypoint_royalFufu) == 26 then doTeleportThing(getNpcCid(), {x=1008, y=1367, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 27) elseif getGlobalStorageValue(waypoint_royalFufu) == 27 then doTeleportThing(getNpcCid(), {x=1007, y=1367, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 28) elseif getGlobalStorageValue(waypoint_royalFufu) == 28 then doTeleportThing(getNpcCid(), {x=1006, y=1367, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 29) elseif getGlobalStorageValue(waypoint_royalFufu) == 29 then doTeleportThing(getNpcCid(), {x=1005, y=1367, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 30) elseif getGlobalStorageValue(waypoint_royalFufu) == 30 then doTeleportThing(getNpcCid(), {x=1005, y=1366, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 31) elseif getGlobalStorageValue(waypoint_royalFufu) == 31 then doTeleportThing(getNpcCid(), {x=1005, y=1365, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 32) elseif getGlobalStorageValue(waypoint_royalFufu) == 32 then doTeleportThing(getNpcCid(), {x=1005, y=1364, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 33) elseif getGlobalStorageValue(waypoint_royalFufu) == 33 then doTeleportThing(getNpcCid(), {x=1005, y=1363, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 34) elseif getGlobalStorageValue(waypoint_royalFufu) == 34 then doTeleportThing(getNpcCid(), {x=1005, y=1362, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 35) elseif getGlobalStorageValue(waypoint_royalFufu) == 35 then doTeleportThing(getNpcCid(), {x=1005, y=1361, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 36) elseif getGlobalStorageValue(waypoint_royalFufu) == 36 then doTeleportThing(getNpcCid(), {x=1005, y=1360, z=7}, true) setGlobalStorageValue(waypoint_royalFufu, 37) elseif getGlobalStorageValue(waypoint_royalFufu) == 37 then doTeleportThing(getNpcCid(), {x=1005, y=1358, z=6}, true) setGlobalStorageValue(waypoint_royalFufu, 38) elseif getGlobalStorageValue(waypoint_royalFufu) == 38 then doTeleportThing(getNpcCid(), {x=1006, y=1358, z=6}, true) setGlobalStorageValue(waypoint_royalFufu, 39) elseif getGlobalStorageValue(waypoint_royalFufu) == 39 then doTeleportThing(getNpcCid(), {x=1007, y=1358, z=6}, true) setGlobalStorageValue(waypoint_royalFufu, 40) elseif getGlobalStorageValue(waypoint_royalFufu) == 40 then doTeleportThing(getNpcCid(), {x=1008, y=1358, z=6}, true) setGlobalStorageValue(waypoint_royalFufu, 41) elseif getGlobalStorageValue(waypoint_royalFufu) == 41 then doTeleportThing(getNpcCid(), {x=1009, y=1358, z=6}, true) setGlobalStorageValue(waypoint_royalFufu, 42) elseif getGlobalStorageValue(waypoint_royalFufu) == 42 then doTeleportThing(getNpcCid(), {x=1010, y=1357, z=6}, true) doCreatureSetLookDir(getNpcCid(), SOUTH) addEvent(setGlobalStorageValue, 20000, waypoint_royalFufu, 0) end -- falas local falarA = math.random(1, 100000) if falarA <= 500 then doCreatureSay(getNpcCid(), msgs[math.random(#msgs)], TALKTYPE_SAY) end return true end npcHandler:addModule(FocusModule:new()) npcHandler:setCallback(CALLBACK_GREET, greet) E em globalevents, procure por 'init.lua', então adicione esta linha: setGlobalStorageValue(waypoint_royalFufu, 0)