Exemplo n.º 1
0
        public static void OnEnterRegion(OnEnterRegionEventArgs e)
        {
            Mobile m = e.From;

            if (!m.Player || e.OldRegion == null || e.NewRegion == null || m.Backpack == null)
            {
                return;
            }

            if (e.OldRegion.IsPartOf("Wrong") && !e.NewRegion.IsPartOf("Wrong"))
            {
                bool found = false;

                m.Backpack.Items.IterateReverse(i =>
                {
                    EnchantedHotItemSocket socket = i.GetSocket <EnchantedHotItemSocket>();

                    if (socket != null)
                    {
                        found = true;
                        socket.Remove();
                    }
                });

                if (found)
                {
                    m.SendLocalizedMessage(1152085); // The curse is removed from the item you stole!
                }
            }
        }
Exemplo n.º 2
0
        public static void OnEnterRegion(OnEnterRegionEventArgs e)
        {
            WispOrb orb = GetWispOrb(e.From);

            if (orb != null && !Region.Find(e.From.Location, e.From.Map).IsPartOf(typeof(DespiseRegion)))
            {
                Timer.DelayCall(orb.Delete);
            }
        }
Exemplo n.º 3
0
        public static void OnEnterRegion(OnEnterRegionEventArgs e)
        {
            WispOrb orb = GetWispOrb(e.From);

            if (orb != null && !Region.Find(e.From.Location, e.From.Map).IsPartOf <DespiseRegion>())
            {
                Timer.DelayCall(() =>
                {
                    e.From.SendLocalizedMessage(1153233);     // The Wisp Orb vanishes to whence it came...
                    orb.Delete();
                });
            }
        }
        private void EventSink_OnEnterRegion(OnEnterRegionEventArgs e)
        {
            if (e == null || e.Region == null || e.From == null || e.Region.Name == null)
            {
                return;
            }
            var player = e.From as PlayerMobile;

            if (e.Region.Name.Contains(m_Region) && player != null)
            {
                AchievmentSystem.SetAchievementStatus(player, this, 1);
            }
        }
Exemplo n.º 5
0
        public static void OnEnterRegion(OnEnterRegionEventArgs e)
        {
            WispOrb orb = GetWispOrb(e.From);

            if (orb != null && !Region.Find(e.From.Location, e.From.Map).IsPartOf <DespiseRegion>())
            {
                Timer.DelayCall(() =>
                {
                    if (orb.Pet != null && !orb.Pet.Deleted)
                    {
                        orb.Pet.Delete();
                    }

                    orb.Delete();
                });;
            }
        }
Exemplo n.º 6
0
        public static void OnEnterRegion(OnEnterRegionEventArgs e)
        {
            Mobile m     = e.From;
            bool   debug = m is PlayerMobile;

            if (!(m is PlayerMobile) || e.OldRegion == null || e.NewRegion == null || m.Backpack == null)
            {
                return;
            }

            if (e.OldRegion.IsPartOf("Wrong") && !e.NewRegion.IsPartOf("Wrong"))
            {
                bool found = false;

                List <Item> check = new List <Item>(m.Items.Where(i => HotItems.ContainsKey(i)));
                check.AddRange(m.Backpack.Items.Where(i => HotItems.ContainsKey(i)));

                foreach (var hotItem in check)
                {
                    HotItems.Remove(hotItem);
                    found = true;

                    if (hotItem is BaseWeapon)
                    {
                        hotItem.Hue = ((BaseWeapon)hotItem).GetElementalDamageHue();
                    }
                    else
                    {
                        hotItem.Hue = 0;
                    }

                    hotItem.InvalidateProperties();
                }

                ColUtility.Free(check);

                if (found)
                {
                    m.SendLocalizedMessage(1152085); // The curse is removed from the item you stole!
                }
            }
        }