Add Powerscroll to loot?

Boss

Citizen
Aug 16, 2016
43
0
6
www.kingdomofbritannia.com
Shard Name
Kingdom of Britannia
How do i add a random powerscroll, not tailor or smith to a monsters pack
if i use this it gives me an alchy scroll of 0


c.DropItem ( new PowerScroll( ) );

I am curious how i make it drop a random scroll of a random level thanks in advance!
 

PyrO

Moderator
Jan 27, 2015
1,352
195
63
Well you could use something like
Code:
c.DropItem(new PowerScroll((SkillName)(RandomImpl.Next(Enum.GetNames(typeof(SkillName)).Length)), 105 + (5 * RandomImpl.Next(4))));
or make a function inside PowerScroll or make another class called RandomPowerScroll and have it behave like RandomWand for example.
 
  • Like
Reactions: Dezzie

PyrO

Moderator
Jan 27, 2015
1,352
195
63
then you need to basically initialize the random yourself and replace it with RandomImpl
 

Dexter_Lexia

Admin
ServUO Developer
Jul 3, 2014
4,138
210
63
44
USA
Shard Name
Heritage
Donate
Donate money to this user
Or use Utility.Random(4) like every other script it the RunUO environment.
 

Dezzie

Squire
Oct 26, 2013
131
12
18
58
Shard Name
Darkness Once Forsaken
Donate
Donate money to this user
Well you could use something like
Code:
c.DropItem(new PowerScroll((SkillName)(RandomImpl.Next(Enum.GetNames(typeof(SkillName)).Length)), 105 + (5 * RandomImpl.Next(4))));
or make a function inside PowerScroll or make another class called RandomPowerScroll and have it behave like RandomWand for example.
Thanks I used this today!! It's so nice to have the forums where we can look back for answers.