New Modified CPAdmin

04/09/2010 03:55 patelkarn#1
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
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
So this is my code if you like it press thanks
04/09/2010 05:41 Arcо#2
Code:
while (true)
?
04/09/2010 14:28 patelkarn#3
Quote:
Originally Posted by .Arco View Post
Code:
while (true)
?
Why what is wrong with that I use that so I can repeat the loop until there are no dragon balls left in the inventory
04/09/2010 19:34 Arcо#4
Oh!
I get what this is doing now.
You're selling all the dragonballs in the inventory.
Gotcha.
04/09/2010 21:49 patelkarn#5
yes that what it does i made it because lots of people have high rate for dbs it annoying to keep on clicking the guy to sell one db at a time. so i decided to made it if someone wat to use it.


press thanks if you like it
05/03/2010 03:50 arab4life#6
Good Job.
05/03/2010 04:29 ©Hyperlink#7
Quote:
Originally Posted by patelkarn View Post
yes that what it does i made it because lots of people have high rate for dbs it annoying to keep on clicking the guy to sell one db at a time. so i decided to made it if someone wat to use it.


press thanks if you like it
i think the millionair thing is there for that reason, but i like this idea better :)
05/03/2010 05:59 punkie..#8
Quote:
Originally Posted by ©Hyperlink View Post
i think the millionair thing is there for that reason, but i like this idea better :)
Well, if you read what he wrote it works also for all the DB Scrolls you've got.
So Millionair dude means nothing here :]

Good work.
05/03/2010 06:07 TheGuyWithTheCodes#9
why didnt you just make it checks how many dbs they have.
and then give hte amount thats needed.
much more simply, but goodwork :)
09/15/2010 14:57 salem rey#10
Arco got silent, hehehe Just joking peace arco..