Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Gente quero um script que o player ao usar um pot de mana ou life ele tem 65% de chances do potion quebrar e 35% que o potion nao quebraria.

 

Seria assim tanto para potions de life para de mana, um player que usa uma potion tera 35% chance que o item nao irar quebrar, alguem pode me ajudar com isso?

Muito obrigado, REP+ !

 

                                                           

55f6tc.gif                     

Link para o post
Compartilhar em outros sites

Coloque isso no script das potions:

local chance = math.random(1, 100)

 if chance < 35 then
  doRemoveItem(item.uid, 1)
  

Ou passe o script de ambas.


spacer.png

 

 

Link para o post
Compartilhar em outros sites

Coloque isso no script das potions:

local chance = math.random(1, 100)

 if chance < 35 then
  doRemoveItem(item.uid, 1)
  

Ou passe o script de ambas.

Serio a script dos potions? irei passar !

 

potions.lua

local config = {
removeOnUse = "yes",
usableOnTarget = "yes", -- can be used on target? (fe. healing friend)
splashable = "no",
range = -1,
realAnimation = "no", -- make text effect visible only for players in range 1x1
multiplier = {
health = 1.0,
mana = 1.0
}
}
 
config.removeOnUse = getBooleanFromString(config.removeOnUse)
config.usableOnTarget = getBooleanFromString(config.usableOnTarget)
config.splashable = getBooleanFromString(config.splashable)
config.realAnimation = getBooleanFromString(config.realAnimation)
 
local POTIONS = {
[8704] = {empty = 7636, splash = 42, health = {50, 100}}, -- small health potion
[7618] = {empty = 7636, splash = 42, health = {100, 200}}, -- health potion
[7588] = {empty = 7634, splash = 42, health = {200, 400}, level = 50, vocations = {3, 4, 7, 8}, vocStr = "knights and paladins"}, -- strong health potion
[7591] = {empty = 7635, splash = 42, health = {500, 700}, level = 80, vocations = {4, 8}, vocStr = "knights"}, -- great health potion
[8473] = {empty = 7635, splash = 42, health = {800, 1000}, level = 130, vocations = {4, 8}, vocStr = "knights"}, -- ultimate health potion
 
[7620] = {empty = 7636, splash = 47, mana = {70, 130}}, -- mana potion
[7589] = {empty = 7634, splash = 47, mana = {110, 190}, level = 50, vocations = {1, 2, 3, 5, 6, 7}, vocStr = "sorcerers, druids and paladins"}, -- strong mana potion
[7590] = {empty = 7635, splash = 47, mana = {200, 300}, level = 80, vocations = {1, 2, 5, 6}, vocStr = "sorcerers and druids"}, -- great mana potion
 
[8472] = {empty = 7635, splash = 43, health = {200, 400}, mana = {110, 190}, level = 80, vocations = {3, 7}, vocStr = "paladins"} -- great spirit potion
}
 
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local potion = POTIONS[item.itemid]
if(not potion) then
return false
end
 
if(not isPlayer(itemEx.uid) or (not config.usableOnTarget and cid ~= itemEx.uid)) then
if(not config.splashable) then
return false
end
 
if(toPosition.x == CONTAINER_POSITION) then
toPosition = getThingPosition(item.uid)
end
 
doDecayItem(doCreateItem(POOL, potion.splash, toPosition))
doRemoveItem(item.uid, 1)
if(not potion.empty or config.removeOnUse) then
return true
end
 
if(fromPosition.x ~= CONTAINER_POSITION) then
doCreateItem(potion.empty, fromPosition)
else
doPlayerAddItem(cid, potion.empty, 1)
end
 
return true
end
 
if(hasCondition(cid, CONDITION_EXHAUST)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end
 
if(((potion.level and getPlayerLevel(itemEx.uid) < potion.level) or (potion.vocations and not isInArray(potion.vocations, getPlayerVocation(itemEx.uid)))) and
not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES))
then
doCreatureSay(itemEx.uid, "Only " .. potion.vocStr .. (potion.level and (" of level " .. potion.level) or "") .. " or above may drink this fluid.", TALKTYPE_ORANGE_1)
return true
end
 
if(config.range > 0 and cid ~= itemEx.uid and getDistanceBetween(getThingPosition(cid), getThingPosition(itemEx.uid)) > config.range) then
return false
end
 
local health = potion.health
if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * config.multiplier.health))) then
return false
end
 
local mana = potion.mana
if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * config.multiplier.mana))) then
return false
end
 
