• 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 Spell doing damage only in x monsters.

Delita Hyral

Member
Joined
Mar 16, 2012
Messages
350
Reaction score
10
I were trying to make a spell who:
Heal players
Deal damage on undeads.

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 12)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 1.2, 0.2, 2.4, 0.4)

local disable = createConditionObject(CONDITION_PACIFIED)
setConditionParam(disable, CONDITION_PARAM_TICKS, 2500)


local area1 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}
--=======================================

setCombatArea(combat, createCombatArea(area1))


function onCastSpell(cid, var)
local pos = getCreaturePosition(cid)
	if getPlayerStorageValue(cid, 575) == -1 then
	setPlayerStorageValue(cid, 575, 1)
	doCreatureSetNoMove(cid, 1)
	doAddCondition(cid, disable)
	
	addEvent(doCreatureSay, 1, cid, "Life's refreshing breeze,", TALKTYPE_ORANGE_1)
	addEvent(doSendMagicEffect, 1, pos, 30)
	addEvent(doSendMagicEffect, 500, pos, 30)
		addEvent(doCreatureSay, 500, cid, "blow in energy!", TALKTYPE_ORANGE_1)
	addEvent(doSendMagicEffect, 1000, pos, 30)
	addEvent(doSendMagicEffect, 1500, pos, 30)
	addEvent(doCombat, 2000, cid, combat, var)
		addEvent(doCreatureSay, 2000, cid, "Cure!", TALKTYPE_ORANGE_1)
	addEvent(doCreatureSetNoMove, 2500, cid, 0)
	addEvent(setPlayerStorageValue, 3000, cid, 575, -1)
	
	elseif getPlayerStorageValue(cid, 575) == 1 then
	doPlayerSendCancel(cid, "You are casting another spell!")
	return false
	end
	
return true
end
Could someone help me?
Thanks,
Delita
 
Last edited:
Back
Top