示例#1
0
        private void type_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ProfessionDefine define = type.SelectedItem as ProfessionDefine;

            rt1.SelectedValue = define.TotemCategory1;
            rt2.SelectedValue = define.TotemCategory2;
            rti1.Text         = define.Totem1.ToString();
            rti2.Text         = define.Totem2.ToString();
            rf.Text           = define.SpellFocus.ToString();
        }
示例#2
0
        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));
        }