Пример #1
0
        private void CalculateProperties()
        {
            Creature2Entry creatureEntry = GameTableManager.Creature2.GetEntry(CreatureId);

            // TODO: research this some more

            /*float[] values = new float[200];
             *
             * CreatureLevelEntry levelEntry = GameTableManager.CreatureLevel.GetEntry(6);
             * for (uint i = 0u; i < levelEntry.UnitPropertyValue.Length; i++)
             *  values[i] = levelEntry.UnitPropertyValue[i];
             *
             * Creature2ArcheTypeEntry archeTypeEntry = GameTableManager.Creature2ArcheType.GetEntry(creatureEntry.Creature2ArcheTypeId);
             * for (uint i = 0u; i < archeTypeEntry.UnitPropertyMultiplier.Length; i++)
             *  values[i] *= archeTypeEntry.UnitPropertyMultiplier[i];
             *
             * Creature2DifficultyEntry difficultyEntry = GameTableManager.Creature2Difficulty.GetEntry(creatureEntry.Creature2DifficultyId);
             * for (uint i = 0u; i < difficultyEntry.UnitPropertyMultiplier.Length; i++)
             *  values[i] *= archeTypeEntry.UnitPropertyMultiplier[i];
             *
             * Creature2TierEntry tierEntry = GameTableManager.Creature2Tier.GetEntry(creatureEntry.Creature2TierId);
             * for (uint i = 0u; i < tierEntry.UnitPropertyMultiplier.Length; i++)
             *  values[i] *= archeTypeEntry.UnitPropertyMultiplier[i];
             *
             * for (uint i = 0u; i < levelEntry.UnitPropertyValue.Length; i++)
             *  SetProperty((Property)i, values[i]);*/
        }
Пример #2
0
        public override void OnActivate(Player activator)
        {
            Creature2Entry entry = GameTableManager.Creature2.GetEntry(CreatureId);

            if (entry.DatacubeId != 0u)
            {
                activator.DatacubeManager.AddDatacube((ushort)entry.DatacubeId, int.MaxValue);
            }
        }
Пример #3
0
        private string GetName(WorldEntity target, Language language)
        {
            if (target is Player player)
            {
                return(player.Name);
            }

            Creature2Entry entry = GameTableManager.Instance.Creature2.GetEntry(target.CreatureId);

            return(GameTableManager.Instance.GetTextTable(language).GetEntry(entry.LocalizedTextIdName));
        }
Пример #4
0
        public static void HandleClientEntityInteractEmote(WorldSession session, ClientEntityInteractChair interactChair)
        {
            WorldEntity chair = session.Player.GetVisible <WorldEntity>(interactChair.ChairUnitId);

            if (chair == null)
            {
                throw new InvalidPacketValueException();
            }

            Creature2Entry creatureEntry = GameTableManager.Instance.Creature2.GetEntry(chair.CreatureId);

            if ((creatureEntry.ActivationFlags & 0x200000) == 0)
            {
                throw new InvalidPacketValueException();
            }

            session.Player.Sit(chair);
        }
Пример #5
0
        private void HandleEffectDisguise(UnitEntity target, SpellTargetInfo.SpellTargetEffectInfo info)
        {
            if (!(target is Player player))
            {
                return;
            }

            Creature2Entry creature2 = GameTableManager.Instance.Creature2.GetEntry(info.Entry.DataBits02);

            if (creature2 == null)
            {
                return;
            }

            Creature2DisplayGroupEntryEntry displayGroupEntry = GameTableManager.Instance.Creature2DisplayGroupEntry.Entries.FirstOrDefault(d => d.Creature2DisplayGroupId == creature2.Creature2DisplayGroupId);

            if (displayGroupEntry == null)
            {
                return;
            }

            player.SetDisplayInfo(displayGroupEntry.Creature2DisplayInfoId);
        }
Пример #6
0
        public override void OnActivateCast(Player activator)
        {
            uint progress = (uint)(1 << QuestChecklistIdx);

            Creature2Entry entry = GameTableManager.Creature2.GetEntry(CreatureId);

            if (entry.DatacubeId != 0u)
            {
                Datacube datacube = activator.DatacubeManager.GetDatacube((ushort)entry.DatacubeId, DatacubeType.Datacube);
                if (datacube == null)
                {
                    activator.DatacubeManager.AddDatacube((ushort)entry.DatacubeId, progress);
                }
                else
                {
                    datacube.Progress |= progress;
                    activator.DatacubeManager.SendDatacube(datacube);
                }
            }

            if (entry.DatacubeVolumeId != 0u)
            {
                Datacube datacube = activator.DatacubeManager.GetDatacube((ushort)entry.DatacubeVolumeId, DatacubeType.Journal);
                if (datacube == null)
                {
                    activator.DatacubeManager.AddDatacubeVolume((ushort)entry.DatacubeVolumeId, progress);
                }
                else
                {
                    datacube.Progress |= progress;
                    activator.DatacubeManager.SendDatacubeVolume(datacube);
                }
            }

            //TODO: cast "116,Generic Quest Spell - Activating - Activate - Tier 1" by 0x07FD
        }