Adds BufferReader and BufferWriter. Updates UOP handling. (#101)
This commit is contained in:
parent
2c0d97cd36
commit
038c3be258
98 changed files with 2458 additions and 2185 deletions
|
|
@ -427,9 +427,9 @@ namespace Server.Accounting
|
|||
EventSink.Login += EventSink_Login;
|
||||
}
|
||||
|
||||
private static void EventSink_Connected( ConnectedEventArgs e )
|
||||
private static void EventSink_Connected(Mobile m)
|
||||
{
|
||||
if ( !(e.Mobile.Account is Account acc) )
|
||||
if ( !(m.Account is Account acc) )
|
||||
return;
|
||||
|
||||
if ( acc.Young && acc.m_YoungTimer == null )
|
||||
|
|
@ -439,9 +439,9 @@ namespace Server.Accounting
|
|||
}
|
||||
}
|
||||
|
||||
private static void EventSink_Disconnected( DisconnectedEventArgs e )
|
||||
private static void EventSink_Disconnected(Mobile m)
|
||||
{
|
||||
if ( !(e.Mobile.Account is Account acc) )
|
||||
if ( !(m.Account is Account acc) )
|
||||
return;
|
||||
|
||||
if ( acc.m_YoungTimer != null )
|
||||
|
|
@ -450,21 +450,21 @@ namespace Server.Accounting
|
|||
acc.m_YoungTimer = null;
|
||||
}
|
||||
|
||||
if ( !(e.Mobile is PlayerMobile m) )
|
||||
if ( !(m is PlayerMobile pm) )
|
||||
return;
|
||||
|
||||
acc.m_TotalGameTime += DateTime.UtcNow - m.SessionStart;
|
||||
acc.m_TotalGameTime += DateTime.UtcNow - pm.SessionStart;
|
||||
}
|
||||
|
||||
private static void EventSink_Login( LoginEventArgs e )
|
||||
private static void EventSink_Login(Mobile m)
|
||||
{
|
||||
if ( !(e.Mobile is PlayerMobile m) )
|
||||
if ( !(m is PlayerMobile pm) )
|
||||
return;
|
||||
|
||||
if ( !(m.Account is Account acc) )
|
||||
return;
|
||||
|
||||
if ( m.Young && acc.Young )
|
||||
if ( pm.Young && acc.Young )
|
||||
{
|
||||
TimeSpan ts = YoungDuration - acc.TotalGameTime;
|
||||
int hours = Math.Max( (int) ts.TotalHours, 0 );
|
||||
|
|
|
|||
|
|
@ -191,11 +191,8 @@ namespace Server.Misc
|
|||
}
|
||||
}
|
||||
|
||||
private static void EventSink_DeleteRequest(DeleteRequestEventArgs e)
|
||||
private static void EventSink_DeleteRequest(NetState state, int index)
|
||||
{
|
||||
NetState state = e.State;
|
||||
int index = e.Index;
|
||||
|
||||
if (!(state.Account is Account acct))
|
||||
{
|
||||
state.Dispose();
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ namespace Server.Accounting
|
|||
}
|
||||
}
|
||||
|
||||
public static void Save(WorldSaveEventArgs e)
|
||||
public static void Save(bool message)
|
||||
{
|
||||
if (!Directory.Exists("Saves/Accounts"))
|
||||
Directory.CreateDirectory("Saves/Accounts");
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ namespace Server.Commands
|
|||
{
|
||||
var paramList = c.GetParameters();
|
||||
object[] args = paramList.Length == 0 ? null : new object[paramList.Length];
|
||||
Array.Fill(args, Type.Missing);
|
||||
if (args != null) Array.Fill(args, Type.Missing);
|
||||
try
|
||||
{
|
||||
from.SendMessage("Duping {0}...", m_Amount);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Commands
|
||||
{
|
||||
public class VisibilityList
|
||||
public static class VisibilityList
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
|
|
@ -16,9 +16,9 @@ namespace Server.Commands
|
|||
CommandSystem.Register("VisClear", AccessLevel.Counselor, VisClear_OnCommand);
|
||||
}
|
||||
|
||||
public static void OnLogin(LoginEventArgs e)
|
||||
public static void OnLogin(Mobile m)
|
||||
{
|
||||
if (e.Mobile is PlayerMobile pm) pm.VisibilityList.Clear();
|
||||
(m as PlayerMobile)?.VisibilityList.Clear();
|
||||
}
|
||||
|
||||
[Usage("Vis")]
|
||||
|
|
@ -138,4 +138,4 @@ namespace Server.Commands
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
namespace Server.Chat
|
||||
{
|
||||
public class ChatSystem
|
||||
public static class ChatSystem
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.ChatRequest += EventSink_ChatRequest;
|
||||
}
|
||||
|
||||
private static void EventSink_ChatRequest(ChatRequestEventArgs e)
|
||||
private static void EventSink_ChatRequest(Mobile m)
|
||||
{
|
||||
e.Mobile.SendMessage("Chat is not currently supported.");
|
||||
m.SendMessage("Chat is not currently supported.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server.Engines.PartySystem;
|
||||
using Server.Factions;
|
||||
using Server.Gumps;
|
||||
|
|
@ -160,7 +161,7 @@ namespace Server.Engines.ConPVP
|
|||
if (spell is RecallSpell)
|
||||
from.SendMessage("You may not cast this spell.");
|
||||
|
||||
string title = null;
|
||||
string title;
|
||||
string option;
|
||||
|
||||
switch (spell)
|
||||
|
|
@ -498,7 +499,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
DuelPlayer pl = Find(mob);
|
||||
|
||||
if (pl?.Eliminated == true || m_EventGame?.OnDeath(mob, corpse) == false)
|
||||
if (pl?.Eliminated != false || m_EventGame?.OnDeath(mob, corpse) == false)
|
||||
return;
|
||||
|
||||
pl.Eliminated = true;
|
||||
|
|
@ -1075,30 +1076,13 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
public static bool CheckCombat(Mobile m)
|
||||
public static bool CheckCombat(Mobile m) =>
|
||||
m.Aggressed.Any(info => info.Defender.Player && DateTime.UtcNow - info.LastCombatTime < CombatDelay) ||
|
||||
m.Aggressors.Any(info => info.Attacker.Player && DateTime.UtcNow - info.LastCombatTime < CombatDelay);
|
||||
|
||||
private static void EventSink_Login(Mobile m)
|
||||
{
|
||||
for (int i = 0; i < m.Aggressed.Count; ++i)
|
||||
{
|
||||
AggressorInfo info = m.Aggressed[i];
|
||||
|
||||
if (info.Defender.Player && DateTime.UtcNow - info.LastCombatTime < CombatDelay)
|
||||
return true;
|
||||
}
|
||||
|
||||
for (int i = 0; i < m.Aggressors.Count; ++i)
|
||||
{
|
||||
AggressorInfo info = m.Aggressors[i];
|
||||
|
||||
if (info.Attacker.Player && DateTime.UtcNow - info.LastCombatTime < CombatDelay)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void EventSink_Login(LoginEventArgs e)
|
||||
{
|
||||
if (!(e.Mobile is PlayerMobile pm))
|
||||
if (!(m is PlayerMobile pm))
|
||||
return;
|
||||
|
||||
DuelContext dc = pm.DuelContext;
|
||||
|
|
|
|||
|
|
@ -19,9 +19,8 @@ namespace Server.Engines.Doom
|
|||
EventSink.Login += OnLogin;
|
||||
}
|
||||
|
||||
public static void OnLogin(LoginEventArgs e)
|
||||
public static void OnLogin(Mobile m)
|
||||
{
|
||||
Mobile m = e.Mobile;
|
||||
Rectangle2D rect = LeverPuzzleController.lr_Rect;
|
||||
if (m.X >= rect.X && m.X <= rect.X + 10 && m.Y >= rect.Y && m.Y <= rect.Y + 10 && m.Map == Map.Internal)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -940,7 +940,7 @@ namespace Server.Factions
|
|||
int silver = killerState.Faction.AwardSilver(killer, bc.FactionSilverWorth);
|
||||
|
||||
if (silver > 0)
|
||||
killer.SendLocalizedMessage(1042748,
|
||||
killer?.SendLocalizedMessage(1042748,
|
||||
silver.ToString("N0")); // Thou hast earned ~1_AMOUNT~ silver for vanquishing the vile creature.
|
||||
}
|
||||
|
||||
|
|
@ -981,7 +981,7 @@ namespace Server.Factions
|
|||
{
|
||||
if (victimState.KillPoints <= -6)
|
||||
{
|
||||
killer.SendLocalizedMessage(501693); // This victim is not worth enough to get kill points from.
|
||||
killer?.SendLocalizedMessage(501693); // This victim is not worth enough to get kill points from.
|
||||
|
||||
#region Ethics
|
||||
|
||||
|
|
@ -1029,7 +1029,7 @@ namespace Server.Factions
|
|||
int silver = killerState.Faction.AwardSilver(killer, award * 40);
|
||||
|
||||
if (silver > 0)
|
||||
killer.SendLocalizedMessage(1042736,
|
||||
killer?.SendLocalizedMessage(1042736,
|
||||
$"{silver:N0} silver\t{victim.Name}"); // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
|
||||
}
|
||||
|
||||
|
|
@ -1038,9 +1038,9 @@ namespace Server.Factions
|
|||
|
||||
int offset = award != 1 ? 0 : 2; // for pluralization
|
||||
|
||||
string args = $"{award}\t{victim.Name}\t{killer.Name}";
|
||||
string args = $"{award}\t{victim.Name}\t{killer?.Name}";
|
||||
|
||||
killer.SendLocalizedMessage(1042737 + offset,
|
||||
killer?.SendLocalizedMessage(1042737 + offset,
|
||||
args); // Thou hast been honored with ~1_KILL_POINTS~ kill point(s) for vanquishing ~2_DEAD_PLAYER~!
|
||||
victim.SendLocalizedMessage(1042738 + offset,
|
||||
args); // Thou has lost ~1_KILL_POINTS~ kill point(s) to ~3_ATTACKER_NAME~ for being vanquished!
|
||||
|
|
@ -1072,24 +1072,19 @@ namespace Server.Factions
|
|||
}
|
||||
else
|
||||
{
|
||||
killer.SendLocalizedMessage(
|
||||
killer?.SendLocalizedMessage(
|
||||
1042231); // You have recently defeated this enemy and thus their death brings you no honor.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void EventSink_Logout(LogoutEventArgs e)
|
||||
private static void EventSink_Logout(Mobile m)
|
||||
{
|
||||
e.Mobile.Backpack?.FindItemsByType<Sigil>().ForEach(sigil => sigil.ReturnHome());
|
||||
m.Backpack?.FindItemsByType<Sigil>().ForEach(sigil => sigil.ReturnHome());
|
||||
}
|
||||
|
||||
private static void EventSink_Login(LoginEventArgs e)
|
||||
{
|
||||
Mobile mob = e.Mobile;
|
||||
|
||||
CheckLeaveTimer(mob);
|
||||
}
|
||||
private static void EventSink_Login(Mobile m) => CheckLeaveTimer(m);
|
||||
|
||||
public static void WriteReference(IGenericWriter writer, Faction fact)
|
||||
{
|
||||
|
|
@ -1102,10 +1097,7 @@ namespace Server.Factions
|
|||
{
|
||||
int idx = reader.ReadEncodedInt() - 1;
|
||||
|
||||
if (idx >= 0 && idx < Factions.Count)
|
||||
return Factions[idx];
|
||||
|
||||
return null;
|
||||
return idx >= 0 && idx < Factions.Count ? Factions[idx] : null;
|
||||
}
|
||||
|
||||
public static Faction Find(Mobile mob, bool inherit = false, bool creatureAllegiances = false)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using Server.Network;
|
|||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class Keywords
|
||||
public static class Keywords
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using Server.Engines.ConPVP;
|
||||
using Server.Factions;
|
||||
using Server.Gumps;
|
||||
|
|
@ -194,19 +195,17 @@ namespace Server.Engines.Help
|
|||
EventSink.HelpRequest += EventSink_HelpRequest;
|
||||
}
|
||||
|
||||
private static void EventSink_HelpRequest(HelpRequestEventArgs e)
|
||||
private static void EventSink_HelpRequest(Mobile m)
|
||||
{
|
||||
foreach (Gump g in e.Mobile.NetState.Gumps)
|
||||
if (g is HelpGump)
|
||||
return;
|
||||
if (m.NetState.Gumps.OfType<HelpGump>().Any()) return;
|
||||
|
||||
if (!PageQueue.CheckAllowedToPage(e.Mobile))
|
||||
if (!PageQueue.CheckAllowedToPage(m))
|
||||
return;
|
||||
|
||||
if (PageQueue.Contains(e.Mobile))
|
||||
e.Mobile.SendMenu(new ContainedMenu(e.Mobile));
|
||||
if (PageQueue.Contains(m))
|
||||
m.SendMenu(new ContainedMenu(m));
|
||||
else
|
||||
e.Mobile.SendGump(new HelpGump(e.Mobile));
|
||||
m.SendGump(new HelpGump(m));
|
||||
}
|
||||
|
||||
private static bool IsYoung(Mobile m) => m is PlayerMobile mobile && mobile.Young;
|
||||
|
|
|
|||
|
|
@ -535,9 +535,9 @@ namespace Server.Engines.MLQuests
|
|||
}
|
||||
}
|
||||
|
||||
public static void EventSink_QuestGumpRequest(QuestGumpRequestArgs args)
|
||||
public static void EventSink_QuestGumpRequest(Mobile m)
|
||||
{
|
||||
if (!Enabled || !(args.Mobile is PlayerMobile pm))
|
||||
if (!Enabled || !(m is PlayerMobile pm))
|
||||
return;
|
||||
|
||||
pm.SendGump(new QuestLogGump(pm));
|
||||
|
|
|
|||
|
|
@ -134,9 +134,8 @@ namespace Server.Engines.PartySystem
|
|||
}
|
||||
}
|
||||
|
||||
public static void EventSink_PlayerDeath(PlayerDeathEventArgs e)
|
||||
public static void EventSink_PlayerDeath(Mobile from)
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
Party p = Get(from);
|
||||
|
||||
if (p != null)
|
||||
|
|
@ -152,9 +151,8 @@ namespace Server.Engines.PartySystem
|
|||
}
|
||||
}
|
||||
|
||||
public static void EventSink_Login(LoginEventArgs e)
|
||||
public static void EventSink_Login(Mobile from)
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
Party p = Get(from);
|
||||
|
||||
if (p != null)
|
||||
|
|
@ -163,9 +161,8 @@ namespace Server.Engines.PartySystem
|
|||
from.Party = null;
|
||||
}
|
||||
|
||||
public static void EventSink_Logout(LogoutEventArgs e)
|
||||
public static void EventSink_Logout(Mobile from)
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
Party p = Get(from);
|
||||
|
||||
p?.Remove(from);
|
||||
|
|
|
|||
|
|
@ -407,10 +407,8 @@ namespace Server.Engines.Plants
|
|||
EventSink.Login += EventSink_Login;
|
||||
}
|
||||
|
||||
private static void EventSink_Login(LoginEventArgs args)
|
||||
private static void EventSink_Login(Mobile from)
|
||||
{
|
||||
Mobile from = args.Mobile;
|
||||
|
||||
from.Backpack?.FindItemsByType<PlantItem>().ForEach(plant =>
|
||||
{
|
||||
if (plant.IsGrowable)
|
||||
|
|
@ -443,7 +441,7 @@ namespace Server.Engines.Plants
|
|||
GrowAll();
|
||||
}
|
||||
|
||||
private static void EventSink_WorldSave(WorldSaveEventArgs args)
|
||||
private static void EventSink_WorldSave(bool message)
|
||||
{
|
||||
GrowAll();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ namespace Server.Engines.VeteranRewards
|
|||
if (args == null && entries[j].Args.Length == 0)
|
||||
return i + 1;
|
||||
|
||||
if (args.Length == entries[j].Args.Length)
|
||||
if (args?.Length == entries[j].Args.Length)
|
||||
{
|
||||
bool match = true;
|
||||
|
||||
|
|
@ -467,15 +467,15 @@ namespace Server.Engines.VeteranRewards
|
|||
EventSink.Login += EventSink_Login;
|
||||
}
|
||||
|
||||
private static void EventSink_Login(LoginEventArgs e)
|
||||
private static void EventSink_Login(Mobile m)
|
||||
{
|
||||
if (!e.Mobile.Alive)
|
||||
if (!m.Alive)
|
||||
return;
|
||||
|
||||
ComputeRewardInfo(e.Mobile, out int cur, out int max, out int level);
|
||||
ComputeRewardInfo(m, out int cur, out int max, out int level);
|
||||
|
||||
if (e.Mobile.SkillsCap == 7000 || e.Mobile.SkillsCap == 7050 || e.Mobile.SkillsCap == 7100 ||
|
||||
e.Mobile.SkillsCap == 7150 || e.Mobile.SkillsCap == 7200)
|
||||
if (m.SkillsCap == 7000 || m.SkillsCap == 7050 || m.SkillsCap == 7100 ||
|
||||
m.SkillsCap == 7150 || m.SkillsCap == 7200)
|
||||
{
|
||||
if (level > 4)
|
||||
level = 4;
|
||||
|
|
@ -483,19 +483,19 @@ namespace Server.Engines.VeteranRewards
|
|||
level = 0;
|
||||
|
||||
if (SkillCapRewards)
|
||||
e.Mobile.SkillsCap = 7000 + level * 50;
|
||||
m.SkillsCap = 7000 + level * 50;
|
||||
else
|
||||
e.Mobile.SkillsCap = 7000;
|
||||
m.SkillsCap = 7000;
|
||||
}
|
||||
|
||||
if (Core.ML && e.Mobile is PlayerMobile mobile && !mobile.HasStatReward && HasHalfLevel(mobile))
|
||||
if (Core.ML && m is PlayerMobile pm && !pm.HasStatReward && HasHalfLevel(pm))
|
||||
{
|
||||
mobile.HasStatReward = true;
|
||||
mobile.StatCap += 5;
|
||||
pm.HasStatReward = true;
|
||||
pm.StatCap += 5;
|
||||
}
|
||||
|
||||
if (cur < max)
|
||||
e.Mobile.SendGump(new RewardNoticeGump(e.Mobile));
|
||||
m.SendGump(new RewardNoticeGump(m));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,47 +64,41 @@ namespace Server
|
|||
m_Callbacks[gumpID] = callback;
|
||||
}
|
||||
|
||||
private static void EventSink_VirtueItemRequest(VirtueItemRequestEventArgs e)
|
||||
private static void EventSink_VirtueItemRequest(Mobile beholder, Mobile beheld, int gumpID)
|
||||
{
|
||||
if (e.Beholder != e.Beheld)
|
||||
if (beholder != beheld)
|
||||
return;
|
||||
|
||||
e.Beholder.CloseGump<VirtueGump>();
|
||||
beholder.CloseGump<VirtueGump>();
|
||||
|
||||
if (e.Beholder.Kills >= 5)
|
||||
if (beholder.Kills >= 5)
|
||||
{
|
||||
e.Beholder.SendLocalizedMessage(1049609); // Murderers cannot invoke this virtue.
|
||||
beholder.SendLocalizedMessage(1049609); // Murderers cannot invoke this virtue.
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_Callbacks.TryGetValue(e.GumpID, out OnVirtueUsed callback))
|
||||
callback(e.Beholder);
|
||||
if (m_Callbacks.TryGetValue(gumpID, out OnVirtueUsed callback))
|
||||
callback(beholder);
|
||||
else
|
||||
e.Beholder.SendLocalizedMessage(1052066); // That virtue is not active yet.
|
||||
beholder.SendLocalizedMessage(1052066); // That virtue is not active yet.
|
||||
}
|
||||
|
||||
|
||||
private static void EventSink_VirtueMacroRequest(VirtueMacroRequestEventArgs e)
|
||||
private static void EventSink_VirtueMacroRequest(Mobile beholder, int virtue)
|
||||
{
|
||||
var virtueID = e.VirtueID switch
|
||||
var virtueID = virtue switch
|
||||
{
|
||||
0 => // Honor
|
||||
107,
|
||||
1 => // Sacrifice
|
||||
110,
|
||||
2 => // Valor;
|
||||
112,
|
||||
0 => 107, // Honor
|
||||
1 => 110, // Sacrifice
|
||||
2 => 112, // Valor;
|
||||
_ => 0
|
||||
};
|
||||
|
||||
EventSink_VirtueItemRequest(new VirtueItemRequestEventArgs(e.Mobile, e.Mobile, virtueID));
|
||||
EventSink_VirtueItemRequest(beholder, beholder, virtueID);
|
||||
}
|
||||
|
||||
private static void EventSink_VirtueGumpRequest(VirtueGumpRequestEventArgs e)
|
||||
private static void EventSink_VirtueGumpRequest(Mobile beholder, Mobile beheld)
|
||||
{
|
||||
Mobile beholder = e.Beholder;
|
||||
Mobile beheld = e.Beheld;
|
||||
|
||||
if (beholder == beheld && beholder.Kills >= 5)
|
||||
{
|
||||
beholder.SendLocalizedMessage(1049609); // Murderers cannot invoke this virtue.
|
||||
|
|
|
|||
|
|
@ -17,10 +17,8 @@ namespace Server.Gumps
|
|||
EventSink.PlayerDeath += EventSink_PlayerDeath;
|
||||
}
|
||||
|
||||
public static void EventSink_PlayerDeath( PlayerDeathEventArgs e )
|
||||
public static void EventSink_PlayerDeath(Mobile m)
|
||||
{
|
||||
Mobile m = e.Mobile;
|
||||
|
||||
List<Mobile> killers = new List<Mobile>();
|
||||
List<Mobile> toGive = new List<Mobile>();
|
||||
|
||||
|
|
@ -46,7 +44,7 @@ namespace Server.Gumps
|
|||
{
|
||||
int n = Notoriety.Compute( g, m );
|
||||
|
||||
int theirKarma = m.Karma, ourKarma = g.Karma;
|
||||
int ourKarma = g.Karma;
|
||||
bool innocent = n == Notoriety.Innocent;
|
||||
bool criminal = n == Notoriety.Criminal || n == Notoriety.Murderer;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Engines.Events
|
||||
{
|
||||
public class TrickOrTreat
|
||||
public static class TrickOrTreat
|
||||
{
|
||||
public static TimeSpan OneSecond = TimeSpan.FromSeconds(1);
|
||||
|
||||
|
|
|
|||
|
|
@ -64,10 +64,10 @@ namespace Server.Engines.Events
|
|||
}
|
||||
}
|
||||
|
||||
public static void EventSink_PlayerDeath( PlayerDeathEventArgs e )
|
||||
public static void EventSink_PlayerDeath(Mobile m)
|
||||
{
|
||||
if ( e.Mobile is PlayerMobile player && !player.Deleted && m_Timer.Running && !m_DeathQueue.Contains( player ) && m_DeathQueue.Count < m_DeathQueueLimit )
|
||||
m_DeathQueue.Add( player );
|
||||
if (m is PlayerMobile pm && !pm.Deleted && m_Timer.Running && !m_DeathQueue.Contains(pm) && m_DeathQueue.Count < m_DeathQueueLimit)
|
||||
m_DeathQueue.Add(pm);
|
||||
}
|
||||
|
||||
private static void Clear_Callback()
|
||||
|
|
|
|||
|
|
@ -215,61 +215,58 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
private static void EventSink_OpenDoorMacroUsed(OpenDoorMacroEventArgs args)
|
||||
private static void EventSink_OpenDoorMacroUsed(Mobile m)
|
||||
{
|
||||
Mobile m = args.Mobile;
|
||||
if (m.Map == null) return;
|
||||
|
||||
if (m.Map != null)
|
||||
int x = m.X, y = m.Y;
|
||||
|
||||
switch (m.Direction & Direction.Mask)
|
||||
{
|
||||
int x = m.X, y = m.Y;
|
||||
|
||||
switch (m.Direction & Direction.Mask)
|
||||
{
|
||||
case Direction.North:
|
||||
--y;
|
||||
break;
|
||||
case Direction.Right:
|
||||
++x;
|
||||
--y;
|
||||
break;
|
||||
case Direction.East:
|
||||
++x;
|
||||
break;
|
||||
case Direction.Down:
|
||||
++x;
|
||||
++y;
|
||||
break;
|
||||
case Direction.South:
|
||||
++y;
|
||||
break;
|
||||
case Direction.Left:
|
||||
--x;
|
||||
++y;
|
||||
break;
|
||||
case Direction.West:
|
||||
--x;
|
||||
break;
|
||||
case Direction.Up:
|
||||
--x;
|
||||
--y;
|
||||
break;
|
||||
}
|
||||
|
||||
Sector sector = m.Map.GetSector(x, y);
|
||||
|
||||
foreach (Item item in sector.Items)
|
||||
if (item.Location.X == x && item.Location.Y == y && item.Z + item.ItemData.Height > m.Z &&
|
||||
m.Z + 16 > item.Z && item is BaseDoor && m.CanSee(item) && m.InLOS(item))
|
||||
{
|
||||
if (m.CheckAlive())
|
||||
{
|
||||
m.SendLocalizedMessage(500024); // Opening door...
|
||||
item.OnDoubleClick(m);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case Direction.North:
|
||||
--y;
|
||||
break;
|
||||
case Direction.Right:
|
||||
++x;
|
||||
--y;
|
||||
break;
|
||||
case Direction.East:
|
||||
++x;
|
||||
break;
|
||||
case Direction.Down:
|
||||
++x;
|
||||
++y;
|
||||
break;
|
||||
case Direction.South:
|
||||
++y;
|
||||
break;
|
||||
case Direction.Left:
|
||||
--x;
|
||||
++y;
|
||||
break;
|
||||
case Direction.West:
|
||||
--x;
|
||||
break;
|
||||
case Direction.Up:
|
||||
--x;
|
||||
--y;
|
||||
break;
|
||||
}
|
||||
|
||||
Sector sector = m.Map.GetSector(x, y);
|
||||
|
||||
foreach (Item item in sector.Items)
|
||||
if (item.Location.X == x && item.Location.Y == y && item.Z + item.ItemData.Height > m.Z &&
|
||||
m.Z + 16 > item.Z && item is BaseDoor && m.CanSee(item) && m.InLOS(item))
|
||||
{
|
||||
if (m.CheckAlive())
|
||||
{
|
||||
m.SendLocalizedMessage(500024); // Opening door...
|
||||
item.OnDoubleClick(m);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static Point3D GetOffset(DoorFacing facing) => m_Offsets[(int)facing];
|
||||
|
|
|
|||
|
|
@ -1048,9 +1048,9 @@ namespace Server.Items
|
|||
EventSink.Login += EventSink_Login;
|
||||
}
|
||||
|
||||
private static void EventSink_Login(LoginEventArgs e)
|
||||
private static void EventSink_Login(Mobile m)
|
||||
{
|
||||
CheckHeaveTimer(e.Mobile);
|
||||
CheckHeaveTimer(m);
|
||||
}
|
||||
|
||||
public static void CheckHeaveTimer(Mobile from)
|
||||
|
|
|
|||
|
|
@ -193,16 +193,7 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public virtual bool InstancedCorpse
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!Core.SE)
|
||||
return false;
|
||||
|
||||
return DateTime.UtcNow < TimeOfDeath + InstancedCorpseTime;
|
||||
}
|
||||
}
|
||||
public virtual bool InstancedCorpse => Core.SE && DateTime.UtcNow < TimeOfDeath + InstancedCorpseTime;
|
||||
|
||||
public override bool IsDecoContainer => false;
|
||||
|
||||
|
|
|
|||
|
|
@ -630,10 +630,8 @@ namespace Server.Items
|
|||
EventSink.Logout += EventSink_Logout;
|
||||
}
|
||||
|
||||
public static void EventSink_Logout(LogoutEventArgs e)
|
||||
public static void EventSink_Logout(Mobile from)
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
if (from == null || !m_Table.TryGetValue(from, out TeleportingInfo info))
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -245,6 +245,7 @@ namespace Server.Items
|
|||
{
|
||||
EventSink.OpenSpellbookRequest += EventSink_OpenSpellbookRequest;
|
||||
EventSink.CastSpellRequest += EventSink_CastSpellRequest;
|
||||
EventSink.TargetedSpell += EventSink_TargetedSpell;
|
||||
|
||||
CommandSystem.Register("AllSpells", AccessLevel.GameMaster, AllSpells_OnCommand);
|
||||
}
|
||||
|
|
@ -278,14 +279,12 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
private static void EventSink_OpenSpellbookRequest(OpenSpellbookRequestEventArgs e)
|
||||
private static void EventSink_OpenSpellbookRequest(Mobile from, int typeID)
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
if (!DesignContext.Check(from))
|
||||
return; // They are customizing
|
||||
|
||||
var type = e.Type switch
|
||||
var type = typeID switch
|
||||
{
|
||||
1 => SpellbookType.Regular,
|
||||
2 => SpellbookType.Necromancer,
|
||||
|
|
@ -302,15 +301,32 @@ namespace Server.Items
|
|||
book?.DisplayTo(from);
|
||||
}
|
||||
|
||||
private static void EventSink_CastSpellRequest(CastSpellRequestEventArgs e)
|
||||
private static void EventSink_TargetedSpell(Mobile from, IEntity target, int spellId)
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
if (!DesignContext.Check(from)) return; // They are customizing
|
||||
|
||||
Spellbook book = Find(from, spellId);
|
||||
|
||||
if (book?.HasSpell(spellId) != true)
|
||||
{
|
||||
from.SendLocalizedMessage(500015); // You do not have that spell!
|
||||
return;
|
||||
}
|
||||
|
||||
SpecialMove move = SpellRegistry.GetSpecialMove(spellId);
|
||||
|
||||
if (move != null)
|
||||
SpecialMove.SetCurrentMove(from, move);
|
||||
else
|
||||
SpellRegistry.NewSpell(spellId, @from, null)?.Cast();
|
||||
}
|
||||
|
||||
private static void EventSink_CastSpellRequest(Mobile from, int spellID, Item item)
|
||||
{
|
||||
if (!DesignContext.Check(from))
|
||||
return; // They are customizing
|
||||
|
||||
Spellbook book = e.Spellbook as Spellbook;
|
||||
int spellID = e.SpellID;
|
||||
Spellbook book = item as Spellbook;
|
||||
|
||||
if (book?.HasSpell(spellID) != true)
|
||||
book = Find(from, spellID);
|
||||
|
|
@ -688,7 +704,7 @@ namespace Server.Items
|
|||
if ((prop = Attributes.RegenMana) != 0)
|
||||
list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~
|
||||
|
||||
if ((prop = Attributes.NightSight) != 0)
|
||||
if ((Attributes.NightSight) != 0)
|
||||
list.Add(1060441); // night sight
|
||||
|
||||
if ((prop = Attributes.ReflectPhysical) != 0)
|
||||
|
|
@ -700,7 +716,7 @@ namespace Server.Items
|
|||
if ((prop = Attributes.RegenHits) != 0)
|
||||
list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
|
||||
|
||||
if ((prop = Attributes.SpellChanneling) != 0)
|
||||
if ((Attributes.SpellChanneling) != 0)
|
||||
list.Add(1060482); // spell channeling
|
||||
|
||||
if ((prop = Attributes.SpellDamage) != 0)
|
||||
|
|
|
|||
|
|
@ -70,30 +70,27 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
private static void EventSink_BandageTargetRequest(BandageTargetRequestEventArgs e)
|
||||
private static void EventSink_BandageTargetRequest(Mobile from, Item item, Mobile target)
|
||||
{
|
||||
if (!(e.Bandage is Bandage b) || b.Deleted)
|
||||
if (!(item is Bandage b) || b.Deleted)
|
||||
return;
|
||||
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
if (from.InRange(b.GetWorldLocation(), Range))
|
||||
{
|
||||
if (from.Target != null)
|
||||
{
|
||||
Target.Cancel(from);
|
||||
from.Target = null;
|
||||
}
|
||||
|
||||
from.RevealingAction();
|
||||
from.SendLocalizedMessage(500948); // Who will you use the bandages on?
|
||||
|
||||
new InternalTarget(b).Invoke(from, e.Target);
|
||||
}
|
||||
else
|
||||
if (!from.InRange(b.GetWorldLocation(), Range))
|
||||
{
|
||||
from.SendLocalizedMessage(500295); // You are too far away to do that.
|
||||
return;
|
||||
}
|
||||
|
||||
if (from.Target != null)
|
||||
{
|
||||
Target.Cancel(from);
|
||||
from.Target = null;
|
||||
}
|
||||
|
||||
from.RevealingAction();
|
||||
from.SendLocalizedMessage(500948); // Who will you use the bandages on?
|
||||
|
||||
new InternalTarget(b).Invoke(from, target);
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
|
|
@ -203,7 +200,7 @@ namespace Server.Items
|
|||
{
|
||||
StopHeal();
|
||||
|
||||
int healerNumber = -1, patientNumber = -1;
|
||||
int healerNumber, patientNumber;
|
||||
bool playSound = true;
|
||||
bool checkSkills = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -389,14 +389,12 @@ namespace Server.Items
|
|||
EventSink.SetAbility += EventSink_SetAbility;
|
||||
}
|
||||
|
||||
private static void EventSink_SetAbility(SetAbilityEventArgs e)
|
||||
private static void EventSink_SetAbility(Mobile m, int index)
|
||||
{
|
||||
int index = e.Index;
|
||||
|
||||
if (index == 0)
|
||||
ClearCurrentAbility(e.Mobile);
|
||||
ClearCurrentAbility(m);
|
||||
else if (index >= 1 && index < Abilities.Length)
|
||||
SetCurrentAbility(e.Mobile, Abilities[index]);
|
||||
SetCurrentAbility(m, Abilities[index]);
|
||||
}
|
||||
|
||||
private static void AddContext(Mobile m, WeaponAbilityContext context)
|
||||
|
|
|
|||
|
|
@ -216,13 +216,11 @@ namespace Server.Items
|
|||
return (item == null || item is Spellbook) && m.FindItemOnLayer(Layer.TwoHanded) == null;
|
||||
}
|
||||
|
||||
private static void EventSink_DisarmRequest(DisarmRequestEventArgs e)
|
||||
private static void EventSink_DisarmRequest(Mobile m)
|
||||
{
|
||||
if (Core.AOS)
|
||||
return;
|
||||
|
||||
Mobile m = e.Mobile;
|
||||
|
||||
#region Dueling
|
||||
|
||||
if (!DuelContext.AllowSpecialAbility(m, "Disarm", true))
|
||||
|
|
@ -251,13 +249,11 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
private static void EventSink_StunRequest(StunRequestEventArgs e)
|
||||
private static void EventSink_StunRequest(Mobile m)
|
||||
{
|
||||
if (Core.AOS)
|
||||
return;
|
||||
|
||||
Mobile m = e.Mobile;
|
||||
|
||||
#region Dueling
|
||||
|
||||
if (!DuelContext.AllowSpecialAbility(m, "Stun", true))
|
||||
|
|
|
|||
|
|
@ -1,31 +1,23 @@
|
|||
namespace Server.Misc
|
||||
{
|
||||
public class Animations
|
||||
public static class Animations
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.AnimateRequest += EventSink_AnimateRequest;
|
||||
}
|
||||
|
||||
private static void EventSink_AnimateRequest(AnimateRequestEventArgs e)
|
||||
private static void EventSink_AnimateRequest(Mobile from, string actionName)
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
int action;
|
||||
|
||||
switch (e.Action)
|
||||
int action = actionName switch
|
||||
{
|
||||
case "bow":
|
||||
action = 32;
|
||||
break;
|
||||
case "salute":
|
||||
action = 33;
|
||||
break;
|
||||
default: return;
|
||||
}
|
||||
"bow" => 32,
|
||||
"salute" => 33,
|
||||
_ => 0,
|
||||
};
|
||||
|
||||
if (from.Alive && !from.Mounted && from.Body.IsHuman)
|
||||
if (action > 0 && from.Alive && !from.Mounted && from.Body.IsHuman)
|
||||
from.Animate(action, 5, 1, true, false, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,4 +59,4 @@ namespace Server.Misc
|
|||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
namespace Server.Misc
|
||||
{
|
||||
public class Broadcasts
|
||||
public static class Broadcasts
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.Crashed += EventSink_Crashed;
|
||||
EventSink.ServerCrashed += EventSink_Crashed;
|
||||
EventSink.Shutdown += EventSink_Shutdown;
|
||||
}
|
||||
|
||||
public static void EventSink_Crashed(CrashedEventArgs e)
|
||||
public static void EventSink_Crashed(ServerCrashedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -20,16 +20,16 @@ namespace Server.Misc
|
|||
}
|
||||
}
|
||||
|
||||
public static void EventSink_Shutdown(ShutdownEventArgs e)
|
||||
public static void EventSink_Shutdown()
|
||||
{
|
||||
/* try
|
||||
{
|
||||
World.Broadcast(0x35, true, "The server has shut down.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}*/
|
||||
/* try
|
||||
{
|
||||
World.Broadcast(0x35, true, "The server has shut down.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,11 +11,13 @@ namespace Server
|
|||
public static void Initialize()
|
||||
{
|
||||
if (Enabled)
|
||||
EventSink.ClientVersionReceived += delegate(ClientVersionReceivedArgs args)
|
||||
{
|
||||
if (args.State.Mobile is PlayerMobile pm)
|
||||
Timer.DelayCall(TimeSpan.Zero, pm.ResendBuffs);
|
||||
};
|
||||
EventSink.ClientVersionReceived += ResendBuffsOnClientVersionReceived;
|
||||
}
|
||||
|
||||
public static void ResendBuffsOnClientVersionReceived(NetState ns, ClientVersion cv)
|
||||
{
|
||||
if (ns.Mobile is PlayerMobile pm)
|
||||
Timer.DelayCall(TimeSpan.Zero, pm.ResendBuffs);
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
|
@ -284,4 +286,4 @@ namespace Server
|
|||
m_Stream.Fill(4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1164,7 +1164,7 @@ namespace Server.Misc
|
|||
if (m_Mobile?.EquipItem(item) == true)
|
||||
return;
|
||||
|
||||
Container pack = m_Mobile.Backpack;
|
||||
Container pack = m_Mobile?.Backpack;
|
||||
|
||||
if (!mustEquip && pack != null)
|
||||
pack.DropItem(item);
|
||||
|
|
|
|||
|
|
@ -56,13 +56,11 @@ namespace Server.Misc
|
|||
}
|
||||
}
|
||||
|
||||
private static void EventSink_ClientVersionReceived(ClientVersionReceivedArgs e)
|
||||
private static void EventSink_ClientVersionReceived(NetState state, ClientVersion version)
|
||||
{
|
||||
string kickMessage = null;
|
||||
NetState state = e.State;
|
||||
ClientVersion version = e.Version;
|
||||
|
||||
if (state.Mobile == null || state.Mobile.AccessLevel > AccessLevel.Player)
|
||||
if (state.Mobile?.AccessLevel != AccessLevel.Player)
|
||||
return;
|
||||
|
||||
if (Required != null && version < Required && (m_OldClientResponse == OldClientResponse.Kick ||
|
||||
|
|
|
|||
|
|
@ -7,20 +7,20 @@ using Server.Network;
|
|||
|
||||
namespace Server.Misc
|
||||
{
|
||||
public class CrashGuard
|
||||
public static class CrashGuard
|
||||
{
|
||||
private static bool Enabled = true;
|
||||
private static bool SaveBackup = true;
|
||||
private static bool RestartServer = true;
|
||||
private static bool GenerateReport = true;
|
||||
private static readonly bool Enabled = true;
|
||||
private static readonly bool SaveBackup = true;
|
||||
private static readonly bool RestartServer = true;
|
||||
private static readonly bool GenerateReport = true;
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
if (Enabled) // If enabled, register our crash event handler
|
||||
EventSink.Crashed += CrashGuard_OnCrash;
|
||||
EventSink.ServerCrashed += CrashGuard_OnCrash;
|
||||
}
|
||||
|
||||
public static void CrashGuard_OnCrash(CrashedEventArgs e)
|
||||
public static void CrashGuard_OnCrash(ServerCrashedEventArgs e)
|
||||
{
|
||||
if (GenerateReport)
|
||||
GenerateCrashReport(e);
|
||||
|
|
@ -61,7 +61,7 @@ namespace Server.Misc
|
|||
|
||||
private static string Combine(string path1, string path2) => path1.Length == 0 ? path2 : Path.Combine(path1, path2);
|
||||
|
||||
private static void Restart(CrashedEventArgs e)
|
||||
private static void Restart(ServerCrashedEventArgs e)
|
||||
{
|
||||
string root = GetRoot();
|
||||
|
||||
|
|
@ -152,7 +152,7 @@ namespace Server.Misc
|
|||
}
|
||||
}
|
||||
|
||||
private static void GenerateCrashReport(CrashedEventArgs e)
|
||||
private static void GenerateCrashReport(ServerCrashedEventArgs e)
|
||||
{
|
||||
Console.Write("Crash: Generating report...");
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ namespace Server.Misc
|
|||
{
|
||||
// This fastwalk detection is no longer required
|
||||
// As of B36 PlayerMobile implements movement packet throttling which more reliably controls movement speeds
|
||||
public class Fastwalk
|
||||
public static class Fastwalk
|
||||
{
|
||||
private static int MaxSteps = 4; // Maximum number of queued steps until fastwalk is detected
|
||||
private static bool Enabled = false; // Is fastwalk detection enabled?
|
||||
|
|
@ -30,4 +30,4 @@ namespace Server.Misc
|
|||
Console.WriteLine("Client: {0}: Fast movement detected (name={1})", e.NetState, e.NetState.Mobile.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -484,9 +484,7 @@ namespace Server.Guilds
|
|||
|
||||
public class WarTimer : Timer
|
||||
{
|
||||
private static TimeSpan InternalDelay = TimeSpan.FromMinutes(1.0);
|
||||
|
||||
public WarTimer() : base(InternalDelay, InternalDelay) => Priority = TimerPriority.FiveSeconds;
|
||||
public WarTimer() : base(TimeSpan.FromMinutes(1.0), TimeSpan.FromMinutes(1.0)) => Priority = TimerPriority.FiveSeconds;
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
|
|
@ -718,7 +716,7 @@ namespace Server.Guilds
|
|||
|
||||
if (o is Guildstone stone)
|
||||
{
|
||||
if (stone?.Guild.Disbanded != false)
|
||||
if (stone.Guild.Disbanded)
|
||||
{
|
||||
from.SendMessage("The guild associated with that Guildstone no longer exists");
|
||||
return;
|
||||
|
|
@ -748,9 +746,9 @@ namespace Server.Guilds
|
|||
|
||||
#region EventSinks
|
||||
|
||||
public static void EventSink_GuildGumpRequest(GuildGumpRequestArgs args)
|
||||
public static void EventSink_GuildGumpRequest(Mobile m)
|
||||
{
|
||||
if (!NewGuildSystem || !(args.Mobile is PlayerMobile pm))
|
||||
if (!NewGuildSystem || !(m is PlayerMobile pm))
|
||||
return;
|
||||
|
||||
if (pm.Guild == null)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using Server.Mobiles;
|
|||
|
||||
namespace Server.Misc
|
||||
{
|
||||
public class Keywords
|
||||
public static class Keywords
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
|
|
@ -51,4 +51,4 @@ namespace Server.Misc
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,10 +54,8 @@ namespace Server
|
|||
}
|
||||
}
|
||||
|
||||
public static void OnLogin(LoginEventArgs args)
|
||||
public static void OnLogin(Mobile m)
|
||||
{
|
||||
Mobile m = args.Mobile;
|
||||
|
||||
m.CheckLightLevels(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,17 +10,15 @@ namespace Server.Misc
|
|||
EventSink.Login += EventSink_Login;
|
||||
}
|
||||
|
||||
private static void EventSink_Login(LoginEventArgs args)
|
||||
private static void EventSink_Login(Mobile m)
|
||||
{
|
||||
int userCount = TcpServer.Instances.Count;
|
||||
int itemCount = World.Items.Count;
|
||||
int mobileCount = World.Mobiles.Count;
|
||||
|
||||
Mobile m = args.Mobile;
|
||||
|
||||
m.SendMessage(
|
||||
"Welcome, {0}! There {1} currently {2} user{3} online, with {4} item{5} and {6} mobile{7} in the world.",
|
||||
args.Mobile.Name,
|
||||
m.Name,
|
||||
userCount == 1 ? "is" : "are",
|
||||
userCount, userCount == 1 ? "" : "s",
|
||||
itemCount, itemCount == 1 ? "" : "s",
|
||||
|
|
|
|||
|
|
@ -3,18 +3,15 @@ using Server.Network;
|
|||
|
||||
namespace Server.Misc
|
||||
{
|
||||
public class Paperdoll
|
||||
public static class Paperdoll
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.PaperdollRequest += EventSink_PaperdollRequest;
|
||||
}
|
||||
|
||||
public static void EventSink_PaperdollRequest(PaperdollRequestEventArgs e)
|
||||
public static void EventSink_PaperdollRequest(Mobile beholder, Mobile beheld)
|
||||
{
|
||||
Mobile beholder = e.Beholder;
|
||||
Mobile beheld = e.Beheld;
|
||||
|
||||
beholder.Send(new DisplayPaperdoll(beheld, Titles.ComputeTitle(beholder, beheld),
|
||||
beheld.AllowEquipFrom(beholder)));
|
||||
|
||||
|
|
@ -30,4 +27,4 @@ namespace Server.Misc
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace Server.Misc
|
|||
Other // some other implementation
|
||||
}
|
||||
|
||||
public class ProfanityProtection
|
||||
public static class ProfanityProtection
|
||||
{
|
||||
private static bool Enabled = false;
|
||||
|
||||
|
|
@ -118,4 +118,4 @@ namespace Server.Misc
|
|||
e.Blocked = !OnProfanityDetected(from, e.Speech);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using Server.Network;
|
|||
|
||||
namespace Server.Misc
|
||||
{
|
||||
public class Profile
|
||||
public static class Profile
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
|
|
@ -12,21 +12,16 @@ namespace Server.Misc
|
|||
EventSink.ChangeProfileRequest += EventSink_ChangeProfileRequest;
|
||||
}
|
||||
|
||||
public static void EventSink_ChangeProfileRequest(ChangeProfileRequestEventArgs e)
|
||||
public static void EventSink_ChangeProfileRequest(Mobile beholder, Mobile beheld, string text)
|
||||
{
|
||||
Mobile from = e.Beholder;
|
||||
|
||||
if (from.ProfileLocked)
|
||||
from.SendMessage("Your profile is locked. You may not change it.");
|
||||
if (beholder.ProfileLocked)
|
||||
beholder.SendMessage("Your profile is locked. You may not change it.");
|
||||
else
|
||||
from.Profile = e.Text;
|
||||
beholder.Profile = text;
|
||||
}
|
||||
|
||||
public static void EventSink_ProfileRequest(ProfileRequestEventArgs e)
|
||||
public static void EventSink_ProfileRequest(Mobile beholder, Mobile beheld)
|
||||
{
|
||||
Mobile beholder = e.Beholder;
|
||||
Mobile beheld = e.Beheld;
|
||||
|
||||
if (!beheld.Player)
|
||||
return;
|
||||
|
||||
|
|
@ -48,10 +43,7 @@ namespace Server.Misc
|
|||
if (footer.Length == 0 && beholder == beheld)
|
||||
footer = GetAccountDuration(beheld);
|
||||
|
||||
string body = beheld.Profile;
|
||||
|
||||
if (body == null || body.Length <= 0)
|
||||
body = "";
|
||||
string body = beheld.Profile ?? "";
|
||||
|
||||
beholder.Send(new DisplayProfile(beholder != beheld || !beheld.ProfileLocked, beheld, header, body, footer));
|
||||
}
|
||||
|
|
@ -90,4 +82,4 @@ namespace Server.Misc
|
|||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,14 @@
|
|||
namespace Server.Misc
|
||||
{
|
||||
public class RenameRequests
|
||||
public static class RenameRequests
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.RenameRequest += EventSink_RenameRequest;
|
||||
}
|
||||
|
||||
private static void EventSink_RenameRequest(RenameRequestEventArgs e)
|
||||
private static void EventSink_RenameRequest(Mobile from, Mobile targ, string name)
|
||||
{
|
||||
Mobile from = e.From;
|
||||
Mobile targ = e.Target;
|
||||
string name = e.Name;
|
||||
|
||||
if (from.CanSee(targ) && from.InRange(targ, 12) && targ.CanBeRenamedBy(from))
|
||||
{
|
||||
name = name.Trim();
|
||||
|
|
@ -44,4 +40,4 @@ namespace Server.Misc
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,12 +142,12 @@ namespace Server.Misc
|
|||
EventSink.Login += EventSink_Login;
|
||||
}
|
||||
|
||||
private static void EventSink_Login(LoginEventArgs e)
|
||||
private static void EventSink_Login(Mobile m)
|
||||
{
|
||||
if (m_ActivePollers.Count == 0)
|
||||
return;
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.0), EventSink_Login_Callback, e.Mobile);
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.0), EventSink_Login_Callback, m);
|
||||
}
|
||||
|
||||
private static void EventSink_Login_Callback(Mobile from)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace Server.Misc
|
|||
PainSpike
|
||||
}
|
||||
|
||||
public class WeightOverloading
|
||||
public static class WeightOverloading
|
||||
{
|
||||
public const int OverloadAllowance = 4; // We can be four stones overweight without getting fatigued
|
||||
|
||||
|
|
@ -117,4 +117,4 @@ namespace Server.Misc
|
|||
return Mobile.BodyWeight + m.TotalWeight > GetMaxWeight(m) + OverloadAllowance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -632,7 +632,7 @@ namespace Server.Mobiles
|
|||
|
||||
if (!Core.AOS && SmartAI && !m_Mobile.StunReady && m_Mobile.Skills.Wrestling.Value >= 80.0 &&
|
||||
m_Mobile.Skills.Anatomy.Value >= 80.0)
|
||||
EventSink.InvokeStunRequest(new StunRequestEventArgs(m_Mobile));
|
||||
EventSink.InvokeStunRequest(m_Mobile);
|
||||
|
||||
if (!m_Mobile.InRange(c, m_Mobile.RangePerception))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ namespace Server.Mobiles
|
|||
|
||||
if (!Core.AOS && !m_Mobile.DisarmReady && m_Mobile.Skills.Wrestling.Value >= 80.0 &&
|
||||
m_Mobile.Skills.ArmsLore.Value >= 80.0 && m_toDisarm != null)
|
||||
EventSink.InvokeDisarmRequest(new DisarmRequestEventArgs(m_Mobile));
|
||||
EventSink.InvokeDisarmRequest(m_Mobile);
|
||||
|
||||
if (m_toDisarm?.IsChildOf(combatant.Backpack) == true &&
|
||||
Core.TickCount - m_Mobile.NextSkillTime >= 0 && m_toDisarm.LootType != LootType.Blessed &&
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Mobiles
|
||||
|
|
@ -71,21 +72,16 @@ namespace Server.Mobiles
|
|||
EventSink.PlayerDeath += EventSink_PlayerDeath;
|
||||
}
|
||||
|
||||
public static void EventSink_PlayerDeath(PlayerDeathEventArgs e)
|
||||
public static void EventSink_PlayerDeath(Mobile m)
|
||||
{
|
||||
Mobile m = e.Mobile;
|
||||
Mobile lastKiller = m.LastKiller;
|
||||
|
||||
if (lastKiller is BaseCreature creature)
|
||||
lastKiller = creature.GetMaster();
|
||||
|
||||
if (IsInsideKhaldun(m) && IsInsideKhaldun(lastKiller) && lastKiller.Player && !m_Set.Contains(lastKiller))
|
||||
foreach (AggressorInfo ai in m.Aggressors)
|
||||
if (ai.Attacker == lastKiller && ai.CanReportMurder)
|
||||
{
|
||||
SummonRevenant(m, lastKiller);
|
||||
break;
|
||||
}
|
||||
if (IsInsideKhaldun(m) && IsInsideKhaldun(lastKiller) && lastKiller.Player && !m_Set.Contains(lastKiller) &&
|
||||
m.Aggressors.Any(ai => ai.Attacker == lastKiller && ai.CanReportMurder))
|
||||
SummonRevenant(m, lastKiller);
|
||||
}
|
||||
|
||||
public static void SummonRevenant(Mobile victim, Mobile killer)
|
||||
|
|
|
|||
|
|
@ -543,9 +543,76 @@ namespace Server.Mobiles
|
|||
EventSink.Connected += EventSink_Connected;
|
||||
EventSink.Disconnected += EventSink_Disconnected;
|
||||
|
||||
EventSink.TargetedSkillUse += TargetedSkillUse;
|
||||
EventSink.EquipMacro += EquipMacro;
|
||||
EventSink.UnequipMacro += UnequipMacro;
|
||||
|
||||
if (Core.SE) Timer.DelayCall(TimeSpan.Zero, CheckPets);
|
||||
}
|
||||
|
||||
private static void TargetedSkillUse(Mobile from, IEntity target, int skillId)
|
||||
{
|
||||
if (from == null || target == null)
|
||||
return;
|
||||
|
||||
from.TargetLocked = true;
|
||||
|
||||
if (skillId == 35)
|
||||
AnimalTaming.DisableMessage = true;
|
||||
// AnimalTaming.DeferredTarget = false;
|
||||
|
||||
if (from.UseSkill(skillId))
|
||||
from.Target?.Invoke(from, target);
|
||||
|
||||
if (skillId == 35)
|
||||
// AnimalTaming.DeferredTarget = true;
|
||||
AnimalTaming.DisableMessage = false;
|
||||
|
||||
from.TargetLocked = false;
|
||||
}
|
||||
|
||||
public static void EquipMacro(Mobile m, List<Serial> list)
|
||||
{
|
||||
if (m is PlayerMobile pm && pm.Backpack != null && pm.Alive)
|
||||
{
|
||||
Container pack = pm.Backpack;
|
||||
|
||||
foreach (var serial in list)
|
||||
{
|
||||
Item item = pack.Items.FirstOrDefault(i => i.Serial == serial);
|
||||
if (item == null) continue;
|
||||
|
||||
Item toMove = pm.FindItemOnLayer(item.Layer);
|
||||
|
||||
if (toMove != null)
|
||||
{
|
||||
//pack.DropItem(toMove);
|
||||
toMove.Internalize();
|
||||
|
||||
if (!pm.EquipItem(item))
|
||||
pm.EquipItem(toMove);
|
||||
else
|
||||
pack.DropItem(toMove);
|
||||
}
|
||||
else
|
||||
pm.EquipItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void UnequipMacro(Mobile m, List<Layer> layers)
|
||||
{
|
||||
if (m is PlayerMobile pm && pm.Backpack != null && pm.Alive)
|
||||
{
|
||||
Container pack = pm.Backpack;
|
||||
List<Item> eq = m.Items;
|
||||
|
||||
foreach (var item in eq)
|
||||
if (layers.Contains(item.Layer))
|
||||
pack.TryDropItem(pm, item, false);
|
||||
}
|
||||
}
|
||||
|
||||
private static void CheckPets()
|
||||
{
|
||||
foreach (Mobile m in World.Mobiles.Values)
|
||||
|
|
@ -666,10 +733,8 @@ namespace Server.Mobiles
|
|||
SpecialMove.ClearCurrentMove(this);
|
||||
}
|
||||
|
||||
private static void OnLogin(LoginEventArgs e)
|
||||
private static void OnLogin(Mobile from)
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
CheckAtrophies(from);
|
||||
|
||||
if (AccountHandler.LockdownLevel > AccessLevel.Player)
|
||||
|
|
@ -925,15 +990,14 @@ namespace Server.Mobiles
|
|||
ValidateEquipment();
|
||||
}
|
||||
|
||||
private static void OnLogout(LogoutEventArgs e)
|
||||
private static void OnLogout(Mobile m)
|
||||
{
|
||||
if (e.Mobile is PlayerMobile mobile)
|
||||
mobile.AutoStablePets();
|
||||
(m as PlayerMobile)?.AutoStablePets();
|
||||
}
|
||||
|
||||
private static void EventSink_Connected(ConnectedEventArgs e)
|
||||
private static void EventSink_Connected(Mobile m)
|
||||
{
|
||||
if (e.Mobile is PlayerMobile pm)
|
||||
if (m is PlayerMobile pm)
|
||||
{
|
||||
pm.SessionStart = DateTime.UtcNow;
|
||||
|
||||
|
|
@ -943,14 +1007,13 @@ namespace Server.Mobiles
|
|||
pm.LastOnline = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
DisguiseTimers.StartTimer(e.Mobile);
|
||||
DisguiseTimers.StartTimer(m);
|
||||
|
||||
Timer.DelayCall(TimeSpan.Zero, SpecialMove.ClearAllMoves, e.Mobile);
|
||||
Timer.DelayCall(TimeSpan.Zero, SpecialMove.ClearAllMoves, m);
|
||||
}
|
||||
|
||||
private static void EventSink_Disconnected(DisconnectedEventArgs e)
|
||||
private static void EventSink_Disconnected(Mobile from)
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
DesignContext context = DesignContext.Find(from);
|
||||
|
||||
if (context != null)
|
||||
|
|
@ -977,7 +1040,7 @@ namespace Server.Mobiles
|
|||
context.Foundation.RestoreRelocatedEntities();
|
||||
}
|
||||
|
||||
if (e.Mobile is PlayerMobile pm)
|
||||
if (from is PlayerMobile pm)
|
||||
{
|
||||
pm.m_GameTime += DateTime.UtcNow - pm.SessionStart;
|
||||
|
||||
|
|
|
|||
|
|
@ -1650,7 +1650,7 @@ namespace Server.Multis
|
|||
EventSink.WorldSave += EventSink_WorldSave;
|
||||
}
|
||||
|
||||
private static void EventSink_WorldSave(WorldSaveEventArgs e)
|
||||
private static void EventSink_WorldSave(bool message)
|
||||
{
|
||||
new UpdateAllTimer().Start();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,10 +115,8 @@ namespace Server.Misc
|
|||
return false;
|
||||
}
|
||||
|
||||
public static void EventSink_Login(LoginEventArgs e)
|
||||
public static void EventSink_Login(Mobile from)
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
if (!IsStranded(from))
|
||||
return;
|
||||
|
||||
|
|
@ -153,7 +151,7 @@ namespace Server.Misc
|
|||
|
||||
int x = p.X, y = p.Y;
|
||||
int z;
|
||||
bool canFit = false;
|
||||
bool canFit;
|
||||
|
||||
z = map.GetAverageZ(x, y);
|
||||
canFit = map.CanSpawnMobile(x, y, z);
|
||||
|
|
@ -175,4 +173,4 @@ namespace Server.Misc
|
|||
from.Location = new Point3D(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1745,7 +1745,7 @@ namespace Server.Multis
|
|||
Fixtures[i].m_OffsetX = reader.ReadShort();
|
||||
Fixtures[i].m_OffsetY = reader.ReadShort();
|
||||
Fixtures[i].m_OffsetZ = reader.ReadShort();
|
||||
Fixtures[i].m_Flags = reader.ReadInt();
|
||||
Fixtures[i].m_Flags = (TileFlag)reader.ReadInt();
|
||||
}
|
||||
|
||||
Revision = reader.ReadInt();
|
||||
|
|
@ -1793,7 +1793,7 @@ namespace Server.Multis
|
|||
writer.Write(ent.m_OffsetX);
|
||||
writer.Write(ent.m_OffsetY);
|
||||
writer.Write(ent.m_OffsetZ);
|
||||
writer.Write(ent.m_Flags);
|
||||
writer.Write((int)ent.m_Flags);
|
||||
}
|
||||
|
||||
writer.Write(Revision);
|
||||
|
|
|
|||
|
|
@ -30,12 +30,12 @@ namespace Server.Regions
|
|||
EventSink.Login += OnLogin;
|
||||
}
|
||||
|
||||
public static void OnLogin(LoginEventArgs e)
|
||||
public static void OnLogin(Mobile m)
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(e.Mobile);
|
||||
BaseHouse house = BaseHouse.FindHouseAt(m);
|
||||
|
||||
if (house?.Public == false && !house.IsFriend(e.Mobile))
|
||||
e.Mobile.Location = house.BanLocation;
|
||||
if (house?.Public == false && !house.IsFriend(m))
|
||||
m.Location = house.BanLocation;
|
||||
}
|
||||
|
||||
public override bool AllowHousing(Mobile from, Point3D p) => false;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MailKit" Version="2.4.1" />
|
||||
<PackageReference Include="MailKit" Version="2.6.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Connections.Abstractions" Version="3.1.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="3.1.3" />
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ namespace Server.Misc
|
|||
EventSink.Login += EventSink_Login;
|
||||
}
|
||||
|
||||
private static void EventSink_Login(LoginEventArgs e)
|
||||
private static void EventSink_Login(Mobile m)
|
||||
{
|
||||
if (!(e.Mobile.Account is Account acct))
|
||||
if (!(m.Account is Account acct))
|
||||
return;
|
||||
|
||||
DateTime now = DateTime.UtcNow;
|
||||
|
|
@ -44,7 +44,7 @@ namespace Server.Misc
|
|||
if (acct.LastLogin >= giver.Start)
|
||||
continue; // already got one
|
||||
|
||||
giver.DelayGiveGift(TimeSpan.FromSeconds(5.0), e.Mobile);
|
||||
giver.DelayGiveGift(TimeSpan.FromSeconds(5.0), m);
|
||||
}
|
||||
|
||||
acct.LastLogin = now;
|
||||
|
|
|
|||
|
|
@ -37,10 +37,8 @@ namespace Server.Misc
|
|||
EventSink.Login += OnLogin;
|
||||
}
|
||||
|
||||
public static void OnLogin(LoginEventArgs e)
|
||||
public static void OnLogin(Mobile from)
|
||||
{
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
if (from == null || from.AccessLevel < AccessLevel.Counselor)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -93,9 +93,9 @@ namespace Server.Spells.Mysticism
|
|||
context.OnDamage();
|
||||
}
|
||||
|
||||
private static void OnPlayerDeath(PlayerDeathEventArgs e)
|
||||
private static void OnPlayerDeath(Mobile m)
|
||||
{
|
||||
RemoveEffect(e.Mobile);
|
||||
RemoveEffect(m);
|
||||
}
|
||||
|
||||
protected void VisualEffect(Mobile to)
|
||||
|
|
|
|||
|
|
@ -146,9 +146,9 @@ namespace Server.Spells.Mysticism
|
|||
BuffInfo.RemoveBuff(m, BuffIcon.StoneForm);
|
||||
}
|
||||
|
||||
private static void OnPlayerDeath(PlayerDeathEventArgs e)
|
||||
private static void OnPlayerDeath(Mobile m)
|
||||
{
|
||||
RemoveEffects(e.Mobile);
|
||||
RemoveEffects(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,10 +67,10 @@ namespace Server.Spells.Ninjitsu
|
|||
EventSink.Login += OnLogin;
|
||||
}
|
||||
|
||||
public static void OnLogin(LoginEventArgs e)
|
||||
public static void OnLogin(Mobile m)
|
||||
{
|
||||
if (GetContext(e.Mobile)?.SpeedBoost == true)
|
||||
e.Mobile.Send(SpeedControl.MountSpeed);
|
||||
if (GetContext(m)?.SpeedBoost == true)
|
||||
m.Send(SpeedControl.MountSpeed);
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
|
|
|
|||
|
|
@ -24,11 +24,13 @@ namespace Server.Spells.Spellweaving
|
|||
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.AggressiveAction += delegate(AggressiveActionEventArgs e)
|
||||
{
|
||||
if (TransformationSpellHelper.UnderTransformation(e.Aggressor, typeof(EtherealVoyageSpell)))
|
||||
TransformationSpellHelper.RemoveContext(e.Aggressor, true);
|
||||
};
|
||||
EventSink.AggressiveAction += RemoveTransformationOnAggressiveAction;
|
||||
}
|
||||
|
||||
public static void RemoveTransformationOnAggressiveAction(AggressiveActionEventArgs e)
|
||||
{
|
||||
if (TransformationSpellHelper.UnderTransformation(e.Aggressor, typeof(EtherealVoyageSpell)))
|
||||
TransformationSpellHelper.RemoveContext(e.Aggressor, true);
|
||||
}
|
||||
|
||||
public override bool CheckCast()
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace Server.Spells.Spellweaving
|
|||
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.PlayerDeath += delegate(PlayerDeathEventArgs e) { HandleDeath(e.Mobile); };
|
||||
EventSink.PlayerDeath += HandleDeath;
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
|
|
@ -132,10 +132,8 @@ namespace Server.Spells.Spellweaving
|
|||
timer.DoExpire();
|
||||
}
|
||||
|
||||
public static void OnLogin(LoginEventArgs e)
|
||||
public static void OnLogin(Mobile m)
|
||||
{
|
||||
Mobile m = e.Mobile;
|
||||
|
||||
if (m?.Alive != false || m_Table[m] == null)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -32,12 +32,12 @@ namespace Server.Spells.Spellweaving
|
|||
EventSink.Login += OnLogin;
|
||||
}
|
||||
|
||||
public static void OnLogin(LoginEventArgs e)
|
||||
public static void OnLogin(Mobile m)
|
||||
{
|
||||
TransformContext context = TransformationSpellHelper.GetContext(e.Mobile);
|
||||
TransformContext context = TransformationSpellHelper.GetContext(m);
|
||||
|
||||
if (context?.Type == typeof(ReaperFormSpell))
|
||||
e.Mobile.Send(SpeedControl.WalkSpeed);
|
||||
m.Send(SpeedControl.WalkSpeed);
|
||||
}
|
||||
|
||||
public override void DoEffect(Mobile m)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue