levelup, item and synchro device fixes

This commit is contained in:
Mikhail
2024-07-07 14:45:00 -04:00
parent 1fac57b254
commit e9ff2caba2
11 changed files with 216 additions and 9 deletions

View File

@@ -122,6 +122,18 @@ namespace nksrv.Utils
MainQuestData.Add(tid, recieved);
}
}
public int GenerateUniqueItemId()
{
var num = Rng.RandomId();
while (Items.Any(x => x.Isn == num))
{
num = Rng.RandomId();
}
return num;
}
}
public class CoreInfo
{

View File

@@ -16,5 +16,10 @@ namespace nksrv.Utils
return new string(Enumerable.Repeat(chars, length)
.Select(s => s[random.Next(s.Length)]).ToArray());
}
public static int RandomId()
{
return random.Next();
}
}
}