Register for your free account! | Forgot your password?

You last visited: Today at 01:10

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] CPWarehouse

Discussion on [Release] CPWarehouse within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,223
Received Thanks: 867
[Release] CPWarehouse

Hello, (Note: This is for impulse's source.)

So I quickly made a CPWarehouse you may run into a few bugs while running this and i am sure this could of been coded hell of alot better but the only reason i am releasing this is because its buggy (H)
in the entities table in mysql add one field called 'WarehouseCPs'
then in Database->EntityTable.cs where it loads add
Code:
client.Entity.WarehouseCPs = r.ReadUInt32("WarehouseCPs");
in Game->Entity.cs in Accessors add
Code:
public uint WarehouseCPs
        {
            get { return _WarehouseCPs; }
            set
            {
                if (FullyLoaded)
                {
                    UpdateDatabase("WarehouseCPs", value);
                }
                _WarehouseCPs = value;
            }
        }
then in Variables find
Code:
private uint _money, _conquerpoints, _uid, _hitpoints, _maxhitpoints, _quizpoints, Etcetc
add on the end of that
Code:
_WarehouseCPs;
then for the npc I had this
Code:
#region CPWarehouse
                case 12111:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hello, I am here to help protect your CPs with a CP Warehouse!");
                                    dialog.Link("Withdraw", 1);
                                    dialog.Link("Deposit", 3);
                                    dialog.Link("How many CPs do I have", 5);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    dialog.Text("You have " + client.Entity.WarehouseCPs + " CPs to Withdraw.");
                                    dialog.Input("Amount to withdraw: ", 2, 500000);
                                    dialog.Link("Forget it.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 2:
                                {
                                    client.TempCPWithdraw = npcRequest.Input;
                                    if (uint.Parse(client.TempCPWithdraw) <= client.Entity.WarehouseCPs)
                                    {
                                        client.Entity.WarehouseCPs -= uint.Parse(client.TempCPWithdraw);
                                        client.Entity.ConquerPoints += uint.Parse(client.TempCPWithdraw);
                                        dialog.Text("You have successfully withdrawn " + client.TempCPWithdraw);
                                        dialog.Link("Thanks.", 255);
                                        client.TempCPWithdraw = "";

                                    }
                                    else
                                    {
                                        dialog.Text("You do not have that much to withdraw. You have " + client.Entity.WarehouseCPs);
                                        dialog.Input("Amount to withdraw: ", 2, 500000);
                                        dialog.Link("Forget it.", 255);
                                    }
                                    dialog.Send();
                                    break;
                                }
                            case 3:
                                {
                                    dialog.Text("You have " + client.Entity.ConquerPoints + " CPs to Deposit.");
                                    dialog.Input("Amount to Deposit: ", 4, 500000);
                                    dialog.Link("Forget it.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 4:
                                {
                                    client.TempCPDeposit = npcRequest.Input;
                                    if (uint.Parse(client.TempCPDeposit) <= client.Entity.ConquerPoints)
                                    {
                                        client.Entity.WarehouseCPs += uint.Parse(client.TempCPDeposit);
                                        client.Entity.ConquerPoints -= uint.Parse(client.TempCPDeposit);
                                        dialog.Text("You have successfully deposited " + client.TempCPDeposit);
                                        dialog.Link("Thanks.", 255);
                                        client.TempCPDeposit = "";

                                    }
                                    else
                                    {
                                        dialog.Text("You do not have that much to Deposit. You have " + client.Entity.ConquerPoints);
                                        dialog.Input("Amount to Deposit: ", 4, 500000);
                                        dialog.Link("Forget it.", 255);
                                    }
                                    dialog.Send();
                                    break;
                                }
                            case 5:
                                {
                                    dialog.Text("Warehouse CPs: " + client.Entity.WarehouseCPs + ".");
                                    dialog.Link("Deposit.", 1);
                                    dialog.Link("Withdraw.", 3);
                                    dialog.Link("Forget it.", 255);
                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
in Client->GameState Define this
Code:
public string TempCPDeposit;
        public string TempCPWithdraw;
under
Code:
public Team Team;
There.!
_DreadNought_ is offline  
Old 08/15/2010, 22:23   #2
 
.Beatz's Avatar
 
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
Errr why make this? When you get killed your CPs don't drop to the ground...... Thats why TQ have not made a CP warehouse... Also I am sure if people are getting 999999999 CPs that fast that they need a warehouse for them then your rates are wwaaaayy too high.. Just a thought.

Good job though.... +k
.Beatz is offline  
Old 08/15/2010, 22:27   #3
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,223
Received Thanks: 867
I was bored and never coded a CPWarehouse saw one in another server so I thought why not

You lot must add this code for it to work(add it in dialog.cs)
Code:
public void Input(string text, byte id, ulong maxLength)
        {
            Replies.Add(new NpcReply()
            {
                DontDisplay = true,
                InputMaxLength = (ushort)maxLength,
                InteractType = NpcReply.Input,
                OptionID = id,
                Text = text
            });
        }

Thanks.
_DreadNought_ is offline  
Old 08/15/2010, 22:41   #4
 
.Beatz's Avatar
 
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
Yeah I get like that sometimes Might find a use for this actually.... Not the CPs though
.Beatz is offline  
Old 08/16/2010, 00:10   #5
 
Sp!!ke's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 380
Received Thanks: 58
great elimination nice to see people using impulse source
Sp!!ke is offline  
Thanks
1 User
Old 08/16/2010, 11:29   #6
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,223
Received Thanks: 867
Quote:
Originally Posted by Tweety.4Girls View Post
great elimination nice to see people using impulse source
Just taking advantage of possibly the best released source Let's not forget without Impulse I could of never made this release. Thanks impulse
_DreadNought_ is offline  
Old 08/16/2010, 11:33   #7
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
if a cps warehouse should be good, then u should have whpw to it, because the thing about cpswh, should be against scamming, so u can protect ur cps.
Fish* is offline  
Old 08/16/2010, 12:26   #8
 
FrontBoy's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 275
Received Thanks: 142
can someone convert it for 5165 LOTF
FrontBoy is offline  
Thanks
1 User
Old 08/16/2010, 19:25   #9
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,223
Received Thanks: 867
No I will not convert it to lotf, and grillmad yeah its easy.
_DreadNought_ is offline  
Old 08/16/2010, 19:28   #10
 
FrontBoy's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 275
Received Thanks: 142
FrontBoy is offline  
Thanks
1 User
Old 08/16/2010, 20:29   #11
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,223
Received Thanks: 867
Not hard to do, add me on msn:
_DreadNought_ is offline  
Old 08/16/2010, 20:44   #12
 
FrontBoy's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 275
Received Thanks: 142
i added you
FrontBoy is offline  
Thanks
1 User
Reply




All times are GMT +2. The time now is 01:10.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.