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); }
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 SaveRecipe() { // save spell SpellTemplate spell = WorldWorker.CreateSpell(LegacyToolBox.Data.Spell); recipeSpellEntry.Text = spell.ID.ToString(); ProfessionDefine define = type.SelectedItem as ProfessionDefine; spell.Attributes[0] = 0x10030; spell.Attributes[1] = 0x400; spell.Icon = (uint)define.SpellIcon; spell.Visual[0] = (uint)define.SpellVisual; spell.Name = recipeItemName.Text; spell.CastingTime = 22; // 3.5 sec spell.InterruptFlags = 17; spell.ProcChance = 101; spell.TotemCategory[0] = Convert.ToInt32(rt1.SelectedValue); spell.TotemCategory[1] = Convert.ToInt32(rt2.SelectedValue); spell.Totem[0] = Convert.ToInt32(rti1.Text); spell.Totem[1] = Convert.ToInt32(rti2.Text); spell.RequiredSpellFocus = Convert.ToUInt32(rf.Text); spell.Effect[0] = 24; spell.EffectTargetA[0] = 1; spell.EffectItemType[0] = Convert.ToUInt32(i1i.Text); spell.EffectBasePoints[0] = Convert.ToInt32(i1c.Text) - 1; spell.EffectDieSides[0] = 1; spell.Reagent[0] = Convert.ToInt32(r1i.Text); spell.Reagent[1] = Convert.ToInt32(r2i.Text); spell.Reagent[2] = Convert.ToInt32(r3i.Text); spell.Reagent[3] = Convert.ToInt32(r4i.Text); spell.Reagent[4] = Convert.ToInt32(r5i.Text); spell.Reagent[5] = Convert.ToInt32(r6i.Text); spell.Reagent[6] = Convert.ToInt32(r7i.Text); spell.Reagent[7] = Convert.ToInt32(r8i.Text); spell.ReagentCount[0] = Convert.ToUInt32(r1c.Text); spell.ReagentCount[1] = Convert.ToUInt32(r2c.Text); spell.ReagentCount[2] = Convert.ToUInt32(r3c.Text); spell.ReagentCount[3] = Convert.ToUInt32(r4c.Text); spell.ReagentCount[4] = Convert.ToUInt32(r5c.Text); spell.ReagentCount[5] = Convert.ToUInt32(r6c.Text); spell.ReagentCount[6] = Convert.ToUInt32(r7c.Text); spell.ReagentCount[7] = Convert.ToUInt32(r8c.Text); WorldWorker.SaveSpell(LegacyToolBox.Data.Spell); // save item - only recipe. item_template item = WorldWorker.CreateItemTemplate(LegacyToolBox.Data.ItemTemplate); item.name = define.Prefix + recipeItemName.Text; item.description = "教你学会制作" + recipeItemName.Text + "。"; item.displayid = define.DisplayID; item.RequiredSkill = define.SkillLine; item.RequiredSkillRank = Convert.ToInt32(rs.Text); item.@class = 9; item.subclass = (byte)define.RecipeSubClass; item.AllowableClass = -1; item.AllowableRace = -1; item.Flags = 64; item.Quality = 1; item.spellid_1 = 483; item.spelltrigger_1 = 0; item.spellcharges_1 = -1; item.spellid_2 = Convert.ToInt32(recipeSpellEntry.Text); item.spelltrigger_2 = 6; WorldWorker.SaveItemTemplate(item); // save skillline SkillLinePanel.AddToSkill((int)spell.ID, Convert.ToInt32(type.SelectedValue), Convert.ToInt32(recipeRequiredSkillValue.Text), Convert.ToInt32(recipeSkillGoYellow.Text), Convert.ToInt32(recipeSkillGoGray.Text)); }