Add Crown Code.

This commit is contained in:
Ottermandias 2023-12-29 00:12:14 +01:00
parent 29799094ea
commit f4dfe8e89c
3 changed files with 65 additions and 20 deletions

View file

@ -104,6 +104,14 @@ public unsafe class FunModule : IDisposable
return;
}
if (_codes.Enabled(CodeService.CodeFlag.Crown)
&& actor.OnlineStatus is OnlineStatus.PvEMentor or OnlineStatus.PvPMentor or OnlineStatus.TradeMentor
&& slot.IsEquipment())
{
armor = new CharacterArmor(6117, 1, 0);
return;
}
switch (_codes.Masked(CodeService.GearCodes))
{
case CodeService.CodeFlag.Emperor:
@ -146,6 +154,13 @@ public unsafe class FunModule : IDisposable
return;
}
if (_codes.Enabled(CodeService.CodeFlag.Crown)
&& actor.OnlineStatus is OnlineStatus.Mentor or OnlineStatus.PvEMentor or OnlineStatus.PvPMentor or OnlineStatus.TradeMentor)
{
SetCrown(armor);
return;
}
switch (_codes.Masked(CodeService.GearCodes))
{
case CodeService.CodeFlag.Emperor:
@ -203,7 +218,7 @@ public unsafe class FunModule : IDisposable
armor.Variant = item.Variant;
}
private void SetElephant(EquipSlot slot, ref CharacterArmor armor)
private static void SetElephant(EquipSlot slot, ref CharacterArmor armor)
{
armor = slot switch
{
@ -213,6 +228,16 @@ public unsafe class FunModule : IDisposable
};
}
private static void SetCrown(Span<CharacterArmor> armor)
{
var clown = new CharacterArmor(6117, 1, 0);
armor[0] = clown;
armor[1] = clown;
armor[2] = clown;
armor[3] = clown;
armor[4] = clown;
}
private void SetRace(ref CustomizeArray customize)
{
var race = _codes.GetRace();