public BroadcastTextEditor(gossip_menu_option o, bool boxText = false) { InitializeComponent(); Util.AssignDefine(language, LegacyToolBox.Data.Language); Util.AssignDefine(emote0, LegacyToolBox.Data.Emotes); Util.AssignDefine(emote1, LegacyToolBox.Data.Emotes); Util.AssignDefine(emote2, LegacyToolBox.Data.Emotes); if (boxText) { _Text = WorldWorker.GetBroadCastText(o.BoxBroadcastTextID); } else { _Text = WorldWorker.GetBroadCastText(o.OptionBroadcastTextID); } if (_Text == null || _Text.ID == 0) { _Text = WorldWorker.CreateNewBroadCastText(); if (boxText) { o.BoxBroadcastTextID = _Text.ID; } else { o.OptionBroadcastTextID = _Text.ID; } } bctGrid.DataContext = _Text; }
private void researchList_SelectionChanged(object sender, SelectionChangedEventArgs e) { capital_city_research_data data = researchList.SelectedItem as capital_city_research_data; if (data == null) // set filter changed { return; } _SelectedResearchData = data; researchGrid.DataContext = data; if (data.Description != 0) { npc_text t = WorldWorker.GetNpcText(data.Description); _SelectedNpcText = t; if (t != null) { broadcast_text b = WorldWorker.GetBroadCastText(t.BroadcastTextID0); _SelectedBroadcastText = b; if (b != null) { Binding binding = new Binding(); binding.Source = b; binding.Path = new PropertyPath("MaleText"); descriptionText.SetBinding(TextBox.TextProperty, binding); } } } else { _SelectedNpcText = null; _SelectedBroadcastText = null; descriptionText.Text = ""; } if (data.Spell != 0) { capital_city_research_trainer_data t = WorldWorker.GetResearchSpell(data.Spell); _SelectedResearchSpell = t; } else { _SelectedResearchSpell = null; } if (data.Item != 0) { capital_city_research_vendor_data t = WorldWorker.GetResearchItem(data.Item); _SelectedResearchItem = t; } else { _SelectedResearchItem = null; } researchSpellGrid.DataContext = _SelectedResearchSpell; researchItemGrid.DataContext = _SelectedResearchItem; _ResearchQuest = WorldWorker.GetResearchQuests(_SelectedResearchData.QuestSet); researchQuestList.ItemsSource = _ResearchQuest; }
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."); }
public static void AddToSkill(int spell, int skill, int reqSkillValue, int high, int low) { var sk = (from d in LegacyToolBox.Data.SkillLineAbility where d.Spell == spell select d).SingleOrDefault(); if (sk != null) { sk.Skill = skill; } else { SkillLineAbilities.Add(new SkillLineAbility() { ID = (from d in SkillLineAbilities select d.ID).Max() + 1, Skill = skill, Spell = spell, Race = 0, Class = 0, RequiredSkillValue = reqSkillValue, SupercededBySpell = 0, AccquiredMethod = 0, SkillLineRankHigh = high, SkillLineRankLow = low }); } WorldWorker.SaveSkillLineAbility(LegacyToolBox.Data.SkillLineAbility); }
private void SaveGossipTextBct() { if (_bct0 != null) { WorldWorker.SaveBroadCastText(_bct0); } if (_bct1 != null) { WorldWorker.SaveBroadCastText(_bct1); } if (_bct2 != null) { WorldWorker.SaveBroadCastText(_bct2); } if (_bct3 != null) { WorldWorker.SaveBroadCastText(_bct3); } if (_bct4 != null) { WorldWorker.SaveBroadCastText(_bct4); } if (_bct5 != null) { WorldWorker.SaveBroadCastText(_bct5); } if (_bct6 != null) { WorldWorker.SaveBroadCastText(_bct6); } if (_bct7 != null) { WorldWorker.SaveBroadCastText(_bct7); } }
private void researchSetNew_Click(object sender, RoutedEventArgs e) { capital_city_research_set set = WorldWorker.CreateNewResearchSet(); LegacyToolBox.Data.ResearchSet.Add(set); LegacyToolBox.AppendMessage("Research Set " + set.ID + " Created."); }
private void itemIconCreateSaveDisplayId_Click(object sender, RoutedEventArgs e) { if (Item == null) { return; } // no need finding old ones cuz this is FAST ENOUGH! int id = (from d in LegacyToolBox.Data.ItemDisplayInfo select d.ID).Max() + 1; int groupSound = (int)itemGroupSound.SelectedValue; LegacyToolBox.Data.ItemDisplayInfo.Add(new ItemDisplayInfo() { ID = id, Icon1 = SelectedIconName, GroupSoundIndex = groupSound, GeosetGroup1 = 0, GeosetGroup2 = 0, GeosetGroup3 = 0, SpellVisualID = 0, HelmetGeosetFemale = 0, HelmetGeosetMale = 0, ItemVisual = 0, ParticleColorID = 0 }); Item.displayid = id; WorldWorker.SaveItemTemplate(Item); itemIconCreateID.Text = id.ToString(); WorldWorker.SaveItemDisplayInfo(LegacyToolBox.Data.ItemDisplayInfo); }
private void createQuestSet_Click(object sender, RoutedEventArgs e) { capital_city_research_quest q = WorldWorker.CreateNewResearchQuest(); _ResearchQuest.Add(q); questSet.Text = q.QuestSet.ToString(); _SelectedResearchData.QuestSet = q.QuestSet; }
private void gossipText7New_Click(object sender, RoutedEventArgs e) { broadcast_text t = WorldWorker.CreateNewBroadCastText(); _bct7 = t; bct7.DataContext = t; _SelectedNpcText.BroadcastTextID7 = t.ID; }
private void SaveGossipItems() { if (_SelectedGossipItems != null && _SelectedGossipItems.Count != 0) { int wipe = _SelectedGossipItems[0].menu_id; WorldWorker.SaveGossipOptions(_SelectedGossipItems, wipe); } }
private void questDelete_Click(object sender, RoutedEventArgs e) { quest_template o = questList.SelectedItem as quest_template; WorldWorker.DeleteQuestTemplate(o.Id); LegacyToolBox.Data.QuestTemplate.Remove(o); LegacyToolBox.AppendMessage("Quest " + o.Id + " Deleted."); }
private void gossipMenuItemNew_Click(object sender, RoutedEventArgs e) { if (_SelectedGossipMenu == null) { return; } WorldWorker.CreateNewGossipItem(_SelectedGossipMenu.entry); LoadGossipMenuItems(_SelectedGossipMenu.entry); }
public void Save() { List <npc_trainer> list = trainerInfoGrid.ItemsSource as List <npc_trainer>; if (list != null && list.Count != 0) { WorldWorker.SaveNpcTrainer(list, _entry); } statusLabel.Content = "Saved."; }
private void questCreate_Click(object sender, RoutedEventArgs e) { quest_template q = WorldWorker.GetQuestTemplate(26035); WorldWorker.SetEntityState(q, EntityState.Added); q.Id = WorldWorker.GenerateNextQuestEntry(); WorldWorker.SaveQuestTemplate(q); LegacyToolBox.Data.QuestTemplate.Add(q); LegacyToolBox.AppendMessage("New Quest " + q.Id + " Created."); }
private void Save() { VendorData = vendorData.ItemsSource as List <npc_vendor>; if (VendorData == null || VendorEntry == 0) { return; } WorldWorker.SaveNpcVendor(VendorData, VendorEntry); }
private void researchQuestNew_Click(object sender, RoutedEventArgs e) { if (_SelectedResearchData == null) { return; } capital_city_research_quest q = WorldWorker.CreateNewResearchQuest(_SelectedResearchData.QuestSet); _ResearchQuest.Add(q); }
private void questCopy_Click(object sender, RoutedEventArgs e) { quest_template o = questList.SelectedItem as quest_template; quest_template q = WorldWorker.GetQuestTemplate(o.Id); WorldWorker.SetEntityState(q, EntityState.Added); q.Id = WorldWorker.GenerateNextQuestEntry(); WorldWorker.SaveQuestTemplate(q); LegacyToolBox.Data.QuestTemplate.Add(q); LegacyToolBox.AppendMessage("Quest " + o.Id + " To Quest " + q.Id + " Copied."); }
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); }
private void menuItemDelete_Click(object sender, RoutedEventArgs e) { if (_SelectedMenuItem == null) { return; } WorldWorker.DeleteGossipOption(_SelectedMenuItem); LoadGossipMenuItems(_SelectedMenuItem.menu_id); _SelectedMenuItem = null; }
private void recipeGrid_KeyDown(object sender, KeyEventArgs e) { if (e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.S) { compound_recipe recipe = compoundRecipeList.SelectedItem as compound_recipe; if (recipe != null) { WorldWorker.SaveCompoundRecipe(recipe); LegacyToolBox.AppendMessage("Compound Recipe " + recipe.ID + " Saved."); } } }
private void researchDataNew_Click(object sender, RoutedEventArgs e) { if (_SelectedResearchSet == null) { return; } capital_city_research_data data = WorldWorker.CreateNewResearchData(_SelectedResearchSet.ID); LegacyToolBox.Data.ResearchData.Add(data); LegacyToolBox.AppendMessage("Research Data For Set " + data.ResearchSet + " Rank " + data.Rank + " Created."); }
private void Save() { if (_q == null) { return; } WorldWorker.SaveCreatureQuestStarter(_CQuestStarter); WorldWorker.SaveCreatureQuestEnder(_CQuestEnder); WorldWorker.SaveGoQuestStarter(_GQuestStarter); WorldWorker.SaveGoQuestEnder(_GQuestEnder); this.Title = "Relation of Quest " + _q.Id + " Saved."; }
public void Load(int entry) { if (entry == 0) { _entry = 0; trainerInfoGrid.ItemsSource = null; return; } _entry = entry; trainerInfoGrid.ItemsSource = WorldWorker.GetNpcTrainer(entry); }
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; } }
private void questTab_KeyDown(object sender, KeyEventArgs e) { if (e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.S) { quest_template q = questList.SelectedItem as quest_template; if (q != null) { WorldWorker.SaveQuestTemplate(q); } LegacyToolBox.AppendMessage("Quest Template " + q.Id + " Saved."); e.Handled = true; } }
private void questSet_TextChanged(object sender, TextChangedEventArgs e) { try { int set = Convert.ToInt32(questSet.Text); _ResearchQuest = WorldWorker.GetResearchQuests(set); researchQuestList.ItemsSource = _ResearchQuest; } catch (System.Exception /*ex*/) { // } }
private void researchSetDelete_Click(object sender, RoutedEventArgs e) { capital_city_research_set set = researchSetList.SelectedItem as capital_city_research_set; if (set == null) { return; } int id = set.ID; WorldWorker.DeleteResearchSet(id); LegacyToolBox.Data.ResearchSet.Remove(set); LegacyToolBox.AppendMessage("Research Set " + id + " Deleted."); }
public QuestRelations(quest_template q) { InitializeComponent(); _q = q; _CQuestStarter = WorldWorker.GetCreatureQuestStarter(q.Id); _CQuestEnder = WorldWorker.GetCreatureQuestEnder(q.Id); _GQuestStarter = WorldWorker.GetGoQuestStarter(q.Id); _GQuestEnder = WorldWorker.GetGoQuestEnder(q.Id); questGrid.DataContext = _q; npcStarter.ItemsSource = _CQuestStarter; npcEnder.ItemsSource = _CQuestEnder; goStarter.ItemsSource = _GQuestStarter; goEnder.ItemsSource = _GQuestEnder; }
public void SaveItemTemplate(item_template t) { var o = (from d in ItemTemplate where d.entry == t.entry select d).SingleOrDefault(); if (o != null) { o = t; } else { ItemTemplate.Add(t); } WorldWorker.SaveItemTemplate(t); }
private void gossipGrid_KeyDown(object sender, KeyEventArgs e) { if (e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.S) { if (_SelectedGossipMenu != null) { WorldWorker.SaveGossipMenu(_SelectedGossipMenu); } if (_SelectedNpcText != null) { WorldWorker.SaveNpcText(_SelectedNpcText); } if (_bct0 != null) { WorldWorker.SaveBroadCastText(_bct0); } if (_bct1 != null) { WorldWorker.SaveBroadCastText(_bct1); } if (_bct2 != null) { WorldWorker.SaveBroadCastText(_bct2); } if (_bct3 != null) { WorldWorker.SaveBroadCastText(_bct3); } if (_bct4 != null) { WorldWorker.SaveBroadCastText(_bct4); } if (_bct5 != null) { WorldWorker.SaveBroadCastText(_bct5); } if (_bct6 != null) { WorldWorker.SaveBroadCastText(_bct6); } if (_bct7 != null) { WorldWorker.SaveBroadCastText(_bct7); } SaveGossipItems(); LegacyToolBox.AppendMessage("Gossip Menu " + _SelectedGossipMenu.entry + " Saved."); e.Handled = true; } }