Exemplo n.º 1
0
        public void HandleActionMagicRemoveSpellId(uint spellId)
        {
            if (!Biota.TryRemoveKnownSpell((int)spellId, out _, BiotaDatabaseLock))
            {
                log.Error("Invalid spellId passed to Player.RemoveSpellFromSpellBook");
                return;
            }

            ChangesDetected = true;

            GameEventMagicRemoveSpellId removeSpellEvent = new GameEventMagicRemoveSpellId(Session, spellId);

            Session.Network.EnqueueSend(removeSpellEvent);
        }
Exemplo n.º 2
0
        public void RemoveSpellIdGameAction(uint spellId)
        {
            var result = Biota.BiotaPropertiesSpellBook.FirstOrDefault(x => x.Spell == spellId);

            if (result == null)
            {
                log.Error("Invalid spellId passed to Player.RemoveSpellFromSpellBook");
                return;
            }

            DatabaseManager.Shard.RemoveEntity(result, null);

            Biota.BiotaPropertiesSpellBook.Remove(result);

            GameEventMagicRemoveSpellId removeSpellEvent = new GameEventMagicRemoveSpellId(Session, spellId);

            Session.Network.EnqueueSend(removeSpellEvent);
        }
Exemplo n.º 3
0
        public void HandleActionMagicRemoveSpellId(uint spellId)
        {
            new ActionChain(this, () =>
            {
                var entity = Biota.BiotaPropertiesSpellBook.FirstOrDefault(x => x.Spell == spellId);

                if (entity == null)
                {
                    log.Error("Invalid spellId passed to Player.RemoveSpellFromSpellBook");
                    return;
                }

                Biota.BiotaPropertiesSpellBook.Remove(entity);
                entity.Object   = null;
                ChangesDetected = true;

                GameEventMagicRemoveSpellId removeSpellEvent = new GameEventMagicRemoveSpellId(Session, spellId);
                Session.Network.EnqueueSend(removeSpellEvent);
            }).EnqueueChain();
        }
Exemplo n.º 4
0
        public void HandleActionMagicRemoveSpellId(uint spellId)
        {
            new ActionChain(this, () =>
            {
                var entity = Biota.BiotaPropertiesSpellBook.FirstOrDefault(x => x.Spell == spellId);

                if (entity == null)
                {
                    log.Error("Invalid spellId passed to Player.RemoveSpellFromSpellBook");
                    return;
                }

                Biota.BiotaPropertiesSpellBook.Remove(entity);
                entity.Object = null;

                if (ExistsInDatabase && entity.Id != 0)
                {
                    DatabaseManager.Shard.RemoveEntity(entity, null);
                }

                GameEventMagicRemoveSpellId removeSpellEvent = new GameEventMagicRemoveSpellId(Session, spellId);
                Session.Network.EnqueueSend(removeSpellEvent);
            }).EnqueueChain();
        }