// ^ Skill check ^ /// <summary> /// Initializes upgrade effect, setting required default values. /// You should generally use this constructor! /// </summary> /// <param name="type"></param> public UpgradeEffect(UpgradeType type) { Type = type; Unk1 = 0; Unk2 = 0; Stat = 0; ValueType = 0; Value = 0; SkillId = 0; SkillVar = 0; Unk4 = 0x0A; Unk5 = 0; CheckType = UpgradeCheckType.None; CheckStat = 0; CheckRace = 0; CheckPtj = 0; CheckMonth = 0; CheckBroken = false; CheckTitleId = 0; CheckCondition = 0; CheckValueType = 0; CheckValue = 0; CheckSkillId = 0; CheckSkillRank = 0; }
/// <summary> /// Changes effect to check if the given race is supported by the /// item owner. /// </summary> /// <param name="race"></param> public void SetSupportCheck(SupportRace race) { CheckType = UpgradeCheckType.WhenSupporting; CheckRace = race; CheckValueType = 0; CheckValue = 0; }
/// <summary> /// Changes effect to check if today is the given Erinn month. /// </summary> /// <param name="month"></param> public void SetMonthCheck(Month month) { CheckType = UpgradeCheckType.WhileBeing; CheckMonth = month; CheckValueType = 0; CheckValue = 0; }
/// <summary> /// Changes effect to check if the item is broken (0 durability). /// </summary> /// <param name="broken">False = intact, True = broken.</param> public void SetBrokenCheck(bool broken) { CheckType = UpgradeCheckType.WhenBroken; CheckBroken = broken; CheckValueType = 0; CheckValue = 0; }
/// <summary> /// Changes effect to check for the given summon to be there. /// </summary> /// <param name="summonStat"></param> public void SetSummonCheck(UpgradeStat summonStat) { if (summonStat != UpgradeStat.Pet && summonStat != UpgradeStat.BarrierSpikes && summonStat != UpgradeStat.Golem) { throw new ArgumentException(summonStat + " is not a summon stat."); } CheckType = UpgradeCheckType.WhileSummoned; CheckStat = summonStat; CheckValueType = 0; CheckValue = 0; }
/// <summary> /// Changes effect to check for a skill rank. /// </summary> /// <param name="skillId"></param> /// <param name="checkType">SkillRankEqual, SkillRankGreaterThan, or SkillRankLowerThan</param> /// <param name="rank"></param> public void SetSkillCheck(SkillId skillId, UpgradeCheckType checkType, SkillRank rank) { if (checkType < UpgradeCheckType.SkillRankEqual || checkType > UpgradeCheckType.SkillRankLowerThan) { throw new ArgumentException(checkType + " is not a skill check."); } CheckType = checkType; CheckSkillId = skillId; CheckValue = 0; CheckSkillRank = rank; }
/// <summary> /// Changes effect to check a stat for a value. /// </summary> /// <param name="stat"></param> /// <param name="checkType"></param> /// <param name="value"></param> public void SetStatCheck(UpgradeStat stat, UpgradeCheckType checkType, short value, UpgradeValueType valueType) { if (checkType < UpgradeCheckType.GreaterThan || checkType > UpgradeCheckType.Equal) { throw new ArgumentException(checkType + " is not a stat check."); } CheckType = checkType; CheckStat = stat; CheckValueType = valueType; CheckValue = value; }
/// <summary> /// Changes effect to check if the given PTJ has been done x times. /// </summary> /// <param name="ptjType"></param> /// <param name="count"></param> public void SetPtjCheck(PtjType ptjType, int count) { CheckType = UpgradeCheckType.IfPtjCompletedMoreThan; CheckPtj = ptjType; CheckValue = (short)count; }
/// <summary> /// Changes effect to check for the given condition. /// </summary> /// <param name="conditionId"></param> public void SetConditionCheck(int conditionId) { CheckType = UpgradeCheckType.InAStateOf; CheckCondition = (ushort)conditionId; CheckValue = 0; }
/// <summary> /// Changes effect to check if the creature uses the given title. /// </summary> /// <param name="titleId"></param> public void SetTitleCheck(int titleId) { CheckType = UpgradeCheckType.HoldingTitle; CheckTitleId = (ushort)titleId; CheckValue = 0; }
/// <summary> /// Changes effect to check if the item is broken (0 durability). /// </summary> /// <param name="broken">False = intact, True = broken.</param> public void SetBrokenCheck(bool broken) { CheckType = UpgradeCheckType.WhenBroken; CheckBroken = broken; CheckValueType = 0; CheckValue = 0; }
/// <summary> /// Changes effect to check a stat for a value. /// </summary> /// <param name="stat"></param> /// <param name="checkType"></param> /// <param name="value"></param> public void SetStatCheck(UpgradeStat stat, UpgradeCheckType checkType, short value, UpgradeValueType valueType) { if (checkType < UpgradeCheckType.GreaterThan || checkType > UpgradeCheckType.Equal) throw new ArgumentException(checkType + " is not a stat check."); CheckType = checkType; CheckStat = stat; CheckValueType = valueType; CheckValue = value; }
/// <summary> /// Changes effect to check if the given race is supported by the /// item owner. /// </summary> /// <param name="race"></param> public void SetSupportCheck(SupportRace race) { CheckType = UpgradeCheckType.WhenSupporting; CheckRace = race; CheckValueType = 0; CheckValue = 0; }
/// <summary> /// Changes effect to check for the given summon to be there. /// </summary> /// <param name="summonStat"></param> public void SetSummonCheck(UpgradeStat summonStat) { if (summonStat != UpgradeStat.Pet && summonStat != UpgradeStat.BarrierSpikes && summonStat != UpgradeStat.Golem) throw new ArgumentException(summonStat + " is not a summon stat."); CheckType = UpgradeCheckType.WhileSummoned; CheckStat = summonStat; CheckValueType = 0; CheckValue = 0; }
/// <summary> /// Changes effect to check if today is the given Erinn month. /// </summary> /// <param name="month"></param> public void SetMonthCheck(Month month) { CheckType = UpgradeCheckType.WhileBeing; CheckMonth = month; CheckValueType = 0; CheckValue = 0; }
/// <summary> /// Changes effect to check if the given PTJ has been done x times. /// </summary> /// <param name="ptjType"></param> /// <param name="count"></param> public void SetPtjCheck(PtjType ptjType, int count) { CheckType = UpgradeCheckType.IfPtjCompletedMoreThan; CheckPtj = ptjType; CheckValue = (short)count; }
/// <summary> /// Changes effect to check for the given condition. /// </summary> /// <param name="conditionId"></param> public void SetConditionCheck(int conditionId) { CheckType = UpgradeCheckType.InAStateOf; CheckCondition = (ushort)conditionId; CheckValue = 0; }
/// <summary> /// Changes effect to check if the creature uses the given title. /// </summary> /// <param name="titleId"></param> public void SetTitleCheck(int titleId) { CheckType = UpgradeCheckType.HoldingTitle; CheckTitleId = (ushort)titleId; CheckValue = 0; }
// ^ Skill check ^ /// <summary> /// Initializes upgrade effect, setting required default values. /// You should generally use this constructor! /// </summary> /// <param name="type"></param> public UpgradeEffect(UpgradeType type) { Type = type; Unk1 = 0; Unk2 = 0; Stat = 0; ValueType = 0; Value = 0; SkillId = 0; SkillVar = 0; Unk4 = 0x0A; Unk5 = 0; CheckType = UpgradeCheckType.None; CheckStat = 0; CheckRace = 0; CheckPtj = 0; CheckMonth = 0; CheckBroken = false; CheckTitleId = 0; CheckCondition = 0; CheckValueType = 0; CheckValue = 0; CheckSkillId = 0; CheckSkillRank = 0; }
/// <summary> /// Changes effect to check for a skill rank. /// </summary> /// <param name="skillId"></param> /// <param name="checkType">SkillRankEqual, SkillRankGreaterThan, or SkillRankLowerThan</param> /// <param name="rank"></param> public void SetSkillCheck(SkillId skillId, UpgradeCheckType checkType, SkillRank rank) { if (checkType < UpgradeCheckType.SkillRankEqual || checkType > UpgradeCheckType.SkillRankLowerThan) throw new ArgumentException(checkType + " is not a skill check."); CheckType = checkType; CheckSkillId = skillId; CheckValue = 0; CheckSkillRank = rank; }