Ever wanted to earn money on gold in the bank? Now you can!
I created an interest bag, when you drag gold/check on the bag, the funds are converted to an investment certificate.
(note that the gold/check has to be dragged on the un-opened bag)
The following code has to be activated by some kind of timer (im using a central hourly timer on mine). it will scan all bankboxes for investments and give interest on funds held in investment certificates.
works for RUNUO 2.1. enjoy!
to-do - have some randomized events which may affect your investments! Any ideas on thematic events? Or, can also convert the investmentcheck to some kind of bond/stock that has really random returns... who knows!
I created an interest bag, when you drag gold/check on the bag, the funds are converted to an investment certificate.
(note that the gold/check has to be dragged on the un-opened bag)
The following code has to be activated by some kind of timer (im using a central hourly timer on mine). it will scan all bankboxes for investments and give interest on funds held in investment certificates.
works for RUNUO 2.1. enjoy!
C#:
// adding interest to interestbags
Console.WriteLine( "interest check" );
World.Broadcast( 0x22, true, "Your bank has just given you interest on all gold in your interest bag in your bank!" );
ArrayList bankBoxes = new ArrayList();
foreach( Item bb in World.Items.Values )
{
if ( bb is BankBox )
{
bankBoxes.Add( bb );
}
}
foreach( BankBox ibb in bankBoxes )
{
int totalGold = 0;
double interest = 0;
int interestint = 0;
foreach( Item item in ibb.Items )
{
if( item is InterestBag )
{
List<Item> ItemsInBag = item.Items;
for( int z = 0; z < ItemsInBag.Count; z++ )
{
Item inBag = ItemsInBag[z];
if( inBag is InvestmentCheck )
{
interest = ((InvestmentCheck)inBag).Worth * 0.0001;
interestint = Convert.ToInt32(interest);
if (interestint >= 1)
((InvestmentCheck)inBag).Worth += interestint;
}
}
}
}
}
to-do - have some randomized events which may affect your investments! Any ideas on thematic events? Or, can also convert the investmentcheck to some kind of bond/stock that has really random returns... who knows!