Esempio n. 1
0
        public UserIntelligentCreature(BinaryReader reader)
        {
            PetType = (IntelligentCreatureType)reader.ReadByte();
            Info    = IntelligentCreatureInfo.GetCreatureInfo(PetType);

            CustomName = reader.ReadString();
            Fullness   = reader.ReadInt32();
            SlotIndex  = reader.ReadInt32();

            var expireTime = reader.ReadInt64();

            if (expireTime == -9999)
            {
                Expire = DateTime.MinValue;
            }
            else
            {
                Expire = DateTime.Now.AddSeconds(expireTime);
            }

            BlackstoneTime = reader.ReadInt64();

            petMode = (IntelligentCreaturePickupMode)reader.ReadByte();

            Filter = new IntelligentCreatureItemFilter(reader);
            if (Envir.LoadVersion > 48)
            {
                Filter.PickupGrade = (ItemGrade)reader.ReadByte();

                MaintainFoodTime = reader.ReadInt64();//maintain food buff
            }
        }
Esempio n. 2
0
        public UserIntelligentCreature(MySqlDataReader readerIntelligentCreaturesDB)
        {
            PetType = (IntelligentCreatureType)Convert.ToInt32(readerIntelligentCreaturesDB["PetType"]);
            Info    = IntelligentCreatureInfo.GetCreatureInfo(PetType);

            CustomName     = readerIntelligentCreaturesDB["CustomName"].ToString();
            Fullness       = Convert.ToInt32(readerIntelligentCreaturesDB["Fullness"]);
            SlotIndex      = Convert.ToInt32(readerIntelligentCreaturesDB["SlotIndex"]);
            ExpireTime     = Convert.ToInt64(readerIntelligentCreaturesDB["ExpireTime"]);
            BlackstoneTime = Convert.ToInt64(readerIntelligentCreaturesDB["BlackstoneTime"]);

            petMode = (IntelligentCreaturePickupMode)Convert.ToByte(readerIntelligentCreaturesDB["PetMode"]);

            //Filter = new IntelligentCreatureItemFilter(reader);
            Filter = new IntelligentCreatureItemFilter();
            Filter.PetPickupAll         = Convert.ToBoolean(readerIntelligentCreaturesDB["PetPickupAll"]);
            Filter.PetPickupGold        = Convert.ToBoolean(readerIntelligentCreaturesDB["PetPickupGold"]);
            Filter.PetPickupWeapons     = Convert.ToBoolean(readerIntelligentCreaturesDB["PetPickupWeapons"]);
            Filter.PetPickupArmours     = Convert.ToBoolean(readerIntelligentCreaturesDB["PetPickupArmours"]);
            Filter.PetPickupHelmets     = Convert.ToBoolean(readerIntelligentCreaturesDB["PetPickupHelmets"]);
            Filter.PetPickupBoots       = Convert.ToBoolean(readerIntelligentCreaturesDB["PetPickupBoots"]);
            Filter.PetPickupBelts       = Convert.ToBoolean(readerIntelligentCreaturesDB["PetPickupBelts"]);
            Filter.PetPickupAccessories = Convert.ToBoolean(readerIntelligentCreaturesDB["PetPickupAccessories"]);
            Filter.PetPickupOthers      = Convert.ToBoolean(readerIntelligentCreaturesDB["PetPickupOthers"]);

            Filter.PickupGrade = (ItemGrade)Convert.ToByte(readerIntelligentCreaturesDB["PickupGrade"]);

            MaintainFoodTime = Convert.ToInt64(readerIntelligentCreaturesDB["MaintainFoodTime"]);//maintain food buff
        }
Esempio n. 3
0
        public UserIntelligentCreature(BinaryReader reader)
        {
            PetType = (IntelligentCreatureType)reader.ReadByte();
            Info    = IntelligentCreatureInfo.GetCreatureInfo(PetType);

            CustomName     = reader.ReadString();
            Fullness       = reader.ReadInt32();
            SlotIndex      = reader.ReadInt32();
            ExpireTime     = reader.ReadInt64();
            BlackstoneTime = reader.ReadInt64();

            petMode = (IntelligentCreaturePickupMode)reader.ReadByte();

            Filter = new IntelligentCreatureItemFilter(reader);
        }
Esempio n. 4
0
    public ClientIntelligentCreature(BinaryReader reader)
    {
        PetType = (IntelligentCreatureType)reader.ReadByte();
        Icon    = reader.ReadInt32();

        CustomName     = reader.ReadString();
        Fullness       = reader.ReadInt32();
        SlotIndex      = reader.ReadInt32();
        ExpireTime     = reader.ReadInt64();
        BlackstoneTime = reader.ReadInt64();

        petMode = (IntelligentCreaturePickupMode)reader.ReadByte();

        CreatureRules = new IntelligentCreatureRules(reader);
        Filter        = new IntelligentCreatureItemFilter(reader)
        {
            PickupGrade = (ItemGrade)reader.ReadByte()
        };
        MaintainFoodTime = reader.ReadInt64();
    }
Esempio n. 5
0
        public UserIntelligentCreature(IntelligentCreatureType creatureType, int slot, byte effect = 0)
        {
            PetType    = creatureType;
            Info       = IntelligentCreatureInfo.GetCreatureInfo(PetType);
            CustomName = Settings.IntelligentCreatureNameList[(byte)PetType];
            Fullness   = 7500;//starts at 75% food
            SlotIndex  = slot;

            if (effect > 0)
            {
                ExpireTime = effect * 86400;            //effect holds the amount in days
            }
            else
            {
                ExpireTime = -9999; //permanent
            }
            BlackstoneTime = 0;

            Filter = new IntelligentCreatureItemFilter();
        }
