Ir para conteúdo

El Rusher

Cavaleiro
  • Total de itens

    185
  • Registro em

  • Última visita

  • Dias Ganhos

    24

El Rusher venceu a última vez em Março 16

El Rusher had the most liked content!

3 Seguidores

Sobre El Rusher

Perfil

  • Gênero
    Masculino

Informações

  • Forma que conheci o xTibia
    Outros Sites
  • Sou
    Programador

Últimos Visitantes

2929 visualizações

El Rusher's Achievements

  1. function onSay(cid, words, param) --[Configurações de Condição]__ config = { --[[verdadeiro / Falso]] needPa = false, -- Precisa de Premium Account? [true / false] needPz = false, -- Precisa estar em Protection Zone? [true / false] battle = false, -- Precisa estar sem Batlle para Resetar? [true / false] withe = false, -- Players PK Withe pode Resetar? [true / false] red = false, -- Players PK Red pode Resetar? [true / false] tp = false, -- Teleportar para o Templo após o reset? [true / false] look = true, -- Mostrar Resets no Look do Player? [true / false] addLimite = true, -- Abilitar Limite de Resets? [true / false] setClasse = false, -- Mudar Vocação do player quando resetar? [true / false] storage = 54676, -- Storage [valor] --[Configurações do Reset]__ resetStatus = { player = getPlayerGUID(cid), -- Não Mude. lvl = 717217, -- Level Necessário para Resetar. [valor] lvlreset = 1, -- Level que retornará após o Reset. [valor] limite = 100, -- Máximo de resets que um player pode chegar. [valor] newClasse = 0, -- Id da Nova Vocação após o Reset. [valor] tempo = 0 }, } --[Funções]__ function Reseting(cid) resets = getResets(cid) setPlayerStorageValue(cid, config.storage, resets+1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doPlayerSetVocation(cid, config.resetStatus.newClasse) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player) db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player) return TRUE end function noAll(cid) resets = getResets(cid) setPlayerStorageValue(cid, config.storage, resets+1) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player) db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player) return TRUE end function noTeleporting(cid) resets = getResets(cid) setPlayerStorageValue(cid, config.storage, resets+1) doPlayerSetVocation(cid, config.resetStatus.newClasse) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player) db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player) return TRUE end function noLook(cid) resets = getResets(cid) setPlayerStorageValue(cid, config.storage, resets+1) doPlayerSetVocation(cid, config.resetStatus.newClasse) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player) db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player) return TRUE end function noClasse(cid) resets = getResets(cid) setPlayerStorageValue(cid, config.storage, resets+1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player) db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player) return TRUE end function setClasse(cid) resets = getResets(cid) setPlayerStorageValue(cid, config.storage, resets+1) doPlayerSetVocation(cid, config.resetStatus.newClasse) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player) db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player) return TRUE end function look(cid) resets = getResets(cid) setPlayerStorageValue(cid, config.storage, resets+1) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player) db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player) return TRUE end function teleporting(cid) resets = getResets(cid) setPlayerStorageValue(cid, config.storage, resets+1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player) db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player) return TRUE end function getResets(cid) local resets = getPlayerStorageValue(cid, config.storage) -- If the storage value is less than 0 or invalid, set resets to 0 if type(resets) ~= "number" or resets < 0 then resets = 0 end return resets end -- Função para verificar se o jogador tem VIP (normal ou infinito) function hasVipAccess(cid) local vipInfiniteStorage = 13587 local vipNormalStorage = 13545 local currentTime = os.time() -- Verifica VIP infinito (valor máximo de int32) if getPlayerStorageValue(cid, vipInfiniteStorage) == 2^31 - 1 then return true end -- Verifica VIP normal (baseado no tempo) if getPlayerStorageValue(cid, vipNormalStorage) > currentTime then return true end return false end local resets = getResets(cid) local needLvl = "Você precisa de "..config.resetStatus.lvl-getPlayerLevel(cid).." level's para resetar." local msg = "~~[Reset: "..getResets(cid).."]~~ 'Sucesso ao Resetar! Você será deslogado em "..config.resetStatus.tempo.." Segundos." --[Condiçoes]__ -- Verifica se o jogador tem acesso VIP if not hasVipAccess(cid) then doPlayerSendTextMessage(cid, 22, "Você precisa ter VIP (normal ou infinito) para usar o sistema de reset.") return true elseif(config.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then doPlayerSendTextMessage(cid, 22, "Voce Precisa estar em Protection Zone Para Resetar.") return TRUE elseif(config.addLimite == true) and (getResets(cid) == config.resetStatus.limite) then doPlayerSendTextMessage(cid, 22, "Voce ja atingiu o Limite de Resets.") return TRUE elseif(config.withe == false) and (getCreatureSkullType(cid) == 3) then doPlayerSendTextMessage(cid, 22, "Voce ta PK White, por isso não pode resetar.") return TRUE elseif(config.red == false) and (getCreatureSkullType(cid) == 4) then doPlayerSendTextMessage(cid, 22, "Voce ta PK Red, por isso não pode resetar.") return TRUE elseif(config.needPa == true) and not isPremium(cid) then doPlayerSendTextMessage(cid, 22, "Voce Precisa ser Premium Account para Resetar.") return TRUE elseif(config.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then doPlayerSendTextMessage(cid, 22, "Voce Precisa estar sem Battle para Resetar.") return TRUE elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == true) then addEvent(Reseting, config.resetStatus.tempo* 1000, cid) doPlayerSendTextMessage(cid, 22, msg) elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == false) then addEvent(noAll, config.resetStatus.tempo* 1000, cid) doPlayerSendTextMessage(cid, 22, msg) elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == true) then addEvent(noTeleporting, config.resetStatus.tempo* 1000, cid) doPlayerSendTextMessage(cid, 22, msg) elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == true) then addEvent(noLook, config.resetStatus.tempo* 1000, cid) doPlayerSendTextMessage(cid, 22, msg) elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == false) then addEvent(noClasse, config.resetStatus.tempo* 1000, cid) doPlayerSendTextMessage(cid, 22, msg) elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == true) then addEvent(setClasse, config.resetStatus.tempo* 1000, cid) doPlayerSendTextMessage(cid, 22, msg) elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == false) then addEvent(look, config.resetStatus.tempo* 1000, cid) doPlayerSendTextMessage(cid, 22, msg) elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == false) then addEvent(teleporting, config.resetStatus.tempo* 1000, cid) doPlayerSendTextMessage(cid, 22, msg) elseif doPlayerSendCancel(cid, needLvl) then doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return TRUE end return TRUE end
  2. local arrs = { { {0, 1, 0}, {1, 2, 1}, {0, 1, 0} }, { {0, 1, 1, 1, 0}, {1, 1, 0, 1, 1}, {1, 0, 2, 0, 1}, {1, 1, 0, 1, 1}, {0, 1, 1, 1, 0} }, { {0, 0, 1, 0, 1, 0, 0}, {0, 1, 0, 1, 0, 1, 0}, {1, 0, 0, 0, 0, 0, 1}, {1, 0, 0, 2, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 1}, {0, 1, 0, 0, 0, 1, 0}, {0, 0, 1, 1, 1, 0, 0} }, { {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0}, {0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0}, {1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1}, {1, 1, 0, 0, 0, 2, 0, 0, 0, 1, 1}, {1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1}, {0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0}, {0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0} } } local arr1 = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} } local arr2 = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} } local arr3 = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} } local arr4 = { {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0}, {0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0}, {1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1}, {1, 1, 0, 0, 0, 2, 0, 0, 0, 1, 1}, {1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1}, {0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0}, {0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0} } local area1 = createCombatArea(arr1) local area2 = createCombatArea(arr2) local area3 = createCombatArea(arr3) local area4 = createCombatArea(arr4) -- Dano do spell - Fase 1 function onGetFormulaValues1(cid, level, maglevel) local min = 1 local max = 1 return -min, -max end -- Dano do spell - Fase 2 function onGetFormulaValues2(cid, level, maglevel) local min = 2 local max = 2 return -min, -max end -- Dano do spell - Fase 3 function onGetFormulaValues3(cid, level, maglevel) local min = 3 local max = 3 return -min, -max end -- Dano do spell - Fase 4 function onGetFormulaValues4(cid, level, maglevel) local min = 4 local max = 4 return -min, -max end -- Efeito visual para o alvo - Fase 1 function onTargetTile1(cid, pos) doSendDistanceShoot(getCreaturePosition(cid), pos, CONST_ANI_HOLY) return true end -- Efeito visual para o alvo - Fase 2 function onTargetTile2(cid, pos) doSendDistanceShoot(getCreaturePosition(cid), pos, CONST_ANI_HOLY) return true end -- Efeito visual para o alvo - Fase 3 function onTargetTile3(cid, pos) doSendDistanceShoot(getCreaturePosition(cid), pos, CONST_ANI_HOLY) return true end -- Efeito visual para o alvo - Fase 4 function onTargetTile4(cid, pos) doSendDistanceShoot(getCreaturePosition(cid), pos, CONST_ANI_HOLY) return true end -- Criação do combate - Fase 1 local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(combat1, COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA) setCombatArea(combat1, area1) setCombatCallback(combat1, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues1") setCombatCallback(combat1, CALLBACK_PARAM_TARGETTILE, "onTargetTile1") -- Criação do combate - Fase 2 local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE) setCombatArea(combat2, area2) setCombatCallback(combat2, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues2") setCombatCallback(combat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2") -- Criação do combate - Fase 3 local combat3 = createCombatObject() setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(combat3, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE) setCombatArea(combat3, area3) setCombatCallback(combat3, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues3") setCombatCallback(combat3, CALLBACK_PARAM_TARGETTILE, "onTargetTile3") -- Criação do combate - Fase 4 local combat4 = createCombatObject() setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(combat4, COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER) setCombatArea(combat4, area4) setCombatCallback(combat4, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues4") setCombatCallback(combat4, CALLBACK_PARAM_TARGETTILE, "onTargetTile4") -- Funções para executar cada fase do spell function castSpell1(parameters) if isCreature(parameters.cid) then doCombat(parameters.cid, combat1, parameters.var) end return true end function castSpell2(parameters) if isCreature(parameters.cid) then doCombat(parameters.cid, combat2, parameters.var) end return true end function castSpell3(parameters) if isCreature(parameters.cid) then doCombat(parameters.cid, combat3, parameters.var) end return true end function castSpell4(parameters) if isCreature(parameters.cid) then doCombat(parameters.cid, combat4, parameters.var) end return true end function onCastSpell(cid, var) -- Executa a primeira fase imediatamente doCombat(cid, combat1, var) -- Agenda as próximas fases com atrasos diferentes local parameters = {cid = cid, var = var} addEvent(castSpell2, 100, parameters) addEvent(castSpell3, 250, parameters) addEvent(castSpell4, 500, parameters) return true end
  3. local config = { {item = 8310, qntd_max = 2, chance = 45, nome = "Gold Ingot"}, {item = 12635, qntd_max = 1, chance = 25, nome = "Mechanic Box"}, {item = 12636, qntd_max = 1, chance = 15, nome = "Surprise Box"}, {item = 9971, qntd_max = 50, chance = 50, nome = "Gold Coin"}, {item = 11390, qntd_max = 1, chance = 20, nome = "Platinum Amulet", raro = true}, } function onUse(cid, item, fromPos, itemEx, toPos) local msgsucesso = "Você abriu uma box e encontrou: " local check = 0 local ganhou = false local itensGanhos = {} for _, var in pairs(config) do if math.random(1, 100) <= var.chance and check < 5 then doPlayerAddItem(cid, var.item, var.qntd_max) check = check + 1 ganhou = true -- Adiciona à lista de itens ganhos table.insert(itensGanhos, var.qntd_max .. "x " .. var.nome) -- Se for um item raro, notifica todo o servidor if var.raro then local playerName = getCreatureName(cid) local msgRaro = playerName .. " encontrou um item raro: " .. var.nome .. "!" doBroadcastMessage(msgRaro, MESSAGE_STATUS_WARNING) end end end if ganhou then -- Cria mensagem com itens ganhos local mensagemFinal = msgsucesso .. table.concat(itensGanhos, ", ") -- Exibe mensagem flutuante acima do jogador doCreatureSay(cid, mensagemFinal, TALKTYPE_ORANGE_1) doSendMagicEffect(getCreaturePosition(cid), 49) doRemoveItem(item.uid, 1) else -- Caso não ganhe nada doCreatureSay(cid, "Você abriu a box mas não encontrou nada de valor.", TALKTYPE_ORANGE_1) doRemoveItem(item.uid, 1) end return true end
  4. local config = { p_time = 3600 -- Tempo em segundos para receber os pontos (1 hora) } function onSay(cid, words, param, channel) local getP = getPoints(cid) local lastTime = getCreatureStorage(cid, 1219) local currentTime = os.time() -- Usa o tempo de jogo local timeElapsed = currentTime - lastTime local timeRemaining = config.p_time - timeElapsed if timeRemaining < 0 then timeRemaining = 0 end local hours = math.floor(timeRemaining / 3600) local minutes = math.floor((timeRemaining % 3600) / 60) local seconds = timeRemaining % 60 doPlayerPopupFYI(cid, string.format("Você possui %d p-points!\nPróximo ponto em: %02d:%02d:%02d", getP, hours, minutes, seconds)) return true end local config = { p_time = 3600, -- Tempo em segundos para receber os pontos (1 hora) p_points = 1 -- Quantidade de pontos recebida a cada "p_time" } local GLOBAL_TIME_STORAGE = 1220 -- Define um storage global para o tempo de jogo local function givePoints(cid, quant) local currentTime = os.time() -- Usa o tempo de jogo if currentTime - getCreatureStorage(cid, 1219) >= config.p_time then doPlayerSendTextMessage(cid, 19, "Parabéns, você recebeu ".. config.p_points .." p-point. Agora você tem ".. config.p_points + getPoints(cid) .." p-points na sua conta. Seu tempo foi zerado, próximo p-points daqui 1 hora.") doPlayerAddPoints(cid, quant) doCreatureSetStorage(cid, 1219, currentTime) end return true end function onThink(interval) local currentTime = os.time() setGlobalStorageValue(GLOBAL_TIME_STORAGE, currentTime) for i, v in pairs(getPlayersOnline()) do if getCreatureStorage(v, 1219) > 0 then -- Verifica se o storage está inicializado givePoints(v, config.p_points) else doCreatureSetStorage(v, 1219, currentTime) -- Inicializa o storage para novos personagens end end return true end
  5. bom dia talkaction: local config = { p_time = 3600 -- Tempo em segundos para receber os pontos (1 hora) } function onSay(cid, words, param, channel) local getP = getPoints(cid) local lastTime = getCreatureStorage(cid, 1219) local currentTime = getGlobalStorageValue(GLOBAL_TIME_STORAGE) or os.time() -- Usa o tempo de jogo local timeElapsed = currentTime - lastTime local timeRemaining = config.p_time - timeElapsed if timeRemaining < 0 then timeRemaining = 0 end local hours = math.floor(timeRemaining / 3600) local minutes = math.floor((timeRemaining % 3600) / 60) local seconds = timeRemaining % 60 doPlayerPopupFYI(cid, string.format("Você possui %d p-points!\nPróximo ponto em: %02d:%02d:%02d", getP, hours, minutes, seconds)) return true end globalevent: local config = { p_time = 3600, -- Tempo em segundos para receber os pontos (1 hora) p_points = 1 -- Quantidade de pontos recebida a cada "p_time" } local GLOBAL_TIME_STORAGE = 1220 -- Define um storage global para o tempo de jogo local function givePoints(cid, quant) local currentTime = getGlobalStorageValue(GLOBAL_TIME_STORAGE) or os.time() -- Usa o tempo de jogo if currentTime - getCreatureStorage(cid, 1219) >= config.p_time then doPlayerSendTextMessage(cid, 19, "Parabéns, você recebeu ".. config.p_points .." p-point. Agora você tem ".. config.p_points + getPoints(cid) .." p-points na sua conta. Seu tempo foi zerado, próximo p-points daqui 1 hora.") doPlayerAddPoints(cid, quant) doCreatureSetStorage(cid, 1219, currentTime) end return true end function onThink(interval) local currentTime = getGlobalStorageValue(GLOBAL_TIME_STORAGE) or os.time() setGlobalStorageValue(GLOBAL_TIME_STORAGE, currentTime + interval) for i, v in pairs(getPlayersOnline()) do if getCreatureStorage(v, 1219) > 0 then -- Verifica se o storage está inicializado givePoints(v, config.p_points) else doCreatureSetStorage(v, 1219, currentTime) -- Inicializa o storage para novos personagens end end return true end
  6. no points.lua adicione o seguinte no inicio do script: local config = { p_time = 3600 -- Tempo em segundos para receber os pontos (1 hora) } local config = { p_time = 3600 -- Tempo em segundos para receber os pontos (1 hora) } function onSay(cid, words, param, channel) local getP = getPoints(cid) local lastTime = getCreatureStorage(cid, 1219) local currentTime = os.time() local timeElapsed = currentTime - lastTime local timeRemaining = config.p_time - timeElapsed if timeRemaining < 0 then timeRemaining = 0 end local hours = math.floor(timeRemaining / 3600) local minutes = math.floor((timeRemaining % 3600) / 60) local seconds = timeRemaining % 60 doPlayerPopupFYI(cid, string.format("Você possui %d p-points!\nPróximo ponto em: %02d:%02d:%02d", getP, hours, minutes, seconds)) return true end
  7. local waterIds = {493, 4608} -- IDs das tiles de água, adicione aqui os IDs específicos das tiles de água que você está usando. local storageSurf = 1000 -- ID de armazenamento para a surf local storageBike = 1001 -- ID de armazenamento para a bicicleta local storageDive = 1002 -- ID de armazenamento para mergulho local storageRide = 1003 -- ID de armazenamento para montaria local storageFly = 1004 -- ID de armazenamento para voar local condition = Condition(CONDITION_OUTFIT) condition:setTicks(-1) function getEffectIdForPlayer(player) -- Esta função deve retornar o ID do efeito se o jogador estiver com algum efeito ativo -- Exemplo: -- if player:getCondition(CONDITION_INFIGHT) then -- return CONDITION_INFIGHT -- end -- Adicione aqui as verificações de condição que desejar return nil end function hasSummons(player) -- Função para verificar se o jogador tem um summon return #player:getSummons() > 0 end function doRemoveSummon(cid, instant, position, forced) -- Função para remover o summon do jogador local player = Player(cid) if player then local summons = player:getSummons() for _, summon in ipairs(summons) do summon:remove() end end end function doReleaseSummon(cid, position, instant, forced) -- Função para liberar o summon do jogador local player = Player(cid) if player then local summons = player:getSummons() for _, summon in ipairs(summons) do summon:teleportTo(position) end end end function onStepIn(creature, item, position, fromPosition) if not creature:isPlayer() then return false end -- Verificar se o jogador tem algum efeito ativo (não pode usar surf, fly ou ride) local effectId = getEffectIdForPlayer(creature) if effectId then creature:sendCancelMessage("Desculpe, não é possível enquanto estiver com efeito ativo.") creature:teleportTo(fromPosition, false) return false end if creature:getStorageValue(storageBike) > 0 then creature:sendCancelMessage("Desculpe, não é possível enquanto estiver na bicicleta.") creature:teleportTo(fromPosition, false) return false end local outfit = 267 if hasSummons(creature) then local summon = creature:getSummons()[1] local summonName = summon:getName() local summonSpeed = summon:getTotalSpeed() local monsterType = MonsterType(summonName) local surfOutfit = monsterType:isSurfable() if surfOutfit > 0 then if surfOutfit > 1 then outfit = surfOutfit end creature:changeSpeed(summonSpeed) creature:setStorageValue(storageSurf, outfit) condition:setOutfit({lookType = outfit}) creature:addCondition(condition) doRemoveSummon(creature:getId(), false, nil, false) creature:say(summonName .. ", vamos surfar!", TALKTYPE_MONSTER_SAY) else creature:sendCancelMessage("Desculpe, não é possível. Seu Pokémon não pode surfar.") creature:teleportTo(fromPosition, false) return false end else if creature:getStorageValue(storageSurf) == -1 then creature:sendCancelMessage("Desculpe, não é possível. Você precisa de um Pokémon que possa surfar.") creature:teleportTo(fromPosition, false) return false else local surfOutfit = creature:getStorageValue(storageSurf) condition:setOutfit({lookType = surfOutfit}) creature:addCondition(condition) end end return true end function onStepOut(creature, item, position, fromPosition) if not creature:isPlayer() then return false end local tile = Tile(creature:getPosition()) if not tile or not tile:getGround() then return false end local tileId = tile:getGround():getId() if (not isInArray(waterIds, tileId) and position == fromPosition) or (creature:getStorageValue(storageDive) > 0) then creature:changeSpeed(creature:getBaseSpeed()-creature:getSpeed()) creature:setStorageValue(storageSurf, -1) doReleaseSummon(creature:getId(), creature:getPosition(), false, false) local summon = creature:getSummons()[1] if summon then local summonName = summon:getName() creature:say(summonName .. ", obrigado!", TALKTYPE_MONSTER_SAY) else creature:say("Obrigado!", TALKTYPE_MONSTER_SAY) end end if not (creature:getStorageValue(storageRide) > 0 or creature:getStorageValue(storageFly) > 0 or creature:getStorageValue(storageBike) > 0 or creature:getStorageValue(storageDive) > 0) then creature:removeCondition(CONDITION_OUTFIT) end return true end
  8. tankactions: function onSay(cid, words, param, channel) local getP = getPoints(cid) local lastTime = getCreatureStorage(cid, 1219) local currentTime = os.time() local timeElapsed = currentTime - lastTime local timeRemaining = config.p_time - timeElapsed if timeRemaining < 0 then timeRemaining = 0 end local hours = math.floor(timeRemaining / 3600) local minutes = math.floor((timeRemaining % 3600) / 60) local seconds = timeRemaining % 60 doPlayerPopupFYI(cid, string.format("Você possui %d p-points!\nPróximo ponto em: %02d:%02d:%02d", getP, hours, minutes, seconds)) return true end globalevent: --[[ P Points System by LsM. ###### © 2011 Version : v1.0 ]]-- local config = { p_time = 3600, -- Tempo em segundos para receber os pontos( 3600 = 1hora ) p_points = 1 -- Quantidade de pontos recebida a cada "p_time" } local function givePoints(cid, quant) if os.time() - getCreatureStorage(cid, 1219) >= config.p_time then doPlayerSendTextMessage(cid, 19, "Parabéns, você recebeu ".. config.p_points .." p-point. Agora você tem ".. config.p_points + getPoints(cid) .." p-points na sua conta. Seu tempo foi zerado, próximo p-points daqui 1 hora.") doPlayerAddPoints(cid, quant) doCreatureSetStorage(cid, 1219, os.time()) end return true end function onThink(interval) for i, v in pairs(getPlayersOnline()) do givePoints(v, config.p_points) end return true end
  9. ninguem pode ver a url que vc soltou pq esta rodando somente no seu servidor local.. observe que uma das colunas mencionadas no comando DESC players; está sem um sublinhado (skill axe), enquanto no seu comando INSERT ela está com um sublinhado (skill_axe INSERT INTO `players` (`id`, `name`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `lastlogout`, `blessings`, `blessings1`, `blessings2`, `blessings3`, `blessings4`, `blessings5`, `blessings6`, `blessings7`, `blessings8`, `onlinetime`, `deletion`, `balance`, `offlinetraining_time`, `offlinetraining_skill`, `stamina`, `skill_fist`, `skill_fist_tries`, `skill_club`, `skill_club_tries`, `skill_sword`, `skill_sword_tries`, `skill_axe`, `skill_axe_tries`, `skill_dist`, `skill_dist_tries`, `skill_shielding`, `skill_shielding_tries`, `skill_fishing`, `skill_fishing_tries`, `skill_critical_hit_chance`, `skill_critical_hit_chance_tries`, `skill_critical_hit_damage`, `skill_critical_hit_damage_tries`, `skill_life_leech_chance`, `skill_life_leech_chance_tries`, `skill_life_leech_amount`, `skill_life_leech_amount_tries`, `skill_mana_leech_chance`, `skill_mana_leech_chance_tries`, `skill_mana_leech_amount`, `skill_mana_leech_amount_tries`, `skill_criticalhit_chance`, `skill_criticalhit_damage`, `skill_lifeleech_chance`, `skill_lifeleech_amount`, `skill_manaleech_chance`, `skill_manaleech_amount`, `manashield`, `max_manashield`, `xpboost_stamina`, `xpboost_value`, `marriage_status`, `marriage_spouse`, `bonus_rerolls`, `prey_wildcard`, `task_points`, `quickloot_fallback`, `lookmountbody`, `lookmountfeet`, `lookmounthead`, `lookmountlegs`, `lookfamiliarstype`, `isreward`, `istutorial`, `ismain`, `forge_dusts`, `forge_dust_level`, `randomize_mount`, `boss_points`, `created`, `hidden`, `comment`) VALUES (1, 'Account Manager', 0, 1, 1, 1, 0, 150, 150, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 160, 54, 7, '', 400, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, '', 0, 0, '', 0, 0, ''), (2, 'Rook Sample', 0, 1, 1, 1, 0, 150, 150, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, '', 400, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, '', 0, 0, '', 0, 0, ''), (3, 'Sorcerer Sample', 0, 1, 1, 1, 1, 150, 150, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, '', 400, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, '', 0, 0, '', 0, 0, ''), (4, 'Druid Sample', 0, 1, 1, 1, 2, 150, 150, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, '', 400, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, '', 0, 0, '', 0, 0, ''), (5, 'Paladin Sample', 0, 1, 1, 1, 3, 150, 150, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, '', 400, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, '', 0, 0, '', 0, 0, ''), (6, 'Knight Sample', 0, 1, 1, 1, 4, 150, 150, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, '', 400, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, '', 0, 0, '', 0, 0, '');
  10. El Rusher

    Ajuda com SCRIPT.

    tenta assim colega local regenEvent = {} -- Tabela para armazenar os identificadores de eventos por jogador. function onEquip(cid, item, position, fromPosition) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Activated Strength Blessing.") doSendAnimatedText(getPlayerPosition(cid), "Reloading!!", 210) doPlayerSay(cid, "POWER-UP!", 16) doSendMagicEffect(getPlayerPosition(cid), 95) local function regenVida(cid) if isPlayer(cid) and getPlayerAccess(cid) > 0 then -- Verifica se o jogador ainda é válido. doPlayerAddHealth(cid, 1000) regenEvent[cid] = addEvent(regenVida, 1000, cid) -- Reagendar o evento. else regenEvent[cid] = nil -- Limpa o evento se o jogador não estiver mais online. end end if isPlayer(cid) then -- Certifica-se de que o jogador é válido antes de inicializar o evento. regenEvent[cid] = addEvent(regenVida, 1000, cid) -- Inicializa o evento com o `cid`. end return TRUE end function onDeEquip(cid, item, position, fromPosition) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Strength Blessing Disabled.") doSendAnimatedText(getPlayerPosition(cid), "Weakening!!", 210) doPlayerSay(cid, "Losing Strength!", 16) doSendMagicEffect(getPlayerPosition(cid), 95) -- Parar o evento associado ao jogador. if regenEvent[cid] then stopEvent(regenEvent[cid]) -- Cancela o evento em execução. regenEvent[cid] = nil -- Remove o identificador para evitar uso futuro. end return TRUE end
  11. isso é falha de conexao com o banco de dados, é só inserir o nome dele na linha 'sqlFile = ""'
  12. acho que nao compreendi direito oq vc quer que aconteceça, poderia explicar melhor por gentileza
  13. local BOOSTED_MONSTER = 56404 local boostedMonstersList = {"rat"} local experienceBonus = 8.0 function onDeath(cid, corpse, deathList) local master = getCreatureMaster(cid) if (master and master ~= cid) then return true end local boostedMonster = boostedMonstersList[getGlobalStorageValue(BOOSTED_MONSTER)] if getCreatureName(cid):lower() == boostedMonster then -- Inicializa a mensagem de loot local lootMessage = "Loot of " .. getCreatureName(cid):lower() .. ": " local lootList = getMonsterLootList(getCreatureName(cid)) local firstLoot = true for _, loot in pairs(lootList) do if loot.count > 1 then local numb = math.random(1, loot.count) doAddContainerItem(corpse.uid, loot.id, numb) if firstLoot then lootMessage = lootMessage .. numb .. " " .. getItemNameById(loot.id) firstLoot = false else lootMessage = lootMessage .. ", " .. numb .. " " .. getItemNameById(loot.id) end elseif math.random(1, 100000) <= loot.chance then doAddContainerItem(corpse.uid, loot.id, 1) if firstLoot then lootMessage = lootMessage .. getItemNameById(loot.id) firstLoot = false else lootMessage = lootMessage .. ", " .. getItemNameById(loot.id) end end end -- Adiciona "(boosted loot)" ao final da mensagem lootMessage = lootMessage .. ". (boosted loot)" -- Envia a mensagem de loot para todos os jogadores for i = 1, #deathList do doPlayerSendTextMessage(deathList[i], MESSAGE_INFO_DESCR, lootMessage) end end return true end
  14. local Snowtalk = TalkAction("!snowball") function Snowtalk.onSay(cid, words, param, channel) local k = string.split(param, ",") if k[1] ~= nil then if string.upper(k[1]) == 'INFO' then local score = {} local output = "Você tem " .. getPlayerStorageValue(cid, SBW_SCORE) .. " pontos.\nVocê tem " .. getPlayerStorageValue(cid, SBW_AMMO) .. "x munições.\n------------------\nO maior matador:\n" for _, pid in ipairs(getOnlinePlayers()) do if getPlayerStorageValue(pid, SBW_INEVENT) then table.insert(score, {getCreatureName(pid), getPlayerStorageValue(pid, SBW_SCORE)}) end end local lx = #score if lx > 3 then lx = 3 end table.sort(score, function(a, b) return a[2] > b[2] end) for i = 1, lx do output = output .. i .. ". " .. score[i][1] .. " [" .. score[i][2] .. "].\n" end doPlayerPopupFYI(cid, output) elseif string.upper(k[1]) == 'ATIRAR' then if getPlayerStorageValue(cid, SBW_INEVENT) == 1 and not getTileInfo(getThingPos(cid)).protection then if getPlayerStorageValue(cid, SBW_EXAUSTHED) <= 1 then if getPlayerStorageValue(cid, SBW_AMMO) > 0 then if SBW_STATUS == 'on' then if not SBW_AMMOINFI then setGlobalStorageValue(cid, SBW_AMMO, getPlayerStorageValue(cid, SBW_AMMO) - 1) end setGlobalStorageValue(cid, SBW_EXAUSTHED, 2) lineAnimation(getCreatureDirection(cid), getCreaturePosition(cid), 13, cid, 1, 1, 1, 1, 1, 1, 1, 1) addEvent(setGlobalStorageValue, SBW_SHOOTEXAUSTHED, cid, SBW_EXAUSTHED, 1) if getPlayerStorageValue(cid, SBW_AMMO) ~= 1 then doPlayerSendTextMessage(cid, 27, "Restam " .. getPlayerStorageValue(cid, SBW_AMMO) .. "x bolas de neve.") else doPlayerSendTextMessage(cid, 27, "Usando sua última bola de neve, recarregue.") end end else doPlayerSendCancel(cid, "Você está sem bolas de neve, recarregue no centro do campo ou mate um inimigo.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end else doPlayerPopupFYI(cid, "Acalme-se, você deve esperar para atirar novamente.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return false end else doPlayerPopupFYI(cid, "Você precisa estar dentro do evento ou fora da área protegida.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end end end return true end function lineAnimation(lookDir, playerPos, effect, cid, fvar, fpos, ffound, fposV, fcheck, fvcid, floopCounter, fvpid) local var = fvar local pos = playerPos local found = ffound local posV = fposV local check = fcheck local vcid = fvcid local loopCounter = floopCounter local vpid = fvpid if var < 2 then vcid = cid end pos = playerPos if not isInWallArray(convert(lookDir, pos)) then doSendDistanceShoot(pos, convert(lookDir, pos), effect) pos = convert(lookDir, pos) var = var + 1 posV = convertV(lookDir, playerPos) for _, pid in ipairs(getOnlinePlayers()) do if getCreaturePosition(pid).x == pos.x and getCreaturePosition(pid).y == pos.y and getCreaturePosition(pid).z == pos.z then vpid = pid if vpid ~= vcid then if var > 2 then if getCreaturePosition(pid).x == posV.x and getCreaturePosition(pid).y == posV.y and getCreaturePosition(pid).z == posV.z then killPlayer(pid, pos, vcid) if lookDir == 0 or lookDir == 2 then var = 6 else var = 8 end end end killPlayer(pid, pos, vcid) if lookDir == 0 or lookDir == 2 then var = 6 else var = 8 end end end loopCounter = loopCounter + 1 end if (lookDir == 0 or lookDir == 2) and var ~= 6 then addEvent(lineAnimation, SBW_BALLSPEED, lookDir, pos, effect, nil, var, pos, found, posV, check, vcid, loopCounter, vpid) elseif (lookDir == 1 or lookDir == 3) and var ~= 8 then addEvent(lineAnimation, SBW_BALLSPEED, lookDir, pos, effect, nil, var, pos, found, posV, check, vcid, loopCounter, vpid) else var = 1 end else doSendMagicEffect(convert(lookDir, pos), 2) var = 1 end end function convert(lookDir, pos) local positions = { [0] = {x = pos.x, y = pos.y - 1, z = pos.z}, [1] = {x = pos.x + 1, y = pos.y, z = pos.z}, [2] = {x = pos.x, y = pos.y + 1, z = pos.z}, [3] = {x = pos.x - 1, y = pos.y, z = pos.z}, } return positions[lookDir] end function convertV(lookDir, pos) local positions = { [0] = {x = pos.x, y = pos.y + 1, z = pos.z}, [1] = {x = pos.x - 1, y = pos.y, z = pos.z}, [2] = {x = pos.x, y = pos.y - 1, z = pos.z}, [3] = {x = pos.x + 1, y = pos.y, z = pos.z}, } return positions[lookDir] end function isInWallArray(pos) for _, wallId in ipairs(SBW_WALLSID) do if getTileItemById(pos, wallId).itemid == wallId then return true end end return false end function killPlayer(cid, pos, killer) local tl = SBW_AREA[1] local br = SBW_AREA[2] local posti local isPossibleToTeleportPlayer = false while not isPossibleToTeleportPlayer do posti = Position(math.random(tl.x, br.x), math.random(tl.y, br.y), 7) if not isInWallArray(posti) then isPossibleToTeleportPlayer = true end end doTeleportThing(cid, posti) doSendMagicEffect(pos, 2) doSendMagicEffect(posti, 6) doSendAnimatedText(pos, getCreatureName(killer), 55) doPlayerSendTextMessage(cid, 27, "Você morreu para " .. getCreatureName(killer) .. ".") setGlobalStorageValue(killer, SBW_SCORE, getPlayerStorageValue(killer, SBW_SCORE) + SBW_POINTSKILL) doPlayerSendTextMessage(killer, 27, "Você matou " .. getCreatureName(cid) .. ".") if SBW_LOSTSCORE then setGlobalStorageValue(cid, SBW_SCORE, getPlayerStorageValue(cid, SBW_SCORE) - 1) end if SBW_RESETAMMO then setGlobalStorageValue(cid, SBW_AMMO, SBW_MINAMMO) end end Snowtalk:separator(" ") Snowtalk:register() testa assim colega
  15. El Rusher

    Ajuda com SCRIPT.

    poe cid nesses parenteses ai
  • Quem Está Navegando   0 membros estão online

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