hello i have 5165 reflect problem

11/26/2011 23:41 $-Tiger-$#1
hello again :
here is my problem ,when i attack other character the number of damage = - HP
, and the right way the reflect skill should work have max -HP like 1700 if attack up or down , so i hope any one get my point i mean and thanks
11/27/2011 01:47 pro4never#2
There's lots of handy math functions built into C#... One you're thinking of would be something like...


target.Health -= Math.Min(1700, damage);

That will take whichever one is lower.

Personally I'd do something more like...

damage = Math.Min(1700, damage);
target.Health -= damage;

That way the actual attack packet will cap out at 1700 also rather then showing crazy high numbers that aren't actually being dealt
11/27/2011 10:59 $-Tiger-$#3
thanks for your reply but did you mean make some thing like that

Code:
  public void GetReflect(uint Damage, AttackType AT)
        {
            if (Damage < CurHP)
            {
                Damage = Math.Min(1700, Damage);
                 Target.Health -= Damage;
               

                World.Action(this, Packets.AttackPacket(EntityID, EntityID, Loc.X, Loc.Y, Damage, (byte)AT).Get);
            }


thanks pro4never i am done it now the damage number is 1700 but now the problem in ,when my attack anther character like noob no have stuff my attack number will be like 43368 and my hp= 30000 and when reflect come i dead 1 hit then i conclusion that "when my attack get number high than my hp i died 1 hit not just -hp 1700.i hope u get my point again :handsdown: thanks again
11/27/2011 20:14 pro4never#4
You shouldn't need the damage < cur hp cause that only causes the code to run when it will NOT kill the user.

Reflect has a damage cap REGARDLESS of if it kills or not.
11/28/2011 07:01 BaussHacker#5
The damage cap is 2000, isn't it?
11/28/2011 11:17 $-Tiger-$#6
Quote:
Originally Posted by pro4never View Post
You shouldn't need the damage < cur hp cause that only causes the code to run when it will NOT kill the user.

Reflect has a damage cap REGARDLESS of if it kills or not.
u mean to make the code like that
Code:
 public void GetReflect(uint Damage, AttackType AT)
        {
            {
                 Damage = Math.Min(1700, Damage);
                    CurHP -= (ushort)Damage;

                World.Action(this, Packets.AttackPacket(EntityID, EntityID, Loc.X, Loc.Y, Damage, (byte)AT).Get);
            }
but when i make it like that the characters die 1 hit from ref

Quote:
Originally Posted by BaussHacker View Post
The damage cap is 2000, isn't it?
no i just make it 1700
11/29/2011 02:58 pro4never#7
Quote:
Originally Posted by $-Tiger-$ View Post
u mean to make the code like that
Code:
 public void GetReflect(uint Damage, AttackType AT)
        {
            {
                 Damage = Math.Min(1700, Damage);
                    CurHP -= (ushort)Damage;

                World.Action(this, Packets.AttackPacket(EntityID, EntityID, Loc.X, Loc.Y, Damage, (byte)AT).Get);
            }
but when i make it like that the characters die 1 hit from ref



no i just make it 1700

Breakpoint and see what the values are lol.

Sounds to me like it's just an issue of your source not handling reflect correctly.

For example it would call your GetReflect code but would then still continue on and run another GetDamage type method which would be of course using the initial damage that's being passed into the method.
11/29/2011 19:42 $-Tiger-$#8
so can you tell me how to fix it or what part of reflect code is wrong to try to fix it thanks very much pro4never .