• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Spell Explanation of Spell Formula Values

ziggy46802

Active Member
Joined
Aug 19, 2012
Messages
418
Reaction score
27
Many people are confused by the values that are set by

setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC)

and

setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -1, -1, -1, 2, 1.4, 1.7, 1.9)

So I would like to try and explain them, to my fullest testing and knowledge that I possess.

setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC)

Here is an example of an old school burst arrow (that is more based on magic level than level or skill):

Lua:
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -1, -1, -1, 2, 1.4, 1.7, 1.9)

Here are what the numbers mean

The first four:
These are the low minimums and high minimums, as in
first = (lowmina1)
second = (lowmina2)
third = (lowminb1)
fourth = (lowminb2)
I'm not entirely sure how these work, but I do know that the first one is the lowest you can possibly hit, and the rest is just, the "lowest" you can hit per se, like I said, I'm not entirely sure how this works and I'd be glad if somebody cleared this up.


The first backhalf:

the fifth number, 2 in this case, means that it is the lowest you can hit (which will be added to the backhalf as the lowest). This number is your level, divided by 2, so 2 would actually mean it does your level's worth of damage.
the sixth number, 1.4 in this case, means that it is the highest you can hit, added to the backhalf as well. This number is also your level, divided by 2, so 1.4 would mean you can only do .7 times your level's worth of damage. And yes I realized my mistake in this damage and will show the right one after this explanation.

The second backhalf:
the seventh number, 1.7 in this case, means that it is the lowest you can hit (added from the first backhalf). This number is your magic level, multiplied by whatever you put, so this means I am doing, say I have mL 100, I would do a minimum of 170 damage from this.
the eigth number, 1.9 in this case, means that it is the highest you can hit (added from the first backhalf). This number is also your magic level, multiplied. So this would be 1.9 times your magic level's damage

So the real formula to the burst arrow (old school) is

Lua:
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -1, -1, -1, 1.4, 2.0, 1.7, 1.9)

Now on to

setCombatFormula(combat, COMBAT_FORMULA_SKILL)

setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 1, 2, 5)


The first two numbers, through my testing seemed to do nothing at all, no minimums or maximums or anything, so I'd like some clarity on that as well.

The third number, is the minimum you will hit. It is your skill multiplied, like if it's distance, then it would be distance times 2 in this case
The fourth number, is the maximum you will hit. It is your skill multiplied, like if it it's distance, then it would be distance times 5 in this case

Will add more to this later, but that's the basics.

I hope this helped anyone looking at it, reply with any clarity on those weird numbers or general thoughts.
 
Well I know that low min a works as the lowest possible hit you can have, which is added to the other two/one factors (depending on the formula), so if lowmina is set to 1 and the other level and magic level is set to 1 with a lvl 100/mL 100, he would hit a 201 at minimum (as my testing shows on TFS 9.6 at least).

Lowmina2,lowminb1, and lowminb2 are just additions to the other factors as well. I'm pretty sure, but not positive, that the last min, lowminb2, is the factor that is added to the highest hit that they can possibly hit, but the middle two, lowmina2 and lowminb1 I am unsure of and, like I said, I hope somebody else knows and clarifies what they mean and do.
 
Lua:
function onGetFormulaValues(cid, level, maglevel)
min = -(level * X + maglevel * X) * X
max = -(level * X + maglevel * X) * X
	return min, max
end
 
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

i still recomend this one its easier to understand and easier to calculate.. and you can even customize it more advanced..
I've tried to understand your explanation but i don't understand it all and what do you mean with backhalf?:p
 
Yeah I probably messed up somewhere I typed that really fast.

Lagmacun, I actually like the style you put up better too since it is
a) easier to understand
b) in effect the same thing
c) does not add stupid "low mins, mid mins, and high mins" into it

But I put that up due to well, I forgot his name, but their one of those really good scripter (C++ I mean) guys that made a GUI Spell Creator, and it uses this system. That's why I'm trying to figure out the mins and everything.

Or, when you make spells off his program, just rip out the part about this nad put in the function shown by Lagmacun, but that requires work whereas if people understood the complicated way, they could just do it in one step, that's my take on it.
 
sometimes i use the spell creator too it takes a lot lesser time making animated spells and you got a good view of your spell
but yeah the scripting is different then im used too so some things i edit like tabbings and such but also always the formula



also
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

the part of LEVELMAGICVALUE can be changed to anything else just check your lib.

also if you want take a look on my spell tutorial maybe you find something nice (see my sig)
 
Back
Top