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);
}
}