and i have problem with that npc
the npc upgrade the items above 140
Code:
#region Weapon Master
case 7050:
{
switch (npcRequest.OptionID)
{
case 0:
{
int aut = npcRequest.OptionID * 10;
dialog.Text("Hi friend select the equipment you want to pass the level now? Each level costs a Dragonball.");
dialog.Option("Upgrade HeadGear.", (byte)(aut + 1));
dialog.Option("Upgrade Necklace/Bag.", (byte)(aut + 2));
dialog.Option("Upgrade armor.", (byte)(aut + 3));
dialog.Option("Upgrade main weapon.", (byte)(aut + 4));
dialog.Option("Upgrade Left weapon/shield.", (byte)(aut + 5));
dialog.Option("Upgrade Heavy Ring, Ring, Bracelet.", (byte)(aut + 6));
dialog.Option("Upgrade Boots.", (byte)(aut + 8));
dialog.Option("No need thanks!", 255);
dialog.Send();
break;
}
case 100:
{
if (client.SelectedItem == 0)
return;
var item = client.Equipment.TryGetItem(client.SelectedItem);
var itemdetail = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];
Conquer_Online_Server.Database.ConquerItemInformation infos = new Conquer_Online_Server.Database.ConquerItemInformation(item.ID, item.Plus);
switch (client.UpdateType)
{
case 1:
case 2:
{
byte cost = (byte)(itemdetail.Level / 6);
cost += (byte)((item.ID % 10) / 3);
uint id = 1088001;
if (client.UpdateType == 2)
id++;
if (client.Inventory.Contains(id, cost))
{
client.Inventory.Remove(id, cost);
client.UnloadItemStats(item, false);
if (client.UpdateType == 1)
item.ID = infos.CalculateUplevel();
else
item.ID = infos.CalculateDownlevel();
if (infos.BaseInformation.ID == item.ID)
return;
Conquer_Online_Server.Database.ConquerItemTable.UpdateItemID(item, client);
item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
item.Send(client);
_String str = new _String(true);
str.UID = client.Entity.UID;
str.TextsCount = 1;
str.Type = _String.Effect;
str.Texts.Add("perfect");
client.Screen.SendScreen(str, true);
client.LoadItemStats(item);
client.Equipment.UpdateEntityPacket();
}
break;
}
case 3:
{
byte cost = (byte)(itemdetail.Level / 30);
cost += (byte)((item.ID % 10) / 2);
uint id = 1088000;
if (client.Inventory.Contains(id, cost))
{
client.Inventory.Remove(id, cost);
client.UnloadItemStats(item, false);
item.ID++;
Conquer_Online_Server.Database.ConquerItemTable.UpdateItemID(item, client);
item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
item.Send(client);
_String str = new _String(true);
str.UID = client.Entity.UID;
str.TextsCount = 1;
str.Type = _String.Effect;
str.Texts.Add("perfect");
client.Screen.SendScreen(str, true);
client.LoadItemStats(item);
client.Equipment.UpdateEntityPacket();
}
break;
}
}
break;
}
default:
{
if (npcRequest.OptionID == 255)
break;
byte SelectedItem = (byte)(npcRequest.OptionID % 10);
byte NowType = (byte)(npcRequest.OptionID / 10);
if (client.Equipment.Free(SelectedItem))
{
dialog.Text("You have to be wearing the selected item.");
dialog.Option("I'll just leave", 255);
dialog.Send();
return;
}
var item = client.Equipment.TryGetItem(SelectedItem);
var itemdetail = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];
if (itemdetail.Level == Conquer_Online_Server.Network.PacketHandler.ItemMaxLevel(client.SelectedItem) && client.UpdateType == 1)
{
dialog.Text("This item's level cannot be upgraded anymore.");
dialog.Option("Ahh sorry.", 255);
dialog.Send();
client.SelectedItem = 0;
client.UpdateType = 0;
return;
}
if (NowType == 1)
{
dialog.Text("It will cost you one dragonball. Do you accept?");
dialog.Option("Yes.", (byte)(20 + SelectedItem));
dialog.Option("No thank you.", 255);
dialog.Send();
}
else
{
Conquer_Online_Server.Database.ConquerItemInformation infos = new Conquer_Online_Server.Database.ConquerItemInformation(item.ID, item.Plus);
Conquer_Online_Server.Database.ConquerItemInformation infos2 = new Conquer_Online_Server.Database.ConquerItemInformation(infos.CalculateUplevel(), item.Plus);
if (client.Entity.Level < infos2.BaseInformation.Level)
{
dialog.Text("You need level " + infos2.BaseInformation.Level + " first.");
dialog.Option("Ahh sorry.", 255);
dialog.Send();
client.SelectedItem = 0;
client.UpdateType = 0;
return;
}
if (client.Inventory.Contains(1088000, 1))
{
client.Inventory.Remove(1088000, 1);
client.UnloadItemStats(item, false);
item.ID = infos.CalculateUplevel();
Conquer_Online_Server.Database.ConquerItemTable.UpdateItemID(item, client);
item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
item.Send(client);
_String str = new _String(true);
str.UID = client.Entity.UID;
str.TextsCount = 1;
str.Type = _String.Effect;
str.Texts.Add("perfect");
client.Screen.SendScreen(str, true);
client.LoadItemStats(item);
client.Equipment.UpdateEntityPacket();
}
}
}
break;
}
break;
}
#endregion






