RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2.0 RC1] Economy Control System

merlyn2000

Sorceror
Economy Control System

ok guys ...

this package allows one to control the flow of gold into their shard. basically it consists of 2 scripts, and one modified distro.

to use:
place the control stone [stonegoldcounter] into your world. wherever you wish, but only the owner has access to its functions. clicking the stone will give you a complete count of gold in your world, including bankchecks, gold inside bankbox & packs, and also gold contained in creature packs or houses.

then according to your wishes, you can limit or increase the gold drops into creatures lootpacks. props the stone and change the economy modifier value. its a percentage value, 100=standard drops, 200 doubles the gold drops, 50 halves the drops etc.


to install:
drop the files into a custom folder, and rename/delete the distro file lootpack.cs. if your lootpack is modified, you may wish to include my changes in your current lootpack.cs, if so replace the Roll() function in lootpack.cs, near line 915 with this one::

Code:
		public int Roll()
		{
			int v = m_Bonus;
			double eco_Modifier = 100;
			double w;

			for ( int i = 0; i < m_Count; ++i )
				v += Utility.Random( 1, m_Sides );
	              	foreach (Item item in World.Items.Values)
                                      {
				
                                      	if (item is StoneGoldCounter)
                                 	{
             	             	StoneGoldCounter GC = (StoneGoldCounter)item;
            	              	             eco_Modifier = GC.EconomyMultiplier;
                                       }

			w = v * (eco_Modifier * .01);
			return (int)w;
		}

i also included father time's checkbook from his token system. this version of the checkbook is a gold checkbook, rather than a token checkbook. if you use his token system, you may want to delete mine, as it will probably cause errors.

now, before i post this, i'd like to thank the guys helping me with it. i can't really take any credit at all, as the biggest chunk of code was written by FingersMcsteal.

you can read my post http://www.runuo.com/forums/showthread.php?t=77755

thanx.
 

Attachments

  • economy control system.zip
    9.3 KB · Views: 759

merlyn2000

Sorceror
well, it was something that had been on my mind a good while, and was mentioned once or twice by others, so i thought id try to put something together.

its a very simple system, yet i couldnt have done it without the all you guys helping me thru. like i said before the biggest chunk of it is Finger's work.

i would like, as i learn, to make it 'automagic'. but that will come in time.

thanx again everyone,
merlyn
 

Kenny164

Sorceror
Congrats on getting this scripted and released. Gonna have to wait till later (after work) till I try it. :(

Keep us updated on the, erm... updates. :rolleyes:

Thanks! ++Karma
 

Pyro-Tech

Knight
Code:
 + Custom/Distro/Misc/LootPack.cs:
    CS0176: Line 934: Static member 'Server.Items.Economy.StoneGoldCounter.Econo
myMultiplier' cannot be accessed with an instance reference; qualify it with a t
ype name instead

got this error when installing
 

Vipre

Wanderer
i have no errors when loading up after installing but i am having a problem finding how to set the stone out can't find it any any menus
 

goldiron

Wanderer
odd

noone seems to have this prob but me so far...

Code:
The namespace 'server' already contains a definition for lootpack'
the same but instead of lookpack i also have 1) lookpackentry 2)lookpackdice 3) lootpackitem

humm why does it happen?
 

FingersMcSteal

Sorceror
Nice to see you got to release it, and i only made the stone, looks like you've done the bulk of the 'hard' work. I'll not be able to try this out since i still run a v1.0 server but good work :)
 

milvaen

Wanderer
Code:
 + Misc/LootPack.cs:
    CS0176: Line 934: Static member 'Server.Items.Economy.StoneGoldCounter.Econo
myMultiplier' cannot be accessed with an instance reference; qualify it with a t
ype name instead
 

goldiron

Wanderer
hello??

goldiron;625145 said:
noone seems to have this prob but me so far...

Code:
The namespace 'server' already contains a definition for lootpack'
the same but instead of lookpack i also have 1) lookpackentry 2)lookpackdice 3) lootpackitem

humm why does it happen?


^
I noone seemed to comment on this....:(
 

merlyn2000

Sorceror
+ Misc/LootPack.cs:
CS0176: Line 934: Static member 'Server.Items.Economy.StoneGoldCounter.Econo
myMultiplier' cannot be accessed with an instance reference; qualify it with a t
ype name instead


i THINK i need to check which version i posted ... i am trying [when i get back home] to add in code to automate the system.


as far as
The namespace 'server' already contains a definition for lootpack'

u need to either delete/rename your distro lootpack.cs or change the roll() function in your lootpack.cs to the one listed above.


thanx guys for the feedback. i hope y'all like the system.
 

Vendetta165

Wanderer
goldiron;625232 said:
but thats just it, i already got rid of the lootpack.cs and replaced it
....

Should give you the location of the Lootpack it's finding... then just goto it and delete it or make sure its not the one that came with the system. Other then that you must have the distro lootpack in the Scripts/Misc/ Directory.
 

merlyn2000

Sorceror
[i made a mistake, uploaded the wrong files ...

lootpack.cs
Code:
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Mobiles;
using System.Collections.Generic;
using Server.Network;
[COLOR="Red"]using Server.Items.Economy;[/COLOR]

namespace Server
{

remove the RED line. it isnt needed.


also ... globalCountGold.cs
Code:
using System;
using System.Text;
using Server.Items;
using Server.Network;

[COLOR="Red"]namespace Server.Items.Economy[/COLOR]
{

change namespace Server.Items.Economy to read namespace Server.Items

ill update the files in next day or so.

sorry guys.
 

Caldwerl

Wanderer
I copied the part that I need to add to my lootpack.cs, and I get this error.

Code:
Errors:
 + Misc/LootPack.cs:
    CS1513: Line 932: } expected

Where should I put the right bracket?
 

milvaen

Wanderer
Code:
Errors:
 + Misc/LootPack.cs:
    CS0176: Line 933: Static member 'Server.Items.StoneGoldCounter.EconomyMultip
lier' cannot be accessed with an instance reference; qualify it with a type name
 instead
 
Top