private static void ProcessDiscordance(DiscordanceInfo info) { Mobile from = info.m_From; Mobile targ = info.m_Creature; bool ends = false; // According to uoherald bard must remain alive, visible, and // within range of the target or the effect ends in 15 seconds. if (!targ.Alive || targ.Deleted || !from.Alive || from.Hidden) { ends = true; } else { int range = (int)targ.GetDistanceToSqrt(from); int maxRange = BaseInstrument.GetBardRange(from, SkillName.Discordance); Map targetMap = targ.Map; if (targ is BaseMount && ((BaseMount)targ).Rider != null) { Mobile rider = ((BaseMount)targ).Rider; range = (int)rider.GetDistanceToSqrt(from); targetMap = rider.Map; } if (from.Map != targetMap || range > maxRange) { ends = true; } } if (ends && info.m_Ending && info.m_EndTime < DateTime.UtcNow) { if (info.m_Timer != null) { info.m_Timer.Stop(); } info.Clear(); m_Table.Remove(targ); } else { if (ends && !info.m_Ending) { info.m_Ending = true; info.m_EndTime = DateTime.UtcNow + TimeSpan.FromSeconds(15); } else if (!ends) { info.m_Ending = false; info.m_EndTime = DateTime.UtcNow; } targ.FixedEffect(0x376A, 1, 32); } }
public static void RemoveDiscord(DiscordanceInfo info) { if (info.m_Timer != null) { info.m_Timer.Stop(); } var targ = info.m_Target; info.Clear(); Discordance.RemoveEffects(targ); }
private static void ProcessDiscordance(DiscordanceInfo info) { Mobile from = info.m_From; Mobile targ = info.m_Creature; bool ends = false; // According to uoherald bard must remain alive, visible, and // within range of the target or the effect ends in 15 seconds. if (!targ.Alive || targ.Deleted || !from.Alive || from.Hidden) { ends = true; } else { int range = (int)targ.GetDistanceToSqrt(from); int maxRange = BaseInstrument.GetBardRange(from, SkillName.Discordance); if (from.Map != targ.Map || range > maxRange) { ends = true; } } if (ends && info.m_Ending && info.m_EndTime < DateTime.UtcNow) { if (info.m_Timer != null) { info.m_Timer.Stop(); } info.Clear(); m_Table.Remove(targ); } else { if (ends && !info.m_Ending) { info.m_Ending = true; info.m_EndTime = DateTime.UtcNow + TimeSpan.FromSeconds(15); } else if (!ends) { info.m_Ending = false; info.m_EndTime = DateTime.UtcNow; } targ.FixedEffect(0x376A, 1, 32); } }
private static void ProcessDiscordance(object state) { DiscordanceInfo info = (DiscordanceInfo)state; Mobile from = info.m_From; Mobile targ = info.m_Creature; if (DateTime.Now >= info.m_EndTime || targ.Deleted || from.Map != targ.Map || targ.GetDistanceToSqrt(from) > 16) { info.Clear(); m_Table.Remove(targ); } else { targ.FixedEffect(0x376A, 1, 32); } }