doSendMagicEffect(getThingPosition(itemEx.uid), CONST_ME_MAGIC_BLUE)
if(not config.realAnimation) then
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
else
for i, tid in ipairs(getSpectators(getThingPosition(itemEx.uid), 1, 1)) do
if(isPlayer(tid)) then
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1, false, tid)
end
end
end
 
doAddCondition(cid, exhaust)
doRemoveItem(item.uid, 1)
if(not potion.empty or config.removeOnUse) then
return true
end
 
if(fromPosition.x ~= CONTAINER_POSITION) then
doCreateItem(potion.empty, fromPosition)
else
doPlayerAddItem(cid, potion.empty, 1)
end
 
return true
end

 

 

 

                                                           

55f6tc.gif                     

Link para o post
Compartilhar em outros sites

Não testei, tente assim

[paste]bKh7Cq0U[/paste]

Bruno Carvalho / Ex-Administrador TibiaKing

[email protected]

 

Em 26/12/2016 em 03:47, Spraypaint disse:

A força da alienação vem dessa fragilidade dos indivíduos, quando apenas conseguem identificar o que os separa e não o que os une.

-miltinho

 

wMwSJFE.png?1

 

Link para o post
Compartilhar em outros sites

Não testei, tente assim

[paste]bKh7Cq0U[/paste]

Sim, mais onde e que eu colocaria isso por favor?

E isso funcionara para todos tipos de Potions Life-Potions Mana?

 

Obrigado.

 

                                                           

55f6tc.gif                     

Link para o post
Compartilhar em outros sites

Sim, mais onde e que eu colocaria isso por favor?

E isso funcionara para todos tipos de Potions Life-Potions Mana?

 

Obrigado.

Substitua pelo potions.lua, ele é o mesmo só que com uma função que inventei agora para dar uma porcentagem. Está configurável.

Bruno Carvalho / Ex-Administrador TibiaKing

[email protected]

 

Em 26/12/2016 em 03:47, Spraypaint disse:

A força da alienação vem dessa fragilidade dos indivíduos, quando apenas conseguem identificar o que os separa e não o que os une.

-miltinho

 

wMwSJFE.png?1

 

Link para o post
Compartilhar em outros sites

Substitua pelo potions.lua, ele é o mesmo só que com uma função que inventei agora para dar uma porcentagem. Está configurável.

Ok, vou esperar da o SS, ae vou testar o scrip, porque se eu esta agora quando eu der reload no server talvez cai, entao depois eu testo se funcionar edito aqui.

Mesmo assim, obrigado REP+ !

 

                                                           

55f6tc.gif                     

Link para o post
Compartilhar em outros sites

Recomendo testar privato, pois se tiver player no servidore e ocorrer algum erro as potions irão parar de funcionar ._.

Bruno Carvalho / Ex-Administrador TibiaKing

[email protected]

 

Em 26/12/2016 em 03:47, Spraypaint disse:

A força da alienação vem dessa fragilidade dos indivíduos, quando apenas conseguem identificar o que os separa e não o que os une.

-miltinho

 

wMwSJFE.png?1

 

Link para o post
Compartilhar em outros sites

Recomendo testar privato, pois se tiver player no servidore e ocorrer algum erro as potions irão parar de funcionar ._.

Ah ok, muito obrigado pelas suas dicas, vou testar fora do dedicado entao, muito obrigado, REP+ pela boa intencao como sempre!

 

                                                           

55f6tc.gif                     

Link para o post
Compartilhar em outros sites
  • 2 years later...

Desculpa reviver o topico, mais estava precisando deste Script novamente pois eu perdi ele, e parece que ele sumiu aqui do Topico, obrigado!

 

                                                           

55f6tc.gif                     

Link para o post
Compartilhar em outros sites

@UP

 

                                                           

