Mr Noxi
Noxus Otserver
Soo this is my code
Am trying to have the summons i summon to heal the player, am trying to set it to heal 10% of the health of the player but no mater what number i put in i always get 100% of the health back from the summons,
any idea whats wrong here?
Code below
"
Am trying to have the summons i summon to heal the player, am trying to set it to heal 10% of the health of the player but no mater what number i put in i always get 100% of the health back from the summons,
any idea whats wrong here?
Code below
"
Lua:
local config = {
condition = "yes", -- put no if you dont want him to remove the conditions (fire, poison, etc).
}
function onThink(cid, target)
if math.random(1, 100) <= 100 then -- here you can edit chance of reciving heal, higher number than 12 = more heal chances
local master = getCreatureMaster(cid)
if master then
local conditions = {CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY, CONDITION_PARALYZE, CONDITION_DRUNK, CONDITION_DROWN, CONDITION_CURSED}
local party = getPartyMembers(master)
local pos = getCreaturePosition(master)
if not getPlayerParty(master) then
doCreatureAddHealth(master, cid:getMaxHealth() * 0.01)
doSendMagicEffect(pos, 12)
if (config.condition == "yes") then
for i, todos in ipairs(conditions) do
doRemoveCondition(master, todos)
end
end
return true
end
for _, miembros in pairs(party) do
doCreatureAddHealth(miembros, config.heal)
pos = getCreaturePosition(miembros)
doSendMagicEffect(pos, 12)
if (config.contidion == "yes") then
for i, todos in ipairs(conditions) do
doRemoveCondition(miembros, todos)
end
end
end
end
return true
end
end