예제 #1
0
        public static bool TrySkill(string name, CharBuffTimer cbt, BuffTargetClass bft)
        {
            uint tmp_id;
            if (System.String.Equals("PET", name.ToUpperInvariant()))
            {
                tmp_id = Globals.gamedata.my_pet.ID;
            }
            if (System.String.Equals("PET1", name.ToUpperInvariant()))
            {
                tmp_id = Globals.gamedata.my_pet1.ID;
            }
            if (System.String.Equals("PET2", name.ToUpperInvariant()))
            {
                tmp_id = Globals.gamedata.my_pet2.ID;
            }
            if (System.String.Equals("PET3", name.ToUpperInvariant()))
            {
                tmp_id = Globals.gamedata.my_pet3.ID;
            }
            else
            {
                tmp_id = Util.GetCharID(name);
            }

            if (Util.Distance(tmp_id) > bft.Range)
            {
                //cant buff them now
                //Globals.gamedata.my_char.BuffTarget = 0;
                return false;
            }
            else
            {
                //do we actually need a target?
                Globals.gamedata.my_char.LastBuffTime = System.DateTime.Now;
                Globals.gamedata.my_char.BuffSkillID = bft.SkillID;
                Globals.gamedata.my_char.BuffTarget = tmp_id;
                Globals.gamedata.my_char.LastTarget = Globals.gamedata.my_char.TargetID;

                Globals.gamedata.BOT_STATE = BotState.Buffing;

                if (bft.NeedTarget == 1)
                {
                    Globals.gamedata.my_char.BuffNeedTarget = 1;

                    if (!Globals.gamedata.my_char.CanBuff())
                    {
                        int x = 0, y = 0, z = 0;
                        Util.GetCharLoc(Globals.gamedata.my_char.BuffTarget, ref x, ref y, ref z);
                        Target(Globals.gamedata.my_char.BuffTarget, x, y, z, false);
                    }
                }
                else
                {
                    Globals.gamedata.my_char.BuffNeedTarget = 0;
                }

                return true;
            }
        }
