예제 #1
0
        /// <summary>
        ///     Enable cumulative level effects for custom creatures requesting it. Thx ASP for the code.
        /// </summary>
        private void EnableCumulativeLevelEffects(LevelEffects self, int level)
        {
            if (level <= 2)
            {
                return;
            }

            if (!Creatures.Any(x => x.Prefab.name == self.m_character.m_nview.GetPrefabName() && x.UseCumulativeLevelEffects))
            {
                return;
            }

            for (int index = level - 2; index >= 0; --index)
            {
                if (index >= self.m_levelSetups.Count)
                {
                    continue;
                }

                var levelSetup = self.m_levelSetups[index];

                if (levelSetup.m_enableObject)
                {
                    Logger.LogDebug($"Enabling {(level - 1)} star equipment: '{levelSetup.m_enableObject.name}'");
                    levelSetup.m_enableObject.SetActive(true);
                }
            }
        }
예제 #2
0
            static void Prefix(ref LevelEffects __instance)
            {
                if (Settings.isDefaultDifficulty)
                {
                    return;
                }

                var count = __instance.m_levelSetups.Count;

                if (count == 0)
                {
                    var levelSetup = new LevelEffects.LevelSetup();
                    levelSetup.m_scale      = 1f + Settings.mobScale.Value / 100f;
                    levelSetup.m_hue        = 0.3f;
                    levelSetup.m_saturation = 0.3f;
                    levelSetup.m_value      = 0.1f;
                    __instance.m_levelSetups.Add(levelSetup);

                    var levelSetup2 = new LevelEffects.LevelSetup();
                    levelSetup.m_scale      = 1f + 2 * Settings.mobScale.Value / 100f;;
                    levelSetup.m_hue        = 0.4f;
                    levelSetup.m_saturation = 0.35f;
                    levelSetup.m_value      = 0.15f;
                    __instance.m_levelSetups.Add(levelSetup2);
                    count = __instance.m_levelSetups.Count;
                }
                if (count < Settings.maxMobLevel.Value)
                {
                    for (int i = count; i <= Settings.maxMobLevel.Value; i++)
                    {
                        var levelSetup = new LevelEffects.LevelSetup();
                        var prev       = __instance.m_levelSetups[i - 1];
                        var prev2      = __instance.m_levelSetups[i - 2];

                        var scaleFactor = Settings.mobScale.Value / 100f;
                        levelSetup.m_scale        = prev.m_scale + scaleFactor;
                        levelSetup.m_hue          = prev.m_hue * 2 - prev2.m_hue;
                        levelSetup.m_saturation   = prev.m_saturation * 2 - prev2.m_saturation;
                        levelSetup.m_value        = prev.m_value * 2 - prev2.m_value;
                        levelSetup.m_enableObject = prev.m_enableObject;
                        __instance.m_levelSetups.Add(levelSetup);
                    }
                }
            }
예제 #3
0
        public void Load(S.ObjectPlayer info)
        {
            Name = info.Name;
            NameColour = info.NameColour;
            GuildName = info.GuildName;
            GuildRankName = info.GuildRankName;
            Class = info.Class;
            Gender = info.Gender;
            Level = info.Level;

            CurrentLocation = info.Location;
            MapLocation = info.Location;
            GameScene.Scene.MapControl.AddObject(this);

            Direction = info.Direction;
            Hair = info.Hair;

            Weapon = info.Weapon;
            Armour = info.Armour;
            Light = info.Light;

            Poison = info.Poison;

            Dead = info.Dead;
            Hidden = info.Hidden;

            WingEffect = info.WingEffect;
            CurrentEffect = info.Effect;

            MountType = info.MountType;
            RidingMount = info.RidingMount;

            Fishing = info.Fishing;

            TransformType = info.TransformType;

            SetLibraries();

            if (Dead) ActionFeed.Add(new QueuedAction { Action = MirAction.Dead, Direction = Direction, Location = CurrentLocation });
            if (info.Extra) Effects.Add(new Effect(Libraries.Magic2, 670, 10, 800, this));

            ElementEffect = (int)info.ElementOrbEffect;
            ElementsLevel = (int)info.ElementOrbLvl;
            ElementOrbMax = (int)info.ElementOrbMax;

            Buffs = info.Buffs;

            LevelEffects = info.LevelEffects;

            ProcessBuffs();

            SetAction();

            SetEffects();
        }
