Hi I kind of modified the code for CPAdmin so instead of selling one db for 215 cps you can sell all of then in your inventory in one shot and same thing with the DBScroll. This is my first time playing around with the C# so please do not flame me. And i tested this code and it works perfect in my client 5165.
Press the thanks button if you like it :D
So this is my code if you like it press thanks
Press the thanks button if you like it :D
Code:
#region CPAdmin
case XXXXX: <<< Make the case whatever you want and add the NPC
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hello, I can trade you 215 CPs for a DragonBall and 2150 CPs for a DBScroll and silvers to cps 10k silver for 10 cps."));
GC.AddSend(Packets.NPCLink("Here, take all my DragonBall!", 1));
GC.AddSend(Packets.NPCLink("Here, take all my DBScroll!", 2));
GC.AddSend(Packets.NPCLink("All Silvers", 3));
GC.AddSend(Packets.NPCLink("I'm too poor...", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
while (true)
{
if (GC.MyChar.InventoryContains(1088000, 1))
{
Game.Item DB = null;
foreach (Game.Item I in GC.MyChar.Inventory)
if (I.ID == 1088000)
{ DB = I; break; }
if (DB != null)
{
GC.MyChar.CPs += 215;
GC.MyChar.RemoveItem(DB);
}
}
else break;
}
}
if (Control == 2)
{
while (true)
{
if (GC.MyChar.InventoryContains(720028, 1))
{
Game.Item DB = null;
foreach (Game.Item I in GC.MyChar.Inventory)
if (I.ID == 720028)
{ DB = I; break; }
if (DB != null)
{
GC.MyChar.CPs += 2150;
GC.MyChar.RemoveItem(DB);
}
}
else break;
}
}
if (Control == 3)
{
if (GC.MyChar.Silvers >= 10000)
{
while (GC.MyChar.Silvers >= 10000)
{
GC.MyChar.CPs += 10;
GC.MyChar.Silvers -= 10000;
}
}
}
break;
}
#endregion