Advertisement
Guest User

npc donate .

a guest
Apr 25th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.27 KB | None | 0 0
  1. ------------------------------------------ ( Npcs.cs ) ---------------------------------------------
  2. switch (client.Entity.MapID)
  3.             {
  4.  
  5. #region Nobility Donor
  6.                 case 7611237:
  7.                     {
  8.                         switch (npcRequest.OptionID)
  9.                         {
  10.                             case 0:
  11.                                 {
  12.                                     dialog.Text("Hello friend. 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.");
  13.                                     dialog.Input("Insert amount:", 1, 10);
  14.                                     dialog.Option("No thank you.", 255);
  15.                                     break;
  16.                                 }
  17.                             case 1:
  18.                                 {
  19.                                     uint input;
  20.                                     if (uint.TryParse(npcRequest.Input, out input))
  21.                                     {
  22.                                         if (input < 6000000)
  23.                                         {
  24.                                             dialog.Text("You need to input more or atleast 6,000,000 CPs..");
  25.                                             dialog.Input("Insert amount:", 1, 9);
  26.                                             dialog.Option("No thank you.", 255);
  27.                                             return;
  28.                                         }
  29.                                         if (client.Entity.ConquerPoints >= input)
  30.                                         {
  31.                                             client.NpcCpsInput = input;
  32.                                             dialog.Text("Are you sure you want to donate " + input + " CPs? That means I will donate for you " + (((ulong)input) * 50000ul) + " gold.");
  33.                                             dialog.Option("Yes", 2);
  34.                                             dialog.Option("No thank you.", 255);
  35.                                         }
  36.                                         else
  37.                                         {
  38.                                             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.");
  39.                                             dialog.Input("Insert amount:", 1, 9);
  40.                                             dialog.Option("No thank you.", 255);
  41.                                         }
  42.                                     }
  43.                                     else
  44.                                     {
  45.                                         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.");
  46.                                         dialog.Input("Insert amount:", 1, 9);
  47.                                         dialog.Option("No thank you.", 255);
  48.                                     }
  49.                                     break;
  50.                                 }
  51.                             case 2:
  52.                                 {
  53.                                     if (client.Entity.ConquerPoints >= client.NpcCpsInput && client.NpcCpsInput != 0)
  54.                                     {
  55.                                         client.Entity.ConquerPoints -= client.NpcCpsInput;
  56.                                         Game.ConquerStructures.Nobility.Donate((ulong)client.NpcCpsInput * 50000ul, client);
  57.                                         client.NpcCpsInput = 0;
  58.                                     }
  59.                                     break;
  60.                                 }
  61.                         }
  62.                         break;
  63.                     }
  64.                 #endregion
  65.  
  66. ------------------------------------ (npc / database ) ---------------------------------
  67. 7611237    0    0    nobilitydonation    2    16970    -1    1036    198    191    0    0    0    0    0    0    0    0    0    0    0    0    None    0    0    0    0    0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement