-
Total de itens
311 -
Registro em
-
Última visita
-
Dias Ganhos
8
Tudo que meubk postou
-
meu script : http://www.xtibia.com/forum/topic/156691-globalevents-invasao/ :smile_positivo:
-
Ajuda Com Script Q Mostra O Tanto Que Reala
tópico respondeu ao Jonasman de meubk em Lixeira Pública
procura no config.lua essa parte: showHealingDamage = true showHealingDamageForMonsters = true ai vc verifica se os 2 está true -
sim acabei de arrumar isso, só atualizar o script de NPC.
-
eu ñ sabia desse global.lua, mais como o demonbholder explicou, espero que de tudu certo, obrigado pela atenção.
-
acabei de baixar um server 8.7 aki no xtibia para verificar se não avia a pasta lib, e está normal.
-
Olá hoje venho trazer um sistema não tão inovador por varios servers tem, porem o meu é mto diferente, para escolher sua aura vc precisa conversar com um npc, onde vc pode configurar para ser paga, precisar de level, ou somente para premiuns, no meu sistema está disponiveis as seguintes auras: Fire Ice Earth Death Holy Energy Que são os tipos mais comuns de magias do tibia, bom no script, enquanto vc está parado a aura são simples efeitos que acompanham o player e não foi feio por OnThink que pode causar lags no servidor, foi feito de um modo diferente, qndo vc está sendo atacado dependendo da chance escolhida a aura libera poderes, acertando alvos que estão te atacando, isso acontece automaticamente. Bom chega de explicação e vamos a instalação. Entre na pasta data/lib e crie um arquivo chamado configAura.lua e cole o seguinte código: -- [[ AURA SYSTEM LIB (BY: XXOTSERVXX) ]] -- -- [[ CONFIGURAÇÕES DO NPC ]] -- npc = { level = 1, -- level para pegar aura (1 para não precisar) price = 0, -- preço para comprar a aura (0 para ser gratis) premmy = false, -- precisar ser premium (false para não precisar) } -- [[ OUTRAS CONFIGURAÇÕES ]] -- auexchance = 20 -- chance de acontecer uma explosão de aura(maixmo 100) aurast = 56897 -- storage da aura (troque se ja estiver usando ela) Bom nesse script é onde você vai poder configurar variias coisas do script, é só seguir os comentários no script. Continuando na mesma pasta data/lib crie outro arquivo com o nome libAura.lua e cole o seguinte script: -- [[ FUNÇÕES ]] -- au = { ["fire"] = {ef = {5, 6, 15, 36}, sh = 3, dmg = COMBAT_FIREDAMAGE}, ["ice"] = {ef = {41, 42, 43}, sh = 28, dmg = COMBAT_ICEDAMAGE}, ["earth"] = {ef = {8, 45, 20}, sh = 29, dmg = COMBAT_EARTHDAMAGE}, ["death"] = {ef = {17, 34, 38}, sh = 31, dmg = COMBAT_DEATHDAMAGE}, ["holy"] = {ef = {39, 49}, sh = 30, dmg = COMBAT_HOLYDAMAGE}, ["energy"] = {ef = {11, 47, 48}, sh = 35, dmg = COMBAT_ENERGYDAMAGE} } function isAura(cid) if type(getPlayerStorageValue(cid, aurast)) == "string" then return true end return false end function addAura(cid, aura) return setPlayerStorageValue(cid, aurast, aura) end function getAura(cid) return getPlayerStorageValue(cid, aurast) end function startAura(cid, aura) a = au[aura] if not isCreature(cid) then return true end doSendMagicEffect(getThingPos(cid), a.ef[math.random(1, #a.ef)]) addEvent(startAura, 2000, cid, aura) end arrex = createCombatArea{ {0, 0, 1, 0, 0}, {0, 1, 1, 1, 0}, {1, 1, 2, 1, 1}, {0, 1, 1, 1, 0}, {0, 0, 1, 0, 0} } function sendExplosion(cid, aura, model) rateatk = math.ceil(getPlayerLevel(cid)/2*1,5) a = au[aura] min, max = rateatk/2, rateatk if model == 1 then doAreaCombatHealth(cid, a.dmg, getThingPos(cid), arrex, -min, -max, a.ef[math.random(1, #a.ef)]) elseif model == 2 then for i = 0, 3 do doSendDistanceShoot(getThingPos(cid), getPositionByDirection(getThingPos(cid), i, 1), a.sh) doAreaCombatHealth(cid, a.dmg, getPositionByDirection(getThingPos(cid), i, 1), 0, -min, -max, a.ef[math.random(1, #a.ef)]) end end end function getPositionByDirection(position, direction, size) -- TFS FUNCTION local n = size or 1 if(direction == NORTH) then position.y = position.y - n elseif(direction == SOUTH) then position.y = position.y + n elseif(direction == WEST) then position.x = position.x - n elseif(direction == EAST) then position.x = position.x + n elseif(direction == NORTHWEST) then position.y = position.y - n position.x = position.x - n elseif(direction == NORTHEAST) then position.y = position.y - n position.x = position.x + n elseif(direction == SOUTHWEST) then position.y = position.y + n position.x = position.x - n elseif(direction == SOUTHEAST) then position.y = position.y + n position.x = position.x + n end return position end Neste script não é recomendado mexer a não ser que vc seje um scritper e saiba oque faça. Agora entre na pasta data/creaturescripts/scripts e crie um arquivo chamado creatureAura.lua e cole o seguinte código: function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS then if isAura(cid) then if math.random(1, 100) < auexchance then sendExplosion(cid, getAura(cid), math.random(1, 2)) end end end return true end function onLogin(cid) if isAura(cid) then startAura(cid, getAura(cid)) end return true end Também não é recomendando mexer, continuando nesta mesma pasta (data/creaturescripts/scripts) procure pelo login.lua e no final do script antes do return true end, cole isto: registerCreatureEvent(cid, "loginAura") registerCreatureEvent(cid, "statsAura") Vá na pasta anterior data/creaturescripts e procure pelo arquivo creaturescripts.xml e adicione as seguintes tags: <event type="login" name="loginAura" event="script" value="creatureAura.lua"/> <event type="statschange" name="statsAura" event="script" value="creatureAura.lua"/> Agora entre na pasta data/npc e crie um arquivo chamado Npc Aura.xml e cole o seguinte codigo: <?xml version="1.0" encoding="UTF-8"?> <npc name="Npc Aura" script="npcAura.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="128" head="55" body="53" legs="42" feet="0" addons="2"/> <parameters> <parameter key="message_greet" value="Ola, diga {aura} para ver as auras disponiveis."/> </parameters> </npc> Entre na pasta data/npc/scripts e crie um arquivo chamado npcAura.lua e cole o seguinte código: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, 'aura') then if not isAura(cid) then selfSay('Temos disponiveis as seguintes auras: {fire}, {ice}, {earth}, {death}, {holy} e {energy}, qual você quer aprender ?', cid) talkState = 1 else selfSay('Você já tem á '..getAura(cid).." aura.", cid) end elseif isInArray({"fire", "ice", "earth", "death", "holy", "energy"}, msg) and talkState == 1 then if getPlayerLevel(cid) < npc.level then return selfSay("Desculpe mais para aprender a aura é preciso level "..npc.level..".") end if getPlayerMoney(cid) < npc.price then return selfSay("Desculpe mais para aprender a aura é preciso "..npc.price.."gps.") end if not isPremium(cid) and npc.premmy then return selfSay("Desculpe mais para aprender a aura é preciso ser premium.") end addAura(cid, msg) startAura(cid, getAura(cid)) doPlayerRemoveMoney(cid, npc.price) selfSay("Você acaba de receber á "..getAura(cid).." aura.") talkState = 2 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Bom para quem não entende de script é recomendando mexer somente no configAura.lua da pasta data/lib, lá é possivel configurar de modo funcional. Obrigado por ter visto este tópico Fuii.
-
Obrigado apocarai, tudu que sei, devo a vc.
-
tem varios tutoriais aki no xtibia, exemplo: [Globaleventes] Teleports Falantes By RookWar [06/02/2010] Teleports Falantes Modo Facil
-
Olá depois de um tempo, afastado voltei, e trouxe um script bem legal e interessante é um script para fazer invasões. Instalando Entre na pasta data/globalevents/scripts e crie um arquivo com o nome de inv.lua e cole o seguinte código: local i = { ["00:00"] = {nome = "Demon Invasões", pos = {x=1000, y=1000, z=7}, monster = {"40 Demon", "50 Fire Devil", "4 Orshabaal"}}, ["21:00"] = {nome = "Dragon Invasões", pos = {x=1000, y=1000, z=7}, monster = {"100 Dragon"}}, } function onThink(interval, lastExecution) hours = tostring(os.date("%X")):sub(1, 5) tb = i[hours] if tb then doBroadcastMessage(hours .. " - " .. tb.nome .. " Iníciou.") for _,x in pairs(tb.monster) do for s = 1, tonumber(x:match("%d+")) do doSummonCreature(x:match("%s(.+)"), tb.pos) end end end return true end Depois vá na pasta data/globalevents e procure pelo arquivo globalevents.xml e adicione a seguinte tag: <globalevent name="Invasao" interval="60" event="script" value="inv.lua"/> Adicionando Invasões No arquivo inv.lua vc segue a seguinte tabela: local i = { ["00:00"] = {nome = "Demon Invasões", pos = {x=1000, y=1000, z=7}, monster = {"40 Demon", "50 Fire Devil", "4 Orshabaal"}}, ["21:00"] = {nome = "Dragon Invasões", pos = {x=1000, y=1000, z=7}, monster = {"100 Dragon"}}, } Para adicionar mais eventos é simples, somente configurar: ["HORA DA INVASÃO"] = {nome = "NOME DA INVASÃO", pos = {POSIÇÃO X, Y, Z}, monster = {"MONSTROS"}}, Á hora da invasão é colocada entre " " e somente a hora e minuto, segundos não precisa exemplo: "15:00" Á Posição está entre { } adicionando as posições x, y e z, exemplo: {x=1688, y=1445, z=7} Os monters tem um modo especial de configurar, vc coloca entre { }, e cada monstro entre " ", e entre as " " vc adiciona "QUANTIDADE MONSTRO", e para adicionar mais tipos de monstro se separa por virgulas, exemplo: {"40 Water Elemental", "5 Cyclops"} E no final de cada invasão não esqueça a virgula, exemplo: ["21:00"] = {nome = "Dragon Invasões", pos = {x=1000, y=1000, z=7}, monster = {"100 Dragon"}}, Então é isso, qualquer erro só falar. Fui.
-
mesmo esquema do de cima, só que vc só configura o limite ali... LIMITE = 1 -- limite de players com mesmo ip function onLogin(cid, words, param, channel) x = {} for _, pid in pairs(getPlayersOnline()) do if getPlayerIp(pid) == getPlayerIp(cid) then table.insert(x, pid) end end if #x > LIMITE then for _,pid in pairs(x) do doPlayerSendTextMessage(pid, 27, "Este Char Será logado em 5 segundos por haver outro char com mesmo ip.") addEvent(doRemoveCreature, 5000, pid) end end return true end se variso players tiver em lan, vai ser meio tenso.
-
e eu divulguei por acaso ? até hj ñ sei como foi parar aki...
-
ACTION na pasta scripts crie um arquivo lua: ID_FECHADO = 5475 ID_ABERTO = 5474 function onUse(cid, item) if item.itemid == ID_FECHADO then return doTransformItem(item.uid, ID_ABERTO) elseif item.itemd == ID_ABERTO then return doCreatureAddHealth(cid, -getCreatureHealth(cid)) end end Configure o ID_FECHADO e ID_ABERTO.. depois no actions.xml á seguitne tag ( tambem configurar o ID_FECHADO e ID_ABERTO ) <action itemid="ID_FECHADO;ID_ABERTO" event="script" value="NOME DO ARQUIVO.lua"/>
-
Reportado para fechar, eu qui fiz, e já cansei de fechar tópicos com esse script.
-
vlw demon, como eu disse ñ testei, mais vlw. ja atualizei
-
xml: <?xml version="1.0" encoding="UTF-8"?> <npc name="Name Changer" script="nome do arquivo.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="128" head="17" body="54" legs="114" feet="0" addons="2"/> <parameters> <parameter key="message_greet" value="Ola, diga {change} para trocar seu nome."/> </parameters> </npc> script: local configs = { max = 14, -- tamanho maximo do nome invalid = {"!", ".", ",", "@", "#", "GOD", "ADM"}, -- caracters invalidos diamondid = 2145, -- id do diamante count = 5 -- tantos de diamond que precisa } local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, 'change') and talkState ~= 1 then c = configs if getPlayerItemCount(cid, c.diamondid) < c.count then return selfSay('Voce precisa pelo menos de '..c.count.." "..getItemNameById(c.diamondid).." para trocar seu nome.", cid) end talkState = 1 elseif talkState == 1 and msg ~= "" then for _,d in pairs(c.invalid) do if string.find(msg, d) then return selfSay('Caracters invalidos não são permitidos.') end end if string.len(msg) > c.max then return selfSay('Você ultrapasou o limite de caracters.') end doPlayerRemoveItem(cid, c.diamondid, c.count) db.executeQuery("UPDATE `players` SET `name` = '"..msg.."' WHERE `id` = "..getPlayerGUID(cid)..";") doPlayerSendTextMessage(cid, 25, "Você será relogado em 5 segundos.") addEvent(doRemoveCreature, 5*1000, cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) configure o xml como kiser, e o npc tbem na tabela: local configs = { max = 14, -- tamanho maximo do nome invalid = {"!", ".", ",", "@", "#", "GOD", "ADM"}, -- caracters invalidos diamondid = 2145, -- id do diamante count = 5 -- tantos de diamond que precisa } qualker erro mi diga pq ñ testei.
-
function onUse(cid, item, frompos, item2, topos) queststatus = getPlayerStorageValue(cid,90978) if queststatus ~= 1 then doPlayerSendTextMessage(cid,22,"Você Ganhou Um Black Ring!") doPlayerAddItem(cid,10502,1) setPlayerStorageValue(cid,90978,1) else doPlayerSendTextMessage(cid,22,"Você ja fez essa quest!") end return true end na tag vc ponha: <action uniqueid="UNIQUE ID COLOCADO NO MAP EDITOR" event="script" value="NOMI DO SCRIPT.lua"/>
-
Bom tá ai se for pra mudar a outflit tbem vc mi avisa. function getMembersGuildOnline(GuildName) -- function by xxotservxx tb = {} for _, on in pairs(getPlayersOnline()) do if getPlayerGuildName(on) == GuildName then table.insert(tb, on) end end return tb end function getGuildLeaderName(GuildName) -- function by vodkart local leader = db.getResult("SELECT `players`.`name` FROM `players` WHERE `players`.`id` = (SELECT `guilds`.`ownerid` FROM `guilds` WHERE `guilds`.`name` = ".. db.escapeString(GuildName) .. ")") if(leader:getID() ~= -1) then return leader:getDataString("name") end return nil end function onSay(cid) g = getMembersGuildOnline(getPlayerGuildName(cid)) if #g ~= 0 then if getGuildLeaderName(getPlayerGuildName(cid)) == getCreatureName(cid) then o = getCreatureOutfit(cid) for _,mem in pairs(g) do c = getCreatureOutfit(mem) doCreatureChangeOutfit(mem, { lookType = c.lookType, lookHead = o.lookHead, lookBody = o.lookBody, lookLegs = o.lookLegs, lookFeet = o.lookFeet, lookAddons = c.lookAddons }) doSendMagicEffect(getThingPos(mem), 24) end else doPlayerSendCancel(cid, "You not is Guild Leader.") end else doPlayerSendCancel(cid, "You dont have any guild.") end return true end tag: talkaction words="!go" event="script" value="NOME_DO_ARQUIVO.lua"/> qualquer erro mi avisa pq ñ testei.
-
function onSay(cid,words,param) jailpos, unjailpos = {x=520, y=373, z=7}, {x=449, y=366, z=7} -- pos do julgamento e de saida. if isPlayer(getPlayerByName(param)) then target = getPlayerByName(param) doPlayerSendTextMessage(target,25,'Voce foi julgado pelo '..getPlayerName(cid)..' por no minimo 20 minutos.') -- Mensagem que aparecera para ele doTeleportThing(target, jailpos) doPlayerSendTextMessage(cid, 21,"Voce esta em JULGAMENTO "..param..".")} addEvent(doTeleportThing, 20*60*1000, target, unjailpos) -- tempo em que ele ficara em julgamento. end return true end se ele logar e tiver no julgamento, ele num sai mais de lá...
-
ñ tem necessidade de por == true, estude mais por favor.
-
desculpe, arrumado.
-
atualizado acima, só pegar.
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.