Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ REGENERATION SYSTEM
- SCRIPT BY: SKYFOREVER/SKYMAGNUM
- NÃO POSTE EM OUTROS FÓRUNS SEM AUTORIZAÇÃO
- ]]
- function onThink(cid)
- local vocations = {
- [1] = {
- {levelmin = 0, levelmax = 10, lifeReg = 10, secondRegHp = 1, manaReg = 5, secondRegMana = 1},
- {levelmin = 11, levelmax = 30, lifeReg = 50, secondRegHp = 0.2, manaReg = 10, secondRegMana = 2}
- }
- }
- local mana, manaMax = getCreatureMana(cid), getCreatureMaxMana(cid)
- local health, healthMax = getCreatureHealth(cid), getCreatureMaxHealth(cid)
- local level = getPlayerLevel(cid)
- local V = vocations[getPlayerVocation(cid)]
- if (getTileInfo(getThingPos(cid)).protection) then
- return
- end
- if (health ~= healthMax) or (mana ~= maxMana) then
- for _, I in pairs(V) do
- if (level >= I.levelmin) and (level <= I.levelmax) then
- addEvent(doCreatureAddHealth, I.secondRegHp * 1000, cid, I.lifeReg)
- addEvent(doCreatureAddMana, I.secondRegMana * 1000, cid, I.manaReg)
- end
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement