[Help] Spells Damage Error

05/24/2020 10:15 Soulfly25#1
Hi guys,

I am getting a problem on spells damage the problem is, if my spells get leveled it's getting damage decrease. The more spell level it increase the more the spell damage decreasing. How can I get this done?

Code:
MsgSpellAnimation.SpellObj AnimationObj;
                                    Calculate.Magic.OnPlayer(user.Player, attacked, DBSpell, out AnimationObj);
                                    AnimationObj.Damage = Calculate.Base.CalculateLevel(AnimationObj.Damage, ClientSpell.Level);
                                    ReceiveAttack.Player.Execute(AnimationObj, user, attacked);
                                    MsgSpell.Targets.Enqueue(AnimationObj);

here is the based
Code:
 public static uint CalculateLevell(uint Damage, byte SpellLevel)
        {
            Damage += (uint)(Damage * (SpellLevel * 2) / 100);
            return Damage;
        }
What could be the problem here?

Thank you.
05/25/2020 22:02 Santa#2
Quote:
Originally Posted by Soulfly25 View Post

Code:
MsgSpellAnimation.SpellObj AnimationObj;
                                    Calculate.Magic.OnPlayer(user.Player, attacked, DBSpell, out AnimationObj);
                                    AnimationObj.Damage = Calculate.Base.CalculateLevel(AnimationObj.Damage, ClientSpell.Level);
                                    ReceiveAttack.Player.Execute(AnimationObj, user, attacked);
                                    MsgSpell.Targets.Enqueue(AnimationObj);
Not enough information for us to tell you anything. Also, the function below isn't called in your snippet above. Are you looking at the correct function?

Quote:
Originally Posted by Soulfly25 View Post
Code:
 public static uint CalculateLevell(uint Damage, byte SpellLevel)
        {
            Damage += (uint)(Damage * (SpellLevel * 2) / 100);
            return Damage;
        }
05/26/2020 02:17 pintinho12#3
Quote:
Originally Posted by StarBucks View Post
Not enough information for us to tell you anything. Also, the function below isn't called in your snippet above. Are you looking at the correct function?
ahm

Quote:
AnimationObj.Damage = Calculate.Base.CalculateLevel(AnimationObj.Damage, ClientSpell.Level);
05/26/2020 03:24 Latyos#4
Quote:
Originally Posted by pintinho12 View Post
ahm
CalculateLevell != CalculateLevel :kappa:

Anyways, it's not rocket science. Just debug it by printing damage value in every step, see where the damage is getting reduced.

Code:
Console.WriteLine($"Calculate magic on player: {Calculate.Magic.OnPlayer(user.Player, attacked, DBSpell, out AnimationObj)}");
Console.WriteLine($"Calculate level damage: {Calculate.Base.CalculateLevel(AnimationObj.Damage, ClientSpell.Level)}");
05/26/2020 03:57 Santa#5
Quote:
Originally Posted by pintinho12 View Post
ahm
Exactly, he needs to post that function
05/27/2020 12:42 Soulfly25#6
Quote:
Originally Posted by pintinho12 View Post
ahm
Sorry, my bar they are the same based I just renamed the other 1 but they are the same function just like the other one.
05/27/2020 19:03 Santa#7
What is your OnPlayer function returning for AnimationObj? what is DbSpell, what is Clientspell?