EDIT: Changed two '==' to '>=' as nTL3fTy pointed out, dunno what I was thinking
Screenshot:

Code A: NpcTalk.cs:
Code:
case 5004: // MillionaireLee
{
if (LinkBack == 0)
{
Text("Hello! I can free up space in your inventory by packing 10 DragonBalls or Meteors into a DragonScroll or MeteorScroll!", CSocket);
Link("Make me a DragonScroll.", 1, CSocket);
Link("Make me a MeteorScroll.", 2, CSocket);
Link("No thanks!", 255, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
int DBCount = 0;
List<int> DBList = new List<int>();
foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
{
if (Item.ItemID == 1088000)
{
DBCount++;
DBList.Add(Item.UID);
}
if (DBCount == 10)
break;
}
if (DBCount >= 10)
{
foreach (int DBUID in DBList)
{
CSocket.Client.Inventory.Remove(DBUID);
CSocket.Send(ConquerPacket.ItemUsage(DBUID, 255, Struct.ItemUsage.RemoveItem));
Database.Database.DeleteItem(DBUID);
}
Struct.ItemInfo SubItem = new Struct.ItemInfo();
SubItem.Bless = SubItem.Enchant = SubItem.Position =
SubItem.Color = SubItem.Soc1 = SubItem.Soc2 = SubItem.Plus = 0;
SubItem.Dura = 1;
SubItem.ItemID = 720028;
SubItem.UID = Nano.Rand.Next(1, 9999999);
bool created = Database.Database.NewItem(SubItem, CSocket);
while (!created)
{
SubItem.UID = Nano.Rand.Next(1, 9999999);
created = Database.Database.NewItem(SubItem, CSocket);
}
CSocket.Client.Inventory.Add(SubItem.UID, SubItem);
CSocket.Send(ConquerPacket.ItemInfo(SubItem.UID, SubItem.ItemID, SubItem.Plus, SubItem.Bless, SubItem.Enchant, SubItem.Soc1, SubItem.Soc2, SubItem.Dura, SubItem.MaxDura, SubItem.Position, SubItem.Color));
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You obtained a DragonScroll!", Struct.ChatType.Top));
}
else
{
Text("Fool! How dare you try and rip me off!", CSocket);
Link("Sorry!", 255, CSocket);
End(CSocket);
break;
}
}
else if (LinkBack == 2)
{
int MetCount = 0;
List<int> MetList = new List<int>();
foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
{
if (Item.ItemID == 1088001)
{
MetCount++;
MetList.Add(Item.UID);
}
if (MetCount == 10)
break;
}
if (MetCount >= 10)
{
foreach (int DBUID in MetList)
{
CSocket.Client.Inventory.Remove(DBUID);
CSocket.Send(ConquerPacket.ItemUsage(DBUID, 255, Struct.ItemUsage.RemoveItem));
Database.Database.DeleteItem(DBUID);
}
Struct.ItemInfo SubItem = new Struct.ItemInfo();
SubItem.Bless = SubItem.Enchant = SubItem.Position =
SubItem.Color = SubItem.Soc1 = SubItem.Soc2 = SubItem.Plus = 0;
SubItem.Dura = 1;
SubItem.ItemID = 720027;
SubItem.UID = Nano.Rand.Next(1, 9999999);
bool created = Database.Database.NewItem(SubItem, CSocket);
while (!created)
{
SubItem.UID = Nano.Rand.Next(1, 9999999);
created = Database.Database.NewItem(SubItem, CSocket);
}
CSocket.Client.Inventory.Add(SubItem.UID, SubItem);
CSocket.Send(ConquerPacket.ItemInfo(SubItem.UID, SubItem.ItemID, SubItem.Plus, SubItem.Bless, SubItem.Enchant, SubItem.Soc1, SubItem.Soc2, SubItem.Dura, SubItem.MaxDura, SubItem.Position, SubItem.Color));
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You obtained a MeteorScroll!", Struct.ChatType.Top));
}
else
{
Text("Fool! How dare you try and rip me off!", CSocket);
Link("Sorry!", 255, CSocket);
End(CSocket);
break;
}
}
break;
}
Code:
#region Misc.
case 720027: // MeteorScroll
{
if (CSocket.Client.Inventory.Count <= 30)
{
for (int i = 0; i < 10; i++)
{
Struct.ItemInfo SubItem = new Struct.ItemInfo();
SubItem.Bless = SubItem.Enchant = SubItem.Position =
SubItem.Color = SubItem.Soc1 = SubItem.Soc2 = SubItem.Plus = 0;
SubItem.Dura = 1;
SubItem.ItemID = 1088001;
SubItem.UID = Nano.Rand.Next(1, 9999999);
bool created = Database.Database.NewItem(SubItem, CSocket);
while (!created)
{
SubItem.UID = Nano.Rand.Next(1, 9999999);
created = Database.Database.NewItem(SubItem, CSocket);
}
CSocket.Client.Inventory.Add(SubItem.UID, SubItem);
CSocket.Send(ConquerPacket.ItemInfo(SubItem.UID, SubItem.ItemID, SubItem.Plus, SubItem.Bless, SubItem.Enchant, SubItem.Soc1, SubItem.Soc2, SubItem.Dura, SubItem.MaxDura, SubItem.Position, SubItem.Color));
}
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You used the MeteorScroll and obtained 10 Meteors.", Struct.ChatType.Top));
}
else
{
Delete = false;
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "Not enough space in inventory.", Struct.ChatType.Top));
}
break;
}
case 720028: // DragonScroll
{
if (CSocket.Client.Inventory.Count <= 30)
{
for (int i = 0; i < 10; i++)
{
Struct.ItemInfo SubItem = new Struct.ItemInfo();
SubItem.Bless = SubItem.Enchant = SubItem.Position =
SubItem.Color = SubItem.Soc1 = SubItem.Soc2 = SubItem.Plus = 0;
SubItem.Dura = 1;
SubItem.ItemID = 1088000;
SubItem.UID = Nano.Rand.Next(1, 9999999);
bool created = Database.Database.NewItem(SubItem, CSocket);
while (!created)
{
SubItem.UID = Nano.Rand.Next(1, 9999999);
created = Database.Database.NewItem(SubItem, CSocket);
}
CSocket.Client.Inventory.Add(SubItem.UID, SubItem);
CSocket.Send(ConquerPacket.ItemInfo(SubItem.UID, SubItem.ItemID, SubItem.Plus, SubItem.Bless, SubItem.Enchant, SubItem.Soc1, SubItem.Soc2, SubItem.Dura, SubItem.MaxDura, SubItem.Position, SubItem.Color));
}
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You used the DragonScroll and obtained 10 DragonBalls.", Struct.ChatType.Top));
}
else
{
Delete = false;
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "Not enough space in inventory.", Struct.ChatType.Top));
}
break;
}
#endregion






