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");
Code:
public uint WarehouseCPs { get { return _WarehouseCPs; } set { if (FullyLoaded) { UpdateDatabase("WarehouseCPs", value); } _WarehouseCPs = value; } }
Code:
private uint _money, _conquerpoints, _uid, _hitpoints, _maxhitpoints, _quizpoints, Etcetc
Code:
_WarehouseCPs;
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
Code:
public string TempCPDeposit; public string TempCPWithdraw;
Code:
public Team Team;