Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''creatureevent''.

  • 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. Créditos: luanluciano93 Objetivo Esse script limita uma quantidade de MC logados por IP, podendo evitar várias coisas, como por exemplo o magebomb. Tutorial Basta criar um arquivo em creaturescript/scripts/ com o nome anti-magebomb.lua e coloque esse código dentro: -- <event type="login" name="Anti-Magebomb" script="anti-magebomb.lua"/> local AccPorIp = 2 function onLogin(player) local mc = 0 for _, verificar in ipairs(Game.getPlayers()) do if player:getIp() == verificar:getIp() then mc = mc + 1 if mc > AccPorIp then return false end end end return true end A tag do creaturescript.xml já esta como comentário no script, é só copiar. OBS: Esse script funciona em TFS 1.1 E 1.2, para TFS 1.0 mude as funções: onLogin(player) --> onLogin(cid) player:getIp() --> Player(cid):getIp()
  2. Créditos: Elwyn, arquivo32 Tutorial creaturescripts/scripts/kill.lua function onKill(cid, target) if isPlayer(target) then doPlayerAddMoney(cid, 500) ---------- QUANTIDADE DE DINHEIRO, TA CONFIGURADO 500GPS end return true end creaturescripts.xml <event type="kill" name="KillPlayer" event="script" value="kill.lua"/> login.lua, antes de return true: registerCreatureEvent(cid, "KillPlayer")
  3. Créditos à zipter98. Objetivo Quando X item cair do loot de algum monstro, irá aparecer uma backpack ou bag (a que você preferir) e nela estará o item que você configurou no script. Isso é bom para deixar separados dos itens "sem valor", pois, você vai saber quando realmente cair um item valioso, porque irá aparecer a backpack/bag. É um script diferente que pode chamar a atenção dos players. Tutorial Vá até as pastas data/creaturescripts/scripts, crie o arquivo aparecerbag.lua e coloque: local bag = xxx -- ID da bag ou backpack local itens = {xxx, xxx, xxx} -- ID dos itens que serão colocados dentro da bag, caso dropados. function Loot(mName, mPosition) local items = {} for i = getTileInfo(mPosition).items, 1, -1 do mPosition.stackpos = i table.insert(items, getThingFromPos(mPosition)) end if #items == 0 then return true end local corpse = -1 for _, item in ipairs(items) do local name = getItemName(item.uid):lower() if name:find(mName:lower()) then corpse = item.uid break end end if not isContainer(corpse) then return true end if corpse == -1 then return true end for i = 0, getContainerSize(corpse) - 1 do local item = getContainerItem(corpse, i) if isInArray(itens, item.itemid) then doAddContainerItem(doAddContainerItem(corpse, bag, 1), item.itemid, item.type) doRemoveItem(item.uid) end end end function onKill(cid, target) if isMonster(target) then addEvent(Loot, 5, getCreatureName(target), getThingPos(target)) end return true end function onLogin(cid) registerCreatureEvent(cid, "lootItem") return true end Após isso vá em data/creaturescripts/ e abra o arquivo creaturescripts.xml. Adicione: <event type="login" name="lootLogin" event="script" value="aparecerbag.lua"/> <event type="kill" name="lootItem" script="aparecerbag.lua"/>
  4. Créditos à Kaneki. Objetivo O player quando logar pela primeira vez, aparecerá um popup que poderá ser um texto de ajuda para os novatos, ou como preferir. Ele aparecerá apenas uma vez. Tutorial Newlogin.lua function onLogin(cid) local config = { msginiciantes = "Bem vindo", sto = 13540, -- STORAGE } if getPlayerStorageValue(cid, sto) <= 0 then doPlayerPopupFYI(cid, config.msginiciantes) setPlayerStorageValue(cid, sto, 1) end return true end Creaturescripts.xml <event type="login" name="NewLogin" event="script" value="newlogin.lua"/> Login.lua registerCreatureEvent(cid, "NewLogin")
  5. Créditos à Wakon. Tutorial Em data/creaturescripts/scripts, no arquivo login.lua, adicione isso antes do ultimo return true: for b = 1, 5 do if player:getLevel(cid) <= 50 then player:addBlessing(cid, b) end end O "50" representa o level.
  6. Créditos à Wakon e zipter98. Objetivo Irá aparecer uma mensagem em laranja no Local Chat quando o membro da staff entrar. Aparecerá assim: (TUTOR) Fulano está online! Dúvidas no Help Channel. Tutorial Em data/creaturescripts/scripts, adicione staffon.lua e coloque: local groups = {2, 3} function onLogin(cid) if isInArray(groups, getPlayerGroupId(cid)) then doBroadcastMessage("["..getPlayerGroupName(cid).."] "..getPlayerName(cid)..", está online.") end return true end Após isso vá em data/creaturescripts abra o creaturescripts.xml e adicione a tag: <event type="login" name="StaffOn" event="script" value="staffon.lua"/> OBS. Está configurado para aparecer apenas para o cargo de Tutor e Senior Tutor. Caso queira alterar, basta mudar o ID "2" e "3".
  7. Créditos a Absolute. Objetivo Irá aparecer uma mensagem em vermelho no Default com a seguinte mensagem: [Player que morreu] acaba de ser humilhado pelo jogador [Player que matou ele] Tutorial Em creaturescripts.xml, adicione: <event type="kill" name="anunciarmorte" event="script" value="anunciar_morte.lua"/> Em creaturescripts/scripts, crie um arquivo com o nome anunciar_morte.lua e adicione: function onKill(cid, target, lastHit) if not isPlayer(target) or not isPlayer(cid) then return true end doBroadcastMessage(""..getCreatureName(target).."["..getPlayerLevel(target).."] acabou de ser humilhado pelo jogador "..getCreatureName(cid).."["..getPlayerLevel(cid).."].", MESSAGE_STATUS_CONSOLE_ORANGE) return true end Em creaturescripts/scripts e abra seu login.lua, abaixo de: registerCreatureEvent(cid, "Mail") ou qualquer linha parecida com registerCreature... adicione a linha: registerCreatureEvent(cid, "anunciarmorte")
  8. Este script foi feito por Comedinha. Créditos também a ViitinG. Objetivo Player já irá iniciar no servidor com os icones no mapa. Tutorial Crie o arquivo creaturescripts/scripts/iconmap.lua e adicione o seguinte conteúdo: local config = { storage = 030220122041, version = 1, marks = { {mark = 5, pos = {x = 1095, y = 1062, z = 7}, desc = "Temple."}, {mark = 4, pos = {x = 895, y = 996, z = 7}, desc = "Depot."} } } local f_addMark = doPlayerAddMapMark if(not f_addMark) then f_addMark = doAddMapMark end function onThink(cid, interval) if(isPlayer(cid) ~= TRUE or getPlayerStorageValue(cid, config.storage) == config.version) then return end for _, m in pairs(config.marks) do f_addMark(cid, m.pos, m.mark, m.desc ~= nil and m.desc or "") end setPlayerStorageValue(cid, config.storage, config.version) return TRUE end No arquivo creaturescripts/creaturescripts.xml adicione a tag: <event type="think" name="IconMap" event="script" value="iconmap.lua"/> No seu arquivo creaturescripts/scritps/login.lua adicione a seguinte linha no fim do script: registerCreatureEvent(cid, "IconMap") Caso seja TFS 1.0, use este valor: player:registerEvent(cid, "IconMap") Icones Como configurar {mark = 5, pos = {x = 1095, y = 1062, z = 7}, desc = "Temple."}, - Número do icone que vai aparecer no minimap. - Posição que o icone vai aparecer no minimap. - Descrição que vai aparecer quando deixar o ponteiro do mouse em cima do icone.
  9. Créditos a Limos. Objetivo Esse script se baseia em poder colocar senha em uma porta. Após a porta se abrir, depois de determinado tempo, ela se fechará novamente e só pode abri-lá com a senha. Prévias Tutorial Em data/creaturescripts/creaturescripts.xml adicione essa tag: <event type="textoparaporta" name="Senha" event="script" value="senhaporta.lua"/> Em data/creaturescripts/scripts/login.lua adicione esta tag no final do script: registerCreatureEvent(cid, "Senha") Em data/creaturescripts/scripts/senhaporta.lua adicione isto: local uniqueids = {8049, 8050} local passwords = { ["xTibia"] = {doorpos = {x = 163, y = 36, z = 7}, doorid = 6257, blackboardpos = {x = 162, y = 36, z = 7}, blackboardid = 1811, uniqueid = 8049, doorclosetime = 10}, ["XT"] = {doorpos = {x = 1000, y = 1000, z = 7}, doorid = 1213, blackboardpos = {x = 1000, y = 1000, z = 7}, blackboardid = 1811, uniqueid = 8050, doorclosetime = 10} } function onTextEdit(cid, item, newText) local x = passwords[newText] local function onCloseDoor() if(getTileItemById(x.doorpos,x.doorid+1).uid) > 0 then doTransformItem(getTileItemById(x.doorpos,x.doorid+1).uid, x.doorid) doSendMagicEffect(x.doorpos, CONST_ME_MAGIC_RED) end end for _, check in pairs(uniqueids) do if item.uid == check then if x and item.uid == x.uniqueid then if(getTileItemById(x.doorpos,x.doorid).uid) > 0 then doTransformItem(getTileItemById(x.doorpos,x.doorid).uid, x.doorid + 1) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Sua Senha "'..newText..'" esta correta, voce pode entrar.') addEvent(onCloseDoor,x.doorclosetime*1000) doRemoveItem(item.uid, 1) local blackboard = doCreateItem(x.blackboardid,1,x.blackboardpos) doItemSetAttribute(blackboard, "uid", x.uniqueid) else doRemoveItem(item.uid, 1) local blackboard = doCreateItem(x.blackboardid,1,x.blackboardpos) doItemSetAttribute(blackboard, "uid", x.uniqueid) doPlayerSendCancel(cid, 'A porta ja esta aberta, feche-a ou espera ela se fechar.') end else doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) doPlayerSendCancel(cid, 'Sua senha "'..newText..'" esta incorreta.') end end end return true end Como configurar local uniqueids = {8049, 8050} ["xTibia] = {doorpos = {x = 163, y = 36, z = 7}, doorid = 6257, blackboardpos = {x = 162, y = 36, z = 7}, blackboardid = 1811, uniqueid = 8049, doorclosetime = 10}, ["XT] = {doorpos = {x = 1000, y = 1000, z = 7}, doorid = 1213, blackboardpos = {x = 1000, y = 1000, z = 7}, blackboardid = 1811, uniqueid = 8050, doorclosetime = 10} } UniqueID que será colocado na placa que bota a senha. Senha que bota na placa para abrir a porta. Posição da porta. ID da porta. Posição da placa que bota a senha. ID da placa que bota a senha. Tempo para fechar a porta.
  10. Créditos ao gabra! Objetivo O script se baseia em deixar double exp apenas para x vocações. Tutorial Em data/creaturescripts/scripts/ crie um arquivo ExpVoc.lua e dentro coloque: local rate = 2 local rates = getPlayerRates(cid) local vocations = {9,10,11,12} -- ID das vocações function onLogin(cid) if isInArray(vocations,getPlayerVocation(cid)) then doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+rate) end return true end Para adicionar as vocações do seu servidor basta trocar os ID's em local vocations = {9,10,11,12} Em data/creaturescripts adicione no creaturescripts.xml a seguinte linha: <event type="login" name="ExpVoc" event="script" value="ExpVoc.lua"/> Em data/creaturescripts/scripts/ abra o arquivo login.lua e adicione: registerCreatureEvent(cid, "ExpVoc")
  11. Este script foi feito por MaXwEllDeN. Objetivo Quando player upar, irá aparecer essa mensagem informando para que level ele avançou e quais magias já pode usar. Crie o arquivo creaturescripts/scripts/advancespells.lua e adicione o seguinte conteúdo: function onAdvance(cid, skill, oldLevel, newLevel) if skill == SKILL__LEVEL then local spells = {} for index = 0, getPlayerInstantSpellCount(cid) - 1 do local spell = getPlayerInstantSpellInfo(cid, index) if spell.level > oldLevel and spell.level <= newLevel then table.insert(spells, " [".. spell.name .."] \"".. spell.words .. "\" Mana[".. spell.mana .."]") end end if #spells > 0 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "You have just advanced to level ".. newLevel .." and learned new spells!") for _, v in pairs(spells) do doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, v) end end end return true end No arquivo creaturescripts/creaturescripts.xml adicione a tag: <event type="advance" name="AdvLevelSpells" event="script" value="advancespells.lua" /> No seu arquivo creaturescripts/scritps/login.lua adicione a seguinte linha ANTES DO ÚLTIMO return true: registerCreatureEvent(cid, "AdvLevelSpells") Exemplo: registerCreatureEvent(cid, "AdvLevelSpells") return true end
  12. Fala galera do Xtibia tudo beleza? Hoje resolvi trazer aqui para vocês a Aol Infinita que não perde level items skills e é claro nem a aol. Então vamos lá... Vá até data\creaturescripts\scripts e crie um arquivo.lua e renomeie para aolinfinity.lua e cole isto dentro: function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)if isPlayer(cid) == true thenif (getPlayerSlotItem(cid, 2).itemid == 8409) then -- 8409 é a onde vocês vão por o ID da aol. doCreatureSetDropLoot(cid, false) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)return TRUEendendreturn TRUEend Agora vai em data\creaturescripts\scripts vá em login.lua e adicione essa linha abaixo: registerCreatureEvent(cid, "onPrepareDeathinifi") Depois vai em Creaturescripts.xml e adicione essa linha abaixo: <event type="preparedeath" name="onPrepareDeathinifi" event="script" value="aolinfinity.lua"/> E pra finaliza com chave de ouro vá em data\items abre o items.xml e adicione isso <item id="8409" article="a" name="aolinfinity"> <attribute key="weight" value="480" /> <attribute key="slotType" value="ring" /> <attribute key="charges" value="0" /> <attribute key="preventDrop" value="1" /> Prontinho espero que gostem xD Testado Com Sucesso!!! Créditos: Yan Liima Te ajudei?? REP + e ficamos quites... Atenciosamente, Yan Liima Abraços!
  13. Explicação: Ensinarei a como resolver o problema do exit trainer, que é quando você dá exit no trainer e o char contiuna online mesmo com a pessoa não estando lá, com isso automaticamente o ip do player é mudado para 0.0.0.0 e é assim que você toma um banimento de 30 dias do Otservlist, que é algo que ninguém deseja, não é mesmo?! otserv => data -> creaturescripts -> creaturescripts.xml: <!-- Idle --> <event type="think" name="Idle" event="script" value="idle.lua"/> otserv => data -> creaturescripts -> scripts -> idle.lua: local config = { idleWarning = getConfigValue('idleWarningTime'), idleKick = getConfigValue('idleKickTime') } function onThink(cid, interval) if(getTileInfo(getCreaturePosition(cid)).nologout or getCreatureNoMove(cid) or getPlayerCustomFlagValue(cid, PlayerCustomFlag_AllowIdle)) then return true end local idleTime = getPlayerIdleTime(cid) + interval doPlayerSetIdleTime(cid, idleTime) if(config.idleKick > 0 and idleTime > config.idleKick) then doRemoveCreature(cid) elseif(config.idleWarning > 0 and idleTime == config.idleWarning) then local message = "You have been idle for " .. math.ceil(config.idleWarning / 60000) .. " minutes" if(config.idleKick > 0) then message = message .. ", you will be disconnected in " local diff = math.ceil((config.idleWarning - config.idleKick) / 60000) if(diff > 1) then message = message .. diff .. " minutes" else message = message .. "one minute" end message = message .. " if you are still idle" end doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, message .. ".") end return true end otserv => data -> creaturescripts -> scripts -> login.lua: registerCreatureEvent(cid, "Idle") Otserv/config.lua: stopAttackingAtExit Deixe assim: stopAttackingAtExit = true Ou assim: stopAttackingAtExit = yes E para configurar o tempo de kikar o player após certo tempo sem mexer, é nessa parte aqui do config.lua: idleWarningTime = 9 * 60 * 1000 (após esse tempo dará um alerta para o player se mexer) idleKickTime = 10 * 60 * 1000 (após esse tempo o player será kikado) Créditos: Thiagobji
  14. Dbko

    Max Ml

    oi galera, como eu sou mas funcional pra servidores, de naruto, eu fico mas postando coisas, especial ou seja algo que ajude a os cara que procura por algo do tipo, o que é o sistema do max ml. todo servidores. tem um bug, do ml passar do 150. ir at 302930193. que os lek chega da hs. ou você ate desiste de por seu servidor online vamos deixar de blablabla, e vamos lá em creaturescripter/scripts/copie qualquer arquivo.lua e renomeie.para maxml apague tudo e substitua por isso em login adiciona de baixo desse código registerCreatureEvent(cid, "AdvanceSave") isso registerCreatureEvent(cid, "maxml") if getPlayerStorageValue(cid, 30130310) ~= -1 and getPlayerMagLevel(cid, true) >= getPlayerStorageValue(cid, 20130315) then doPlayerSetMagicRate(cid, 0) end em creaturescripts.xml adicione a seguinte tag <event type="advance" name="maxml" event="script" value="maxml.lua"/>
  15. olá galera olha eu de volta, tem muitas pessoas que tentou por pra funcionar o scripter da semahada, pra funciona o que é samehada, é uma sword de Kisame que ela suga chakra. no jogo ela vai só vai bate do chakra e rouba mana, oky então vamos lá vá em sua pasta do servidor Creaturescripts/scripts/ copie um arquivo.lua e renomeie para, samehada.lua e apague tudo e cole seguinte scripter ainda no creaturescriptes/scripter/login.lua adicione a seguinte tag registerCreatureEvent(cid, "samehada") em creaturescripts.xml abra como blocos de notas ou algum editor. e adicione a seguinte tag <event type="attack" name="samehada" event="script" value="samehada.lua"/> não lembro quem, a fez o sistema, mas vou por créditos desconhecido não sei o nome, mas quem souber avisa para eu por o crédito créditos: Autor Desconhecido.
  16. creaturescripts.xml <event type="advance" name="onadvance_reward" script="onadvance_reward.lua"/> <event type="login" name="onadv_register" script="onadvance_reward.lua"/> onadvance_reward.lua local rewards = { [SKILL_SWORD] = { {lvl = 150, items = {{2160, 2}, {2148, 1}}, storage = 54776}, {lvl = 160, items = {{2365, 2}}, storage = 54777} }, [SKILL_MAGLEVEL] = { {lvl = 100, items = {{2365, 2}}, storage = 54778}, }, [SKILL_LEVEL] = { {lvl = 480, items = {{2152, 2}}, storage = 54779}, }, } function onAdvance(player, skill, oldlevel, newlevel) local rewardstr = "Items received: " local reward_t = {} if rewards[skill] then for j = 1, #rewards[skill] do local r = rewards[skill][j] if not r then return true end if newlevel >= r.lvl then if player:getStorageValue(r.storage) < 1 then player:setStorageValue(r.storage, 1) for i = 1, #r.items do local itt = ItemType(r.items[i][1]) if itt then player:addItem(r.items[i][1], r.items[i][2]) table.insert(reward_t, itt:getName() .. (r.items[i][2] > 1 and " x" .. r.items[i][2] or "")) end end end end end if #reward_t > 0 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, rewardstr .. table.concat(reward_t, ", ")) end end return true end function onLogin(player) player:registerEvent("onadvance_reward") return true end
  17. O sistema é simples ao upar cada level você ganha x pontos de habilidade, onde é possível com esse pontos, comprar mana, hp, skill, etc ... /creaturescripts/scripts/skillpoints.lua /creaturescripts/scripts/login.lua player:registerEvent("SkillPointSystem") /talkactions/scripts/skillpoints.lua <event type="modalwindow" name="PointWindow" script="skillpoints.lua"/> <event type="advance" name="SkillPointSystem" script="skillpoints.lua"/> /talkactions/scripts/skillpoints.lua function onSay(player, words, param) local SKILL_POINTS = 45200 local Point = ModalWindow(1, "Skill Points", "You have skill " ..player:getStorageValue(SKILL_POINTS).. " points make your choice:\n\n Skill Required Points Increase Amount") Point:addChoice(1, "1. Health 1 2") Point:addChoice(2, "2. Mana") Point:addChoice(3, "3. Magic Level") Point:addChoice(4, "4. Sword") Point:addChoice(5, "5. Axe") Point:addChoice(6, "6. Club") Point:addChoice(7, "7. Shielding") Point:addChoice(8, "8. Distance") Point:addButton(1, 'Gain 1') Point:addButton(2, 'Gain 2') Point:addButton(3, 'Gain 5') Point:addButton(4, 'Cancel') player:registerEvent("PointWindow") Point:sendToPlayer(player) return false end /talkactions/talkactions.xml <talkaction words="!points" separator=" " script="skillpoints.lua"/> Créditos : zbisu, codinabacl, ninja, MadMook
  18. Bom eu e um colega meu fizemos este sistema para um antigo projeto nosso, e faz muito tempo e achei aqui no PC e como nunca tinha visto um igual resolvi postar nesta comunidade que de forma direta e/ou indireta sempre tem me ajudado, O que faz? Ao chegar em tal level (determinado pelo admin) o player receber uma nova vocacao e uma nova outfit. É o mesmo que o /transformar dos narutibias só que este só de chegar no level o cara ja transforma. Vamos ao código. Dentro da Pasta "data/creaturescripts/scripts" Crie um arquivo chamado Promovido.lua com o Seguinte Conteudo: local config = { --[vocation id] = { nova voc, looktype, efeito} [1] = { 1, 31, 111}, [ID da Vocacao Inicial] = { ID da Nova Vocacao, LookType da nova vocacao, Efeito}, } local lvlGain = Level em que ira alterar a vocacao. function onAdvance(cid, skill, oldLevel, newLevel) if (getPlayerLevel(cid) == lvlGain and getPlayerStorageValue(cid, 2012) ~= 1) then local voc = config[getPlayerVocation(cid)] if voc then doPlayerSetVocation(cid, voc[1]) doSendMagicEffect(getCreaturePosition(cid), voc[3]) local outfit = {lookType = voc[2]} doCreatureChangeOutfit(cid, outfit) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Parabéns, você agora é um Shippuden") setPlayerStorageValue(cid, 2012, 1) end return true end end Abra o Arquivo "data/creaturescripts/creaturescripts.xml" e adicione na penultima linha: <event type="advance" name="Promovido" event="script" value="promovido.lua"/> Créditos Me and Flaah
  19. Dodge System Introdução: - Fiz esse sistema pra ajuda um cara aqui no xtibia - Desculpa deu um erro na hora que eu fui posta. O que ele faz: - O sistema consiste em defender % dos ataques recebidos. Por Exemplo: Com 1 de dodge, voce vai ter 10% de chance de defender. Com 10 de dodge (vocês podem editar) você vai ter 50% de chance de defender, cada pedra (8302) que voce usar, sua skill de dodge aumenta em 1 ponto, podendo no maximo ter 100 pontos Vamos la. em creaturescript: dodgecombat.lua local storagedodge = 98798644 -- storage do dodge local cor = 35 -- cor do texto local effect = 30 -- id do magic effect local msg = "DODGE!" -- msg local dodge = { {min = 1, max = 2, chance = 10}, -- se o dodge tiver entre 1 e 2 tem 10% de chance de da dodge. {min = 3, max = 4, chance = 20}, -- podem ser configurada portanto que não passe do limite {min = 5, max = 6, chance = 30}, -- vocês pode adicionar mas se quiserem {min = 7, max = 8, chance = 40}, {min = 9, max = 10, chance = 45}, {min = 11, max = math.huge, chance = 50} } function onStatsChange(cid, attacker, type, combat, value) if not isCreature(cid) then return false end for _, tudo in pairs(dodge) do if getPlayerStorageValue(cid, storagedodge) >= tudo.min and getPlayerStorageValue(cid, storagedodge) <= tudo.max then local chancex = math.random(1, 100) if chancex <= tudo.chance then if combat ~= COMBAT_HEALING then doSendMagicEffect(getCreaturePosition(cid), effect) doSendAnimatedText(getCreaturePosition(cid), msg, cor) return false end end end end return true end Creaturescript.xml tag <event type="StatsChange" name="CombatDodge" event="script" value="CombatDodge.lua"/> Login.lua antes do ultimo return true registerCreatureEvent(cid, "CombatDodge") em action: dodgestone.lua local limite = 100 -- limite de dodge local storagedodge = 98798644 -- storage do dodge function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, storagedodge) == -1 then doPlayerSetStorageValue(cid, storagedodge, (getPlayerStorageValue(cid, storagedodge)) + 2) doPlayerSendCancel(cid, " DodgeSKILL:["..getPlayerStorageValue(cid, storagedodge).."/"..limite.."].") elseif getPlayerStorageValue(cid, storagedodge) >= -1 and getPlayerStorageValue(cid, storagedodge) <= limite then doPlayerSetStorageValue(cid, storagedodge, (getPlayerStorageValue(cid, storagedodge)) + 1) doPlayerSendCancel(cid, " DodgeSKILL:["..getPlayerStorageValue(cid, storagedodge).."/"..limite.."].") doRemoveItem(item.uid, 1) else doPlayerSendCancel(cid, "Voce ja chego no maximo.DodgeSKILL:["..getPlayerStorageValue(cid, storagedodge).."/"..limite.."]") end return true end action.xml tag <action itemid="8302" event="script" value="dodgestone.lua"/> Comente oque deve melhora, oque ta de errado.
  20. Olá , gostaria de saber como eu posso aumentar a vida de um pokemon especificado . Eu quero editar a vida / ataque de pokemons lendários , gostaria de balancia-los . Se tiver algum tipo de tópico aqui no xtibia me passem por favor !
  21. EFEITO COM TODOS ITEMS NO UPGRADE MAXIMO Existe varios servidores que estão adaptanto o upgrade system, ou seja poder deixar os items +1, +2, +3 até o maximo configurado, então eu fiz esse script baseando no MU Online, aonde quando se tem todos os items por exemplo no +13, fica saindo efeitinhos no jogador, bom segue o script: creaturescripts/scripts/upgradeEffect.lua -- CONFIGURAÇÕES -- MAXUPGRADE = 9 -- nivel que os items precisarão estar para sair o efeito ANIMATIONEFFECT = 1 -- numero do efeito DELAYEFFECT = 1000 -- de quanto em quanto tempo saira o efeito (1000 = 1s) NEEDBOOTS = true -- as botas tbem precisam estar no nivel maximo ? (existe sistema de upgrade que não é possivel usar nas botas, caso o seu for deixe "false") ------------------- function thinkEffect(cid, mU, aE, dE, nB) if not isCreature(cid) then return true end local slots = nB and {1, 4, 7, 8} or {1, 4, 7} local result = true for _, slot in pairs(slots) do if getPlayerSlotItem(cid, slot).uid > 0 then local itemName = getItemAttribute(getPlayerSlotItem(cid, slot).uid, "name") if itemName:find("+" .. mU) or itemName:find("+ " .. mU) then result = true else result = false break end end end if result then doSendMagicEffect(getThingPos(cid), aE) end addEvent(thinkEffect, dE, cid, mU, aE, dE, nB) end function onLogin(cid) return thinkEffect(cid, MAXUPGRADE, ANIMATIONEFFECT, DELAYEFFECT, NEEDBOOTS) end toda configuração esta no script, creio q funcione com todos sistemas de upgrade, pois a maioria usa a msm função para editar o nome do item, oque pode mudar é q uns upgrade system não aceitam aprimorar as botas, mais isto esta configuravel no script tbem. creaturescripts/creaturescripts.xml <event type="login" name="UpgradeEffect" event="script" value="upgradeEffect.lua"/> flw
  22. Ola adiciona 1 negocio pra min aki no login.lua nao to conseguindo adicona isto registerCreatureEvent(cid, "maxml") if getPlayerStorageValue(cid, 20130314) ~= -1 and getPlayerMagLevel(cid, true) >= getPlayerStorageValue(cid, 20130314) then doPlayerSetMagicRate(cid, 0) end return true end O meu Login.lua é esse local config = { loginMessage = getConfigValue('loginMessage'), useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')) } function onLogin(cid) local loss = getConfigValue('deathLostPercent') if(loss ~= nil) then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10) end local accountManager = getPlayerAccountManager(cid) if(accountManager == MANAGER_NONE) then local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage if(lastLogin > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "." end doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) elseif(accountManager == MANAGER_NAMELOCK) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?") elseif(accountManager == MANAGER_ACCOUNT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.") end if(not isPlayerGhost(cid)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end registerCreatureEvent(cid, "Mail") registerCreatureEvent(cid, "GuildMotd") registerCreatureEvent(cid, "Idle") if(config.useFragHandler) then registerCreatureEvent(cid, "SkullCheck") end registerCreatureEvent(cid, "ProtDeath") registerCreatureEvent(cid, "Biohazard") registerCreatureEvent(cid, "ZombieAttack") registerCreatureEvent(cid, "WeaponMana") registerCreatureEvent(cid, "showVoc") registerCreatureEvent(cid, "ReportBug") registerCreatureEvent(cid, "AdvanceSave") return true end registerCreatureEvent(cid, "maxml")
  23. Death System Introdução: Vamos pessoal participar da oms, esse sistema faz com que quando um player mate o outro apareça um ceifeiro vindo pega a alma dele. Vamos la começar a add a script Em creaturescript/script, crie DeathSystem.lua -- Do not remove the credits -- -- [CREATURESCRIPT] Death System -- -- developed by Rigby to help DuuhCarvalho -- -- Especially for the Xtibia.com -- function onDeath(cid, corpse, killer) local pos = getCreaturePosition(cid) local monster = 'ceifeiro' local timer = 3 -- quanto tempo vai demorar pra sumir function removeMonster() for _, pid in ipairs(getCreatureSummons(killer[1])) do doRemoveCreature(pid) end return true end if isPlayer(cid) and isPlayer(killer[1]) then doConvinceCreature(killer[1], doCreateMonster(monster, pos)) doSendAnimatedText(getThingPos(cid), "DEATH!", 125) doSendMagicEffect(getThingPos(cid), 65) addEvent(removeMonster, timer*1000) end return true end Creaturescript.xml tag <event type="death" name="DeathSystem" event="script" value="DeathSystem.lua"/> Login.lua antes do ultimo return true registerCreatureEvent(cid, "DeathSystem") Agora vamos criar o ceifeiro em monster crie um ceifeiro.xml <?xml version="1.0" encoding="UTF-8"?> <monster name="Ceifeiro" nameDescription="a ceifeiro" race="blood" experience="0" speed="0" manacost="220"> <health now="9999999999999" max="9999999999999"/> <look type="300" corpse="5971"/> <targetchange interval="2000" chance="0"/> <strategy attack="100" defense="0"/> <flags> <flag skull="5"/> <flag summonable="1"/> <flag attackable="1"/> <flag hostile="0"/> <flag illusionable="1"/> <flag convinceable="1"/> <flag pushable="1"/> <flag canpushitems="0"/> <flag canpushcreatures="0"/> <flag targetdistance="1"/> <flag staticattack="90"/> <flag runonhealth="8"/> </flags> <defenses armor="1" defense="2"/> <immunities> <immunity physical="0"/> <immunity energy="0"/> <immunity fire="0"/> <immunity poison="0"/> <immunity lifedrain="0"/> <immunity paralyze="0"/> <immunity outfit="0"/> <immunity drunk="0"/> <immunity invisible="0"/> </immunities> <voices interval="2000" chance="100"> <voice sentence="HAHAHAHA"/> </voices> </monster> em monsters.xml adicione essa tag antes do ultimo </monsters> <monster name="Ceifeiro" file="ceifeiro.xml"/> Espero que gostem.
  24. resolvi postar esse script por que fiz um mais elaborado. lembrando que o meu ta configurado pro meu servidor Naruto Legends, então no local vocs, vocês colocam o nome conforme é a voc do servidor de vocês. crie um arquivo em creaturescripts com o nome description.lua e adicione isso depois em creaturescripts.xml adicione: <event type="look" name="GraduationSystem" event="script" value="description.lua"/> agora no login.lua você adiciona essas duas linhas registerCreatureEvent(cid, "GraduationSystem") setPlayerStorageValue(cid, 20900, "Gennin") -- aqui você muda pra gradução que você quer "Gennin" "Chunnin" etc serve pra outras coisas também
  25. Introdução: esse script faz com que ao alcançar determinado level o player irá receber uma nova vocação. Em creaturescripts\scripts crie: changevoc.lua --[[Script desenvolvido por Desperate]]-- function onAdvance(cid, skill, oldLevel, newLevel) if newLevel == 20 then doPlayerSetVocation(cid, 2) doPlayerSendTextMessage(cid, 22, "Você foi promovido à (nome da vocação)!") doSendMagicEffect(getCreaturePosition(cid), 11) elseif newLevel == 40 then doPlayerSetVocation(cid, 3) doPlayerSendTextMessage(cid, 22, "Você foi promovido à (nome da vocação)!") doSendMagicEffect(getCreaturePosition(cid), 11) end return true end Tag do creaturescripts.xml <event type="advance" name="ChangeVoc" event="script" value="changevoc.lua"/> Adicione no login.lua registerCreatureEvent(cid, "ChangeVoc") Esse foi meu primeiro script, espero que gostem. Dúvidas e/ou criticas comentem. Creditos: Desperate
×
×
  • Criar Novo...