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

Help with spell

Hjuston

New Member
Joined
Sep 29, 2009
Messages
11
Reaction score
0
Hi everyone! Look at this:

Code:
combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLICE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.0, min,-2.0,min)

arr1 = {
{0, 0, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 3, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 0, 0},
}

local area1 = createCombatArea(arr1)
setCombatArea(combat, area1)


function onCastSpell(cid, var)
local dmg = getPlayerStorageValue(cid,15100)
min = -(dmg)
	return doCombat(cid, combat, var)
end

I have a little problem :/
I'm trying to do a spell which dmg will depends on a
variable which is reading from player's storage value.
For example player storage value numer 15100 is '15'
variable will look like this:
local dmg = getPlayerStorageValue(cid,15100)
min = -(dmg*10)
now min will be = -150.
Simple, but i can't use it in the spell's formula, why?
Anybody know how to do this?
I'm using 0.3.6 crying damson.
 
Back
Top