feat: Adds PlayerDeathEvent and CreatureDeathEvent using code generated events (#1927)
### Summary - Adds [Code Generated Events](https://github.com/modernuo/CodeGeneratedEvents) - Removes EventSink.PlayerDeath - Adds `PlayerDeathEvent` and `CreatureDeathEvent` using code generated events > [!Important] > **Developer Note** > Use `[OnEvent(nameof(PlayerMobile.PlayerDeathEvent))]` instead of `EventSink.PlayerDeath` delegate > Check this commit for examples of how to use this.
This commit is contained in:
parent
d5984ce058
commit
95cd8749a3
26 changed files with 191 additions and 135 deletions
|
|
@ -1,8 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using ModernUO.CodeGeneratedEvents;
|
||||
using Server.Factions;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells.Fifth;
|
||||
|
||||
namespace Server.Spells.Seventh
|
||||
|
|
@ -184,6 +186,13 @@ namespace Server.Spells.Seventh
|
|||
FinishSequence();
|
||||
}
|
||||
|
||||
[OnEvent(nameof(PlayerMobile.PlayerDeathEvent))]
|
||||
public static void OnPlayerDeathEvent(Mobile m)
|
||||
{
|
||||
StopTimer(m);
|
||||
m.EndAction<PolymorphSpell>();
|
||||
}
|
||||
|
||||
public static void StopTimer(Mobile m)
|
||||
{
|
||||
if (_table.Remove(m, out var timer))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue