public ResetStatsEnum ResetStats() { if (this.CurrentAccount == null || this.CurrentAccount.ActiveCharacter == null) { return(ResetStatsEnum.Error); } if (!this.CurrentAccount.ActiveCharacter.SubtractMoney((uint)CharacterFormulas.CalcGoldAmountToResetStats( this.CurrentAccount.ActiveCharacter.Asda2Strength, this.CurrentAccount.ActiveCharacter.Asda2Agility, this.CurrentAccount.ActiveCharacter.Asda2Stamina, this.CurrentAccount.ActiveCharacter.Asda2Spirit, this.CurrentAccount.ActiveCharacter.Asda2Luck, this.CurrentAccount.ActiveCharacter.Asda2Intellect, (byte)this.CurrentAccount.ActiveCharacter.Level, (int)(byte)this.CurrentAccount.ActiveCharacter.Record.RebornCount))) { return(ResetStatsEnum.NotEnoughtMoney); } this.CurrentAccount.ActiveCharacter.ResetStatPoints(); this.CurrentAccount.ActiveCharacter.SendMoneyUpdate(); return(ResetStatsEnum.Ok); }
public ResetStatsEnum ResetStats() { if (CurrentAccount == null || CurrentAccount.ActiveCharacter == null) { return(ResetStatsEnum.Error); } var goldToReset = CharacterFormulas.CalcGoldAmountToResetStats(CurrentAccount.ActiveCharacter.Asda2Strength, CurrentAccount.ActiveCharacter.Asda2Agility, CurrentAccount.ActiveCharacter.Asda2Stamina, CurrentAccount.ActiveCharacter.Asda2Spirit, CurrentAccount.ActiveCharacter.Asda2Luck, CurrentAccount.ActiveCharacter.Asda2Intellect, (byte)CurrentAccount.ActiveCharacter.Level, (byte) CurrentAccount.ActiveCharacter.Record.RebornCount); if (!CurrentAccount.ActiveCharacter.SubtractMoney((uint)goldToReset)) { return(ResetStatsEnum.NotEnoughtMoney); } CurrentAccount.ActiveCharacter.ResetStatPoints(); CurrentAccount.ActiveCharacter.SendMoneyUpdate(); return(ResetStatsEnum.Ok); }