Ir para conteúdo

xAlony

Campones
  • Total de itens

    6
  • Registro em

  • Última visita

Histórico de Reputação

  1. Upvote
    xAlony deu reputação a Crypter em Npc - Saffari Zone Automático!   
    È um sistema para poketibia que serio o Saffari totalmente automático.




     




    [+] O jogador não perde level(experience) ao morrer.




    [+] O jogador é teleportado quando acabar o tempo ou quando suas Saffari balls acabar!




    [+] Mostra o tempo restante num comando exclusivo !saffari time




     








     




     




     




    Pasta mods




     




    Saffari.xml




    <?xml version="1.0" encoding="ISO-8859-1"?>
    <mod name="Saffari" version="2.0" author="Vodkart" contact="none.com" enabled="yes">
    <config name="saffari_func"><![CDATA[
    config = {
    price = 5000,
    level = 50,
    need_premium = false,
    minutes = 60,
    saffari_positions = {enter = {x=152,y=51,z=5}, exit = {x=163,y=51,z=5}},
    saffari_balls = {11445,30}, -- itemid e quantidade
    blocked_pokeballs = {2146, 2147, 11437, 11441, 11445}, -- pokeball, ultraball, greatball, masterball, safarriball
    storages = {874547,874548} -- start, time
    }
    function timeString(timeDiff)
    local dateFormat = {
    {"day", timeDiff / 60 / 60 / 24},
    {"hour", timeDiff / 60 / 60 % 24},
    {"minute", timeDiff / 60 % 60},
    {"second", timeDiff % 60}
    }
    local out = {}
    for k, t in ipairs(dateFormat) do
    local v = math.floor(t[2])
    if(v > 0) then
    table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or ' and ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or ''))
    end
    end
    local ret = table.concat(out)
    if ret:len() < 16 and ret:find("second") then
    local a, b = ret:find(" and ")
    ret = ret:sub(b+1)
    end

    return ret
    end

    ]]></config>
    <event type="login" name="SaffariRegister" event="script"><![CDATA[
    function onLogin(cid)
    registerCreatureEvent(cid, "SaffariDeath")
    return true
    end]]></event>
    <talkaction words="/saffari;!saffari" event="buffer"><![CDATA[
    domodlib('saffari_func')
    param = string.lower(param)
    if getPlayerStorageValue(cid, config.storages[1]) <= 0 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"you are not in Saffari") return true
    end
    if (param == "") then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"invalid command, enter !saffari time or !safari leave") return true
    elseif isInArray({"time","tempo"}, param) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, (getPlayerStorageValue(cid, config.storages[2]) - os.time() > 0 and "Left "..timeString(getPlayerStorageValue(cid, config.storages[2]) - os.time()).."" or "Time is over. Please wait a moment.").."\nTo leave enter command: !saffari leave") return true
    elseif isInArray({"sair","leave"},param) then
    doTeleportThing(cid, config.saffari_positions.exit)
    setPlayerStorageValue(cid, config.storages[1], 0)
    setPlayerStorageValue(cid, config.storages[2], 0)
    doPlayerSendTextMessage(cid,22,'you left the saffari zone.') return true
    end
    ]]></talkaction>
    <globalevent name="SaffariCheck" interval="60" event="script"><![CDATA[
    domodlib('saffari_func')
    function onThink(interval, lastExecution)
    local on = getPlayersOnline()
    if #on > 0 then
    for i = 1, #on do
    if getPlayerStorageValue(on[i], config.storages[1]) > 0 then
    if getPlayerItemCount(on[i], config.saffari_balls[1]) <= 0 or getPlayerStorageValue(on[i], config.storages[2]) - os.time() <= 0 then
    doTeleportThing(on[i], config.saffari_positions.exit)
    setPlayerStorageValue(on[i], config.storages[1], 0)
    setPlayerStorageValue(on[i], config.storages[2], 0)
    doPlayerSendTextMessage(on[i],22,'you left the saffari zone.')
    end
    end
    end
    end
    return true
    end
    ]]></globalevent>
    <event type="death" name="SaffariDeath" event="script"><![CDATA[
    domodlib('saffari_func')
    function onDeath(cid, corpse, deathList)
    if isPlayer(cid) and getPlayerStorageValue(cid, config.storages[1]) >= 1 then
    setPlayerStorageValue(cid, config.storages[1], 0)
    setPlayerStorageValue(cid, config.storages[2], 0)
    doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
    end
    return true
    end
    ]]></event>
    </mod>


     




     




    NPC




     




     




    Saffari Man.xml




    <?xml version="1.0"?>
    <npc name="Saffari Man" script="data/npc/scripts/saffari.lua" walkinterval="50000" floorchange="0">
    <health now="100" max="100"/>
    <look type="129" head="95" body="116" legs="121" feet="115" addons="3"/>
    <parameters>
    <parameter key="message_greet" value="Hello |PLAYERNAME|. You want to {enter} in the {saffari} zone!" />
    </parameters>
    </npc>


     




    saffari.lua




    domodlib('saffari_func')
    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,msg = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid,msg:lower()
    if isInArray({"saffari","enter","entrar"}, msg) then
    npcHandler:say('you can stay in the Saffari zone by '..config.minutes..' minutes, the price is '..config.price..' gp(s), You want enter? {yes}', cid)
    talkState[talkUser] = 1
    elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
    for i = 1, #config.blocked_pokeballs do
    if getPlayerItemCount(cid, config.blocked_pokeballs[i]) >= 1 then
    npcHandler:say('Keep your '..getItemNameById(config.blocked_pokeballs[i])..'!', cid) return true
    end
    end
    if config.need_premium and not isPremium(cid) then
    npcHandler:say('Sorry, you need to be premium!', cid) return true
    elseif getPlayerLevel(cid) < config.level then
    npcHandler:say('Sorry, you must be at least level '..config.level..' to enter the Saffari zone!', cid) return true
    elseif not doPlayerRemoveMoney(cid, config.price) then
    npcHandler:say('Sorry, you do not have enough money!', cid) return true
    end
    doPlayerAddItem(cid, config.saffari_balls[1], config.saffari_balls[2])
    selfSay("Thanks, you've been teleported to the Saffari zone and has "..config.minutes.." minutes, if you want to leave enter {!saffari leave}.", cid)
    doTeleportThing(cid, config.saffari_positions.enter)
    setPlayerStorageValue(cid, config.storages[1], 1)
    setPlayerStorageValue(cid, config.storages[2], os.time()+config.minutes*60)
    elseif msg == "no" and talkState[talkUser] >= 1 then
    selfSay("then ok.", cid)
    talkState[talkUser] = 0
    npcHandler:releaseFocus(cid)
    end
    return true
    end
    npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
    npcHandler:addModule(FocusModule:new())
  2. Upvote
    xAlony deu reputação a Crypter em [0.3.6-0.4] Explosive mine   
    Sistema simples que ao pisar em "X" item com a action id ele explode //
     
     
    Em data/lib
     
    Crie um arquivo chamado Mine.lua
     
    function setItemAid(uid, value)return doItemSetAttribute(uid, 'aid', value)endfunction removeBomba(pos, id)local item = getTileItemById(pos, id)    if item.uid > 0 then        doRemoveItem(item.uid)    endreturn trueend  
    Em data/movements/scripts
     
    Crie um arquivo chamado Mine.lua
    local config = {effect1 = 4, -- efeito ao pisareffect2 = 5, -- efeito ao explodirmsg = "Você foi acertado pela bomba.", -- msg que manda pra quem for acertadomindmg = 100, -- dmg minimo que tira (nao é necessariamente o dano que vai sair do cara pois precisa desconsiderar as defesas dele antes)maxdmg = 300, -- dmg maximo que tira (nao é o dano que vai sair do cara)self = true -- true/false pra ativar/desativar dano no cara que colocou a bomba caso ele mesmo passe na bomba.}local arr = {{0, 1, 0},{1, 3, 1}, -- area que vai acertar ao explodir a bomba{0, 1, 0},}local area = createCombatArea(arr)function onStepIn(cid, item, position)    local player = getPlayerByNameWildcard(getItemAttribute(item.uid, 'ref'))    doSendMagicEffect(position, config.effect1)    if isCreature(player) then        doAreaCombatHealth(player, COMBAT_FIREDAMAGE, position, area, -config.mindmg, -config.maxdmg, config.effect2)    end    if ((cid == player and config.self) or (not isPlayer(cid)) or (not isCreature(player))) then        doCreatureAddHealth(cid, -1 * math.random(config.mindmg, config.maxdmg))        doSendMagicEffect(position, config.effect2)    end    if isPlayer(cid) then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msg)    end    doRemoveItem(item.uid)return trueend  
    Em movements.xml
    <movevent type="StepIn" actionid="13245" event="script" value="Mine.lua"/>  
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     
    Caso voce queira rodar esse movements em uma spell
     
    data/spells/scripts:
     
    Crie um arquivo chamado mine.lua
     
    local config = {itemid = 2180, -- Id do item que ira explodir duration = 10, -- duração para ser removidaactionid = 13245, --Nao mechaeffect = 1, -- efeitomsg = "Planted explosive mine!" -- mensagemcooldown = 120, --- tempo entre um uso e outro em segundo}function onCastSpell(cid, var) if os.time() - getPlayerStorageValue(cid, 55695) >= config.cooldown then setPlayerStorageValue(cid, 55695, os.time())    local position = getCreaturePosition(cid)    local item = doCreateItem(config.itemid, 1, position)    setItemAid(item, config.actionid)    doItemSetAttribute(item, 'ref', getCreatureName(cid))    doCreatureSay(cid, config.msg, 20)    doSendMagicEffect(position, config.effect)    addEvent(removeBomba, config.duration * 1000, position, config.itemid)  elsedoPlayerSendCancel(cid, "Aguarde "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, 55695))).." segundos para plantar outra bomba!") endreturn trueend Em Spells.xml
     
    <instant name="Explosive Mine" words="Explosive Mine" lvl="1" mana="1" prem="0" aggressive="1" exhaustion="1000" needlearn="0" event="script" value="mine.lua">   <vocation id="1"/></instant>  
     
              Se Voce Gostou da script da um REP+ e me Segui .!
  3. Upvote
    xAlony deu reputação a Crypter em (0.3.6-0.4]Global-events[TOP 5 FRAGS no BroadCast]   
    Oque a script faz??
    Anuncio os top5 jogadores com mais frags.!
     
    Data/globalevents/script
     
    topfrags.lua
    function getJogadorFrags(jogador) -- essa função já existia, só modifiquei uma parte local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))} local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. jogador .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") if(result:getID() ~= -1) then repeat local content = {date = result:getDataInt("date")} if(content.date > times.today) then table.insert(contents.day, content) elseif(content.date > times.week) then table.insert(contents.week, content) else table.insert(contents.month, content) end until not result:next() result:free() end local size = {day = table.maxn(contents.day),week = table.maxn(contents.week),month = table.maxn(contents.month)} return size.day + size.week + size.monthendfunction onThink(interval, lastExecution) local max = 5 -- quantidade max que vai aparecer no rank local str,k, p = "TOP "..max.." Rank Frags:\n\n", 0, {} -- n mexa em nd local players = db.getResult("SELECT `id`,`name` FROM `players`") if (players:getID() ~= -1) then repeat table.insert(p, {getJogadorFrags(players:getDataInt("id")), players:getDataString("name")}) until not players:next() end table.sort(p, function(a, b) return a[1] > b[1] end) for x = 1, table.maxn(p) do k = k + 1 str = str .. "\n " .. k .. ". ".. p[x][2] .." - " .. p[x][1] .. "" if k == max then break end end doBroadcastMessage(str, 22) return trueend  
     
    TAG:
    <globalevent name="TopFrags" interval="3600" event="script" value="topfrags.lua"/>
  4. Upvote
    xAlony deu reputação a Crypter em [Resolvido] addevent com set storage   
    local function Storage()     setPlayerStorageValue(cid,900,1) end    AddEvent(Storage, 1000) end
  5. Upvote
    xAlony deu reputação a Crypter em Alavancas que dá skills   
    function onUse(cid, item, fromPosition, itemEx, toPosition)




    local Gain = 1




    local Stor = 67853




    if getPlayerStorageValue(cid, Stor) >= 1 then




    doPlayerSendCancel(cid, "it's not possible")




    else




    doPlayerAddSkill(cid, 0, Gain)




    doPlayerAddSkill(cid, 1, Gain)




    doPlayerAddSkill(cid, 2, Gain)




    doPlayerAddSkill(cid, 3, Gain)




    doPlayerAddSkill(cid, 4, Gain)




    doPlayerAddSkill(cid, 5, Gain)




    doPlayerAddSkill(cid, 6, Gain)




    doPlayerSetMagicLevel(cid, Gain)




    doPlayerSetStorageValue(cid, Stor, 1)




    end




    end



  6. Upvote
    xAlony deu reputação a Drakopoulos em World of piece - completo! sources - launcher - sprites - modulos   
    Como prometido, client e source - otclient funcionando 100%.
    Dentro tem uma pasta chamada Server que contem o config.lua e a database em sqlite funcionando com Account Manager ou se for usar site e mysql irá funcionar tbm.
     

     
     
    Link -  https://mega.nz/#!3YVFhZSb!62hSeDKFdfImTt_9Svy4zljA8MqlIaTRWBFGx27jScg
     

  7. Upvote
    xAlony recebeu reputação de victorcain em NTO LEAGUES V0.1   
    Poderia dizer como você extendeu pra 500?
  • Quem Está Navegando   0 membros estão online

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