예제 #4
0
        protected override void ReadPacket(BinaryReader reader)
        {
            ObjectID = reader.ReadUInt32();
            Name = reader.ReadString();
            GuildName = reader.ReadString();
            GuildRankName = reader.ReadString();
            NameColour = Color.FromArgb(reader.ReadInt32());
            Class = (MirClass)reader.ReadByte();
            Gender = (MirGender)reader.ReadByte();
            Level = reader.ReadByte();
            Location = new Point(reader.ReadInt32(), reader.ReadInt32());
            Direction = (MirDirection)reader.ReadByte();
            Hair = reader.ReadByte();
            Light = reader.ReadByte();
            Weapon = reader.ReadInt16();
            Armour = reader.ReadInt16();
            Poison = (PoisonType)reader.ReadByte();
            Dead = reader.ReadBoolean();
            Hidden = reader.ReadBoolean();
            Effect = (SpellEffect)reader.ReadByte();
            WingEffect = reader.ReadByte();
            Extra = reader.ReadBoolean();
            MountType = reader.ReadInt16();
            RidingMount = reader.ReadBoolean();
            Fishing = reader.ReadBoolean();

            TransformType = reader.ReadInt16();

            ElementOrbEffect = reader.ReadUInt32();
            ElementOrbLvl = reader.ReadUInt32();
            ElementOrbMax = reader.ReadUInt32();

            int count = reader.ReadInt32();
            for (int i = 0; i < count; i++)
            {
                Buffs.Add((BuffType)reader.ReadByte());
            }

            LevelEffects = (LevelEffects)reader.ReadByte();
        }
예제 #5
0
        public bool CreatureSummoned;//IntelligentCreature

        protected override void ReadPacket(BinaryReader reader)
        {
            ObjectID = reader.ReadUInt32();
            RealId = reader.ReadUInt32();
            Name = reader.ReadString();
            GuildName = reader.ReadString();
            GuildRank = reader.ReadString();
            NameColour = Color.FromArgb(reader.ReadInt32());
            Class = (MirClass)reader.ReadByte();
            Gender = (MirGender)reader.ReadByte();
            Level = reader.ReadByte();
            Location = new Point(reader.ReadInt32(), reader.ReadInt32());
            Direction = (MirDirection)reader.ReadByte();
            Hair = reader.ReadByte();
            HP = reader.ReadUInt16();
            MP = reader.ReadUInt16();

            Experience = reader.ReadInt64();
            MaxExperience = reader.ReadInt64();

            LevelEffects = (LevelEffects)reader.ReadByte();

            if (reader.ReadBoolean())
            {
                Inventory = new UserItem[reader.ReadInt32()];
                for (int i = 0; i < Inventory.Length; i++)
                {
                    if (!reader.ReadBoolean()) continue;
                    Inventory[i] = new UserItem(reader);
                }
            }

            if (reader.ReadBoolean())
            {
                Equipment = new UserItem[reader.ReadInt32()];
                for (int i = 0; i < Equipment.Length; i++)
                {
                    if (!reader.ReadBoolean()) continue;
                    Equipment[i] = new UserItem(reader);
                }
            }

            if (reader.ReadBoolean())
            {
                QuestInventory = new UserItem[reader.ReadInt32()];
                for (int i = 0; i < QuestInventory.Length; i++)
                {
                    if (!reader.ReadBoolean()) continue;
                    QuestInventory[i] = new UserItem(reader);
                }
            }

            Gold = reader.ReadUInt32();

            int count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
                Magics.Add(new ClientMagic(reader));

            //IntelligentCreature
            count = reader.ReadInt32();
            for (int i = 0; i < count; i++)
                IntelligentCreatures.Add(new ClientIntelligentCreature(reader));
            SummonedCreatureType = (IntelligentCreatureType)reader.ReadByte();
            CreatureSummoned = reader.ReadBoolean();
        }
예제 #6
0
 protected override void ReadPacket(BinaryReader reader)
 {
     ObjectID = reader.ReadUInt32();
     LevelEffects = (LevelEffects)reader.ReadByte();
 }
예제 #7
0
        public void SetLevelEffects()
        {
            LevelEffects = LevelEffects.None;

            if (Info.Flags[990]) LevelEffects |= LevelEffects.Mist;
            if (Info.Flags[991]) LevelEffects |= LevelEffects.RedDragon;
            if (Info.Flags[992]) LevelEffects |= LevelEffects.BlueDragon;
        }
예제 #8
0
 private static void EnableCumulativeLevelEffects(LevelEffects __instance, int level) => Instance.EnableCumulativeLevelEffects(__instance, level);