Пример #1
0
        /// <summary>Initialize the GO</summary>
        /// <param name="entry"></param>
        /// <param name="templ"></param>
        internal virtual void Init(GOEntry entry, GOSpawnEntry spawnEntry, GOSpawnPoint spawnPoint)
        {
            EntityId =
                EntityId.GetGameObjectId((uint)Interlocked.Increment(ref _lastGOUID), entry.GOId);
            Type        |= ObjectTypes.GameObject;
            m_entry      = entry;
            m_spawnPoint = spawnPoint;
            GoId         = entry.GOId;
            DisplayId    = entry.DisplayId;
            EntryId      = entry.Id;
            GOType       = entry.Type;
            Flags        = m_entry.Flags;
            m_faction    = m_entry.Faction ?? Faction.NullFaction;
            ScaleX       = m_entry.Scale;
            GossipMenu   = entry.DefaultGossip;
            if (QuestHolderInfo != null && GossipMenu == null)
            {
                GossipMenu = new GossipMenu();
            }
            spawnEntry = spawnEntry ?? entry.FirstSpawnEntry;
            if (spawnEntry != null)
            {
                Phase = spawnEntry.Phase;
                State = spawnEntry.State;
                if (spawnEntry.Scale != 1.0)
                {
                    ScaleX = spawnEntry.Scale;
                }
                Orientation       = spawnEntry.Orientation;
                AnimationProgress = spawnEntry.AnimProgress;
                SetRotationFields(spawnEntry.Rotations);
            }

            m_entry.InitGO(this);
        }
Пример #2
0
        /// <summary>
        /// Initialize the GO
        /// </summary>
        /// <param name="entry"></param>
        /// <param name="templ"></param>
        internal virtual void Init(GOEntry entry, GOSpawnEntry spawnEntry, GOSpawnPoint spawnPoint)
        {
            EntityId = EntityId.GetGameObjectId((uint)Interlocked.Increment(ref _lastGOUID), entry.GOId);
            Type    |= ObjectTypes.GameObject;
            //DynamicFlagsLow = GameObjectDynamicFlagsLow.Activated;
            m_entry      = entry;
            m_spawnPoint = spawnPoint;

            DisplayId  = entry.DisplayId;
            EntryId    = entry.Id;
            GOType     = entry.Type;
            Flags      = m_entry.Flags;
            m_faction  = m_entry.Faction ?? Faction.NullFaction;
            ScaleX     = m_entry.Scale;
            GossipMenu = entry.DefaultGossip;

            if (QuestHolderInfo != null && GossipMenu == null)
            {
                // make sure, there is a GossipMenu that allows the player to start/finish quests
                GossipMenu = new GossipMenu();
            }

            spawnEntry = spawnEntry ?? entry.FirstSpawnEntry;
            if (spawnEntry != null)
            {
                Phase = spawnEntry.Phase;
                State = spawnEntry.State;
                if (spawnEntry.Scale != 1)
                {
                    ScaleX = spawnEntry.Scale;
                }
                Orientation       = spawnEntry.Orientation;
                AnimationProgress = spawnEntry.AnimProgress;
                SetRotationFields(spawnEntry.Rotations);
            }

            m_entry.InitGO(this);
        }