/// <summary> /// Grant the <see cref="Player"/> rewards from the <see cref="PathRewardEntry"/> /// </summary> /// <param name="pathRewardEntry">The entry containing items, spells, or titles, to be rewarded"/></param> private void GrantPathReward(PathRewardEntry pathRewardEntry) { if (pathRewardEntry == null) { throw new ArgumentNullException(); } // TODO: Check if there's bag space. Otherwise queue? Or is there an overflow inventory? if (pathRewardEntry.Item2Id > 0) { player.Inventory.ItemCreate(pathRewardEntry.Item2Id, 1, 4); } // TODO: Grant Spell rewards (needs PR #76) if (pathRewardEntry.CharacterTitleId > 0) { player.TitleManager.AddTitle((ushort)pathRewardEntry.CharacterTitleId); } }
/// <summary> /// Grant the <see cref="Player"/> rewards from the <see cref="PathRewardEntry"/> /// </summary> /// <param name="pathRewardEntry">The entry containing items, spells, or titles, to be rewarded"/></param> private void GrantPathReward(PathRewardEntry pathRewardEntry) { if (pathRewardEntry == null) { throw new ArgumentNullException(); } // TODO: Check if there's bag space. Otherwise queue? Or is there an overflow inventory? if (pathRewardEntry.Item2Id > 0) { player.Inventory.ItemCreate(pathRewardEntry.Item2Id, 1, ItemUpdateReason.PathReward); } if (pathRewardEntry.Spell4Id > 0) { Spell4Entry spell4Entry = GameTableManager.Spell4.GetEntry(pathRewardEntry.Spell4Id); player.SpellManager.AddSpell(spell4Entry.Spell4BaseIdBaseSpell); } if (pathRewardEntry.CharacterTitleId > 0) { player.TitleManager.AddTitle((ushort)pathRewardEntry.CharacterTitleId); } }