55f6tc.gif                     

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por BTitan
      Reviva a nostalgia do Tibia 8.6 com um toque das novidades modernas, mantendo a essência clássica que você ama. Nosso mapa é limpo e otimizado, perfeito para wars intensas e estratégicas.
      Com mais de 100 áreas de caça, vocações equilibradas e eventos automáticos diários, garantimos diversão sem limites para todos os jogadores.
       
      ACC Manager: 1/1
      IP: go.baiaktitan.com
      https://www.baiaktitan.com
       
      Principais informações:
       
      Dedicado 24 horas sem lag Attack Speed moderado Cast System DODGE! CRITICAL! REFLECT! Upgrade Weapon Forge System Autoloot Anti Rollbacks Eventos exclusivos (Battle Royale, DOTA, Team Battle, entre outros...) Servidor integrado com Telegram (Contato direto com ADM) Cliente próprio (com novos itens, montarias e outfits) Mapa Baiak, modificado exclusivamente para o PvP Servidor otimizado, suportando mais de 1.000 players online  
      »» EXP Rate: 200x
      »» Skill Rate: 20x
      »» Magic Rate: 10x
      »» Loot Rate: 3x
       
      Aguardamos por você!
    • Por Kuds
      Boas pessoal!
       
      Estou disponibilizando neste fórum a oportunidade para quem é fan de Lord Of the Rings e gostaria de participar na recriação de um mapa baseado no universo de Tolkien. Comecei a projetar o mapa pois sempre gostei do antigo servidor Bronson, então pensei em melhorar ele da melhor forma que posso, e mesmo não sendo Mapper de muito tempo as partes que fiz ja receberam aprovação de conhecidos que acharam interessante o meu estilo por mais simples que seja.
       
      Atualmente ja possuo a base do mapa inteiro de LOTR, recriei ele do 0 seguindo fielmente o formato do mapa, porém ele está com mais de 4x o tamanho do Bronson original. E conforme tenho tempo vou criando áreas do mapa, e no momento ja possuo Bree e Edoras prontas, e estou no processo para recriar Minas Tirith.
       
      Meu objetivo com este Post é achar pessoas que estariam dispostas á participar do grupo de WPP que criei para poder opinar nas votações que faço a respeito do mapa, e talvez achar alguem interessado em ajudar com este projeto. Então qualquer pessoa que tiver interesse fique a vontade para me mandar PM no site!
       
      PS: Não existe nenhuma obrigatoriedade de se manter no grupo, considerando que este é apenas um projeto de carinho ao Tibia e LOTR todos estão livres de sair do projeto a qualquer momento.
    • Por Nogard
      Não deixe seu evento de Natal para última hora, faltam apenas 4 dias. 

      Aproveite as sprites com desconto no site: https://otsprites.com
       
       
       

       

       
       
       
    • Por otpokesalense
      🧿Base Tibia Solebran totalmente otimizada!  
       
       ✔️ OTClient (Version Old);
      ✔️ Update 2.2;
      ✔️ Site Póprio;
      ✔️ Map Global
      ✔️ Bugs, Minimo (2x) talvez;
      ✔️ PVP 💯 Funcional.
       
       
      Get Servidor: https://files.fm/f/7qumr8943e 💸 Buy! otimo projeto para vc utilizá-lo.
      Lembrando:: ao comprar o download será disponibilizado automaticamente.
       
      🧑‍💻System Operacional: Windows (VPS)
      👨‍💻Programador (27) 998931903 - - - O Valor já inclui o serviço de programação! 🤗
       

       
       

       
       
    • Por Arkanjo39
      CUIDA, CUIDA E VEM CONHECER NOSSO SERVER. KING BAIAK ACABOU DE SER LANÇADO!!! VEM SER O TOP 1 Site com Otclient: https://kingbaiak.com/ PARA NOVOS JOGARES ADM TA DANDO AQUELA FORCINHA! SERVIDOR 8.60 COM RESETS, MONTARIAS E GOLDEN OUTFIT! INFORMAÇÕES BÁSICAS DO SERVIDOR: [+] MAPA BAIAK [+] HIGH EXP [+] RESETS COM + DAMAGE [+] AUTOLOOT AUTOMÁTICO [+] CITY DONATE [+] ROSHAMUUL, ORAMOND E NETHER [+] MONTARIAS E GOLDEN OUTFIT [+] INVASÃO DE MONSTROS AUTOMÁTICAS [+] DAILY MONSTER QUE APARECE AO LOGAR [+] MONTARIAS COM COMANDO !MOUNT [+] SISTEMA DE ROLETA ATUAL [+] CAST WATCH [+] FAST ATTACK [+] CAST ARROWS [+] PUSH CRUZADO [+] REWARD CHEST [+] WARSQUARE [+] COMBO EXP DE POTIONS [+] MINERAÇÃO COM LOJA [+] SISTEMA DE BOSS [+] CRITICAL/DODGE [500/500] [+] LIFE E MANA EM PORCENTAGEM* [+] VARIAS QUESTS [+] EVENTO DTT (AUTOMÁTICO) [+] EVENTO BATLEFIELD (AUTOMÁTICO) [+] EVENTO SNOWBALLWAR (AUTOMÁTICO) [+] EVENTO DESERT WAR (AUTOMÁTICO) [+] EVENTO ZOMBIE (AUTOMÁTICO) [+] EVENTO CAMPO MINADO (AUTOMÁTICO) [+] EVENTO TEAM BATLE (AUTOMÁTICO) [+] EVENTO CAPTURE THE FLAG (AUTOMÁTICO)
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo