Ir para conteúdo

zipter98

Membro
  • Registro em

  • Última visita

Tudo que zipter98 postou

  1. Você pode instalar nas sources o creatureevent onGainExp (só procurar no Google que você acha) e fazer simples alterações, ou usar a seguinte função para alterar a rate de experiência: doPlayerSetExperienceRate(cid, 1.5)
  2. O bônus de reflect seria acumulativo? Qual seria a fórmula do dano refletido?
  3. Abaixo de: doAddCondition(playerMuted, conditions[timeMuted]) coloque: setPlayerStorageValue(cid, 91828, os.time() + timeMuted * 60) Depois, em data/creaturescripts/scripts: local maxTimeMute = 60 --Tempo máximo de mute, em minutos. local conditions = {} for i = 1, maxTimeMute do conditions[i] = createConditionObject(CONDITION_MUTED) setConditionParam(conditions[i], CONDITION_PARAM_TICKS, i * 60 * 1000) end function onLogin(cid) local remainingTime = getPlayerStorageValue(cid, 91828) - os.time() if remainingTime > 0 and conditions[remainingTime] then doAddCondition(cid, conditions[remainingTime]) end return true end
  4. Período configurado no código? Acesso ao local por comando? Só teria uma área para guerra, ou várias (para guerras de outras guildas)?
  5. Ops, não prestei atenção no código. Corrigido.
  6. Apenas recomendaria uma verificação do jogador estar ou não online, para evitar erros.
  7. Pode postar o código da função countDown?
  8. <event type="death" name="deathEffect" event="script" value="nome_do_arquivo.lua"/>
  9. Tags: <event type="logout" name="skullLogin" event="script" value="nome_do_arquivo.lua"/> <event type="statschange" name="skullStatsChange" event="script" value="nome_do_arquivo.lua"/> <event type="target" name="skullTarget" event="script" value="nome_do_arquivo.lua"/> Código (data/creaturescripts/scripts): local monsterName = "nome_do_monstro" function onStatsChange(cid, attacker, type, combat, value) if isPlayer(attacker) and getCreatureSkullType(attacker) ~= SKULL_WHITE and isMonster(cid) and getCreatureName(cid) == monsterName and type == STATSCHANGE_HEALTHLOSS then doCreatureSetSkullType(attacker, SKULL_WHITE) end return true end function onTarget(cid, target) if isPlayer(cid) and getCreatureSkullType(cid) ~= SKULL_WHITE and isMonster(target) and getCreatureName(target) == monsterName then doCreatureSetSkullType(cid, SKULL_WHITE) end return true end function onLogin(cid) registerCreatureEvent(cid, "skullStatsChange") registerCreatureEvent(cid, "skullTarget") return true end
  10. Não se esqueça de registrar o evento no arquivo .XML dos monstros. local config = { --["monster_name"] = effect, ["Dragon"] = 28, ["Orc"] = 13, --etc } function onDeath(cid) local effect = config[getCreatureName(cid)] if effect then doSendMagicEffect(getThingPos(cid), effect) end return true end
  11. local GMGroup = 3 -- grupo mínimo do GM local maxTimeMute = 60 --Tempo máximo de mute, em minutos. Sim, isso é necessário. local conditions = {} for i = 1, maxTimeMute do conditions[i] = createConditionObject(CONDITION_MUTED) setConditionParam(conditions[i], CONDITION_PARAM_TICKS, i * 60 * 1000) end function onSay(cid,words,param) local testeGroup = getPlayerGroupId(cid) if testeGroup >= GMGroup then if param ~= "" then local sep = param:explode(",") local playerMuted, timeMuted = getPlayerByName(sep[1]), tonumber(sep[2]) if not timeMuted or not conditions[timeMuted] then doPlayerSendCancel(cid, "Escolha um tempo de mute (em minutos) válido.") elseif isPlayer(playerMuted) then local GMName = getPlayerName(cid) local playerName = getPlayerName(playerMuted) if playerName == GMName then doPlayerSendTextMessage(cid,MESSAGE_STATUS_DEFAULT ,"Por que ao invés aplicar um muted em si mesmo você mesmo não cale a boca?") return 0 end local playerGroup = getPlayerGroupId(playerMuted) if playerGroup >= testeGroup then doPlayerSendTextMessage(cid,MESSAGE_STATUS_DEFAULT ,"Você não pode calar um jogador que tenha um cargo maior ou igual ao seu.") return 0 end doAddCondition(playerMuted, conditions[timeMuted]) doPlayerSendTextMessage(cid,MESSAGE_STATUS_DEFAULT ,"Você aplicou um muted de "..timeMuted.." minuto(s) no jogador "..playerName..".") doPlayerSendTextMessage(playerMuted,MESSAGE_STATUS_DEFAULT,"Você foi mutado por "..timeMuted.." minuto(s) pelo "..GMName..".") else doPlayerSendTextMessage(cid,MESSAGE_STATUS_DEFAULT ,"O nome "..param.." está escrito errado ou este está offline.") end end end return true end
  12. Troque: received = doPlayerAddItemEx(1,getPlayerSlotItem(cid, 3).uid, bag) por: received = doPlayerAddItemEx(cid, bag)
  13. Faltou um parênteses na função responsável por teleportar o jogador. Troque por: doTeleportThing(cid, getThingPos(getCreatureTarget(cid)))
  14. function onSay(cid, words, param) local t = param:explode(",") for _, pid in pairs(getPlayersOnline()) do setPlayerStorageValue(pid, tonumber(t[1]) or 1, tonumber(t[2]) or 1) end return true end
  15. Qual seu sistema de Castle 24h?
  16. local config = { segundos = 5, lerIP = "yes" } config.lerIP = getBooleanFromString(config.lerIP) local m_lastLogin, m_lastIP = 0, 0 function onLogout(cid) local timeNow, playerIP = os.time(), getPlayerIp(cid) if(m_lastLogin + config.segundos >= timeNow and (config.lerIP == FALSE or m_lastIP == playerIP)) then doPlayerSendTextMessage(cid,19, "[Pokémon X Timer] Aguarde "..timeNow - (m_lastLogin + config.segundos).." segundo(s) Para Poder Deslogar!.") return false end m_lastIP = playerIP m_lastLogin = timeNow return true end
  17. Digo, o onAttack seria executado quando a aranha visse o jogador ou quando houvesse uma troca de dano entre eles? Por exemplo: -Aranha viu o jogador -onAttack é executado -Assim, addEvent é executado Confesso que nunca escrevi um código usando este creatureevent, então não o conheço muito bem. E o silence, o que você acha: fazê-lo em Lua ou C++? Lua seria mais fácil de ser escrito, porém em C++ acredito que ficaria mais simples e prático.
  18. Mas o onAttack seria executado logo quando a aranha visse/targetasse o jogador, ou precisaria de uma troca de dano entre eles?
  19. Bem, terminei o código da aranha, falta apenas testá-lo e aperfeiçoá-lo. Se alguém também o fez, pergunto: qual método foi utilizado para aquela parte da aranha teleportar logo que ver o jogador? Eu usei onTarget com uma modificação nas sources para que monstros também executem este creatureevent (achei esta a maneira mais viável).
  20. Tabela effectiveness, configuration.lua. Já o multiplicador de dano, exp2.0.lua.
  21. Cara, que ideia legal essa da aranha. :0 Mas ela já faria essa ação logo que o primeiro jogador aparecer na tela? E, também, o player chegaria na área simplesmente andando ou por, sei lá, um teleporte?
  22. Mas como as bombas seriam destruídas? E não entendi muito bem a primeira mecânica da aranha.
  23. zipter98 postou uma resposta no tópico em Suporte Tibia OTServer
    local focus = 0 local max_distance = 4 local talk_start = 0 local conv = 0 local fighting = false local challenger = 0 local pokeNpc = nil local pokeChalenger = nil local afk_limit_time = 15 -- seconds local afk_time = 0 -- don't change local battle_turn = 0 -- don't change local challenger_turn = 0 -- don't change local exhStorage = 19182 local exhaust = 15 --Tempo, em segundos, para o NPC atacar o jogador novamente. local function doSummonGymPokemon(npc) battle_turn = battle_turn + 1 local this = npc if #getCreatureSummons(this) >= 1 or focus == 0 then return true end local it = wildRocket[math.random(1, 5)][battle_turn] pokeNpc = doSummonCreature(it.name, getThingPos(this)) local summon = getCreatureSummons(this)[1] local balleffect = pokeballs["normal"].effect if it.ball and pokeballs[it.ball] then balleffect = pokeballs[it.ball].effect end doSendMagicEffect(getThingPos(pokeNpc), balleffect) setPlayerStorageValue(pokeNpc, 990, this) setPlayerStorageValue(pokeNpc, 991, "battle") setPlayerStorageValue(this, 990, 1) addEvent(adjustWildPoke, 15, pokeNpc, it.optionalLevel) mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", it.name) doCreatureSay(this, mgo, 1) fighting = true end local function doWinDuel(cid, npc) local outfit = getCreatureOutfit(getThis()) setPlayerStorageValue(cid, exhStorage, os.time() + exhaust) local this = npc ---------------------------------------- if outfit.lookType == 605 then --verifica se o npc eh female.. ;p monster = doCreateMonster("aRocketFemale", getThingPos(this)) doRemoveCreature(this) else monster = doCreateMonster("aRocket", getThingPos(this)) doRemoveCreature(this) end ---------------------------------------- --doCloneOut(monster, outfit) addEvent(beDrunk, 100, monster) addEvent(doSummonGymPokemon, 1000, getThis()) end local afk_warning = false function checkPoke(player, poke) end function onThink() if challenger == 0 then local s = getSpectators(getThingPos(getThis()), 5, 5) table.remove(s, getThis()) if #s > 0 then for i = 1, #s do if isPlayer(s[i]) and getPlayerStorageValue(s[i], 123456) > -1 and getPlayerStorageValue(s[i], exhStorage) < os.time() then challenger = s[i] focus = s[i] setPlayerStorageValue(s[i], 990, 1) selfSay(getCreatureName(s[i])..", let's fight!") talk_start = os.clock() addEvent(doSummonGymPokemon, 850, getThis()) break end end end end if focus == 0 then selfTurn(2) fighting = false challenger = 0 challenger_turn = 0 battle_turn = 0 afk_time = 0 afk_warning = false setPlayerStorageValue(getThis(), 990, -1) return true else if not isCreature(focus) then focus = 0 return true end if fighting then talk_start = os.clock() if #getCreatureSummons(challenger) >= 1 then if pokeChalenger == nil then pokeChalenger = getCreatureName(getCreatureSummons(challenger)[1]) afk_time = 0 challenger_turn = challenger_turn + 1 elseif pokeChalenger == getCreatureName(getCreatureSummons(challenger)[1]) then afk_time = 0 else afk_time = 0 challenger_turn = challenger_turn + 1 pokeChalenger = getCreatureName(getCreatureSummons(challenger)[1]) end else afk_time = afk_time + 0.5 end if afk_time > afk_limit_time then setPlayerStorageValue(focus, 990, -1) setPlayerStorageValue(focus, 999, -1) doRemoveCreature(pokeNpc) focus = 0 selfSay("I have waited too long, come back when you are ready!") setPlayerStorageValue(cid, exhStorage, os.time() + exhaust) return true end if not afk_warning and afk_time > afk_limit_time / 2 then selfSay("Where's your pokemon? Let's fight!") afk_warning = true end if getPlayerStorageValue(getThis(), 990) == -1 then if battle_turn >= #wildRocket then addEvent(doWinDuel, 1000, focus, getThis()) addEvent(doCreateNpc, 300000, ".aRocket", getThingPos(getThis())) setPlayerStorageValue(focus, 990, -1) focus = 0 return true end setPlayerStorageValue(getThis(), 990, 1) addEvent(doSummonGymPokemon, 1000, getThis()) end if challenger_turn >= 7 or challenger_turn > #wildRocket then selfSay("You lost our duel! Maybe some other time you'll defeat me.") setPlayerStorageValue(focus, 990, -1) setPlayerStorageValue(focus, exhStorage, os.time() + exhaust) focus = 0 return true end end local npcpos = getThingPos(getThis()) local focpos = getThingPos(focus) if npcpos.z ~= focpos.z then setPlayerStorageValue(focus, 990, -1) setPlayerStorageValue(focus, exhStorage, os.time() + exhaust) focus = 0 selfSay("Bye then.") return true end if (os.clock() - talk_start) > 30 then selfSay("Good bye and keep training!") setPlayerStorageValue(focus, exhStorage, os.time() + exhaust) setPlayerStorageValue(focus, 990, -1) focus = 0 end if getDistanceToCreature(focus) > max_distance then setPlayerStorageValue(focus, 990, -1) setPlayerStorageValue(focus, 999, -1) setPlayerStorageValue(focus, exhStorage, os.time() + exhaust) if #getCreatureSummons(focus) >= 1 then local pk = getCreatureSummons(focus)[1] setPlayerStorageValue(pk, 990, -1) end doRemoveCreature(pokeNpc) focus = 0 selfSay("You were strong enough to win this battle!") return true end local dir = doRedirectDirection(getDirectionTo(npcpos, focpos)) selfTurn(dir) end return true end
  24. No método que apresentei não é necessário aplicar um reset no valor da storage. os.time() retorna quantos segundos se passaram desde o dia 1º de Janeiro de 1970, às 00:00:00. Somando a diferença de segundos entre o horário atual e o horário designado (como já mencionado, 7 horas da manhã) com o os.time() atual, temos como valor resultante a quantidade de segundos passados desde aquela data que mencionei até a próxima 7h. Comparando o valor da storage com o os.time() atual, podemos concluir informações como: storage > os.time() = ainda não deu 7h storage < os.time() = já passou das 7h Logo, não importa se o servidor estará ou não offline.
  25. Você pode colocar, como valor da storage, a diferença de segundos entre o horário atual e o horário designado (7h, nesse caso). Assim, não haveriam problemas como este. Exemplo: function timeDiff(from, to) local ret = {} local t1 = from:explode(":") local t2 = to:explode(":") for i = 3, 1, -1 do t1[i] = tonumber(t1[i]) t2[i] = tonumber(t2[i]) if t2[i] > t1[i] then ret[i] = t2[i] - t1[i] - (ret[i] and 1 or 0) elseif t1[i] > t2[i] then local value = i ~= 1 and 60 or 24 ret[i] = value - t1[i] + t2[i] - (ret[i] and 1 or 0) ret[i - 1] = true else ret[i] = ret[i] and 1 or 0 end end return ret end local diff = timeDiff(os.date("%X"), "07:00:00") setPlayerStorageValue(cid, 9292, os.time() + diff[1] * 60 * 60 + diff[2] * 60 + diff[3]) Para checagens: if getPlayerStorageValue(cid, 9292) > os.time() then --não deu 7h ainda end

Informação Importante

Confirmação de Termo