So, I am having a bit of trouble with one of my skills in my game and need some help.
I have a weapon that enhances fire magic and one that enhances water/ice magic. They both weaken the opposite element, but I need a bit of help with the fire skill.
I have this in the fire skill I want to use:
a.hasWeapon($dataWeapons[95]) ? a.mat * 4 - b.mdf * 1.5 : a.mat * 3 - b.mdf * 2
My question is, if I have the water weapon (Id:96) equipped, how do I make it so the skill does even less damage?
Would the formula look like this:?
a.hasWeapon($dataWeapons[95]) ? a.mat * 4 - b.mdf * 1.5 : a.mat * 3 - b.mdf * 2 || a.hasWeapon($dataWeapons[96]) ? a.mat - b.mdf
When I do that, the damage is always zero, even if my magic attack is higher than the enemies magic defense. How do I fix this?
Edit: Nevermind, I found the problem. I didn't have the else part of the last code. I fixed it.
I have a weapon that enhances fire magic and one that enhances water/ice magic. They both weaken the opposite element, but I need a bit of help with the fire skill.
I have this in the fire skill I want to use:
a.hasWeapon($dataWeapons[95]) ? a.mat * 4 - b.mdf * 1.5 : a.mat * 3 - b.mdf * 2
My question is, if I have the water weapon (Id:96) equipped, how do I make it so the skill does even less damage?
Would the formula look like this:?
a.hasWeapon($dataWeapons[95]) ? a.mat * 4 - b.mdf * 1.5 : a.mat * 3 - b.mdf * 2 || a.hasWeapon($dataWeapons[96]) ? a.mat - b.mdf
When I do that, the damage is always zero, even if my magic attack is higher than the enemies magic defense. How do I fix this?
Edit: Nevermind, I found the problem. I didn't have the else part of the last code. I fixed it.