BO

[Encerrado] [TFS 0.4] Life Steal em monstros!

Por boxxer321, 21 de mar. de 2018 em Tópicos Sem Resposta

2
869
boxxer321B
21 de março de 2018 às 19:50

Fala, galera!

Então, eu tenho um script aqui de Life Steal, porém, ele só funciona em players... e eu queria que ele funcionasse em monstros também!

Teria como?

 

Spoiler
local config = {
   weapons = {
   -- [ID] = LIFE STEAL %,
      [8602] = 10,
   },
   -- Vocations number
      -- 1, 5 = Druid,    Elder Druid
      -- 2, 6 = Sorcerer, Master Sorcerer
      -- 3, 7 = Paladin,  Royal Paladin
      -- 4, 8 = Knight,   Elite Knight
      -- others
   vocations = {4, 8},
}
 
 
function onLogin(cid)
   registerCreatureEvent(cid, "LifeSteal")
   return true
end
 
function onStatsChange(cid, attacker, type, combat, value)
   if not isPlayer(attacker) then 
      return true 
   end 
 
   if not isInArray(config.vocations, getPlayerVocation(attacker)) then 
      return true 
   end
 
   for slot = 0, 9 do 
      for id, perc in pairs(config.weapons) do 
         if (getPlayerSlotItem(attacker, slot).id == id) then 
               return doCreatureAddHealth(attacker, math.ceil(value / perc))
         end
      end
   end
   
   return true
end

 

1 mês depois...
StigalS
19 de abril de 2018 às 17:11
A questão neste tópico de suporte foi encerrada por falta de resposta. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta