private void bnItem_Click(object sender, EventArgs e) { Function.SoundManager.PlayButtonSound(); this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); rewardType = EnumQuestRewardType.Item; }
public static void GiveEasyQuestReward(Player _player, EnumQuestRewardType _rewardType) { int xpReward = 0; Item itemReward = new Item(); int dustReward = 0; MessageForm mes = new MessageForm(""); Random r = new Random(); switch (_rewardType) { case EnumQuestRewardType.Experience: foreach (var item in _player.ControlledCharacters) { xpReward = (int)(item.CharXPToLevel * 0.10); item.CharRecieveXP(xpReward); mes = new MessageForm(item.UnitName + " received " + xpReward + " experience!"); mes.ShowDialog(); } break; case EnumQuestRewardType.Item: for (int i = 0; i < 2; i++) { int temp = r.Next(0, 101); int ilevel = _player.ControlledCharacters[r.Next(0,_player.ControlledCharacters.Count)].UnitLevel-2; if (ilevel < 1) ilevel = 1; if(temp >=85 && ilevel > 10) { itemReward = ItemGeneration.ReturnEpocalItem(ilevel); } else { itemReward = ItemGeneration.GenerateFabledItem(ilevel); } _player.AddItemToInventory(itemReward); mes = new MessageForm("You received an " + itemReward.ItemQuality + " item:" + Environment.NewLine + itemReward.ItemName); mes.ShowDialog(); } break; case EnumQuestRewardType.Dust: foreach (var item in _player.ControlledCharacters) { dustReward += (int)(item.UnitLevel * 2); } mes = new MessageForm("You received a total of " + dustReward + " Dust!"); _player.Dust += dustReward; mes.ShowDialog(); break; default: break; } }
public static void GiveVeryHardQuestReward(Player _player, EnumQuestRewardType _rewardType) { int xpReward = 0; Item itemReward = new Item(); int dustReward = 0; MessageForm mes = new MessageForm(""); Random r = new Random(); switch (_rewardType) { case EnumQuestRewardType.Experience: foreach (var item in _player.ControlledCharacters) { xpReward = (int)(item.CharXPToLevel * 0.25); item.CharRecieveXP(xpReward); mes = new MessageForm(item.UnitName + " received " + xpReward + " experience!"); mes.ShowDialog(); } break; case EnumQuestRewardType.Item: for (int i = 0; i < 2; i++) { int temp = r.Next(0, 101); int ilevel = _player.ControlledCharacters[r.Next(0, _player.ControlledCharacters.Count)].UnitLevel + 4; if (ilevel < 1) { ilevel = 1; } if (temp >= 70 && ilevel > 10) { itemReward = ItemGeneration.ReturnEpocalItem(ilevel); } else { itemReward = ItemGeneration.GenerateFabledItem(ilevel); } _player.AddItemToInventory(itemReward); mes = new MessageForm("You received an " + itemReward.ItemQuality + " item:" + Environment.NewLine + itemReward.ItemName); mes.ShowDialog(); } break; case EnumQuestRewardType.Dust: foreach (var item in _player.ControlledCharacters) { dustReward += (int)(item.UnitLevel * 5); } mes = new MessageForm("You received a total of " + dustReward + " Dust!"); _player.Dust += dustReward; mes.ShowDialog(); break; default: break; } }