c.DropItem(new PowerScroll((SkillName)(RandomImpl.Next(Enum.GetNames(typeof(SkillName)).Length)), 105 + (5 * RandomImpl.Next(4))));
Well you could use something like
or make a function inside PowerScroll or make another class called RandomPowerScroll and have it behave like RandomWand for example.Code:c.DropItem(new PowerScroll((SkillName)(RandomImpl.Next(Enum.GetNames(typeof(SkillName)).Length)), 105 + (5 * RandomImpl.Next(4))));
Where can I fix it to have certain skills drop rather than power scrolls randomly? For example, I want to drop only Animal Taming skill power scrolls.Well you could use something like
or make a function inside PowerScroll or make another class called RandomPowerScroll and have it behave like RandomWand for example.Code:c.DropItem(new PowerScroll((SkillName)(RandomImpl.Next(Enum.GetNames(typeof(SkillName)).Length)), 105 + (5 * RandomImpl.Next(4))));
Where can I fix it to have certain skills drop rather than power scrolls randomly? For example, I want to drop only Animal Taming skill power scrolls.
public override void OnDeath(Container c)
{
base.OnDeath(c);
if (Utility.RandomDouble() < 0.05)
{
switch (Utility.Random(3))
{
case 0: c.DropItem(new PowerScroll(SkillName.AnimalTaming, 110)); break;
case 1: c.DropItem(new PowerScroll(SkillName.AnimalTaming, 110)); break;
case 2: c.DropItem(new PowerScroll(SkillName.AnimalTaming, 115)); break;
}
if (Utility.RandomDouble() < 0.025)
switch (Utility.Random(3))
{
case 0: c.DropItem(new PowerScroll(SkillName.AnimalTaming, 115)); break;
case 1: c.DropItem(new PowerScroll(SkillName.AnimalTaming, 115)); break;
case 2: c.DropItem(new PowerScroll(SkillName.AnimalTaming, 120)); break;
}
}
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.