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); }
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); }
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(); }
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(); }