Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case DonationTyp.ConquerPoints:
- {
- const ulong POINTS_PER_MILLION = 75;
- const ulong MILLION = 1000000;
- if (UID <= 0)
- {
- Console.WriteLine($"Player {user.Player.Name} attempted to exploit Donation CPS.");
- user.Socket.Disconnect();
- return;
- }
- ulong donationAmount = UID;
- ulong requiredConquerPoints = (donationAmount / MILLION) * POINTS_PER_MILLION;
- if (donationAmount < MILLION)
- {
- user.SendSysMesage("You must donate at least 1 million to earn Conquer Points.", MsgMessage.ChatMode.Service);
- return;
- }
- if (requiredConquerPoints > (ulong)user.Player.ConquerPoints)
- {
- user.SendSysMesage("You do not have enough Conquer Points.", MsgMessage.ChatMode.Service);
- return;
- }
- if (!user.Player.OnMyOwnServer || user.InTrade || user.PokerPlayer != null)
- {
- return;
- }
- if (string.IsNullOrEmpty(UID.ToString()))
- {
- user.SendSysMesage("Invalid UID.", MsgMessage.ChatMode.Service);
- return;
- }
- if (user.Player.ConquerPoints >= (int)requiredConquerPoints)
- {
- user.Player.ConquerPoints -= (int)requiredConquerPoints;
- user.Player.Nobility.Donation += requiredConquerPoints;
- user.Send(stream.NobilityIconCreate(user.Player.Nobility));
- Program.NobilityRanking.UpdateRank(user.Player.Nobility);
- }
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement