Exemple #1
0
        public CharacterItemRecord Add(ushort gid, uint quantity, bool notif = true, bool refresh = true)
        {
            ItemRecord template = ItemRecord.GetItem(gid);

            if (template == null)
            {
                Character.Reply("L'item n'éxiste pas");
                return(null);
            }
            var newObjitem = template.GenerateRandomObjectItem();

            newObjitem.quantity = quantity;
            CharacterItemRecord newItem = new CharacterItemRecord(newObjitem, Character.Id);

            ItemCustomEffects.Instance.Init(newItem);
            Add(newItem, refresh);
            if (notif)
            {
                Character.Reply("Vous avez obtenu " + quantity + " " + template.Name);
            }
            return(newItem);
        }