Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 16.54 KB | None | 0 0
  1.  #region Magic Artisan
  2.                                 case 10062:
  3.                                     {
  4.                                         dialog.Avatar(56);
  5.                                         uint CPUpgrade = 1000000;
  6.                                         switch (npcRequest.OptionID)
  7.                                         {
  8.                                             case 0:
  9.                                                 {
  10.                                                     dialog.Text("Have you ever seen my brother Artisan Wind? If so, you might know that he upgrades and downgrades the item level and item quality.");
  11.                                                     dialog.Text("Well, he doesn't always succeed, but that's why I am here. I can upgrade being sucessfully with a fixed amount of cost " + CPUpgrade.ToString("0,0") + " CPs ");
  12.                                                     dialog.Text("What would you like me to do?");
  13.                                                     dialog.Option("Upgrade~Equipment~level (Quickly).", 150);
  14.                                                     dialog.Option("Lower~Equipment~Level.", 160);
  15.                                                     dialog.Option("I~will~come~later.", 255);
  16.                                                     dialog.Send();
  17.                                                     break;
  18.                                                 }
  19.                                             case 150:
  20.                                                 {
  21.                                                     dialog.Text("Select which item's details you want to change?");
  22.                                                     dialog.Option("Headgear.", (byte)ConquerItem.Head);
  23.                                                     dialog.Option("Necklace.", (byte)ConquerItem.Necklace);
  24.                                                     dialog.Option("Armor.", (byte)ConquerItem.Armor);
  25.                                                     dialog.Option("Main Weapon.", (byte)ConquerItem.RightWeapon);
  26.                                                     dialog.Option("Left Weapon/Shield.", (byte)ConquerItem.LeftWeapon);
  27.                                                     dialog.Option("Ring.", (byte)ConquerItem.Ring);
  28.                                                     dialog.Option("Boots.", (byte)ConquerItem.Boots);
  29.                                                     dialog.Option("I'll just leave", 255);
  30.                                                     dialog.Send();
  31.                                                     break;
  32.                                                 }
  33.                                             case (byte)ConquerItem.RightWeapon:
  34.                                             case (byte)ConquerItem.LeftWeapon:
  35.                                                 {
  36.                                                     if (client.Entity.Level < 140)
  37.                                                     {
  38.                                                         dialog.Text("Sorry~" + client.Entity.Name + "~you~must~be~level~140");
  39.                                                         dialog.Option("I~give~up.", 255);
  40.                                                         dialog.Send();
  41.                                                         return;
  42.                                                     }
  43.                                                     ConquerItem item;
  44.                                                     Interfaces.IProf proficiency = null;
  45.                                                     if ((item = client.Equipment.TryGetItem(npcRequest.OptionID)) != null)
  46.                                                     {
  47.                                                         client.Proficiencies.TryGetValue((ushort)(item.ID / 1000), out proficiency);
  48.                                                         Database.ConquerItemInformation infos = new Conquer_Online_Server.Database.ConquerItemInformation(item.ID, item.Plus);
  49.                                                         if (client.Entity.ConquerPoints >= CPUpgrade)
  50.                                                         {
  51.                                                             if (infos.BaseInformation.Level != ItemHandler.ItemMaxLevel((ushort)ItemHandler.GetPositionFromID(infos.BaseInformation.ID)))
  52.                                                             {
  53.                                                                 if (proficiency != null)
  54.                                                                 {
  55.                                                                     if (proficiency.Level >= 12)
  56.                                                                     {
  57.                                                                         if (infos.BaseInformation.Class == 0)
  58.                                                                         {
  59.                                                                             client.Entity.ConquerPoints -= CPUpgrade;
  60.                                                                             item.ID = infos.HighID(ItemHandler.ItemMinLevel((ushort)ItemHandler.GetPositionFromID(item.ID)));
  61.                                                                             item.Mode = Game.Enums.ItemMode.Update;
  62.                                                                             item.Send(client);
  63.                                                                             client.LoadItemStats();
  64.                                                                             client.Entity.Update(10, "end_task", true);
  65.                                                                             client.Send("Done!");
  66.                                                                         }
  67.                                                                         else if (ItemHandler.EquipPassJobReq(infos.BaseInformation, client))
  68.                                                                         {
  69.                                                                             client.Entity.ConquerPoints -= CPUpgrade;
  70.                                                                             item.ID = infos.HighID(ItemHandler.ItemMinLevel((ushort)ItemHandler.GetPositionFromID(item.ID)));
  71.                                                                             item.Mode = Game.Enums.ItemMode.Update;
  72.                                                                             item.Send(client);
  73.                                                                             client.LoadItemStats();
  74.                                                                             client.Entity.Update(10, "end_task", true);
  75.                                                                             client.Send("Done!");
  76.                                                                         }
  77.                                                                         else
  78.                                                                         {
  79.                                                                             dialog.Text("stats are not compatible with you (Profession)");
  80.                                                                             dialog.Option("Ahh sorry.", 255);
  81.                                                                             dialog.Send();
  82.                                                                         }
  83.                                                                     }
  84.                                                                     else
  85.                                                                     {
  86.                                                                         dialog.Text("You~should~be~have~12~proficiency~in~your~weapon~you~only~have~" + proficiency.Level + "");
  87.                                                                         dialog.Option("Ahh sorry.", 255);
  88.                                                                         dialog.Send();
  89.                                                                     }
  90.                                                                 }
  91.                                                                 else
  92.                                                                 {
  93.                                                                     dialog.Text("You dont have any proficiency");
  94.                                                                     dialog.Option("Ahh sorry.", 255);
  95.                                                                     dialog.Send();
  96.                                                                 }
  97.                                                             }
  98.                                                             else
  99.                                                             {
  100.                                                                 dialog.Text("This item's level cannot be upgraded anymore.");
  101.                                                                 dialog.Option("Ahh sorry.", 255);
  102.                                                                 dialog.Send();
  103.                                                             }
  104.                                                         }
  105.                                                         else
  106.                                                         {
  107.                                                             dialog.Text("Sorry~" + client.Entity.Name + "~you~only~have~" + CPUpgrade.ToString("0,0")+ "~CPs");
  108.                                                             dialog.Option("I~give~up.", 255);
  109.                                                             dialog.Send();
  110.                                                         }
  111.                                                     }
  112.                                                     else
  113.                                                     {
  114.                                                         dialog.Text("You have to be wearing the selected item.");
  115.                                                         dialog.Option("I'll just leave", 255);
  116.                                                         dialog.Send();
  117.                                                     }
  118.                                                     break;
  119.                                                 }
  120.                                             case (byte)ConquerItem.Head:
  121.                                             case (byte)ConquerItem.Necklace:
  122.                                             case (byte)ConquerItem.Armor:
  123.                                             case (byte)ConquerItem.Ring:
  124.                                             case (byte)ConquerItem.Boots:
  125.                                                 {
  126.                                                     if (client.Entity.Level < 140)
  127.                                                     {
  128.                                                         dialog.Text("Sorry~" + client.Entity.Name + "~you~must~be~level~140");
  129.                                                         dialog.Option("I~give~up.", 255);
  130.                                                         dialog.Send();
  131.                                                         return;
  132.                                                     }
  133.                                                     ConquerItem item;
  134.                                                     if ((item = client.Equipment.TryGetItem(npcRequest.OptionID)) != null)
  135.                                                     {
  136.                                                         Database.ConquerItemInformation infos = new Conquer_Online_Server.Database.ConquerItemInformation(item.ID, item.Plus);
  137.                                                         if (client.Entity.ConquerPoints >= CPUpgrade)
  138.                                                         {
  139.                                                             if (infos.BaseInformation.Level < 15)
  140.                                                             {
  141.                                                                 dialog.Text("This item's level cannot be upgraded.");
  142.                                                                 dialog.Option("Ahh sorry.", 255);
  143.                                                                 dialog.Send();
  144.                                                                 return;
  145.                                                             }
  146.                                                             if (infos.BaseInformation.Level != ItemHandler.ItemMaxLevel((ushort)ItemHandler.GetPositionFromID(infos.BaseInformation.ID)))
  147.                                                             {
  148.                                                                 if (ItemHandler.EquipPassJobReq(infos.BaseInformation, client))
  149.                                                                 {
  150.                                                                     client.Entity.ConquerPoints -= CPUpgrade;
  151.                                                                     item.ID = infos.HighID(ItemHandler.ItemMinLevel((ushort)ItemHandler.GetPositionFromID(item.ID)));
  152.                                                                     item.Mode = Game.Enums.ItemMode.Update;
  153.                                                                     item.Send(client);
  154.                                                                     client.LoadItemStats();
  155.                                                                     client.Entity.Update(10, "end_task", true);
  156.                                                                     client.Send("Done!");
  157.                                                                 }
  158.                                                                 else
  159.                                                                 {
  160.                                                                     dialog.Text("stats are not compatible with you (Profession)");
  161.                                                                     dialog.Option("Ahh sorry.", 255);
  162.                                                                     dialog.Send();
  163.                                                                 }
  164.                                                             }
  165.                                                             else
  166.                                                             {
  167.                                                                 dialog.Text("This item's level cannot be upgraded anymore.");
  168.                                                                 dialog.Option("Ahh sorry.", 255);
  169.                                                                 dialog.Send();
  170.                                                             }
  171.                                                         }
  172.                                                         else
  173.                                                         {
  174.                                                             dialog.Text("Sorry~" + client.Entity.Name + "~you~only~have~" + CPUpgrade.ToString("0,0") + "~CPs");
  175.                                                             dialog.Option("I~give~up.", 255);
  176.                                                             dialog.Send();
  177.                                                         }
  178.                                                     }
  179.                                                     else
  180.                                                     {
  181.                                                         dialog.Text("You have to be wearing the selected item.");
  182.                                                         dialog.Option("I'll just leave", 255);
  183.                                                         dialog.Send();
  184.                                                     }
  185.                                                     break;
  186.                                                 }
  187.                                             case 160:
  188.                                                 {
  189.                                                     client.Send(new Data(true) { UID = client.Entity.UID, ID = Data.OpenWindow, dwParam = 506, wParam1 = client.Entity.X, wParam2 = client.Entity.Y });
  190.                                                     break;
  191.                                                 }
  192.                                         }
  193.                                         break;
  194.                                     }
  195.                                 #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement