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

[Spells] Need som help with a couple of spells.

watchoni

New Member
Joined
Aug 30, 2010
Messages
3
Reaction score
0
First off i have to say im very new to scripting spells so obvious things might not be that obvious to me unless it's explained. I got 3 spells i just cant get to work, first there is a aoe healing/mana restoring spell much like mas ress but gonna give mana aswell.

The problem i get with this script is that the "drain_mana" effect only works not the healing.
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_TARGETPLAYERSORSUMMONS, true)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
function onGetFormulaValues(cid, level, magLevel)
	local min = math.ceil((level / 1 + magLevel / 1) * 2)
	local max = math.ceil((level / 1 + magLevel / 1) * 2.5) 
	return -min, -max
        end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local area = createCombatArea(AREA_CIRCLE3X3)
setCombatArea(combat, area)

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_TARGETPLAYERSORSUMMONS, true)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
function onGetFormulaValues(cid, level, magLevel)
	local min = math.ceil((level / 1 + magLevel / 1) * (-1.5))
	local max = math.ceil((level / 1 + magLevel / 1) * (-2)) 
	return -min, -max
        end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local area = createCombatArea(AREA_CIRCLE3X3)
setCombatArea(combat, area)

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

second i have a tuant that i want also to add shielding and melee skill.
The problem here is that i only get the tuant to work no stats increase.

Code:
local time = 250 * 250 -- 120 * 1000 = 2 min
local addShielding = 200 -- how much shielding should be added
local addSword = 100
local addClub = 100
local addAxe = 100
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)

function onTargetCreature(cid, target) return doChallengeCreature(cid, target) end
setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
 
function onCastSpell(cid, var)
	
        return doCombat(cid, combat, var)
end

and last a single target spell that's suppose to decrease shielding with 50% on the target.
This spell dosent work at all unless i make it need target and then i just see the animation on myself nothing else happens.

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
function onGetFormulaValues(cid, level, magLevel)
	local min = math.ceil((level / 1 + magLevel / 1) * 3)
	local max = math.ceil((level / 1 + magLevel / 1) * 3.5) 
	return -min, -max
        end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local condition = {}
for i = 1, 4 do
	condition[i] = createConditionObject(CONDITION_ATTRIBUTES)
	setConditionParam(condition[i], CONDITION_PARAM_TICKS, 10000)
	setConditionParam(condition[i], CONDITION_PARAM_SKILL_SHIELDPERCENT, 50)
end

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

Thanks alot in advance and +REP to whoever helps out!
 
Back
Top