Advertisement
Guest User

Untitled

a guest
May 27th, 2018
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.11 KB | None | 0 0
  1. #region Donation
  2. case 12455:
  3. {
  4. switch (npcRequest.OptionID)
  5. {
  6. case 0:
  7. {
  8. dialog.Text("Hello there " + client.Player.Name + ". I can help you get on the top faster! Instead of donating gold, you can give me your cps and I will automatically do the hard work for you. The exchange ratio is 1:50000. That means you give me 1 CPs, I donate for you 50000 gold. The minimum amount is 6,000,000 CPs.");
  9. dialog.Input("Insert amount:", 1, 10);
  10. dialog.Option("No thank you.", 255);
  11. break;
  12. }
  13. case 1:
  14. {
  15. uint input;
  16. if (uint.TryParse(npcRequest.Input, out input))
  17. {
  18. if (input < 5000000)
  19. {
  20. dialog.Text("You need to input more or atleast 5,000,000 CPs..");
  21. dialog.Input("Insert amount:", 1, 9);
  22. dialog.Option("No thank you.", 255);
  23. return;
  24. }
  25. if (client.Player.ConquerPoints >= input)
  26. {
  27. client.NpcCpsInput = input;
  28. dialog.Text("Are you sure you want to donate " + input + " CPs? That means I will donate for you " + (((ulong)input) * 500ul) + " gold.");
  29. dialog.Option("Yes", 2);
  30. dialog.Option("No thank you.", 255);
  31. }
  32. else
  33. {
  34. dialog.Text("You don't have that much CPs. Try again. \nThe exchange ratio is 1:50000. That means you give me 1 CPs, I donate for you 50000 gold. The minimum amount is 6,000,000 CPs.");
  35. dialog.Input("Insert amount:", 1, 9);
  36. dialog.Option("No thank you.", 255);
  37. }
  38. }
  39. else
  40. {
  41. dialog.Text("Try again. \nThe exchange ratio is 1:50000. That means you give me 1 CPs, I donate for you 50000 gold. The minimum amount is 6,000,000 CPs.");
  42. dialog.Input("Insert amount:", 1, 9);
  43. dialog.Option("No thank you.", 255);
  44. }
  45. break;
  46. }
  47. case 2:
  48. {
  49. if (client.Player.ConquerPoints >= client.NpcCpsInput && client.NpcCpsInput != 0)
  50. {
  51. client.Player.ConquerPoints -= client.NpcCpsInput;
  52. Game.ConquerStructures.Nobility.Donate((ulong)client.NpcCpsInput / 50000ul, client);
  53. client.NpcCpsInput = 0;
  54. }
  55. break;
  56. }
  57. }
  58. break;
  59. }
  60. #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement