fix: Fixes starting champion with valor (#1088)

This commit is contained in:
Kamron Batman 2022-06-21 22:43:08 -07:00 • committed by GitHub
parent 087cc15f39
commit bc2ed44440
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,8 +3,8 @@ using Server.Engines.CannedEvil;
using Server.Mobiles; using Server.Mobiles;
using Server.Targeting; using Server.Targeting;
namespace Server namespace Server;
{
public static class ValorVirtue public static class ValorVirtue
{ {
private const int LossAmount = 250; private const int LossAmount = 250;
@ -63,10 +63,7 @@ namespace Server
{ {
from.SendLocalizedMessage(1054038); // The Champion of this region has already been challenged! from.SendLocalizedMessage(1054038); // The Champion of this region has already been challenged!
} }
else else if (idol.Spawn.Active)
{
var vl = VirtueHelper.GetLevel(from, VirtueName.Valor);
if (idol.Spawn.Active)
{ {
if (idol.Spawn.Champion != null) // TODO: Message? if (idol.Spawn.Champion != null) // TODO: Message?
{ {
@ -114,15 +111,14 @@ namespace Server
from.SendLocalizedMessage(1054039); from.SendLocalizedMessage(1054039);
} }
} }
else else if (VirtueHelper.GetLevel(from, VirtueName.Valor) == VirtueLevel.Knight)
{
if (vl == VirtueLevel.Knight)
{ {
VirtueHelper.Atrophy(from, VirtueName.Valor, 11000); VirtueHelper.Atrophy(from, VirtueName.Valor, 11000);
// Your challenge is heard by the Champion of this region! Beware its wrath! // Your challenge is heard by the Champion of this region! Beware its wrath!
from.SendLocalizedMessage(1054037); from.SendLocalizedMessage(1054037);
idol.Spawn.EndRestart(); idol.Spawn.Start();
idol.Spawn.HasBeenAdvanced = true; // Uncomment to not allow advancing level after starting with valor.
// idol.Spawn.HasBeenAdvanced = true;
} }
else else
{ {
@ -130,8 +126,6 @@ namespace Server
from.SendLocalizedMessage(1054036); from.SendLocalizedMessage(1054036);
} }
} }
}
}
private class InternalTarget : Target private class InternalTarget : Target
{ {
@ -145,4 +139,3 @@ namespace Server
} }
} }
} }
}