Ir para conteúdo

zipter98

Herói
  • Total de itens

    2553
  • Registro em

  • Última visita

  • Dias Ganhos

    72

Tudo que zipter98 postou

  1. Ops. Troque: for i = 1, #SOUNDS do SOUNDS[i].sound = SOUNDS_CONFIG.folder .. SOUNDS[i].sound end por: for i = 1, #SOUNDS do local newSound = type(SOUNDS[i].sound) == "table" and SOUNDS[i].sound[math.random(#SOUNDS[i].sound)] or SOUNDS[i].sound SOUNDS[i].sound = SOUNDS_CONFIG.folder .. newSound end
  2. Não. As funções que enviei o link são responsáveis por manipular storages da account. Sem elas, o código que enviei não vai funcionar.
  3. zipter98

    Oie =)

    ;s
  4. Não. Na função magicEffect316 há um loop que envia um efeito para cada instância da tabela effect. for i=1, #effect do local position = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} doSendMagicEffect(position, effect[i]) end
  5. Troque: for i = 1, #SOUNDS do if(isInPos(pos, SOUNDS[i].fromPos, SOUNDS[i].toPos)) then if(toPlay) then toPlay.priority = toPlay.priority or 0 if((toPlay.sound~=SOUNDS[i].sound) and (SOUNDS[i].priority>toPlay.priority)) then toPlay = SOUNDS[i] end else toPlay = SOUNDS[i] end end end por: for i = 1, #SOUNDS do if(isInPos(pos, SOUNDS[i].fromPos, SOUNDS[i].toPos)) then if(toPlay) then toPlay.priority = toPlay.priority or 0 if((toPlay.sound~=SOUNDS[i].sound) and (SOUNDS[i].priority>toPlay.priority)) then toPlay = SOUNDS[i] end else toPlay = SOUNDS[i] if type(toPlay.sound) == "table" then toPlay.sound = toPlay.sound[math.random(#toPlay.sound)] end end end end Para mais de uma música, coloque-as numa tabela. Exemplo: SOUNDS = { -- PVP {fromPos = {x=936, y=1025, z=13}, toPos = {x=952, y=1043, z=13}, priority = 1, sound="Balada.ogg"}, {fromPos = {x=x, y=y, z=z}, toPos = {x=x, y=y, z=z}, priority = 1, sound = {"PkmCenter.ogg", "PkmCenter2.ogg", "BW_PkmCenter.ogg"}}, } ----------
  6. Se não funcionar o método acima, poste (em spoiler) o conteúdo do arquivo exp2.0.lua.
  7. Instale essas funções no seu servidor, antes de tudo. local points, storage = 30, 48481 function onUse(cid) if getAccountStorageValue(getPlayerAccountId(cid), storage < 1 then doPlayerSendTextMessage(cid, 27, "You received "..points.." points.") setAccountStorageValue(getPlayerAccountId(cid), storage, 1) doAccountAddPoints(cid, 30) else doPlayerSendCancel(cid, "You have already done this quest.") end return true end
  8. -- Do not remove the credits -- -- [MOVEEVENT] Limite de player por sala -- -- Developed by Rigby -- -- Especially for the Xtibia.com -- function onUse(cid, item, topos) local config = { -- Config -- -- [ACTIONID] = {area = getPlayersInArea(AREA QUE IRA CHECAR (FROMPOS,TOPOS)), amountOfPlayers = QUANTIDADE QUE CABE} [50000] = {area = getPlayersInArea({x = 1030, y = 1020, z = 7}, {x = 1040, y = 1030, z = 7}), amountOfPlayers = 1} -- Config -- } if config[item.actionid] then if #config[item.actionid].area >= config[item.actionid].amountOfPlayers then return doPlayerSendCancel(cid, 'Ja tem um player fazendo a quest, aguarde...') end doTeleportThing(cid, topos, true) end return true end function getPlayersInArea(fromPos, toPos) -- Function made by Vodkart local players = {} for _, pid in ipairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), fromPos, toPos) then table.insert(players, pid) end end return players end
  9. Sim, basta configurar na tabela effect. Ex.: local effect = {316, 19} -- effect no player
  10. O problema provavelmente está em wildpoke.lua ou exp2.0.lua.
  11. local storage = {key, value} --Storage, valor. function onStepIn(cid) if not isPlayer(cid) then return true end setPlayerStorageValue(cid, storage[1], storage[2]) return true end
  12. Ah, entendi. Isso, na verdade, não seria uma spell, e sim o ataque básico do jogador. Provavelmente há algum creaturescript bloqueando o dano de players, talvez um onAttack ou um onStatsChange retornando falso. Recomendaria procurar por tais arquivos, e, caso não tenha noções de Lua, postá-los aqui.
  13. local config = { level = 50, count = 5, messages = { [12000] = "A guild %s está penetrando no castelo.", [12001] = "A guild %s já está dentro do castelo.", [12002] = "A guild %s está perto de conquistar o castelo." } } function table.insert(table, value) table[#table + 1] = value end function getGuildOnlineMembers(guildId) local pid, ip = {}, {} for _, cid in pairs(getPlayersOnline()) do if getPlayerGuildId(cid) == guildId and getPlayerLevel(cid) >= config.level and not isInArray(ip, getPlayerIp(cid)) then table.insert(pid, cid) table.insert(ip, getPlayerIp(cid)) end end return pid end function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true end if item.actionid == 12000 then if getPlayerGuildId(cid) < 1 or #getGuildOnlineMembers(getPlayerGuildId(cid)) < config.count then doPlayerSendCancel(cid, "Você precisa estar em guild ou sua guild precisa ter no minimo "..config.count.." jogadores level "..config.level.." ou mais.") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) doTeleportThing(cid, fromPosition, true) return true end end if getGlobalStorageValue(item.actionid + 4819) < os.time() then broadcastMessage(config.messages[item.actionid]:format(getPlayerGuildName(cid))) setGlobalStorageValue(item.actionid + 4819, os.time() + 10) end return true end
  14. Desculpe, não jogo Tibia e, logo, não entendi as referências acima. Basicamente, você quer uma spell que só possa ser usada a 1 SQM de distância do alvo e que altere a sprite do jogador por uma fração de segundo, simulando um soco? Um vídeo ou gif poderiam também ajudar na compreensão.
  15. data/creaturescripts/scripts local config = { name = "monster_name", --Nome do monstro. minDamage = 7000, --Dano mínimo para receber as recompensas. items = { prize = {itemid, count}, --{ID do item, quantidade} medal = xxx, --ID da medalha. }, storage = 91828, } function onStatsChange(cid, attacker, type, combat, value) if isPlayer(attacker) and isMonster(cid) and getCreatureName(cid) == config.name and type == STATSCHANGE_HEALTHLOSS then local damage = getPlayerStorageValue(attacker, config.storage) < 1 and 0 or getPlayerStorageValue(attacker, config.storage) setPlayerStorageValue(attacker, config.storage, damage + value) end return true end function onDeath(cid, corpse, deathList) for _, pid in pairs(deathList) do local damage = getPlayerStorageValue(pid, config.storage) if damage >= config.minDamage then doPlayerSendTextMessage(pid, 27, "For helping killing "..config.name..", you received a medal and "..config.items.prize[2].."x "..getItemNameById(config.items.prize[1])..".") doPlayerAddItem(pid, config.items.prize[1], config.items.prize[2]) doItemSetAttribute(doPlayerAddItem(pid, config.items.medal, 1), "description", "Medalha de honra ganha por "..getCreatureName(pid).." por ajudar a derrotar o "..config.name.." no dia "..os.date("%D")..".") setPlayerStorageValue(pid, config.storage, -1) end end db.executeQuery("UPDATE player_storage SET value = -1 WHERE key = "..config.storage) return true end Tags: <event type="statschange" name="mDamage" event="script" value="nome_do_arquivo.lua"/> <event type="death" name="mItems" event="script" value="nome_do_arquivo.lua"/> Em login.lua: registerCreatureEvent(cid, "mDamage") No arquivo .xml do monstro: <script> <event name="mItems"/> </script>
  16. Desculpe minha má interpretação, mas você quer que a poção cure 150k ou, caso o valor máximo de HP/mana ultrapasse esse limite, a quantia curada seja essa?
  17. Mesmo se a task fosse individual, assim que algum jogador a completasse, o teleporte seria aberto. Daria na mesma, praticamente.
  18. local tpId = 1387 local tp = { info = { pos = {x = 761, y = 57, z = 7}, toPos = {x = 767, y = 52, z = 7}, time = 30, }, kill = { ["Hell's Knight"] = {count = 2, str = 10629}, ["Lok"] = {count = 1, str = 10630}, }, } function checkTask() for name, info in pairs(tp.kill) do if getGlobalStorageValue(info.str) < info.count then return false end end return true end function removeTp(tp) local t = getTileItemById(tp.info.pos, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(tp.info.pos, CONST_ME_POFF) end end function onDeath(cid) local m = tp.kill[getCreatureName(cid)] if not tp then return true end setGlobalStorageValue(m.str, getGlobalStorageValue(m.str) < 0 and 1 or getGlobalStorageValue(m.str) + 1) if checkTask() then doCreateTeleport(tpId, tp.info.toPos, tp.info.pos) doCreatureSay(cid, "O teleport irá sumir em "..tp.info.time.." segundos.", TALKTYPE_ORANGE_1) addEvent(removeTp, tp.info.time * 1000, tp) for _, info in pairs(tp.kill) do setGlobalStorageValue(info.str, -1) end end return true end
  19. local config = { lottery_hora = "60 Minutos", reward_count = 1, website = 0 } function onThink(interval, lastExecution) local players = getPlayersOnline() local list = {} for i, tid in ipairs(players) do list = tid end local winner = list[math.random(1, #list)] if(config.website == 1) then db.executeQuery("INSERT INTO `lottery` (`name`) VALUES ('".. getCreatureName(winner) .."');") end doBroadcastMessage('[Loteria Mineira] Ganhador: '.. getCreatureName(winner) ..', Recompensa: '.. config.reward_count ..'moedas! - Parabens ! (Proxima em: '.. config.lottery_hora ..')') doPlayerAddItem(winner, 8303, config.reward_count) doAccountAddPoints(winner, 1) return true end Sobre o problema do comando não adicionar corretamente os pontos, troque (em AddPoints.lua): doAccountAddPoints(cid, count) por: doAccountAddPoints(pid, count)
  20. Use a base que eu disse ter usado para testar o sistema. As únicas diferenças que o meu tem da PxG é que, enquanto no que escrevi a mensagem é "Mega Evolve!", no deles é o nome da mega evolução, e também porque cada mega evolução deles tem um ícone diferente na CD Bar. Como já disseram, estou viajando, logo não darei suporte por um bom tempo.
  21. O cooldown diminuído será em % baseado no CD total da magia, ou será diferente para cada uma? Responde rápido se possível, logo vou sair e amanhã irei viajar e só voltarei mês que vem. Enfim, escrevi para que o cooldown seja diminuído em 30% (achei esta a melhor porcentagem de redução de tempo de recarga). Se este valor não lhe agradar, mude o 0.3 (que equivale a 30%). O código talvez possa ser escrito de maneira mais simples, porém, como já disse, estou com pressa para sair. pokemon moves.lua: Nas spells que apliquem condições negativas (como Silence, Sleep, Slow, etc), haverá esta linha: local ret = {} Abaixo dela, coloque: ret.Spell = {cid, spell} Depois, em newStatusSyst.lua, abaixo de: doSendAnimatedText(getThingPosWithDebug(ret.id), "BOOST", 215) --alterado v1.8 coloque: local user, spell = ret.Spell[1], ret.Spell[2] if user and spell and isSummon(user) then local pid = getCreatureMaster(user) if isPlayer(pid) then local ball, index, cooldown = getPlayerSlotItem(pid, 8).uid, 0, 0 for i = 1, 12 do local move = getNewMoveTable(movestable[getCreatureName(user)], i) if move and move.name == spell then index = i cooldown = move.cd break end end if index ~= 0 then local newCd = math.floor(cooldown - cooldown * 0.3) setCD(ball, "move"..index, newCd) end end end
  22. Cara, esse evento não se registra em login.lua, e sim no arquivo XML dos monstros. Você tem certeza que instalou corretamente o onSpawn nas sources?
  23. Ops, código corrigido. Falta de atenção minha. Usa esta tag: <event type="spawn" name="bossSpawn" event="script" value="nome_do_arquivo.lua"/>
  24. Já terminei faz tempo, só estou esperando você avisar que criou o item. Certamente não ficou igual a PxG, porque, caso tenham usado esse método, deve ter demorado um bom tempo para achar o tempo ideal para representar um pulo "perfeito" (como o da gif). E, sinceramente, não estava com paciência de ficar procurando tal tempo. Função de pulo: function jump(cid, rounds) doChangeSpeed(cid, -getCreatureSpeed(cid)) doCreatureSetNoMove(cid, true) for i = 1, rounds do addEvent(function() if isCreature(cid) then local pos = getThingPos(cid) local item = doCreateItem(ITEM_INVISIVEL, 1, pos) addEvent(function() local it = getTileItemById(pos, ITEM_INVISIVEL).uid if it > 0 then doRemoveItem(it) end if i == rounds then doRegainSpeed(cid) doCreatureSetNoMove(cid, false) end end, rounds == 1 and 200 or (i + 2) * 100) end end, i * (rounds == 1 and 200 or 100)) end end Use jump(cid, 1) para um pulo de altura "1" (como o causado pelo Earthquake), e jump(cid, 2) para pulos como do Heavy Slam. Código do Heavy Slam: local config = { areas = {area1, area2}, --Áreas, em ordem de execução. effect = 160, --Efeito. combat = NORMALDAMAGE, --Elemento. } local function doPushCreature(target, cid) if target > 0 then if not isNpc(target) then local position = getThingPosition(cid) local fromPosition = getThingPosition(target) local x = ((fromPosition.x - position.x) < 0 and -1 or ((fromPosition.x - position.x) == 0 and 0 or 1)) local y = ((fromPosition.y - position.y) < 0 and -1 or ((fromPosition.y - position.y) == 0 and 0 or 1)) local toPosition = {x = fromPosition.x + x, y = fromPosition.y + y, z = fromPosition.z} if doTileQueryAdd(target, toPosition) == 1 and getTileInfo(toPosition).house == false then doTeleportThing(target, toPosition, true) end end end end jump(cid, 2) addEvent(function() for i = 0, #config.areas - 1 do addEvent(function() local pos = getPosfromArea(cid, config.areas[i + 1]) doMoveInArea2(cid, config.effect, config.areas[i + 1], config.combat, min, max) for j = 1, #pos do local pid = getTopCreature(pos[j]).uid if ehMonstro(pid) then doPushCreature(pid, cid) elseif isSummon(pid) then local master = getCreatureMaster(pid) if isSummon(cid) then if getPlayerStorageValue(master, 52480) >= 1 and getPlayerStorageValue(master, 52481) >= 0 then local masterCid = getCreatureMaster(cid) if isDuelingAgainst(masterCid, master) then doPushCreature(pid, cid) end end else doPushCreature(pid, cid) end end end end, i * 230) end end, 650)
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...