Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 12.84 KB | None | 0 0
  1.  #region ExchangeOfficer
  2.                                 case 13547:// OTP`s
  3.                                     {
  4.                                         dialog.Avatar(254);
  5.                                         switch (npcRequest.OptionID)
  6.                                         {
  7.                                             case 0:
  8.                                                 {
  9.                                                     dialog.Text("Hello sir, i've been called by the authority to help the active people with the speical gifts I carry in my bag. So let's see how active you are.. your online ");
  10.                                                     dialog.Text("training points are " + client.OnlinePoints.ToString("0,0") + " What would you like to claim with your points " + client.OnlinePoints.ToString("0,0") + " OTP's?");
  11.                                                     dialog.Option("increase my VIP", 8);
  12.                                                     dialog.Option("Exchange to CPs", 2);
  13.                                                     dialog.Option("Exchange to ChampionPoints", 3);
  14.                                                     dialog.Option("Tournaments~Exchange", 60);
  15.                                                     dialog.Option("just passing by", 255);
  16.                                                     dialog.Send();
  17.                                                     break;
  18.                                                 }
  19.                                             case 3:
  20.                                                 {
  21.                                                     dialog.Text("How~many~OTP's~would~you~like~to~exchange?");
  22.                                                     dialog.Option("10~OTP~=~2~ChampionPoints", 4);
  23.                                                     dialog.Option("100~OTP~=~25~ChampionPoints", 5);
  24.                                                     dialog.Option("I'll~choose~another~offer", 255);
  25.                                                     dialog.Send();
  26.                                                     break;
  27.                                                 }
  28.                                             case 60:
  29.                                                 {
  30.                                                     var shop = new ProtoExchangeShop()
  31.                                                     {
  32.                                                         ShopID = 19424,
  33.                                                         Action = 1,
  34.                                                         TimeIn = 1714178,
  35.                                                         TimeInSeconds = 46389,
  36.                                                     };
  37.                                                     client.Send(CMsgExchangeShop.FinalizeProtoBuf(shop));
  38.                                                     break;
  39.                                                 }
  40.                                             case 4:
  41.                                                 {
  42.                                                     if (client.OnlinePoints >= 10)
  43.                                                     {
  44.                                                         client.OnlinePoints -= 10;
  45.                                                         client.ChampionPoints += 2;
  46.                                                         client.Champion.Send(client);
  47.                                                         Database.EntityTable.UpdateOtp(client);
  48.                                                         client.Send("You've~successfully~swapped~10~OTP~with~2~ChampionPoints");
  49.                                                     }
  50.                                                     else
  51.                                                     {
  52.                                                         dialog.Text("You~don't~have~enough~OnlineTraningPoints~to~continue..");
  53.                                                         dialog.Option("Oh,~Sorry!", 255);
  54.                                                         dialog.Send();
  55.                                                     }
  56.                                                     break;
  57.                                                 }
  58.                                             case 5:
  59.                                                 {
  60.                                                     if (client.OnlinePoints >= 100)
  61.                                                     {
  62.                                                         client.OnlinePoints -= 100;
  63.                                                         client.ChampionPoints += 25;
  64.                                                         client.Champion.Send(client);
  65.                                                         Database.EntityTable.UpdateOtp(client);
  66.                                                         client.Send("You've~successfully~swapped~100~OTP~with~25~ChampionPoints");
  67.                                                     }
  68.                                                     else
  69.                                                     {
  70.                                                         dialog.Text("You~don't~have~enough~OnlineTraningPoints~to~continue..");
  71.                                                         dialog.Option("Oh,~Sorry!", 255);
  72.                                                         dialog.Send();
  73.                                                     }
  74.                                                     break;
  75.                                                 }
  76.                                             case 8:
  77.                                                 {
  78.                                                     if (client.Entity.VIPLevel < 6)
  79.                                                     {
  80.                                                         uint Points = Program.MaxVIPPoints;
  81.                                                         if (client.Entity.VIPLevel >= 0 && client.Entity.VIPLevel <= 3)
  82.                                                             Points = 1500;
  83.                                                         else if (client.Entity.VIPLevel == 4)
  84.                                                             Points = 3000;
  85.                                                         else if (client.Entity.VIPLevel == 5)
  86.                                                             Points = 4000;
  87.                                                         if (client.OnlinePoints >= Points)
  88.                                                         {
  89.                                                             client.Entity.VIPLevel++;
  90.                                                             VipStatus vip = new VipStatus();
  91.                                                             client.Send(vip.ToArray());
  92.                                                             if (client.Entity.VIPLevel >= 1 && client.Entity.VIPLevel <= 3)
  93.                                                                 client.VIPDays = 30;
  94.                                                             else if (client.Entity.VIPLevel == 4)
  95.                                                                 client.VIPDays = 40;
  96.                                                             else if (client.Entity.VIPLevel == 5)
  97.                                                                 client.VIPDays = 45;
  98.                                                             else if (client.Entity.VIPLevel == 6)
  99.                                                                 client.VIPDays = 50;
  100.                                                             Database.PremiumTable.activateVip(client);
  101.                                                             client.OnlinePoints -= Points;
  102.                                                             Database.EntityTable.UpdateOtp(client);
  103.                                                             client.MessageBox("You`ve Successfuly upgrade your vip to level " + client.Entity.VIPLevel + " and got " + client.VIPDays + " Days!");
  104.                                                             client.Send(new Network.GamePackets.Message("You`ve Successfuly upgrade your vip to level " + client.Entity.VIPLevel + "", System.Drawing.Color.Red, Message.Talk));
  105.                                                         }
  106.                                                         else
  107.                                                         {
  108.                                                             client.Send(new Network.GamePackets.Message("You need " + Points.ToString("0,0") + " OTP's to be upgrade your VIP Level, You stand now with " + client.OnlinePoints.ToString("0,0") + "", System.Drawing.Color.Red, Message.Talk));
  109.                                                         }
  110.                                                     }
  111.                                                     else
  112.                                                     {
  113.                                                         client.Send(new Network.GamePackets.Message("You aready have Max Vip " + client.Entity.VIPLevel + "", System.Drawing.Color.Red, Message.Talk));
  114.                                                     }
  115.                                                     break;
  116.                                                 }
  117.                                             case 2:
  118.                                                 {
  119.                                                     uint input;
  120.                                                     if (uint.TryParse(npcRequest.Input, out input))
  121.                                                     {
  122.                                                         if (input < 1)
  123.                                                         {
  124.                                                             dialog.Text("How many OTP's would you like to exchange? 1 OTP = " + Program.ExchangeCPs.ToString("0,0") + " CPs");
  125.                                                             dialog.Input("OTP's: (Max=5000)", 2, 9);
  126.                                                             return;
  127.                                                         }
  128.                                                         if (client.OnlinePoints >= input)
  129.                                                         {
  130.                                                             client.OTPsInput = input;
  131.                                                             if (client.OnlinePoints >= client.OTPsInput && client.OTPsInput != 0 && client.OTPsInput <= 5000)
  132.                                                             {
  133.                                                                 client.OnlinePoints -= client.OTPsInput;
  134.                                                                 client.Entity.ConquerPoints += client.OTPsInput * Program.ExchangeCPs;
  135.                                                                 uint Convert = client.OTPsInput * Program.ExchangeCPs;
  136.                                                                 client.Send(new Network.GamePackets.Message("You`ve Successfuly " + client.OTPsInput.ToString("0,0") + " OPT with " + Convert.ToString("0,0") + " CPs!", System.Drawing.Color.Tan, Message.Talk));
  137.                                                                 client.OTPsInput = 0;
  138.                                                                 Convert = 0;
  139.                                                                 Database.EntityTable.UpdateOtp(client);
  140.                                                             }
  141.                                                         }
  142.                                                         else
  143.                                                         {
  144.                                                             client.Send(new Network.GamePackets.Message("You don`t have OTP's, You stand now with " + client.OnlinePoints.ToString("0,0") + "", System.Drawing.Color.Red, Message.Talk));
  145.                                                         }
  146.                                                     }
  147.                                                     else
  148.                                                     {
  149.                                                         dialog.Text("How many OTP's would you like to exchange? 1 OTP = " + Program.ExchangeCPs.ToString("0,0") + " CPs");
  150.                                                         dialog.Input("OTP's: (Max=5000)", 2, 9);
  151.                                                     }
  152.                                                     break;
  153.                                                 }
  154.                                            
  155.                                         }
  156.                                         break;
  157.                                     }
  158.                                 #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement