Transformation skill in Redux

10/05/2022 22:36 denominator#1
I am using a redux source and I noticed an issue with transformation skills, basically transform to DivineHare, WaterElf, and NightDevil and your mana disappears. I had this working but had to reinstall Win 10 due to a dumb Win 11 update that screwed my OS up and now I can't remember where the error originally was.

Any help would be greatly appreciated
10/06/2022 05:23 pintinho12#2
Quote:
Originally Posted by denominator View Post
I am using a redux source and I noticed an issue with transformation skills, basically transform to DivineHare, WaterElf, and NightDevil and your mana disappears. I had this working but had to reinstall Win 10 due to a dumb Win 11 update that screwed my OS up and now I can't remember where the error originally was.

Any help would be greatly appreciated

I got it working request close
Can you explain what happened so it can be documented here?
10/06/2022 20:26 denominator#3
I was using extra unneeded code which I deleted, so now it works but only in TG. I got to figure out now why in cities it still persists lol. Code in question was this
Code:
public override void SetDisguise(Database.Domain.DbMonstertype _mob, long _duration, bool increaseAS)
        {
            if (!Alive)
                return;
            LastServerJump -= 1000;
            LastClientJump -= 1000;
            if (_mob == null)
            {
                var pctLife = Life * 100 / MaximumLife;
                Transformation = 0;
                waitingAttackSpeedFix = true;
                Recalculate();
                Life = MaximumLife * pctLife / 100;
            }
            else
            {
                AddStatus(Enum.ClientStatus.TransformationTimeout, (int)_mob.Mesh, _duration);
                CombatStats = CombatStatistics.Create(_mob);
                if (increaseAS)
                {
                    CombatStats.BonusHitratePct += 50; // todo: adjust this value
                }

                Transformation = (ushort)_mob.Mesh;
                TransformationAttackSpeed = CombatStats.BonusHitratePct;
                Send(UpdatePacket.Create(UID, UpdateType.MaxLife, MaximumLife));
                Life = MaximumLife;
            }
        }
I'm still struggling with this, code is working fine if I'm in TG but as soon as I transform out of TG then the mana disappears? I had this working after checking another source but I can't remember what source I found it in, iirc it was a line of code that is missing but from where and what that code was I can't for the life of me remember :(

I have tried adding things like Mana = MaximumMana; but anything that I try adding results in the original issue but even in TG

Code:
 public override void SetDisguise(Database.Domain.DbMonstertype _mob, long _duration, bool increaseAS)
        {
            if (!Alive)
                return;
            LastServerJump -= 1000;
            LastClientJump -= 1000;
            if (_mob == null)
            {
                var pctLife = Life * 100 / MaximumLife;
                var pctMana = Mana * 100 / MaximumMana;
                Transformation = 0;
                waitingAttackSpeedFix = true;
                Recalculate();
                Life = MaximumLife * pctLife / 100;
                Mana = (ushort)(MaximumMana * pctMana / 100);
            }
            else
            {
                AddStatus(Enum.ClientStatus.TransformationTimeout, (int)_mob.Mesh, _duration);
                CombatStats = CombatStatistics.Create(_mob);
                if (increaseAS)
                {
                    CombatStats.BonusHitratePct += 50; // todo: adjust this value
                }

                Transformation = (ushort)_mob.Mesh;
                TransformationAttackSpeed = CombatStats.BonusHitratePct;
                Send(UpdatePacket.Create(UID, UpdateType.MaxLife, MaximumLife));
                Life = MaximumLife;
                Mana = (ushort)MaximumMana;

            }
        }
Even this fails, code is from Fangs source

So I finally got it to work not sure if it's the correct way but it's actually working

Code:
public override void SetDisguise(Database.Domain.DbMonstertype _mob, long _duration, bool increaseAS)
        {
            if (!Alive)
                return;
            LastServerJump -= 1000;
            LastClientJump -= 1000;
            if (_mob == null)
            {
                var pctLife = Life * 100 / MaximumLife;
                Transformation = 0;
                waitingAttackSpeedFix = true;
                Recalculate();
                Life = MaximumLife * pctLife / 100;
            }
            else
            {
                AddStatus(Enum.ClientStatus.TransformationTimeout, (int)_mob.Mesh, _duration);
                CombatStats = CombatStatistics.Create(_mob);
                if (increaseAS)
                {
                    CombatStats.BonusHitratePct += 50; // todo: adjust this value
                }

                Transformation = (ushort)_mob.Mesh;
                TransformationAttackSpeed = CombatStats.BonusHitratePct;              
                Send(UpdatePacket.Create(UID, UpdateType.MaxLife, MaximumLife));
                Life = MaximumLife;
                Send(UpdatePacket.Create(UID, UpdateType.MaxMana, MaximumMana));
                CombatStats.MaxMana = (ushort)(Common.GetTaoistManaBonus(MaximumMana) * 100);

            }
        }