Ir para conteúdo

Murilosky

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    Murilosky deu reputação a Shadownzinho em [PEDIDO] 2 Spells.   
    Ai Mano Eu Fis Uma Nova Magia Pra VC Com Os Msm Efeito Msm Area Onde vai Acerta, E Eu testei Funciono Certinho.


  2. Gostei
    Murilosky deu reputação a Adriano SwaTT em Bônus nos equipes de acordo com vocação?   
    Teste assim:

    local mages = {1, 2, 5, 6} local paladins = {3, 7} local knights = {4, 8} local addml = 2 -- quantidade de ML à adicionar aos mages local addskill = 2 -- quantidade de skill adicionar aos guerreiros (pally e knights) function onEquip(cid, item, slot)     if isInArray(mages, getPlayerVocation(cid)) then         doPlayerAddMagLevel(cid, addml)     elseif isInArray(knights, getPlayerVocation(cid)) then         for b = 1, 4 do         doPlayerAddSkill(cid, b, addskill)         end     elseif isInArray(paladins, getPlayerVocation(cid)) then         doPlayerAddSkill(cid, 5, addskill)     end return true end function onDeEquip(cid, item, slot)     if isInArray(mages, getPlayerVocation(cid)) then         doPlayerAddMagLevel(cid, (getPlayerMagLevel(cid) - addml))     elseif isInArray(knights, getPlayerVocation(cid)) then         for b = 1, 4 do         doPlayerAddSkill(cid, b, (getPlayerSkillLevel(cid, b) - addskill))         end     elseif isInArray(paladins, getPlayerVocation(cid)) then         doPlayerAddSkill(cid, 5, (getPlayerSkillLevel(cid, 5) - addskill))     end return true end  
    E por acaso o do Look deu algum resultado?
     
    Boa sorte.
  3. Gostei
    Murilosky deu reputação a Caronte em (Resolvido)[PEDIDO] Death penalty   
    Usa o que deu certo por enquanto...
     
     
    você tirou minha melhor resposta
  4. Gostei
    Murilosky deu reputação a Caronte em (Resolvido)[PEDIDO] Death penalty   
    @Murilosky, 
    Tenta agora:
    coloquei o mínimo e arrumei as porcentagens de cada vocação.., lembrando que a distro não atualiza a vida na hora, depois vejo com max sobre o script que faz atualizar...
    function onDeath(cid, corpse, deathList) if not isPlayer(cid) then return true end local config = { mages = {1, 5, 2, 6}, pallys = {3, 7}, knights = {4, 8}, } local percents = { perdevida5 = 5, perdevida3 = 3, perdemana5 = 5, perdemana3 = 3, } if isInArray(config.mages, getPlayerVocation(cid)) and getPlayerMaxMana(cid) > 3695 then -- Mana mínima dos mages setCreatureMaxMana(cid, getPlayerMaxMana(cid) - (getPlayerMaxMana(cid)*percents.perdemana5/100)) elseif isInArray(config.pallys, getPlayerVocation(cid)) then if getCreatureMaxHealth(cid) > 1405 then -- Vida mínima do pala setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - (getCreatureMaxHealth(cid)*percents.perdevida3/100)) if getPlayerMaxMana(cid) > 1255 then -- Mana mínima do para setCreatureMaxMana(cid, getPlayerMaxMana(cid) - (getPlayerMaxMana(cid)*percents.perdemana3/100)) elseif isInArray(config.knights, getPlayerVocation(cid)) and getCreatureMaxHealth(cid) > 1405 then -- Vida mínima de kina setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - (getCreatureMaxHealth(cid)*percents.vida5/100)) end end end return true end Se você quiser re-configurar é só alterar os números da tabela percents...
  5. Gostei
    Murilosky deu reputação a Caronte em (Resolvido)[PEDIDO] Death penalty   
    Tinha o break no que você testou ?
  6. Gostei
    Murilosky deu reputação a Caronte em (Resolvido)[PEDIDO] Death penalty   
    Funciona sem saber o hp.
  7. Gostei
    Murilosky deu reputação a Snowsz em (Resolvido)[PEDIDO] Death penalty   
    Como você não informou o hp/mana do level 130, fiz somente assim:

    Crie um arquivo com o nome deathpercent.lua
    function onDeath(cid, corpse, deathList) if not isPlayer(cid) then return true end local config = { mages = {1, 5, 2, 6}, pallys = {3, 7}, knights = {4, 8}, } if isInArray(config.mages, getPlayerVocation(cid)) then setCreatureMaxMana(cid, getPlayerMaxMana(cid) - (getPlayerMaxMana(cid)*0.5)) elseif isInArray(config.pallys, getPlayerVocation(cid)) then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - (getCreatureMaxHealth(cid)*0.3)) setCreatureMaxMana(cid, getPlayerMaxMana(cid) - (getPlayerMaxMana(cid)*0.3)) elseif isInArray(config.knights, getPlayerVocation(cid)) then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - (getCreatureMaxHealth(cid)*0.5)) end return true end Tag:
    <event type="death" name="DeathPercent" event="script" value="deathpercent.lua"/> No login.lua:
     
    registerCreatureEvent(cid, 'DeathPercent')
  8. Gostei
    Murilosky deu reputação a Caronte em (Resolvido)[PEDIDO] Death penalty   
    local config = {     ["Mages"] = {         vocs = {1, 5, 2, 6},         lose = {             ["hp"] = 0, -- Nao perde health             ["mp"] = 5, -- Perde 5% de mana         }     },     ["Knight"] = {         vocs = {4, 8},         lose = {             ["hp"] = 5, -- Perde 5% de health             ["mp"] = 0, -- Nao perde mana         }     },          ["Paladin"] = {         vocs = {3, 7},         lose = {             ["hp"] = 3, -- Perde 3% de health             ["mp"] = 3, -- Perde 4% de mana         }     } } function onDeath(cid, corpse, deathList)     local voc = getPlayerVocation(cid)          for index, info in pairs(config) do         if isInArray(info.vocs, voc) then -- Da uma estudada em for..             if info.lose["mp"] > 0 then                 setCreatureMaxMana(cid, getCreatureMaxHealth(cid) * (1 - info.lose["mp"] / 100))                 doCreatureAddMana(cid, 1)                 doCreatureAddMana(cid, -1)             end                          if info.lose["hp"] > 0 then                 setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) * (1 - info.lose["hp"] / 100))                 doCreatureAddHealth(cid, 1)                 doCreatureAddHealth(cid, -1)             end                          break         end     end          return true end

     
    <event type="death" name="Perda" event="script" value="Arquivo.lua"/> tem que registrar ..
    registerCreatureEvent(cid, "Perda")
  9. Gostei
    Murilosky deu reputação a Wise em [BUG] mp/hp gem   
    local t = {     [8301] = {voc = {3, 7}, add = {500, 500}}, -- {voc = {vocationIds}, add = {hp, mana}}     [8302] = {voc = {1, 2, 5, 6}, add = {0, 2000}},     [8303] = {voc = {4, 8}, add = {1000, 0}} } function onUse(cid, item, fromPos, toPos)     local a = t[item.itemid]          if a and isInArray(a.voc, getPlayerVocation(cid)) then         setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + a.add[1])         setCreatureMaxMana(cid, getCreatureMaxMana(cid) + a.add[2])         doSendAnimatedText(toPos, '+'..a.add[1]..'HP/+'..a.add[2]..'MP', math.random(0, 255))         doRemoveItem(item.uid)     end          return true end
  10. Gostei
    Murilosky deu reputação a olokomeu em (Resolvido)[BUG] Npc comprando itens 2x (dobro).   
    Primeiro você deve criar um arquivo XML em data>npc. Dentro desse aquivo você coloca:
     



     
    Obs: em "Shop_sellable" eu coloquei até 2 item, mas caso queira por mais é so sair adicionando "nome do item,id do item,preço do item;" Lembre-se de alterar para item que você quer,id do item que vai ser vendido e o preço que será vendido.
     
    Agora vá em data>npc>script. Crie um arquivo.lua com o nome de default e coloque dentro dele:
     



     
    !
  11. Gostei
    Murilosky deu reputação a Nogard em (Resolvido)[PEDIDO] Surprise Bag.   
    Bom, assim viria todos os items, mas o resultado do random serviria pra todos:
    function onUse(cid, item, fromPosition, itemEx, toPosition) local config = { items = {6541, 6542, 6543, 6544, 6545} } for i = 1, (#config.items) do doPlayerAddItem(cid, config.items(i), math.random(30, 100)) doRemoveItem(item.uid, 1) end return true end  
     
     
     
    Assim viria como seu exemplo, um resultado do random pra cada item:
    function onUse(cid, item, fromPosition, itemEx, toPosition) local config = { items = {6541, 6542, 6543, 6544, 6545} } doPlayerAddItem(cid, config.items[1], math.random(30, 100)) doPlayerAddItem(cid, config.items[2], math.random(30, 100)) doPlayerAddItem(cid, config.items[3], math.random(30, 100)) doPlayerAddItem(cid, config.items[4], math.random(30, 100)) doPlayerAddItem(cid, config.items[5], math.random(30, 100)) doRemoveItem(item.uid, 1) return true end
  12. Gostei
    Murilosky deu reputação a Nogard em (Resolvido)[PEDIDO] Surprise Bag.   
    Cria uma tabela com os ID's dos items.
      local config = { items = {6541, 6542, 6543, 6544, 6545} } Depois, randomiza.
    doPlayerAddItem(cid, math.random(config.items[1], config.items[5]), math.random(30, 100))

Informação Importante

Confirmação de Termo