Ejemplo n.º 1
0
        private static void CastBarRequestHandler(CastBarRequestEventArgs e)
        {
            if (!CMOptions.ModuleEnabled || e.User == null || !e.User.IsOnline() || e.Gump != null)
            {
                return;
            }

            SpellCastBar cb;

            if (!Instances.TryGetValue(e.User, out cb) || cb.IsDisposed)
            {
                Instances[e.User] = cb = new SpellCastBar(e.User, e.Location.X, e.Location.Y);
            }
            else
            {
                cb.X = e.Location.X;
                cb.Y = e.Location.Y;
            }

            cb.Preview = false;

            e.Gump = cb;

            if (CMOptions.ModuleDebug)
            {
                CMOptions.ToConsole(
                    "Request: {0} casting {1}, using {2} ({3}) at {4}",
                    e.User,
                    e.User.Spell,
                    cb,
                    cb.Preview ? "Prv" : "Std",
                    e.Location);
            }
        }
Ejemplo n.º 2
0
        private static void CastBarRequestHandler(CastBarRequestEventArgs e)
        {
            if (e.User == null || e.User.Deleted || e.User.NetState == null || e.Gump != null)
            {
                return;
            }

            SpellCastBar cb;

            if (Instances.TryGetValue(e.User, out cb) && !cb.IsDisposed)
            {
                cb.X = e.Location.X;
                cb.Y = e.Location.Y;
            }
            else
            {
                cb = new SpellCastBar(e.User, e.Location.X, e.Location.Y);

                if (Instances.ContainsKey(e.User))
                {
                    Instances[e.User] = cb;
                }
                else
                {
                    Instances.Add(e.User, cb);
                }
            }

            cb.Preview = false;

            e.Gump = cb;

            if (CMOptions.ModuleDebug)
            {
                CMOptions.ToConsole(
                    "Request: {0} casting {1}, using {2} ({3}) at {4}",
                    e.User,
                    e.User.Spell,
                    cb,
                    cb.Preview ? "Prv" : "Std",
                    e.Location);
            }
        }
Ejemplo n.º 3
0
		private static void CastBarRequestHandler(CastBarRequestEventArgs e)
		{
			if (e.User == null || e.User.Deleted || e.User.NetState == null || e.Gump != null)
			{
				return;
			}

			SpellCastBar cb;

			if (Instances.TryGetValue(e.User, out cb) && !cb.IsDisposed)
			{
				cb.X = e.Location.X;
				cb.Y = e.Location.Y;
			}
			else
			{
				cb = new SpellCastBar(e.User, e.Location.X, e.Location.Y);

				if (Instances.ContainsKey(e.User))
				{
					Instances[e.User] = cb;
				}
				else
				{
					Instances.Add(e.User, cb);
				}
			}

			cb.Preview = false;

			e.Gump = cb;

			if (CMOptions.ModuleDebug)
			{
				CMOptions.ToConsole(
					"Request: {0} casting {1}, using {2} ({3}) at {4}",
					e.User,
					e.User.Spell,
					cb,
					cb.Preview ? "Prv" : "Std",
					e.Location);
			}
		}