I am trying to create a NPC where players can make sockets to their equipment with DB's and ToughDrills and I am trying to find out what is wrong with this script.
#region Socketter
case 4400:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("Hello there my friend. I am here to put a socket in Your Equipment. For the first socket I demand 40 DragonBalls and for the second one I demand 25 ToughDrills.");
dialog.Option("Headgear", 4001);
dialog.Option("Necklace", 4011);
dialog.Option("Ring", 4021);
dialog.Option("Armor", 4031);
dialog.Option("Boots", 4041);
dialog.Option("Tower", 4051);
dialog.Option("Fan", 4061);
dialog.Option("Alright.", 255);
dialog.Send();
break;
}
case 4001:
{
if (!client.Headgear.Free(4))
{
MsgItemInfo Item = null;
Item = client.Headgear.TryGetItem(4);
if (Item.SocketOne == COServer.Game.Enums.Gem.NoSocket)
{
dialog.Text("My friend I will need 40 DragonBalls to socket your Headgear. Are you sure you want to do this ?");
dialog.Option("Yea sure.", 4002);
dialog.Send();
}
else if (Item.SocketTwo == COServer.Game.Enums.Gem.NoSocket)
{
dialog.Text("My friend I will need 25 ToughDrills to socket your Headgear. Are you sure you want to do this ?");
dialog.Option("Yea sure.", 4002);
dialog.Send();
}
else
{
dialog.Text("I can't socket this Headgear once more.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
else
{
dialog.Text("You need to wear the Headgear first.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
case 4011:
{
if (!client.Necklace.Free(4))
{
MsgItemInfo Item = null;
Item = client.Necklace.TryGetItem(4);
if (Item.SocketOne == COServer.Game.Enums.Gem.NoSocket)
{
dialog.Text("My friend I will need 40 DragonBalls to socket your Necklace. Are you sure you want to do this ?");
dialog.Option("Yea sure.", 4012);
dialog.Send();
}
else if (Item.SocketTwo == COServer.Game.Enums.Gem.NoSocket)
{
dialog.Text("My friend I will need 25 ToughDrills to socket your Necklace. Are you sure you want to do this ?");
dialog.Option("Yea sure.", 4012);
dialog.Send();
}
else
{
dialog.Text("I can't socket this Necklace once more.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
else
{
dialog.Text("You need to wear the Necklace first.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
case 4021:
{
if (!client.Ring.Free(4))
{
MsgItemInfo Item = null;
Item = client.Ring.TryGetItem(4);
if (Item.SocketOne == COServer.Game.Enums.Gem.NoSocket)
{
dialog.Text("My friend I will need 40 DragonBalls to socket your Ring. Are you sure you want to do this ?");
dialog.Option("Yea sure.", 4022);
dialog.Send();
}
else if (Item.SocketTwo == COServer.Game.Enums.Gem.NoSocket)
{
dialog.Text("My friend I will need 25 ToughDrills to socket your Ring. Are you sure you want to do this ?");
dialog.Option("Yea sure.", 4022);
dialog.Send();
}
else
{
dialog.Text("I can't socket this Ring once more.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
else
{
dialog.Text("You need to wear the Ring first.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
case 4031:
{
if (!client.Armor.Free(4))
{
MsgItemInfo Item = null;
Item = client.Armor.TryGetItem(4);
if (Item.SocketOne == COServer.Game.Enums.Gem.NoSocket)
{
dialog.Text("My friend I will need 40 DragonBalls to socket your Armor. Are you sure you want to do this ?");
dialog.Option("Yea sure.", 4032);
dialog.Send();
}
else if (Item.SocketTwo == COServer.Game.Enums.Gem.NoSocket)
{
dialog.Text("My friend I will need 25 ToughDrills to socket your Armor. Are you sure you want to do this ?");
dialog.Option("Yea sure.", 4032);
dialog.Send();
}
else
{
dialog.Text("I can't socket this Armor once more.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
else
{
dialog.Text("You need to wear the Armor first.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
case 4041:
{
if (!client.Boots.Free(4))
{
MsgItemInfo Item = null;
Item = client.Boots.TryGetItem(4);
if (Item.SocketOne == COServer.Game.Enums.Gem.NoSocket)
{
dialog.Text("My friend I will need 40 DragonBalls to socket your Boots. Are you sure you want to do this ?");
dialog.Option("Yea sure.", 4042);
dialog.Send();
}
else if (Item.SocketTwo == COServer.Game.Enums.Gem.NoSocket)
{
dialog.Text("My friend I will need 25 ToughDrills to socket your Boots. Are you sure you want to do this ?");
dialog.Option("Yea sure.", 4042);
dialog.Send();
}
else
{
dialog.Text("I can't socket this Ring once more.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
else
{
dialog.Text("You need to wear the Ring first.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
case 4051:
{
if (!client.Fan.Free(4))
{
MsgItemInfo Item = null;
Item = client.Fan.TryGetItem(4);
if (Item.SocketOne == COServer.Game.Enums.Gem.NoSocket)
{
dialog.Text("My friend I will need 40 DragonBalls to socket your FanTalisman. Are you sure you want to do this ?");
dialog.Option("Yea sure.", 4052);
dialog.Send();
}
else if (Item.SocketTwo == COServer.Game.Enums.Gem.NoSocket)
{
dialog.Text("My friend I will need 25 ToughDrills to socket your FanTalisman. Are you sure you want to do this ?");
dialog.Option("Yea sure.", 4052);
dialog.Send();
}
else
{
dialog.Text("I can't socket this FanTalisman once more.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
else
{
dialog.Text("You need to wear the FanTalisman first.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
case 4061:
{
if (!client.Tower.Free(4))
{
MsgItemInfo Item = null;
Item = client.Tower.TryGetItem(4);
if (Item.SocketOne == COServer.Game.Enums.Gem.NoSocket)
{
dialog.Text("My friend I will need 40 DragonBalls to socket your TowerTalisman. Are you sure you want to do this ?");
dialog.Option("Yea sure.", 4062);
dialog.Send();
}
else if (Item.SocketTwo == COServer.Game.Enums.Gem.NoSocket)
{
dialog.Text("My friend I will need 25 ToughDrills to socket your TowerTalisman. Are you sure you want to do this ?");
dialog.Option("Yea sure.", 4062);
dialog.Send();
}
else
{
dialog.Text("I can't socket this TowerTalisman once more.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
else
{
dialog.Text("You need to wear the TowerTalisman first.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
case 4002:
{
if (!client.Headgear.Free(4))
{
MsgItemInfo Item = null;
Item = client.Headgear.TryGetItem(4);
if (Item.SocketOne == COServer.Game.Enums.Gem.NoSocket)
{
if (client.Inventory.Contains(1088000, 40))
{
client.Inventory.Remove(1088000, 40);
Item.SocketOne = COServer.Game.Enums.Gem.EmptySocket;
Item.Mode = COServer.Game.Enums.ItemMode.Update;
Item.Send(client);
COServer.Database.ConquerItemTable.UpdateSockets(I tem);
dialog.Text("Done !");
dialog.Option("Thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You don't have 40 DragonBalls !");
dialog.Option("Ah...", 255);
dialog.Send();
}
}
else if (Item.SocketTwo == COServer.Game.Enums.Gem.NoSocket)
{
if (client.Inventory.Contains(1200005, 25))
{
client.Inventory.Remove(1200005, 25);
Item.SocketTwo = COServer.Game.Enums.Gem.EmptySocket;
Item.Mode = COServer.Game.Enums.ItemMode.Update;
Item.Send(client);
COServer.Database.ConquerItemTable.UpdateSockets(I tem);
dialog.Text("Done !");
dialog.Option("Thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You don't have 25 ToughDrills !");
dialog.Option("Ah...", 255);
dialog.Send();
}
}
else
{
dialog.Text("You need to wear the Headgear first.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
}
case 4012:
{
if (!client.Necklace.Free(4))
{
MsgItemInfo Item = null;
Item = client.Necklace.TryGetItem(4);
if (Item.SocketOne == COServer.Game.Enums.Gem.NoSocket)
{
if (client.Inventory.Contains(1088000, 40))
{
client.Inventory.Remove(1088000, 40);
Item.SocketOne = COServer.Game.Enums.Gem.EmptySocket;
Item.Mode = COServer.Game.Enums.ItemMode.Update;
Item.Send(client);
COServer.Database.ConquerItemTable.UpdateSockets(I tem);
dialog.Text("Done !");
dialog.Option("Thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You don't have 40 DragonBalls !");
dialog.Option("Ah...", 255);
dialog.Send();
}
}
else if (Item.SocketTwo == COServer.Game.Enums.Gem.NoSocket)
{
if (client.Inventory.Contains(1200005, 25))
{
client.Inventory.Remove(1200005, 25);
Item.SocketTwo = COServer.Game.Enums.Gem.EmptySocket;
Item.Mode = COServer.Game.Enums.ItemMode.Update;
Item.Send(client);
COServer.Database.ConquerItemTable.UpdateSockets(I tem);
dialog.Text("Done !");
dialog.Option("Thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You don't have 25 ToughDrills !");
dialog.Option("Ah...", 255);
dialog.Send();
}
}
else
{
dialog.Text("You need to wear the Necklace first.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
}
case 4022:
{
if (!client.Ring.Free(4))
{
MsgItemInfo Item = null;
Item = client.Ring.TryGetItem(4);
if (Item.SocketOne == COServer.Game.Enums.Gem.NoSocket)
{
if (client.Inventory.Contains(1088000, 40))
{
client.Inventory.Remove(1088000, 40);
Item.SocketOne = COServer.Game.Enums.Gem.EmptySocket;
Item.Mode = COServer.Game.Enums.ItemMode.Update;
Item.Send(client);
COServer.Database.ConquerItemTable.UpdateSockets(I tem);
dialog.Text("Done !");
dialog.Option("Thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You don't have 40 DragonBalls !");
dialog.Option("Ah...", 255);
dialog.Send();
}
break;
}
else if (Item.SocketTwo == COServer.Game.Enums.Gem.NoSocket)
{
if (client.Inventory.Contains(1200005, 25))
{
client.Inventory.Remove(1200005, 25);
Item.SocketTwo = COServer.Game.Enums.Gem.EmptySocket;
Item.Mode = COServer.Game.Enums.ItemMode.Update;
Item.Send(client);
COServer.Database.ConquerItemTable.UpdateSockets(I tem);
dialog.Text("Done !");
dialog.Option("Thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You don't have 25 ToughDrills !");
dialog.Option("Ah...", 255);
dialog.Send();
}
}
else
{
dialog.Text("You need to wear the Ring first.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
}
case 4032:
{
if (!client.Armor.Free(4))
{
MsgItemInfo Item = null;
Item = client.Armor.TryGetItem(4);
if (Item.SocketOne == COServer.Game.Enums.Gem.NoSocket)
{
if (client.Inventory.Contains(1088000, 40))
{
client.Inventory.Remove(1088000, 40);
Item.SocketOne = COServer.Game.Enums.Gem.EmptySocket;
Item.Mode = COServer.Game.Enums.ItemMode.Update;
Item.Send(client);
COServer.Database.ConquerItemTable.UpdateSockets(I tem);
dialog.Text("Done !");
dialog.Option("Thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You don't have 40 DragonBalls !");
dialog.Option("Ah...", 255);
dialog.Send();
}
}
else if (Item.SocketTwo == COServer.Game.Enums.Gem.NoSocket)
{
if (client.Inventory.Contains(1200005, 25))
{
client.Inventory.Remove(1200005, 25);
Item.SocketTwo = COServer.Game.Enums.Gem.EmptySocket;
Item.Mode = COServer.Game.Enums.ItemMode.Update;
Item.Send(client);
COServer.Database.ConquerItemTable.UpdateSockets(I tem);
dialog.Text("Done !");
dialog.Option("Thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You don't have 25 ToughDrills !");
dialog.Option("Ah...", 255);
dialog.Send();
}
}
else
{
dialog.Text("You need to wear the Armor first.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
}
case 4042:
{
if (!client.Boots.Free(4))
{
MsgItemInfo Item = null;
Item = client.Boots.TryGetItem(4);
if (Item.SocketOne == COServer.Game.Enums.Gem.NoSocket)
{
if (client.Inventory.Contains(1088000, 40))
{
client.Inventory.Remove(1088000, 40);
Item.SocketOne = COServer.Game.Enums.Gem.EmptySocket;
Item.Mode = COServer.Game.Enums.ItemMode.Update;
Item.Send(client);
COServer.Database.ConquerItemTable.UpdateSockets(I tem);
dialog.Text("Done !");
dialog.Option("Thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You don't have 40 DragonBalls !");
dialog.Option("Ah...", 255);
dialog.Send();
}
}
else if (Item.SocketTwo == COServer.Game.Enums.Gem.NoSocket)
{
if (client.Inventory.Contains(1200005, 25))
{
client.Inventory.Remove(1200005, 25);
Item.SocketTwo = COServer.Game.Enums.Gem.EmptySocket;
Item.Mode = COServer.Game.Enums.ItemMode.Update;
Item.Send(client);
COServer.Database.ConquerItemTable.UpdateSockets(I tem);
dialog.Text("Done !");
dialog.Option("Thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You don't have 25 ToughDrills !");
dialog.Option("Ah...", 255);
dialog.Send();
}
}
else
{
dialog.Text("You need to wear the Boots first.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
}
case 4052:
{
if (!client.Fan.Free(4))
{
MsgItemInfo Item = null;
Item = client.Fan.TryGetItem(4);
if (Item.SocketOne == COServer.Game.Enums.Gem.NoSocket)
{
if (client.Inventory.Contains(1088000, 40))
{
client.Inventory.Remove(1088000, 40);
Item.SocketOne = COServer.Game.Enums.Gem.EmptySocket;
Item.Mode = COServer.Game.Enums.ItemMode.Update;
Item.Send(client);
COServer.Database.ConquerItemTable.UpdateSockets(I tem);
dialog.Text("Done !");
dialog.Option("Thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You don't have 40 DragonBalls !");
dialog.Option("Ah...", 255);
dialog.Send();
}
}
else if (Item.SocketTwo == COServer.Game.Enums.Gem.NoSocket)
{
if (client.Inventory.Contains(1200005, 25))
{
client.Inventory.Remove(1200005, 25);
Item.SocketTwo = COServer.Game.Enums.Gem.EmptySocket;
Item.Mode = COServer.Game.Enums.ItemMode.Update;
Item.Send(client);
COServer.Database.ConquerItemTable.UpdateSockets(I tem);
dialog.Text("Done !");
dialog.Option("Thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You don't have 25 ToughDrills !");
dialog.Option("Ah...", 255);
dialog.Send();
}
}
else
{
dialog.Text("You need to wear the FanTalisman first.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
}
case 4062:
{
if (!client.Tower.Free(4))
{
MsgItemInfo Item = null;
Item = client.Tower.TryGetItem(4);
if (Item.SocketOne == COServer.Game.Enums.Gem.NoSocket)
{
if (client.Inventory.Contains(1088000, 40))
{
client.Inventory.Remove(1088000, 40);
Item.SocketOne = COServer.Game.Enums.Gem.EmptySocket;
Item.Mode = COServer.Game.Enums.ItemMode.Update;
Item.Send(client);
COServer.Database.ConquerItemTable.UpdateSockets(I tem);
dialog.Text("Done !");
dialog.Option("Thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You don't have 40 DragonBalls !");
dialog.Option("Ah...", 255);
dialog.Send();
}
}
else if (Item.SocketTwo == COServer.Game.Enums.Gem.NoSocket)
{
if (client.Inventory.Contains(1200005, 25))
{
client.Inventory.Remove(1200005, 25);
Item.SocketTwo = COServer.Game.Enums.Gem.EmptySocket;
Item.Mode = COServer.Game.Enums.ItemMode.Update;
Item.Send(client);
COServer.Database.ConquerItemTable.UpdateSockets(I tem);
dialog.Text("Done !");
dialog.Option("Thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You don't have 25 ToughDrills !");
dialog.Option("Ah...", 255);
dialog.Send();
}
}
else
{
dialog.Text("You need to wear the TowerTalisman first.");
dialog.Option("Alright.", 255);
dialog.Send();
}
}
}
break;
}
}
#endregion