Ir para conteúdo

zipter98

Herói
  • Total de itens

    2553
  • Registro em

  • Última visita

  • Dias Ganhos

    72

Histórico de Reputação

  1. Upvote
    zipter98 recebeu reputação de M i s s em Efeito no Chao Que Tira HP   
    Globalevent:
     
    local config = { effect = xxx, --Efeito. hp = xxx, --HP tirada. pos = { {x = x, y = y, z = z}, {x = x, y = y, z = z}, {x = x, y = y, z = z}, --etc }, } function onThink() for _, pos in pairs(config.pos) do local c = getTopCreature(pos).uid doSendMagicEffect(pos, config.effect) if c > 0 and isPlayer(c) then doCreatureAddHealth(c, -config.hp) end end return true end
  2. Upvote
    zipter98 recebeu reputação de M i s s em [Encerrado] [Pedido] Parede Que Abre   
    local posis = { {x = x, y = y, z = z}, --Posição onde o jogador deve ficar. {x = x, y = y, z = z}, {x = x, y = y, z = z}, {x = x, y = y, z = z}, {x = x, y = y, z = z}, {x = x, y = y, z = z}, {x = x, y = y, z = z}, {x = x, y = y, z = z}, {x = x, y = y, z = z}, } local wall_pos = {x = x, y = y, z = z} --Coordenadas da posição da parede. local wall = x --ID da parede. local time = 5 --Tempo, em minutos, para a parede reaparecer. local check = 0 function onUse(cid, item, frompos, item2, topos) for a, b in pairs(posis) do if not isPlayer(getThingFromPos(b)) then return doPlayerSendCancel(cid, "Um ou mais jogadores não estão nas posições corretas.") else check = check + 1 end end if check == #posis and getTileItemById(wall_pos, wall).uid > 0 then doRemoveItem(getTileItemById(wall_pos, wall).uid, 1) addEvent(function() doCreateItem(wall, 1, wall_pos) end, time * 60 * 1000) end return true end
  3. Upvote
    zipter98 recebeu reputação de M i s s em passa pela porta so com o item!   
    Tenta:
     
    function onUse(cid, item, fromPosition, itemEx, toPosition) local tppos = {x = xxx, y = yyy, z = zzz} --Para onde será teleportado. if getPlayerItemCount(cid, 7409) >= 1 then doTeleportThing(cid, tppos) doPlayerSendTextMessage(cid, 22, "Você passou pela porta.") else doPlayerSendCancel(cid, "Você não tem o item especificado.") end return true end
  4. Amei
    zipter98 recebeu reputação de poxt em Mega Evolution System (PxG)   
    Base usada: PDA by Slicer, v1.9
     
    Para quem não conhece o sistema de mega evoluções, recomendo acessar este link. A diferença é que a pedra (mega stone) não ocupa o espaço de um Held Item tier Y (visto que não são todos os servidores que possuem Held Itens).
     
    Instalação do sistema (atenção nos detalhes)  
    data/lib:
     
    cooldown bar.lua:
    Troque o código da função getNewMoveTable(table, n) por este:
    function getNewMoveTable(table, n)    if table == nil then        return false    end    local moves = {table.move1, table.move2, table.move3, table.move4, table.move5, table.move6, table.move7, table.move8, table.move9, table.move10, table.move11, table.move12}    local returnValue = moves    if n then        returnValue = moves[n]    end    return returnValueend No código da função doUpdateMoves(cid), troque o segundo: table.insert(ret, "n/n,") por:
    local mEvolveif not getCreatureName(summon):find("Mega") and getItemAttribute(getPlayerSlotItem(cid, 8).uid, "megaStone") then    if not isInArray(ret, "Mega Evolution,") then        table.insert(ret, "Mega Evolution,")        mEvolve = true    endendif not mEvolve then    table.insert(ret, "n/n,")end  
    Depois, em pokemon moves.lua: Troque: min = getSpecialAttack(cid) * table.f * 0.1   --alterado v1.6 por:
    min = getSpecialAttack(cid) * (table and table.f or 0) * 0.1   --alterado v1.6  
    Código da spell: elseif spell == "Mega Evolution" then    local effect = xxx                          --Efeito de mega evolução.    if isSummon(cid) then        local pid = getCreatureMaster(cid)        if isPlayer(pid) then            local ball = getPlayerSlotItem(pid, 8).uid            if ball > 0 then                local attr = getItemAttribute(ball, "megaStone")                if attr and megaEvolutions[attr] then                    local oldPosition, oldLookdir, health_percent_lost = getThingPos(cid), getCreatureLookDir(cid), (getCreatureMaxHealth(cid) - getCreatureHealth(cid)) * 100 / getCreatureMaxHealth(cid)                    doItemSetAttribute(ball, "poke", megaEvolutions[attr][2])                    doSendMagicEffect(getThingPos(cid), effect)                    doRemoveCreature(cid)                    doSummonMonster(pid, megaEvolutions[attr][2])                    local newPoke = getCreatureSummons(pid)[1]                    doTeleportThing(newPoke, oldPosition, false)                    doCreatureSetLookDir(newPoke, oldLookdir)                    adjustStatus(newPoke, ball, true, false) doCreatureAddHealth(newPoke, -(health_percent_lost * getCreatureMaxHealth(newPoke) / 100))                    if useKpdoDlls then                        addEvent(doUpdateMoves, 5, pid)                    end                end            end        end    end Depois, em configuration.lua:
    megaEvolutions = {    --[itemid] = {"poke_name", "mega_evolution"},    [11638] = {"Charizard", "Mega Charizard X"},    [11639] = {"Charizard", "Mega Charizard Y"},}  
    Agora, em data/actions/scripts, código da mega stone: function onUse(cid, item)    local mEvolution, ball = megaEvolutions[item.itemid], getPlayerSlotItem(cid, 8).uid    if not mEvolution then        return doPlayerSendCancel(cid, "Sorry, this isn't a mega stone.")    elseif ball < 1 then        return doPlayerSendCancel(cid, "Put a pokeball in the pokeball slot.")    elseif #getCreatureSummons(cid) > 0 then        return doPlayerSendCancel(cid, "Return your pokemon.")    elseif getItemAttribute(ball, "poke") ~= mEvolution[1] then        return doPlayerSendCancel(cid, "Put a pokeball with a(n) "..mEvolution[1].." in the pokeball slot.")    elseif getItemAttribute(ball, "megaStone") then        return doPlayerSendCancel(cid, "Your pokemon is already holding a mega stone.")    end    doItemSetAttribute(ball, "megaStone", item.itemid)    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Now your "..getItemAttribute(ball, "poke").." is holding a(n) "..getItemNameById(item.itemid)..".")    doRemoveItem(item.uid)    return trueend  
    Depois, em goback.lua: Abaixo de: if not pokes[pokemon] then    return trueend coloque:
       if pokemon:find("Mega") then        local normalPoke = megaEvolutions[getItemAttribute(item.uid, "megaStone")][1]        if normalPoke then            doItemSetAttribute(item.uid, "poke", normalPoke)            pokemon = normalPoke        end    end  
    Depois, em data/creaturescripts/scripts, look.lua:
    Abaixo de: local boost = getItemAttribute(thing.uid, "boost") or 0 coloque:
    local extraInfo, megaStone = "", getItemAttribute(thing.uid, "megaStone")if megaStone then    extraInfo = getItemNameById(megaStone)       if pokename:find("Mega") then        pokename = megaEvolutions[megaStone][1]    endend  
    Depois, acima do primeiro: doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) coloque:
    if extraInfo ~= "" then    table.insert(str, "\nIt's holding a(n) "..extraInfo..".")end  
    Já em data/talkactions/scripts, move1.lua: Abaixo de: function doAlertReady(cid, id, movename, n, cd) coloque:
    if movename == "Mega Evolution" then return true end Troque:
       if not move then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")        return true    end por:
    if not move then        local isMega = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "megaStone")        if not isMega or name:find("Mega") then            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")            return true        end        local moveTable, index = getNewMoveTable(movestable[name]), 0        for i = 1, 12 do            if not moveTable[i] then                index = i                break            end        end        if tonumber(it) ~= index then            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")            return true        end        local needCds = true                   --Coloque false se o pokémon puder mega evoluir mesmo com spells em cooldown.        if needCds then            for i = 1, 12 do                if getCD(getPlayerSlotItem(cid, 8).uid, "move"..i) > 0 then                    return doPlayerSendCancel(cid, "To mega evolve, all the spells of your pokemon need to be ready.")                end            end        end        move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0}    end E troque:
    doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..move.name.."!", TALKTYPE_SAY) por:
    local spellMessage = msgs[math.random(#msgs)]..""..move.name.."!"if move.name == "Mega Evolution" then    spellMessage = "Mega Evolve!"enddoCreatureSay(cid, getPokeName(mypoke)..", "..spellMessage, TALKTYPE_SAY)  
     
    Se não quiser que o "Mega" apareça no nome do pokémon, vá em data/lib, level system.lua: Acima de: if getItemAttribute(item, "nick") then    nick = getItemAttribute(item, "nick")end coloque:
       if nick:find("Mega") then        nick = nick:match("Mega (.*)")        if not pokes[nick] then            nick = nick:explode(" ")[1]        end    end  
     
    Caso queiram que cada mega evolução tenha um clã específico: Em move1.lua, acima de:
    move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0, f = 0, t = "?"} coloque:
    local megaEvoClans = {    --[mega_stone_id] = "clan_name",    [91912] = "Volcanic",    [91913] = "Seavell",    --etc,}if megaEvoClans[isMega] then    if getPlayerClanName(cid) ~= megaEvoClans[isMega] then        return doPlayerSendCancel(cid, "You can't mega evolve this pokemon.")    endend  
    Finalizando o tópico após uma pequena reestruturação na indexação, gostaria de levantar algo que acredito ser bem claro: o sistema é cheio de detalhes, muitas vezes minuciosos. Um simples erro e bugs aparecem por toda parte. Se você encontrou algum, pelo menos uma das duas seguintes condições acontecem: Base DIFERENTE da usada. Peço desculpas, mas não pretendo adaptar o sistema para todas as bases diferentes que aparecerem. Se a base for a mesma, você com certeza errou em algum ponto da instalação. O sistema foi testado inúmeras vezes, não apenas por mim, e seu funcionamento foi seguidamente comprovado.  
    Façam bom uso, invocadores.
  5. Confuso
    zipter98 recebeu reputação de DanijoBR em [PEDIDO] Item aleatorio   
    Antes de mais nada, vou explicar a lógica por trás do código que escrevi e sua configuração.
     
    Tome a seguinte imagem como referência:

     
    As posições que serão consideradas no "sorteio" estão contidas na área do quadrilátero (representado em azul). Por isso, para delimitar essa área do restante do mapa que não será considerado tomamos como pontos de referência os vértices A e B. No código que postarei a seguir, você deve colocar em fromPos as coordenadas do ponto A (ponto superior esquerdo da área), e em toPos as coordenadas do ponto B (ponto inferior direito da área).
    Também optei por imprimir a posição escolhida na distro, facilitando sua busca.
     
    data/globalevents/scripts:
    local config = { itemid = xxx, --ID do item criado. edges = { fromPos = {x = x, y = y, z = z}, --Coordenadas da posição superior esquerda. toPos = {x = x, y = y, z = z} --Coordenadas da posição inferior direita. }}function isWalkable(pos, creature, proj, pz, water)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if isWater(getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid) and water then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return trueendfunction getRandomPos(f, t) local pos = {x = math.random(f.x, t.x), y = math.random(f.y, t.y), z = math.random(f.z, t.z)} if not isWalkable(pos, true, true, true, true) then pos = getRandomPos(f, t) end return posendfunction onStartup() local pos = getRandomPos(config.edges.fromPos, config.edges.toPos) print("Coordenadas selecionadas para o item "..getItemNameById(config.itemid)..":") print("X: "..pos.x..", Y: "..pos.y..", Z: "..pos.z) doCreateItem(config.itemid, 1, pos) return trueend Tag:
    <globalevent name="randompos" type="start" event="script" value="nome_do_arquivo.lua"/>  
  6. Upvote
    zipter98 recebeu reputação de M i s s em Fly/Surf proíbidos em áreas.   
    Abaixo de:
    if getPlayerStorageValue(cid, 17000) >= 1 then
    coloque:
    local fly_areas, canFly = {
    --{fromPos = {posição_superior_esquerda_da_área}, toPos = {posição_inferior_direita_da_área}},
    {fromPos = {x = x, y = y, z = z}, toPos = {x = x, y = y, z = z}},
    {fromPos = {x = x, y = y, z = z}, toPos = {x = x, y = y, z = z}},
    --etc
    }

    for _, coordinates in pairs(fly_areas) do
    if isInRange(getThingPos(cid), coordinates.fromPos, coordinates.toPos) then
    canFly = true
    break
    end
    end

    if not canFly then
    doPlayerSendCancel(cid, "You can't fly here.")
    doTeleportThing(cid, frompos)
    return true
    end
  7. Upvote
    zipter98 recebeu reputação de M i s s em (resolvido) alguém pode criar uma spell a partir dessa action por favor?   
    elseif spell == "Transform" then local config = { forms = {"Castform", "Fire Castform", "Water Castform", "Ice Castform"}, --Formas, na ordem de transformação. effects = { ["water"] = xxx, --["elemento_primário_da_nova_forma"] = efeito_na_transformação, ["ice"] = xxx, ["fire"] = xxx, } } local function fakeEvolution(cid, newPoke, pokeball) local owner = getCreatureMaster(cid) if not owner then return true end local description = "Contains a "..newPoke.."." local pct = getCreatureHealth(cid) / getCreatureMaxHealth(cid) doItemSetAttribute(pokeball, "hp", pct) doItemSetAttribute(pokeball, "poke", newPoke) doItemSetAttribute(pokeball, "morta", "no") doItemSetAttribute(pokeball, "Icone", "yes") doItemSetAttribute(pokeball, "description", "Contains a "..newPoke..".") doTransformItem(pokeball, icons[getItemAttribute(pokeball, "poke")].use) doTransformItem(getPlayerSlotItem(owner, 7).uid, fotos[newPoke]) local oldpos, oldlod = getThingPos(cid), getCreatureLookDir(cid) doRemoveCreature(cid) doSummonMonster(owner, newPoke) local pk = getCreatureSummons(owner)[1] doTeleportThing(pk, oldpos, false) doCreatureSetLookDir(pk, oldlod) adjustStatus(pk, pokeball, true, false) if useKpdoDlls then doUpdateMoves(owner) end end table.find = function (table, value) for i, v in pairs(table) do if(v == value) then return i end end return nil end if not isInArray(config.forms, getCreatureName(cid)) then return true end local next_form = config.forms[table.find(config.forms, getCreatureName(cid)) + 1] if not next_form then next_form = config.forms[1] end doSendMagicEffect(getThingPos(cid), config.effects[pokes[next_form].type] or 18) if not isSummon(cid) then local pos, dir, health_lost = getThingPos(cid), getCreatureLookDir(cid), getCreatureHealth(cid) / getCreatureMaxHealth(cid) doRemoveCreature(cid) local newMonster = doCreateMonster(next_form, pos) setPlayerStorageValue(newMonster, 94831, health_lost) doCreatureSetLookDir(newMonster, dir) else local p = getPlayerSlotItem(getCreatureMaster(cid), 8) if not p then return true end fakeEvolution(cid, next_form, p.uid) end  
    Depois, em data/lib/level system.lua, no código da função adjustWildPoke:
    Abaixo de:
    doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) coloque:
    if tonumber(getPlayerStorageValue(cid, 94831)) > -1 then local ratio = 1 - tonumber(getPlayerStorageValue(cid, 94831)) doCreatureAddHealth(cid, -(getCreatureMaxHealth(cid) * ratio))end  
  8. Upvote
    zipter98 recebeu reputação de M i s s em (resolvido) points premium in game   
    Supondo que, de fato, todas as funções tenham sido copiadas exatamente iguais (o código de box que você postou está incompleto, então me baseei no do PDA):
    local pokemon = { ["nome_do_pokémon"] = {price = xxx, boost = xxx}, --etc}function doCorrectString(str) --Slicer local name = str:explode(" ") local final = {} for _, s in ipairs(name) do table.insert(final, s:sub(1, 1):upper()..s:sub(2, #s):lower()) end return table.concat(final, (name[2] and " " or ""))endfunction onSay(cid, words, param) local p = param:lower() if p == "list" then local str = "******** You can buy: ********" for p_name, info in pairs(pokemon) do str = str.."\n-"..p_name.." [+"..info.boost.."] for "..info.price.." premium point(s)." end doPlayerPopupFYI(cid, str) elseif pokemon[doCorrectString(p)] then local poke = pokemon[doCorrectString(p)] if getAccountPoints(cid) < poke.price then doPlayerSendCancel(cid, "Sorry, you do not have enough points. ["..poke.price.." premium points]") return true end doPlayerSendTextMessage(cid, 27, "You successfully bought a "..doCorrectString(p).." [+"..poke.boost.."] for "..poke.price.." premium point(s).") doAccountRemovePoints(cid, poke.price) addPokeToPlayer(cid, doCorrectString(p), poke.boost, nil, "normal") else doPlayerSendCancel(cid, "Invalid parameter. Type 'list' to see a list of pokemon you can buy, or type the name of the wished pokemon.") end return trueend Algumas observações:
    Optei por deixar o código mais configurável. Você pode escolher os pokémon que podem ser comprados, junto com boost e preço específico. Essas informações são mostradas num parâmetro que incluí (/comando list).
    Logo, as opções de fala são:
    /comando nome_do_pokémon --Para comprar um pokémon./comando list --Para mostrar uma lista com os pokémon compráveis.  
    Também, devo informar que os premium points não são compartilhados por outros personagens da conta. Para que isso aconteça, recomendaria instalar a função setAccountStorageValue, encontrada por aí na internet (acho que aqui no XTibia tem).
  9. Upvote
    zipter98 recebeu reputação de M i s s em NPC que teleporta se apenas estiver tal storage   
    Em data/npc/scripts, crie um arquivo com extensão .lua, nomeie-o travelnpc, e coloque nele o seguinte conteúdo:
    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 local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local cfg = { storage = 13500, --Storage. pos = {x = x, y = y, z = z}, --Para onde o jogador será teleportado. } if msgcontains(msg, "travel") or msgcontains(msg, "viajar") then selfSay("Você gostaria de viajar? Para isso, você precisa ser VIP.", cid) talkState[talkUser] = 1 return true elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, cfg.storage) >= 1 then selfSay("Boa viajem!", cid) doTeleportThing(cid, cfg.pos) talkState[talkUser] = 0 return true else selfSay("Desculpe, você não é VIP.", cid) talkState[talkUser] = 0 return true end elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then selfSay("Tudo bem, então...", cid) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Depois, em data/npc, crie um arquivo com extensão .xml, e adicione neste o seguinte conteúdo:
    <?xml version="1.0" encoding="UTF-8"?> <npc name="Nome do NPC" script="travelnpc.lua" walkinterval="0" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="523" head="114" body="119" legs="114" feet="114" corpse="2212"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|, would you like to {travel}?"/> </parameters> </npc> OBS: Não se esqueça de alterar o nome e a outfit do NPC no arquivo acima.
  10. Upvote
    zipter98 recebeu reputação de Holograma em [PDA] PokéDex em corpses de pokémons   
    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.
  11. Upvote
    zipter98 recebeu reputação de mister17 em [Pedido] Função: doSetLanguage.   
    Isso aí você faz em Lua, não em C++. Em qualquer arquivo de data/lib, coloque:
    LANGUAGE_STORAGE = 4929 Languages = { --["linguagem"] = valor_da_storage, ["english"] = 1, ["portuguese"] = 2, ["spanish"] = 3, } function getPlayerLanguage(cid) if not isPlayer(cid) then return true end for lang, value in pairs(Languages) do if value == getPlayerStorageValue(cid, LANGUAGE_STORAGE) then return lang end end return "none" end function setPlayerLanguage(cid, new_language) if not isPlayer(cid) or not Languages[new_language] then return true end setPlayerStorageValue(cid, LANGUAGE_STORAGE, Languages[new_language]) end Para alterar a linguagem do jogador:
    setPlayerLanguage(cid, nova_linguagem) Ex.:
    setPlayerLanguage(cid, "english") setPlayerLanguage(cid, "portuguese") Para obter a linguagem do jogador:
    getPlayerLanguage(cid) Que retorna valores como:
    english portuguese Em login.lua, recomendo colocar, abaixo de:
    function onLogin(cid) o seguinte bloco de código:
    if getPlayerLanguage(cid) == "none" then setPlayerLanguage(cid, "portuguese") end Exemplo de uso do sistema:
    local test_messages = { ["portuguese"] = "Mensagem de teste.", ["english"] = "Test message.", ["spanish"] = "Mensaje de prueba." } function onSay(cid) doPlayerPopupFYI(cid, test_messages[getPlayerLanguage(cid)]) return true end
  12. Thanks
    zipter98 recebeu reputação de RimuruMuaw em Efeito Drop Stone.   
    Ops, código corrigido.
    @shept
     
    function isStone(itemid) local ids = {itemid, itemid, itemid, ...} --ID das stones. return isInArray(ids, itemid) end
  13. Thanks
    zipter98 recebeu reputação de M i s s em Básico,Tile ou Door que passa com Storage!   
    data/movements/scripts, crie um arquivo com extensão .lua, nomeie-o tilesto, e coloque o seguinte conteúdo:
    function onStepIn(cid, item, position, fromPosition) local sto_one = xxx --Primeira storage. local sto_two = yyy --Segunda storage. if getPlayerStorageValue(cid, sto_one) < 1 or getPlayerStorageValue(cid, sto_two) < 1 then return doPlayerSendCancel(cid, "Você não pode passar por aqui!") and doTeleportThing(cid, fromPosition) end doPlayerSendTextMessage(cid, 27, "Parabéns, você conseguiu passar!") doSendMagicEffect(getThingPos(cid), 14) return true end Depois, em data/movements, abra o arquivo movements.xml, e coloque a seguinte tag: <movevent type="StepIn" actionid="coloque aqui um action id que não esteja em uso no seu servidor" event="script" value="tilesto.lua"/>
  14. Thanks
    zipter98 recebeu reputação de jeanflamengo em [Resolvido] ajuda com magia unown e air vortex   
    Em pokemon moves.lua:
    elseif spell == "Air Vortex" then local config = { outfit = xxx, --Outfit. time = {xxx, xxx}, --{Duração da spell, intervalo entre cada "tick" de dano (em milésimos de segundos)}, storage = 93828, effects = { pullEffects = { distance = xxx, --Distance effect do efeito de puxar pokémons. effect = xxx, --Efeito de tornado. }, damageEffect = xxx, --Efeito do redemoinho que aplica dano. }, } local time = os.time() + config.time[1] function Pull(cid, ret) local pos = getPosfromArea(cid, pullArea) if pos and #pos > 0 then for i = 1, #pos do local c = getTopCreature(pos[i]).uid if c > 0 then if ehMonstro(c) then doTeleportThing(c, getClosestFreeTile(cid, getThingPos(cid))) doMoveDano2(cid, c, NORMALDAMAGE, 0, 0, ret, spell) elseif isSummon(c) then local master = getCreatureMaster(c) if isSummon(cid) then if getPlayerStorageValue(master, 52480) >= 1 and getPlayerStorageValue(master, 52481) >= 0 then local masterCid = getCreatureMaster(cid) if isDuelingAgainst(masterCid, master) then doTeleportThing(c, getClosestFreeTile(cid, getThingPos(cid))) doMoveDano2(cid, c, NORMALDAMAGE, 0, 0, ret, spell) end end else doTeleportThing(c, getClosestFreeTile(cid, getThingPos(cid))) doMoveDano2(cid, c, NORMALDAMAGE, 0, 0, ret, spell) end end end end end end function doSendTornado(cid, pos) if not isCreature(cid) then return true end if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end doSendDistanceShoot(getThingPos(cid), pos, config.effects.pullEffects.distance) doSendMagicEffect(pos, config.effects.pullEffects.effect) end function vortexDamage(cid) if not isCreature(cid) then return true elseif time - os.time() < 0 then return true end doDanoWithProtect(cid, FLYINGDAMAGE, getThingPos(cid), damageArea, min, max, config.effects.damageEffect) addEvent(vortexDamage, config.time[2], cid) end local ret = {id = 0, cd = config.time[1], check = 0, cond = {"Silence", "Paralyze"}} for b = 1, 3 do for a = 1, 20 do local pos = {x = getThingPos(cid).x + math.random(-4, 4), y = getThingPos(cid).y + math.random(-3, 3), z = getThingPos(cid).z} addEvent(doSendTornado, a * 75, cid, pos) end end Pull(cid, ret) vortexDamage(cid) doCreatureSetNoMove(cid, true) doChangeSpeed(cid, -getCreatureSpeed(cid)) doSetCreatureOutfit(cid, {lookType = config.outfit}, config.time[1] * 1000) setPlayerStorageValue(cid, config.storage, time) addEvent(function() if isCreature(cid) then doCreatureSetNoMove(cid, false) doRegainSpeed(cid) end end, config.time[1] * 1000) Em areas.lua: damageArea = createCombatArea{ --Área do dano da spell + redemoinhos. {1, 1, 1}, {1, 2, 1}, {1, 1, 1}, } pullArea = { --Área onde os pokémons serão puxados. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 3, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } Em newStatusSyst.lua: Troque todos os: if ret and ret.cond then ret.id = pid ret.check = getPlayerStorageValue(pid, conds[ret.cond]) doCondition2(ret) end por: if ret and ret.cond then if type(ret.cond) == "table" then for i = 1, #ret.cond do ret.id = pid ret.check = getPlayerStorageValue(pid, conds[ret.cond[i]]) doCondition2(ret) end else ret.id = pid ret.check = getPlayerStorageValue(pid, conds[ret.cond]) doCondition2(ret) end end Depois, troque: if ret.cond and ret.cond == "Miss" then doMiss2(ret.id, ret.cd, ret.eff, ret.check, ret.spell) elseif ret.cond and ret.cond == "Silence" then doSilence2(ret.id, ret.cd, ret.eff, ret.check) elseif ret.cond and ret.cond == "Slow" then doSlow2(ret.id, ret.cd, ret.eff, ret.check, ret.first) elseif ret.cond and ret.cond == "Confusion" then doConfusion2(ret.id, ret.cd, ret.check) elseif ret.cond and ret.cond == "Burn" then doBurn2(ret.id, ret.cd, ret.check, ret.damage) elseif ret.cond and ret.cond == "Poison" then doPoison2(ret.id, ret.cd, ret.check, ret.damage) elseif ret.cond and ret.cond == "Fear" then doFear2(ret.id, ret.cd, ret.check, ret.skill) elseif ret.cond and ret.cond == "Stun" then doStun2(ret.id, ret.cd, ret.eff, ret.check, ret.spell) elseif ret.cond and ret.cond == "Paralyze" then doParalyze2(ret.id, ret.cd, ret.eff, ret.check, ret.first) elseif ret.cond and ret.cond == "Sleep" then doSleep2(ret.id, ret.cd, ret.check, ret.first) elseif ret.cond and ret.cond == "Leech" then doLeech2(ret.id, ret.attacker, ret.cd, ret.check, ret.damage) end por: if type(ret.cond) == "table" then for i = 1, #ret.cond do if ret.cond[i] and ret.cond[i] == "Miss" then doMiss2(ret.id, ret.cd, ret.eff, ret.check, ret.spell) elseif ret.cond[i] and ret.cond[i] == "Silence" then doSilence2(ret.id, ret.cd, ret.eff, ret.check) elseif ret.cond[i] and ret.cond[i] == "Slow" then doSlow2(ret.id, ret.cd, ret.eff, ret.check, ret.first) elseif ret.cond[i] and ret.cond[i] == "Confusion" then doConfusion2(ret.id, ret.cd, ret.check) elseif ret.cond[i] and ret.cond[i] == "Burn" then doBurn2(ret.id, ret.cd, ret.check, ret.damage) elseif ret.cond[i] and ret.cond[i] == "Poison" then doPoison2(ret.id, ret.cd, ret.check, ret.damage) elseif ret.cond[i] and ret.cond[i] == "Fear" then doFear2(ret.id, ret.cd, ret.check, ret.skill) elseif ret.cond[i] and ret.cond[i] == "Stun" then doStun2(ret.id, ret.cd, ret.eff, ret.check, ret.spell) elseif ret.cond[i] and ret.cond[i] == "Paralyze" then doParalyze2(ret.id, ret.cd, ret.eff, ret.check, ret.first) elseif ret.cond[i] and ret.cond[i] == "Sleep" then doSleep2(ret.id, ret.cd, ret.check, ret.first) elseif ret.cond[i] and ret.cond[i] == "Leech" then doLeech2(ret.id, ret.attacker, ret.cd, ret.check, ret.damage) end end else if ret.cond and ret.cond == "Miss" then doMiss2(ret.id, ret.cd, ret.eff, ret.check, ret.spell) elseif ret.cond and ret.cond == "Silence" then doSilence2(ret.id, ret.cd, ret.eff, ret.check) elseif ret.cond and ret.cond == "Slow" then doSlow2(ret.id, ret.cd, ret.eff, ret.check, ret.first) elseif ret.cond and ret.cond == "Confusion" then doConfusion2(ret.id, ret.cd, ret.check) elseif ret.cond and ret.cond == "Burn" then doBurn2(ret.id, ret.cd, ret.check, ret.damage) elseif ret.cond and ret.cond == "Poison" then doPoison2(ret.id, ret.cd, ret.check, ret.damage) elseif ret.cond and ret.cond == "Fear" then doFear2(ret.id, ret.cd, ret.check, ret.skill) elseif ret.cond and ret.cond == "Stun" then doStun2(ret.id, ret.cd, ret.eff, ret.check, ret.spell) elseif ret.cond and ret.cond == "Paralyze" then doParalyze2(ret.id, ret.cd, ret.eff, ret.check, ret.first) elseif ret.cond and ret.cond == "Sleep" then doSleep2(ret.id, ret.cd, ret.check, ret.first) elseif ret.cond and ret.cond == "Leech" then doLeech2(ret.id, ret.attacker, ret.cd, ret.check, ret.damage) end end Depois, em data/talkactions/scripts, move1.lua: Abaixo de: if isSleeping(mypoke) or isSilence(mypoke) then --alterado v1.5 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode fazer isso agora.") return 0 else newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, move.cd) end coloque: if getPlayerStorageValue(mypoke, 93828) > os.time() then return doPlayerSendCancel(cid, "Your pokemon can't use moves right now.") end Outra hora escrevo o código do Unown Help e Unown Rush (vou sair daqui a pouco).
    Perguntas: Há uma quantia mínima de Unowns para usar o Unown Rush? O dano de tal spell aumenta de acordo com o número de Unowns summonados? Seria bem legal isso (ex.: cada Unown aumenta o dano da spell em 5%).
  15. Upvote
    zipter98 recebeu reputação de Azazel428 em Apenas tal vocation id pode usar essa talkactions   
    Abaixo de:
    function onSay(cid, words, param) coloque:
    local vocations = {1, 2, 3} --Vocações que podem teleportar. if not isInArray(vocations, getPlayerVocation(cid)) then return doPlayerSendCancel(cid, "Você não é digno de ir para esse lugar.") end
  16. Thanks
    zipter98 recebeu reputação de LeoTK em Sistema de vim shiny   
    Não se esqueçam de registrar o evento no arquivo .XML dos monstros que poderão spawnar um boss.
     
    local config = { chance = 1, --Coloquem apenas números inteiros (1 - 0.0001%). bosses = { --["monster_name"] = "boss", ["Dragon Lord"] = "Demodras", }, } function onSpawn(cid) if isMonster(cid) then addEvent(function() if isCreature(cid) then local boss = config.bosses[getCreatureName(cid)] if boss and math.random(1, 1000000) <= config.chance then local pos = getThingPos(cid) doRemoveCreature(cid) doCreateMonster(boss, pos) end end end, 5) end return true end
  17. Thanks
    zipter98 recebeu reputação de LeoTK em Sistema de vim shiny   
    Claro, seria quase o mesmo processo. Porém, neste caso, você teria que configurar uma tabela indicando os monstros e seus respectivos "shinies".
    Já adianto a ambos: será necessário instalar nas sources o creatureevent onSpawn.
    Link para a versão 0.3.6
    Link para a versão 0.4
  18. Thanks
    zipter98 recebeu reputação de tuca1010 em Sistema de Addon   
    Troque:
    if not look then doSetItemAttribute(pb,"addon",0) return false end if look > 0 then doSetCreatureOutfit(pk, {lookType = look}, -1) return true end por: if not look then doSetItemAttribute(pb,"addon",0) end if look > 0 then doSetCreatureOutfit(pk, {lookType = look}, -1) end
  19. Thanks
    zipter98 recebeu reputação de LeoTK em Spell teleport   
    Fiz bem corrido aqui, talvez não funcione.
     
    local config = { effect = xxx, --Efeito. interval = 500 --Intervalo, em milésimos de segundo, entre os teleportes. } local combat, invisibility, outfit = createCombatObject(), createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_INVISIBLE), createConditionObject(CONDITION_INVISIBLE, -1, false) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) function getDamage(cid, level, magic) return -(level * 5 + magic * 12), -(level * 5 + magic * 12 + 55) end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "getDamage") function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 2 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function doSpellTeleport(cid, target, positions, original_position) if not isPlayer(cid) then return true elseif #positions < 1 or not isCreature(target) then doTeleportThing(cid, original_position) doRemoveCondition(cid, CONDITION_INVISIBLE) doRemoveCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) doPlayerSetNoMove(cid, false) return true end local index = math.random(#positions) local toPos = positions[index] if not isWalkable(toPos) then repeat table.remove(positions, index) index = math.random(#positions) toPos = positions[index] if #positions < 1 then doTeleportThing(cid, original_position) doRemoveCondition(cid, CONDITION_INVISIBLE) doRemoveCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) doPlayerSetNoMove(cid, false) return true end until isWalkable(toPos) end doTeleportThing(cid, toPos) doSendMagicEffect(getThingPos(cid), config.effect) doCombat(cid, combat, numberToVariant(target)) table.remove(positions, index) addEvent(doSpellTeleport, config.interval, cid, target, positions, original_position) end function onCastSpell(cid, var) local target = variantToNumber(var) if not isCreature(target) then return doPlayerSendCancel(cid, "You need a target.") end local pos = getThingPos(target) local posis = { {x = pos.x + 1, y = pos.y + 1, z = pos.z}, {x = pos.x + 1, y = pos.y - 1, z = pos.z}, {x = pos.x - 1, y = pos.y + 1, z = pos.z}, {x = pos.x - 1, y = pos.y - 1, z = pos.z} } doAddCondition(cid, invisibility) doAddCondition(cid, outfit) doPlayerSetNoMove(cid, true) doSpellTeleport(cid, target, posis, getThingPos(cid)) return true end
  20. Upvote
    zipter98 recebeu reputação de FlamesAdmin em [Resolvido] [Pedido] Script Para Pda   
    Um amigo me pediu este sisteminha alguns dias atrás. Como poderá ver, é algo bem simples. Entretanto, ele pode conflitar com outras mudanças de outfit que o pokémon venha sofrer. Para evitar isso, você terá de fazer algumas mudanças adicionais, explicadas adiante.
    Primeiramente, em algum arquivo da lib:
    outfits_order = { --["nome_do_pokemon"] = {outfit1, outfit2, outfit3, ...}, } function doTradeOutfit(cid, index) if not isSummon(cid) then return true end local outfit = outfits_order[getCreatureName(cid)] if not outfit[index] then index = 1 end doSetCreatureOutfit(cid, {lookType = outfit[index]}, -1) addEvent(doTradeOutfit, 200, cid, index + 1) end As outfits devem ser configuradas na ordem em que serão trocadas. O resto dependerá de onde a função será chamada. Se a animação do pokémon começar logo após ele ter sido chamado da pokébola, então, em goback.lua (data/actions/scripts): Abaixo de: local pk = getCreatureSummons(cid)[1] if not isCreature(pk) then return true end Coloque: if outfits_order[getCreatureName(pk)] then doTradeOutfit(pk, 1) end Se formos seguir a lógica da gif demonstrada, a função deveria ser chamada após a mega evolução, o que dependeria de como o sistema usado por você foi escrito. Usando o meu, o processo seria o seguinte: Em pokemon moves.lua (data/lib), no código da spell Mega Evolution: Abaixo de: adjustStatus(newPoke, ball, true, false) coloque: if outfits_order[getCreatureName(newPoke)] then doTradeOutfit(newPoke, 1) end Caso os pokémons que façam parte do sistema de mudança constante de outfit possam ter sua looktype alterada de alguma maneira durante o jogo (por exemplo, um Mega Charizard X usando Outrage ou uma Rapidash usando Blue Flames), você deverá fazer algumas pequenas mudanças. Troque a função que passei anteriormente por essa: function doTradeOutfit(cid, index) if not isSummon(cid) then return true end local outfit = outfits_order[getCreatureName(cid)] if not getCreatureCondition(cid, CONDITION_OUTFIT) or isInArray(outfit, getCreatureOutfit(cid).lookType) then if not outfit[index] then index = 1 end doSetCreatureOutfit(cid, {lookType = outfit[index]}, -1) end addEvent(doTradeOutfit, 200, cid, index + 1) end Depois, no código de todos os possíveis fatores que possam mudar a outfit dos pokémons participantes do sistema, acima da linha responsável pela alteração na looktype: doSetCreatureOutfit(...) Coloque isso: if getCreatureCondition(cid, CONDITION_OUTFIT) then doRemoveCondition(cid, CONDITION_OUTFIT) end Sinceramente, acho que você só terá de fazer isso em pouquíssimos códigos.
    Por gentileza, poste um feedback do sistema. Assim, saberei se devo ou não mover o tópico.
  21. Upvote
    zipter98 recebeu reputação de Navazek em Mega Evolution System (PxG)   
    Base usada: PDA by Slicer, v1.9
     
    Para quem não conhece o sistema de mega evoluções, recomendo acessar este link. A diferença é que a pedra (mega stone) não ocupa o espaço de um Held Item tier Y (visto que não são todos os servidores que possuem Held Itens).
     
    Instalação do sistema (atenção nos detalhes)  
    data/lib:
     
    cooldown bar.lua:
    Troque o código da função getNewMoveTable(table, n) por este:
    function getNewMoveTable(table, n)    if table == nil then        return false    end    local moves = {table.move1, table.move2, table.move3, table.move4, table.move5, table.move6, table.move7, table.move8, table.move9, table.move10, table.move11, table.move12}    local returnValue = moves    if n then        returnValue = moves[n]    end    return returnValueend No código da função doUpdateMoves(cid), troque o segundo: table.insert(ret, "n/n,") por:
    local mEvolveif not getCreatureName(summon):find("Mega") and getItemAttribute(getPlayerSlotItem(cid, 8).uid, "megaStone") then    if not isInArray(ret, "Mega Evolution,") then        table.insert(ret, "Mega Evolution,")        mEvolve = true    endendif not mEvolve then    table.insert(ret, "n/n,")end  
    Depois, em pokemon moves.lua: Troque: min = getSpecialAttack(cid) * table.f * 0.1   --alterado v1.6 por:
    min = getSpecialAttack(cid) * (table and table.f or 0) * 0.1   --alterado v1.6  
    Código da spell: elseif spell == "Mega Evolution" then    local effect = xxx                          --Efeito de mega evolução.    if isSummon(cid) then        local pid = getCreatureMaster(cid)        if isPlayer(pid) then            local ball = getPlayerSlotItem(pid, 8).uid            if ball > 0 then                local attr = getItemAttribute(ball, "megaStone")                if attr and megaEvolutions[attr] then                    local oldPosition, oldLookdir, health_percent_lost = getThingPos(cid), getCreatureLookDir(cid), (getCreatureMaxHealth(cid) - getCreatureHealth(cid)) * 100 / getCreatureMaxHealth(cid)                    doItemSetAttribute(ball, "poke", megaEvolutions[attr][2])                    doSendMagicEffect(getThingPos(cid), effect)                    doRemoveCreature(cid)                    doSummonMonster(pid, megaEvolutions[attr][2])                    local newPoke = getCreatureSummons(pid)[1]                    doTeleportThing(newPoke, oldPosition, false)                    doCreatureSetLookDir(newPoke, oldLookdir)                    adjustStatus(newPoke, ball, true, false) doCreatureAddHealth(newPoke, -(health_percent_lost * getCreatureMaxHealth(newPoke) / 100))                    if useKpdoDlls then                        addEvent(doUpdateMoves, 5, pid)                    end                end            end        end    end Depois, em configuration.lua:
    megaEvolutions = {    --[itemid] = {"poke_name", "mega_evolution"},    [11638] = {"Charizard", "Mega Charizard X"},    [11639] = {"Charizard", "Mega Charizard Y"},}  
    Agora, em data/actions/scripts, código da mega stone: function onUse(cid, item)    local mEvolution, ball = megaEvolutions[item.itemid], getPlayerSlotItem(cid, 8).uid    if not mEvolution then        return doPlayerSendCancel(cid, "Sorry, this isn't a mega stone.")    elseif ball < 1 then        return doPlayerSendCancel(cid, "Put a pokeball in the pokeball slot.")    elseif #getCreatureSummons(cid) > 0 then        return doPlayerSendCancel(cid, "Return your pokemon.")    elseif getItemAttribute(ball, "poke") ~= mEvolution[1] then        return doPlayerSendCancel(cid, "Put a pokeball with a(n) "..mEvolution[1].." in the pokeball slot.")    elseif getItemAttribute(ball, "megaStone") then        return doPlayerSendCancel(cid, "Your pokemon is already holding a mega stone.")    end    doItemSetAttribute(ball, "megaStone", item.itemid)    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Now your "..getItemAttribute(ball, "poke").." is holding a(n) "..getItemNameById(item.itemid)..".")    doRemoveItem(item.uid)    return trueend  
    Depois, em goback.lua: Abaixo de: if not pokes[pokemon] then    return trueend coloque:
       if pokemon:find("Mega") then        local normalPoke = megaEvolutions[getItemAttribute(item.uid, "megaStone")][1]        if normalPoke then            doItemSetAttribute(item.uid, "poke", normalPoke)            pokemon = normalPoke        end    end  
    Depois, em data/creaturescripts/scripts, look.lua:
    Abaixo de: local boost = getItemAttribute(thing.uid, "boost") or 0 coloque:
    local extraInfo, megaStone = "", getItemAttribute(thing.uid, "megaStone")if megaStone then    extraInfo = getItemNameById(megaStone)       if pokename:find("Mega") then        pokename = megaEvolutions[megaStone][1]    endend  
    Depois, acima do primeiro: doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) coloque:
    if extraInfo ~= "" then    table.insert(str, "\nIt's holding a(n) "..extraInfo..".")end  
    Já em data/talkactions/scripts, move1.lua: Abaixo de: function doAlertReady(cid, id, movename, n, cd) coloque:
    if movename == "Mega Evolution" then return true end Troque:
       if not move then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")        return true    end por:
    if not move then        local isMega = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "megaStone")        if not isMega or name:find("Mega") then            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")            return true        end        local moveTable, index = getNewMoveTable(movestable[name]), 0        for i = 1, 12 do            if not moveTable[i] then                index = i                break            end        end        if tonumber(it) ~= index then            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")            return true        end        local needCds = true                   --Coloque false se o pokémon puder mega evoluir mesmo com spells em cooldown.        if needCds then            for i = 1, 12 do                if getCD(getPlayerSlotItem(cid, 8).uid, "move"..i) > 0 then                    return doPlayerSendCancel(cid, "To mega evolve, all the spells of your pokemon need to be ready.")                end            end        end        move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0}    end E troque:
    doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..move.name.."!", TALKTYPE_SAY) por:
    local spellMessage = msgs[math.random(#msgs)]..""..move.name.."!"if move.name == "Mega Evolution" then    spellMessage = "Mega Evolve!"enddoCreatureSay(cid, getPokeName(mypoke)..", "..spellMessage, TALKTYPE_SAY)  
     
    Se não quiser que o "Mega" apareça no nome do pokémon, vá em data/lib, level system.lua: Acima de: if getItemAttribute(item, "nick") then    nick = getItemAttribute(item, "nick")end coloque:
       if nick:find("Mega") then        nick = nick:match("Mega (.*)")        if not pokes[nick] then            nick = nick:explode(" ")[1]        end    end  
     
    Caso queiram que cada mega evolução tenha um clã específico: Em move1.lua, acima de:
    move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0, f = 0, t = "?"} coloque:
    local megaEvoClans = {    --[mega_stone_id] = "clan_name",    [91912] = "Volcanic",    [91913] = "Seavell",    --etc,}if megaEvoClans[isMega] then    if getPlayerClanName(cid) ~= megaEvoClans[isMega] then        return doPlayerSendCancel(cid, "You can't mega evolve this pokemon.")    endend  
    Finalizando o tópico após uma pequena reestruturação na indexação, gostaria de levantar algo que acredito ser bem claro: o sistema é cheio de detalhes, muitas vezes minuciosos. Um simples erro e bugs aparecem por toda parte. Se você encontrou algum, pelo menos uma das duas seguintes condições acontecem: Base DIFERENTE da usada. Peço desculpas, mas não pretendo adaptar o sistema para todas as bases diferentes que aparecerem. Se a base for a mesma, você com certeza errou em algum ponto da instalação. O sistema foi testado inúmeras vezes, não apenas por mim, e seu funcionamento foi seguidamente comprovado.  
    Façam bom uso, invocadores.
  22. Upvote
    zipter98 recebeu reputação de samlecter em House   
    Instale esse creatureevent nas suas sources. Depois, crie um arquivo em data/creatureevents/scripts com extensão .lua e coloque o seguinte conteúdo:
    function onMoveItem(cid, item, fromPosition, toPosition) if getTileInfo(toPosition).house then local house_id, cid_house = getHouseFromPos(toPosition), getHouseByPlayerGUID(getPlayerGUID(cid)) local guest_list = getHouseAccessList(house_id, 0x100):explode("\n") if house_id == cid_house or (#guest_list > 0 and isInArray(guest_list, getCreatureName(cid))) then return true end return false end return true end Tag (não se esqueça de registrar o evento em login.lua): <event type="move" name="throwItemAtHouse" event="script" value="nome_do_arquivo.lua"/>  
  23. Thanks
    zipter98 recebeu reputação de ldsajkdadaf em Auto-Loot System Automatico! Help   
    Use esta versão com proteções:
     
    --local toloot = {11441, 11441, 11443, 11444, 11445, 11446, 11447, 11448, 11449,11450, 11451, 11452, 11453, 11454, 12618, 12232, 12244} -- PREFERENCIAL - SE QUISER APENAS COM ALGUNS ITENS function onUse(cid, item, frompos, item2, topos) if getItemAttribute(item.uid, "corpseowner") ~= cid then doPlayerSendCancel(cid, "You're not the owner.") return true end if getPlayerStorageValue(cid, 4919) < 1 then return false else local items = {} for x=0, (getContainerSize(item.uid)) do local itens = getContainerItem(item.uid, 0) if itens and itens.uid > 0 and itens.itemid ~= 0 then --if isInArray(toloot, itens.itemid) then table.insert(items, {i=itens.itemid, q=itens.type}) doRemoveItem(itens.uid) --break --end end end for y=1, #items do doPlayerAddItemStacking(cid, items[y].i, items[y].q) doPlayerSendTextMessage(cid, 20, "Looted "..items[y].q.."x "..getItemNameById(items[y].i)..".") end if #items > 0 then return true else return false end end end --[[ AUTO LOOT BY GABRIEL SALES SE QUISER ATIVAR O AUTOLOOT APENAS PARA ALGUNS ITENS, ADICIONE OS IDS NA TABELA toloot E TIRE OS COMENTÁRIOS(--). --]]
  24. Upvote
    zipter98 recebeu reputação de InsanityA em House   
    Instale esse creatureevent nas suas sources. Depois, crie um arquivo em data/creatureevents/scripts com extensão .lua e coloque o seguinte conteúdo:
    function onMoveItem(cid, item, fromPosition, toPosition) if getTileInfo(toPosition).house then local house_id, cid_house = getHouseFromPos(toPosition), getHouseByPlayerGUID(getPlayerGUID(cid)) local guest_list = getHouseAccessList(house_id, 0x100):explode("\n") if house_id == cid_house or (#guest_list > 0 and isInArray(guest_list, getCreatureName(cid))) then return true end return false end return true end Tag (não se esqueça de registrar o evento em login.lua): <event type="move" name="throwItemAtHouse" event="script" value="nome_do_arquivo.lua"/>  
  25. Upvote
    zipter98 recebeu reputação de narutomaniacos em Quest Simples   
    Action:
    local config = { time = 10, --Tempo para fazer a quest, em minutos. toPosition = {x = x, y = y, z = z}, --Para onde os jogadores serão teleportados. positions = { {x = x, y = y, z = z}, --Posições que os jogadores devem ficar. {x = x, y = y, z = z}, {x = x, y = y, z = z}, {x = x, y = y, z = z}, }, level = 100, --Level mínimo para fazer a quest. storages = {8605, 8606}, } function onUse(cid) local pid = {} if getPlayerStorageValue(cid, config.storages[2]) > -1 then return doPlayerSendCancel(cid, "You already completed that quest.") end for _, online in pairs(getPlayersOnline()) do if getPlayerStorageValue(online, config.storages[1]) > -1 then return doPlayerSendCancel(cid, "Someone is at the quest right now.") end end for i, position in pairs(config.positions) do local p = getTopCreature(position).uid if p < 1 or not isPlayer(p) then return doPlayerSendCancel(cid, "Not enough players to start the quest.") elseif getPlayerLevel(p) < config.level then return doPlayerSendCancel(cid, "Some player is at a level below "..config.level..".") end pid[#pid + 1] = p end for _, player in pairs(pid) do doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, "Good luck at the quest!\nTime: "..config.time.." minutes.") doTeleportThing(player, getClosestFreeTile(player, config.toPosition)) setPlayerStorageValue(player, config.storages[1], 1) end addEvent(function() for _, player in pairs(pid) do if isPlayer(player) and getPlayerStorageValue(player, config.storages[1]) > -1 then doPlayerSendTextMessage(player, 27, "Oh, timeout. Sorry. :/") setPlayerStorageValue(player, config.storages[1], -1) doTeleportThing(player, getTownTemplePosition(getPlayerTown(player))) end end end, config.time * 60 * 1000) return true end Tag: <action actionid="xxx" event="script" value="nome_do_arquivo.lua"/> Troque xxx pelo actionid. Creaturescript: function onLogout(cid) if getPlayerStorageValue(cid, 8605) > -1 then return doPlayerSendCancel(cid, "You can't logout on the quest.") and false end return true end function onLogin(cid) if getPlayerStorageValue(cid, 8605) > -1 then setPlayerStorageValue(cid, 8605, -1) end return true end Tags: <event type="logout" name="questLogout" event="script" value="nome_do_arquivo.lua"/> <event type="login" name="questLogin" event="script" value="nome_do_arquivo.lua"/> Em data/creaturescripts/scripts, abra o arquivo exp2.0.lua. Acima de: if getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then Coloque: if getPlayerStorageValue(cid, 8605) > -1 then for _, pid in pairs(getPlayersOnline()) do if getPlayerStorageValue(pid, 8605) > -1 then doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) doPlayerSendTextMessage(pid, 27, "Someone died and you lost the quest. Better luck on the next time!") setPlayerStorageValue(pid, 8605, -1) end end doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) return false end No código de premiação da quest, coloque as seguintes linhas:
    setPlayerStorageValue(cid, 8605, -1) setPlayerStorageValue(cid, 8606, 1)
  • Quem Está Navegando   0 membros estão online

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