public virtual void Reward(PlayerMobile player, CollectionItem reward, int hue) { Item item = QuestHelper.Construct(reward.Type) as Item; if (item != null && player.AddToBackpack(item)) { if (hue > 0) { item.Hue = hue; } player.AddCollectionPoints(this.CollectionID, (int)reward.Points * -1); player.SendLocalizedMessage(1073621); // Your reward has been placed in your backpack. player.PlaySound(0x5A7); } else if (item != null) { player.SendLocalizedMessage(1074361); // The reward could not be given. Make sure you have room in your pack. item.Delete(); } reward.OnGiveReward(player, this, hue); player.SendGump(new ComunityCollectionGump(player, this, this.Location)); }
public virtual void Reward(PlayerMobile player, CollectionItem reward, int hue) { Item item = QuestHelper.Construct(reward.Type) as Item; if (item != null && player.AddToBackpack(item)) { if (hue > 0) item.Hue = hue; player.AddCollectionPoints(this.CollectionID, (int)reward.Points * -1); player.SendLocalizedMessage(1073621); // Your reward has been placed in your backpack. player.PlaySound(0x5A7); } else if (item != null) { player.SendLocalizedMessage(1074361); // The reward could not be given. Make sure you have room in your pack. item.Delete(); } reward.OnGiveReward(player, this, hue); player.SendGump(new ComunityCollectionGump(player, this, this.Location)); }