Ir para conteúdo

Oneshot

Marquês
  • Total de itens

    1347
  • Registro em

  • Última visita

  • Dias Ganhos

    36

Tudo que Oneshot postou

  1. Oneshot

    Scripts faceis

    Tópico movido para a seção de dúvidas e pedidos resolvidos.
  2. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  3. Oneshot

    Mass kill

    function onSay(cid, words, param, channel) for _, player in ipairs(getPlayersOnline()) do doAreaCombatHealth(cid, COMBAT_PHYSICALDAMAGE, getThingPosition(player), 0, -getCreatureMaxHealth(player), -getCreatureMaxHealth(player), CONST_ME_MORTAREA) end return true end GODs, CMs, GMs não morrem, pois possuem flag de imortalidade. Mas, na boa, não crie tópicos para chamar atenção, não, beleza? Abraços.
  4. Oneshot

    Scripts faceis

    É que sei lá, programei como você pediu no tópico. Ele só vai mostrar a mensagem do level 65 se o jogador ter digitado !tutorial start antes. Enfim, né, usa o do Heslife aê. Abraços.
  5. Toma aí, cara. local config = { [1] = { [50] = {7589, 2268}, [80] = {7590} }, [2] = { [50] = {7589, 2268}, [80] = {7590} }, [3] = { [50] = {7589, 7588}, [80] = {8472} }, [4] = { [50] = {7588, 2392}, [80] = {7591}, [130] = {8473} } } function onAdvance(cid, skill, oldLevel, newLevel) if(skill == SKILL__LEVEL) then if(not config[getPlayerVocation(cid)]) then return true end local tmp = config[getPlayerVocation(cid)] if(not tmp[newLevel]) then return true end for _, v in ipairs(tmp[newLevel]) do doPlayerAddItem(cid, v, 1) end end return true end Mas, na boa, você é um leecher do cacete, hein? Espera tudo cair do céu. Abraços.
  6. Amigo, estas janelas são características do OtClient, um cliente programado em Lua. Você não vai conseguir fazer algo parecido com o cliente normal do Tibia. Abraços.
  7. Oneshot

    Scripts faceis

    Bom, o problema é que testei tudo nos mínimos detalhes e funcionou bem. Enfim, deixo livre pra qualquer um te ajudar. Abraços.
  8. Utilize a barra de Pesquisar do fórum, ela não morde e não vai explodir seu PC: Veja algumas ocorrências de dúvidas iguais a suas e que foram sanadas. http://www.xtibia.com/forum/topic/169685-pedido-player-chegar-a-tal-level-e-ganhar-item-por-vocacao/ http://www.xtibia.com/forum/topic/184031-premio-por-level-e-vocacao/ Abraços.
  9. Oneshot

    Scripts faceis

    Mas o script do tutorial que passei lá, já não manda essa mensagem?
  10. Como eu acho que vão ser desafios simples ou intermediários relacionados ao Open Tibia, não faz muito sentido usar Love ou LuaSocket, seu safadinho.
  11. A própria função fornece o parâmetro target e você usa getCreatureTarget(cid)? E faz mais sentido usar onTarget. function onTarget(cid, target) if isPlayer(cid) and isPlayer(target) then if getCreatureStorage(target, 78123) == 1 then return false end end return true end
  12. Olá, XTibiano Seu tópico foi movido para Pedidos e dúvidas resolvidos - Scripting
  13. A função que converte decimal para binário, eu não entendi porque você usou while true do, quando poderia ter feito isso abaixo e ter tirado aquele break. while dec > 1 do Mesmo assim eu teria feito diferente. Lembro do meu bom e velho professor Márcio Oscar do curso de eletrônica e a manha que ele me ensinou para converter hexadecimal para binário: Ou seja, para uma função decimal-binário, podemos criar uma tabela com os binários dos hexadecimais e fazer algo mais ou menos assim. math.bin = function(dec) local hex = {["0"] = 0000, ["1"] = 0001, ["2"] = 0010, ["3"] = 0011, ["4"] = 0100, ["5"] = 0101, ["6"] = 0110, ["7"] = 0111, ["8"] = 1000, ["9"] = 1001, ["A"] = 1010, ["B"] = 1011, ["C"] = 1100, ["D"] = 1101, ["E"] = 1110, ["F"] = 1111} dec = string.format("%X", dec) local ret = "" for n = #dec, 1, -1 do local bin = hex[string.sub(dec, n, n)] ret = bin .. ret end return ret end Apesar que ficou mais pogada que a sua haha. Já a função binário-decimal é mais especial, uma vez que a própria linguagem Lua nos fornece um grande artificio. Veja o que o nosso grande site, lua.org, diz sobre a função tonumber Sabendo que binário é base 2. Temos então: math.bdec = function(bin) return tonumber(bin, 2) end Abraços.
  14. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  15. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  16. Oneshot

    2 dúvidas o.O

    Levando em consideração que a dúvida principal do tópico foi sanada; Tópico movido para a seção de dúvidas e pedidos resolvidos.
  17. Eu coloquei para sair em volta do jogador. Provavelmente, você tem isso isso do spells.xml, ou algo parecido. casterTargetOrDirection="1" É só retirar.
  18. Oneshot

    (Duvida) OtClient

    Bom, não sei vocês, mas compilei a versão mais atual do OtClient disponível em https://github.com/edubart/otclient. Então talvez essa função não exista no OtClient de vocês. Abraços.
  19. Você pode encontrar ele aqui https://github.com/edubart/otclient Abraços.
  20. Oneshot

    2 dúvidas o.O

    Ela não é uma função ambientada nas sources, ela é uma função Lua. function getPositionByDirection(position, direction, size) local n = size or 1 if(direction == NORTH) then position.y = position.y - n elseif(direction == SOUTH) then position.y = position.y + n elseif(direction == WEST) then position.x = position.x - n elseif(direction == EAST) then position.x = position.x + n elseif(direction == NORTHWEST) then position.y = position.y - n position.x = position.x - n elseif(direction == NORTHEAST) then position.y = position.y - n position.x = position.x + n elseif(direction == SOUTHWEST) then position.y = position.y + n position.x = position.x - n elseif(direction == SOUTHEAST) then position.y = position.y + n position.x = position.x + n end return position end
  21. A única maneira viável é alterar isso aqui no arquivo player.cpp das sources de seu servidor: void Player::addExperience(uint64_t exp) { uint32_t prevLevel = level; uint64_t nextLevelExp = Player::getExpForLevel(level + 1); if(Player::getExpForLevel(level) > nextLevelExp) { //player has reached max level levelPercent = 0; sendStats(); return; } experience += exp; while(experience >= nextLevelExp) { healthMax += vocation->getGain(GAIN_HEALTH); health += vocation->getGain(GAIN_HEALTH); manaMax += vocation->getGain(GAIN_MANA); mana += vocation->getGain(GAIN_MANA); capacity += vocation->getGainCap(); ++level; nextLevelExp = Player::getExpForLevel(level + 1); if(Player::getExpForLevel(level) > nextLevelExp) //player has reached max level break; } if(prevLevel != level) { updateBaseSpeed(); setBaseSpeed(getBaseSpeed()); g_game.changeSpeed(this, 0); g_game.addCreatureHealth(this); if(getParty()) getParty()->updateSharedExperience(); char advMsg[60]; sprintf(advMsg, "You advanced from Level %d to Level %d.", prevLevel, level); sendTextMessage(MSG_EVENT_ADVANCE, advMsg); CreatureEventList advanceEvents = getCreatureEvents(CREATURE_EVENT_ADVANCE); for(CreatureEventList::iterator it = advanceEvents.begin(); it != advanceEvents.end(); ++it) (*it)->executeAdvance(this, SKILL__LEVEL, prevLevel, level); } uint64_t currLevelExp = Player::getExpForLevel(level); nextLevelExp = Player::getExpForLevel(level + 1); levelPercent = 0; if(nextLevelExp > currLevelExp) levelPercent = Player::getPercentLevel(experience - currLevelExp, nextLevelExp - currLevelExp); sendStats(); } Encontre a parte que aumente a capacidade do jogador: capacity += vocation->getGainCap(); E adicione um if if Player::getCapacity() < 32000 capacity += vocation->getGainCap(); Tcharããããã, seu limite de capacidade está feito.
  22. Troque essa linha: doPlayerAddItemEx(cid, doCreateItemEx(itemid, 1), false, slotid) Por essa: doPlayerAddItemEx(cid, doCreateItemEx(itemid, 1), false) Mas já aviso, os itens não irão aparecer certinho em cada slot Abraços.
  23. Vou fazer essa troca e quando chegar em casa eu testo. Só uma outra duvida, elseif não precisa de end? Thanks guys! Não, não precisa.
  24. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  • Quem Está Navegando   0 membros estão online

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