Ejemplo n.º 1
0
 private void IDBox_TextChanged(object sender, EventArgs e)
 {
     SelectedQuest.ID = (uint)IDBox.GetValue();
     BindingSource.ResetBindings(false);
 }
Ejemplo n.º 2
0
        private void StoreData()
        {
            // Base info
            SelectedQuest.StartCondition.IsEnabled = IsEnabledBox.Text == @"True";
            SelectedQuest.ID             = (uint)IDBox.GetValue();
            SelectedQuest.Title.ID       = (uint)TitleBox.GetValue();
            SelectedQuest.Description.ID = (uint)DescriptionBox.GetValue();
            SelectedQuest.Region         = Convert.ToByte(RegionBox.GetValue());
            SelectedQuest.QuestType      = (QuestType)QuestTypeBox.SelectedIndex;
            SelectedQuest.IsRepeatAble   = IsRepeatableBox.Text == @"True";
            SelectedQuest.IsDailyQuest   = IsDailyQuestBox.Text == @"True";
            SelectedQuest.DailyType      = (DailyType)DailyQuestTypeBox.SelectedIndex;

            // Start info
            SelectedQuest.StartCondition.IsInstantAccept    = StartIsInstantAcceptBox.Text == @"True";
            SelectedQuest.StartCondition.IsWaitListView     = StartIsWaitListViewBox.Text == @"True";
            SelectedQuest.StartCondition.IsWaitListProgress = StartIsWaitListProgressBox.Text == @"True";
            SelectedQuest.StartCondition.NeedsLevel         = StartNeedsLevelBox.Text == @"True";
            SelectedQuest.StartCondition.LevelMin           = (byte)StartMinLevelBox.GetValue();
            SelectedQuest.StartCondition.LevelMax           = (byte)StartMaxLevelBox.GetValue();
            SelectedQuest.StartCondition.NeedsNPC           = StartNeedsNPCBox.Text == @"True";
            SelectedQuest.StartCondition.NPC.ID             = (ushort)StartNPCIDBox.GetValue();
            SelectedQuest.StartCondition.NeedsItem          = StartNeedsItemBox.Text == @"True";
            SelectedQuest.StartCondition.Item.ID            = (ushort)StartItemIDBox.GetValue();
            SelectedQuest.StartCondition.Item.Lot           = (ushort)StartItemLotBox.GetValue();
            SelectedQuest.StartCondition.NeedsLocation      = StartNeedsLocationBox.Text == @"True";
            SelectedQuest.StartCondition.Location           = (ushort)StartLocationBox.GetValue();
            SelectedQuest.StartCondition.LocationX          = (uint)StartXBox.GetValue();
            SelectedQuest.StartCondition.LocationY          = (uint)StartYBox.GetValue();
            SelectedQuest.StartCondition.LocationRange      = (uint)StartRangeBox.GetValue();
            SelectedQuest.StartCondition.Unk3 = (int)StartUnkBox.GetValue();
            SelectedQuest.StartCondition.NeedsPreviousQuest = StartNeedsQuestBox.Text == @"True";
            SelectedQuest.StartCondition.PreviousQuestID    = (ushort)StartPreviousQuestBox.GetValue();
            SelectedQuest.StartCondition.NeedsRace          = StartNeedsRaceBox.Text == @"True";
            SelectedQuest.StartCondition.Race        = (Race)StartRaceBox.SelectedIndex;
            SelectedQuest.StartCondition.NeedsClass  = StartNeedsClassBox.Text == @"True";
            SelectedQuest.StartCondition.Class       = (Class)StartClassBox.SelectedIndex;
            SelectedQuest.StartCondition.NeedsGender = StartNeedsGenderBox.Text == @"True";
            SelectedQuest.StartCondition.Gender      = (Gender)StartGenderBox.SelectedIndex;
            SelectedQuest.StartCondition.NeedsDate   = StartNeedsDateBox.Text == @"True";
            SelectedQuest.StartCondition.DateMode    = (DateMode)StartDateModeBox.SelectedIndex;
            SelectedQuest.StartCondition.DateStart   = (long)StartDateStartBox.GetValue();
            SelectedQuest.StartCondition.DateEnd     = (long)StartDateEndBox.GetValue();

            // End info
            SelectedQuest.EndCondition.IsInstantHandIn = EndIsInstantHandInBox.Text == @"True";
            SelectedQuest.EndCondition.NeedsLevel      = EndNeedsLevelBox.Text == @"True";
            SelectedQuest.EndCondition.Level           = (byte)EndLevelBox.GetValue();
            SelectedQuest.EndCondition.NeedsLocation   = EndNeedsLocationBox.Text == @"True";
            SelectedQuest.EndCondition.Location        = (ushort)EndLocationBox.GetValue();
            SelectedQuest.EndCondition.LocationX       = (uint)EndXBox.GetValue();
            SelectedQuest.EndCondition.LocationY       = (uint)EndYBox.GetValue();
            SelectedQuest.EndCondition.LocationRange   = (uint)EndRangeBox.GetValue();
            SelectedQuest.EndCondition.Unk7            = (int)EndUnkBox.GetValue();
            SelectedQuest.EndCondition.NeedsScenario   = EndNeedsScenarioBox.Text == @"True";
            SelectedQuest.EndCondition.ScenarioID      = (ushort)EndScenarioIDBox.GetValue();
            SelectedQuest.EndCondition.NeedsRace       = EndNeedsRaceBox.Text == @"True";
            SelectedQuest.EndCondition.Race            = (Race)EndRaceBox.SelectedIndex;
            SelectedQuest.EndCondition.NeedsClass      = EndNeedsClassBox.Text == @"True";
            SelectedQuest.EndCondition.Class           = (Class)EndClassBox.SelectedIndex;
            SelectedQuest.EndCondition.HasTimeLimit    = EndHasTimeLimitBox.Text == @"True";
            SelectedQuest.EndCondition.TimeLimit       = (ushort)EndTimeLimitBox.GetValue();

            // Scripts
            SelectedQuest.StartScript     = StartScriptBox.Text;
            SelectedQuest.StartScriptSize = (ushort)(StartScriptBox.Text.Length + 1);

            SelectedQuest.DoingScript     = ActiveScriptBox.Text;
            SelectedQuest.DoingScriptSize = (ushort)(ActiveScriptBox.Text.Length + 1);

            SelectedQuest.EndScript     = EndScriptBox.Text;
            SelectedQuest.EndScriptSize = (ushort)(EndScriptBox.Text.Length + 1);

            // Rewards
            StoreRewards();
        }