Untitled
unknown
lua
2 years ago
1.0 kB
16
Indexable
local isRunning = false
local config = {
minPorcentaje = 5.5,
hpRange = {250000, 300000},
segundos = 7,
monstrarMsgs = true,
}
local function curarMonster(monsterCID)
if isMonster(monsterCID) then
doCreatureAddHealth(monsterCID, math.random(config.hpRange[1], config.hpRange[2]))
doSendMagicEffect(getCreaturePosition(monsterCID), CONST_ME_MAGIC_BLUE)
doCreatureSay(monsterCID, "Podeeer!", TALKTYPE_ORANGE_2)
if config.monstrarMsgs then
print("Recibiendo addEvent...")
end
end
end
function onStatsChange(cid, attacker, type, combat, value)
if isMonster(cid) and isPlayer(attacker) then
local hpPorcentaje = (getCreatureHealth(cid)/getCreatureMaxHealth(cid))*100
if hpPorcentaje < config.minPorcentaje and not running then
if config.monstrarMsgs then
print("Enviando addEvent...")
end
doCreatureSay(monsterCID, "No eres rival para mi!", TALKTYPE_ORANGE_2)
addEvent(curarMonster, config.segundos, cid)
end
end
return true
endEditor is loading...