Server.Items.BaseRunicTool.GetRandomSlayer C# (CSharp) Method

GetRandomSlayer() public static method

public static GetRandomSlayer ( ) : SlayerName
return SlayerName
		public static SlayerName GetRandomSlayer()
		{
			// TODO: Check random algorithm on OSI

			SlayerGroup[] groups = SlayerGroup.Groups;

			if ( groups.Length == 0 )
				return SlayerName.None;

			SlayerGroup group = groups[Utility.Random( groups.Length -1 )]; //-1 To Exclude the Fey Slayer which appears ONLY on a certain artifact.
			SlayerEntry entry;

			if ( 10 > Utility.Random( 100 ) ) // 10% chance to do super slayer
			{
				entry = group.Super;
			}
			else
			{
				SlayerEntry[] entries = group.Entries;

				if ( entries.Length == 0 )
					return SlayerName.None;

				entry = entries[Utility.Random( entries.Length )];
			}

			return entry.Name;
		}

Usage Example

Ejemplo n.º 1
0
 public Pincer()
 {
     Hue = 2500;
     Attributes.BalancedWeapon = 1;
     Slayer2 = BaseRunicTool.GetRandomSlayer();
     SetSkillBonuses.SetValues(0, SkillName.Lumberjacking, 10);
     WeaponAttributes.HitLeechHits = 87;
     Attributes.RegenStam          = 6;
     Attributes.RegenMana          = 6;
     Attributes.WeaponDamage       = 40;
 }
All Usage Examples Of Server.Items.BaseRunicTool::GetRandomSlayer