feat: Converts OnLogin to a coded generated event (#2070)

This commit is contained in:
Kamron Batman 2025-01-17 15:21:45 -08:00 • committed by GitHub
parent 3b698de556
commit 66a257ece2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 127 additions and 122 deletions

View file

@ -64,11 +64,12 @@ public class AnimalForm : NinjaSpell
new(typeof(Reptalon), 1075202, 11669, 0, 1075222, 90.0, 0x114, 0, 0, false, false)
};
public static void OnLogin(Mobile m)
[OnEvent(nameof(PlayerMobile.PlayerLoginEvent))]
public static void OnLogin(PlayerMobile pm)
{
if (GetContext(m)?.SpeedBoost == true)
if (GetContext(pm)?.SpeedBoost == true)
{
m.NetState.SendSpeedControl(SpeedControlSetting.Mount);
pm.NetState.SendSpeedControl(SpeedControlSetting.Mount);
}
}

View file

@ -1,4 +1,6 @@
using System;
using ModernUO.CodeGeneratedEvents;
using Server.Mobiles;
using Server.Network;
namespace Server.Spells.Spellweaving
@ -27,13 +29,14 @@ namespace Server.Spells.Spellweaving
public virtual int SwingSpeedBonus => 10 + FocusLevel;
public virtual int SpellDamageBonus => 10 + FocusLevel;
public static void OnLogin(Mobile m)
[OnEvent(nameof(PlayerMobile.PlayerLoginEvent))]
public static void OnLogin(PlayerMobile pm)
{
var context = TransformationSpellHelper.GetContext(m);
var context = TransformationSpellHelper.GetContext(pm);
if (context?.Type == typeof(ReaperFormSpell))
{
m.NetState.SendSpeedControl(SpeedControlSetting.Walk);
pm.NetState.SendSpeedControl(SpeedControlSetting.Walk);
}
}