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!

Random Scrolls

wildjoker78

Wanderer
Random Scrolls

Item scroll;
switch ( Utility.Random( 3 ) )
{
default: case 0: scroll = new EarthquakeScroll(); break;
case 1: scroll = new ResurrectionScroll(); break;
case 2: scroll = new SummonDaemonScroll(); break;
}
AddItem( scroll );

How can i make it give a random scroll of the circle of my choosing

such as a ranom eighth circle scroll?


thanks for the help,
:shock:
 

Spooky

Wanderer
Scrolls

We may be working on the same thing.

I do have a couple of ways to hand out random scrolls (I assume you are doing this to genrate creature loot). They may not be exactly what you are after but you can have a look and see when I get home and post it.

I am at work now will be home later and can post the code.
 

wildjoker78

Wanderer
Yeah Monster loot is what iam tring to do, i have 2 more stupid questions

i noticed that when u create a monster in town.. the guards wont attack them no matter how much u yell guards.. until u use the [props to turn them into criminals... and when u are out side of town.. u cant even attack them until they are criminals.. is there a way to make them criminal upon creation?

one last question.. i downloaded the AI scripts in the script summison fourm.. but when i try to use it i get the error that namespace BaseCreature cannot be found..

thanks :shock:
 

Spooky

Wanderer
Loot

Thats because you are not coding them as criminals or murder's see my post in Here on how to do this.

Its a long topic and the post is towards the end.
 

Delta

Wanderer
If you are using the current monsters in game they will attack if you are creating your own then yes do like spooky says but to let you know the AI is not complete and might undergo some changes (see the ai posts)
 

Spooky

Wanderer
Random Scrolls

This is the basic method:

[code:1] Container bag1 = new Bag();
for ( int i = 0; i < Utility.Random( 1, 3 ); ++i )
{
switch ( Utility.Random ( 8 ) )
{
case 0: bag1.DropItem( new ClumsyScroll() ); break;
case 1: bag1.DropItem( new CreateFoodScroll() ); break;
case 2: bag1.DropItem( new FeeblemindScroll() ); break;
case 3: bag1.DropItem( new HealScroll() ); break;
case 4: bag1.DropItem( new MagicArrowScroll() ); break;
case 5: bag1.DropItem( new NightSightScroll() ); break;
case 6: bag1.DropItem( new ReactiveArmorScroll() ); break;
case 7: bag1.DropItem( new WeakenScroll() ); break;
}

}

pack.DropItem( bag1 );[/code:1]

just make the random list to suit your needs and it will generate 1 to 3 scrolls of the type indicated and in a container too.

There is another method I would like to see but this will do for now until I work the bugs out of the other idea I have to make it similar to randomnames.
 
Top