This is just an example without an NPC. I hope it makes sense to you.
Code:
if (MyChar.Silvers >= 100000)
{
MyChar.CPs += 10;
SendPacket(General.MyPackets.Vital(MyChar.UID, 30, CPs));
MyChar.Silvers -= 100000;
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
}
That checks to see if you have 100000 Silvers, and if you do, it gives you 10 CP then takes away the silvers.