Example #1
0
        internal static void SetLastTargetWait(Mobile m, byte flagType)
        {
            TargetInfo targ = new TargetInfo();

            m_LastGroundTarg = m_LastTarget = targ;

            if ((m_HasTarget && m_CurFlags == 1) || flagType == 1)
            {
                m_LastHarmTarg = targ;
            }
            else if ((m_HasTarget && m_CurFlags == 2) || flagType == 2)
            {
                m_LastBeneTarg = targ;
            }
            else if (flagType == 0)
            {
                m_LastHarmTarg = m_LastBeneTarg = targ;
            }

            targ.Type  = 0;
            targ.Flags = m_HasTarget ? m_CurFlags : flagType;

            targ.Gfx    = m.Body;
            targ.Serial = m.Serial;
            targ.X      = m.Position.X;
            targ.Y      = m.Position.Y;
            targ.Z      = m.Position.Z;

            ClientCommunication.SendToClientWait(new ChangeCombatant(m));
            m_LastCombatant = m.Serial;

            LastTargetChanged();
        }
Example #2
0
        internal static void CancelOneTimeTargetByScript()
        {
            m_ClientTarget = m_HasTarget = false;

            ClientCommunication.SendToClientWait(new CancelTarget(LocalTargID));
            EndIntercept();
        }
Example #3
0
 internal static void CancelClientTargetByScript()
 {
     if (m_ClientTarget)
     {
         m_FilterCancel.Add((uint)m_CurrentID);
         ClientCommunication.SendToClientWait(new CancelTarget(m_CurrentID));
         m_ClientTarget = false;
     }
 }
Example #4
0
        private static void OnTick(object state)
        {
            if (m_Table.Count <= 0)
            {
                return;
            }

            ConcurrentBag <KeyValuePair <string, MsgInfo> > list = new ConcurrentBag <KeyValuePair <string, MsgInfo> >(m_Table);

            foreach (KeyValuePair <string, MsgInfo> pair in list)
            {
                string  txt = pair.Key.ToString();
                MsgInfo msg = (MsgInfo)pair.Value;

                if (msg.NextSend > DateTime.Now)
                {
                    continue;
                }

                if (msg.Count > 0)
                {
                    if (msg.Lang == "A")
                    {
                        ClientCommunication.SendToClientWait(new AsciiMessage(msg.Serial, msg.Body, msg.Type, msg.Hue, msg.Font, msg.Name, msg.Count > 1 ? String.Format("{0} [{1}]", txt, msg.Count) : txt));
                    }
                    else
                    {
                        ClientCommunication.SendToClientWait(new UnicodeMessage(msg.Serial, msg.Body, msg.Type, msg.Hue, msg.Font, msg.Lang, msg.Name, msg.Count > 1 ? String.Format("{0} [{1}]", txt, msg.Count) : txt));
                    }
                    msg.Count    = 0;
                    msg.NextSend = DateTime.Now + msg.Delay;
                }
                else
                {
                    MsgInfo removed;
                    m_Table.TryRemove(pair.Key, out removed);
                }
            }
        }