Example #1
0
 public void UpdateBreedSpells(bool sendpackets = true)
 {
     foreach (var spell in BreedSpellRecord.GetBreedSpellsForLevel(Record.Level, Record.Breed, Spells.ConvertAll <short>(x => (short)x.spellId)))
     {
         SaveTask.AddElement(new CharacterSpellRecord(CharacterSpellRecord.CharactersSpells.PopNextId <CharacterSpellRecord>(x => x.Id), Id, spell.spellId, 1));
         SaveTask.AddElement(new SpellShortcutRecord(SpellShortcutRecord.SpellsShortcuts.PopNextId <SpellShortcutRecord>(x => x.Id), Id, (ushort)spell.spellId, SpellShortcutRecord.GetFreeSlotId(Id)));
     }
     if (sendpackets)
     {
         RefreshShortcuts();
         RefreshSpells();
     }
 }
Example #2
0
 public bool LearnSpell(ushort spellid)
 {
     if (Spells.Contains <SpellItem>(x => x.spellId == spellid))
     {
         Client.Character.Reply("Vous connaissez déja ce sort.");
         return(false);
     }
     new CharacterSpellRecord(CharacterSpellRecord.CharactersSpells.PopNextId <CharacterSpellRecord>(x => x.Id), Id, spellid, 1).AddElement();
     new SpellShortcutRecord(SpellShortcutRecord.SpellsShortcuts.PopNextId <SpellShortcutRecord>(x => x.Id), Id, spellid, SpellShortcutRecord.GetFreeSlotId(Id)).AddElement();
     RefreshShortcuts();
     RefreshSpells();
     Client.Character.Reply("Vous avez appris un nouveau sort!");
     return(true);
 }