Code:
if (MyMath.ChanceSuccess(100)) { string acc = ""; int CpBase = 1000; // Default Cp drop, i mean lvl 1 :P double cprandomdrop = (Convert.ToDouble(MobTarget.Level) / Convert.ToDouble(Char.Level)) * CpBase; if (MyMath.ChanceSuccess(cprandomdrop)) { int cpToAdd = cprandomdrop / Char.Level; Char.CPs += Convert.ToUInt32(cpToAdd); Char.MyClient.LocalMessage(2005, "[CPs] You have gained: " + cpToAdd + " CPs for killing a(n) " + MobTarget.Name + " at your current level."); Database.SaveCharacter(Char, acc); }
if someone can finish it better, ill be very grateful.
remembering, its a base (and based) code for cpsdrop system.
If i get new code lines for this, ill update this post.