Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''action''.

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • xTibia - Notícias e Suporte
    • Regras
    • Noticias
    • Soluções
    • Projetos Patrocinados
    • Tutoriais para Iniciantes
    • Imprensa
  • OTServ
    • Notícias e Debates
    • OTServlist
    • Downloads
    • Recursos
    • Suporte
    • Pedidos
    • Show-Off
    • Tutoriais
  • OFF-Topic
    • Barzinho do Éks
    • Design
    • Informática

Encontrar resultados em...

Encontrar resultados que contenham...


Data de Criação

  • Início

    FIM


Data de Atualização

  • Início

    FIM


Filtrar pelo número de...

Data de Registro

  • Início

    FIM


Grupo


Sou

  1. Eu estou tentando fazer um action de alavanca para uma anihi nova com 6 players, mas não to conseguindo fazer funcionar. Eu só quero que funcione a alavanca quando puxa-la levar os players para a sala com os monstros. Meu script ta assim: local config = { daily = "no", level = 325, storage = 2239 } local playerPosition = { {x = 3988, y = 1840, z = 9}, {x = 3987, y = 1840, z = 9}, {x = 3986, y = 1840, z = 9}, {x = 3985, y = 1840, z = 9}, {x = 3984, y = 1840, z = 9}, {x = 3983, y = 1840, z = 9} } local newPosition = { {x = 3989, y = 1811, z = 9}, {x = 3988, y = 1811, z = 9}, {x = 3987, y = 1811, z = 9}, {x = 3986, y = 1811, z = 9}, {x = 3985, y = 1811, z = 9}, {x = 3984, y = 1811, z = 9} } -- Do not modify the declaration lines below. local players = {} local failed = true config.daily = getBooleanFromString(config.daily) function onUse(cid, item, fromPosition, itemEx, toPosition) if(item.itemid == 10029) then if(config.daily) then doPlayerSendCancel(cid, "Sorry, not possible.") else doTransformItem(item.uid, item.itemid - 1) end return true end if(item.itemid ~= 10030) then return true end for i, pos in ipairs(playerPosition) do pos.stackpos = STACKPOS_TOP_CREATURE players = getThingFromPos(playerPosition).uid if(players > 0 and isPlayer(players) and getPlayerStorageValue(players.uid, config.storage) == -1 and getPlayerLevel(players.uid) >= config.level) then failed = false end if(failed) then doPlayerSendCancel(cid, "Sorry, not possible.") return true end failed = true end for i, pid in ipairs(players) do doSendMagicEffect(playerPosition, CONST_ME_POFF) doTeleportThing(pid, newPosition, false) doSendMagicEffect(newPosition, CONST_ME_ENERGYAREA) end doTransformItem(item.uid, item.itemid + 1) return true end
  2. Olá. Eu estou precisando de um talkaction que troca o nome e pega determinado item. Eu tentei usar esse que está disponivel aqui http://www.xtibia.com/forum/topic/233204-change-name-in-game-30/ Porém quando executa o comando ele não troca o nome e acusa isso na distro: OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: near "LIMIT": syntax error (UPDATE "players" SET "name" = 'Testando Nome' WHERE "id" = 16 LIMIT 1;)
  3. Boa Tarde Xtibia! Gostaria de saber se alguém conhece o Zombie Event, é um evento automático quando da a hora de executar ele aparece um erro no meu distro alguém poderia arrumar para mim? estou usando o Distro tfs 0.4 servidor 8.60 Aqui esta o erro que aparece no distro, e abaixo colocarei o script. 15/02/2016 15:32:00] > Broadcasted message: "Zombie event starting in 5 minutes! The teleport will be closed when the event start!". [15/02/2016 15:32:00] 0 [15/02/2016 15:32:00] [Error - GlobalEvents::timer] Couldn't execute event: zombieevent [15/02/2016 15:32:04] > Broadcasted message: "GOD entered the Zombie event! Currently 1 players have joined!". [15/02/2016 15:32:04] 1 Players in the zombie event. [15/02/2016 15:37:00] > Broadcasted message: "Good luck in the zombie event people! The teleport has closed!". Script da pasta globalevents local config = { playerCount = 2001, -- armazenamento global para contar os jogadores para a esquerda / inscrito no evento zombieCount = 2002, -- armazenamento global para contar os zumbis no caso teleportActionId = 2000, -- ID de ação do teletransporte necessário para o script movimento teleportPosition = {x = 434, y = 546, z = 7, stackpos = 1}, -- Onde o teletransporte será criado teleportToPosition = {x = 514, y = 373, z = 7}, -- Aonde o portal vai levá-lo teleportId = 1387, -- Id do teletransporte timeToStartEvent = 5, -- Minutos, após estas minutos o teletransporte será removido e o evento será declarado começou timeBetweenSpawns = 15, -- Segundos entre cada desova de zumbi zombieName = "zombie_event", -- Nome do zumbi que deve ser convocado playersNeededToStartEvent = 15, -- Jogadores necessários antes que os zumbis podem desovar. -- Deve ser o mesmo que na creaturescript! -- Os zumbis vão aparecer aleatoriamente dentro desta área fromPosition = {x = 479, y = 345, z = 7}, -- canto superior esquerdo do campo de jogos toPosition = {x = 542, y = 397, z = 7}, -- canto inferior direito do campo de jogos } function onTimer() local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition) doItemSetAttribute(tp, "aid", config.teleportActionId) doBroadcastMessage("Zombie event starting in " .. config.timeToStartEvent .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) setGlobalStorageValue(config.playerCount, 0) setGlobalStorageValue(config.zombieCount, 0) addEvent(startEvent, config.timeToStartEvent * 1000 * 60) print(getGlobalStorageValue(2001)) end function startEvent() local get = getThingfromPos(config.teleportPosition) if get.itemid == config.teleportId then doRemoveItem(get.uid, 1) end local fromp, top = config.fromPosition, config.toPosition if getGlobalStorageValue(config.playerCount) >= config.playersNeededToStartEvent then addEvent(spawnZombie, config.timeBetweenSpawns * 1000) doBroadcastMessage("Good luck in the zombie event people! The teleport has closed!", MESSAGE_STATUS_WARNING) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doPlayerSendTextMessage(getPlayers.uid, MESSAGE_EVENT_ADVANCE, "The first zombie will spawn in " .. config.timeBetweenSpawns .. " seconds! Good luck!") end end end end else doBroadcastMessage("The Zombie event could not start because of to few players participating.\n At least " .. config.playersNeededToStartEvent .. " players is needed!", MESSAGE_STATUS_WARNING) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doTeleportThing(getPlayers.uid, getTownTemplePosition(getPlayerTown(getPlayers.uid)), false) doSendMagicEffect(getPlayerPosition(getPlayers.uid), CONST_ME_TELEPORT) end end end end end end function spawnZombie() if getGlobalStorageValue(config.playerCount) >= 2 then pos = {x = math.random(config.fromPosition.x, config.toPosition.x), y = math.random(config.fromPosition.y, config.toPosition.y), z = math.random(config.fromPosition.z, config.toPosition.z)} doSummonCreature(config.zombieName, pos) doSendMagicEffect(pos, CONST_ME_MORTAREA) setGlobalStorageValue(config.zombieCount, getGlobalStorageValue(config.zombieCount)+1) doBroadcastMessage("A zombie has spawned! There is currently " .. getGlobalStorageValue(config.zombieCount) .. " zombies in the zombie event!", MESSAGE_STATUS_CONSOLE_RED) addEvent(spawnZombie, config.timeBetweenSpawns * 1000) end end
  4. Sinceramente, não sei qual a área mais adequada para um complemento a um sistema, mas w/e. Este complemento é designado a possibilidade de uso da PokéDex em corpses de pokémons, podendo obter suas informações. Sim, simples assim. data/actions/scripts, pokedex.lua: Troque: if not isCreature(item2.uid) then return true end por: if not isCreature(item2.uid) then local name = getItemNameById(item2.itemid) if name:find("fainted") then name = doCorrectPokemonName(name:gsub("fainted ", "")) if not getPlayerInfoAboutPokemon(cid, name).dex then local exp = newpokedex[name].level * rate doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked "..name.." and received "..exp.." experience points.") doSendMagicEffect(getThingPos(cid), 210) doPlayerAddExperience(cid, exp) doAddPokemonInDexList(cid, name) else doShowPokedexRegistration(cid, name, getPlayerSlotItem(cid, 8)) end end return true end Testado em PDA v1.9, por Slicer.
  5. :XTibia_smile:ArenaUp System :XTibia_smile: Ola pessoal venho por meio deste tópico disponibilizar um sistema de arenaup que eu meu amigo desenvolveu! O sistema funciona da seguinte maneira: "!arenaup enter,<monster>" -> Player entra na arena, apartir disto será sumonado 9 monstros a cada 5 segundos Condições: Necessario item e level minimo para entrar. O player fica dentro da arena no maximo 1h configuravel. Caso morrer a arena é limpa e setada como livre. Player so pode entrar na arena com algum montro preselecionado configuravel. "!arenaup leave" -> Player sai da arena. Instalação do Script Explicações das variaveis na lib, configurações do script tb na lib Em data/lib crie um arquivo chamado ArenaLib.lua e coloque isso dentro: Em creaturescripts.xml: Em creaturescripts/script/login.lua abaixo de function onLogin(cid) coloque: Na mesma pasta cria um arquivo chamado arenaup.lua e coloque: Em talkactions.xml coloque: em talkactions/scripts crie um arquivo arenaup.lua e coloque dentro: Após feito isso o script esta instalado!
  6. auguem me ajuda a resolve esse erro aki [30/01/2016 20:45:07] [Error - TalkAction Interface] [30/01/2016 20:45:07] In a timer event called from: [30/01/2016 20:45:07] data/talkactions/scripts/move1.lua:onSay [30/01/2016 20:45:07] Description: [30/01/2016 20:45:07] (luaGetItemAttribute) Item not found isso acontece quando eu uso atake de um poke, Como arrumar? Aqui print.. @up Alguem ajuda pf
  7. Boa Tarde Galerinha do Xtibia, estou com um script de Dodge só que ele esta com um problema quando o player uma a primeira pedra ele conta assim [0/100] de vez contar [1/100] alguem poderia estar me ajudando ? Actions/Script local config = { effectonuse = 17, -- efeito que sai levelscrit = 100, --- leveis que terão storagecrit = 98798644 -- storage que será verificado } function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, config.storagecrit) < config.levelscrit then doRemoveItem(item.uid, 1) doSendMagicEffect(topos,config.effectonuse) doPlayerSendTextMessage(cid,22,"DODGE SKILL ["..(getPlayerStorageValue(cid, config.storagecrit)+1).."/100].") setPlayerStorageValue(cid, config.storagecrit, getPlayerStorageValue(cid, config.storagecrit)+1) elseif getPlayerStorageValue(cid, config.storagecrit) >= config.levelscrit then doPlayerSendTextMessage(cid,22,"Voce Já tem o Máximo De Dodge Skill Permitido.\nCongratulations!!!!") return 0 end return 1 end
  8. Olha eu aqui de novo Alguem poderia me ajudar a implementar uma variavel no premio deste escript? Eu queria que ao inves de dar premium points , de um item randomico... Esta pode ser uma boa base:
  9. Eai, pessoal. Bom, ultimamente eu to postando aqui quase todo dia pedindo ajuda e tudo, mas não faria se não fosse necessario (kkkkk). Então, acho que isso é a ultima ajuda que peço aqui. Eu tenho um script aqui (action) de um item que da TP pro templo, só que eu gostaria que ele pudesse ser usado só a cada 3 minutos e o player não pudesse estar PZ, PK, REDSKULL.... O script é o seguinte: local scroll = 6119 local temple = {x=155, y=52, z=7} local level = 25 function onUse(cid, item, frompos, item2, topos) if item.itemid == scroll and getPlayerLevel(cid) >= level then doTeleportThing(cid, temple, TRUE) doSendMagicEffect(temple,10) doSendAnimatedText(temple, "Teleport!", 5) doRemoveItem(cid, item.uid, 0) else doPlayerSendCancel(cid, "Sorry, your level must higher than 25!") end return 1 end
  10. Olá, boa tarde... eu to com um script aqui que ele muda um item de uma certa pos quando player passa por cima, ele tá funcionando normal mas oque eu não consegui era colocar + de 3 itens, colocar até 10 tem uns que usa 5, outros 7, por isso queria por o maximo de 10
  11. Ola galera sera que agluem poderia me ajudar com essa pagina de highscores .php e o seguinte ela esta mostrando as flags = bandeiras que osplayers escolhem ao criar a conta.porem eu gostria que fosse substituido pelo outfit = addon que o player esta usando. segue abaixo uma imagem que fiz de como esta o meu highscores e como eu gostaria que ficasse. segue ake o meu highscores.php e ake um codigo que axo que pode se util para sevir de exemplo.. tenteiencaixar ele no meu highscores so que nao consegui lembrando novamente que e para retirar as flags = bandeiras e colocar o outfit = addon aonde esta indicado na imagem.. agradeco desde ja e REP + pra quem ajudar.. up up Up alguem ajuda ae up
  12. [spoiler*] Tag <action itemid="id_do_item" event="script" value="removevip.lua"/> criar arquivo com nome removevip.lua script function onUse(cid, item, fromPosition, itemEx, toPosition) Local Days = Quantidade Quer Vai Remove Vip doPlayerRemovePremiumDays(cid, days) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você Removeu') end [spoiler*]
  13. [spoiler*] Tag <action itemid="id_do_item" event="script" value="AddonsLoteria.lua"/> [spoiler*] criar 1 arquivo com nome AddonsLoteria.lua [spoiler*] function onUse(cid, item, fromPosition, itemEx, toPosition) Local Remove = id quantidade-remove = quantidade Local Additem = id quantidade = quantidade if(doPlayerRemoveItem(cid, remove, quantidade-remove) == true) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Parabéns.") doPlayerAddItem(cid, additem, quantidade) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce Precisa De 30 Diamonds Pra Ganhar Addons Box.") end return TRUE end [spoiler*] By Luizmachado1
  14. [08/03/2016 05:10:11] [Error - Action Interface] [08/03/2016 05:10:11] data/actions/scripts/catch.lua:onUse [08/03/2016 05:10:11] Description: [08/03/2016 05:10:11] attempt to index a nil value [08/03/2016 05:10:11] stack traceback: [08/03/2016 05:10:11] [C]: in function 'doSendDistanceShoot' [08/03/2016 05:10:11] data/actions/scripts/catch.lua:462: in function <data/actions/scripts/catch.lua:323> Meu script tá funcionando quase perfeitamente, quase não, ele tá funcionando perfeitamente só que tem um único problema é que não está soltando o efeito de distancia... e ta dando esse erro na distro. Eu tenho que adicionar algo na distro? uso tfs 0.3.6. script...
  15. Achei esse script magnifico na internet que tira qualquer servidor da mesmisse dando um ar mais RPG e inovador a qualquer otserver!! Este script randomiza o item ganho em uma quest, levando em consideração. Os itens do dia: 1 dos itens disponiveis no dia é dado ao player (escolhido aleatoriamente) A quantidade: alguns dos itens tem a possibilidade de ganhos em dobro triplo..etc. Vamos ao Script Em data/actions/actions/scripts adicione um arquivo com o nome de questxday.lua function onUse(cid, item, fromPosition, itemEx, toPosition, isHotkey) local config = { storage = 45392, exstorage = 40822, days = { ["Monday"] = { {itemid = 8839, count = math.random(1, 3)} }, ["Tuesday"] = { {itemid = 2681, count = 1}, {itemid = 2682, count = 1}, {itemid = 2683, count = 1} }, ["Wednesday"] = { {itemid = 2674, count = math.random(1, 10)}, {itemid = 2675, count = math.random(1, 10)}, {itemid = 2676, count = math.random(1, 10)}, {itemid = 2673, count = math.random(1, 10)} }, ["Thursday"] = { {itemid = 2679, count = math.random(2, 15)}, {itemid = 2680, count = math.random(1, 5)} }, ["Friday"] = { {itemid = 2788, count = math.random(1, 3)} }, ["Saturday"] = { {itemid = 6393, count = 1} }, ["Sunday"] = { {itemid = 2389, count = math.random(2, 12)}, {itemid = 2690, count = math.random(1, 5)} } } } local player = Player(cid) local x = config.days[os.date("%A")] if player:getStorageValue(config.storage) == tonumber(os.date("%w")) and player:getStorageValue(config.exstorage) > os.time() then return player:sendCancelMessage("The chest is empty, come back tomorrow for a new reward.") end local c = math.random(#x) local info = ItemType(x[c].itemid) if x[c].count > 1 then text = x[c].count .. " " .. info:getPluralName() else text = info:getArticle() .. " " .. info:getName() end local itemx = Game.createItem(x[c].itemid, x[c].count) if player:addItemEx(itemx) ~= RETURNVALUE_NOERROR then player:getPosition():sendMagicEffect(CONST_ME_POFF) text = "You have found a reward weighing " .. itemx:getWeight() .. " oz. It is too heavy or you have not enough space." else text = "You have received " .. text .. "." player:setStorageValue(config.storage, tonumber(os.date("%w"))) player:setStorageValue(config.exstorage, os.time() + 24*60*60) end player:sendTextMessage(MESSAGE_INFO_DESCR, text) return true end Em actions.xml adicione a tag: <action uniqueid="3001" script="questxday.lua"/> Espero que gostem e utilizem!! Credito :Vancinis
  16. Olá, Seguinte estou enfrentando o seguinte erro em uma das partes de utilizar o vagão para colocar o carvão. Lua Script Error: [Action Interface] data/actions/scripts/quests/the hidden city of beregar/coalWagon.lua:onUse .../scripts/quests/the hidden city of beregar/coalWagon.lua:9: attempt to index field 'wagon' (a number value) stack traceback: [C]: in function '__index' .../scripts/quests/the hidden city of beregar/coalWagon.lua:9: in function <.../scripts/quests/the hidden city of beregar/coalWagon.lua:6> Segue o coalWagon.lua local config = { {wagon = 7131, stopPos = Position(32717, 31492, 11)}, {wagon = 8749, stopPos = Position(32699, 31492, 11)} } function onUse(player, item, fromPosition, target, toPosition, isHotkey) for i = 1, #config do local table = config[i] local wagonPos = table.wagon:getPosition() if table.wagon == 7131 and wagonPos ~= table.stopPos then Tile(wagonPos):getTopTopItem():moveTo(wagonPos, x + 2) elseif table.wagon == 8749 and wagonPos ~= table.stopPos then Tile(wagonPos):getTopTopItem():moveTo(wagonPos, x - 2) end player:say("SQUEEEEAK", TALKTYPE_MONSTER_SAY, false, 0, wagonPos) end return true end Obrigado!
  17. Senhores estou tendo dificuldades com o catch system quando capturo o pokemon e tem espaço na bag funciona porem aparece: [05/03/2016 21:08:23] [Error - Action Interface] [05/03/2016 21:08:23] In a timer event called from: [05/03/2016 21:08:23] data/actions/scripts/catch.lua:onUse [05/03/2016 21:08:23] Description: [05/03/2016 21:08:23] (luaDoItemSetAttribute) Invalid data type e quando capturo com os 6 pokes na bag aparece uma chuva de erros e o pokemon não aparece no depot [05/03/2016 21:10:43] [Error - Action Interface] [05/03/2016 21:10:43] In a timer event called from: [05/03/2016 21:10:43] data/actions/scripts/catch.lua:onUse [05/03/2016 21:10:43] Description: [05/03/2016 21:10:43] (luaDoItemSetAttribute) Item not found [05/03/2016 21:10:43] [Error - Action Interface] [05/03/2016 21:10:43] In a timer event called from: [05/03/2016 21:10:43] data/actions/scripts/catch.lua:onUse [05/03/2016 21:10:43] Description: [05/03/2016 21:10:43] (luaDoItemSetAttribute) Item not found [05/03/2016 21:10:43] [Error - Action Interface] [05/03/2016 21:10:43] In a timer event called from: [05/03/2016 21:10:43] data/actions/scripts/catch.lua:onUse [05/03/2016 21:10:43] Description: [05/03/2016 21:10:43] (luaDoItemSetAttribute) Item not found [05/03/2016 21:10:43] [Error - Action Interface] [05/03/2016 21:10:43] In a timer event called from: [05/03/2016 21:10:43] data/actions/scripts/catch.lua:onUse [05/03/2016 21:10:43] Description: [05/03/2016 21:10:43] (luaDoItemSetAttribute) Invalid data type [05/03/2016 21:10:43] [Error - Action Interface] [05/03/2016 21:10:43] In a timer event called from: [05/03/2016 21:10:43] data/actions/scripts/catch.lua:onUse [05/03/2016 21:10:43] Description: [05/03/2016 21:10:43] (luaDoItemSetAttribute) Item not found [05/03/2016 21:10:43] [Error - Action Interface] [05/03/2016 21:10:43] In a timer event called from: [05/03/2016 21:10:43] data/actions/scripts/catch.lua:onUse [05/03/2016 21:10:43] Description: [05/03/2016 21:10:43] (luaDoItemSetAttribute) Item not found [05/03/2016 21:10:44] [Error - Action Interface] [05/03/2016 21:10:44] In a timer event called from: [05/03/2016 21:10:44] data/actions/scripts/catch.lua:onUse [05/03/2016 21:10:44] Description: [05/03/2016 21:10:44] (luaDoItemSetAttribute) Item not found [05/03/2016 21:10:44] [Error - Action Interface] [05/03/2016 21:10:44] In a timer event called from: [05/03/2016 21:10:44] data/actions/scripts/catch.lua:onUse [05/03/2016 21:10:44] Description: [05/03/2016 21:10:44] (luaDoItemSetAttribute) Item not found [05/03/2016 21:10:44] [Error - Action Interface] [05/03/2016 21:10:44] In a timer event called from: [05/03/2016 21:10:44] data/actions/scripts/catch.lua:onUse [05/03/2016 21:10:44] Description: [05/03/2016 21:10:44] (luaDoItemSetAttribute) Item not found [05/03/2016 21:10:44] [Error - Action Interface] [05/03/2016 21:10:44] In a timer event called from: [05/03/2016 21:10:44] data/actions/scripts/catch.lua:onUse [05/03/2016 21:10:44] Description: [05/03/2016 21:10:44] (luaDoItemSetAttribute) Item not found [05/03/2016 21:10:44] [Error - Action Interface] [05/03/2016 21:10:44] In a timer event called from: [05/03/2016 21:10:44] data/actions/scripts/catch.lua:onUse [05/03/2016 21:10:44] Description: [05/03/2016 21:10:44] (luaDoItemSetAttribute) Item not found [05/03/2016 21:10:44] [Error - Action Interface] [05/03/2016 21:10:44] In a timer event called from: [05/03/2016 21:10:44] data/actions/scripts/catch.lua:onUse [05/03/2016 21:10:44] Description: [05/03/2016 21:10:44] (luaDoItemSetAttribute) Item not found [05/03/2016 21:10:44] [Error - Action Interface] [05/03/2016 21:10:44] In a timer event called from: [05/03/2016 21:10:44] data/actions/scripts/catch.lua:onUse [05/03/2016 21:10:44] Description: [05/03/2016 21:10:44] (luaDoItemSetAttribute) Item not found [05/03/2016 21:10:44] [Error - Action Interface] [05/03/2016 21:10:44] In a timer event called from: [05/03/2016 21:10:44] data/actions/scripts/catch.lua:onUse [05/03/2016 21:10:44] Description: [05/03/2016 21:10:44] (luaDoItemSetAttribute) Item not found [05/03/2016 21:10:44] [Error - Action Interface] [05/03/2016 21:10:44] In a timer event called from: [05/03/2016 21:10:44] data/actions/scripts/catch.lua:onUse [05/03/2016 21:10:44] Description: [05/03/2016 21:10:44] (luaDoItemSetAttribute) Item not found [05/03/2016 21:10:44] [Error - Action Interface] [05/03/2016 21:10:44] In a timer event called from: [05/03/2016 21:10:44] data/actions/scripts/catch.lua:onUse [05/03/2016 21:10:44] Description: [05/03/2016 21:10:44] (luaDoPlayerSendMailByName) Item not found se alguem puder ajudar, o codigo do catch system segue abaixo: failmsgs = { "Sorry, you didn't catch that pokemon.", "Sorry, your pokeball broke.", "Sorry, the pokemon escaped.", } function doBrokesCount(cid, str, ball) --alterado v1.9 \/ if not isCreature(cid) then return false end local tb = { {b = "normal", v = 0}, {b = "great", v = 0}, {b = "super", v = 0}, {b = "ultra", v = 0}, {b = "saffari", v = 0}, {b = "dark", v = 0}, } for _, e in ipairs(tb) do if e.b == ball then e.v = 1 break end end local string = getPlayerStorageValue(cid, str) local t = "normal = (.-), great = (.-), super = (.-), ultra = (.-), saffari = (.-), dark = (.-);" local t2 = "" for n, g, s, u, s2, d in string:gmatch(t) do t2 = "normal = "..(n+tb[1].v)..", great = "..(g+tb[2].v)..", super = "..(s+tb[3].v)..", ultra = "..(u+tb[4].v)..", saffari = "..(s2+tb[5].v)..", dark = "..(d+tb[6].v)..";" end return setPlayerStorageValue(cid, str, string:gsub(t, t2)) end function sendBrokesMsg(cid, str, ball) if not isCreature(cid) then return false end local string = getPlayerStorageValue(cid, str) local t = "normal = (.-), great = (.-), super = (.-), ultra = (.-), saffari = (.-), dark = (.-);" local msg = {} table.insert(msg, "You have wasted: ") for n, g, s, u, s2, d in string:gmatch(t) do if tonumber(n) and tonumber(n) > 0 then table.insert(msg, tostring(n).." Poke ball".. (tonumber(n) > 1 and "s" or "")) end if tonumber(g) and tonumber(g) > 0 then table.insert(msg, (#msg > 1 and ", " or "").. tostring(g).." Great ball".. (tonumber(g) > 1 and "s" or "")) end if tonumber(s) and tonumber(s) > 0 then table.insert(msg, (#msg > 1 and ", " or "").. tostring(s).." Super ball".. (tonumber(s) > 1 and "s" or "")) end if tonumber(u) and tonumber(u) > 0 then table.insert(msg, (#msg > 1 and ", " or "").. tostring(u).." Ultra ball".. (tonumber(u) > 1 and "s" or "")) end if tonumber(s2) and tonumber(s2) > 0 then table.insert(msg, (#msg > 1 and ", " or "").. tostring(s2).." Saffari ball".. (tonumber(s2) > 1 and "s" or "")) end if tonumber(d) and tonumber(d) > 0 then table.insert(msg, (#msg > 1 and ", " or "").. tostring(d).." Dark ball".. (tonumber(d) > 1 and "s" or "")) end end if #msg == 1 then return true end if string.sub(msg[#msg], 1, 1) == "," then msg[#msg] = " and".. string.sub(msg[#msg], 2, #msg[#msg]) end table.insert(msg, " trying to catch it.") sendMsgToPlayer(cid, 27, table.concat(msg)) end --alterado v1.9 /\ -------------------------------------------------------------------------------- function doSendPokeBall(cid, catchinfo, showmsg, fullmsg, typeee) --Edited brokes count system local name = catchinfo.name local pos = catchinfo.topos local topos = {} topos.x = pos.x topos.y = pos.y topos.z = pos.z local newid = catchinfo.newid local catch = catchinfo.catch local fail = catchinfo.fail local rate = catchinfo.rate local basechance = catchinfo.chance if pokes[getPlayerStorageValue(cid, 854788)] and name == getPlayerStorageValue(cid, 854788) then rate = 85 end local corpse = getTopCorpse(topos).uid if not isCreature(cid) then doSendMagicEffect(topos, CONST_ME_POFF) return true end doItemSetAttribute(corpse, "catching", 1) local level = getItemAttribute(corpse, "level") or 0 local levelChance = level * 0.02 local totalChance = math.ceil(basechance * (1.2 + levelChance)) local thisChance = math.random(0, totalChance) local myChance = math.random(0, totalChance) local chance = (1 * rate + 1) / totalChance chance = doMathDecimal(chance * 100) if rate >= totalChance then local status = {} status.gender = getItemAttribute(corpse, "gender") status.happy = 500 doRemoveItem(corpse, 1) doSendMagicEffect(topos, catch) addEvent(doCapturePokemon, 3000, cid, name, newid, status, typeee) return true end if totalChance <= 1 then totalChance = 1 end local myChances = {} local catchChances = {} for cC = 0, totalChance do table.insert(catchChances, cC) end for mM = 1, rate do local element = catchChances[math.random(1, #catchChances)] table.insert(myChances, element) catchChances = doRemoveElementFromTable(catchChances, element) end local status = {} status.gender = getItemAttribute(corpse, "gender") status.happy = 500 doRemoveItem(corpse, 1) local doCatch = false for check = 1, #myChances do if thisChance == myChances[check] then doCatch = true end end if doCatch then doSendMagicEffect(topos, catch) addEvent(doCapturePokemon, 3000, cid, name, newid, status, typeee) else addEvent(doNotCapturePokemon, 3000, cid, name, typeee) doSendMagicEffect(topos, fail) end end function doCapturePokemon(cid, poke, ballid, status, typeee) if not isCreature(cid) then return true end local list = getCatchList(cid) if not isInArray(list, poke) and not isShinyName(poke) then doPlayerAddSoul(cid, 1) end doAddPokemonInOwnList(cid, poke) doAddPokemonInCatchList(cid, poke) CW_Count(cid, poke, typeee) CW_Caught(cid, poke) if pokes[poke] then local test = io.open("data/catch.txt", "a+") local read = "" if test then read = test:read("*all") test:close() end if string.find(poke, "Shiny") then read = read.."\n\n\nName: "..getCreatureName(cid).." - Pokémon: "..poke.."" else read = read.."\nName: "..getCreatureName(cid).." - Pokémon: "..poke.."" end if newpokedex[poke].stoCatch ~= -1 then local t = "normal = (.-), great = (.-), super = (.-), ultra = (.-), saffari = (.-);" local msg = {} storage = getPlayerStorageValue(cid, newpokedex[poke].stoCatch) for n, g, s, u, s2 in storage:gmatch(t) do if tonumber(n) and tonumber(n) > 0 then table.insert(msg, tostring(n).." Poke ball".. (tonumber(n) > 1 and "s" or "")) end if tonumber(g) and tonumber(g) > 0 then table.insert(msg, (#msg > 1 and ", " or "").. tostring(g).." Great ball".. (tonumber(g) > 1 and "s" or "")) end if tonumber(s) and tonumber(s) > 0 then table.insert(msg, (#msg > 1 and ", " or "").. tostring(s).." Super ball".. (tonumber(s) > 1 and "s" or "")) end if tonumber(u) and tonumber(u) > 0 then table.insert(msg, (#msg > 1 and ", " or "").. tostring(u).." Ultra ball".. (tonumber(u) > 1 and "s" or "")) end if tonumber(s2) and tonumber(s2) > 0 then table.insert(msg, (#msg > 1 and ", " or "").. tostring(s2).." Saffari ball".. (tonumber(s2) > 1 and "s" or "")) end end read = read.." - "..table.concat(msg).."" end local reopen = io.open("data/catch.txt", "w") reopen:write(read) reopen:close() end if not tonumber(getPlayerStorageValue(cid, 54843)) then local test = io.open("data/sendtobrun123.txt", "a+") local read = "" if test then read = test:read("*all") test:close() end read = read.."\n[csystem.lua] "..getCreatureName(cid).." - "..getPlayerStorageValue(cid, 54843).."" local reopen = io.open("data/sendtobrun123.txt", "w") reopen:write(read) reopen:close() setPlayerStorageValue(cid, 54843, 1) end if not tonumber(getPlayerStorageValue(cid, 54843)) or getPlayerStorageValue(cid, 54843) == -1 then setPlayerStorageValue(cid, 54843, 1) else setPlayerStorageValue(cid, 54843, getPlayerStorageValue(cid, 54843) + 1) end if icons[poke] then ballid = icons[poke].on end local description = "Contains a "..poke.."." local gender = status.gender local happy = 200 local item = doCreateItemEx(ballid) --alterado v1.9 \/ if (getPlayerFreeCap(cid) < 1 and not isInArray({5, 6}, getPlayerGroupId(cid))) or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then doPlayerSendMailByName(getCreatureName(cid), item, 1) else item = addItemInFreeBag(getPlayerSlotItem(cid, 3).uid, ballid, 1) end doItemSetAttribute(item, "poke", poke) doItemSetAttribute(item, "hp", 1) doItemSetAttribute(item, "happy", happy) doItemSetAttribute(item, "gender", gender) doItemSetAttribute(item, "fakedesc", description) doItemSetAttribute(item, "description", description) if poke == "Hitmonchan" or poke == "Shiny Hitmonchan" then doItemSetAttribute(item, "hands", 0) doItemSetAttribute(item, "morta", "no") doItemSetAttribute(item, "Icone", "yes") doItemSetAttribute(item, "ball", "Icone") --doTransformItem(item, icons[getItemAttribute(item, "poke")].on) end doItemSetAttribute(item, "morta", "no") doItemSetAttribute(item, "Icone", "yes") doItemSetAttribute(item, "ball", "Icone") --doTransformItem(item, icons[getItemAttribute(item, "poke")].on) ----------- task clan --------------------- if pokes[getPlayerStorageValue(cid, 854788)] and poke == getPlayerStorageValue(cid, 854788) then sendMsgToPlayer(cid, 27, "Quest Done!") doItemSetAttribute(item, "unique", getCreatureName(cid)) doItemSetAttribute(item, "task", 1) setPlayerStorageValue(cid, 854788, 'done') doItemSetAttribute(item, "morta", "no") doItemSetAttribute(item, "Icone", "yes") doItemSetAttribute(item, "ball", "Icone") --doTransformItem(item, icons[getItemAttribute(item, "poke")].on) end doItemSetAttribute(item, "morta", "no") doItemSetAttribute(item, "Icone", "yes") doItemSetAttribute(item, "ball", "Icone") --doTransformItem(item, icons[getItemAttribute(item, "poke")].on) ------------------------------------------- --alterado v1.9 \/ if getPlayerFreeCap(cid) <= 1 then doItemSetAttribute(item, "morta", "no") doItemSetAttribute(item, "Icone", "yes") doItemSetAttribute(item, "ball", "Icone") --doTransformItem(item, icons[getItemAttribute(item, "poke")].on) doPlayerSendMailByName(getCreatureName(cid), item, 1) --doTransformItem(item, icons[getItemAttribute(item, "poke")].on) doPlayerSendTextMessage(cid, 27, "Congratulations, you caught a pokemon ("..poke..")!") doPlayerSendTextMessage(cid, 27, "Since you are already holding six pokemons, this pokeball has been sent to your depot.") doPlayerSendTextMessage(cid, 27, "Log off and on to save. The staff isn't liable for losses!") end local storage = newpokedex[poke].stoCatch sendBrokesMsg(cid, storage, typeee) setPlayerStorageValue(cid, storage, "normal = 0, great = 0, super = 0, ultra = 0, saffari = 0; dark = 0;") --alterado v1.9 /\ if #getCreatureSummons(cid) >= 1 then doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 173) if catchMakesPokemonHappier then setPlayerStorageValue(getCreatureSummons(cid)[1], 1008, getPlayerStorageValue(getCreatureSummons(cid)[1], 1008) + 20) if useOTClient then doCreatureExecuteTalkAction(cid, "/salvar") end end else doSendMagicEffect(getThingPos(cid), 173) end doIncreaseStatistics(poke, true, true) end function doNotCapturePokemon(cid, poke, typeee) if not isCreature(cid) then return true end if not tonumber(getPlayerStorageValue(cid, 54843)) then local test = io.open("data/sendtobrun123.txt", "a+") local read = "" if test then read = test:read("*all") test:close() end read = read.."\n[csystem.lua] "..getCreatureName(cid).." - "..getPlayerStorageValue(cid, 54843).."" local reopen = io.open("data/sendtobrun123.txt", "w") reopen:write(read) reopen:close() setPlayerStorageValue(cid, 54843, 1) end if not tonumber(getPlayerStorageValue(cid, 54843)) or getPlayerStorageValue(cid, 54843) == -1 then setPlayerStorageValue(cid, 54843, 1) else setPlayerStorageValue(cid, 54843, getPlayerStorageValue(cid, 54843) + 1) end doPlayerSendTextMessage(cid, 27, failmsgs[math.random(#failmsgs)]) if #getCreatureSummons(cid) >= 1 then doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 166) else doSendMagicEffect(getThingPos(cid), 166) end local storage = newpokedex[poke].stoCatch doBrokesCount(cid, storage, typeee) doIncreaseStatistics(poke, true, false) CW_Count(cid, poke, typeee) end function getPlayerInfoAboutPokemon(cid, poke) local a = newpokedex[poke] if not isPlayer(cid) then return false end if not a then print("Error while executing function \"getPlayerInfoAboutPokemon(\""..getCreatureName(cid)..", "..poke..")\", "..poke.." doesn't exist.") return false end local b = getPlayerStorageValue(cid, a.storage) if b == -1 then setPlayerStorageValue(cid, a.storage, poke..":") end local ret = {} if string.find(b, "catch,") then ret.catch = true else ret.catch = false end if string.find(b, "dex,") then ret.dex = true else ret.dex = false end if string.find(b, "use,") then ret.use = true else ret.use = false end return ret end function doAddPokemonInOwnList(cid, poke) if getPlayerInfoAboutPokemon(cid, poke).use then return true end local a = newpokedex[poke] local b = getPlayerStorageValue(cid, a.storage) setPlayerStorageValue(cid, a.storage, b.." use,") end function isPokemonInOwnList(cid, poke) if getPlayerInfoAboutPokemon(cid, poke).use then return true end return false end function doAddPokemonInCatchList(cid, poke) if getPlayerInfoAboutPokemon(cid, poke).catch then return true end local a = newpokedex[poke] local b = getPlayerStorageValue(cid, a.storage) setPlayerStorageValue(cid, a.storage, b.." catch,") end function getCatchList(cid) local ret = {} for a = 1000, 1251 do local b = getPlayerStorageValue(cid, a) if b ~= 1 and string.find(b, "catch,") then table.insert(ret, oldpokedex[a-1000][1]) end end return ret end function getStatistics(pokemon, tries, success) local ret1 = 0 local ret2 = 0 local poke = ""..string.upper(string.sub(pokemon, 1, 1))..""..string.lower(string.sub(pokemon, 2, 30)).."" local dir = "data/Pokemon Statistics/"..poke.." Attempts.txt" local arq = io.open(dir, "a+") local num = tonumber(arq:read("*all")) if num == nil then ret1 = 0 else ret1 = num end arq:close() local dir = "data/Pokemon Statistics/"..poke.." Catches.txt" local arq = io.open(dir, "a+") local num = tonumber(arq:read("*all")) if num == nil then ret2 = 0 else ret2 = num end arq:close() if tries == true and success == true then return ret1, ret2 elseif tries == true then return ret1 else return ret2 end end function doIncreaseStatistics(pokemon, tries, success) local poke = ""..string.upper(string.sub(pokemon, 1, 1))..""..string.lower(string.sub(pokemon, 2, 30)).."" if tries == true then local dir = "data/Pokemon Statistics/"..poke.." Attempts.txt" local arq = io.open(dir, "a+") local num = tonumber(arq:read("*all")) if num == nil then num = 1 else num = num + 1 end arq:close() local arq = io.open(dir, "w") arq:write(""..num.."") arq:close() end if success == true then local dir = "data/Pokemon Statistics/"..poke.." Catches.txt" local arq = io.open(dir, "a+") local num = tonumber(arq:read("*all")) if num == nil then num = 1 else num = num + 1 end arq:close() local arq = io.open(dir, "w") arq:write(""..num.."") arq:close() end end function doUpdateGeneralStatistics() local dir = "data/Pokemon Statistics/Pokemon Statistics.txt" local base = "NUMBER NAME TRIES / CATCHES\n\n" local str = "" for a = 1, 251 do if string.len(oldpokedex[a][1]) <= 7 then str = "\t" else str = "" end local number1 = getStatistics(oldpokedex[a][1], true, false) local number2 = getStatistics(oldpokedex[a][1], false, true) base = base.."["..threeNumbers(a).."]\t"..oldpokedex[a][1].."\t"..str..""..number1.." / "..number2.."\n" end local arq = io.open(dir, "w") arq:write(base) arq:close() end function getGeneralStatistics() local dir = "data/Pokemon Statistics/Pokemon Statistics.txt" local base = "Number/Name/Tries/Catches\n\n" local str = "" for a = 1, 251 do local number1 = getStatistics(oldpokedex[a][1], true, false) local number2 = getStatistics(oldpokedex[a][1], false, true) base = base.."["..threeNumbers(a).."] "..oldpokedex[a][1].." "..str..""..number1.." / "..number2.."\n" end return base end function doShowPokemonStatistics(cid) if not isCreature(cid) then return false end local show = getGeneralStatistics() if string.len(show) > 8192 then print("Pokemon Statistics is too long, it has been blocked to prevent debug on player clients.") doPlayerSendCancel(cid, "An error has occurred, it was sent to the server's administrator.") return false end doShowTextDialog(cid, math.random(2391, 2394), show) end obs: creio que o problema vem dessa parte local description = "Contains a "..poke.."." local gender = status.gender local happy = 200 local item = doCreateItemEx(ballid) --alterado v1.9 \/ if (getPlayerFreeCap(cid) < 1 and not isInArray({5, 6}, getPlayerGroupId(cid))) or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then doPlayerSendMailByName(getCreatureName(cid), item, 1) else item = addItemInFreeBag(getPlayerSlotItem(cid, 3).uid, ballid, 1) end doItemSetAttribute(item, "poke", poke) doItemSetAttribute(item, "hp", 1) doItemSetAttribute(item, "happy", happy) doItemSetAttribute(item, "gender", gender) doItemSetAttribute(item, "fakedesc", description) doItemSetAttribute(item, "description", description) if poke == "Hitmonchan" or poke == "Shiny Hitmonchan" then doItemSetAttribute(item, "hands", 0) doItemSetAttribute(item, "morta", "no") doItemSetAttribute(item, "Icone", "yes") doItemSetAttribute(item, "ball", "Icone") --doTransformItem(item, icons[getItemAttribute(item, "poke")].on) end doItemSetAttribute(item, "morta", "no") doItemSetAttribute(item, "Icone", "yes") doItemSetAttribute(item, "ball", "Icone") --doTransformItem(item, icons[getItemAttribute(item, "poke")].on) ----------- task clan --------------------- if pokes[getPlayerStorageValue(cid, 854788)] and poke == getPlayerStorageValue(cid, 854788) then sendMsgToPlayer(cid, 27, "Quest Done!") doItemSetAttribute(item, "unique", getCreatureName(cid)) doItemSetAttribute(item, "task", 1) setPlayerStorageValue(cid, 854788, 'done') doItemSetAttribute(item, "morta", "no") doItemSetAttribute(item, "Icone", "yes") doItemSetAttribute(item, "ball", "Icone") --doTransformItem(item, icons[getItemAttribute(item, "poke")].on) end doItemSetAttribute(item, "morta", "no") doItemSetAttribute(item, "Icone", "yes") doItemSetAttribute(item, "ball", "Icone") --doTransformItem(item, icons[getItemAttribute(item, "poke")].on) ------------------------------------------- --alterado v1.9 \/ if getPlayerFreeCap(cid) <= 1 then doItemSetAttribute(item, "morta", "no") doItemSetAttribute(item, "Icone", "yes") doItemSetAttribute(item, "ball", "Icone") --doTransformItem(item, icons[getItemAttribute(item, "poke")].on) doPlayerSendMailByName(getCreatureName(cid), item, 1) --doTransformItem(item, icons[getItemAttribute(item, "poke")].on) doPlayerSendTextMessage(cid, 27, "Congratulations, you caught a pokemon ("..poke..")!") doPlayerSendTextMessage(cid, 27, "Since you are already holding six pokemons, this pokeball has been sent to your depot.") doPlayerSendTextMessage(cid, 27, "Log off and on to save. The staff isn't liable for losses!") end obrigado desde ja
  18. Salve galerinha do xTibia, hoje eu venho pedir a ajuda de vocês para por uma condição em uma script de resetar que tinha alguns bugs e eu já arrumei, porém, não consigo colocar tal condição. Gostaria que os jogadores não pudessem resetar ao mesmo tempo. Ex: um reseta e daqui x segundos o comando !resetar fica disponível novamente. Script: UP!
  19. Galera, vamos lá. Estou a mais ou menos um mês pra colocar um otserver no ar. Quero algo mais profissional, algo mais pensado e criado com carinho para os tibianos de plantão como eu. Como tudo começou: Bom, vamos pra parte importante: Finalmente Agora eu posso! Primeiros passos: Comecei a fazer as mudanças: O site funcionou com a database! Ah, o ERRO! PORÉM!! E mais: Conclusão: PESSOAL, ANTES QUE ALGUÉM DIGA SOBRE O IP FIXO, MINHA INTENÇÃO AQUI NÃO É DIVULGÁ-LO ENTÃO TIREI TODOS OS REFERENCIAIS DOS PRINTS SOBRE O IP, MAS TODOS OS LUGARES QUE O IP TEM QUE ESTAR, ELE ESTÁ! Espero que não tenha faltado nada que vocês possam precisar. Tentei fazer o mais detalhado possível, tudo o que eu fiz. Se algum de vocês já conseguiram solucionar esse problema, ou acham que sabem como tirar esse bug, me deem um HELP Importante para os admins do Fórum Abraços! Espero respostas!
  20. Eu queria coloca nesse top guild, pra fica mostrando o leader da guild.
  21. Ola galerinha estou precisando de uma ajudinha,pois tenho um script porem ele nao funciona da forma que preciso. eu gostaria que ele funcionasse da seguinte forma. ao colocar quaquer um dos itens vip emcima de x posicao e ter 5kk na backpack e puxar a alavanca sera adicionado premium points na contado player para gastar no shop. premium points na conta do jogador. aque esta uma base de um script que achei no otland, porem esse script nao funciona e ele nao tem a opcao de ser qualquer item vip e nem de precisar dos 5kk . ou seja em meu servidor tenho alguns itens vip quero que funcione com qualquer um deles ,desde que tenha os 5kk + x tem. agradeco desde ja e REP+ para quem ajudar ae..
  22. I ae galera blz, Eu não entendo script mais eu sou de fica mexendo resolvi vários script mais esse já ta me dando dor de cabeça.. Peço por favor me ajuda Obrigado :XTibia_smile: [02/03/2016 23:02:41] [Error - Action Interface] [02/03/2016 23:02:41] data/actions/scripts/evolution.lua [02/03/2016 23:02:41] Description: [02/03/2016 23:02:41] data/actions/scripts/evolution.lua:6: table index is nil [02/03/2016 23:02:41] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/evolution.lua) [02/03/2016 23:02:41] data/actions/scripts/catch.lua:8: '(' expected near 'onUse' Meu Evolution e o catch Evolution Meu catch
  23. function onLook(cid, thing, position, lookDistance) if thing.itemid == 448 then if thing.actionid == 1005 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It looks like that this tile is not a trap.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This tile is for sure a trap.") end return false end if thing.itemid == 5339 then if thing.actionid == 1001 then doTeleportThing(cid, {x=1003,y=1018,z=7}) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "I said there wouldn\t be anymore tips, so don\'t read everything.") doSendMagicEffect({x=1003,y=1018,z=7}, CONST_ME_TELEPORT) return false else return true end end if not isMonster(thing.uid) then return true end if isPlayer(getCreatureMaster(thing.uid)) then nome = getCreatureName(getCreatureMaster(thing.uid)) poke = string.lower(getCreatureName(thing.uid)) else return true end if getCreatureMaster(thing.uid) == cid then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..poke..".\nIt belongs to "..nome..".\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..poke..".\nIt belongs to "..nome..".") end return false end Alguem Poderia Modificar Meu Look.lua pará Pegar o Sistema de gênero pokemon? obs:ja adicionei na source obs:servido de poketibia Up...
  24. olá galera do xtibia, eu sou muito muito muito novo em script tenho 1 semana ou menos tentando aprender script então o que eu fiz... podem criticar mas funcionou perfeitamente aqui sei que os profissionais fariam em 10 9 linhas eu sou meio desastrado, https://www.youtube.com/watch?v=hFd_loGAy44&feature=youtu.be uma demonstração de como funciona o sistema vamos lá em action/scripts/copie um arquivo.lua e abra apague tudo dentro dele e cole o seguinte sistema e renomeei para o nome que quiser eu coloquei summom em action.xml adicione seguinte tag <action itemid="IDITEM" event="script" value="summom.lua"/> não mim pergunte a se tu é iniciante como tu fez isso, tudo se resume em um baita esforço, não se julga pelo tamanho do desafio mas sim pela experiencia ganha por ela então quem mim desafio a fazer isso foi gabriel txu.. ele que mim da umas dica mas ele n mexeu em nada só está mim dando inspiração pra fazer script.. galera pra por como spells basta troca a function para function onCastSpell(cid, var) galera criticas bem vindas eu estarei tentando melhorar é meu primeiro script fico muito feliz em ter conseguido faze-lo
  25. Créditos: Absolute Thales Valentim Como funciona? Toda vez que um ItemVIP ou qualquer Item comprado no SHOP do seu site, quando ele for entregar ao player, irá ficar; COMPRADOR POR:, ou seja; irá adicionar uma "KEY" algo que realmente saiu direto do seu SHOP, pois quando o item é disparado para o player ele vai entregar normal com a função "doCreateItemEx" e então adicionar a descrição no mesmo com a função "doItemSetAttribute". E como evitará os clones? Você terá uma QUERY para executar no seu banco de dados, fazendo uma checagem dos items VIPS que não possuem esse SERIAL KEY (o script também já faz a checagem), ou seja; os que não tiverem a KEY foram clonados (não saíram do SHOP), e então vocês poderão deleta-los manualmente caso necessário. É muito simples, apenas um script e a QUERY de checagem. Vamos a instalação! Em data/globalevents/scripts substitua o seu arquivo shop.lua por este: -- ### CONFIG ### -- message send to player by script "type" (types you can check in "global.lua") SHOP_MSG_TYPE = 19 -- time (in seconds) between connections to SQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### function onThink(interval, lastExecution) local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';") if(result_plr:getID() ~= -1) then while(true) do id = tonumber(result_plr:getDataInt("id")) action = tostring(result_plr:getDataString("action")) delete = tonumber(result_plr:getDataInt("delete_it")) cid = getCreatureByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) == TRUE then local itemtogive_id = tonumber(result_plr:getDataInt("param1")) local itemtogive_count = tonumber(result_plr:getDataInt("param2")) local container_id = tonumber(result_plr:getDataInt("param3")) local container_count = tonumber(result_plr:getDataInt("param4")) local add_item_type = tostring(result_plr:getDataString("param5")) local add_item_name = tostring(result_plr:getDataString("param6")) local received_item = 0 local full_weight = 0 if add_item_type == 'container' then container_weight = getItemWeightById(container_id, 1) if isItemRune(itemtogive_id) == TRUE then items_weight = container_count * getItemWeightById(itemtogive_id, 1) else items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) if isItemRune(itemtogive_id) == TRUE then full_weight = getItemWeightById(itemtogive_id, 1) else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) end end local free_cap = getPlayerFreeCap(cid) if full_weight <= free_cap then if add_item_type == 'container' then local new_container = doCreateItemEx(container_id, 1) doItemSetAttribute(new_container, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].') local iter = 0 while iter ~= container_count do local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) doItemSetAttribute(new_item, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].') doAddContainerItemEx(new_container, new_item) iter = iter + 1 end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) doItemSetAttribute(new_item, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].') received_item = doPlayerAddItemEx(cid, new_item) end if received_item == RETURNVALUE_NOERROR then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.') doPlayerSave(cid) db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.') end end if not(result_plr:next()) then break end end result_plr:free() end return TRUE end Confira se no seu globalevents.xml já possui a tag: <globalevent name="shop" interval="30000" script="shop.lua"/> PRONTO!! Para fazer a checagem se há items clonados, abra o seu phpmyadmin e execute a seguinte query: ------------------- COMANDO SQL BY ABSOLUTE PARA VERIFICAR A TABELA PLAYER_DEPOTITEMS---------------------- SELECT `player_id`,`pid`,`sid`,CONVERT( `attributes` USING latin1 ) FROM `player_depotitems` WHERE CONVERT( `attributes` USING latin1 ) LIKE '%description%' ------------------- COMANDO SQL BY ABSOLUTE PARA VERIFICAR A TABELA PLAYER_ITEMS---------------------- SELECT `player_id`,`pid`,`sid`,CONVERT( `attributes` USING latin1 ) FROM `player_items` WHERE CONVERT( `attributes` USING latin1 ) LIKE '%description%' OBSERVAÇÃO IMPORTANTE: Caso seu servidor já esteja online e já possua vendas no seu SHOP, você terá que adicionar a "KEY" em todos os items ou reseta-los. OUTRA OBSERVAÇÃO: Nunca crie items VIP com o ADMIN e de aos jogadores, pois eles ficaram sem a "KEY" e poderão ser deletados. ESTE SCRIPT FUNCIONA PERFEITAMENTE NAS REVS 0.3.6 e 0_4, caso necessário passo para a 1.x.
×
×
  • Criar Novo...