private static void ReadEquips() { ushort Count = Reader.ReadUInt16(); for (ushort i = 0; i < Count; i++) { EquipData eq = new EquipData(); eq.ID = Reader.ReadInt32(); eq.isCash = Reader.ReadBoolean(); eq.Type = ReadString(); eq.RequiredLevel = Reader.ReadByte(); eq.Scrolls = (byte)Reader.ReadUInt16(); eq.RequiredDexterity = Reader.ReadUInt16(); eq.RequiredIntellect = Reader.ReadUInt16(); eq.RequiredLuck = Reader.ReadUInt16(); eq.RequiredStrength = Reader.ReadUInt16(); eq.RequiredJob = Reader.ReadUInt16(); eq.Price = Reader.ReadInt32(); eq.Strength = Reader.ReadInt16(); eq.Dexterity = Reader.ReadInt16(); eq.Intellect = Reader.ReadInt16(); eq.Luck = Reader.ReadInt16(); eq.MagicDefense = Reader.ReadByte(); eq.WeaponDefense = Reader.ReadByte(); eq.WeaponAttack = Reader.ReadByte(); eq.MagicAttack = Reader.ReadByte(); eq.Speed = Reader.ReadByte(); eq.Jump = Reader.ReadByte(); eq.Accuracy = Reader.ReadByte(); eq.Avoidance = Reader.ReadByte(); eq.HP = Reader.ReadInt16(); eq.MP = Reader.ReadInt16(); Equips.Add(eq.ID, eq); } }
private static bool canWearItem(Character chr, CharacterPrimaryStats stats, EquipData data, short slot) { // Non-cash item on cash item slot if (!data.Cash && slot > 100) { return(false); } // Cash item on non-cash item slot else if (data.Cash && slot > 0 && slot < 100) { return(false); } else if (!Constants.IsCorrectBodyPart(data.ID, data.Cash ? (short)(slot - 100) : slot, chr.Gender)) { return(false); } else { return(stats.getTotalStr() >= data.RequiredStrength && stats.getTotalDex() >= data.RequiredDexterity && stats.getTotalInt() >= data.RequiredIntellect && stats.getTotalLuk() >= data.RequiredLuck && (stats.Fame >= data.RequiredFame || data.RequiredFame == 0) && stats.Level >= data.RequiredLevel && isRequiredJob(Constants.getJobTrack(stats.Job), data.RequiredJob)); } }
public void GiveStats(bool DoRandom) { if (!DataProvider.Equips.ContainsKey(ItemID)) { return; } EquipData data = DataProvider.Equips[ItemID]; Str = (short)(DoRandom ? GetRandomStat(2, data.Strength) : data.Strength); Dex = (short)(DoRandom ? GetRandomStat(2, data.Dexterity) : data.Dexterity); Int = (short)(DoRandom ? GetRandomStat(2, data.Intellect) : data.Intellect); Luk = (short)(DoRandom ? GetRandomStat(2, data.Luck) : data.Luck); HP = (short)(DoRandom ? GetRandomStat(10, data.HP) : data.HP); MP = (short)(DoRandom ? GetRandomStat(10, data.MP) : data.MP); Watk = (short)(DoRandom ? GetRandomStat(10, data.WeaponAttack) : data.WeaponAttack); Wdef = (short)(DoRandom ? GetRandomStat(10, data.WeaponDefense) : data.WeaponDefense); Matk = (short)(DoRandom ? GetRandomStat(10, data.MagicAttack) : data.MagicAttack); Mdef = (short)(DoRandom ? GetRandomStat(10, data.MagicDefense) : data.MagicDefense); Acc = (short)(DoRandom ? GetRandomStat(2, data.Accuracy) : data.Accuracy); Avo = (short)(DoRandom ? GetRandomStat(2, data.Avoidance) : data.Avoidance); Hands = (short)(DoRandom ? GetRandomStat(4, data.Hands) : data.Hands); Speed = (short)(DoRandom ? GetRandomStat(4, data.Speed) : data.Speed); Jump = (short)(DoRandom ? GetRandomStat(2, data.Jump) : data.Jump); }