Ir para conteúdo

Vodkart

Herói
  • Total de itens

    3406
  • Registro em

  • Última visita

  • Dias Ganhos

    111

Tudo que Vodkart postou

  1. a função vc tem que colocar em DATA > LIB > functions.lua
  2. é pq n tem aquela função no seu ot, me mostra como ficou o seu script
  3. vc colocou traduzir pagina?? ai fico td bugado kkk... bem, no script lá tem essa parte: <event type="statschange" name="morrerNaArena" event="script"><![CDATA[ domodlib('arena_config') if isInRange(getPlayerPosition(cid), config.posicaoArena[1], config.posicaoArena[2]) then if type == STATSCHANGE_HEALTHLOSS then if isPlayer(cid) then if value >= getCreatureHealth(cid) then doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid))) doPlayerSendTextMessage(pid,22,"Você morreu na arena =/.. veja pelo lado positivo, você nao perdeu nada!") doCreatureAddHealth(cid,getCreatureMaxHealth(cid) - getCreatureHealth(cid)) return false end end end end return true ]]></event> troca por <event type="statschange" name="morrerNaArena" event="script"><![CDATA[ domodlib('arena_config') function getPlayerHealth(cid) -- by vodka doPlayerSave(cid) local PlayerInfo = db.getResult("SELECT `health` FROM `players` WHERE `id` = " .. getPlayerGUID(cid)) return PlayerInfo:getDataInt("health") end if isInRange(getPlayerPosition(cid), config.posicaoArena[1], config.posicaoArena[2]) then if type == STATSCHANGE_HEALTHLOSS then if isPlayer(cid) then if value >= getPlayerHealth(cid) then doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid))) doPlayerSendTextMessage(pid,22,"Você morreu na arena =/.. veja pelo lado positivo, você nao perdeu nada!") doCreatureAddHealth(cid,getCreatureMaxHealth(cid) - getPlayerHealth(cid)) return false end end end end return true ]]></event> já pode adicionar na sua lib essa função: function getPlayerHealth(cid) -- by vodka doPlayerSave(cid) local PlayerInfo = db.getResult("SELECT `health` FROM `players` WHERE `id` = " .. getPlayerGUID(cid)) return PlayerInfo:getDataInt("health") end
  4. PODE AJUDAR: http://www.xtibia.com/forum/topic/192703-getcontainerslotsfreegetallcontainerfree/
  5. troque está: local query = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = "..value.." ORDER BY cast(value as INTEGER) DESC;") para local query = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = "..value.." ORDER BY cast(value as SIGNED) DESC;")
  6. vou resolver, testa uma função pra mim dps??
  7. adiciona no script da sua spell exemplo: if isInRange(getCreaturePosition(cid), {x = 341, y = 465, z = 7}, {x = 424, y = 520, z = 7}) then doPlayerSendCancel(cid,"You can not use this spell here.") return false end ficando tp assim function onCastSpell(cid, var) if isInRange(getCreaturePosition(cid), {x = 341, y = 465, z = 7}, {x = 424, y = 520, z = 7}) then doPlayerSendCancel(cid,"You can not use this spell here.") return false end return doCombat(cid, combat, var) end as pos ali eh começo e final da area
  8. function onUse(cid, item, fromPosition, itemEx, toPosition) local B = { {21832,{x=229, y=1061, z=7, stackpos = 1}}, {21926,{x=228, y=1061, z=7, stackpos = 1}}, {21781,{x=229, y=1060, z=7, stackpos = 1}}, {21781,{x=228, y=1060, z=7, stackpos = 1}} } for i = 1, #B do if getTileItemById(B[i][2], B[i][1]).uid > 0 then doRemoveItem(getThingfromPos(B[i][2]).uid,1) end end doTransformItem(item.uid, 10030) return true end
  9. depois eu faço isso . Mais ele so consegui usar o item se tiver do lado do player. se tiver longe não funfa . longe quer dizer o que? uma tela ? ele pode passar nas portas, paredes, etc... coloca outra função para checar se o player está na frente dele(até um limite de 2 sqm por exemplo) if getDistanceBetween(pos, pos2) > 2 then doPlayerSendCancel(cid, "Você pode usar este item até 2 sqm longe do jogador.") return true end
  10. beleza, me passa o ID dela e o arquivo.lua dela que fica na pasta spells por exemplo: o id da SD é 2268 e o arquivo.lua dela é o sudden death.lua
  11. tem que colocar para checar se ele está mesmo trapado e não pode se mexer, porque só com skull ele vai poder bugar muita coisa, quest's ou houses
  12. 1° - Só precisa adicionar os IDS das WANDS e RODS do server, nessas tabelas: WEAPON_WAND = {2190, 2191, 2188, 8921, 2189, 2187, 8920, 8922, 2184, 7414, 2453} WEAPON_ROD = {2182, 2186, 2185, 8911, 2181, 2183, 8912, 8910, 7958, 12609} distance, weapons, etc... NÃO! 2° - Dá para adicionar sim, no caso você quer alterar a SD original pela sua modificada ou colocar as 2 SD no rank hit??
  13. /\ vc n tem essa função adc na sua lib: function getGuildNameById(id) local query = db.getResult("SELECT `name` FROM `guilds` WHERE `id` = "..id) if query:getID() ~= -1 then return query:getDataString("name") end end
  14. troque essa linha: local query = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = "..value.." ORDER BY cast(value as INTEGER) DESC;") por essa: local query = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = "..value.." ORDER BY cast(value as SIGNED) DESC;")
  15. Vodkart

    Addon Bonus EXP

    simples, só fazer pelo onKill (:
  16. Vodkart

    For _, pid

    depende, na global storage stá salvo o NICK da guild ou o ID dela?
  17. testa e ve se eh isso q vc quer function onSay(cid, words, param, channel) function getPlayerReset(cid) local check = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid)) return check:getDataInt("reset") <= 0 and 0 or check:getDataInt("reset") end function getInfoStatus(vocation, type, level) return type == "health" and getVocationInfo(vocation).gainhp*tonumber(level) or getVocationInfo(vocation).gainmana*tonumber(level) end if (param ~= "dark" and param ~= "hellborn" and param ~= "supreme") then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce digitou errado o nome da classe") return TRUE end local config = { darklvl = 20, -- level para resetar dark hellbornlvl = 30, -- level para resetar hellborn supremelvl = 50, -- level para resetar supreme vocationDark = 15, -- id vocação dark vocationHellborn = 16, -- id vocação hellborn vocationSupreme = 17, -- id vocação supreme lvlreset = 250, -- level apos resetar primeiras vocações lvlHellborn = 250, -- level apos resetar vocação sacred player = getPlayerGUID(cid), -- não mexa! reset = 50, pz = "yes", -- players precisam estar em protection zone para usar? ("yes" or "no"). battle = "yes", -- players deve estar sem battle ("yes" or "no") premium = "no" -- se precisa ser premium account ("yes" or "no") } if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa estar em Protection Zone para usar este comando.") return TRUE end if(config.premium == "yes") and (not isPremium(cid)) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Only players with premium account can use.") return TRUE end if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Voce nao pode usar com battle.") return TRUE end if (param == "dark") then if (getPlayerReset(cid) >= 50) then if (getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 or getPlayerVocation(cid) == 7 or getPlayerVocation(cid) == 8 or getPlayerVocation(cid) == 14) then if (getPlayerLevel(cid) >= config.darklvl) then doPlayerSetVocation(cid, config.vocationDark) setPlayerStorageValue(cid, 897979, config.vocationDark) local hp, mana = getInfoStatus(config.vocationDark, "health", config.lvlreset), getInfoStatus(config.vocationDark, "mana", config.lvlreset) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.lvlreset..",`reset` = 0,`experience` = "..getExperienceForLevel(config.lvlreset)..",`manamax` = "..mana..",`healthmax` = "..hp..",`health` = "..hp..",`mana` = "..mana.." WHERE `id` = "..config.player) return TRUE else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa ser level "..config.darklvl..".") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa ter promotion.") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Voce precisa ter 50 resets ou mais para poder mudar de classe.") return TRUE end return true end if (param == "hellborn") then if (getPlayerReset(cid) >= 75) then if (getPlayerVocation(cid) == 15) then if (getPlayerLevel(cid) >= config.hellbornlvl) then doPlayerSetVocation(cid, config.vocationHellborn) setPlayerStorageValue(cid, 897979, config.vocationHellborn) local hp, mana = getInfoStatus(config.vocationHellborn, "health", config.lvlreset), getInfoStatus(config.vocationHellborn, "mana", config.lvlreset) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.lvlreset..",`reset` = 0,`experience` = "..getExperienceForLevel(config.lvlreset)..",`manamax` = "..mana..",`healthmax` = "..hp..",`health` = "..hp..",`mana` = "..mana.." WHERE `id` = "..config.player) return TRUE else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa ser level "..config.hellbornlvl..".") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa ser Dark Hero.") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Voce precisa ter 75 resets ou mais para poder mudar de classe.") return TRUE end return true end if (param == "supreme") then if (getPlayerReset(cid) >= 100) then if (getPlayerVocation(cid) == 16) then if (getPlayerLevel(cid) >= config.supremelvl) then doPlayerSetVocation(cid, config.vocationSupreme) setPlayerStorageValue(cid, 897979, config.vocationSupreme) local hp, mana = getInfoStatus(config.vocationSupreme, "health", config.lvlreset), getInfoStatus(config.vocationSupreme, "mana", config.lvlreset) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.lvlreset..",`reset` = 0,`experience` = "..getExperienceForLevel(config.lvlreset)..",`manamax` = "..mana..",`healthmax` = "..hp..",`health` = "..hp..",`mana` = "..mana.." WHERE `id` = "..config.player) return TRUE else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa ser level "..config.Supremelvl..".") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa ser Hellborn Deathbringer.") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Voce precisa ter 100 resets ou mais para poder mudar de classe.") return TRUE end return true end end
  18. ta como é a conta do hp e mana?? me explica em forma de calculos tem que pegar a info da voc anterior * level + a voc atual?? pq meu calculo ta pra fazer assim: hp/mana por level nova voc * level (baseada no vocations.xml em hpgain e managain) obs: esqueci de colocar para resetar a quantidade de reset.. mas faço isso na proxima editação
  19. até hj n fizeram ainda?? uheueheuhe function onSay(cid, words, param, channel) function getPlayerReset(cid) local check = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid)) return check:getDataInt("reset") <= 0 and 0 or check:getDataInt("reset") end if (param ~= "dark" and param ~= "hellborn" and param ~= "supreme") then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce digitou errado o nome da classe") return TRUE end local config = { darklvl = 20, -- level para resetar dark hellbornlvl = 30, -- level para resetar hellborn supremelvl = 50, -- level para resetar supreme vocationDark = 15, -- id vocação dark vocationHellborn = 16, -- id vocação hellborn vocationSupreme = 17, -- id vocação supreme lvlreset = 250, -- level apos resetar primeiras vocações lvlHellborn = 250, -- level apos resetar vocação sacred player = getPlayerGUID(cid), -- não mexa! reset = 50, pz = "yes", -- players precisam estar em protection zone para usar? ("yes" or "no"). battle = "yes", -- players deve estar sem battle ("yes" or "no") premium = "no" -- se precisa ser premium account ("yes" or "no") } if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa estar em Protection Zone para usar este comando.") return TRUE end if(config.premium == "yes") and (not isPremium(cid)) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Only players with premium account can use.") return TRUE end if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Voce nao pode usar com battle.") return TRUE end if (param == "dark") then if (getPlayerReset(cid) >= 50) then if (getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 or getPlayerVocation(cid) == 7 or getPlayerVocation(cid) == 8 or getPlayerVocation(cid) == 14) then if (getPlayerLevel(cid) >= config.darklvl) then doPlayerSetVocation(cid, config.vocationDark) setPlayerStorageValue(cid, 897979, config.vocationDark) local hp,mana = getVocationInfo(config.vocationDark).gainhp*config.lvlreset,getVocationInfo(config.vocationDark).gainmana*config.lvlreset doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.lvlreset..", `experience` = "..getExperienceForLevel(config.lvlreset)..",`manamax` = "..mana..",`healthmax` = "..hp..",`health` = "..hp..",`mana` = "..mana.." WHERE `id` = "..config.player) return TRUE else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa ser level "..config.darklvl..".") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa ter promotion.") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Voce precisa ter 50 resets ou mais para poder mudar de classe.") return TRUE end return true end if (param == "hellborn") then if (getPlayerReset(cid) >= 75) then if (getPlayerVocation(cid) == 15) then if (getPlayerLevel(cid) >= config.hellbornlvl) then doPlayerSetVocation(cid, config.vocationHellborn) setPlayerStorageValue(cid, 897979, config.vocationHellborn) local hp,mana = getVocationInfo(config.vocationHellborn).gainhp*config.lvlreset,getVocationInfo(config.vocationHellborn).gainmana*config.lvlreset doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.lvlreset..", `experience` = "..getExperienceForLevel(config.lvlreset)..",`manamax` = "..mana..",`healthmax` = "..hp..",`health` = "..hp..",`mana` = "..mana.." WHERE `id` = "..config.player) return TRUE else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa ser level "..config.hellbornlvl..".") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa ser Dark Hero.") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Voce precisa ter 75 resets ou mais para poder mudar de classe.") return TRUE end return true end if (param == "supreme") then if (getPlayerReset(cid) >= 100) then if (getPlayerVocation(cid) == 16) then if (getPlayerLevel(cid) >= config.supremelvl) then doPlayerSetVocation(cid, config.vocationSupreme) setPlayerStorageValue(cid, 897979, config.vocationSupreme) local hp,mana = getVocationInfo(config.vocationSupreme).gainhp*config.lvlreset,getVocationInfo(config.vocationSupreme).gainmana*config.lvlreset doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.lvlreset..", `experience` = "..getExperienceForLevel(config.lvlreset)..",`manamax` = "..mana..",`healthmax` = "..hp..",`health` = "..hp..",`mana` = "..mana.." WHERE `id` = "..config.player) return TRUE else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa ser level "..config.Supremelvl..".") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa ser Hellborn Deathbringer.") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Voce precisa ter 100 resets ou mais para poder mudar de classe.") return TRUE end return true end end ----------------------------------------- dica para galera que quer usar uma função para saber a quantidade de hp ou mana que o player vai ter em tal level: getVocationInfo(ID DA VOCATION).gainhp*LEVEL -- aqui vai pegar os dados la em vocations.xml e vai fazer a conta por exemplo: se no seu vocations.xml a VOC com ID 1 estiver: gainhp=5 e eu quero saber o total de hp que ela vai ter no LEVEL 10 então vai fazer essa conta getVocationInfo(1).gainhp*10 5*10 = 50 -- no level 10 a vocation com ID 1 vai ter 50 de hp para HP: getVocationInfo(ID DA VOCATION).gainhp*LEVEL Para MANA: getVocationInfo(ID DA VOCATION).gainmana*LEVEL ------------------------------------------------------------------- fiz um função para melhorar o intendimento: function getInfoStatus(vocation, type, level) return type == "health" and getVocationInfo(vocation).gainhp*tonumber(level) or getVocationInfo(vocation).gainmana*tonumber(level) end agora só usar para saber a quantidade de hp ou mana no tal level: por exemplo quero saber o life de knight(voc 4) no level 50 local hp = getInfoStatus(4, "health", 50) -- retorna quanto de hp o knight(voc 4) tem no lvl 50 ou se quiser saber a mana usa: local mana = getInfoStatus(4, "mana", 50) -- retorna quanto de o knight(voc 4) tem no lvl 50
  20. é não tem como saber que sistema de vip ele usa
  21. gostei da talk, mas retira mto o rpg do server '-' em um global por exemplo, ficaria paia kk mas a ideia é bacana parabéns rep+
  22. viado mas sua mãe me feeda todo dia de noite eu chego com ghost pela sala e dps uso flash pra ir pro quarto e rushar o inibidor dela
  23. quer jogar LOL com a galera??
  24. mas todos vão voltar com o msm lvl, hp e mana??
  • Quem Está Navegando   0 membros estão online

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