• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua summon heal per lvl

luigilc

Lua Learner
Joined
Mar 24, 2010
Messages
863
Reaction score
37
Location
A music box
I use this script for my summon to heal its party:
Code:
-- summon heal master v1.1
-- by leyendario.
	local config = {
	heal = 140,
	mana = 0, -- put 0 if you dont want him to recover mana.
	condition = "yes", -- put no if you dont want him to remove the conditions (fire, poison, etc).
	}
 
function onCast(cid, target)
 
	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, config.heal)
			doCreatureAddMana(master, config.mana)
			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
			doCreatureAddMana(miembros, config.mana)
			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
I want to change the
Code:
heal = 140
so it's something like :
master lvl+mlvl*0.2/3 but I don't know how, can someone help me?
 
Code:
-- summon heal master v1.1
-- by leyendario.
	local config = {
	heal = 140,
	mana = 0, -- put 0 if you dont want him to recover mana.
	condition = "yes", -- put no if you dont want him to remove the conditions (fire, poison, etc).
	}
 
function onCast(cid, target)
 
	local master = getCreatureMaster(cid)
	local masterlvl = getPlayerLevel(master)
	local masermaglvl = getPlayerMagLevel(master)
	local lvlandmaglvl = masterlvl+mastermaglvl
	local doheal = config.heal*lvlandmaglvl
	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, doheal)
			doCreatureAddMana(master, config.mana)
			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
			doCreatureAddMana(miembros, config.mana)
			doCreatureAddHealth(miembros, doheal)
			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

rep+ to me thanks ;)
 
Last edited:
Back
Top