예제 #2
0
        private void button_save_Click(object sender, System.EventArgs e)
        {
            //save out the options
            ////////////////////////PARTY OPTIONS
            if (checkBox_activefollow.Checked)
                Globals.gamedata.botoptions.ActiveFollow = 1;
            else
                Globals.gamedata.botoptions.ActiveFollow = 0;

            Globals.gamedata.botoptions.Set_ActiveFollow(textBox_activefollow_name.Text);

            if (radioButton_ActiveFollow_style1.Checked)
                Globals.gamedata.botoptions.ActiveFollowStyle = 1;//walker style
            else
                Globals.gamedata.botoptions.ActiveFollowStyle = 0;//l2.net style

            Globals.gamedata.botoptions.ActiveFollowDistance = Util.GetInt32(textBox_ActiveFollow_Dist.Text);

            if (checkBox_activefollow_attack.Checked)
                Globals.gamedata.botoptions.ActiveFollowAttack = 1;
            else
                Globals.gamedata.botoptions.ActiveFollowAttack = 0;

            if (checkBox_activefollow_attack_Instant.Checked)
                Globals.gamedata.botoptions.ActiveFollowAttackInstant = 1;
            else
                Globals.gamedata.botoptions.ActiveFollowAttackInstant = 0;

            if (checkBox_activefollow_target.Checked)
                Globals.gamedata.botoptions.ActiveFollowTarget = 1;
            else
                Globals.gamedata.botoptions.ActiveFollowTarget = 0;

            if (checkBox_autosweep.Checked)
                Globals.gamedata.botoptions.AutoSweep = 1;
            else
                Globals.gamedata.botoptions.AutoSweep = 0;

            if (checkBox_autospoil.Checked)
                Globals.gamedata.botoptions.AutoSpoil = 1;
            else
                Globals.gamedata.botoptions.AutoSpoil = 0;

            if (checkBox_UntilSuccess.Checked)
                Globals.gamedata.botoptions.AutoSpoilUntilSuccess = 1;
            else
                Globals.gamedata.botoptions.AutoSpoilUntilSuccess = 0;

            Globals.gamedata.botoptions.SpoilMPAbove = System.Convert.ToInt32(textBox_spoil_mp.Text);

            if (checkBox_spoilcrush.Checked)
                Globals.gamedata.botoptions.SpoilCrush = 1;
            else
                Globals.gamedata.botoptions.SpoilCrush = 0;

            if (checkBox_use_plunder.Checked)
                Globals.gamedata.botoptions.Plunder = 1;
            else
                Globals.gamedata.botoptions.Plunder = 0;

            if (checkBox_ignoreitems.Checked)
                Globals.gamedata.botoptions.IgnoreItems = 1;
            else
                Globals.gamedata.botoptions.IgnoreItems = 0;

            if (checkBox_PickOnly.Checked)
                Globals.gamedata.botoptions.PickOnlyItemsInList = 1;
            else
                Globals.gamedata.botoptions.PickOnlyItemsInList = 0;

            if (checkBox_AttackOnly.Checked)
                Globals.gamedata.botoptions.AttackOnlyMobsInList = 1;
            else
                Globals.gamedata.botoptions.AttackOnlyMobsInList = 0;

            if (checkBox_ignore_no_mesh.Checked)
                Globals.gamedata.botoptions.IgnoreMeshlessItems = 1;
            else
                Globals.gamedata.botoptions.IgnoreMeshlessItems = 0;

            Globals.gamedata.botoptions.HealRange = Util.GetInt32(textBox_buffrange.Text);

            if (checkBox_accept_party.Checked)
                Globals.gamedata.botoptions.AcceptParty = 1;
            else
                Globals.gamedata.botoptions.AcceptParty = 0;

            Globals.gamedata.botoptions.AcceptPartyNames = textBox_accept_party.Text;

            if (checkBox_auto_invite.Checked)
                Globals.gamedata.botoptions.SendParty = 1;
            else
                Globals.gamedata.botoptions.SendParty = 0;

            Globals.gamedata.botoptions.SendPartyNames = textBox_auto_invite.Text;

            if (checkBox_oop.Checked)
                Globals.gamedata.botoptions.OOP = 1;
            else
                Globals.gamedata.botoptions.OOP = 0;
            Globals.gamedata.botoptions.OOPNames = textBox_oop.Text;

            if (checkBox_drop_leader.Checked)
                Globals.gamedata.botoptions.LeavePartyOnLeader = 1;
            else
                Globals.gamedata.botoptions.LeavePartyOnLeader = 0;

            if (checkBox_accept_rez_clan.Checked)
                Globals.gamedata.botoptions.AcceptRezClan = 1;
            else
                Globals.gamedata.botoptions.AcceptRezClan = 0;

            if (checkBox_accept_rez_Party.Checked)
                Globals.gamedata.botoptions.AcceptRezParty = 1;
            else
                Globals.gamedata.botoptions.AcceptRezParty = 0;

            if (checkBox_accept_rez_alliance.Checked)
                Globals.gamedata.botoptions.AcceptRezAlly = 1;
            else
                Globals.gamedata.botoptions.AcceptRezAlly = 0;

            if (checkBox_accept_party_clan.Checked)
                Globals.gamedata.botoptions.AcceptPartyClan = 1;
            else
                Globals.gamedata.botoptions.AcceptPartyClan = 0;

            if (checkBox_accept_party_alliance.Checked)
                Globals.gamedata.botoptions.AcceptPartyAlly = 1;
            else
                Globals.gamedata.botoptions.AcceptPartyAlly = 0;

            

            //set up oops ID
            Globals.gamedata.botoptions.OOPIDs = new ArrayList();
            Globals.gamedata.botoptions.OOPNamesArray = Util.GetArray(Globals.gamedata.botoptions.OOPNames);
            Globals.gamedata.botoptions.OOPIDs = new System.Collections.ArrayList();

            if (Globals.gamedata.botoptions.OOPNamesArray.Count > 0)
            {
                Globals.PlayerLock.EnterReadLock();
                try
                {
                    foreach (Player_Info player in Globals.gamedata.nearby_chars.Values)
                    {
                        if (Globals.gamedata.botoptions.OOPNamesArray.Contains(player.Name.ToUpperInvariant()))
                        {
                            Globals.gamedata.botoptions.OOPIDs.Add(player.ID);
                        }
                    }
                }
                catch
                {
                    //oops
                }
                finally
                {
                    Globals.PlayerLock.ExitReadLock();
                }
            }
            /*********** Rest Options **************/
            /* Rest Below */
            if (checkBox_RestBelowHP.Checked)
            {
                Globals.gamedata.botoptions.RestBelowHP = 1;
                try
                {
                    Globals.gamedata.botoptions.RestBelowHealth = (Globals.gamedata.my_char.Max_HP * (float)numericUpDown_RestBelowHP.Value / 100);
                }
                catch
                {
                    Globals.l2net_home.Add_Error("Invalid rest below HP value, please enter a number between 0 and 100");
                }
                Globals.l2net_home.Add_Text("Rest Below " + Globals.gamedata.botoptions.RestBelowHealth.ToString() + " HP", Globals.Green, TextType.BOT);
            }
            else
                Globals.gamedata.botoptions.RestBelowHP = 0;

            if (checkBox_RestBelowMP.Checked)
            {
                Globals.gamedata.botoptions.RestBelowMP = 1;
                try
                {
                    Globals.gamedata.botoptions.RestBelowMana = (Globals.gamedata.my_char.Max_MP * (float)numericUpDown_RestBelowMP.Value / 100);
                }
                catch
                {
                    Globals.l2net_home.Add_Error("Invalid rest below MP value, please enter a number between 0 and 100");
                }
                Globals.l2net_home.Add_Text("Rest Below " + Globals.gamedata.botoptions.RestBelowMana.ToString() + " MP", Globals.Green, TextType.BOT);
            }
            else
                Globals.gamedata.botoptions.RestBelowMP = 0;

            /* Rest Until */
            if (checkBox_RestUntilHP.Checked)
            {
                /*
                Globals.gamedata.botoptions.RestUntilHP = 1;
                */
                try
                {
                    Globals.gamedata.botoptions.RestUntilHealth = (Globals.gamedata.my_char.Max_HP * (float)numericUpDown_RestUntilHP.Value / 100);
                }
                catch
                {
                    Globals.l2net_home.Add_Error("Invalid rest until HP value, please enter a number between 0 and 100");
                }
                Globals.l2net_home.Add_Text("Rest Until " + Globals.gamedata.botoptions.RestUntilHealth.ToString() + " HP", Globals.Green, TextType.BOT);
            }
            else
            {
                /*
                Globals.gamedata.botoptions.RestUntilHP = 0;
                 */
                Globals.gamedata.botoptions.RestUntilHealth = Globals.gamedata.my_char.Max_HP;
            }

            if (checkBox_RestUntilMP.Checked)
            {
                /*
                Globals.gamedata.botoptions.RestUntilMP = 1;
                */
                try
                {
                    Globals.gamedata.botoptions.RestUntilMana = (Globals.gamedata.my_char.Max_MP * (float)numericUpDown_RestUntilMP.Value / 100);
                }
                catch
                {
                    Globals.l2net_home.Add_Error("Invalid rest until MP value, please enter a number between 0 and 100");
                }
                Globals.l2net_home.Add_Text("Rest Until " + Globals.gamedata.botoptions.RestUntilMana.ToString() + " MP", Globals.Green, TextType.BOT);
            }
            else
            {
                /*
                Globals.gamedata.botoptions.RestUntilMP = 0;
                 */
                Globals.gamedata.botoptions.RestUntilMana = Globals.gamedata.my_char.Max_MP;
            }


            /* Follow Rest */
            if (checkBox_FollowRest.Checked)
                Globals.gamedata.botoptions.FollowRest = 1;
            else
                Globals.gamedata.botoptions.FollowRest = 0;
            Globals.gamedata.botoptions.Set_FollowRest(textBox_FollowRestName.Text); //ActiveFollow(textBox_activefollow_name.Text);

            /* Stuck Check */
            if (checkBox_StuckCheck.Checked)
                Globals.gamedata.botoptions.StuckCheck = 1;
            else
                Globals.gamedata.botoptions.StuckCheck = 0;

            /* Auto Blacklist */
            if (checkBox_AutoBlacklist.Checked)
                Globals.gamedata.botoptions.AutoBlacklist = 1;
            else
                Globals.gamedata.botoptions.AutoBlacklist = 0;


            /*************************/

            if (checkBox_accept_rez.Checked)
                Globals.gamedata.botoptions.AcceptRez = 1;
            else
                Globals.gamedata.botoptions.AcceptRez = 0;

            Globals.gamedata.botoptions.AcceptRezNames = textBox_accept_rez.Text;

            if (checkBox_active_target.Checked)
                Globals.gamedata.botoptions.Target = 1;
            else
                Globals.gamedata.botoptions.Target = 0;

            if (checkBox_cancel_target.Checked)
                Globals.gamedata.botoptions.Cancel_Target = 1;
            else
                Globals.gamedata.botoptions.Cancel_Target = 0;

            //move to location stuff
            if (checkBox_MoveToLoc.Checked)
                Globals.gamedata.botoptions.MoveToLoc = 1;
            else
                Globals.gamedata.botoptions.MoveToLoc = 0;

            if (checkBox_OutOfCombat.Checked)
                Globals.gamedata.botoptions.OutOfCombat = 1;
            else
                Globals.gamedata.botoptions.OutOfCombat = 0;

            Globals.gamedata.botoptions.Moveto_X = textBox_Moveto_X.Text;
            Globals.gamedata.botoptions.Moveto_Y = textBox_Moveto_Y.Text;
            Globals.gamedata.botoptions.Moveto_Z = textBox_Moveto_Z.Text;
            Globals.gamedata.botoptions.MoveToLeash = System.Convert.ToInt32(textBox_MoveToLeash.Text);


            if (checkBox_active_attack.Checked)
                Globals.gamedata.botoptions.Attack = 1;
            else
                Globals.gamedata.botoptions.Attack = 0;

            if (checkBox_pet_autoassist.Checked)
                Globals.gamedata.botoptions.PetAssist = 1;
            else
                Globals.gamedata.botoptions.PetAssist = 0;

            if (checkBox_Summon_autoassist.Checked)
                Globals.gamedata.botoptions.SummonAssist = 1;
            else
                Globals.gamedata.botoptions.SummonAssist = 0;

            if (checkBox_pet_soloattack.Checked)
                Globals.gamedata.botoptions.PetAttackSolo = 1;
            else
                Globals.gamedata.botoptions.PetAttackSolo = 0;

            if (checkBox_summon_instantattack.Checked)
                Globals.gamedata.botoptions.SummonInstantAttack = 1;
            else
                Globals.gamedata.botoptions.SummonInstantAttack = 0;

            if (checkBox_active_move_first.Checked)
                Globals.gamedata.botoptions.MoveFirst = 1;
            else
                Globals.gamedata.botoptions.MoveFirst = 0;

            Globals.gamedata.botoptions.MoveRange = Util.GetInt32(textBox_active_move_range.Text);

            if (checkBox_pickup.Checked)
                Globals.gamedata.botoptions.Pickup = 1;
            else
                Globals.gamedata.botoptions.Pickup = 0;

            if (checkBox_PickupAfterAttack.Checked)
                Globals.gamedata.botoptions.PickupAfterAttack = 1;
            else
                Globals.gamedata.botoptions.PickupAfterAttack = 0;

            if (checkBox_OnlyPickMine.Checked)
                Globals.gamedata.botoptions.OnlyPickMine = 1;
            else
                Globals.gamedata.botoptions.OnlyPickMine = 0;

            Globals.gamedata.botoptions.LootRange = Util.GetInt32(textBox_pickup_range.Text);

            if (checkBox_buff_control.Checked)
                Globals.gamedata.botoptions.ControlBuffing = 1;
            else
                Globals.gamedata.botoptions.ControlBuffing = 0;

            if (checkBox_buff_shift.Checked)
                Globals.gamedata.botoptions.ShiftBuffing = 1;
            else
                Globals.gamedata.botoptions.ShiftBuffing = 0;

            if (checkBox_portect_priority.Checked)
                Globals.gamedata.botoptions.ProtectPriority = 1;
            else
                Globals.gamedata.botoptions.ProtectPriority = 0;

            BotOptions.Target_ZRANGE = Util.GetInt32(textBox_zrange.Text);

            ////////////////////////BUFF OPTIONS
            Globals.BuffListLock.EnterWriteLock();
            try
            {
                BotOptions.BuffTargets.Clear();

                string inp, tmp;

                foreach (System.Windows.Forms.ListViewItem lv in listView_buffheal.CheckedItems)
                {
                    BuffTargetClass btc = new BuffTargetClass();

                    btc.Active = lv.Checked;
                    btc.Type = (BuffTriggers)Util.GetInt32(lv.SubItems[7].Text);
                    btc.SkillID = Util.GetUInt32(lv.SubItems[8].Text);
                    btc.Min_Per = Util.GetInt32(lv.SubItems[3].Text);
                    btc.TickDuration = Util.GetInt64(lv.SubItems[4].Text) * TimeSpan.TicksPerSecond;
                    btc.Min_MP = Util.GetInt32(lv.SubItems[5].Text);
                    btc.NeedTarget = Util.GetInt32(lv.SubItems[6].Text);

                    btc.TargetNames.Clear();

                    //set the names
                    inp = lv.SubItems[2].Text;
                    while (inp.Length > 0)
                    {
                        int pipe;
                        pipe = inp.IndexOf(';');
                        if (pipe == -1)
                        {
                            tmp = inp;
                            inp = "";
                            tmp = tmp.ToUpperInvariant();
                            btc.TargetNames.Add(tmp);
                        }
                        else
                        {
                            tmp = inp.Substring(0, pipe);
                            inp = inp.Remove(0, pipe + 1);
                            tmp = tmp.ToUpperInvariant();
                            btc.TargetNames.Add(tmp);
                        }
                    }

                    BotOptions.BuffTargets.Add(btc);
                }
            }//unlock
            finally
            {
                Globals.BuffListLock.ExitWriteLock();
            }

            ////////////////////////ITEM OPTIONS
            Globals.ItemListLock.EnterWriteLock();
            try
            {
                BotOptions.ItemTargets.Clear();

                foreach (System.Windows.Forms.ListViewItem lv in listView_item.CheckedItems)
                {
                    ItemTargetClass it;

                    it = new ItemTargetClass();
                    it.Active = lv.Checked;
                    it.Type = (BuffTriggers)Util.GetInt32(lv.SubItems[4].Text);
                    it.ItemID = Util.GetUInt32(lv.SubItems[5].Text);
                    it.Min_Per = Util.GetInt32(lv.SubItems[2].Text);
                    it.TickDuration = ((long)Util.GetInt32(lv.SubItems[3].Text)) * System.TimeSpan.TicksPerMillisecond;

                    BotOptions.ItemTargets.Add(it);
                }

            }
            finally
            {
                Globals.ItemListLock.ExitWriteLock();
            }
            ////////////////////////COMBAT OPTIONS
            Globals.CombatListLock.EnterWriteLock();
            try
            {
                BotOptions.CombatTargets.Clear();

                foreach (System.Windows.Forms.ListViewItem lv in listView_combat.CheckedItems)
                {
                    CombatTargetClass ct;

                    ct = new CombatTargetClass();
                    ct.Active = lv.Checked;
                    ct.Type = (BuffTriggers)Util.GetInt32(lv.SubItems[6].Text);
                    ct.Conditional = Util.GetInt32(lv.SubItems[7].Text);
                    ct.ShortCutID = Util.GetInt32(lv.SubItems[8].Text);
                    ct.Min_Per = Util.GetInt32(lv.SubItems[2].Text);
                    ct.Min_MP = Util.GetInt32(lv.SubItems[5].Text);
                    ct.TickDuration = ((long)Util.GetInt32(lv.SubItems[4].Text)) * System.TimeSpan.TicksPerMillisecond;

                    BotOptions.CombatTargets.Add(ct);
                }

            }
            finally
            {
                Globals.CombatListLock.ExitWriteLock();
            }
            ///////////////////////Do Not
            Globals.DoNotItemLock.EnterWriteLock();
            try
            {
                BotOptions.DoNotItems.Clear();

                foreach (System.Windows.Forms.ListViewItem lv in listView_donot_items.Items)
                {
                    if (lv != null)
                    {
                        BotOptions.DoNotItems.Add(Util.GetUInt32(lv.SubItems[0].Text)); //Item ID
                    }
                }

            }
            finally
            {
                Globals.DoNotItemLock.ExitWriteLock();
            }

            Globals.DoNotNPCLock.EnterWriteLock();
            try
            {
                BotOptions.DoNotNPCs.Clear();

                foreach (System.Windows.Forms.ListViewItem lv in listView_donot_npcs.Items)
                {
                    try
                    {
                        if (lv != null)
                        {
                            BotOptions.DoNotNPCs.Add(Util.GetUInt32(lv.SubItems[0].Text));
                        }
                    }
                    catch
                    {

                    }
                }

                if (checkBox_Ign_Raidbosses.Checked)
                {
                    uint tmpID;
                    foreach (uint rbID in RaidBossIDs)
                    {
                        tmpID = rbID; //Meh...
                        if (tmpID < Globals.NPC_OFF)
                        {
                            tmpID += Globals.NPC_OFF;
                        }
                        BotOptions.DoNotNPCs.Add(tmpID);
                    }
                }

                if (checkBox_Ign_Summons.Checked)
                {
                    uint tmpID;
                    foreach (uint smID in SummonIDs)
                    {
                        tmpID = smID; //Meh...
                        if (tmpID < Globals.NPC_OFF)
                        {
                            tmpID += Globals.NPC_OFF;
                        }
                        BotOptions.DoNotNPCs.Add(tmpID);
                    }
                }

                if (checkBox_Ign_TreasureChests.Checked)
                {
                    uint tmpID;
                    foreach (uint chestID in TreasureChestIDs)
                    {
                        tmpID = chestID;
                        if (tmpID < Globals.NPC_OFF)
                        {
                            tmpID += Globals.NPC_OFF;
                        }
                        BotOptions.DoNotNPCs.Add(tmpID);
                    }
                }
            }
            finally
            {
                Globals.DoNotNPCLock.ExitWriteLock();
            }

            ////////////////////////////Bounding Polygon
            Globals.gamedata.Paths.PointList.Clear();

            foreach (System.Windows.Forms.ListViewItem lv in listView_border.Items)
            {
                Point p = new Point();
                p.X = Util.GetInt32(lv.SubItems[0].Text);
                p.Y = Util.GetInt32(lv.SubItems[1].Text);

                Globals.gamedata.Paths.PointList.Add(p);
            }

            //Sound Alerts
            Globals.gamedata.alertoptions.beepon_2waywar = checkBox_2waywar.Checked;
            Globals.gamedata.alertoptions.beepon_1waywar = checkBox_1waywar.Checked;
            Globals.gamedata.alertoptions.beepon_n1waywar = checkBox_n1waywar.Checked;
            Globals.gamedata.alertoptions.beepon_hp = checkBox_hp.Checked;
            Globals.gamedata.alertoptions.beepon_mp = checkBox_mp.Checked;
            Globals.gamedata.alertoptions.beepon_cp = checkBox_cp.Checked;
            Globals.gamedata.alertoptions.beepon_clan = checkBox_clan.Checked;
            Globals.gamedata.alertoptions.beepon_player = checkBox_player.Checked;
            Globals.gamedata.alertoptions.hp_value = Util.GetInt32(textBox_hp.Text);
            Globals.gamedata.alertoptions.mp_value = Util.GetInt32(textBox_mp.Text);
            Globals.gamedata.alertoptions.cp_value = Util.GetInt32(textBox_cp.Text);
            Globals.gamedata.alertoptions.clan_value = textBox_clan.Text;
            Globals.gamedata.alertoptions.player_value = textBox_player.Text;
            Globals.gamedata.alertoptions.beepon_clan_ignoreparty = checkBox_clan_ignore.Checked;
            Globals.gamedata.alertoptions.beepon_player_ignoreparty = checkBox_player_ignore.Checked;
            Globals.gamedata.alertoptions.beepon_whitechat = checkBox_whitechat.Checked;
            Globals.gamedata.alertoptions.beepon_privatemessage = checkBox_privatemessage.Checked;
            Globals.gamedata.alertoptions.beepon_friendchat = checkBox_friendchat.Checked;

            //Logout
            Globals.gamedata.alertoptions.logouton_2waywar = checkBox_2waywar_logout.Checked;
            Globals.gamedata.alertoptions.logouton_1waywar = checkBox_1waywar_logout.Checked;
            Globals.gamedata.alertoptions.logouton_n1waywar = checkBox_n1waywar_logout.Checked;
            Globals.gamedata.alertoptions.logouton_hp = checkBox_hp_logout.Checked;
            Globals.gamedata.alertoptions.logouton_mp = checkBox_mp_logout.Checked;
            Globals.gamedata.alertoptions.logouton_cp = checkBox_cp_logout.Checked;
            Globals.gamedata.alertoptions.logouton_clan = checkBox_clan_logout.Checked;
            Globals.gamedata.alertoptions.logouton_player = checkBox_player_logout.Checked;
            Globals.gamedata.alertoptions.hp_value_logout = Util.GetInt32(textBox_hp_logout.Text);
            Globals.gamedata.alertoptions.mp_value_logout = Util.GetInt32(textBox_mp_logout.Text);
            Globals.gamedata.alertoptions.cp_value_logout = Util.GetInt32(textBox_cp_logout.Text);
            Globals.gamedata.alertoptions.clan_value_logout = textBox_clan_logout.Text;
            Globals.gamedata.alertoptions.player_value_logout = textBox_player_logout.Text;

            //targeting
            if (radioButton_type0.Checked)
                BotOptions.Target_TYPE = 0;
            if (radioButton_type1.Checked)
                BotOptions.Target_TYPE = 1;
            if (radioButton_type2.Checked)
                BotOptions.Target_TYPE = 2;
            if (radioButton_attackable0.Checked)
                BotOptions.Target_ATTACKABLE = 0;
            if (radioButton_attackable1.Checked)
                BotOptions.Target_ATTACKABLE = 1;
            if (radioButton_attackable2.Checked)
                BotOptions.Target_ATTACKABLE = 2;
            if (radioButton_alive0.Checked)
                BotOptions.Target_ALIVE = 0;
            if (radioButton_alive1.Checked)
                BotOptions.Target_ALIVE = 1;
            if (radioButton_alive2.Checked)
                BotOptions.Target_ALIVE = 2;
            if (radioButton_inbox0.Checked)
                BotOptions.Target_INBOX = 0;
            if (radioButton_inbox1.Checked)
                BotOptions.Target_INBOX = 1;
            if (radioButton_inbox2.Checked)
                BotOptions.Target_INBOX = 2;
            if (radioButton_combat0.Checked)
                BotOptions.Target_COMBAT = 0;
            if (radioButton_combat1.Checked)
                BotOptions.Target_COMBAT = 1;
            if (radioButton_combat2.Checked)
                BotOptions.Target_COMBAT = 2;
            //this.Hide();

            //Normal Move Before Attack v385//
            if (checkBox_active_move_first_normal.Checked)
                Globals.gamedata.botoptions.MoveFirstNormal = 1;
            else
                Globals.gamedata.botoptions.MoveFirstNormal = 0;

            //Move before targeting v391
            if (checkBox_movebeforetargeting.Checked)
                Globals.gamedata.botoptions.MoveBeforeTargeting = 1;
            else
                Globals.gamedata.botoptions.MoveBeforeTargeting = 0;

            //Dead logout/return/toggle v391
            if (checkBox_DeadReturn.Checked)
            {
                Globals.gamedata.botoptions.DeadReturn = comboBox_DeadReturn.SelectedIndex;
                Globals.gamedata.botoptions.DeadReturnDelay = System.Convert.ToInt32(textBox_DeadReturnDelay.Text);
            }
            else
            {
                Globals.gamedata.botoptions.DeadReturn = -1;
            }

            if (checkBox_DeadLogOut.Checked)
            {
                Globals.gamedata.botoptions.DeadLogout = 1;
                Globals.gamedata.botoptions.DeadLogoutDelay = System.Convert.ToInt32(textBox_DeadLogOutDelay.Text);
            }
            else
                Globals.gamedata.botoptions.DeadLogout = 0;

            if (checkBox_DeadToggleBotting.Checked)
                Globals.gamedata.botoptions.DeadToggleBotting = 1;
            else
                Globals.gamedata.botoptions.DeadToggleBotting = 0;

            //Advanced
            Globals.gamedata.botoptions.AntiKSDelay = (int)numericUpDown_anti_ks_delay.Value;
            Globals.gamedata.botoptions.AutoFollowDelay = (int)numericUpDown_autofollow_delay.Value;
            Globals.gamedata.botoptions.BlacklistTries = (int)numericUpDown_blacklist_tries.Value;
            Globals.gamedata.botoptions.PickupTimeout = (int)numericUpDown_pickuptimeout.Value;


            //Loot Type v386
            if (comboBox_LootType.SelectedIndex == 0)
            {
                Globals.gamedata.LootType = 0;
            }
            else if (comboBox_LootType.SelectedIndex == 1)
            {
                Globals.gamedata.LootType = 1;
            }
            else if (comboBox_LootType.SelectedIndex == 2)
            {
                Globals.gamedata.LootType = 2;
            }
            else if (comboBox_LootType.SelectedIndex == 3)
            {
                Globals.gamedata.LootType = 3;
            }
            else if (comboBox_LootType.SelectedIndex == 4)
            {
                Globals.gamedata.LootType = 4;
            }
            else
            {
                Globals.gamedata.LootType = 0;
            }

            // Content Filter
            if (cf_targetselected.Checked)
                Globals.lagfilter_TargetSelected = true;
            else
                Globals.lagfilter_TargetSelected = false;

            if (cf_targetunselected.Checked)
                Globals.lagfilter_TargetUnselected = true;
            else
                Globals.lagfilter_TargetUnselected = false;

            if (cf_filtermagicskill.Checked)
                Globals.lagfilter_Skills = true;
            else
                Globals.lagfilter_Skills = false;

            if (cf_ExBrExtraUserInfo.Checked)
                Globals.lagfilter_ExBrExtraUserInfo = true;
            else
                Globals.lagfilter_ExBrExtraUserInfo = false;

            if (cf_striptitle.Checked)
                Globals.lagfilter_xf_ci_striptitle = true;
            else
                Globals.lagfilter_xf_ci_striptitle = false;

            if (cf_stripenchant.Checked)
                Globals.lagfilter_xf_ci_stripenchant = true;
            else
                Globals.lagfilter_xf_ci_stripenchant = false;

            if (cf_stripaugment.Checked)
                Globals.lagfilter_xf_ci_stripaug = true;
            else
                Globals.lagfilter_xf_ci_stripaug = false;

            if (cf_zerononvisible.Checked)
                Globals.lagfilter_xf_ci_stripunseen = true;
            else
                Globals.lagfilter_xf_ci_stripunseen = false;

            if (cf_one_gender.Checked)
                Globals.lagfilter_xf_ci_simple_gender = true;
            else
                Globals.lagfilter_xf_ci_simple_gender = false;

            if (cf_simple_appearance.Checked)
                Globals.lagfilter_xf_ci_simple_apperance = true;
            else
                Globals.lagfilter_xf_ci_simple_apperance = false;

            if (cf_norecs.Checked)
                Globals.lagfilter_xf_ci_striprecs = true;
            else
                Globals.lagfilter_xf_ci_striprecs = false;

            if (cf_dwarfmode.Checked)
                Globals.lagfilter_xf_ci_simple_race = true;
            else
                Globals.lagfilter_xf_ci_simple_race = false;

        }