Beispiel #1
0
        private void creatureCopy_Click(object sender, RoutedEventArgs e)
        {
            creature_template c = creatureList.SelectedItem as creature_template;

            if (c == null)
            {
                return;
            }

            creature_template c2 = WorldWorker.GetCreatureTemplate(c.entry);

            if (c2 == null)
            {
                return;
            }
            WorldWorker.SetEntityState(c2, System.Data.EntityState.Added);

            int id = (from d in LegacyToolBox.Data.CreatureTemplate select d.entry).Max() + 1;

            c2.entry = id;

            LegacyToolBox.Data.CreatureTemplate.Add(c2);
            WorldWorker.SaveCreatureTemplate(c2);
            LegacyToolBox.AppendMessage("Creature " + c.entry + " To Creature " + c2.entry + " Copied.");
        }
Beispiel #2
0
        public void SaveCreatureTemplate(creature_template c)
        {
            var o = (from d in CreatureTemplate where d.entry == c.entry select d).SingleOrDefault();

            if (o != null)
            {
                CreatureTemplate.Remove(o);
            }
            CreatureTemplate.Add(c);
            WorldWorker.SaveCreatureTemplate(c);
        }
Beispiel #3
0
 private void creatureTab_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.S)
     {
         creature_template c = creatureList.SelectedItem as creature_template;
         if (c != null)
         {
             WorldWorker.SaveCreatureTemplate(c);
             LegacyToolBox.AppendMessage("Creature Template " + c.entry + " Saved.", "#FF00FF00");
         }
         e.Handled = true;
     }
 }