Esempio n. 6
0
        public UserIntelligentCreature(BinaryReader reader)
        {
            PetType = (IntelligentCreatureType)reader.ReadByte();
            Info    = IntelligentCreatureInfo.GetCreatureInfo(PetType);

            CustomName     = reader.ReadString();
            Fullness       = reader.ReadInt32();
            SlotIndex      = reader.ReadInt32();
            ExpireTime     = reader.ReadInt64();
            BlackstoneTime = reader.ReadInt64();

            petMode = (IntelligentCreaturePickupMode)reader.ReadByte();

            Filter = new IntelligentCreatureItemFilter(reader);
            if (Envir.LoadVersion > 48)
            {
                Filter.PickupGrade = (ItemGrade)reader.ReadByte();

                MaintainFoodTime = reader.ReadInt64();//maintain food buff
            }
        }
Esempio n. 7
0
        public UserIntelligentCreature(IntelligentCreatureType creatureType, int slot, byte effect = 0)
        {
            PetType    = creatureType;
            Info       = IntelligentCreatureInfo.GetCreatureInfo(PetType);
            CustomName = Envir.Main.GetMonsterInfo(64, (byte)PetType)?.Name ?? PetType.ToString();
            Fullness   = 7500;//starts at 75% food
            SlotIndex  = slot;

            if (effect > 0)
            {
                Expire = DateTime.Now.AddDays(effect);            //effect holds the amount in days
            }
            else
            {
                Expire = DateTime.MinValue; //permanent
            }
            BlackstoneTime   = 0;
            MaintainFoodTime = 0;

            Filter = new IntelligentCreatureItemFilter();
        }
Esempio n. 8
0
    public ClientIntelligentCreature(BinaryReader reader)
    {
        PetType = (IntelligentCreatureType)reader.ReadByte();
        Icon = reader.ReadInt32();

        CustomName = reader.ReadString();
        Fullness = reader.ReadInt32();
        SlotIndex = reader.ReadInt32();
        ExpireTime = reader.ReadInt64();
        BlackstoneTime = reader.ReadInt64();

        petMode = (IntelligentCreaturePickupMode)reader.ReadByte();

        CreatureRules = new IntelligentCreatureRules(reader);
        Filter = new IntelligentCreatureItemFilter(reader);
        Filter.PickupGrade = (ItemGrade)reader.ReadByte();
        MaintainFoodTime = reader.ReadInt64();
    }
Esempio n. 9
0
 public void Show(IntelligentCreatureItemFilter filter)
 {
     if (Visible) return;
     Filter = filter;
     Visible = true;
     RefreshFilter();
 }
Esempio n. 10
0
 private void ButtonClick(object sender, EventArgs e)
 {
     if (sender == OptionsSaveButton)
     {
         Filter.PickupGrade = GameScene.Scene.IntelligentCreatureOptionsGradeDialog.GradeType;
         GameScene.Scene.IntelligentCreatureOptionsGradeDialog.Hide();
         GameScene.Scene.IntelligentCreatureDialog.SaveItemFilter(Filter);
         Hide();
     }
     if (sender == OptionsCancelButton)
     {
         Filter = new IntelligentCreatureItemFilter();
         GameScene.Scene.IntelligentCreatureOptionsGradeDialog.GradeType = ItemGrade.None;
         GameScene.Scene.IntelligentCreatureOptionsGradeDialog.RefreshGradeFilter();
         GameScene.Scene.IntelligentCreatureOptionsGradeDialog.Hide();
         RefreshFilter();
         Hide();
     }
 }
Esempio n. 11
0
        public void SaveItemFilter(IntelligentCreatureItemFilter filter)
        {
            int selectedCreature = BeforeAfterDraw();
            if (selectedCreature < 0) return;

            GameScene.User.IntelligentCreatures[selectedCreature].Filter = filter;
            Network.Enqueue(new C.UpdateIntelligentCreature { Creature = GameScene.User.IntelligentCreatures[selectedCreature] });
        }
Esempio n. 12
0
        public UserIntelligentCreature(BinaryReader reader)
        {
            PetType = (IntelligentCreatureType)reader.ReadByte();
            Info = IntelligentCreatureInfo.GetCreatureInfo(PetType);

            CustomName = reader.ReadString();
            Fullness = reader.ReadInt32();
            SlotIndex = reader.ReadInt32();
            ExpireTime = reader.ReadInt64();
            BlackstoneTime = reader.ReadInt64();

            petMode = (IntelligentCreaturePickupMode)reader.ReadByte();

            Filter = new IntelligentCreatureItemFilter(reader);
            if (Envir.LoadVersion > 48)
            {
                Filter.PickupGrade = (ItemGrade)reader.ReadByte();

                MaintainFoodTime = reader.ReadInt64();//maintain food buff
            }
        }
Esempio n. 13
0
        public UserIntelligentCreature(IntelligentCreatureType creatureType, int slot, byte effect = 0)
        {
            PetType = creatureType;
            Info = IntelligentCreatureInfo.GetCreatureInfo(PetType);
            CustomName = Settings.IntelligentCreatureNameList[(byte)PetType];
            Fullness = 7500;//starts at 75% food
            SlotIndex = slot;

            if (effect > 0) ExpireTime = effect * 86400;//effect holds the amount in days
            else ExpireTime = -9999;//permanent

            BlackstoneTime = 0;
            MaintainFoodTime = 0;

            Filter = new IntelligentCreatureItemFilter();
        }