예제 #1
0
        public static void TryRemoveDragon(SkeletalDragon dragon)
        {
            if (Instances == null)
            {
                return;
            }

            var bell = Instances.FirstOrDefault(x => x.Dragon == dragon);

            if (bell != null)
            {
                bell.Dragon = null;
            }
        }
예제 #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_Chyloth = reader.ReadMobile() as Chyloth;
            m_Dragon  = reader.ReadMobile() as SkeletalDragon;

            if (m_Chyloth != null)
            {
                m_Chyloth.Delete();
            }
        }
예제 #3
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            if (Instances == null)
            {
                Instances = new List <BellOfTheDead>();
            }

            Instances.Add(this);

            m_Chyloth = reader.ReadMobile() as Chyloth;
            m_Dragon  = reader.ReadMobile() as SkeletalDragon;

            if (m_Chyloth != null)
            {
                m_Chyloth.Delete();
            }
        }
예제 #4
0
파일: Chyloth.cs 프로젝트: tflynt91/TrueUO
        public virtual void EndSummonDragon()
        {
            if (Deleted || m_AngryAt == null)
            {
                return;
            }

            Map map = m_AngryAt.Map;

            if (map == null)
            {
                return;
            }

            if (!m_AngryAt.Region.IsPartOf("Doom"))
            {
                return;
            }

            PublicOverheadMessage(MessageType.Regular, 0x3B2, 1050015);                        // Feel the wrath of my legions!!!
            PublicOverheadMessage(MessageType.Regular, 0x3B2, false, "MUHAHAHAHA HAHAH HAHA"); // A wee bit crazy, aren't we?

            SkeletalDragon dragon = new SkeletalDragon();

            int offset = Utility.Random(8) * 2;

            bool foundLoc = false;

            for (int i = 0; i < m_Offsets.Length; i += 2)
            {
                int x = m_AngryAt.X + m_Offsets[(offset + i) % m_Offsets.Length];
                int y = m_AngryAt.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];

                if (map.CanSpawnMobile(x, y, m_AngryAt.Z))
                {
                    dragon.MoveToWorld(new Point3D(x, y, m_AngryAt.Z), map);
                    foundLoc = true;
                    break;
                }
                else
                {
                    int z = map.GetAverageZ(x, y);

                    if (map.CanSpawnMobile(x, y, z))
                    {
                        dragon.MoveToWorld(new Point3D(x, y, z), map);
                        foundLoc = true;
                        break;
                    }
                }
            }

            if (!foundLoc)
            {
                dragon.MoveToWorld(m_AngryAt.Location, map);
            }

            dragon.Combatant = m_AngryAt;

            if (m_Bell != null)
            {
                m_Bell.Dragon = dragon;
            }
        }