Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region Magic Artisan
- case 10062:
- {
- dialog.Avatar(56);
- uint CPUpgrade = 1000000;
- switch (npcRequest.OptionID)
- {
- case 0:
- {
- 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.");
- 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 ");
- dialog.Text("What would you like me to do?");
- dialog.Option("Upgrade~Equipment~level (Quickly).", 150);
- dialog.Option("Lower~Equipment~Level.", 160);
- dialog.Option("I~will~come~later.", 255);
- dialog.Send();
- break;
- }
- case 150:
- {
- dialog.Text("Select which item's details you want to change?");
- dialog.Option("Headgear.", (byte)ConquerItem.Head);
- dialog.Option("Necklace.", (byte)ConquerItem.Necklace);
- dialog.Option("Armor.", (byte)ConquerItem.Armor);
- dialog.Option("Main Weapon.", (byte)ConquerItem.RightWeapon);
- dialog.Option("Left Weapon/Shield.", (byte)ConquerItem.LeftWeapon);
- dialog.Option("Ring.", (byte)ConquerItem.Ring);
- dialog.Option("Boots.", (byte)ConquerItem.Boots);
- dialog.Option("I'll just leave", 255);
- dialog.Send();
- break;
- }
- case (byte)ConquerItem.RightWeapon:
- case (byte)ConquerItem.LeftWeapon:
- {
- if (client.Entity.Level < 140)
- {
- dialog.Text("Sorry~" + client.Entity.Name + "~you~must~be~level~140");
- dialog.Option("I~give~up.", 255);
- dialog.Send();
- return;
- }
- ConquerItem item;
- Interfaces.IProf proficiency = null;
- if ((item = client.Equipment.TryGetItem(npcRequest.OptionID)) != null)
- {
- client.Proficiencies.TryGetValue((ushort)(item.ID / 1000), out proficiency);
- Database.ConquerItemInformation infos = new Conquer_Online_Server.Database.ConquerItemInformation(item.ID, item.Plus);
- if (client.Entity.ConquerPoints >= CPUpgrade)
- {
- if (infos.BaseInformation.Level != ItemHandler.ItemMaxLevel((ushort)ItemHandler.GetPositionFromID(infos.BaseInformation.ID)))
- {
- if (proficiency != null)
- {
- if (proficiency.Level >= 12)
- {
- if (infos.BaseInformation.Class == 0)
- {
- client.Entity.ConquerPoints -= CPUpgrade;
- item.ID = infos.HighID(ItemHandler.ItemMinLevel((ushort)ItemHandler.GetPositionFromID(item.ID)));
- item.Mode = Game.Enums.ItemMode.Update;
- item.Send(client);
- client.LoadItemStats();
- client.Entity.Update(10, "end_task", true);
- client.Send("Done!");
- }
- else if (ItemHandler.EquipPassJobReq(infos.BaseInformation, client))
- {
- client.Entity.ConquerPoints -= CPUpgrade;
- item.ID = infos.HighID(ItemHandler.ItemMinLevel((ushort)ItemHandler.GetPositionFromID(item.ID)));
- item.Mode = Game.Enums.ItemMode.Update;
- item.Send(client);
- client.LoadItemStats();
- client.Entity.Update(10, "end_task", true);
- client.Send("Done!");
- }
- else
- {
- dialog.Text("stats are not compatible with you (Profession)");
- dialog.Option("Ahh sorry.", 255);
- dialog.Send();
- }
- }
- else
- {
- dialog.Text("You~should~be~have~12~proficiency~in~your~weapon~you~only~have~" + proficiency.Level + "");
- dialog.Option("Ahh sorry.", 255);
- dialog.Send();
- }
- }
- else
- {
- dialog.Text("You dont have any proficiency");
- dialog.Option("Ahh sorry.", 255);
- dialog.Send();
- }
- }
- else
- {
- dialog.Text("This item's level cannot be upgraded anymore.");
- dialog.Option("Ahh sorry.", 255);
- dialog.Send();
- }
- }
- else
- {
- dialog.Text("Sorry~" + client.Entity.Name + "~you~only~have~" + CPUpgrade.ToString("0,0")+ "~CPs");
- dialog.Option("I~give~up.", 255);
- dialog.Send();
- }
- }
- else
- {
- dialog.Text("You have to be wearing the selected item.");
- dialog.Option("I'll just leave", 255);
- dialog.Send();
- }
- break;
- }
- case (byte)ConquerItem.Head:
- case (byte)ConquerItem.Necklace:
- case (byte)ConquerItem.Armor:
- case (byte)ConquerItem.Ring:
- case (byte)ConquerItem.Boots:
- {
- if (client.Entity.Level < 140)
- {
- dialog.Text("Sorry~" + client.Entity.Name + "~you~must~be~level~140");
- dialog.Option("I~give~up.", 255);
- dialog.Send();
- return;
- }
- ConquerItem item;
- if ((item = client.Equipment.TryGetItem(npcRequest.OptionID)) != null)
- {
- Database.ConquerItemInformation infos = new Conquer_Online_Server.Database.ConquerItemInformation(item.ID, item.Plus);
- if (client.Entity.ConquerPoints >= CPUpgrade)
- {
- if (infos.BaseInformation.Level < 15)
- {
- dialog.Text("This item's level cannot be upgraded.");
- dialog.Option("Ahh sorry.", 255);
- dialog.Send();
- return;
- }
- if (infos.BaseInformation.Level != ItemHandler.ItemMaxLevel((ushort)ItemHandler.GetPositionFromID(infos.BaseInformation.ID)))
- {
- if (ItemHandler.EquipPassJobReq(infos.BaseInformation, client))
- {
- client.Entity.ConquerPoints -= CPUpgrade;
- item.ID = infos.HighID(ItemHandler.ItemMinLevel((ushort)ItemHandler.GetPositionFromID(item.ID)));
- item.Mode = Game.Enums.ItemMode.Update;
- item.Send(client);
- client.LoadItemStats();
- client.Entity.Update(10, "end_task", true);
- client.Send("Done!");
- }
- else
- {
- dialog.Text("stats are not compatible with you (Profession)");
- dialog.Option("Ahh sorry.", 255);
- dialog.Send();
- }
- }
- else
- {
- dialog.Text("This item's level cannot be upgraded anymore.");
- dialog.Option("Ahh sorry.", 255);
- dialog.Send();
- }
- }
- else
- {
- dialog.Text("Sorry~" + client.Entity.Name + "~you~only~have~" + CPUpgrade.ToString("0,0") + "~CPs");
- dialog.Option("I~give~up.", 255);
- dialog.Send();
- }
- }
- else
- {
- dialog.Text("You have to be wearing the selected item.");
- dialog.Option("I'll just leave", 255);
- dialog.Send();
- }
- break;
- }
- case 160:
- {
- client.Send(new Data(true) { UID = client.Entity.UID, ID = Data.OpenWindow, dwParam = 506, wParam1 = client.Entity.X, wParam2 = client.Entity.Y });
- break;
- }
- }
- break;
- }
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement