Revert "Updates Packets & Randomizer (#43)" (#61)

This reverts commit 179cb50557.
This commit is contained in:
Kamron Batman 2019-11-11 08:46:11 -08:00 • committed by GitHub
parent 179cb50557
commit c2ecc76457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
588 changed files with 16260 additions and 10926 deletions

View file

@ -1,5 +1,4 @@
using System;
using System.Linq;
using Server.Accounting;
using Server.Engines.VeteranRewards;
using Server.Factions;
@ -580,6 +579,7 @@ namespace Server.Items
return;
}
SkillName skill = m_Stone.Skill;
double skillValue = m_Stone.SkillValue;
Skill fromSkill = from.Skills[m_Stone.Skill];
@ -589,8 +589,27 @@ namespace Server.Items
*/
int requiredAmount = (int)(skillValue * 10) - fromSkill.BaseFixedPoint - (from.SkillsCap - from.SkillsTotal);
bool cannotAbsorb = fromSkill.Lock != SkillLock.Up || requiredAmount > 0 &&
requiredAmount > from.Skills.Where(t => t.Lock == SkillLock.Down).Sum(t => t.BaseFixedPoint);
bool cannotAbsorb = false;
if (fromSkill.Lock != SkillLock.Up)
{
cannotAbsorb = true;
}
else if (requiredAmount > 0)
{
int available = 0;
for (int i = 0; i < from.Skills.Length; ++i)
{
if (from.Skills[i].Lock != SkillLock.Down)
continue;
available += from.Skills[i].BaseFixedPoint;
}
if (requiredAmount > available)
cannotAbsorb = true;
}
if (cannotAbsorb)
{