commit
0c7dbccb6e
1 changed files with 6 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Server.Items
|
namespace Server.Items
|
||||||
{
|
{
|
||||||
|
|
@ -180,7 +181,7 @@ namespace Server.Items
|
||||||
|
|
||||||
private static void ApplySkillBonus( AosSkillBonuses attrs, int min, int max, int index, int low, int high )
|
private static void ApplySkillBonus( AosSkillBonuses attrs, int min, int max, int index, int low, int high )
|
||||||
{
|
{
|
||||||
SkillName[] possibleSkills = ( attrs.Owner is Spellbook ? m_PossibleSpellbookSkills : m_PossibleBonusSkills );
|
List<SkillName> possibleSkills = new List<SkillName>( attrs.Owner is Spellbook ? m_PossibleSpellbookSkills : m_PossibleBonusSkills );
|
||||||
int count = ( Core.SE ? possibleSkills.Length : possibleSkills.Length - 2 );
|
int count = ( Core.SE ? possibleSkills.Length : possibleSkills.Length - 2 );
|
||||||
|
|
||||||
SkillName sk, check;
|
SkillName sk, check;
|
||||||
|
|
@ -190,11 +191,12 @@ namespace Server.Items
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
sk = possibleSkills[Utility.Random( count )];
|
sk = possibleSkills[Utility.Random( count-- )];
|
||||||
|
possibleSkills.Remove(sk);
|
||||||
|
|
||||||
for ( int i = 0; !found && i < 5; ++i )
|
for ( int i = 0; !found && i < 5; ++i )
|
||||||
found = ( attrs.GetValues( i, out check, out bonus ) && check == sk );
|
found = ( attrs.GetValues( i, out check, out bonus ) && check == sk );
|
||||||
} while ( found );
|
} while ( found && count > 0 );
|
||||||
|
|
||||||
attrs.SetValues( index, sk, Scale( min, max, low, high ) );
|
attrs.SetValues( index, sk, Scale( min, max, low, high ) );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue