• 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!

[Druid] Mass Party Heal?

Ceejzor

Murica Born N Raised!
Joined
Jul 5, 2008
Messages
2,295
Reaction score
188
Location
USA - Philippines
Hi, I'm using tfs 0.3.6 and I'm looking for a spell sorta like utura mas sio(party heal spell) but instead of gradually healing over time it instantly heal's you for about 400-700.

If any can make I would really appreciate it xD

rep too ofc :thumbup:
 
Check it out,
Code:
local combat = createCombatObject()
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local combatHeal = createCombatObject()
setCombatParam(combatHeal, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combatHeal, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combatHeal, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combatHeal, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combatHeal, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 14)

local config = {
	baseMana = 120,
	pvpManaSpent = getConfigValue("addManaSpentInPvPZone")
}

function onCastSpell(cid, var)
	local pos, membersList = getCreaturePosition(cid), getPartyMembers(cid)
	if(membersList == nil or type(membersList) ~= 'table' or table.maxn(membersList) <= 1) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOPARTYMEMBERSINRANGE)
		doSendMagicEffect(pos, CONST_ME_POFF)
		return false
	end

	local affectedList = {}
	for _, pid in ipairs(membersList) do
		if(getDistanceBetween(getCreaturePosition(pid), pos) <= 36) then
			table.insert(affectedList, pid)
		end
	end

	local tmp = table.maxn(affectedList)
	if(tmp <= 1) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOPARTYMEMBERSINRANGE)
		doSendMagicEffect(pos, CONST_ME_POFF)
		return false
	end

	local mana = math.ceil((0.9 ^ (tmp - 1) * config.baseMana) * tmp)
	if(getCreatureMana(cid) < mana) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)
		doSendMagicEffect(pos, CONST_ME_POFF)
		return false
	end

	if(not doCombat(cid, combat, var)) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		doSendMagicEffect(pos, CONST_ME_POFF)
		return false
	end

	doCreatureAddMana(cid, -(mana - config.baseMana), false)
	if(not getPlayerFlagValue(cid, PlayerFlag_NotGainMana) and (not getTileInfo(getThingPosition(cid)).pvp or config.pvpManaSpent)) then
		doPlayerAddSpentMana(cid, (mana - config.baseMana))
	end

	for _, pid in ipairs(affectedList) do
		doCombat(cid, combatHeal, numberToVariant(pid))
	end

	return true
end
 
no.

i might have to test it :mad:@@@

or it could just be me, I have never added spell's into my server what I did was copy what you told me put into a notepad saved it as party heal.lua then put it in the folder spells>healing.

Then went to spells.xml copied exura sio pasted it edited the name and the location to load file to party heal.lua

if I messed up tell me :$
 
in Spells.xml put this:
PHP:
<instant name="Party Heal" words="YOUR WORDS" lvl="50" mana="250" prem="1" aggressive="0" exhaustion="1000" needlearn="0" event="script" value="healing/partyhealing.lua">
		<vocation id="2"/>
		<vocation id="6"/>
</instant>

in spells/scripts put the script Cykotitan posted above, and
name it partyhealing.lua

Lua:
local combat = createCombatObject()
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local combatHeal = createCombatObject()
setCombatParam(combatHeal, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combatHeal, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combatHeal, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combatHeal, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combatHeal, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 14)

local config = {
	baseMana = 120,
	pvpManaSpent = getConfigValue("addManaSpentInPvPZone")
}

function onCastSpell(cid, var)
	local pos, membersList = getCreaturePosition(cid), getPartyMembers(cid)
	if(membersList == nil or type(membersList) ~= 'table' or table.maxn(membersList) <= 1) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOPARTYMEMBERSINRANGE)
		doSendMagicEffect(pos, CONST_ME_POFF)
		return false
	end

	local affectedList = {}
	for _, pid in ipairs(membersList) do
		if(getDistanceBetween(getCreaturePosition(pid), pos) <= 36) then
			table.insert(affectedList, pid)
		end
	end

	local tmp = table.maxn(affectedList)
	if(tmp <= 1) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOPARTYMEMBERSINRANGE)
		doSendMagicEffect(pos, CONST_ME_POFF)
		return false
	end

	local mana = math.ceil((0.9 ^ (tmp - 1) * config.baseMana) * tmp)
	if(getCreatureMana(cid) < mana) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)
		doSendMagicEffect(pos, CONST_ME_POFF)
		return false
	end

	if(not doCombat(cid, combat, var)) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		doSendMagicEffect(pos, CONST_ME_POFF)
		return false
	end

	doCreatureAddMana(cid, -(mana - config.baseMana), false)
	if(not getPlayerFlagValue(cid, PlayerFlag_NotGainMana) and (not getTileInfo(getThingPosition(cid)).pvp or config.pvpManaSpent)) then
		doPlayerAddSpentMana(cid, (mana - config.baseMana))
	end

	for _, pid in ipairs(affectedList) do
		doCombat(cid, combatHeal, numberToVariant(pid))
	end

	return true
end


inb4 close tag </instant>

fixed :eek: thanks
 
Last edited:
Back
Top