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 } }
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 }
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); }
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(); }
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 } }
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(); }