[Release] Simple CPAdmin NPC

05/28/2009 08:43 xXVamXx#1
Hi Guys those who are too lazy to edit CPAdmin NPC here u are a simple CPAdmin NPC using money to exchange for CPs

go to Handler.cs then click on NPCTalk.cs

HTML Code:
                case 2071://CPAdmin Guy
                    {
                        if (LinkBack == 0)
                        {
                            Text("Would like to exchange for Cps with ur money? It will only cost u 50k for 5k Cps.", CSocket);
                            Link("Well yea I want it.", 1, CSocket);
                            Link("Nah No thanks!!", 255, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            if (CSocket.Client.Money >= 50000)
                            {
                                Money(-50000, CSocket);
                                CPs (+5000, CSocket);
                            }
                            else
                            {
                                Text("How dare you try to rip me off! Get lost, Or get my money!", CSocket);
                                Link("I'm sorry, I didn't realize.", 255, CSocket);
                                End(CSocket);
                            }
                        }
                        break;
                    }
I guess these will help you all and comment pls reply me. Thanks Guys for those who are helping me out.
05/28/2009 12:44 PeTe Ninja#2
this is the cp admin guy cp admin guy gives cps for dbs not money for cps
05/28/2009 14:22 scottdavey#3
This sucks, no offense.
05/28/2009 15:06 tanelipe#4
How can you say "no offence" if you're saying it sucks? I don't see the point posting that last part. Only thing you could really correct is the grammar.
05/28/2009 15:30 xXVamXx#5
lol Its ok watever u wanna to say but I did say in the first place right

Hi Guys those who are too lazy to edit CPAdmin NPC here u are a simple CPAdmin NPC using money to exchange for CPs

Thats wat i say in the begining b4 i post
05/28/2009 17:36 scottdavey#6
Quote:
Originally Posted by tanelipe View Post
How can you say "no offence" if you're saying it sucks? I don't see the point posting that last part. Only thing you could really correct is the grammar.
Because perhaps it was his first work? He can't agree that his first work sucks and that he can improve?

And offence is spelt differently where i live.
06/03/2009 20:37 killerbee#7
nice job. how do you change it so you can exchange dbs for cps.
06/05/2009 05:12 xXVamXx#8
Here are the exchange DB for CPs

paste it in ur Handler/NPCTalks

Look for case 923: // LadyLuck
On top it add


HTML Code:
case 2071://Market CPAdmin
                    {
                        if (LinkBack == 0)
                        {
                            Text("I guess you have extra DragonBalls in your inventory. \nI can give you 2000 CPs per dragonball and 20000 per DB Scroll.", CSocket);
                            Link("Yes, i want 2000 CPs for my dragonball.", 1, CSocket);
                            Link("Yes, i want 20000 CPs for my DBScroll.", 2, CSocket);
                            Link("Just passing by.", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            if (InventoryContains(1088000, 1, CSocket))
                            {
                                CSocket.Client.CPs += 2000;
                                int uid = ReturnUID(1088000, CSocket);
                                CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You now have " + CSocket.Client.CPs + " CPs.", Struct.ChatType.Top));
                                CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.CPs, Struct.StatusTypes.InvCPoints));
                                CSocket.Client.Inventory.Remove(uid);
                                CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem));
                                Database.Database.DeleteItem(uid);
                            }
                            else
                            {
                                Text("You don't have a dragonball.", CSocket);
                                Link("Ok.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                        }
                        else if (LinkBack == 2)
                        {
                            if (InventoryContains(720028, 1, CSocket))
                            {
                                CSocket.Client.CPs += 20000;
                                int uid = ReturnUID(720028, CSocket);
                                CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You now have " + CSocket.Client.CPs + " CPs.", Struct.ChatType.Top));
                                CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.CPs, Struct.StatusTypes.InvCPoints));
                                CSocket.Client.Inventory.Remove(uid);
                                CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem));
                                Database.Database.DeleteItem(uid);
                            }
                            else
                            {
                                Text("You don't have a dragonball scroll.", CSocket);
                                Link("Ok.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                        }
                        break;

Then look for

default:
{
Text("NPC " + ID + "'s dialog is not coded.", CSocket);
Link("Aw! That's too bad!", 255, CSocket);
Face(30, CSocket);
End(CSocket);
break;
}

Below it add :


HTML Code:
public static void AddItem(int itemid, int bless, int dura, int enchant, int plus, int position, int soc1, int soc2, int color, ClientSocket CSocket)
        {
            Struct.ItemInfo Item = new Struct.ItemInfo();
            if (dura == 255)
            {
                Item.Dura = Item.MaxDura;
            }
            else
            {
                Item.Dura = dura;
            }
            Item.Bless = bless;
            Item.Enchant = enchant;
            Item.ItemID = itemid;
            Item.Plus = plus;
            Item.Position = position;
            Item.Soc1 = soc1;
            Item.Soc2 = soc2;
            Item.Color = color;
            Item.UID = Nano.Rand.Next(1, 9999999);
            bool created = Database.Database.NewItem(Item, CSocket);
            while (!created)
            {
                Item.UID = Nano.Rand.Next(1, 9999999);
                created = Database.Database.NewItem(Item, CSocket);
            }
I hope you enjoy it Wha La
06/05/2009 05:47 hunterman01#9
Quote:
int uid = ReturnUID(1088000, CSocket);
If im correct i believe that is the id for a db not a db scroll
06/05/2009 06:10 xXVamXx#10
yup for the DBScroll u can search it or change it by searching at the ItemID in ur CoEmuV2 files
06/12/2009 10:36 WHITELIONX#11
7 Errors >.< I just got the LadyLuck but I still have 7 errors Face being one ReturnUID being another and InventoryContains being the other problem any suggestions? Ok I brought it down to 4 errors by deleting the Face line completly. But I am still with the InventoryContain problem not existing and also ReturnUID not existing.
07/04/2009 06:37 Jay1029#12
K, well I read the FIRST post in this thread and followed the instructions. It all worked. I now have a CPAdmin giving 5000 CPs for 50000 silvers. Thanks VAM
07/04/2009 18:29 Roykssop#13
I still have 2 errors

int uid = ReturnUID(1088000, CSocket);
Face(30, CSocket);
07/04/2009 18:30 Roykssop#14
I still have 2 errors

int uid = ReturnUID(1088000, CSocket);
Face(30, CSocket);
07/05/2009 16:58 xXVamXx#15
Delete the :

Face(30, CSocket);

Then There u go