I use 5165 but the gist of it should be the same as other servers.
also, thanks to CoEmu v2, I used some of the damage calculation from there namely the reborn percentages.
This is only to fix FB/SS. Melee you need to change yourself in attack.cs
in skills.cs find
Code:
public uint GetDamage(Character C)
Code:
case DamageType.Melee:
Code:
if (Game.World.NoPKMaps.Contains(User.Loc.Map)) if (Info.ExtraEff == ExtraEffect.None) return 0; ushort Def = (ushort)((double)C.EqStats.defense*2); Buff Shield = C.BuffOf(SkillsClass.ExtraEffect.MagicShield); if (Shield.Eff == SkillsClass.ExtraEffect.MagicShield) Def = (ushort)(Def * Shield.Value); Damage = User.PrepareAttack(2, false); Damage = (uint)(Damage * Info.EffectValue); Damage += Info.Damage; if (Def >= Damage) Damage = 1; else Damage -= Def; if (C.Reborns == 1) { Damage = (uint)Math.Floor((double)Damage * .7); } else if (C.Reborns == 2) { Damage = (uint)Math.Floor((double)Damage * .7); if (User.Reborns < 2) Damage = (uint)(Math.Floor((double)Damage * .5)); } //STGs Damage = (uint)(Math.Floor((double)Damage * (1 - ((C.EqStats.GemBless < .50) ? C.EqStats.GemBless : .50)))); //EQ bless if (C.EqStats.TotalBless > 0) { Damage = (uint)(Math.Floor((double)Damage * (1 - ((C.EqStats.TotalBless < 60) ? (double)C.EqStats.TotalBless : (double)60) * .01))); //Console.WriteLine(C.EqStats.TotalBless); } //BP //Console.WriteLine(User.Name + " " + (int)User.Potency); //Console.WriteLine(C.Name + " " + (int)C.Potency); if (User.Potency < C.Potency) { Damage = (uint)(((double)Damage) * (((double)C.Potency / (double)User.Potency) + .85) / Math.Sqrt((double)(C.Potency - User.Potency))); if (C.Potency - User.Potency >= 50) Damage = (uint)((double)Damage * .6); } else { Damage = (uint)((double)Damage * .9); } if (C.Potency >= 300) { Damage = Damage = (uint)((double)Damage * .7); } Damage += User.EqStats.MeleeDamageIncrease; if (C.EqStats.MeleeDamageDecrease >= Damage) Damage = 1; else Damage -= C.EqStats.MeleeDamageDecrease; break;
Also for 5165 users. Server calculates BP wrong. It doesn't add in the steed BP. So to make it add the steed bp to total bp:
find
Code:
public ushort Potency
Code:
public ushort Potency { get { string s = ((ushort)Equips.HeadGear.Soc1).ToString(); int prePotency = 0; prePotency += Level + 5 * Reborns; for (byte x = 1; x <= 12; x++) { Item I = Equips.Get(x); if (I.UID != 0) prePotency += I.Pot; } prePotency += (byte)Nobility.Rank; return (ushort)prePotency; } }
find:
Code:
public static void GetGemEffect(ref EquipStats E, Gem G)
Code:
case Gem.NormalTortoiseGem: { E.GemBless += 0.02; break; } case Gem.RefinedTortoiseGem: { E.GemBless += 0.04; break; } case Gem.SuperTortoiseGem: { E.GemBless += 0.06; break; }
Code:
public double GemExtraMAttack;
Code:
public double GemBless;
find:
Code:
Eqp.GemExtraMAttack += eqp.GemExtraMAttack;
Code:
Eqp.GemBless += eqp.GemBless;
find:
Code:
Eqp.GemExtraMAttack -= eqp.GemExtraMAttack;
Code:
Eqp.GemBless -= eqp.GemBless;
find:
Code:
EqStats.GemExtraAttack = 1;
Code:
EqStats.GemBless = 0;
Also to those that wanna help make a better damage equation i also attached an excel file with all the info on the damages. It's kinda messy though but meh.
And if you are gonna use this, some thanks would be nice.